linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-unionfs@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [PATCH] ovl: do not ignore disk quota if current task is not privileged
Date: Tue, 10 Jan 2017 19:44:27 +0300	[thread overview]
Message-ID: <6a6432f1-16e5-7510-4bd4-deb950075877@yandex-team.ru> (raw)
In-Reply-To: <20170110163517.GE23108@redhat.com>

On 10.01.2017 19:35, Vivek Goyal wrote:
> On Tue, Jan 10, 2017 at 11:06:47AM -0500, Vivek Goyal wrote:
>> On Tue, Jan 10, 2017 at 02:26:48PM +0300, Konstantin Khlebnikov wrote:
>>> If overlay was mounted by root then quota set for upper layer does not work
>>> because overlay now always use mounter's credentials for operations.
>>>
>>
>> Hi Konstantin,
>>
>> So CAP_SYS_RESOURCE bypasses the quota checks?
>>
>> I just created dir upper on xfs filesystem and defined quota of 1G and
>> as root user (with cap_sys_resoureces), I am not able to create file
>> bigger than 1g in that dir. So looks like xfs quota took affect even
>> for privileged user with CAP_SYS_RESOURCE set.
>>
>> What am I missing?
>
> As root user, I set limit of 1G on work/ and upper/ dir and created
> a file of 4G in lower/ dir and mounted overlay on "merged" dir and
> did "touch zerofile", and go error message.
>
> touch: cannot touch 'zerofile': No space left on device
>
> So looks like I am doing something wrong and not be able to reproduce
> the issue to begin with.
>

I'm using ext4 project quota around upper/work directories.
ext4 use generic quota implementation: it ignores hard limits if CAP_SYS_RESOURCE is set.

It seems XFS ignores CAP_SYS_RESOURCE for any kind of quota.
But I've found special meaning for CAP_FOWNER - chown() can ignore user/group
quota if caller have this capability.

-- 
Konstantin

  reply	other threads:[~2017-01-10 16:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 11:26 [PATCH] ovl: do not ignore disk quota if current task is not privileged Konstantin Khlebnikov
2017-01-10 14:46 ` Vivek Goyal
2017-01-10 15:57   ` Miklos Szeredi
2017-01-10 16:34     ` Konstantin Khlebnikov
2017-01-10 18:11       ` Amir Goldstein
2017-01-10 18:30         ` Konstantin Khlebnikov
2017-01-10 16:06 ` Vivek Goyal
2017-01-10 16:30   ` Konstantin Khlebnikov
2017-01-10 16:35   ` Vivek Goyal
2017-01-10 16:44     ` Konstantin Khlebnikov [this message]
2017-01-10 18:30 ` [PATCH v2] ovl: drop CAP_SYS_RESOURCE from saved mounter's credentials Konstantin Khlebnikov
2017-01-10 19:17   ` Vivek Goyal
2017-07-22  9:30     ` Amir Goldstein
2017-07-24  8:15       ` Miklos Szeredi
2017-07-25  3:47         ` Greg KH
2017-07-24  8:19     ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a6432f1-16e5-7510-4bd4-deb950075877@yandex-team.ru \
    --to=khlebnikov@yandex-team.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).