From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 320DDC433DF for ; Tue, 25 Aug 2020 22:43:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13943206EB for ; Tue, 25 Aug 2020 22:43:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbgHYWnC (ORCPT ); Tue, 25 Aug 2020 18:43:02 -0400 Received: from mail106.syd.optusnet.com.au ([211.29.132.42]:49882 "EHLO mail106.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbgHYWnC (ORCPT ); Tue, 25 Aug 2020 18:43:02 -0400 Received: from dread.disaster.area (pa49-181-146-199.pa.nsw.optusnet.com.au [49.181.146.199]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id DA4486AC19E; Wed, 26 Aug 2020 08:42:59 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1kAhed-0000XK-4G; Wed, 26 Aug 2020 08:42:59 +1000 Date: Wed, 26 Aug 2020 08:42:59 +1000 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, Eric Sandeen Subject: Re: [PATCH] xfs: initialize the shortform attr header padding entry Message-ID: <20200825224259.GT12131@dread.disaster.area> References: <20200825202853.GE6096@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825202853.GE6096@magnolia> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=QIgWuTDL c=1 sm=1 tr=0 cx=a_idp_d a=GorAHYkI+xOargNMzM6qxQ==:117 a=GorAHYkI+xOargNMzM6qxQ==:17 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=yPCof4ZbAAAA:8 a=7-415B0cAAAA:8 a=iznvsACjZTC2k9t3KwoA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Tue, Aug 25, 2020 at 01:28:53PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > Don't leak kernel memory contents into the shortform attr fork. > > Signed-off-by: Darrick J. Wong > --- > fs/xfs/libxfs/xfs_attr_leaf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c > index 8623c815164a..e1a3d225a77d 100644 > --- a/fs/xfs/libxfs/xfs_attr_leaf.c > +++ b/fs/xfs/libxfs/xfs_attr_leaf.c > @@ -656,6 +656,7 @@ xfs_attr_shortform_create( > hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data; > hdr->count = 0; > hdr->totsize = cpu_to_be16(sizeof(*hdr)); > + hdr->padding = 0; memset(hdr, 0, sizeof(*hdr)), please. Cheers, Dave. -- Dave Chinner david@fromorbit.com