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 DDFBF188CC9; Thu, 20 Aug 2026 17:31:00 +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=1787247062; cv=none; b=sljNQrcUVYegECy9Q3T55ZjprjOhPICUMuZaTgRNrvGZSdYECkV1fXqVLbzr1/EGFuRBGHAsg2jLo0SWwqM+PHWmpH2IMfIlYSxPPrQatQVXdupAA2cWb8cgqQYzY/xfliK46M3C0kdo8zAwcDYzBXYoUC3wAZZvc2+3+qXmqjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787247062; c=relaxed/simple; bh=cG39FWQXVth9wjqQm1jxxjTTcjCiP5SOKlQqNMyT2Zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SrYYSjtFhRZp7D/d/HJsLPN/cW+tRMLbW1Y4lHuZVRUYIWVShRfIyv0ODo6z4JU/998rJpgtaFzIwiGg2qgUSxFBMQ7kNnEyDGArWjaznVqJViIFE8CvStasPuKDsrtEUsN8zksFyCVtt/yIl0kz5fEmOy+jhTLB3/RbYZ1cOVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T7h0nYt5; 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="T7h0nYt5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D15C1F000E9; Thu, 20 Aug 2026 17:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787247060; bh=v+AiHA5GHONJVVcUs+hHlGrH8n80IdBuZEUKJYnsmWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T7h0nYt5Ic7FnMnHAwtmR//pniwI2kJa5tWpN5ZdfRgfPw9/OeWvTM6w9L84hAchT Sb7SWtAI48wxZk0uS0PjrN20mjkWwUBNymFUPyW70tH6mRzk+dSFP0CVZLcaArqnO/ 3xEHK7SJbb9wG9BCjJIJpIdS++AOwp+BK6Rf/Opw= 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.12 134/220] smb/server: fix minimum SMB1 PDU size Date: Thu, 20 Aug 2026 16:55:24 +0200 Message-ID: <20260820145227.494758057@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145223.480031205@linuxfoundation.org> References: <20260820145223.480031205@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -376,7 +376,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) /** @@ -444,7 +445,7 @@ recheck: 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 */