From mboxrd@z Thu Jan 1 00:00:00 1970 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 EEEBA361967 for ; Thu, 17 Sep 2026 16:17:14 +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=1789661836; cv=none; b=Vf+XxV7fnSk5PPeB7omXWnCYGa43D/AIwqj7YcJaWRzYyxnkPAxDu/tcLyUaSGW1sdRa5PDFHZXdlXIFzilybm9RxQZpVntL2PFWsz47psObEI8Hfr+b5j9tpPRnA3ItnXE5iSBuisjuyUKWXo9ULVBjdedNR6LPG4cuLqNZCV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789661836; c=relaxed/simple; bh=aqByeQLCjM8J2wt7srg8wOH1jJQpDqXMTKPo7UtNpdc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FrM+/DFnf3yKgn18mo94pBQe9Of2zX8AszaUzQYJ39IRXDJgNiaATeu8miSvq5y4BHZj6+C1Q5cuZ2nbQ6PUgaOvOH7GT3yj4jGlzg7Uo/MvTyVSthpe+935Wb+JdXifV20ev4GPt+JGChZnxa+qybkmNZsrSUX2CghCPXKQkp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=noO1RKEv; 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="noO1RKEv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 501FD1F000FF; Thu, 17 Sep 2026 16:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789661834; bh=ABQHmgJcfDTtJcRlaNmsIkt2mPosGP5fi8v4qvd+9Yk=; h=From:To:Cc:Subject:Date:Reply-To; b=noO1RKEv8QolTwJkSoUwIsE5hRkqJSDjEz7LAUtamOpzDBI35AN5u2lbTsTXjjqO2 GakC4N1szCcln8LRpUIR4K3khVWhZXvJkfz/9uqB2UMkkICMZJ0GOQBs76J68HD5CQ jQeSP7/mtSIrMdbLF0ZCB+/hkvKOIM3/76VjchAM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-90125: smb: client: fix request buffer leak in smb2_new_read_req() Date: Thu, 17 Sep 2026 17:09:15 +0100 Message-ID: <2026091718-CVE-2026-90125-c8a7@gregkh> X-Mailer: git-send-email 2.55.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=4788; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0sQdMGEIYZNmv2/ysU48uLvoE4hlso7aMWGjAdOMYIo=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlrBIrErm2ef66XK+q2cZ9UhOtTtifzjkheEK2rf7tge qKgSGRwRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkQhHD/Jj/Oqf3R5vxLDSf W8yuvOODZabgbYb5ETOXbb99dMK36JOXmQWrtmTomH7+DwA= 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: smb: client: fix request buffer leak in smb2_new_read_req() smb2_new_read_req() allocates the request buffer with smb2_plain_req_init() but only publishes it to the caller with *buf = req at the very end of the function. Two error returns sit in between: rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, server, (void **) &req, total_len); if (rc) return rc; if (server == NULL) return -ECONNABORTED; [...] rdata->mr = smbd_register_mr(server->smbd_conn, &rdata->subreq.io_iter, true, need_invalidate); if (!rdata->mr) return -EAGAIN; On either of them the buffer is neither released nor handed back, so it is leaked. The caller cannot clean up after it: smb2_async_readv() does 'goto out' on a non-zero return, which skips the cifs_small_buf_release(buf) at async_readv_out, and buf has not been assigned at that point in any case. The write path has never had this problem. smb2_async_writev() registers the memory region inline and jumps to its release label instead of returning: wdata->mr = smbd_register_mr(...); if (!wdata->mr) { rc = -EAGAIN; goto async_writev_out; } Commit b7972092199f ("cifs: smbd: Retry on memory registration failure") changed both sides from -ENOBUFS to -EAGAIN in a single patch, which puts the two shapes next to each other. Only the -EAGAIN return is reachable in practice, because smb2_plain_req_init() calls smb2_reconnect() first and that already fails with -EIO when server is NULL, before anything is allocated. Both returns are given the same treatment here rather than leaving one of them correct only by accident. Because -EAGAIN is a replayable error, the failure also reaches the retry block at the end of smb2_async_readv(), which marks the subrequest NETFS_SREQ_NEED_RETRY, so a failing registration can be retried rather than ending the I/O, and every attempt that reaches it leaks another buffer. smb2_should_replay() short-circuits on tcon->retry, so on a hard mount the attempt count is not bounded by the retrans setting. Only the asynchronous read path is affected. The synchronous SMB2_read() caller passes rdata == NULL and the memory registration block is guarded on rdata. The memory registration failure path was pointed out by the Sashiko AI reviewer while it was reviewing an unrelated patch to smb2_async_readv(). The Linux kernel CVE team has assigned CVE-2026-90125 to this issue. Affected and fixed versions =========================== Issue introduced in 4.16 with commit bd3dcc6a22a9186ed78da51ce09e889803552189 and fixed in 6.6.157 with commit 58066940076b90c16e821fd6f9767cd979cbdb5e Issue introduced in 4.16 with commit bd3dcc6a22a9186ed78da51ce09e889803552189 and fixed in 6.12.110 with commit 12092ed28434bf41e08d41e3c5269eb6b337fc02 Issue introduced in 4.16 with commit bd3dcc6a22a9186ed78da51ce09e889803552189 and fixed in 6.18.52 with commit 442c5f1358ced0d4e716778ac06f1e323a7e4f21 Issue introduced in 4.16 with commit bd3dcc6a22a9186ed78da51ce09e889803552189 and fixed in 7.2.6 with commit 73f6bdb0380486ab37fe12cd74de20abfaf5d3ae Issue introduced in 4.16 with commit bd3dcc6a22a9186ed78da51ce09e889803552189 and fixed in 7.3-rc1 with commit deb6468f4164640e4dc875f008aa449cf55987a5 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-90125 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: fs/smb/client/smb2pdu.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/58066940076b90c16e821fd6f9767cd979cbdb5e https://git.kernel.org/stable/c/12092ed28434bf41e08d41e3c5269eb6b337fc02 https://git.kernel.org/stable/c/442c5f1358ced0d4e716778ac06f1e323a7e4f21 https://git.kernel.org/stable/c/73f6bdb0380486ab37fe12cd74de20abfaf5d3ae https://git.kernel.org/stable/c/deb6468f4164640e4dc875f008aa449cf55987a5