Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4148849pxv; Mon, 19 Jul 2021 18:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXi+BeP2yXtdp9AG/NE4SfAalevnoV7MsP2iZo5/4agCxFj1HhLJtsEeVrZGhKrQjdMzKT X-Received: by 2002:a02:ccec:: with SMTP id l12mr24142079jaq.61.1626744520210; Mon, 19 Jul 2021 18:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626744520; cv=none; d=google.com; s=arc-20160816; b=vSFBpR1ufp2bfCbS45vXr3xr1pRq3fKirNZTMIUFIsLDWk8usVBQBk43+BOvNLAlFx ErzbIgBrL/TQnc4AysIVSk3wmum4erUfBrNuRRCQbQve/PNEy8YA1L8xParGpF4K5wJ1 wLSjJCUh7bhoORXweHr/9U9xRfIDScs6O0THkd6cxMH6rckCELeL4Gx8nx9KcCKrlvx6 PstU100QzN84UOpqM80vC4OLYlnFsBAb6uV6e/y54SqOR4iyuh4E6HHGRFmlsFnb03Hj levWqjnJfuFjNmwMNwmlU1lrnHbuyF5igWQ5c6bVASWvaRcIF3G3TPBEXpkJwHUCKpBV GQCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YnC+8ABLn72yJ6cV2Nn4jWQLFUbzlJADIKkNF3nyZDA=; b=CBG9qAL4nDoUpHh9MhrBLA+iIJeq4nHqHsb0YEefki9y7L58Gn+ufai4YngvSFWBlo utHKWCQlcc1YRwaOF2bGzAQyDaY56LcWO3xASXH3hq/gOBKPzGYE5y2DPaXy9GEFb+Qy 7v/6TW0L3KjjjLo5YwBo669/yT2wkyoUcR0RaQ+KNI7JtA8QBp1dsEorLuxz289xwwr8 AlTIRxkeNEC34wANNJD4yZPVRFJd9bjQ2lY4uJmPOZV7n6EiBv//5Va4o1AOCpBu3Ujb wP14GIms+5j18AVTZSz1GTSianb8VuCiBwastrF38c+3AVwjqo/qsptj7HoLzSMmHA27 MVyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OAbeUaRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si12521943jat.16.2021.07.19.18.28.26; Mon, 19 Jul 2021 18:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OAbeUaRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240932AbhGSOvG (ORCPT + 99 others); Mon, 19 Jul 2021 10:51:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244497AbhGSOeB (ORCPT ); Mon, 19 Jul 2021 10:34:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 682CE61353; Mon, 19 Jul 2021 15:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707601; bh=UanXG94Kwo6+g5BQ3N4FtlOVTG+wTA0/tOHkzDJ0CG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAbeUaRezXFoGnAAc1xK6ol1ffgLsCJ6F+ICDMU3LGDbo60nGQ6hFfgE74kp+BpFy d+wUWnYDG4vuTIRNdJIcVd6zsqCSAkX5VlOH9ZKJPwdsOv6me/0wdv7iL0geYzaeZ4 RWpEHi9j1c8gnVW/CQmeSiFyqQovx0rbmK5EokXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker , Christoph Hellwig , Joseph Qi , Gao Xiang , Sasha Levin Subject: [PATCH 4.9 229/245] nfs: fix acl memory leak of posix_acl_create() Date: Mon, 19 Jul 2021 16:52:51 +0200 Message-Id: <20210719144947.790560577@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gao Xiang [ Upstream commit 1fcb6fcd74a222d9ead54d405842fc763bb86262 ] 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 Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- 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 dc925b531f32..41bda33b630f 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -363,7 +363,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, break; case NFS3_CREATE_UNCHECKED: - goto out; + goto out_release_acls; } nfs_fattr_init(data->res.dir_attr); nfs_fattr_init(data->res.fattr); @@ -708,7 +708,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, break; default: status = -EINVAL; - goto out; + goto out_release_acls; } status = nfs3_do_create(dir, dentry, data); -- 2.30.2