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 92D281D9A5F for ; Tue, 9 Dec 2025 00:03:09 +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=1765238589; cv=none; b=E8MgeEMXDhsbq2m1fWMItFygVWpJOhFE/x0aKZSlW73ekZY33o8VsnobfuHk1uYsw4vI30XuOUagsLsUTNNJG4NfDEl3Uo/BuoytFOgUJBVMaheyU1j69Ai/PI559DkTo1p76qpKb4j2WkferLBlX0V1Cy9yk0wkslaE78HAOSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238589; c=relaxed/simple; bh=AlJhCHXZVnI9Cthed3povyhrMKlZvPt4hCyewdzrOVg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aqmOnfp/sSMDg2xJH2L7KR1DB8YPT0Wd/EMEG3bNOjF3m5QqZRYAAlcYrKbi4KPcG4995Ks8FxOcpDlgDwOiYElOAOQKoQlflQ4Qb+U8nC2H1wV9upwP9QpXoM1jo2nrqMnrIN23ZqgrOJWjA0rq7pazd1+F0DMkAtvoWZRl2KM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iK/A6mIc; 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="iK/A6mIc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FD40C4CEF1; Tue, 9 Dec 2025 00:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238589; bh=AlJhCHXZVnI9Cthed3povyhrMKlZvPt4hCyewdzrOVg=; h=From:To:Cc:Subject:Date:Reply-To:From; b=iK/A6mIcqubGIZS9yxSsfvkzSDNgaMC4lilvzIjDozaAbp8LFsBeofAKfiGjzwbEQ LLFS0sKKBMjRuTwCd+8+pxorpdTCivozeWhZ6xGi+51C1dp6qKtpasUvR316/p/UHY P+JzEGYwN4aZO3g27+IDBheswMXWZfPR7NQkx4Ss= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53781: smc: Fix use-after-free in tcp_write_timer_handler(). Date: Tue, 9 Dec 2025 09:02:02 +0900 Message-ID: <2025120939-CVE-2023-53781-cb1d@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=4384; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2Z5SE6Twbn9UOfe3qBC2yrYQfc44BbksNGDOQm435e0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmaY9Tstsa4g1ddTy3tfYc6uLc4R685v+ljJtvv740e TYprCC/I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbS8p1hvoPlbbNE62v823M5 2p5mTjV+VS7owbBgQRivmJah9+a1D4xNb3xMqZE7PSMVAA== 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: smc: Fix use-after-free in tcp_write_timer_handler(). With Eric's ref tracker, syzbot finally found a repro for use-after-free in tcp_write_timer_handler() by kernel TCP sockets. [0] If SMC creates a kernel socket in __smc_create(), the kernel socket is supposed to be freed in smc_clcsock_release() by calling sock_release() when we close() the parent SMC socket. However, at the end of smc_clcsock_release(), the kernel socket's sk_state might not be TCP_CLOSE. This means that we have not called inet_csk_destroy_sock() in __tcp_close() and have not stopped the TCP timers. The kernel socket's TCP timers can be fired later, so we need to hold a refcnt for net as we do for MPTCP subflows in mptcp_subflow_create_socket(). [0]: leaked reference. sk_alloc (./include/net/net_namespace.h:335 net/core/sock.c:2108) inet_create (net/ipv4/af_inet.c:319 net/ipv4/af_inet.c:244) __sock_create (net/socket.c:1546) smc_create (net/smc/af_smc.c:3269 net/smc/af_smc.c:3284) __sock_create (net/socket.c:1546) __sys_socket (net/socket.c:1634 net/socket.c:1618 net/socket.c:1661) __x64_sys_socket (net/socket.c:1672) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) ================================================================== BUG: KASAN: slab-use-after-free in tcp_write_timer_handler (net/ipv4/tcp_timer.c:378 net/ipv4/tcp_timer.c:624 net/ipv4/tcp_timer.c:594) Read of size 1 at addr ffff888052b65e0d by task syzrepro/18091 CPU: 0 PID: 18091 Comm: syzrepro Tainted: G W 6.3.0-rc4-01174-gb5d54eb5899a #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.amzn2022.0.1 04/01/2014 Call Trace: dump_stack_lvl (lib/dump_stack.c:107) print_report (mm/kasan/report.c:320 mm/kasan/report.c:430) kasan_report (mm/kasan/report.c:538) tcp_write_timer_handler (net/ipv4/tcp_timer.c:378 net/ipv4/tcp_timer.c:624 net/ipv4/tcp_timer.c:594) tcp_write_timer (./include/linux/spinlock.h:390 net/ipv4/tcp_timer.c:643) call_timer_fn (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/timer.h:127 kernel/time/timer.c:1701) __run_timers.part.0 (kernel/time/timer.c:1752 kernel/time/timer.c:2022) run_timer_softirq (kernel/time/timer.c:2037) __do_softirq (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/irq.h:142 kernel/softirq.c:572) __irq_exit_rcu (kernel/softirq.c:445 kernel/softirq.c:650) irq_exit_rcu (kernel/softirq.c:664) sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1107 (discriminator 14)) The Linux kernel CVE team has assigned CVE-2023-53781 to this issue. Affected and fixed versions =========================== Issue introduced in 4.11 with commit ac7138746e14137a451f8539614cdd349153e0c0 and fixed in 6.2.12 with commit 1cc41c8acfc1ee30b4868559058db97fa44b0137 Issue introduced in 4.11 with commit ac7138746e14137a451f8539614cdd349153e0c0 and fixed in 6.3 with commit 9744d2bf19762703704ecba885b7ac282c02eacf 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-53781 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/smc/af_smc.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/1cc41c8acfc1ee30b4868559058db97fa44b0137 https://git.kernel.org/stable/c/9744d2bf19762703704ecba885b7ac282c02eacf