Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3886637rwi; Sat, 22 Oct 2022 01:34:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M10EoQHp4RaWFa4xsHJTpyTnmlQwye1ryuM2wTrhdNvxbt0+VjuV1K42apX6knoSP4RbB X-Received: by 2002:a17:902:988e:b0:186:907a:a029 with SMTP id s14-20020a170902988e00b00186907aa029mr806732plp.97.1666427650041; Sat, 22 Oct 2022 01:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427650; cv=none; d=google.com; s=arc-20160816; b=KPx4JSQPbDmvnrbuy4UFO+ipy+k+LaRTcsKnrTQw+sKy116bOiWdvFC2sSUPRtf9TZ jHzhUmeaaRPMBnZb/+/btiO6iDNgPdm7sO1PCqsoJxEYwmXFrcIhOuNY2/TggUfewhCu sFu6Z2C+ruCtzWisfECv735WhyU5fqm0/euJCltEYInmb9W2VsGI0n84/DmLdwQIeeYh nPxN96IuGA1DYmswd52sZcpTBSF0d3Mx6uD+cRco+0x+aBfytEVbE1YXjg6kC27ExK94 oo+DflpDhJxMivcHMizXtasJj6ec2PK5BtWK6amrCIGjBojQnLuAk+1HcnyeA0vXWxrZ sMQA== 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=1Z0cpAA2gPaxaDA7Hudpfi6w4Z1UIJnNWCC05RLFmNE=; b=ZI6WkZIWaeIY2YpBZw9QCBLV0xM9KrkW2XSLNi0wNnQfZAAPYDOkXVpNARD4Ltuvh+ Fq1hWJbGL26/oDv/CK2f9YYD2ctQNm/sxzG4quG96LStW/UN+a0hSM72QP9w5QxpxgVO Lbes8d527srMuSN8Tsy9n6yiXpK/xnIX6UBuHAb+Ez/f/1jhF1Qz4EdMsnwU82fiDUMg 0BuekN/sCU2Z6vuuLhuK34IevX8DMqGhRgRIcqowHwR1h9zqKgTuT0VgSl5fuI7gq5ga UGX06L1ntFmwS/jZHJTqiL79az+kjZEu8+YtgJPaYAe9wdDbEPG/CofLRaLHoPGNm/6d wH9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZqIF+TsJ; 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 k71-20020a63844a000000b0045724b1e357si27673163pgd.683.2022.10.22.01.33.53; Sat, 22 Oct 2022 01:34:10 -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=ZqIF+TsJ; 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 S230273AbiJVHfR (ORCPT + 99 others); Sat, 22 Oct 2022 03:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbiJVHem (ORCPT ); Sat, 22 Oct 2022 03:34:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908A1357C5; Sat, 22 Oct 2022 00:34:29 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B936E60AD9; Sat, 22 Oct 2022 07:34:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB2D1C433D7; Sat, 22 Oct 2022 07:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424068; bh=R9pusQAITq/r7Pnku+U28DKSfwlq7tVODE7WmxvlkmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZqIF+TsJbRFNV/ICgXAgtHDo0DS00AeOviUE/6LM+Cm89BEpCJN88fqTpCVdBBBFM AZAB0JU3h6eriy0M9ghxwZeyOp+lzpmc+bK78Ugtia0vxaeA7lTEdvWB8IPI2cD8i3 aC/DZlARRXJCTZjr0m/n/t0nnA/EINXtk2ZYFiv0= 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.19 018/717] cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message Date: Sat, 22 Oct 2022 09:18:17 +0200 Message-Id: <20221022072418.296354338@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@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.3 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 @@ -1168,9 +1168,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,