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 827AC2E6CC1 for ; Wed, 1 Oct 2025 11:56:42 +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=1759319802; cv=none; b=Ho5iU/VsvC2My2Cn96o+HIwW8mEw6UaUgBxLwlNock6ReunPrvurCZ4zeCidmrlY1T5I3bh3LiCeGENZn9wziaE/rJ0b5OVUKRsg1QcVlyw0KFFQU+3dv6Ep9srhdeJet9gBM4We7+4057KGefmnulc4haLNj/48XgBCPIRNgvM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759319802; c=relaxed/simple; bh=T1XZKVuMSYK5TMgJoRu4op56NToH5vuM91CeJDNjT1c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wy2+NqhSakFs4YTnk30D45NNX6vuYkImMUMZNAUn3HxhcRvsXy7Zvdnx0XU9udT8HFlNZv25GGOdLkKRcyotxldAeHPyjcIoHaI1wqn/C5VOkHRk0Kz2Zfq6wCiYFB0XEbl1puxjsIz4tjOCLS3tfff8KwalSxUcopr/+qTKEmM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lv43+By4; 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="Lv43+By4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F20C116C6; Wed, 1 Oct 2025 11:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759319802; bh=T1XZKVuMSYK5TMgJoRu4op56NToH5vuM91CeJDNjT1c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Lv43+By4JYiwiddpYC0ZOD5zOnbPecw3cW6DbKoWV0XaKdSmqss5ueXlg7IvUXrqq TNzqyo3rLpK4CIUezbbXGUZs6U1y1qmSFu2GC5eUmJiqx5YgbuTHII9BOuCx9Rr9cO fmxBAa5utQvlqk5jZzuCX4lqBT0+8QnrOS5RmD6Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53500: xfrm: fix slab-use-after-free in decode_session6 Date: Wed, 1 Oct 2025 13:45:52 +0200 Message-ID: <2025100126-CVE-2023-53500-61b6@gregkh> X-Mailer: git-send-email 2.51.0 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=5955; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=jh4lChGtD4q5XzlJWv6SPzIQkjUCUYFp9m/SLCfrbC8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl3RcJqe2R+rbzPzP24Pz8iZ02wwaLmuOtfHaOvxhkZv 3ERnLe7I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYiaMGwYHoLi/2dlQZxr+vr Xn1ufX6/f5HfQoYFE6rKw8pfrTrK/cb26o+/31UnXizSAQA= 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: xfrm: fix slab-use-after-free in decode_session6 When the xfrm device is set to the qdisc of the sfb type, the cb field of the sent skb may be modified during enqueuing. Then, slab-use-after-free may occur when the xfrm device sends IPv6 packets. The stack information is as follows: BUG: KASAN: slab-use-after-free in decode_session6+0x103f/0x1890 Read of size 1 at addr ffff8881111458ef by task swapper/3/0 CPU: 3 PID: 0 Comm: swapper/3 Not tainted 6.4.0-next-20230707 #409 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: dump_stack_lvl+0xd9/0x150 print_address_description.constprop.0+0x2c/0x3c0 kasan_report+0x11d/0x130 decode_session6+0x103f/0x1890 __xfrm_decode_session+0x54/0xb0 xfrmi_xmit+0x173/0x1ca0 dev_hard_start_xmit+0x187/0x700 sch_direct_xmit+0x1a3/0xc30 __qdisc_run+0x510/0x17a0 __dev_queue_xmit+0x2215/0x3b10 neigh_connected_output+0x3c2/0x550 ip6_finish_output2+0x55a/0x1550 ip6_finish_output+0x6b9/0x1270 ip6_output+0x1f1/0x540 ndisc_send_skb+0xa63/0x1890 ndisc_send_rs+0x132/0x6f0 addrconf_rs_timer+0x3f1/0x870 call_timer_fn+0x1a0/0x580 expire_timers+0x29b/0x4b0 run_timer_softirq+0x326/0x910 __do_softirq+0x1d4/0x905 irq_exit_rcu+0xb7/0x120 sysvec_apic_timer_interrupt+0x97/0xc0 asm_sysvec_apic_timer_interrupt+0x1a/0x20 RIP: 0010:intel_idle_hlt+0x23/0x30 Code: 1f 84 00 00 00 00 00 f3 0f 1e fa 41 54 41 89 d4 0f 1f 44 00 00 66 90 0f 1f 44 00 00 0f 00 2d c4 9f ab 00 0f 1f 44 00 00 fb f4 44 89 e0 41 5c c3 66 0f 1f 44 00 00 f3 0f 1e fa 41 54 41 89 d4 RSP: 0018:ffffc90000197d78 EFLAGS: 00000246 RAX: 00000000000a83c3 RBX: ffffe8ffffd09c50 RCX: ffffffff8a22d8e5 RDX: 0000000000000001 RSI: ffffffff8d3f8080 RDI: ffffe8ffffd09c50 RBP: ffffffff8d3f8080 R08: 0000000000000001 R09: ffffed1026ba6d9d R10: ffff888135d36ceb R11: 0000000000000001 R12: 0000000000000001 R13: ffffffff8d3f8100 R14: 0000000000000001 R15: 0000000000000000 cpuidle_enter_state+0xd3/0x6f0 cpuidle_enter+0x4e/0xa0 do_idle+0x2fe/0x3c0 cpu_startup_entry+0x18/0x20 start_secondary+0x200/0x290 secondary_startup_64_no_verify+0x167/0x16b Allocated by task 939: kasan_save_stack+0x22/0x40 kasan_set_track+0x25/0x30 __kasan_slab_alloc+0x7f/0x90 kmem_cache_alloc_node+0x1cd/0x410 kmalloc_reserve+0x165/0x270 __alloc_skb+0x129/0x330 inet6_ifa_notify+0x118/0x230 __ipv6_ifa_notify+0x177/0xbe0 addrconf_dad_completed+0x133/0xe00 addrconf_dad_work+0x764/0x1390 process_one_work+0xa32/0x16f0 worker_thread+0x67d/0x10c0 kthread+0x344/0x440 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff888111145800 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 239 bytes inside of freed 640-byte region [ffff888111145800, ffff888111145a80) As commit f855691975bb ("xfrm6: Fix the nexthdr offset in _decode_session6.") showed, xfrm_decode_session was originally intended only for the receive path. IP6CB(skb)->nhoff is not set during transmission. Therefore, set the cb field in the skb to 0 before sending packets. The Linux kernel CVE team has assigned CVE-2023-53500 to this issue. Affected and fixed versions =========================== Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 4.19.293 with commit da4cbaa75ed088b6d70db77b9103a27e2359e243 Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 5.4.255 with commit db0e50741f0387f388e9ec824ea7ae8456554d5b Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 5.10.192 with commit bafa236380816b41b2c4c6970d9067fefa4a6c9e Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 5.15.128 with commit 44b3d40967009304617a7a6486490c1d6c12f899 Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 6.1.47 with commit 0d27567fde5be5f0edc2db5c110142b7915b8fa8 Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 6.4.12 with commit 86f15300a22656db3fa8c8967defbcd24fac4d37 Issue introduced in 3.19 with commit f855691975bb06373a98711e4cfe2c224244b536 and fixed in 6.5 with commit 53223f2ed1ef5c90dad814daaaefea4e68a933c8 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-53500 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/xfrm/xfrm_interface_core.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/da4cbaa75ed088b6d70db77b9103a27e2359e243 https://git.kernel.org/stable/c/db0e50741f0387f388e9ec824ea7ae8456554d5b https://git.kernel.org/stable/c/bafa236380816b41b2c4c6970d9067fefa4a6c9e https://git.kernel.org/stable/c/44b3d40967009304617a7a6486490c1d6c12f899 https://git.kernel.org/stable/c/0d27567fde5be5f0edc2db5c110142b7915b8fa8 https://git.kernel.org/stable/c/86f15300a22656db3fa8c8967defbcd24fac4d37 https://git.kernel.org/stable/c/53223f2ed1ef5c90dad814daaaefea4e68a933c8