Daniel Borkmann 3a1c756590 net: ipv6: tcp: fix potential use after free in tcp_v6_do_rcv
In tcp_v6_do_rcv() code, when processing pkt options, we soley work
on our skb clone opt_skb that we've created earlier before entering
tcp_rcv_established() on our way. However, only in condition ...

  if (np->rxopt.bits.rxtclass)
    np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb));

... we work on skb itself. As we extract every other information out
of opt_skb in ipv6_pktoptions path, this seems wrong, since skb can
already be released by tcp_rcv_established() earlier on. When we try
to access it in ipv6_hdr(), we will dereference freed skb.

[ Bug added by commit 4c507d2897bd9b ("net: implement IP_RECVTOS for
  IP_PKTOPTIONS") ]

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-04 14:44:41 -04:00
..
2013-09-03 22:16:50 -04:00
2013-02-15 15:10:37 -05:00
2012-11-03 14:59:05 -04:00
2013-08-19 09:37:46 +02:00
2013-05-27 22:50:59 -07:00
2013-08-19 09:37:46 +02:00
2013-03-26 12:27:19 -04:00
2013-05-31 16:26:49 -07:00
2013-03-17 14:35:13 -04:00
2013-05-11 16:26:38 -07:00
2013-07-10 17:08:27 -07:00
2013-05-11 16:26:38 -07:00