From patchwork Tue Aug 25 20:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11736759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 834F0913 for ; Tue, 25 Aug 2020 20:31:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6095F20715 for ; Tue, 25 Aug 2020 20:31:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ow6ZRy6X" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgHYUbB (ORCPT ); Tue, 25 Aug 2020 16:31:01 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34702 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbgHYUbA (ORCPT ); Tue, 25 Aug 2020 16:31:00 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07PKOv3T115003; Tue, 25 Aug 2020 20:30:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=EEk+ilij2GAQP4zS5JzK26462xFVoruqF95gj2o9R+g=; b=ow6ZRy6Xf2horua7t2qu0b01kGSyVIm3KsWb2+5xtfUCwi4GLuZ22syE29hejMnCJj0h PIhLm0WlOrPwsWflwmzqfaYGveVxQN4/OSw/ZT4MVkTaeUoCkue+0Z7kyX0bHSa3eg5C AnLTp16dWi3GOGvbaIaQq/6OBjjoC7n6NproxGtg5r48jPmkPWDmyzAd5SPyz/xKma88 T7Z2G4hi9QHp/m3e9hr3VhAxdyUndI0qW6vzf6wr33kUniO5Jl0SGL4M6oxYr3YZFadH W4x030V1OGyd2UkAJ2VKqNLG7psQN68OgVBTznleo5QnosM/AWWbnjnzX+ypaGAftkE3 cg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 333csj4uhd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Aug 2020 20:30:56 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07PKPJHr154015; Tue, 25 Aug 2020 20:28:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 333r9k1g0q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Aug 2020 20:28:55 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 07PKSsPm025619; Tue, 25 Aug 2020 20:28:54 GMT Received: from localhost (/10.159.234.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Aug 2020 13:28:54 -0700 Date: Tue, 25 Aug 2020 13:28:53 -0700 From: "Darrick J. Wong" To: linux-xfs@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH] xfs: initialize the shortform attr header padding entry Message-ID: <20200825202853.GE6096@magnolia> MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9724 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=3 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250154 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9724 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 clxscore=1015 spamscore=0 priorityscore=1501 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=3 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250154 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Don't leak kernel memory contents into the shortform attr fork. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- 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; xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); }