Forráskód Böngészése

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 éve
szülő
commit
e79c33eabb
1 módosított fájl, 1 hozzáadás és 1 törlés
  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)
 NonnullRefPtr<TmpFSInode> TmpFSInode::create_root(TmpFS& fs)
 {
 {
     InodeMetadata metadata;
     InodeMetadata metadata;
-    metadata.mode = 0040777;
+    metadata.mode = 0041777;
     return create(fs, metadata, { fs.fsid(), 1 });
     return create(fs, metadata, { fs.fsid(), 1 });
 }
 }