> Reading illegal memory should not crash the system

I think this depends on what the memory is.

I agree 100% for any application-level memory (stuff from regular APIs
like sbrk() or mmap() etc.).

In this case, the application opens /dev/mem, which allows it to access
arbitrary physical memory without restriction. It assumes that a certain
physical memory region can be accessed (the DMI region) and does so. The
HW triggers an SError in this case since no device exists at that
location in memory, since this platform doesn't support DMI. This is
correct HW response to the request. The solution is to prevent SW from
accessing this location.

This issue happens identically if you were to use an upstream kernel
(which does support the HW), or the Ubuntu kernel (assuming it supports
this HW model).

Whether this SW access prevention is implemented in the kernel or the
application may be open for debate. I believe the definition of the
/dev/mem device is such that it does not intend to filter addresses to
prevent applications from accessing invalid HW. As such, I believe it's
up to the application to fix the issue; it should determine whether the
platform supports DMI before explicitly using low-level primitives
(/dev/mem) to attempt to access it.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1821632

Title:
  dmidecode causing system crash

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dmidecode/+bug/1821632/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to