summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJustin Husted <sigstop@gmail.com>2019-11-09 19:15:40 -0800
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:31 -0400
commitb627c7d8f46ca74e78f6df63e8e2f15af124d1f7 (patch)
treeb22fd7ada9a76e749111ee87f7d16814c143e8f5 /fs
parent0897705163b5c7eb9ecacad53c252adbbf72454a (diff)
bcachefs: Set lost+found mode to 0700
For security and conformance with other filesystems, the lost+found directory should not be world or group accessible. Signed-off-by: Justin Husted <sigstop@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/fsck.c2
-rw-r--r--fs/bcachefs/recovery.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 3cced2b99f3f..0f2308e53d65 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -797,7 +797,7 @@ create_lostfound:
bch2_create_trans(&trans,
BCACHEFS_ROOT_INO, root_inode,
lostfound_inode, &lostfound,
- 0, 0, S_IFDIR|0755, 0, NULL, NULL));
+ 0, 0, S_IFDIR|0700, 0, NULL, NULL));
if (ret)
bch_err(c, "error creating lost+found: %i", ret);
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 2c441a278044..d1184bf62cae 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1013,7 +1013,7 @@ int bch2_fs_initialize(struct bch_fs *c)
bch2_create_trans(&trans, BCACHEFS_ROOT_INO,
&root_inode, &lostfound_inode,
&lostfound,
- 0, 0, S_IFDIR|0755, 0,
+ 0, 0, S_IFDIR|0700, 0,
NULL, NULL));
if (ret)
goto err;