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 2F00E37F31A; Thu, 20 Aug 2026 15:17:48 +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=1787239070; cv=none; b=fQP0OtXF/gKgAxyLeM+hFwveR6cLOcWNBjSwD/qCGuomgpRJD11ZKqV23r6lki/nP2DQT/zHjhncgni/adaobpWcIPlktzf2Zw01sBIlvc7Dkk8+U2XXteBzMtIF6jWv44pJhvjOMwwE7lPUQ4q0OS9BDyf7OZg03u30SAq2aZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787239070; c=relaxed/simple; bh=+umdk8T+pD+XxvHgNc3F5EpcHrllPYGkMzAn2b0ShXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L2GmUt6vhm6eZ0g4Lzd76f6vdmvQmoClIGwcnsNUNiRK0wKRTiswIxLr5psGWA/mxMHcPwjamqz95Y8efoUEViF/ZlIIfmlZdKT9NQaBugjhtOSMKgz+pMMxmhSKmJlMxEOMoeC8GS5Fi8HhGg/QrrgZq8z+N4JTLbEn4EDewZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yJGvCR9D; 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="yJGvCR9D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BB1B1F00A3A; Thu, 20 Aug 2026 15:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787239068; bh=OQh6PEn4mGcRO62rhlDfL0+84qE0Hc3hk5INCJgOvBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yJGvCR9DBW81VuTgsYmfKsakXq75Btohhcsv326mHhWFOkRmxWvnvs/kob3o/GV0E fhmKM+5TzfTKFm+Pm+KviZdvWl1Nv3nwIrdyLe7E3unj3Y408kCl5lJvsoZXuJheGC KPWxmXgmJQjh/C990DxbaXaJ0kmNXu67gsTEWNrI= 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.18 139/217] smb/server: fix minimum SMB1 PDU size Date: Thu, 20 Aug 2026 16:55:07 +0200 Message-ID: <20260820145241.939069616@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145237.531699751@linuxfoundation.org> References: <20260820145237.531699751@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.18-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 */