From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796388277; b=31gQnn0ItWoqQajiElAsMU8dpKOPScQTuSVekaq+jnS+5sbK11rWN5T2rBkbMkGBILzF CHB98DlJPHk3dr9FFOwUyqSEo8Wh74RNN3WWOm2uhmRle/UD2E8nNwN862bef5q2Nhphd MA1k+OUW4jtsDP/HLunzsVJw0uU8NVyhhOJRtzmXZ7qkm9NIsCDi/bdt3cTrInnjgY/YS bLKb4FsDYHOVdYLSIJ7oNpEfQtyaA0f6q9Vy28YChSQXQ9ShP2kU4Hi7dDsBsF+S7y8xV ok2mgpkeqgsR0a/GFVp/SwDokAkMz5lrvyP1XiMizXQT+PRxogBMjhFaRrSj/q2q3fg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388277; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=/5gLgBQySq2SGPCsoH5Km9fcVvE4M50sJLLzzIPW56M=; b=N8jicHfWYbFkWRC9DpD35PAfZhApiGDogRrLv8RNtph77BBJkkMKzZVY/TFp3v8bezgp oXOppk3DZf5F963izPTeTu3llIqdjIUb7lvv3cZOyj0GMq8WroSerF6a4LOirdDA15jAp XDF4UHH2O4mhRQlFuLCi9pX9avh4ax9IH2SQiVAVYALxF772UpJMS6+ZvyWOm8eFVTad0 BrD4uaCGL2RlgtrstKzbhN1Huvv7S8iqp8n73z8jbF8NYhUiLufB3onliadjk1Huyg6+Z 0sJmS4kdoVyOO/aD6aBmjF3eiLyq0P2qJYSIdr8dE1wUTykg5yUS+aG5JP1I8J4DbQA== 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=DKfaFNIq; 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 565B6606A32C; Fri, 4 Dec 2026 12:44:37 +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=DKfaFNIq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A7141F00897; Fri, 4 Dec 2026 12:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388276; bh=/5gLgBQySq2SGPCsoH5Km9fcVvE4M50sJLLzzIPW56M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DKfaFNIqICirUHU26pvazYTCFhTPNphUeFj/00QKmqab/Qv5WV4G6lYRFB3T9Kp6J qzkVss0ONC9L7K+xGUcWGNPIy9evIID+fdPuC5xhW+5SI6nazpitmnioQmHUvoQDqk bTkW/givWITd/lS5KzHQZ9FFe95lFUs0vYyw2T3E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Namjae Jeon , Yifan Zhang , Paulo Alcantara Subject: [PATCH 6.1 0554/1059] smb: client: bound invalid NTLMSSP signature diagnostic Date: Fri, 4 Dec 2026 19:01:25 +0900 Message-ID: <20261204100658.538679811@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yifan Zhang commit 0584b02669c3e76188097174b4f25ed13723e94c upstream. The NTLMSSP Signature field is an eight-byte binary value and need not be NUL-terminated. decode_ntlmssp_challenge() prints it with %s on the signature-mismatch path, so the diagnostic can continue beyond the received blob until it encounters a zero byte. KASAN reports: BUG: KASAN: slab-out-of-bounds in string Read of size 1 string vsnprintf _printk decode_ntlmssp_challenge Print the fixed-width field with the bounded hexadecimal format. The patched kernel reaches the invalid-signature path and returns -EINVAL without a KASAN report. Fixes: 0b3cc858003b ("[CIFS] NTLMSSP reenabled after move from connect.c to sess.c") Reviewed-by: Namjae Jeon Signed-off-by: Yifan Zhang Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/sess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -937,8 +937,8 @@ int decode_ntlmssp_challenge(char *bcc_p } if (memcmp(pblob->Signature, "NTLMSSP", 8)) { - cifs_dbg(VFS, "blob signature incorrect %s\n", - pblob->Signature); + cifs_dbg(VFS, "%s: blob signature incorrect: %8phN\n", + __func__, pblob->Signature); return -EINVAL; } if (pblob->MessageType != NtLmChallenge) {