diff --git a/net/sched/em_canid.c b/net/sched/em_canid.c index 5337bc462755..a9b6cab70ff1 100644 --- a/net/sched/em_canid.c +++ b/net/sched/em_canid.c @@ -99,6 +99,9 @@ static int em_canid_match(struct sk_buff *skb, struct tcf_ematch *m, int i; const struct can_filter *lp; + if (skb->len < sizeof(canid_t)) + return 0; + can_id = em_canid_get_id(skb); if (can_id & CAN_EFF_FLAG) {