]> git.baikalelectronics.ru Git - kernel.git/commit
ip: on queued skb use skb_header_pointer instead of pskb_may_pull
authorWillem de Bruijn <willemb@google.com>
Mon, 7 Jan 2019 21:47:33 +0000 (16:47 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jan 2019 14:27:20 +0000 (09:27 -0500)
commit7641d4719f20f05214d635ba0e142df5433635d6
treefce2609c8420b949997d123cec8aacd178a0cd1d
parentd41ac5a3de83ddde06a647b6aec65231a20133f4
ip: on queued skb use skb_header_pointer instead of pskb_may_pull

Commit 9d503672ce72 ("ip: in cmsg IP(V6)_ORIGDSTADDR call
pskb_may_pull") avoided a read beyond the end of the skb linear
segment by calling pskb_may_pull.

That function can trigger a BUG_ON in pskb_expand_head if the skb is
shared, which it is when when peeking. It can also return ENOMEM.

Avoid both by switching to safer skb_header_pointer.

Fixes: 9d503672ce72 ("ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull")
Reported-by: syzbot <syzkaller@googlegroups.com>
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_sockglue.c
net/ipv6/datagram.c