From e241b47fee775ad9be40c8a219c4ee083ed32947 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 13 Jan 2023 01:02:26 +0200 Subject: [PATCH] Userland: Remove a bunch of unveil calls on /sys/kernel/processes These are not needed anymore since the introduction of the new get_root_session_id syscall. --- Userland/Applets/Audio/main.cpp | 1 - Userland/Applications/3DFileViewer/main.cpp | 1 - Userland/Applications/Browser/main.cpp | 1 - Userland/Applications/Help/main.cpp | 1 - Userland/Applications/HexEditor/main.cpp | 1 - Userland/Applications/Magnifier/main.cpp | 1 - Userland/Applications/Mail/main.cpp | 1 - Userland/Applications/NetworkSettings/main.cpp | 1 - Userland/Applications/PDFViewer/main.cpp | 1 - Userland/Applications/PixelPaint/main.cpp | 1 - Userland/Applications/Spreadsheet/main.cpp | 1 - Userland/Applications/Terminal/main.cpp | 1 - Userland/Applications/TextEditor/main.cpp | 1 - Userland/Applications/ThemeEditor/main.cpp | 1 - Userland/Applications/Welcome/main.cpp | 1 - Userland/Demos/Eyes/main.cpp | 1 - Userland/Demos/WidgetGallery/main.cpp | 1 - Userland/DevTools/GMLPlayground/main.cpp | 1 - Userland/Games/Chess/main.cpp | 1 - Userland/Services/LoginServer/main.cpp | 1 - Userland/Services/SpiceAgent/main.cpp | 1 - Userland/Services/WebContent/main.cpp | 1 - Userland/Services/WebDriver/main.cpp | 1 - Userland/Utilities/aplay.cpp | 1 - Userland/Utilities/logout.cpp | 1 - 25 files changed, 25 deletions(-) diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index 2ec64907eb4..238561c4b8a 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -237,7 +237,6 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domain("AudioApplet"); TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw")); TRY(Core::System::unveil("/res", "r")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil(nullptr, nullptr)); auto window = TRY(GUI::Window::try_create()); diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index 14078998c62..911d7648237 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -370,7 +370,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r")); TRY(Core::System::unveil("/res", "r")); diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 13ab6406b8d..05477647d91 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -88,7 +88,6 @@ ErrorOr serenity_main(Main::Arguments arguments) if (!Browser::g_webdriver_content_ipc_path.is_empty()) specified_urls.empend("about:blank"); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/image", "rw")); diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp index 2a67ad6e36f..20fa5a38093 100644 --- a/Userland/Applications/Help/main.cpp +++ b/Userland/Applications/Help/main.cpp @@ -23,7 +23,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); auto app = TRY(GUI::Application::try_create(arguments)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); // We specifically don't want to load this path from a library, as that can be hijacked with LD_PRELOAD. TRY(Core::System::unveil("/usr/share/man", "r")); diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index ead97342b0e..97cd3e138c3 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -43,7 +43,6 @@ ErrorOr serenity_main(Main::Arguments arguments) return GUI::Window::CloseRequestDecision::StayOpen; }; - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp index 9178f8373e1..b65dbaa53b9 100644 --- a/Userland/Applications/Magnifier/main.cpp +++ b/Userland/Applications/Magnifier/main.cpp @@ -47,7 +47,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Desktop::Launcher::seal_allowlist()); Config::pledge_domain("Magnifier"); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp index 909b80c5caa..9ab66d589c8 100644 --- a/Userland/Applications/Mail/main.cpp +++ b/Userland/Applications/Mail/main.cpp @@ -24,7 +24,6 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domain("Mail"); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/etc", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); diff --git a/Userland/Applications/NetworkSettings/main.cpp b/Userland/Applications/NetworkSettings/main.cpp index a05a0a46350..22354b10bb0 100644 --- a/Userland/Applications/NetworkSettings/main.cpp +++ b/Userland/Applications/NetworkSettings/main.cpp @@ -22,7 +22,6 @@ ErrorOr serenity_main(Main::Arguments args) TRY(Core::System::unveil("/bin/NetworkServer", "x")); TRY(Core::System::unveil("/etc/Network.ini", "rwc")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/sys/kernel/net/adapters", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp index 748ea0a7e81..baf8a231f24 100644 --- a/Userland/Applications/PDFViewer/main.cpp +++ b/Userland/Applications/PDFViewer/main.cpp @@ -34,7 +34,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index 7f3cf01acf5..8ed439bc174 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -31,7 +31,6 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(image_file, "Image file to open", "path", Core::ArgsParser::Required::No); args_parser.parse(arguments); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index 090d2ef8a9a..d6ab7f96d87 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -44,7 +44,6 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); TRY(Core::System::unveil("/etc", "r")); diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 681e9c5b81e..429a8380b7d 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -441,7 +441,6 @@ ErrorOr serenity_main(Main::Arguments arguments) terminal->set_logical_focus(!is_preempted); }; - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/bin", "r")); TRY(Core::System::unveil("/proc", "r")); diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index 08034792fe2..178e3848b30 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -31,7 +31,6 @@ ErrorOr serenity_main(Main::Arguments arguments) parser.add_positional_argument(file_to_edit, "File to edit, with optional starting line and column number", "file[:line[:column]]", Core::ArgsParser::Required::No); parser.parse(arguments); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 7dc1a87bd5f..93498e581ea 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -39,7 +39,6 @@ ErrorOr serenity_main(Main::Arguments arguments) path = Core::File::absolute_path(file_to_edit); TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Applications/Welcome/main.cpp b/Userland/Applications/Welcome/main.cpp index 688c4a10c5c..5de82d36cf8 100644 --- a/Userland/Applications/Welcome/main.cpp +++ b/Userland/Applications/Welcome/main.cpp @@ -19,7 +19,6 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domain("SystemServer"); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); diff --git a/Userland/Demos/Eyes/main.cpp b/Userland/Demos/Eyes/main.cpp index 06e78bedf18..66b5eabd4c3 100644 --- a/Userland/Demos/Eyes/main.cpp +++ b/Userland/Demos/Eyes/main.cpp @@ -40,7 +40,6 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::try_create(arguments)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp index 59e7d5ddcbb..e1ad079fde5 100644 --- a/Userland/Demos/WidgetGallery/main.cpp +++ b/Userland/Demos/WidgetGallery/main.cpp @@ -17,7 +17,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread")); auto app = TRY(GUI::Application::try_create(arguments, Core::EventLoop::MakeInspectable::Yes)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r")); diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index f4bfbba8e4f..6b9c09ae0e8 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -67,7 +67,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio thread recvfd sendfd cpath rpath wpath unix")); auto app = TRY(GUI::Application::try_create(arguments)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index cde3533599a..569e463e21e 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -36,7 +36,6 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(GUI::Window::try_create()); auto widget = TRY(window->set_main_widget()); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/bin/ChessEngine", "x")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); diff --git a/Userland/Services/LoginServer/main.cpp b/Userland/Services/LoginServer/main.cpp index 4481b201ba0..3318cc93bdc 100644 --- a/Userland/Services/LoginServer/main.cpp +++ b/Userland/Services/LoginServer/main.cpp @@ -70,7 +70,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/etc/shadow", "r")); TRY(Core::System::unveil("/etc/group", "r")); TRY(Core::System::unveil("/bin/SystemServer", "x")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Services/SpiceAgent/main.cpp b/Userland/Services/SpiceAgent/main.cpp index 89588df46da..89843e19ef8 100644 --- a/Userland/Services/SpiceAgent/main.cpp +++ b/Userland/Services/SpiceAgent/main.cpp @@ -18,7 +18,6 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::pledge("unix rpath wpath stdio sendfd recvfd")); TRY(Core::System::unveil(SPICE_DEVICE, "rw"sv)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index ebd2959f785..dda03d5330c 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -32,7 +32,6 @@ ErrorOr serenity_main(Main::Arguments) if (Core::File::exists(webdriver_socket_path)) TRY(Core::System::unveil(webdriver_socket_path, "rw"sv)); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil("/usr/lib", "r")); diff --git a/Userland/Services/WebDriver/main.cpp b/Userland/Services/WebDriver/main.cpp index a3261c377eb..4436635f0bd 100644 --- a/Userland/Services/WebDriver/main.cpp +++ b/Userland/Services/WebDriver/main.cpp @@ -100,7 +100,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/bin/headless-browser", "rx")); TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil("/res/icons", "r")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil(webdriver_socket_path, "rwc"sv)); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp index 7df08b2f450..18d693de424 100644 --- a/Userland/Utilities/aplay.cpp +++ b/Userland/Utilities/aplay.cpp @@ -35,7 +35,6 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_option(show_sample_progress, "Show playback progress in samples", "sample-progress", 's'); args_parser.parse(arguments); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw")); TRY(Core::System::unveil(Core::File::absolute_path(path), "r"sv)); TRY(Core::System::unveil(nullptr, nullptr)); diff --git a/Userland/Utilities/logout.cpp b/Userland/Utilities/logout.cpp index 59bd1e3c57e..15d1d5dcde3 100644 --- a/Userland/Utilities/logout.cpp +++ b/Userland/Utilities/logout.cpp @@ -12,7 +12,6 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio proc rpath")); - TRY(Core::System::unveil("/sys/kernel/processes", "r")); TRY(Core::System::unveil("/etc/passwd", "r")); TRY(Core::System::unveil(nullptr, nullptr));