Xin Long a482c5e00a netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6
In rt_mt6(), when it's a nonlinear skb, the 1st skb_header_pointer()
only copies sizeof(struct ipv6_rt_hdr) to _route that rh points to.
The access by ((const struct rt0_hdr *)rh)->reserved will overflow
the buffer. So this access should be moved below the 2nd call to
skb_header_pointer().

Besides, after the 2nd skb_header_pointer(), its return value should
also be checked, othersize, *rp may cause null-pointer-ref.

v1->v2:
  - clean up some old debugging log.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2021-10-14 23:08:35 +02:00
..
2021-06-11 14:48:50 +02:00
2019-07-27 14:23:48 -07:00
2021-07-27 20:11:44 +01:00
2021-07-27 20:11:44 +01:00
2021-08-05 13:27:50 +01:00
2021-06-11 14:48:50 +02:00
2021-06-29 11:28:21 -07:00
2021-04-29 15:34:15 -07:00
2021-07-27 20:11:44 +01:00
2020-12-16 11:01:04 -08:00