Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 426D92EB878 for ; Tue, 30 Dec 2025 12:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767097281; cv=none; b=bKizcRQq81hIj3hZOGB6r1RCwYUOKc9/519Br0lIFH9AGvhePTN9Kkmf9KXsMEC8gFQ61GYoWiSkYK72D8vOTqv2ScAWwvt9D7WTauRjjhw3RF0LkgDGNbG/0/RgsxxFQvo9gyu10UiBHwkrRarjIBBMashY1KaHLsYJavv+z9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767097281; c=relaxed/simple; bh=oUOSU+WmF40Lr9aa7SzX4JtDyCNRFjzQCfieATfi1RI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=snhV+AyZTNTZ2/iIYdv2YLihBzq2a5S29fLN1df69yzSJO+U+JziiJnuimX9HmvhlLCiialksHWsphaRglubCpvgigLhM5L0WemuvDYF8nFTQm8F72gEAHKl0ZrzqaSW6Je5L5Lweow2iI8cgqGGDdK+J6mlcF10uQLavFtNjzo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hMlule0k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hMlule0k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C32FFC113D0; Tue, 30 Dec 2025 12:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767097281; bh=oUOSU+WmF40Lr9aa7SzX4JtDyCNRFjzQCfieATfi1RI=; h=From:To:Cc:Subject:Date:Reply-To:From; b=hMlule0kaqspmhtH5cPSZFXqa2U5jiVeo2HLREUAc7f6ZggYMguFjBXICjrB5C4J1 t8vRIr/amH1eiwr7LFTw0m1qXCkYqkRATUpb0ZCngtA3zLeJ/AwGvYzQO4m7lTt59q VNK8RnasP/V+At3qc7ITTqAtlKvnn0pK78U5EByY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54251: net/sched: taprio: Limit TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME to INT_MAX. Date: Tue, 30 Dec 2025 13:20:17 +0100 Message-ID: <2025123054-CVE-2023-54251-2a3b@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5755; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=39cYntYRbNGv8WfaZOJNYVP7OUJpwe2/fn1jKe6A5JQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnBh7NuRZX3TNq66FzanyX66/8umeTzaOOc2VJimrbPW 7Q2v11+tCOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmUjSBYcF8k/OnbrXf+bit xYBf/WuIRvmN+dIMCy5+1LjNWBpmqBWcovT9jebLXwfyDgEA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net/sched: taprio: Limit TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME to INT_MAX. syzkaller found zero division error [0] in div_s64_rem() called from get_cycle_time_elapsed(), where sched->cycle_time is the divisor. We have tests in parse_taprio_schedule() so that cycle_time will never be 0, and actually cycle_time is not 0 in get_cycle_time_elapsed(). The problem is that the types of divisor are different; cycle_time is s64, but the argument of div_s64_rem() is s32. syzkaller fed this input and 0x100000000 is cast to s32 to be 0. @TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME={0xc, 0x8, 0x100000000} We use s64 for cycle_time to cast it to ktime_t, so let's keep it and set max for cycle_time. While at it, we prevent overflow in setup_txtime() and add another test in parse_taprio_schedule() to check if cycle_time overflows. Also, we add a new tdc test case for this issue. [0]: divide error: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 1 PID: 103 Comm: kworker/1:3 Not tainted 6.5.0-rc1-00330-g60cc1f7d0605 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:div_s64_rem include/linux/math64.h:42 [inline] RIP: 0010:get_cycle_time_elapsed net/sched/sch_taprio.c:223 [inline] RIP: 0010:find_entry_to_transmit+0x252/0x7e0 net/sched/sch_taprio.c:344 Code: 3c 02 00 0f 85 5e 05 00 00 48 8b 4c 24 08 4d 8b bd 40 01 00 00 48 8b 7c 24 48 48 89 c8 4c 29 f8 48 63 f7 48 99 48 89 74 24 70 <48> f7 fe 48 29 d1 48 8d 04 0f 49 89 cc 48 89 44 24 20 49 8d 85 10 RSP: 0018:ffffc90000acf260 EFLAGS: 00010206 RAX: 177450e0347560cf RBX: 0000000000000000 RCX: 177450e0347560cf RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000100000000 RBP: 0000000000000056 R08: 0000000000000000 R09: ffffed10020a0934 R10: ffff8880105049a7 R11: ffff88806cf3a520 R12: ffff888010504800 R13: ffff88800c00d800 R14: ffff8880105049a0 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0edf84f0e8 CR3: 000000000d73c002 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: get_packet_txtime net/sched/sch_taprio.c:508 [inline] taprio_enqueue_one+0x900/0xff0 net/sched/sch_taprio.c:577 taprio_enqueue+0x378/0xae0 net/sched/sch_taprio.c:658 dev_qdisc_enqueue+0x46/0x170 net/core/dev.c:3732 __dev_xmit_skb net/core/dev.c:3821 [inline] __dev_queue_xmit+0x1b2f/0x3000 net/core/dev.c:4169 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_resolve_output net/core/neighbour.c:1552 [inline] neigh_resolve_output+0x4a7/0x780 net/core/neighbour.c:1532 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0x924/0x17d0 net/ipv6/ip6_output.c:135 __ip6_finish_output+0x620/0xaa0 net/ipv6/ip6_output.c:196 ip6_finish_output net/ipv6/ip6_output.c:207 [inline] NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x206/0x410 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK.constprop.0+0xea/0x260 include/linux/netfilter.h:303 ndisc_send_skb+0x872/0xe80 net/ipv6/ndisc.c:508 ndisc_send_ns+0xb5/0x130 net/ipv6/ndisc.c:666 addrconf_dad_work+0xc14/0x13f0 net/ipv6/addrconf.c:4175 process_one_work+0x92c/0x13a0 kernel/workqueue.c:2597 worker_thread+0x60f/0x1240 kernel/workqueue.c:2748 kthread+0x2fe/0x3f0 kernel/kthread.c:389 ret_from_fork+0x2c/0x50 arch/x86/entry/entry_64.S:308 Modules linked in: The Linux kernel CVE team has assigned CVE-2023-54251 to this issue. Affected and fixed versions =========================== Issue introduced in 5.3 with commit 4cfd5779bd6efe8c76b4494aec63a063be0d2ff2 and fixed in 5.15.126 with commit f04f6d9b3b060f7e11219a65a76da65f1489e391 Issue introduced in 5.3 with commit 4cfd5779bd6efe8c76b4494aec63a063be0d2ff2 and fixed in 6.1.45 with commit 0b45af982a4df0b14fb8669ee2a871cfdfa6a39c Issue introduced in 5.3 with commit 4cfd5779bd6efe8c76b4494aec63a063be0d2ff2 and fixed in 6.4.10 with commit 57b3fe08ae06ef11af007b4a182629b12a961e30 Issue introduced in 5.3 with commit 4cfd5779bd6efe8c76b4494aec63a063be0d2ff2 and fixed in 6.5 with commit e739718444f7bf2fa3d70d101761ad83056ca628 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-54251 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/sched/sch_taprio.c tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/f04f6d9b3b060f7e11219a65a76da65f1489e391 https://git.kernel.org/stable/c/0b45af982a4df0b14fb8669ee2a871cfdfa6a39c https://git.kernel.org/stable/c/57b3fe08ae06ef11af007b4a182629b12a961e30 https://git.kernel.org/stable/c/e739718444f7bf2fa3d70d101761ad83056ca628