Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5391277pxj; Tue, 22 Jun 2021 23:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeOL+uiP2MFjKxWcxUEKU6ll8rhrMeVGUm6IuYewNB1AyuOiUYVZA9pMLKkCTgpbFjwVgc X-Received: by 2002:a17:906:3794:: with SMTP id n20mr8052632ejc.276.1624430379987; Tue, 22 Jun 2021 23:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624430379; cv=none; d=google.com; s=arc-20160816; b=Ea0Vqu49sHIAEg7hty4nxYHYAAfZ+DTfdoign3WgioeSc0gPd2cRz2FvzIucg20W5O GtiNIQyoIqVVz9u/OukC0GKRFahr8UQs97MGfhHqvugSX3Ax7DrKVD4pU7K0YgVnbUud 0i3Whv9A8QXs/gCNRPnn1DjQQ9CYVW0DtVDeIRabQe35D2gJSky4n2JLPIbNpWl+6qMA racgM7bZzHZl9XuNENS2XPSrW6nIEY2AVmvonmgBq7lRBRPx89zDj41XJ88+6GTPQUqM IQlirCkwh6OxzvjbZ0p8Ul0GfB8oECQe2sf/y2VxmZDAI9glKEGW1KiPXqXPSHmDDuSx W/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=nw1NAC6AAQbDev6M71N/DaI22eOvaKEDP+ZQrJqFn4o=; b=eH7rdqEQHqdFvpXLAVDW8sLbTc1c2+mv4UUb/8xCdo4uKuVkifb2SAJsDnPDIif18E WEx2mXCPo2m8s9gbZPDaYfWa1baqBsm5nfXx06alApDx8SSHEFw2D3LkRSprP8TaRd0e BWJqAJXQCXjRDHepTc5wfMiHnp7o6CRqsiIXnVSa+a1SjJIJb4nm+rP9iEv/dAVwoKDW dw5WCKBggwyJRp0zJQGrj2Q+yCkZfquHOIJBUtJ/BUmxYVEKe0oWgCBqBcWJWZIA0KdG aNhHVL9jorPMK5nD/D+UG4x0U5rUiXnQkhaJaj9L6dVjEkTWFSCjHKJCb2tODY2iusNP 6r7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si4377157ejn.683.2021.06.22.23.39.15; Tue, 22 Jun 2021 23:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbhFWGl3 (ORCPT + 99 others); Wed, 23 Jun 2021 02:41:29 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:56939 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbhFWGl3 (ORCPT ); Wed, 23 Jun 2021 02:41:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UdOd0Cx_1624430336; Received: from e18g09479.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UdOd0Cx_1624430336) by smtp.aliyun-inc.com(127.0.0.1); Wed, 23 Jun 2021 14:39:09 +0800 From: Gao Xiang To: linux-nfs@vger.kernel.org Cc: LKML , Gao Xiang , Trond Myklebust , Anna Schumaker , Christoph Hellwig , Joseph Qi Subject: [PATCH v2 1/2] nfs: fix acl memory leak of posix_acl_create() Date: Wed, 23 Jun 2021 14:38:54 +0800 Message-Id: <1624430335-10322-1-git-send-email-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org When looking into another nfs xfstests report, I found acl and default_acl in nfs3_proc_create() and nfs3_proc_mknod() error paths are possibly leaked. Fix them in advance. Fixes: 013cdf1088d7 ("nfs: use generic posix ACL infrastructure for v3 Posix ACLs") Cc: Trond Myklebust Cc: Anna Schumaker Cc: Christoph Hellwig Cc: Joseph Qi Signed-off-by: Gao Xiang --- no change. fs/nfs/nfs3proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 5c4e23abc345..2299446b3b89 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -385,7 +385,7 @@ static void nfs3_free_createdata(struct nfs3_createdata *data) break; case NFS3_CREATE_UNCHECKED: - goto out; + goto out_release_acls; } nfs_fattr_init(data->res.dir_attr); nfs_fattr_init(data->res.fattr); @@ -751,7 +751,7 @@ static int nfs3_proc_readdir(struct nfs_readdir_arg *nr_arg, break; default: status = -EINVAL; - goto out; + goto out_release_acls; } d_alias = nfs3_do_create(dir, dentry, data); -- 1.8.3.1