* [PATCH] net/sched: act_police: fix false drops of pps-only policers
@ 2026-12-01 6:12 faicker.mo
2026-12-01 6:18 ` netdev-bot+sinfo
0 siblings, 1 reply; 2+ messages in thread
From: faicker.mo @ 2026-12-01 6:12 UTC (permalink / raw)
To: faicker.mo
Cc: stable, Jamal Hadi Salim, Jiri Pirko, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Louis Peens, Baowen Zheng, netdev
From: Faicker Mo <faicker.mo@gmail.com>
tcf_police_act() reads the clock before taking tcfp_lock. Meanwhile
another CPU may update tcfp_t_c to a later time, making
now - tcfp_t_c negative.
With a byte rate, toks gets tcfp_toks added and is usually absorbed. A
pps-only policer has no byte rate, so the negative toks fails the
(toks | ptoks | ppstoks) >= 0 check and the packet is dropped even
if the pps bucket is full.
Clamp now to tcfp_t_c after taking the lock.
Fixes: 2ffe0395288a ("net/sched: act_police: add support for packet-per-second policing")
Signed-off-by: Faicker Mo <faicker.mo@gmail.com>
---
net/sched/act_police.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 3f8147f37549..0b3163385a69 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -280,6 +280,7 @@ TC_INDIRECT_SCOPE int tcf_police_act(struct sk_buff *skb,
now = ktime_get_ns();
spin_lock_bh(&police->tcfp_lock);
+ now = max_t(s64, now, police->tcfp_t_c);
toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst);
if (p->peak_present) {
ptoks = toks + police->tcfp_ptoks;
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] net/sched: act_police: fix false drops of pps-only policers
2026-12-01 6:12 [PATCH] net/sched: act_police: fix false drops of pps-only policers faicker.mo
@ 2026-12-01 6:18 ` netdev-bot+sinfo
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-12-01 6:18 UTC (permalink / raw)
To: faicker.mo
Cc: stable, Jamal Hadi Salim, Jiri Pirko, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Louis Peens, Baowen Zheng, netdev
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 6:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 6:12 [PATCH] net/sched: act_police: fix false drops of pps-only policers faicker.mo
2026-12-01 6:18 ` netdev-bot+sinfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox