From patchwork Mon Oct 24 11:28:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp442092wru; Mon, 24 Oct 2022 06:06:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ky9EsoSfFQGtsymwGrlthpuiNJk6z7IjEfmIQgLgbU0v8JuwgB4+Uoi93pWmmtqbm5Ko1 X-Received: by 2002:a17:90b:1e03:b0:20d:7f0:7671 with SMTP id pg3-20020a17090b1e0300b0020d07f07671mr37596096pjb.174.1666616804431; Mon, 24 Oct 2022 06:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616804; cv=none; d=google.com; s=arc-20160816; b=t7UjdPvSWcf1yJC8luck+aW4yyw31qjHketvFjNZiQ/GNeGW3Szb1neLTkWbTOzmqa 8LAylwyIAlYkIZcC3OKNdKrYEFe/VvhxwERtT4W79HhV2mMRIDvrnlpKMaQOEt+a+LOA G40yAC0dejovBOyQhQmdeA6Q6DYCATsZNA9Y9gDhIDKyPyI2tYrVwg6mYpDoERRFXQS/ tdIrjuAT3yvZpjpojCWf3g4BKK5mEli36FsUAo75olpnZTq7FnI6+55sp+crD1A9kR4F fEV3BI+W2zyGTkGPbe8MP7VJ+rA3GOG3stKCLxBvoay/D+xOXOKTyb0JMEh1FAMgpf91 zKyQ== 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=g4c6D7GKTR71Ui+TwqwJXv/gFEFnwbhNAQIRu6khp+I=; b=n9rps9qbe4ZGqQc3qVpX/k0pgHCTpb/GpeG+n8Wre6dL8tCtvgqjMWCaqMjBJF4Xbd cFprQJJ+IKUOLudpuH4ZeUKfy2m7ZTFCsxHG8PgUAejkzu2f9WbCw3GrorJPkGUAJmGg fNT4zPG/Y29RVJDVvL13u+9UL5vM8jRYpMXbpeZealZ5IaSHaGccuw7VFS3X90h5Nxt/ e28XyHMA7vdubL5dMESG5tdaZhdoYSn7Jvjdm9RQZHZugIQgvA+wLoOevHoyPVV6cNqu SmAUKwONQcZcSmFQLJs8bUz2VB+2GOaKvSovpTGcdtSyZkRdQBzoFfM3ezi3vfURR83m mZ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q72Xb02L; 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 b11-20020a170902bd4b00b0016db0d4f4c9si14203063plx.65.2022.10.24.06.06.26; Mon, 24 Oct 2022 06:06:44 -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=q72Xb02L; 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 S235289AbiJXNFy (ORCPT + 99 others); Mon, 24 Oct 2022 09:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235186AbiJXNDR (ORCPT ); Mon, 24 Oct 2022 09:03:17 -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 BC795476CB; Mon, 24 Oct 2022 05:20:18 -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 1DD9F61278; Mon, 24 Oct 2022 12:19:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32E22C433C1; Mon, 24 Oct 2022 12:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613987; bh=OC+4YFwol8l1oBUKyo623Veq+MdVfA92yvZEweBhY3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q72Xb02Lif2pbYa8ZxtVHGKaUXTmT/v8v/8zJenaIf3UEolFelmegICoSilFtYgXH B3Y67A0VOxSHYdIclaz24Mo60iAigNhEAbPp/ABKiYS20AOyvxym3C+ENmOcHcO3dZ VdNtwNimCHFGoUXrEFw8eMIjlHjXArnvuJfDXBHo= 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 5.10 090/390] smb3: must initialize two ACL struct fields to zero Date: Mon, 24 Oct 2022 13:28:07 +0200 Message-Id: <20221024113026.456599204@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?1747574382563307110?= X-GMAIL-MSGID: =?utf-8?q?1747574382563307110?= 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 @@ -2294,7 +2294,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); @@ -2367,6 +2367,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);