From patchwork Mon Oct 24 11:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp641478wru; Mon, 24 Oct 2022 13:35:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4T16z9xRjsiqvamyfoMx1vn944GUJq2yR5wKF11d245vdRztN6atoPnhKitjSP3/GEa6EF X-Received: by 2002:a17:902:cac3:b0:186:6ce4:f94a with SMTP id y3-20020a170902cac300b001866ce4f94amr22381460pld.145.1666643728852; Mon, 24 Oct 2022 13:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643728; cv=none; d=google.com; s=arc-20160816; b=SgPesWEtC3bJ5NX7OCahMST9U4T4gwbFaQjhu5U/ujGySVKnVw+uE7EYxuatMIW36T 3QU2s2BRjT55r0evD4BX6U3KIvdKz73meaj+1XnHhOAEMzRU9VQnEAzhCtOwmEhQgN6u G8yvRXnJUp9Tqr/8qmlW89I83DU8jPtLIBbK5Myh+LRtd3vxwPyVxJiJfhuEF7bPSfMj U7tuHT3FphHmr8W5BVDMgkDkkwWjkC9jjKdkEjH4l5wscI3gn6zFOliiZbh8UBJH6vmq QN3Q1//tw6AP8YCFFA7wz/EJUzq3qS3VwJVYgJRsUyQE1pCLmqa4PK5zaePxVVJfFzj5 TU0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xIiFRRikePwW9pbr+rDL6GtxfJv2uYHgCFJ3GmTSh+4=; b=qIhHMwC16PGAO17LMBeChiLqI5oOunvruOzYYg7fjD6OQFFe7K0dn47xbEs7ZOLcFQ PtB9Lr8yxU52gyVvrK6pEns27Z3iMwtQnEp3sLLLUWq9ShGnsOLkw20q4n67WW6NiEit hNmaMUvmc6wd4KpSHBnWuvxCjF4tZfArr1U556zVJnAE0AayfHGfwSOQgDfTJDHxk24q UA6WIWnsNyZamR08lrQXDELcMouO4tXfTQJDNB1pmGcPyBH6Tm8DBo84osSc96wqBRIk rKTC+NEZqvjMvWjBN6JvoV55jlwTD1lp62uVtvYgP242kgcBftGzIJ6er251Oa2mVV7R m08w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cm1XkriF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a63-20020a639042000000b0046ed15a820fsi492999pge.672.2022.10.24.13.35.15; Mon, 24 Oct 2022 13:35:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cm1XkriF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233801AbiJXUZ1 (ORCPT + 99 others); Mon, 24 Oct 2022 16:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234286AbiJXUXj (ORCPT ); Mon, 24 Oct 2022 16:23:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51884360B5; Mon, 24 Oct 2022 11:39:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5C4D3B811B9; Mon, 24 Oct 2022 12:16:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B10E5C433D7; Mon, 24 Oct 2022 12:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613779; bh=qYKM/knQ12F6UlTUM7FZHtkKGNyWjWZQpvghfT6Vky4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cm1XkriFDjlcpcNxjIa8GR2lwZk9G1t30K2A+4OxHS0RBnVznJQfKQm/gQvZfI8fl hnkTc8Cqr5fGD3XNRJmlpSxK4fzAWkOXCLOg4uLMCCUbj/AHLE6hONqJLFxN7egWQR yiYTCV+xe+YRII8JC7gRH9BTPM3REOPXN7lb9JYg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Xiaoxu , "Paulo Alcantara (SUSE)" , Tom Talpey , Steve French Subject: [PATCH 5.10 011/390] cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message Date: Mon, 24 Oct 2022 13:26:48 +0200 Message-Id: <20221024113023.012197841@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747602614392823450?= X-GMAIL-MSGID: =?utf-8?q?1747602614392823450?= From: Zhang Xiaoxu commit e98ecc6e94f4e6d21c06660b0f336df02836694f upstream. Commit d5c7076b772a ("smb3: add smb3.1.1 to default dialect list") extend the dialects from 3 to 4, but forget to decrease the extended length when specific the dialect, then the message length is larger than expected. This maybe leak some info through network because not initialize the message body. After apply this patch, the VALIDATE_NEGOTIATE_INFO message length is reduced from 28 bytes to 26 bytes. Fixes: d5c7076b772a ("smb3: add smb3.1.1 to default dialect list") Signed-off-by: Zhang Xiaoxu Cc: Acked-by: Paulo Alcantara (SUSE) Reviewed-by: Tom Talpey Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1075,9 +1075,9 @@ int smb3_validate_negotiate(const unsign pneg_inbuf->Dialects[0] = cpu_to_le16(server->vals->protocol_id); pneg_inbuf->DialectCount = cpu_to_le16(1); - /* structure is big enough for 3 dialects, sending only 1 */ + /* structure is big enough for 4 dialects, sending only 1 */ inbuflen = sizeof(*pneg_inbuf) - - sizeof(pneg_inbuf->Dialects[0]) * 2; + sizeof(pneg_inbuf->Dialects[0]) * 3; } rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,