diff options
author | Jamal Hadi Salim <jhs@mojatatu.com> | 2023-01-02 00:57:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-14 12:16:47 +0300 |
commit | 5f65f48516bfeebaab1ccc52c8fad698ddf21282 (patch) | |
tree | c65c81ab196bc2a5515f8e8e67b7a7f4d597fa27 /net | |
parent | f4a2ad1002006548e235255c65a4f1d07312be9d (diff) | |
download | linux-5f65f48516bfeebaab1ccc52c8fad698ddf21282.tar.xz |
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 794c7377cd7e..95967ce1f370 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -396,10 +396,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; |