]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: fix possible use-after-free in ip6_xmit()
authorEric Dumazet <edumazet@google.com>
Fri, 14 Sep 2018 19:02:31 +0000 (12:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Sep 2018 14:56:02 +0000 (07:56 -0700)
commit76c9cbfeee3c0d3d107bf80d4c42dba92888f6b4
tree4c7e9f26af82fd34dcbc6520091f046982388a10
parent729a8dac50fb7e95b67ec85687e8a66f5f35f0e6
ipv6: fix possible use-after-free in ip6_xmit()

In the unlikely case ip6_xmit() has to call skb_realloc_headroom(),
we need to call skb_set_owner_w() before consuming original skb,
otherwise we risk a use-after-free.

Bring IPv6 in line with what we do in IPv4 to fix this.

Fixes: 1da177e4c3f41 ("Linux-2.6.12-rc2")
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/ip6_output.c