Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 25972368D60 for ; Sun, 18 Oct 2026 15:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792337825; cv=none; b=YSVsWa3rPTnva3yZ2kH4DVWLWTcL7AXePgLVy9PJdRl0aG1nf+lJfk/UBH0KeFaUWIl6dB6YRDLn6Egu0vezhgEBmddo2JwThrdJE7/tHucNgBh7auHR110gSBM/o/eTFvkyjOeEaqzxRFOo2Ctk2Kaf84eNZgdezT6WZqTlD8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792337825; c=relaxed/simple; bh=L8XWlnGoU7XWb5xglDiqz4qTPngB09vEXfNYgEy+bQM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sutS8KnJUM3edBI+AXkgnZp5E/U4tkPdmMWFSsKPgFiOKyPZQ9kZf8+MeLfxe21V/hVLCUGtYMUZWhgA2x+JzcshYnTK2tCtYySvuMR64zHcvwK4BLvrm/2aBVvJlLixx3kSyWB8iXuUM+87dyd8FYNHmGkMAp7fyWlARUaDKSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=crn/H12B; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="crn/H12B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E6C61F000C4; Sun, 18 Oct 2026 15:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792337824; bh=tfZym6VH7V6Qe9LbBq5g4rBpUPXQLttdIHK0BTF2WSM=; h=From:To:Cc:Subject:Date:Reply-To; b=crn/H12B4wQzTYcxBNIoua3qW5gKE7U8u18CjwHutMV8zk/9JAtnIv2pFOQXU9MMC mpL6yec+7hPERHkNDNPw3Ay+q+0USfyi2GhPldh2rBs0VCOS8XYAkEa/JMvvTmoydy Khs0p4aejhVc9+5eRKlSJIGDAtttNxftaf4QqzMc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98646: tcp: Skip cond_resched() in inet_csk_listen_stop() under BPF context Date: Sun, 18 Oct 2026 17:18:30 +0200 Message-ID: <2026101847-CVE-2026-98646-815c@gregkh> X-Mailer: git-send-email 2.56.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=4611; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qfaGD5f+e/WWB4s0OQfBeYmZRZ48DWHY8J/RkBTPWPs=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlXHi32tE2oUF/8oaxryT8ei0ppF/8SPV51p2dS78V6+ v966K7uiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkohzDMs9ydOuXHsg3iorNu 370Rf89Ku8zIj2Ge8vEbv1e8svWeuWn6oovTzrDHTFCIAwA= 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: tcp: Skip cond_resched() in inet_csk_listen_stop() under BPF context bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If the sock is a listener that still has children in its accept queue, tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched() there trips the debug check: BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 locks held by test_progs/628: 3, last CPU#3: #0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210 #1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0 #2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0 CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT Tainted: [W]=WARN Call Trace: dump_stack_lvl+0xc1/0xf0 dump_stack+0x10/0x20 __might_resched+0x3d2/0x610 inet_csk_listen_stop+0x7b/0xbf0 tcp_abort+0x23b/0x3b0 bpf_sock_destroy+0xfc/0x140 bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a bpf_iter_run_prog+0x538/0xde0 bpf_iter_tcp_seq_show+0x26b/0x4b0 bpf_seq_read+0x424/0x1210 vfs_read+0x197/0xe40 ksys_read+0x119/0x240 __x64_sys_read+0x72/0xc0 x64_sys_call+0x647/0x27e0 do_syscall_64+0xe5/0x610 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fad39b28aca RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014 RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000 The commit that added the kfunc already guards lock_sock() in tcp_abort() and udp_abort() with has_current_bpf_ctx(), but missed the listener path. Do the same for the cond_resched(). The loop runs inside the iterator's rcu_read_lock(), it must not reschedule or report a quiescent state there. The Linux kernel CVE team has assigned CVE-2026-98646 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b and fixed in 6.6.158 with commit 23da88d1597ee7fdda373e1530284b763710911f Issue introduced in 6.5 with commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b and fixed in 6.12.112 with commit 5b52417c6196e05618a3b5d9753dbed9adef0166 Issue introduced in 6.5 with commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b and fixed in 6.18.55 with commit 55bbebf2829c3f47c5a48fc261740301d0f25f48 Issue introduced in 6.5 with commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b and fixed in 7.2.9 with commit ee7246bccb9da66076dd8094daa48bdc761d6b76 Issue introduced in 6.5 with commit 4ddbcb886268af8d12a23e6640b39d1d9c652b1b and fixed in 7.3-rc5 with commit eaab8cab451b9502ce224cd202550375b894a467 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-2026-98646 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/ipv4/inet_connection_sock.c 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/23da88d1597ee7fdda373e1530284b763710911f https://git.kernel.org/stable/c/5b52417c6196e05618a3b5d9753dbed9adef0166 https://git.kernel.org/stable/c/55bbebf2829c3f47c5a48fc261740301d0f25f48 https://git.kernel.org/stable/c/ee7246bccb9da66076dd8094daa48bdc761d6b76 https://git.kernel.org/stable/c/eaab8cab451b9502ce224cd202550375b894a467