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)
commit1c73213ba991d26a91282e775d1f5a60e41e5184
treee555b8e1ba2231f6419aca576fc46d6af3ea25cd
parent4d5b5539742d2554591751b4248b0204d20dcc9d
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: 1d1e1ded1356 ("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