Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp875881rwi; Wed, 19 Oct 2022 04:11:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Yaw4uB2DoF0t4uVi0tgHaPNd7x3hCYNObU2jMUQaWRK9RO5QQLNpzkEWd72SqXFYy8RaN X-Received: by 2002:a17:902:aa46:b0:17a:487:ef6b with SMTP id c6-20020a170902aa4600b0017a0487ef6bmr7935964plr.8.1666177901602; Wed, 19 Oct 2022 04:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177901; cv=none; d=google.com; s=arc-20160816; b=zs3rKfPNniT+bm7JWUj2HdRqmGYGGTflf+OB0ZEFljDjdrv5wZDKSxBijdWvQSgYXy CGTecbtjKZWcvlsKgeEM+QX1QVEBW47KKaVDSTDTnDxpnpwzAn1vj9StLP2fEA/u4GVQ VEfeJUFpwiV5w+dqpw7aH0M4duAJzS+VKWCk9D4aNa6ZDHHkaMeJbLXwPEVseyUEhdSt wultDitT3HSKdQxGa9CS+kzuToCS5Uukj8ehaAeDGs1CU4Eyef1Vxc9J5gSMa81jYFkH e85YMsbb1OEJbtfdj6XmWNL2vR66A5zgTVV2E/TO6/+m+iyIAD0OcP6QCnhUSfUp4iCp Z7gA== 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=kbKpMI0xfcDuAac3hFUgcFSRHLpa5m/7w1vcjv0hyKs=; b=El146oRXIA6toUpFbcFiFBnRK1BZHoDDFkBCtYPC60JPvE97O3DTmYhotpjjoTEpGT uCN8C6UjvxFxvW8xGo6Avt45azLCgx19xcci7kkuKWg7YESCbC6GtZLprW/86thiBHL1 V50zm58fYcdFtcy0PK/6opw+Gftg8zxpahgrC2duGZ5Cw6Jo3a1l+7Y4lOg95yLzV6Sh b+rJox99wAmmFnPFc0/bsXBJbWyxQL/VGRfFXQuNbfoIFfsvz8JAGh4EZPksezSvFyJf wGaPZTKEDkhqpHJSmZ4hlNbMDw2RvnTnMiGSCSCoQ4FdR710iwjrsjHVk4+ixpgKp+86 lUbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x3EGwfbl; 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 y9-20020a1709029b8900b0017f61ac5a65si17749629plp.110.2022.10.19.04.11.28; Wed, 19 Oct 2022 04:11:41 -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=x3EGwfbl; 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 S234122AbiJSKsI (ORCPT + 99 others); Wed, 19 Oct 2022 06:48:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233061AbiJSKqE (ORCPT ); Wed, 19 Oct 2022 06:46:04 -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 C594B15A32B; Wed, 19 Oct 2022 03:21:38 -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 4EA57B822C8; Wed, 19 Oct 2022 08:47:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F7AFC433C1; Wed, 19 Oct 2022 08:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169225; bh=puH1w9DmpDqITltvyjb9R5pU9ClMf1szAJHb55f+86w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x3EGwfbl7sTHvBzandBzImKUQpBDljkvSpA4ep+PSZrPE3E77zTqJqSBj29tBNllj nSE02UkXTSvIRIk2fvzpYaZ1HbwFfsUYgXfEJSejqgTqHXrgXuD1zTR8HTD67RA/Z7 JEvd1AIzsoOzYtO/pS0vC8c3IC9lYHZQ0k4gKGrI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Paulo Alcantara (SUSE)" , Steve French Subject: [PATCH 6.0 201/862] smb3: must initialize two ACL struct fields to zero Date: Wed, 19 Oct 2022 10:24:48 +0200 Message-Id: <20221019083258.886035119@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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: Steve French commit f09bd695af3b8ab46fc24e5d6954a24104c38387 upstream. Coverity spotted that we were not initalizing Stbz1 and Stbz2 to zero in create_sd_buf. Addresses-Coverity: 1513848 ("Uninitialized scalar variable") Cc: Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2411,7 +2411,7 @@ create_sd_buf(umode_t mode, bool set_own unsigned int acelen, acl_size, ace_count; unsigned int owner_offset = 0; unsigned int group_offset = 0; - struct smb3_acl acl; + struct smb3_acl acl = {}; *len = roundup(sizeof(struct crt_sd_ctxt) + (sizeof(struct cifs_ace) * 4), 8); @@ -2484,6 +2484,7 @@ create_sd_buf(umode_t mode, bool set_own acl.AclRevision = ACL_REVISION; /* See 2.4.4.1 of MS-DTYP */ acl.AclSize = cpu_to_le16(acl_size); acl.AceCount = cpu_to_le16(ace_count); + /* acl.Sbz1 and Sbz2 MBZ so are not set here, but initialized above */ memcpy(aclptr, &acl, sizeof(struct smb3_acl)); buf->ccontext.DataLength = cpu_to_le32(ptr - (__u8 *)&buf->sd);