summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-01-29 20:28:19 +0200
committerAndreas Kling <kling@serenityos.org>2021-02-01 17:13:23 +0100
commita1e20aa04f3624204f0eff5225ad65869046fced (patch)
tree6d63b6ad407f1695a96e5035d0aafafa0963aa43
parenta9d1ddb1a5c959e2ced29b6906228e695498bdb9 (diff)
downloadserenity-a1e20aa04f3624204f0eff5225ad65869046fced.zip
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.
-rw-r--r--Kernel/UnixTypes.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h
index 271d4a45f0..294b786772 100644
--- a/Kernel/UnixTypes.h
+++ b/Kernel/UnixTypes.h
@@ -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