dmidocode.c directly accesses memory and assumes it's an x86 without any
checking that the arch is x86.. Randomly scanning arbitrary hunks of
memory on non-x86 as root will lead to all sorts of woe:

memory_scan:
        if (!(opt.flags & FLAG_QUIET))
                printf("Scanning %s for entry point.\n", opt.devmem);
        /* Fallback to memory scan (x86, x86_64) */
        if ((buf = mem_chunk(0xF0000, 0x10000, opt.devmem)) == NULL)
        {
                ret = 1;
                goto exit_free;
        }

It probably needs wrapping with:

#if defined(__x86_64__) || defined(__x86_64) || \
    defined(__i386__)   || defined(__i386)

...

#endif

Anyhow, I don't think this is a kernel specific issue. I can trigger
this with various kernels - we just don't protect users with
CAP_SYS_ADMIN rights doing crazy probing on /dev/mem.

** Changed in: dmidecode (Ubuntu)
     Assignee: Colin Ian King (colin-king) => (unassigned)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to dmidecode in Ubuntu.
https://bugs.launchpad.net/bugs/1858615

Title:
  dmidecode triggers system reboot on Inforce 6640

Status in cloud-init:
  Invalid
Status in dmidecode package in Ubuntu:
  Triaged

Bug description:
  Device: Inforce 6640
  
https://www.inforcecomputing.com/products/single-board-computers-sbc/qualcomm-snapdragon-820-inforce-6640-sbc
  SoC: Snapdragon 820

  sysname='Linux',
  nodename='ubuntu',
  release='4.15.0-1069-snapdragon', 
  version='#76-Ubuntu SMP Tue Nov 26 16:10:14 UTC 2019', 
  machine='aarch64'

  The issue is caused by following commit.
  Inforce 6640 doesn't have functional demidecode.
  System will reboot when executing dmidecode.

  commit 3416e2ee7f65defdb15aab861a85767d13e8c34c
  Author: Robert Schweikert <rjsch...@suse.com>
  Date: Sat Oct 29 09:29:53 2016 -0400
      dmidecode: Allow dmidecode to be used on aarch64
      aarch64 systems have functional dmidecode, so allow that to be used.
      - aarch64 has support for dmidecode as well

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1858615/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to