diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-04 22:53:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-04 23:20:39 +0100 |
commit | a5d89ca5dfa39312862928b542819f05fc40df91 (patch) | |
tree | a77b488135845173115abeeb4f5ac5a9e1604501 /Userland/Services/SymbolServer | |
parent | 3ff7b0ebfeb2839a541e3f6b21e187b947bf3658 (diff) | |
download | serenity-a5d89ca5dfa39312862928b542819f05fc40df91.zip |
SymbolServer+bt: Symbolicate kernel addresses if /boot/Kernel available
The /boot directory is only accessible to root by default, but anyone
wanting access to kernel symbols for development can get them by making
/boot/Kernel accessible to the "symbol" user.
Diffstat (limited to 'Userland/Services/SymbolServer')
-rw-r--r-- | Userland/Services/SymbolServer/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Services/SymbolServer/main.cpp b/Userland/Services/SymbolServer/main.cpp index 8d6e1a2f45..f975f3b37b 100644 --- a/Userland/Services/SymbolServer/main.cpp +++ b/Userland/Services/SymbolServer/main.cpp @@ -49,6 +49,14 @@ int main(int, char**) return 1; } + // NOTE: Developers can opt into kernel symbolication by making /boot/Kernel accessible to the "symbol" user. + if (access("/boot/Kernel", F_OK) == 0) { + if (unveil("/boot/Kernel", "r") < 0) { + perror("unveil"); + return 1; + } + } + if (unveil(nullptr, nullptr) < 0) { perror("unveil"); return 1; |