Thread (161 messages) 161 messages, 13 authors, 2013-11-21

Re: [3/3] gso: Handle malicious GRO packets without crashing

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2013-11-11 18:55:09

On Thu, Nov 07, 2013 at 10:13:29PM +0300, Sergei Shtylyov wrote:
Hello.

On 11/07/2013 10:08 AM, Herbert Xu wrote:
quoted
As virtio_net can now generate GRO frag_list packets without
sufficient verification, we need to handle malicious GRO packets
thrown at us.
quoted
This patch converts to affected BUG_ONs in skb_segment to rate-
limited warnings.
quoted
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
quoted
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index bcc3f1c..fb1106d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2881,7 +2881,15 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
 			while (tail->next)
 				tail = tail->next;

-			BUG_ON(fskb && tail->len != len + doffset);
+			if (fskb && tail->len != len + doffset) {
+				net_warn_ratelimited(
+					"skb_segment: "
+					"illegal GSO fragment: %u %u\n",
   Don't break up the message -- chekpatch.pl should allow that...
Thanks for the comment.  In the latest version of this patch
this should no longer be an issue.
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help