From mboxrd@z Thu Jan 1 00:00:00 1970 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 48BBB38BF9B for ; Mon, 9 Mar 2026 10:27:55 +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=1773052075; cv=none; b=oNUcDtNk/qJNr+8i3xEz9Apky4oLRDeUvgzVX/HUlVwZjk9CJIWVDQ6P1Xeq5XHy22y2V0FQOlgFGLrhTJVMiSoflaF/Om/Lw9lzs78ECsTk8KHTOvsj4bXGfL0O0sItqGGcgeUTD6Cwlfu0VOydG18HZna6dIbEl4E9HT/jJdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773052075; c=relaxed/simple; bh=WPFUapV4uzibynF+TAogzdVRMkOVBIceikfqGK4ESC0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=oAPk6tNriI5RMFiHl4ZrIsyo5Ac4ClCmMBwkV85uEHKbJcWTScpTs1n+IhuJFHY+dx3cKRzI0R4cWJGrjPzhMPMXT7/Eby6rBLzwB6o4lceHwBvNfWMlOcTcrd1x1BASX4b2+rmKkxpIaOB0+FdmuU5BupWTz9Ox9Qg1TL6XwrU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zZhZVmha; 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="zZhZVmha" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1840C4CEF7; Mon, 9 Mar 2026 10:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773052075; bh=WPFUapV4uzibynF+TAogzdVRMkOVBIceikfqGK4ESC0=; h=Subject:To:Cc:From:Date:From; b=zZhZVmhal6evthweN5zFKnKlq++h7hduigHhrhuY8cgd7+Q6NuoFOPLf30wQV+pIL WtnXl09lzNdudOrq6gWB6VKFXdSGyc12ZWQihX18sRVASdkRy1JmLfPVrd1RY1nvib bZIcb8Ez4NqFyxfS6v7u0lixBfEtJ+SVo6AGNNWI= Subject: FAILED: patch "[PATCH] smb: client: Compare MACs in constant time" failed to apply to 6.6-stable tree To: ebiggers@kernel.org,pc@manguebit.org,stfrench@microsoft.com Cc: From: Date: Mon, 09 Mar 2026 11:27:35 +0100 Message-ID: <2026030934-algebra-unrest-318e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 26bc83b88bbbf054f0980a4a42047a8d1e210e4c # git commit -s git send-email --to '' --in-reply-to '2026030934-algebra-unrest-318e@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 26bc83b88bbbf054f0980a4a42047a8d1e210e4c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Feb 2026 20:27:02 -0800 Subject: [PATCH] smb: client: Compare MACs in constant time To prevent timing attacks, MAC comparisons need to be constant-time. Replace the memcmp() with the correct function, crypto_memneq(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Acked-by: Paulo Alcantara (Red Hat) Signed-off-by: Eric Biggers Signed-off-by: Steve French diff --git a/fs/smb/client/smb1encrypt.c b/fs/smb/client/smb1encrypt.c index 0dbbce2431ff..bf10fdeeedca 100644 --- a/fs/smb/client/smb1encrypt.c +++ b/fs/smb/client/smb1encrypt.c @@ -11,6 +11,7 @@ #include #include +#include #include "cifsproto.h" #include "smb1proto.h" #include "cifs_debug.h" @@ -131,7 +132,7 @@ int cifs_verify_signature(struct smb_rqst *rqst, /* cifs_dump_mem("what we think it should be: ", what_we_think_sig_should_be, 16); */ - if (memcmp(server_response_sig, what_we_think_sig_should_be, 8)) + if (crypto_memneq(server_response_sig, what_we_think_sig_should_be, 8)) return -EACCES; else return 0; diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c index 8b9000a83181..81be2b226e26 100644 --- a/fs/smb/client/smb2transport.c +++ b/fs/smb/client/smb2transport.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "cifsglob.h" #include "cifsproto.h" #include "smb2proto.h" @@ -617,7 +618,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) if (rc) return rc; - if (memcmp(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE)) { + if (crypto_memneq(server_response_sig, shdr->Signature, + SMB2_SIGNATURE_SIZE)) { cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n", shdr->Command, shdr->MessageId); return -EACCES;