vfs: catch invalid modes in may_open()

Signed-off-by: Mateusz Guzik <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
This commit is contained in:
Mateusz Guzik authored and Christian Brauner committed 2025-02-21 10:23:53 +01:00
1 parent 8b17e54096
commit af153bb63a
1 file changed
+2
+2
View File
@@ -3415,6 +3415,8 @@ static int may_open(struct mnt_idmap *idmap, const struct path *path,
if ((acc_mode & MAY_EXEC) && path_noexec(path))
return -EACCES;
break;
default:
VFS_BUG_ON_INODE(1, inode);
}
error = inode_permission(idmap, inode, MAY_OPEN | acc_mode);