dmidecode crashes R27.1 on TX2

My Jetson TX2 freshly installed with Jetpack 3.0 immediately crashes and reboots whenever the dmidecode utility is run.

I have also verified the problem is not fixed by installing the latest Ubuntu updates.

The dmidecode utility is invoked by various hardware-discovery scripts that we run. Note that on the TX1 the utility produced this output:

root@jetson-tx1:~# dmidecode

dmidecode 3.0

Scanning /dev/mem for entry point.

No SMBIOS nor DMI entry point found, sorry.

root@jetson-tx1:~#

“dmidecode” command is trying to read from address “0xf0000” using “/dev/mem” node. “drivers/char/mem.c” does mmap() on address from userspace and causes SError on accessing this address.
It needs to be fixed in the application.

Below workaround patch can be applied to avoid the kernel crash.

diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 6b1721f…10fe2bb 100644
— a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -80,6 +80,16 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
#else
static inline int range_is_allowed(unsigned long pfn, unsigned long size)
{
+#ifdef CONFIG_ARCH_OR_PLATFORM_TEGRA

  •    //Not allow read/write requests for first 2MB and PFN Invalid
    
  •    if((!pfn_valid(pfn)) && (pfn <= 0x200))
    
  •    {
    
  •            printk(KERN_INFO "Program %s tried to access /dev/mem between %lx->%lx.\n",
    
  •                            current->comm, (pfn << PAGE_SHIFT), ((pfn<<PAGE_SHIFT)+size));
    
  •            return 0;
    
  •    }
    
  •    else
    

+#endif
return 1;
}
#endif