Kernel: Fix enum of sysconf values to be in the correct order

This prevented from dmidecode to get the right PAGE_SIZE when using the
sysconf syscall.

I found this bug, when I tried to figure why dmidecode fails to mmap
/dev/mem when I passed --no-procfs, and the conclusion is that it tried
to mmap unaligned physical address 0xf5ae0 (SMBIOS data), and that was
caused by a wrong value returned after using the sysconf syscall to get
the plaform page size, therefore, allowing to send an unaligned address
to the mmap syscall.
This commit is contained in:
Liav A 2021-01-29 20:28:19 +02:00 committed by Andreas Kling
parent a9d1ddb1a5
commit a1e20aa04f

View file

@ -60,8 +60,8 @@ enum {
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_OPEN_MAX,
_SC_PAGESIZE,
_SC_TTY_NAME_MAX,
_SC_PAGESIZE,
};
#define PERF_EVENT_SAMPLE 0