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 5FB6E21B9C5 for ; Mon, 20 Oct 2025 15:27:26 +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=1760974046; cv=none; b=LZ/IHkf44RZoTIYhTeMXi2BaxXL2ko1unpsSEzAkNbnohbSUZZQrzhMchqahYppGsZhQFm6O9Fxw5fcvlPRFVGU+5EOV/JyS/2LAYHDaHmjegpPVg84+NzVvZNm40/yD6BlI0j097CWGiPsoGs8P9WNujEIxYA2sywXcuA5EkOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760974046; c=relaxed/simple; bh=EA3QJtogpAsEqr3sm1iM6gg7njBeFDkAY2j9J+S63do=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=L0l8hk4IZ1QsqNgxEyNnT68T5PxZgfUfOcqkZctks8+MCkHrIALjYxGviTMZrQTLGTW3Ih5GPeiqyp2n2jpCSRVEJuVdGU2vyMIRwVT1n0E2uFq7yL6VRtsrhWV/YtIZy76+JfSvM1un9anWWNmqtObkyBRnjk+ijzvzH2/vYgs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xCvI/L3p; 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="xCvI/L3p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D17C4CEF9; Mon, 20 Oct 2025 15:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760974046; bh=EA3QJtogpAsEqr3sm1iM6gg7njBeFDkAY2j9J+S63do=; h=From:To:Cc:Subject:Date:Reply-to:From; b=xCvI/L3pv0oROf27jU3RxXTDpIhdtCBgc5/F4LVB+K/vcXB58RJoY0lEveMW1yoJo JCFp9fV1hBDmFR5UFqIL40UvpncUU5yN7Tm5EX95Mz0IUBsmaaWhSmf9J09jnzsa5J 0BOU9Wt1EQ/ghlJUb4LjyXRofaWwZYsVYvorO/tc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40012: net/smc: fix warning in smc_rx_splice() when calling get_page() Date: Mon, 20 Oct 2025 17:27:08 +0200 Message-ID: <2025102003-CVE-2025-40012-86b3@gregkh> X-Mailer: git-send-email 2.51.1.dirty 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=4095; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=fzVw/z0ji6nRk9EVHsXNbc247XGGCj8I/jU2ajiZFz0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnfQo4nNpfHzdy76k1MkEjkjxvLQ26eWN1S81Gf/cu2n 04P0j+7dsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEOr4zLJj/J3OJofQi172H g1oDj8T+s990VZphnsWJ6W3zt7ZtEut49sCy9Msrv8MKfgA= 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/smc: fix warning in smc_rx_splice() when calling get_page() smc_lo_register_dmb() allocates DMB buffers with kzalloc(), which are later passed to get_page() in smc_rx_splice(). Since kmalloc memory is not page-backed, this triggers WARN_ON_ONCE() in get_page() and prevents holding a refcount on the buffer. This can lead to use-after-free if the memory is released before splice_to_pipe() completes. Use folio_alloc() instead, ensuring DMBs are page-backed and safe for get_page(). WARNING: CPU: 18 PID: 12152 at ./include/linux/mm.h:1330 smc_rx_splice+0xaf8/0xe20 [smc] CPU: 18 UID: 0 PID: 12152 Comm: smcapp Kdump: loaded Not tainted 6.17.0-rc3-11705-g9cf4672ecfee #10 NONE Hardware name: IBM 3931 A01 704 (z/VM 7.4.0) Krnl PSW : 0704e00180000000 000793161032696c (smc_rx_splice+0xafc/0xe20 [smc]) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3 Krnl GPRS: 0000000000000000 001cee80007d3001 00077400000000f8 0000000000000005 0000000000000001 001cee80007d3006 0007740000001000 001c000000000000 000000009b0c99e0 0000000000001000 001c0000000000f8 001c000000000000 000003ffcc6f7c88 0007740003e98000 0007931600000005 000792969b2ff7b8 Krnl Code: 0007931610326960: af000000 mc 0,0 0007931610326964: a7f4ff43 brc 15,00079316103267ea #0007931610326968: af000000 mc 0,0 >000793161032696c: a7f4ff3f brc 15,00079316103267ea 0007931610326970: e320f1000004 lg %r2,256(%r15) 0007931610326976: c0e53fd1b5f5 brasl %r14,000793168fd5d560 000793161032697c: a7f4fbb5 brc 15,00079316103260e6 0007931610326980: b904002b lgr %r2,%r11 Call Trace: smc_rx_splice+0xafc/0xe20 [smc] smc_rx_splice+0x756/0xe20 [smc]) smc_rx_recvmsg+0xa74/0xe00 [smc] smc_splice_read+0x1ce/0x3b0 [smc] sock_splice_read+0xa2/0xf0 do_splice_read+0x198/0x240 splice_file_to_pipe+0x7e/0x110 do_splice+0x59e/0xde0 __do_splice+0x11a/0x2d0 __s390x_sys_splice+0x140/0x1f0 __do_syscall+0x122/0x280 system_call+0x6e/0x90 Last Breaking-Event-Address: smc_rx_splice+0x960/0xe20 [smc] ---[ end trace 0000000000000000 ]--- The Linux kernel CVE team has assigned CVE-2025-40012 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit f7a22071dbf316c982fb44308874bd7ad9ac2091 and fixed in 6.12.50 with commit 14fc4fdae42e34d7ee871b292ac2ecc61c2c5de7 Issue introduced in 6.10 with commit f7a22071dbf316c982fb44308874bd7ad9ac2091 and fixed in 6.16.10 with commit d5411685dc2f6ac7bdf01a0a204d56cae38c6cf6 Issue introduced in 6.10 with commit f7a22071dbf316c982fb44308874bd7ad9ac2091 and fixed in 6.17 with commit a35c04de2565db191726b5741e6b66a35002c652 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-40012 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/smc_loopback.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/14fc4fdae42e34d7ee871b292ac2ecc61c2c5de7 https://git.kernel.org/stable/c/d5411685dc2f6ac7bdf01a0a204d56cae38c6cf6 https://git.kernel.org/stable/c/a35c04de2565db191726b5741e6b66a35002c652