[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1275481538.14363.10.camel@bigi>
Date: Wed, 02 Jun 2010 08:25:38 -0400
From: jamal <hadi@...erus.ca>
To: Changli Gao <xiaosuo@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] cls_u32: use skb_copy_bits() to dereference data safely
On Wed, 2010-06-02 at 08:21 -0400, jamal wrote:
> Can we make the fix very simple please? i.e no copy bits, this is the
> fast path.
Example, something along lines of:
---
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 9627542..dde7a23 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -135,6 +135,9 @@ next_knode:
for (i = n->sel.nkeys; i>0; i--, key++) {
+ int toff = key->off+(off2&key->offmask)- 4;
+ if (unlikely(toff > skb->len))
+ /* bailout here - needs some thought */
if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->v
n = n->next;
goto next_knode;
----
cheers,
jamal
--
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