Commit d1165b13 authored by Richard Haines's avatar Richard Haines Committed by Zheng Zengkai
Browse files

selinux: allow FIOCLEX and FIONCLEX with policy capability

stable inclusion
from stable-v5.10.110
commit 448857f58009fd950f4d732e8f1e4fcf859cb4b1
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=448857f58009fd950f4d732e8f1e4fcf859cb4b1



--------------------------------

[ Upstream commit 65881e1d ]

These ioctls are equivalent to fcntl(fd, F_SETFD, flags), which SELinux
always allows too.  Furthermore, a failed FIOCLEX could result in a file
descriptor being leaked to a process that should not have access to it.

As this patch removes access controls, a policy capability needs to be
enabled in policy to always allow these ioctls.

Based-on-patch-by: default avatarDemi Marie Obenour <demiobenour@gmail.com>
Signed-off-by: default avatarRichard Haines <richard_c_haines@btinternet.com>
[PM: subject line tweak]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent ac3e27c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment