Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795099211; b=zUFQbhSMyL1RRD3gSGT6PsoDdnDzrmSLqSjvoDwgS6MPdZ0Sk/J6is7YkIagjuhTZKEc 7HHefd+eOsFI7WBAxGFza8VnIDXx17v7oKjg9SbiPOaIVYwko1tD+7JAQayq2xocnC3so Bu5t58d9F1dECdeonHnlfQpmKl7TUVRxKfJLwwd6XGGZCb3jAzhDheY8un4BRcq6327t7 rDT6CpdyWoGwJVZPlqR6XLS0O10wNGkt/Ea1v23GZms+Rtso2u9QRaTwJyZ+y606dfLLd RMgd0MwiHryKzus+OYL4WR5h/ZIxOntQ03jo3u8gV9LXa4mwFqoBqZ6pYGVXB13X5yw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795099211; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=HKgaG5aGJsOKamzpCI4DYtjqMIpDLyIrMgSt3L2J5Q0=; b=ArBqoVKTfoz2UFwu6agQgIcfJhDr5WGruzbricTSrbkhBlQXnuqO78Rl8qCFNvYTSaeX os/LjkDi2GhA9ShrLdkdWT5K1Igu0xNvdlgbZwbgGxZ/x8zM20co5i14bxn1SlQeAw7te 46idNYfjh5gKVywTaUGNkOm4mo8xi6tis3T4lVALZfs++Pq27AZFCuZfL/72veuFm8X0d XGziftx0S3VAFUXdYQOL8dD1X9YbizksQ02XTP3GdPgs4OleN8vfabz0UspPydjJOmJ8p FqY8k1U0QQaZr1Chw0gsr9VHlGUlchOY7IfcCkpZXEuIK5ipOoaKicD74H0Bo8VRRHA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fSql1E3e; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23754606A33A for ; Thu, 19 Nov 2026 14:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fSql1E3e Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC0A11F000CA; Thu, 19 Nov 2026 14:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795099210; bh=HKgaG5aGJsOKamzpCI4DYtjqMIpDLyIrMgSt3L2J5Q0=; h=From:To:Cc:Subject:Date:Reply-To; b=fSql1E3es6YKMn0ZF6GfNx6fdgbYU9hbO/RdiLXLiXRicDEZNhiFhAJz21GVL+CrY 1OTbzYNgNjwm/kCB9D2kjEeLg+fsbiQaaP01I8ZDBWNxpa7c7YpuZvRxUi+I52UMon EO9PWOf9dQ4OuCmVlsFKBzdMDgIMlCPjTWSH54E0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99384: smb: client: fix OOB read of the resume name sent in TRANS2_FIND_NEXT2 Date: Thu, 19 Nov 2026 15:24:42 +0100 Message-ID: <2026111954-CVE-2026-99384-0909@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=7278; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0YELyD+SLui+mUt/ZxeHlWKFIs2iUKWifEGWfd3zHc8=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/2apYjmnM+NC7S+R0tf2Gd6FuaX82aK9cvqXp3TalV NVpxhfZO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAia14zzNPKtwra+Ue1KEwu Wl/j5J2dyz/fkmBYMC95htN9ZwW5nowTL3z2NkXP4be/AAA= 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 OOB read of the resume name sent in TRANS2_FIND_NEXT2 cifs_fill_dirent() reads the fixed part of a directory entry and the name length it holds, or for SMB_FIND_FILE_UNIX scans the name for its terminating NUL, without knowing where the response ends. cifs_save_resume_key() calls it for the entry at the LastNameOffset the server chose, after every FindNext and after the FindFirst of a search rewind, and records the name it returns as the resume name of the search without bounding it; the next CIFSFindNext() copies up to PATH_MAX - 1 bytes from that name into its request and sends them to the server. cifs_filldir() bounds the name against the end of the response since commit f8cf09a53a0d ("smb: client: bound dirent name against end of SMB response in cifs_filldir"), but only after cifs_fill_dirent() has read the entry, and nxt_dir_entry() checks the entries it walks only against sizeof(FILE_DIRECTORY_INFO), for every level but SMB_FIND_FILE_INFO_STANDARD, and never sees the first entry of a response. Bounding where last_entry starts, as the preceding patch does, does not bound the read. A last entry that starts within the final bytes of the response still has its fixed part read past the end of the received data, and the name length it declares, a __le32 for every level but SMB_FIND_FILE_INFO_STANDARD and SMB_FIND_FILE_UNIX, is recorded without being checked against anything. CIFSFindNext() rejects only a length of PATH_MAX or more, then copies the name, up to 4095 bytes, into its request and sends it, and as the report below shows that copy can run past the end of the cifs_request allocation that holds the response. For SMB_FIND_FILE_UNIX the name is in addition scanned for its terminating NUL over up to PATH_MAX + 1 UTF-16 units, or PATH_MAX bytes, before any check. The FindNext that carries the name is only sent by the SMB1 dialect, which is not negotiated by default; reaching it requires an explicit vers=1.0 mount. With KASAN enabled, a response whose last entry declares a name longer than the bytes that follow it gives: ================================================================== BUG: KASAN: slab-out-of-bounds in CIFSFindNext+0x8ca/0x14c0 Read of size 4080 at addr ffff88807c823f98 by task ls/83 CPU: 0 UID: 0 PID: 83 Comm: ls Not tainted 7.3.0-rc4-00457-gf14572c203d5 #69 PREEMPT(lazy) Call Trace: kasan_report+0xdf/0x1a0 kasan_check_range+0x10f/0x1e0 __asan_memcpy+0x23/0x60 CIFSFindNext+0x8ca/0x14c0 cifs_readdir+0xf51/0x29c0 iterate_dir+0x1c0/0x570 __x64_sys_getdents64+0x133/0x270 do_syscall_64+0x109/0x5d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 83 on cpu 1 at 13.497119s: cifs_buf_get+0x36/0x90 smb_init+0x4f/0x110 CIFSFindNext+0xf7/0x14c0 cifs_readdir+0xf51/0x29c0 The buggy address belongs to the object at ffff88807c820000 which belongs to the cache cifs_request of size 16588 The buggy address is located 16280 bytes inside of allocated 16588-byte region [ffff88807c820000, ffff88807c8240cc) ================================================================== The read is the memcpy() that copies the recorded name into the next request, so those bytes go to the server. Pass the end of the response to cifs_fill_dirent() and have it reject an entry whose fixed part does not fit or whose name extends past the end, before either is used, so that both callers are covered; cifs_save_resume_key() computes the end the same way cifs_readdir() does. The name bound compares the bytes left between the name and the end with the name length rather than adding the length to the name pointer, since the length is a 32-bit value taken from the entry and the sum could wrap on 32-bit systems. cifs_fill_dirent() is also used on the SMB2 readdir path; there smb2_parse_query_directory() has already checked every entry against the end of the response, so a valid SMB2 response is not rejected by the new checks. The check cifs_filldir() applies after the parse is left in place. The NUL scan for SMB_FIND_FILE_UNIX names is capped by a separate patch. An entry and its name lie inside the data area of the response, so a server that points LastNameOffset at the entry is not affected. One that points it at the file name, as MS-CIFS 2.2.6.2.2 describes, has its last entry rejected here; the listing is unaffected, because cifs_readdir() records the resume name from an entry it emitted, and before this series such a response could instead end the listing early, since a name length read from the wrong place is usually PATH_MAX or more, which CIFSFindNext() rejects with -EINVAL. On trees before v6.19 the type for the level 0x105 fixed part is spelled SEARCH_ID_FULL_DIR_INFO; adjust when backporting. The Linux kernel CVE team has assigned CVE-2026-99384 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.28 with commit 0752f1522a9120f731232919f7ad904e9e22b8ce and fixed in 6.12.118 with commit 0cc7589ab18a891eb9aa8621f76e1eb09a6d0704 Issue introduced in 2.6.28 with commit 0752f1522a9120f731232919f7ad904e9e22b8ce and fixed in 6.18.64 with commit 556c3a72f58e0ce4356d57301712cbcd7b2e4c65 Issue introduced in 2.6.28 with commit 0752f1522a9120f731232919f7ad904e9e22b8ce and fixed in 7.3.2 with commit 7141cde58f9dc15cf0869529ba2cb09fb0f082e5 Issue introduced in 2.6.28 with commit 0752f1522a9120f731232919f7ad904e9e22b8ce and fixed in 7.4-rc1 with commit f8171804a39ee89a11cd462f67862899de9c6b10 Issue introduced in 2.6.25.19 with commit bc15485e6a3cd20829cfa58bc9111e0bfc9cf303 Issue introduced in 2.6.26.7 with commit 282333bd7f759cdd9362e793b85db08780516416 Issue introduced in 2.6.27.2 with commit 92fa67e9260a65f69d868c4fcc92c9cee428c6f9 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-99384 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/readdir.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/0cc7589ab18a891eb9aa8621f76e1eb09a6d0704 https://git.kernel.org/stable/c/556c3a72f58e0ce4356d57301712cbcd7b2e4c65 https://git.kernel.org/stable/c/7141cde58f9dc15cf0869529ba2cb09fb0f082e5 https://git.kernel.org/stable/c/f8171804a39ee89a11cd462f67862899de9c6b10