diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-04 11:33:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-04 11:33:36 +0100 |
commit | e79c33eabbd500cedaa26613f9de758c276f56b8 (patch) | |
tree | c4731bebb0784f3de03a8be69b664e2bf4f0c983 /Kernel/FileSystem | |
parent | 4398eec03ce1f4552ce0c475b2bb3f0cd1a6a84b (diff) | |
download | serenity-e79c33eabbd500cedaa26613f9de758c276f56b8.zip |
Kernel: The root inode of a TmpFS should have the sticky bit set
We were running without the sticky bit and mode 777, which meant that
the /tmp directory was world-writable *without* protection.
With this fixed, it's no longer possible for everyone to steal root's
files in /tmp.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/TmpFS.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/TmpFS.cpp b/Kernel/FileSystem/TmpFS.cpp index 842a241d8a..b60ff4b5ec 100644 --- a/Kernel/FileSystem/TmpFS.cpp +++ b/Kernel/FileSystem/TmpFS.cpp @@ -121,7 +121,7 @@ NonnullRefPtr<TmpFSInode> TmpFSInode::create(TmpFS& fs, InodeMetadata metadata, NonnullRefPtr<TmpFSInode> TmpFSInode::create_root(TmpFS& fs) { InodeMetadata metadata; - metadata.mode = 0040777; + metadata.mode = 0041777; return create(fs, metadata, { fs.fsid(), 1 }); } |