]> git.baikalelectronics.ru Git - kernel.git/commit
af-packet: fix oops when socket is not present
authorEric Leblond <eric@regit.org>
Tue, 6 Nov 2012 02:10:10 +0000 (02:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Nov 2012 20:40:14 +0000 (15:40 -0500)
commit25c1f5347b6661a6ad7ab62d38aa13520e71e1af
treef4805035e24dcad88cc45ff55ac70ef9de9a3b62
parentbeb006590f424c6671973d42f8ea2aae175a067e
af-packet: fix oops when socket is not present

Due to a NULL dereference, the following patch is causing oops
in normal trafic condition:

commit a729d3e6951d9177818d1f2b2dc4b35ac446beb8
Author: Eric Leblond <eric@regit.org>
Date:   Thu Aug 16 22:02:58 2012 +0000

    af_packet: don't emit packet on orig fanout group

This buggy patch was a feature fix and has reached most stable
branches.

When skb->sk is NULL and when packet fanout is used, there is a
crash in match_fanout_group where skb->sk is accessed.
This patch fixes the issue by returning false as soon as the
socket is NULL: this correspond to the wanted behavior because
the kernel as to resend the skb to all the listening socket in
this case.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c