Netdev List
 help / color / mirror / Atom feed
* [PATCH net v5 0/2] net/sched: act_gate: bound the cycle time and start time arithmetic
@ 2026-11-27 11:43 Jamal Hadi Salim
  2026-11-27 11:43 ` [PATCH net v5 1/2] " Jamal Hadi Salim
  2026-11-27 11:43 ` [PATCH net v5 2/2] selftests: tc-testing: act_gate: cover the cycle time and base time bounds Jamal Hadi Salim
  0 siblings, 2 replies; 3+ messages in thread
From: Jamal Hadi Salim @ 2026-11-27 11:43 UTC (permalink / raw)
  To: netdev
  Cc: Jamal Hadi Salim, Jiri Pirko, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
	Shuah Khan, linux-kselftest, Alexei Starovoitov, Victor Nogueira,
	stable, syzbot+0054fed3dc9085390f51, shaos

The cycle time and the base time are read from u64 attributes into a
signed ktime_t, and the cycle arithmetic built on them wraps when either
value is above S64_MAX.  With base_time = 1 and cycle_time = all ones the
timer is armed in the past on every expiry, so the softirq never finishes
and the installing task soft-locks the CPU.

Neither attribute has been bounded since the action was introduced, so one
request is enough to stall a CPU on any kernel that has it.

Patch 1 bounds both attributes at KTIME_MAX and computes the next
boundary with ktime_add_safe(), so an unrepresentable expiry saturates in
the far future.  Patch 2 covers the accepted upper bound and both refusals
in tc-testing.

The 10 us schedule-entry floor from the previous posting is a policy
change and moves to net-next; it follows once this series lands, and is not
part of this series.

Changes since v4:
- Split: only the regression fix and its tests are here; the entry
  interval floor and its test cases move to net-next.
- Conditions states the user-namespace route through a filter, which is
  the minimum privilege that reaches the code (reported on the list).
- The test cases match the kernel's own message on a libmnl build as
  well as the strerror text, use deterministic signed values instead of a
  2^63 decimal whose conversion is architecture dependent, and assert
  the stored value instead of only the index.

Jamal Hadi Salim (2):
  net/sched: act_gate: bound the cycle time and start time arithmetic
  selftests: tc-testing: act_gate: cover the cycle time and base time
    bounds

 net/sched/act_gate.c                          |  34 +++---
 .../tc-testing/tc-tests/actions/gate.json     | 108 ++++++++++++++++++
 2 files changed, 127 insertions(+), 15 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-27 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 11:43 [PATCH net v5 0/2] net/sched: act_gate: bound the cycle time and start time arithmetic Jamal Hadi Salim
2026-11-27 11:43 ` [PATCH net v5 1/2] " Jamal Hadi Salim
2026-11-27 11:43 ` [PATCH net v5 2/2] selftests: tc-testing: act_gate: cover the cycle time and base time bounds Jamal Hadi Salim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox