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 5BFA33BED6E for ; Fri, 1 May 2026 13:57:30 +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=1777643850; cv=none; b=XaUDX+9rG+6l03cF0bvF4U+TmTF+5WZxkdHeGPzrb6Tem+kNKpL01USlvXPxqvxzMwfs/tSvwCSBLJzMGUFOlJPRUgDTr+mAK93oeVldKfZFT4zVClIArAIh80Ab+VYUw/W6flZwtXV4JD7l/RA2lJCYrE8zZNqYQ9vzuLAZmeI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777643850; c=relaxed/simple; bh=AB+eNMod3kMpPNP/oyH6iq53VVKeXluSNwT+TQLDbpo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EYBZjOrIPBvoMnzoMIurWOt/L1j69ckUfzgCiH00i2G3poV4+xGLsJSWzyK/CLK1pYFuOBgdyutqV9/5cXDHWLFVpU+8vATGysAIfGhrs/78HmAZ8nTtEnlpINOB9mtZ6cr4zc//4xBvMXwR937CHpiP4RvctmG5pVB/vAMRTdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aeBEcmNf; 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="aeBEcmNf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8628C2BCB4; Fri, 1 May 2026 13:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777643850; bh=AB+eNMod3kMpPNP/oyH6iq53VVKeXluSNwT+TQLDbpo=; h=From:To:Cc:Subject:Date:Reply-To:From; b=aeBEcmNfWzvOLoP4AaKAfV6am8ss0e9NSUooa06SZuEMQpRaok+Jq8VDuDmE6U7/F Xm9DkGflE2aKPv5goL+MrWJRsp26syl4CE8kR1X8czYhJZMPOpeVmaElQLBJUbuqFG I90CJj7ckB6tHozSRA8lhryjNCeJhwBL0SPPJ3oM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31705: ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment Date: Fri, 1 May 2026 15:56:27 +0200 Message-ID: <2026050121-CVE-2026-31705-5bdc@gregkh> X-Mailer: git-send-email 2.54.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=3784; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=VnrOyQC+Iqh7nWB4huskkdlFjPcjG99yc58SUF8LMfo=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlfNrIGhLzR6pezXbSa9cdbn5W3pigdWK70aO7JN+mTS s++E9l9qCOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmkrmUYcHijD3unZOZPCZd WbHNV0yJ86iizk2GBZPrFxSrdZe+OvRtYvIF+eP7YsqUJQA= 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: ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment smb2_get_ea() applies 4-byte alignment padding via memset() after writing each EA entry. The bounds check on buf_free_len is performed before the value memcpy, but the alignment memset fires unconditionally afterward with no check on remaining space. When the EA value exactly fills the remaining buffer (buf_free_len == 0 after value subtraction), the alignment memset writes 1-3 NUL bytes past the buf_free_len boundary. In compound requests where the response buffer is shared across commands, the first command (e.g., READ) can consume most of the buffer, leaving a tight remainder for the QUERY_INFO EA response. The alignment memset then overwrites past the physical kvmalloc allocation into adjacent kernel heap memory. Add a bounds check before the alignment memset to ensure buf_free_len can accommodate the padding bytes. This is the same bug pattern fixed by commit beef2634f81f ("ksmbd: fix potencial OOB in get_file_all_info() for compound requests") and commit fda9522ed6af ("ksmbd: fix OOB write in QUERY_INFO for compound requests"), both of which added bounds checks before unconditional writes in QUERY_INFO response handlers. The Linux kernel CVE team has assigned CVE-2026-31705 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d and fixed in 6.6.136 with commit ffbce350c6fd1e99116ea57383b9031717e36d3b Issue introduced in 6.6 with commit e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d and fixed in 6.12.84 with commit 98f3de6ef4efbd899348d333f0902dc4ff14380c Issue introduced in 6.6 with commit e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d and fixed in 6.18.25 with commit 790304c02bf9bd7b8171feda4294d6e62d32ae8f Issue introduced in 6.6 with commit e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d and fixed in 7.0.2 with commit 922d48fe8c19f388ffa2f709f33acaae4e408de2 Issue introduced in 6.6 with commit e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d and fixed in 7.1-rc1 with commit 30010c952077a1c89ecdd71fc4d574c75a8f5617 Issue introduced in 5.15.145 with commit f2283680a80571ca82d710bc6ecd8f8beac67d63 Issue introduced in 6.1.71 with commit 9f297df20d93411c0b4ddad7f88ba04a7cd36e77 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-31705 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/server/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/ffbce350c6fd1e99116ea57383b9031717e36d3b https://git.kernel.org/stable/c/98f3de6ef4efbd899348d333f0902dc4ff14380c https://git.kernel.org/stable/c/790304c02bf9bd7b8171feda4294d6e62d32ae8f https://git.kernel.org/stable/c/922d48fe8c19f388ffa2f709f33acaae4e408de2 https://git.kernel.org/stable/c/30010c952077a1c89ecdd71fc4d574c75a8f5617