From patchwork Sat Oct 22 07:20:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105154wrr; Sat, 22 Oct 2022 01:34:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xbstaJxF+8eKyVd4mXfX//gQoQNHDwYuK89C/h6VuEZZN9IB7VzM6nB1EhuIPclaRCrcW X-Received: by 2002:a17:902:d510:b0:185:480a:85d3 with SMTP id b16-20020a170902d51000b00185480a85d3mr23672620plg.4.1666427654310; Sat, 22 Oct 2022 01:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427654; cv=none; d=google.com; s=arc-20160816; b=CZAZ6Pb7TQ25dL/yHfxNSfqYstX2MCNYAnFcjyfNyLGk44RBnwOYQrTP+nzvZngqg6 0ZM11nJMUga4fahWdARWkDz0YzEQxe5xDH/m6xX2X6AaFrSHf2ZtmQDvT7jvNihPPFat rKU8wirs8SOiIL5F3rp5sY1kIA2FIn6OlpgzE5S6C6wLif/yabYr9JSkNC5tR1GHV+Xn 9ZfKxp8g93dZ7LmR5K3JHL3cctLREMvCYbA69JNNURLt3rMBKjOuklENxdOr4Kcq7WBI LbZGxFasxfVPEorApDSzlGaGhinEzptxV0IV4W+pC3YRq1vhmbfN5zrh5fMXq0y1JvRN MLTQ== 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=caZv2F3XZ7YiFftApURP3v8Hb8wkQdgV4fVM45uNOgA=; b=ynKXuQDKvVuXERoZdnEAJ4TOWW6pUq/WeSwMtYAwzBrGZreINXqkmNEHdjyuccOCyS BBX0Z2ZUdKHy8110ipv0LhG6JiEYh8k6PIraiEqhxYgUTr2pCjBiRBEMcJdcfs+WWRoF A/c5uPCmdehh1cRzioNr/0jok7SAvR4AArk/3H7Z2hi0/lUOEFvXQjECsrSZGr5h3cKW fdD3vZ9LZFw9PVA03SSgHOzbEfFLGslWPBfVu7LkaoFa9S4RyrDLdo3SsGcWV/82F8hU pYwyKbGq6wZfR+PlfH2fs+ofG6ejpmIiNYfYSN7s97l5A31a7i1dKioohlHuwbpbuJHn LEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DgAL44du; 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 d19-20020a056a0024d300b0056362152f8fsi28549753pfv.253.2022.10.22.01.33.58; Sat, 22 Oct 2022 01:34:14 -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=DgAL44du; 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 S233520AbiJVIRQ (ORCPT + 99 others); Sat, 22 Oct 2022 04:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233861AbiJVIPZ (ORCPT ); Sat, 22 Oct 2022 04:15:25 -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 CC6832DA1AB; Sat, 22 Oct 2022 00:56:31 -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 B530AB82DF8; Sat, 22 Oct 2022 07:41:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F00BFC433C1; Sat, 22 Oct 2022 07:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424514; bh=RaCY5RAb8ZerKeM1IclPcawvKRfJOaSZ/TtnUxatBTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgAL44duOAbi1WTf6l/lcecDXlKI0Lycu55PIxukf1D1AyjU5tVtN9p0M0/NLS3/S W/L0Ax0gIiUcbi3PC5WhmVWS48KTOf7b+V0A8B5JAPiojZvf2TF4UaTZ25OnnNPe83 FHv71ttCrzle88Pqmg9katWNdBfrSka0UZNlXfBI= 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.19 175/717] smb3: must initialize two ACL struct fields to zero Date: Sat, 22 Oct 2022 09:20:54 +0200 Message-Id: <20221022072446.511064179@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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376044315248344?= X-GMAIL-MSGID: =?utf-8?q?1747376044315248344?= 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 @@ -2410,7 +2410,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); @@ -2483,6 +2483,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);