1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

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.
This commit is contained in:
Liav A 2023-02-11 10:22:07 +02:00 committed by Linus Groh
parent 328a64fbdc
commit 73bc856c16

View file

@ -386,6 +386,10 @@ static ErrorOr<void> populate_devtmpfs()
static ErrorOr<void> 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));