]> git.baikalelectronics.ru Git - kernel.git/commit
cls_u32: use skb_header_pointer() to dereference data safely
authorChangli Gao <xiaosuo@gmail.com>
Wed, 2 Jun 2010 14:32:42 +0000 (07:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2010 14:32:42 +0000 (07:32 -0700)
commitec91ad3fa7572ea6acfac56a9e58a3280c453d0b
treea82f11f0ea06fd465393314d0f37772f715c6caf
parent08991ebb403ebab3ccba75905ac5d2d454d0e7d0
cls_u32: use skb_header_pointer() to dereference data safely

use skb_header_pointer() to dereference data safely

the original skb->data dereference isn't safe, as there isn't any skb->len or
skb_is_nonlinear() check. skb_header_pointer() is used instead in this patch.
And when the skb isn't long enough, we terminate the function u32_classify()
immediately with -1.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c