Thread (3 messages) flat view 3 messages, 3 authors, 2021-10-19

Re: [next] BUG: kernel NULL pointer dereference, address:: selinux_ip_postroute_compat

From: Florian Westphal <fw@strlen.de>
Date: 2021-10-19 13:10:57
Also in: linux-next, lkml, selinux

Naresh Kamboju [off-list ref] wrote:
Following kernel crash noticed on linux next 20211019 tag.
on x86, i386 and other architectures.
Paul, this might be caused by
1d1e1ded13568be81a0e19d228e310a48997bec8
("selinux: make better use of the nf_hook_state passed to the NF
 hooks"), in particular this hunk here:

-       if (sk == NULL)
+       if (state->sk == NULL)
                return NF_ACCEPT;
+       sk = skb_to_full_sk(skb);
        sksec = sk->sk_security;

state->sk might not be related to skb->sk.
I suspect that this should instead be:

+       sk = skb_to_full_sk(skb);
        if (sk == NULL)

See 7026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab for the origin of this
additional socket pointer.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help