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 247772EE999 for ; Fri, 25 Jul 2025 15:30:07 +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=1753457407; cv=none; b=hUH3TnK2Y0NRzJVcDQ4o+gF15Yk9iqyg9qMLP9uTtAnpXDrKWWa3AK//NP53kzjKUXWznh72P+HcGalBRmfPBc4cJap/AlLm2EIv2iGLAJQS+9uJ6JwPaZvWLesDgoPY5WH+N6v6BXtogngfXb362dyDP2IkvW7v0Pm4qywgBk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753457407; c=relaxed/simple; bh=RZnXWPWDTSWboMmejP5SK79x+85PKp7TL8hSW2ERaXI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XV/GdxGExxdtmA8zc1jnpV7XiQO8WNTQUe2bMWHZU5QlOpv/Jylg/OI6+VKMpMtoeyYi3PjMca3PrKluOufWu7W4Ug+Q8VVGsg7FfFWM9v07eGhdMoBxIDU/zO+ZJCCNymU11XMnaxyjoPk9v5uuuJSZvMHB7W60Yhlygzjx1ow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EkJcV8YI; 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="EkJcV8YI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CBBCC4CEE7; Fri, 25 Jul 2025 15:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753457406; bh=RZnXWPWDTSWboMmejP5SK79x+85PKp7TL8hSW2ERaXI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=EkJcV8YI5/as7hOzUKPYNj0pPc6t6f9jHnPjRzfYe7S+aC98lf9kMjrUeW+49urAG Q2s2HLsUzP5YKkLnBN7C23/aFO0EDd5YakgTeJvbidVgYUc4D789W/r2Vcx215Hvys RyZKGxp3zl6kH9y9gdHfcrCg1ORSfEl735/Nmg0k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38464: tipc: Fix use-after-free in tipc_conn_close(). Date: Fri, 25 Jul 2025 17:28:26 +0200 Message-ID: <2025072508-CVE-2025-38464-44a1@gregkh> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=6836; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=p8UL1bGh8RiiSrlGWGBmTzBnjQkcPJ8gXNVl/HtxzT4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNizqa/LdbVjHO/G3/eG/M8WPfe6dbBm+7a/fsrsBki 8Xc7DM3dMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEHjozzDMXCVjUcOPYOWER HxFJg187pzVP92GY720o0LBEQfXEpfXfli54xRwSy+GlBwA= 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: tipc: Fix use-after-free in tipc_conn_close(). syzbot reported a null-ptr-deref in tipc_conn_close() during netns dismantle. [0] tipc_topsrv_stop() iterates tipc_net(net)->topsrv->conn_idr and calls tipc_conn_close() for each tipc_conn. The problem is that tipc_conn_close() is called after releasing the IDR lock. At the same time, there might be tipc_conn_recv_work() running and it could call tipc_conn_close() for the same tipc_conn and release its last ->kref. Once we release the IDR lock in tipc_topsrv_stop(), there is no guarantee that the tipc_conn is alive. Let's hold the ref before releasing the lock and put the ref after tipc_conn_close() in tipc_topsrv_stop(). [0]: BUG: KASAN: use-after-free in tipc_conn_close+0x122/0x140 net/tipc/topsrv.c:165 Read of size 8 at addr ffff888099305a08 by task kworker/u4:3/435 CPU: 0 PID: 435 Comm: kworker/u4:3 Not tainted 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 tipc_conn_close+0x122/0x140 net/tipc/topsrv.c:165 tipc_topsrv_stop net/tipc/topsrv.c:701 [inline] tipc_topsrv_exit_net+0x27b/0x5c0 net/tipc/topsrv.c:722 ops_exit_list+0xa5/0x150 net/core/net_namespace.c:153 cleanup_net+0x3b4/0x8b0 net/core/net_namespace.c:553 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 23: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] tipc_conn_alloc+0x43/0x4f0 net/tipc/topsrv.c:192 tipc_topsrv_accept+0x1b5/0x280 net/tipc/topsrv.c:470 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 23: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 tipc_conn_kref_release net/tipc/topsrv.c:150 [inline] kref_put include/linux/kref.h:70 [inline] conn_put+0x2cd/0x3a0 net/tipc/topsrv.c:155 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff888099305a00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff888099305a00, ffff888099305c00) The buggy address belongs to the page: page:ffffea000264c140 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00028b6b88 ffffea0002cd2b08 ffff88813bff0940 raw: 0000000000000000 ffff888099305000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888099305900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888099305980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888099305a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888099305a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888099305b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb The Linux kernel CVE team has assigned CVE-2025-38464 to this issue. Affected and fixed versions =========================== Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 5.4.296 with commit 03dcdd2558e1e55bf843822fe4363dcb48743f2b Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 5.10.240 with commit 15a6f4971e2f157d57e09ea748d1fbc714277aa4 Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 5.15.189 with commit dab8ded2e5ff41012a6ff400b44dbe76ccf3592a Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 6.1.146 with commit 1dbf7cd2454a28b1da700085b99346b5445aeabb Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 6.6.99 with commit be4b8392da7978294f2f368799d29dd509fb6c4d Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 6.12.39 with commit 50aa2d121bc2cfe2d825f8a331ea75dfaaab6a50 Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 6.15.7 with commit 3b89e17b2fd64012682bed158d9eb3d2e96dec42 Issue introduced in 3.11 with commit c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f and fixed in 6.16-rc6 with commit 667eeab4999e981c96b447a4df5f20bdf5c26f13 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-2025-38464 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/tipc/topsrv.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/03dcdd2558e1e55bf843822fe4363dcb48743f2b https://git.kernel.org/stable/c/15a6f4971e2f157d57e09ea748d1fbc714277aa4 https://git.kernel.org/stable/c/dab8ded2e5ff41012a6ff400b44dbe76ccf3592a https://git.kernel.org/stable/c/1dbf7cd2454a28b1da700085b99346b5445aeabb https://git.kernel.org/stable/c/be4b8392da7978294f2f368799d29dd509fb6c4d https://git.kernel.org/stable/c/50aa2d121bc2cfe2d825f8a331ea75dfaaab6a50 https://git.kernel.org/stable/c/3b89e17b2fd64012682bed158d9eb3d2e96dec42 https://git.kernel.org/stable/c/667eeab4999e981c96b447a4df5f20bdf5c26f13