]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: fix a sock regression in selinux_ip_postroute_compat()
authorPaul Moore <paul@paul-moore.com>
Tue, 19 Oct 2021 16:19:44 +0000 (12:19 -0400)
committerPaul Moore <paul@paul-moore.com>
Tue, 19 Oct 2021 16:35:18 +0000 (12:35 -0400)
commit5fb4e63545eecbd4edafd57eeb689b51ce662bba
treee555b8e1ba2231f6419aca576fc46d6af3ea25cd
parent0bdd5a7db6cb64ec4b887d0152c14bccb06f2205
selinux: fix a sock regression in selinux_ip_postroute_compat()

Unfortunately we can't rely on nf_hook_state->sk being the proper
originating socket so revert to using skb_to_full_sk(skb).

Fixes: adadb06cd416 ("selinux: make better use of the nf_hook_state passed to the NF hooks")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c