Thread (19 messages) flat view 19 messages, 5 authors, 2017-02-17

Re: net/packet: use-after-free in packet_rcv_fanout

From: Cong Wang <hidden>
Date: 2017-02-10 18:40:53
Also in: lkml

On Fri, Feb 10, 2017 at 10:02 AM, Eric Dumazet [off-list ref] wrote:
On Fri, 2017-02-10 at 09:59 -0800, Eric Dumazet wrote:
quoted
On Fri, 2017-02-10 at 09:49 -0800, Cong Wang wrote:
quoted
On Thu, Feb 9, 2017 at 7:23 PM, Eric Dumazet [off-list ref] wrote:
quoted
On Thu, 2017-02-09 at 19:19 -0800, Eric Dumazet wrote:
quoted
More likely the bug is in fanout_add(), with a buggy sequence in error
case, and not correct locking.

kfree(po->rollover);
po->rollover = NULL;

Two cpus entering fanout_add() (using the same af_packet socket,
syzkaller courtesy...) might both see po->fanout being NULL.

Then they grab the mutex.  Too late...
Patch could be :
For me, clearly the data structure that use-after-free'd is struct sock
rather than struct packet_rollover.
Fine. But your patch makes absolutely no sense.
At least, Anoob patch is making a step into the right direction ;)

https://patchwork.ozlabs.org/patch/726532/
Yeah, but still looks like a different one with the one Dmitry reported.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help