]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: tcp: fix potential NULL deref in tcp_v6_send_reset()
authorEric Dumazet <edumazet@google.com>
Fri, 7 Jun 2019 19:23:48 +0000 (12:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Jun 2019 02:42:23 +0000 (19:42 -0700)
commit492d716c81cbd0e49292754a2c1b1e555a04804e
tree49e47af6d0fe976d4ea59af736c46f590c826334
parentd5dfa84232ff4995b91b3fb03066e5849d285269
ipv6: tcp: fix potential NULL deref in tcp_v6_send_reset()

syzbot found a crash in tcp_v6_send_reset() caused by my latest
change.

Problem is that if an skb has been queued to socket prequeue,
skb_dst(skb)->dev can not anymore point to the device.

Fortunately in this case the socket pointer is not NULL.

A similar issue has been fixed in commit 05ff812d077f ("tcp: fix
more NULL deref after prequeue changes"), I should have known better.

Fixes: d93bd92f1701 ("ipv6: tcp: enable flowlabel reflection in some RST packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/tcp_ipv6.c