From: Jamal Hadi Salim <jhs@mojatatu.com>
To: netdev@vger.kernel.org
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Victor Nogueira <victor@mojatatu.com>,
stable@vger.kernel.org,
syzbot+0054fed3dc9085390f51@syzkaller.appspotmail.com,
shaos <shawnq1@163.com>
Subject: [PATCH net v5 0/2] net/sched: act_gate: bound the cycle time and start time arithmetic
Date: Fri, 27 Nov 2026 06:43:33 -0500 [thread overview]
Message-ID: <ACT-WEXM.v5.r0.20261127063407@mojatatu.com> (raw)
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
next reply other threads:[~2026-11-27 11:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 11:43 Jamal Hadi Salim [this message]
2026-11-27 11:43 ` [PATCH net v5 1/2] net/sched: act_gate: bound the cycle time and start time arithmetic 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ACT-WEXM.v5.r0.20261127063407@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shawnq1@163.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+0054fed3dc9085390f51@syzkaller.appspotmail.com \
--cc=victor@mojatatu.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox