浏览代码

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.
Andreas Kling 5 年之前
父节点
当前提交
e79c33eabb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/FileSystem/TmpFS.cpp

+ 1 - 1
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 });
 }