Message ID | 20200601174025.164815490@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=Ycwd=7O=vger.kernel.org=stable-owner@kernel.org> 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=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 DD687C433E1 for <stable@archiver.kernel.org>; Mon, 1 Jun 2020 18:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B46E220679 for <stable@archiver.kernel.org>; Mon, 1 Jun 2020 18:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037579; bh=vvAn8EDpPr9ZfwBzIstG1rQ4gCyXCXUholFYEgR/AA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lCicy36g4ja5S7duAxbS4BO9X/zZmjyD0Cwmj+mzPjG1K5x5oTGl5pzKZLuUiv0W1 G4xJlXKCZrrxO2RevTQYA9aELhA+AKUR/xDpnNoOjpzVzyf7q48WCeaGltz3DUIxiI QCUIh3L30HbbCT9ltynBfDJYq6e/yVY3c6DqUb6U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730130AbgFASwx (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 1 Jun 2020 14:52:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:47230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728205AbgFASDZ (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 1 Jun 2020 14:03:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A4E4C207D0; Mon, 1 Jun 2020 18:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034604; bh=vvAn8EDpPr9ZfwBzIstG1rQ4gCyXCXUholFYEgR/AA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R960K3uy2b1rK+ITgTP/33VhFEO1kVXrkI7Lc/fjTtfK3ZZ30Iy+UonEquWwHjPxC 05sbnZCYZVzolBtwFCKdj917Xt9DdrFxbv0ahCHtlz38xuVDoTchuv0PhVzk0ADitz w1c3wY7HNll8/h99pGd1f063FEyXZCEBx3UfFoZE= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Bob Peterson <rpeterso@redhat.com>, Andreas Gruenbacher <agruenba@redhat.com>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.19 27/95] gfs2: move privileged user check to gfs2_quota_lock_check Date: Mon, 1 Jun 2020 19:53:27 +0200 Message-Id: <20200601174025.164815490@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174020.759151073@linuxfoundation.org> References: <20200601174020.759151073@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 0efae7a0ee80..dd0f9bc13164 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1043,8 +1043,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid) u32 x; int error = 0; - if (capable(CAP_SYS_RESOURCE) || - sdp->sd_args.ar_quota != GFS2_QUOTA_ON) + if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON) return 0; error = gfs2_quota_hold(ip, uid, gid); diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h index 836f29480be6..e3a6e2404d11 100644 --- a/fs/gfs2/quota.h +++ b/fs/gfs2/quota.h @@ -47,7 +47,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip, int ret; ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */ - if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) + if (capable(CAP_SYS_RESOURCE) || + sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) return 0; ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); if (ret)