Skip to content

Commit a2965c7

Browse files
jhsmtdavem330
authored andcommitted
net: sched: atm: dont intepret cls results when asked to drop
If asked to drop a packet via TC_ACT_SHOT it is unsafe to assume res.class contains a valid pointer Fixes: b0188d4 ("[NET_SCHED]: sch_atm: Lindent") Signed-off-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 91e2286 commit a2965c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/sched/sch_atm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,13 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
393393
result = tcf_classify(skb, NULL, fl, &res, true);
394394
if (result < 0)
395395
continue;
396+
if (result == TC_ACT_SHOT)
397+
goto done;
398+
396399
flow = (struct atm_flow_data *)res.class;
397400
if (!flow)
398401
flow = lookup_flow(sch, res.classid);
399-
goto done;
402+
goto drop;
400403
}
401404
}
402405
flow = NULL;

0 commit comments

Comments
 (0)