From nobody Fri Oct 17 10:32:12 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DAFDC433FE for ; Wed, 19 Oct 2022 10:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234134AbiJSKsK (ORCPT ); Wed, 19 Oct 2022 06:48:10 -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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D 0; unsigned int group_offset =3D 0; - struct smb3_acl acl; + struct smb3_acl acl =3D {}; =20 *len =3D roundup(sizeof(struct crt_sd_ctxt) + (sizeof(struct cifs_ace) * = 4), 8); =20 @@ -2484,6 +2484,7 @@ create_sd_buf(umode_t mode, bool set_own acl.AclRevision =3D ACL_REVISION; /* See 2.4.4.1 of MS-DTYP */ acl.AclSize =3D cpu_to_le16(acl_size); acl.AceCount =3D 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)); =20 buf->ccontext.DataLength =3D cpu_to_le32(ptr - (__u8 *)&buf->sd);