dmidecode error on linux-rpi (aarch64) but not on linux-virt (x86_64)
I noticed a error in the cloud-init logfile on a Raspberry Pi (Alpine Edge, aarch64) when it runs dmidecode to obtain hardware information. I can reproduce the problem by running the following command as user "root":
> dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. /dev/mem: Operation not permitted
However on a VM running linux-virt x86_64 the same commands work:
> dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. SMBIOS 2.8 present. 9 Structures occupying 361 bytes ... ...
The permissions on /dev/mem look the same in both cases and give "root" access to the file:
> ls -l /dev/mem crw-r----- 1 root kmem 1, 1 Aug 26 14:29 /dev/mem
I know recent kernels have lockdown support to restrict access to /dev/mem and /dev/kmem even by the root user but I don't see any sign that lockdown is enabled on either of these machines.
Both the aarch64 linux-rpi and x86_64 linux-virt kernels have the same following kernel config settings:
CONFIG_DEVMEM=y CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y CONFIG_STRICT_DEVMEM=y CONFIG_IO_STRICT_DEVMEM=y CONFIG_DMI=y CONFIG_DMIID=y # CONFIG_DMI_SYSFS is not set
Therefore I'd expect the same/similar behaviour in both cases.
If Raspberry Pi does not actually support DMI I would expect a different error to occur, not a permissions error on /dev/mem.