mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +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:
parent
8b17e54096
commit
af153bb63a
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue