All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+8785aaf121cfb2141e0d@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:11:51 -0700	[thread overview]
Message-ID: <6a7b1f97.01d0871a.3a0d52.00cb.GAE@google.com> (raw)
In-Reply-To: <68a7eee9.a00a0220.33401d.0168.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;
 	}

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

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22  4:15 [syzbot] [mm?] INFO: rcu detected stall in sys_munmap (2) syzbot
2025-08-22 12:08 ` Lorenzo Stoakes
2025-08-22 13:55   ` Harry Yoo
2025-08-28  0:29     ` Josh Poimboeuf
2025-08-28  1:57       ` Liam R. Howlett
2025-08-28  3:35         ` Liam R. Howlett
2025-08-28  2:05 ` Liam R. Howlett
2025-08-28  2:05   ` syzbot
2025-08-28  2:20 ` Liam R. Howlett
2025-08-28  3:08   ` syzbot
2025-12-19 19:37 ` syzbot
2026-08-11 13:11 ` syzbot [this message]
  -- strict thread matches above, loose matches on Subject: below --
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
2025-07-28 23:27 [syzbot] [kernfs?] [mm?] INFO: rcu detected stall in kernfs_fop_open (7) syzbot
2026-08-11 13:42 ` 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=6a7b1f97.01d0871a.3a0d52.00cb.GAE@google.com \
    --to=syzbot+8785aaf121cfb2141e0d@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.