Patch "net: vrf: Remove direct access to skb->data" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
net: vrf: Remove direct access to skb->data
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-vrf-remove-direct-access-to-skb-data.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Sat Apr 16 10:02:52 PDT 2016
From: David Ahern <[email protected]>
Date: Tue, 23 Feb 2016 10:10:26 -0800
Subject: net: vrf: Remove direct access to skb->data
From: David Ahern <[email protected]>
[ Upstream commit 65c38aa653c14df49e19faad74bd375f36e61c57 ]
Nik pointed that the VRF driver should be using skb_header_pointer instead of accessing skb->data and bits beyond directly which can be garbage.
--- drivers/net/vrf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/vrf.c +8 -5
@@ -114,20 +114,23 @@ static struct dst_ops vrf_dst_ops = {#if IS_ENABLED (CONFIG_IPV6 )static bool check_ipv6_frame (const struct sk_buff *skb) { -const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data; -size_t hlen =sizeof (*ipv6h); +const struct ipv6hdr *ipv6h; +struct ipv6hdr _ipv6h;bool rc = true; -if (skb->len < hlen) + ipv6h =skb_header_pointer (skb,0 ,sizeof (_ipv6h), &_ipv6h); +if (!ipv6h) goto out;if (ipv6h->nexthdr ==NEXTHDR_ICMP ) {const struct icmp6hdr *icmph; +struct icmp6hdr _icmph; -if (skb->len < hlen +sizeof (*icmph)) + icmph =skb_header_pointer (skb,sizeof (_ipv6h), +sizeof (_icmph), &_icmph); +if (!icmph) goto out; - icmph = (struct icmp6hdr *)(skb->data +sizeof (*ipv6h));switch (icmph->icmp6_type) {case NDISC_ROUTER_SOLICITATION :case NDISC_ROUTER_ADVERTISEMENT :
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/net-vrf-remove-direct-access-to-skb-data.patch queue-4.4/ipv4-initialize-flowi4_flags-before-calling-fib_lookup.patch