[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1362908909-45697-1-git-send-email-honkiko@gmail.com>
Date: Sun, 10 Mar 2013 17:48:29 +0800
From: Hong Zhiguo <honkiko@...il.com>
To: netdev@...r.kernel.org, davem@...emloft.net,
stephen@...workplumber.org
Cc: zhiguo.hong@....com, Hong Zhiguo <honkiko@...il.com>
Subject: [PATCH net-next] fix buf of assigning skb->tail to network_header
in the case of NET_SKBUFF_DATA_USES_OFFSET, direct pointer
assignment to skb->network_header is a dangerous bug.
Signed-off-by: Hong Zhiguo <honkiko@...il.com>
---
net/ipv4/ipmr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5f95b3a..553409b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -980,7 +980,7 @@ static int ipmr_cache_report(struct mr_table *mrt,
/* Copy the IP header */
- skb->network_header = skb->tail;
+ skb_set_network_header(skb, skb->tail - skb->data);
skb_put(skb, ihl);
skb_copy_to_linear_data(skb, pkt->data, ihl);
ip_hdr(skb)->protocol = 0; /* Flag to the kernel this is a route add */
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists