The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: syzbot <syzbot+19d01f6082ec61dd45b2@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [syz test] net/sched: taprio: reject too-small software schedule intervals
Date: Tue, 11 Aug 2026 06:42:48 -0700	[thread overview]
Message-ID: <6a7b26d8.5aeeccc9.207e63.0017.GAE@google.com> (raw)
In-Reply-To: <68880766.050a0220.3cc461.000f.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [syz test] net/sched: taprio: reject too-small software schedule intervals
Author: junjie.cao@linux.dev

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git dd057113ac7ba5bdd2aed3d9405305911152f911

Signed-off-by: Junjie Cao <junjie.cao@intel.com>

diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 299234a5f0fe..f740918a3b17 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -259,6 +259,27 @@ static int length_to_duration(struct taprio_sched *q, int len)
 	return div_u64(len * atomic64_read(&q->picos_per_byte), PSEC_PER_NSEC);
 }
 
+/* Software schedules service one hrtimer expiry per entry; an interval
+ * shorter than the expiry servicing cost rearms the timer in the past
+ * and storms the CPU. 100us stays above that cost across configurations
+ * (sub-us with lockdep, more under KASAN) and below any practical
+ * schedule.
+ */
+#define TAPRIO_MIN_SW_INTERVAL_NS	(100 * NSEC_PER_USEC)
+
+static s64 taprio_min_interval(struct taprio_sched *q)
+{
+	s64 min_interval = length_to_duration(q, ETH_ZLEN);
+
+	/* Only pure software schedules arm the per-entry hrtimer. */
+	if (!FULL_OFFLOAD_IS_ENABLED(q->flags) &&
+	    !TXTIME_ASSIST_IS_ENABLED(q->flags))
+		min_interval = max_t(s64, min_interval,
+				     TAPRIO_MIN_SW_INTERVAL_NS);
+
+	return min_interval;
+}
+
 static int duration_to_length(struct taprio_sched *q, u64 duration)
 {
 	return div_u64(duration * PSEC_PER_NSEC, atomic64_read(&q->picos_per_byte));
@@ -1038,7 +1059,7 @@ static int fill_sched_entry(struct taprio_sched *q, struct nlattr **tb,
 			    struct sched_entry *entry,
 			    struct netlink_ext_ack *extack)
 {
-	int min_duration = length_to_duration(q, ETH_ZLEN);
+	s64 min_duration = taprio_min_interval(q);
 	u32 interval = 0;
 
 	if (tb[TCA_TAPRIO_SCHED_ENTRY_CMD])
@@ -1166,7 +1187,7 @@ static int parse_taprio_schedule(struct taprio_sched *q, struct nlattr **tb,
 		new->cycle_time = cycle;
 	}
 
-	if (new->cycle_time < new->num_entries * length_to_duration(q, ETH_ZLEN)) {
+	if (new->cycle_time < (s64)new->num_entries * taprio_min_interval(q)) {
 		NL_SET_ERR_MSG(extack, "'cycle_time' is too small");
 		return -EINVAL;
 	}

  reply	other threads:[~2026-08-11 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28 23:27 [syzbot] [kernfs?] [mm?] INFO: rcu detected stall in kernfs_fop_open (7) syzbot
2026-08-11 13:42 ` syzbot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-22  4:15 [syzbot] [mm?] INFO: rcu detected stall in sys_munmap (2) syzbot
2026-08-11 13:11 ` Forwarded: [syz test] net/sched: taprio: reject too-small software schedule intervals syzbot
2026-01-13 18:06 [syzbot] [bridge?] INFO: rcu detected stall in br_handle_frame (6) syzbot
2026-08-11 13:43 ` Forwarded: [syz test] net/sched: taprio: reject too-small software schedule intervals syzbot

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=6a7b26d8.5aeeccc9.207e63.0017.GAE@google.com \
    --to=syzbot+19d01f6082ec61dd45b2@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.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