mbox series

[0/4] various /dev/mem related cleanup

Message ID 20181115232517.4588-1-leif.lindholm@linaro.org
Headers show
Series various /dev/mem related cleanup | expand

Message

Leif Lindholm Nov. 15, 2018, 11:25 p.m. UTC
The ARM architectures don't have a standardised memory map, making any
use of /dev/mem an exercise in to easiest cause denial-of-service to an
otherwise stable system.

Since there are proper kernel interfaces for both ACPI and SMBIOS these
days, turn fwts_mmap/fwts_munmap to hard-wired error returns on aarch64.

Get rid of fwts_memcpy_unaligned, which was added only to work around
that the kernel was saying "this is not normal memory", and has no effect
once dmicheck stops using /dev/mem on aarch64.

Then do a simple shuffle to use the /sys interface over /dev/mem on all
architectures, where present.

Leif Lindholm (4):
  lib: disable /dev/mem access on aarch64
  dmicheck: drop unaligned memcpy
  lib: drop fwts_memcpy_unaligned
  dmicheck: use dmi_load_file in preference to fwts_mmap

 src/dmi/dmicheck/dmicheck.c         | 49 +++++++++++++++++++------------------
 src/lib/include/fwts.h              |  3 +++
 src/lib/include/fwts_stringextras.h |  1 -
 src/lib/src/fwts_mmap.c             | 13 ++++++++++
 src/lib/src/fwts_stringextras.c     | 15 ------------
 5 files changed, 41 insertions(+), 40 deletions(-)