From patchwork Tue Sep 15 14:12:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC21C433E2 for ; Wed, 16 Sep 2020 00:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 42D0920756 for ; Wed, 16 Sep 2020 00:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600214928; bh=gHzqM5SbKBDVfGaPTK2hj5hQR2LeONNE70U5p4PrLF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OL4U7R+mBd8IvJL0KvsAB0Bc0bQGxGGXN+Xy1h67QDP46EMwNMiVYGOg1ak180/6B celQhEPmDAjprQ0pT6zvBkSjMZLYJVIhia9r57Ti/JBKCdojTta6YlOrOMVPWX4wWu mXEEuUGX3KOY3UX1osFBQ92lWRnXJ6b628YdAMyo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727386AbgIPAIk (ORCPT ); Tue, 15 Sep 2020 20:08:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:42988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbgIOO2g (ORCPT ); Tue, 15 Sep 2020 10:28:36 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D13C7224BE; Tue, 15 Sep 2020 14:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179613; bh=gHzqM5SbKBDVfGaPTK2hj5hQR2LeONNE70U5p4PrLF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kZS1YMoFucD7OsGvlZKpuOhRq3ZqwF8c6L+/pSG25wFTPgNQ+xuKRZEcQi9qBDqmv QMfI7x69I1szindE4jtEJNan6Klvat80zAiL7dDnpG+e2vh/5Yne6ULXAQUL5nQSJi pWHzQxJm9aHmN5mVJtUykbYFCbqb+AGoTs5ASx+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , Eric Sandeen , Dave Chinner , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.4 049/132] xfs: initialize the shortform attr header padding entry Date: Tue, 15 Sep 2020 16:12:31 +0200 Message-Id: <20200915140646.570599349@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140644.037604909@linuxfoundation.org> References: <20200915140644.037604909@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Darrick J. Wong [ Upstream commit 125eac243806e021f33a1fdea3687eccbb9f7636 ] Don't leak kernel memory contents into the shortform attr fork. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index fe277ee5ec7c4..5472ed3ce6943 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -583,8 +583,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args) ASSERT(ifp->if_flags & XFS_IFINLINE); } xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK); - hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data; - hdr->count = 0; + hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data; + memset(hdr, 0, sizeof(*hdr)); hdr->totsize = cpu_to_be16(sizeof(*hdr)); xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); }