summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorStas Sergeev <stsp2@yandex.ru>2024-12-05 10:36:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 11:36:01 +0100
commit4d44aa4d03a5600cf15e0d5ebee1f76c6f915e44 (patch)
tree1cf1c2140007503e22751602d8b6c7b2608ecb90 /drivers/mmc/core/sdio.c
parent67571f123fe424d9a9e0b496eb003d7e5a682fb6 (diff)
downloadlinux-4d44aa4d03a5600cf15e0d5ebee1f76c6f915e44.tar.gz
linux-4d44aa4d03a5600cf15e0d5ebee1f76c6f915e44.tar.bz2
linux-4d44aa4d03a5600cf15e0d5ebee1f76c6f915e44.zip
tun: fix group permission check
[ Upstream commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3 ] Currently tun checks the group permission even if the user have matched. Besides going against the usual permission semantic, this has a very interesting implication: if the tun group is not among the supplementary groups of the tun user, then effectively no one can access the tun device. CAP_SYS_ADMIN still can, but its the same as not setting the tun ownership. This patch relaxes the group checking so that either the user match or the group match is enough. This avoids the situation when no one can access the device even though the ownership is properly set. Also I simplified the logic by removing the redundant inversions: tun_not_capable() --> !tun_capable() Signed-off-by: Stas Sergeev <stsp2@yandex.ru> Reviewed-by: Willem de Bruijn <willemb@google.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://patch.msgid.link/20241205073614.294773-1-stsp2@yandex.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mmc/core/sdio.c')
0 files changed, 0 insertions, 0 deletions