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 322E548167D; Thu, 20 Aug 2026 17:56:20 +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=1787248582; cv=none; b=but2o52uhFylLo0zlern5TmvalrzCqLreMFVFB4mOOsTD6bRfWU/ty2qZfRr3HZzRyPGsAOSbvE2Ky0iHeyBxdbvw+fEDM2m9OmzK3UKoD35ZmI4KxyWjCi1O88raKLp2m56zF1Cms2D0zGY2EA7l7v1dEAenMfAtuMHugoT8EI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248582; c=relaxed/simple; bh=CwaiHnvcmP1E+Jli3Wc2GbFFZIG1Sgo0WwHzCUMVOlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=umVhu2mkweY8yPwH+XjQSFoVjr9WYzUesObr2inWXlPx62hAOz2HF19OW0UGM39wEuF4QrFyydphhMgBjhDsFi5iyTXWTk+92Wke6HirxDyjTKss75G50+K+G617vCPfEdnmMW/iBGdfvS+pNLiBfsqUB359qYp4ASgArmKMoLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ykm7dulz; 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="Ykm7dulz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9AB1F000E9; Thu, 20 Aug 2026 17:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787248580; bh=ypg+PJRIqPBdascwMy9smJr8XxXazm/bu/ZeEnYV42M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ykm7dulz+KpnOLf66aff/cALhq/k21/81+/DnpPskYN7FYUxBlPlnfgYVvI5lh5I1 JFRQ/lmMjQqTH/brrGCg6IB+1JI+mqjOQo9efpIRdy5uKFh70CA0NXdwsXrms3F76Z igb5FhyM/D42L/Az8th8pRksFPZG8i9XzS2IOGKE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Howells , Namjae Jeon , ChenXiaoSong , Steve French , Sasha Levin Subject: [PATCH 6.1 228/303] smb/server: fix minimum SMB1 PDU size Date: Thu, 20 Aug 2026 16:56:04 +0200 Message-ID: <20260820145300.265399778@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145253.200766705@linuxfoundation.org> References: <20260820145253.200766705@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: ChenXiaoSong [ Upstream commit 3b9c30eb8f5aaad4a54cdfa470b74c0467cc71e8 ] Since the RFC1002 header has been removed from `struct smb_hdr`, the minimum SMB1 PDU size should be updated as well. Fixes: 83bfbd0bb902 ("cifs: Remove the RFC1002 header from smb_hdr") Suggested-by: David Howells Suggested-by: Namjae Jeon Signed-off-by: ChenXiaoSong Reviewed-by: David Howells Acked-by: Namjae Jeon Signed-off-by: Steve French Stable-dep-of: cfc0b8e5080a ("ksmbd: validate minimum PDU size for transform requests") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/smb/server/connection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/smb/server/connection.c +++ b/fs/smb/server/connection.c @@ -305,7 +305,8 @@ bool ksmbd_conn_alive(struct ksmbd_conn return true; } -#define SMB1_MIN_SUPPORTED_HEADER_SIZE (sizeof(struct smb_hdr)) +/* "+2" for BCC field (ByteCount, 2 bytes) */ +#define SMB1_MIN_SUPPORTED_PDU_SIZE (sizeof(struct smb_hdr) + 2) #define SMB2_MIN_SUPPORTED_HEADER_SIZE (sizeof(struct smb2_hdr) + 4) /** @@ -365,7 +366,7 @@ int ksmbd_conn_handler_loop(void *p) if (pdu_size > MAX_STREAM_PROT_LEN) break; - if (pdu_size < SMB1_MIN_SUPPORTED_HEADER_SIZE) + if (pdu_size < SMB1_MIN_SUPPORTED_PDU_SIZE) break; /* 4 for rfc1002 length field */