From 8eb20bdfa2f6e00307a5e7b8243c7eaeac2d245d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 2 Jan 2020 20:11:08 +0100 Subject: [PATCH] Kernel: Move kernel symbols to /res/kernel.map and make it root-only Let's lock down access to the kernel symbol table, since it trivializes learning where the kernel functions are. Of course, you can just build the same revision yourself locally and learn the information, but we're taking one step at a time here. :^) --- Kernel/KSyms.cpp | 2 +- Kernel/build-root-filesystem.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Kernel/KSyms.cpp b/Kernel/KSyms.cpp index 55464d3274..2ab5f84e70 100644 --- a/Kernel/KSyms.cpp +++ b/Kernel/KSyms.cpp @@ -151,7 +151,7 @@ void dump_backtrace() void load_ksyms() { - auto result = VFS::the().open("/kernel.map", 0, 0, VFS::the().root_custody()); + auto result = VFS::the().open("/res/kernel.map", 0, 0, VFS::the().root_custody()); ASSERT(!result.is_error()); auto description = result.value(); auto buffer = description->read_entire_file(); diff --git a/Kernel/build-root-filesystem.sh b/Kernel/build-root-filesystem.sh index 8e713e7a74..b5dceb740f 100755 --- a/Kernel/build-root-filesystem.sh +++ b/Kernel/build-root-filesystem.sh @@ -63,7 +63,8 @@ echo "done" printf "installing base system... " cp -R ../Base/* mnt/ cp -R ../Root/* mnt/ -cp kernel.map mnt/ +cp kernel.map mnt/res/ +chmod 400 mnt/res/kernel.map echo "done" printf "installing users... "