From 73bc856c1654019373d7ee5b3fc4f334f9fb2172 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 11 Feb 2023 10:22:07 +0200 Subject: [PATCH] SystemServer: Re-mount / as non-writable, nosuid and nodev This is a preparation before we remove the default root mount flags from the kernel code. --- Userland/Services/SystemServer/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Services/SystemServer/main.cpp b/Userland/Services/SystemServer/main.cpp index 6b8c77cba2..98700269d9 100644 --- a/Userland/Services/SystemServer/main.cpp +++ b/Userland/Services/SystemServer/main.cpp @@ -386,6 +386,10 @@ static ErrorOr populate_devtmpfs() static ErrorOr prepare_synthetic_filesystems() { + // FIXME: Don't hardcode the fs type as the ext2 filesystem and once there's + // more than this filesystem implementation (which is suitable for usage on + // physical storage), find a way to detect it. + TRY(Core::System::mount(-1, "/"sv, "ext2"sv, MS_REMOUNT | MS_NODEV | MS_NOSUID | MS_RDONLY)); // FIXME: Find a better way to all of this stuff, without hardcoding all of this! TRY(Core::System::mount(-1, "/proc"sv, "proc"sv, MS_NOSUID)); TRY(Core::System::mount(-1, "/sys"sv, "sys"sv, 0));