net/nfc/rawsock.c: fix a permission check bug
stable inclusion from stable-v5.10.44 commit 1e5cab50208c8fb7351b798cb1d569debfeb994a bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=371 CVE: NA ------------------------------------------------- [ Upstream commit 8ab78863 ] The function rawsock_create() calls a privileged function sk_alloc(), which requires a ns-aware check to check net->user_ns, i.e., ns_capable(). However, the original code checks the init_user_ns using capable(). So we replace the capable() with ns_capable(). Signed-off-by: NJeimon <jjjinmeng.zhou@gmail.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by:lf <15042944259@163.com> Reviewed-by: NJian Cheng <cj.chengjian@huawei.com> Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Showing
想要评论请 注册 或 登录