Skip to content

Commit af153bb

Browse files
mjguzikbrauner
authored andcommitted
vfs: catch invalid modes in may_open()
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://lore.kernel.org/r/20250209185523.745956-3-mjguzik@gmail.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 8b17e54 commit af153bb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/namei.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,8 @@ static int may_open(struct mnt_idmap *idmap, const struct path *path,
34153415
if ((acc_mode & MAY_EXEC) && path_noexec(path))
34163416
return -EACCES;
34173417
break;
3418+
default:
3419+
VFS_BUG_ON_INODE(1, inode);
34183420
}
34193421

34203422
error = inode_permission(idmap, inode, MAY_OPEN | acc_mode);

0 commit comments

Comments
 (0)