mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 10:29:52 +00:00
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>
This commit is contained in:
committed by
Christian Brauner
parent
8b17e54096
commit
af153bb63a
@@ -3415,6 +3415,8 @@ static int may_open(struct mnt_idmap *idmap, const struct path *path,
|
|||||||
if ((acc_mode & MAY_EXEC) && path_noexec(path))
|
if ((acc_mode & MAY_EXEC) && path_noexec(path))
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
VFS_BUG_ON_INODE(1, inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = inode_permission(idmap, inode, MAY_OPEN | acc_mode);
|
error = inode_permission(idmap, inode, MAY_OPEN | acc_mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user