diff options
author | Jamal Hadi Salim <jhs@mojatatu.com> | 2023-01-01 16:57:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 09:26:41 +0100 |
commit | db49adc5aff0c84ef0439a666f494a0d57c98bc7 (patch) | |
tree | 6c42b7a66323feedc0fe09917e7a001105e5aded /net | |
parent | 53526dbc8aa6b95e9fc2ab1e29b1a9145721da24 (diff) | |
download | linux-stable-db49adc5aff0c84ef0439a666f494a0d57c98bc7.tar.gz linux-stable-db49adc5aff0c84ef0439a666f494a0d57c98bc7.tar.bz2 linux-stable-db49adc5aff0c84ef0439a666f494a0d57c98bc7.zip |
net: sched: atm: dont intepret cls results when asked to drop
[ Upstream commit a2965c7be0522eaa18808684b7b82b248515511b ]
If asked to drop a packet via TC_ACT_SHOT it is unsafe to assume
res.class contains a valid pointer
Fixes: b0188d4dbe5f ("[NET_SCHED]: sch_atm: Lindent")
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_atm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 9198c9983b83..184ce9050457 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -389,10 +389,13 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch, result = tcf_classify(skb, fl, &res, true); if (result < 0) continue; + if (result == TC_ACT_SHOT) + goto done; + flow = (struct atm_flow_data *)res.class; if (!flow) flow = lookup_flow(sch, res.classid); - goto done; + goto drop; } } flow = NULL; |