mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
pidfs: raise SB_I_NODEV and SB_I_NOEXEC
[ Upstream commit1a1ad73aa1
] Similar to commit1ed95281c0
("anon_inode: raise SB_I_NODEV and SB_I_NOEXEC"): it shouldn't be possible to execute pidfds via execveat(fd_anon_inode, "", NULL, NULL, AT_EMPTY_PATH) so raise SB_I_NOEXEC so that no one gets any creative ideas. Also raise SB_I_NODEV as we don't expect or support any devices on pidfs. Link: https://lore.kernel.org/20250618-work-pidfs-persistent-v2-1-98f3456fd552@kernel.org Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e1b58b4759
commit
a482e56b2a
|
@ -382,6 +382,8 @@ static int pidfs_init_fs_context(struct fs_context *fc)
|
|||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
||||
fc->s_iflags |= SB_I_NOEXEC;
|
||||
fc->s_iflags |= SB_I_NODEV;
|
||||
ctx->ops = &pidfs_sops;
|
||||
ctx->dops = &pidfs_dentry_operations;
|
||||
fc->s_fs_info = (void *)&pidfs_stashed_ops;
|
||||
|
|
Loading…
Reference in New Issue
Block a user