From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84C8743E074 for ; Tue, 11 Aug 2026 13:11:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786453914; cv=none; b=PNgSDchvUOeZi9Nv+Z/2okg8TKTw3xulbsflJ009tO73PiSf+uvb+EAp/s0+vujo0W7hjfzhM48Ey5KY7xhMrDnXrZSS/kiKVpM5A3vc1pAoqIOF3h87bKgIjgjGdDePK1s5tc10JWWP/P+PxUx148rG9DD1HAi5I6H6b5tv7HQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786453914; c=relaxed/simple; bh=Zcq3aF8XZ6i6PmcwMiyuGS5yOP9EkrPMuQUO/uZwrnA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=BoY/GYbW7BLsbsW8hXXc6LmgFP0SIcTHKE2BOOMaeyQXYbbyl/eR8kvYYTEA0jEA6A+zDsbn9BBTu1pZhIqSN5+wnBjg8DE7KOd4gn78TGu40PfdSKqglOiiCj4bkpf1e021QbuHIXTA9nPtOOVpNE/4Th3k/CQv65M1pIty4yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.167.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-4a41f46d629so4015347b6e.3 for ; Tue, 11 Aug 2026 06:11:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786453911; x=1787058711; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=xhYejKbHwnV0lOVsNk3zgyrAx4sZV1tqqwKep48uB78=; b=PHagpduhuiCswn0yc3WLwe9iZAuuZvgFUHu3aAZTROwElLzqGgzhGHcRAvyHGFpRb8 RjuwkA1wJtDH/iYQPhrRoZvI7iSQIm4qZc6nWUXxaussfqL//DZjAVnnAiKpk97Lvu8d fZoh8S07EhiCkSKW/ChuxCb0hIpuBGTOFBYlwLizqHuL5iaLmczFi9IXZyJhSfkDf+bo 08Gviq8KodjPfqjEs9nlIl9mGNIR1Hl8PSL9+P5jEG28D3NUVmievYzWWr7W0CP6bFsU 3ZiirAsRk5UrYYC6MmVfr2cvkpBSQhaNUThYDpemNgcXglxiJKlSaChShh5y0VjcykHE X1tA== X-Gm-Message-State: AOJu0YyxtfGFMoPTmjeuXJBBOJaRdwhnp897eGyMcuY/JYvmsmdjzQAq aHckvki35kx/GKz0JaVis7ajhxjwBvFepNEL4v0Jw4KZppwmsGFV1DBFFhH+vY+Zw2OP56n5pao 3h5Vh9Br4GIHXLVNB8SK+wg0IHO2ajFj6pDarBoyv+wvBpDvXqsVvRJVONFM= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:308e:b0:4af:57e9:4ec6 with SMTP id 5614622812f47-4b1fd831fbamr2359952b6e.15.1786453911457; Tue, 11 Aug 2026 06:11:51 -0700 (PDT) Date: Tue, 11 Aug 2026 06:11:51 -0700 In-Reply-To: <68a7eee9.a00a0220.33401d.0168.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a7b1f97.01d0871a.3a0d52.00cb.GAE@google.com> Subject: Forwarded: [syz test] net/sched: taprio: reject too-small software schedule intervals From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" 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 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; }