Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7439126rwi; Mon, 24 Oct 2022 14:49:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7D4jvWsi43DXBWQATTZzckTpaXgqVIS7Xm2GDPqgGfqjWaxoVP1wTuA28C9YMRy+qrsy5K X-Received: by 2002:a63:f20a:0:b0:464:8c6:f27e with SMTP id v10-20020a63f20a000000b0046408c6f27emr29936395pgh.411.1666648192208; Mon, 24 Oct 2022 14:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666648192; cv=none; d=google.com; s=arc-20160816; b=WZ+9Z/efKfBRy2AY7d8/YNNVfKGpO891EzxaC+zXqoPFn9+R2DitT3NMRf3JvTOK0l ZEcUHmY19JW/s3+Dx0Y0yAmSXPCSZ7KXUPStdq4LwzGV+qJTiz0WggO1eoXNXjMTaTCL J0WQR9jsIxbFNZSK8oexR+Km1AT/6Rybo2VJ14MVtk5s1OpIoQmI6iQg7YCOadnSD3/6 jRWVo93IJEqV1ZfHtDPjfS+oU2JVe81y3ar+OxIzlGl2t5x5cn2Dn4gVjSw3i4iGZcAD cpCkpTBwuy0W9rFR5lbydWl1CHdra1pkdcz6CQyNEBsGsKyv4pOVU944cLUtN+BPAan9 BTrQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v189-20020a6389c6000000b0043c5d3dc0d4si648585pgd.332.2022.10.24.14.49.40; Mon, 24 Oct 2022 14:49:52 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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,