linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Vivek Goyal <vgoyal@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-unionfs@vger.kernel.org" <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH] ovl: do not ignore disk quota if current task is not privileged
Date: Tue, 10 Jan 2017 20:11:50 +0200	[thread overview]
Message-ID: <CAOQ4uxgYT+dKabuVu7JWWvc7A=s3DCm+n=MrXoM0GcC==UOgBQ@mail.gmail.com> (raw)
In-Reply-To: <859c4d99-dc1d-312b-6c60-23749cea4495@yandex-team.ru>

On Tue, Jan 10, 2017 at 6:34 PM, Konstantin Khlebnikov
<khlebnikov@yandex-team.ru> wrote:
>
> On 10.01.2017 18:57, Miklos Szeredi wrote:
>>
>> On Tue, Jan 10, 2017 at 3:46 PM, Vivek Goyal <vgoyal@redhat.com> 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.
>>>>
>>>> This patch adds second copy of credentials without CAP_SYS_RESOURCE and
>>>> use it if current task doesn't have this capability in mounter's user-ns.
>>>> This affects creation new files, whiteouts, and copy-up operations.
>>>>
>>>> Now quota limits are ignored only if both mounter and current task have
>>>> capability CAP_SYS_RESOURCE in root user namespace.
>>>
>>>
>>> This makes sense to me. I too would like quota to take effect for
>>> containers on overlay.
>>
>>
>> At first sight I hated this patch.  It breaks the nice concept that
>> underlying filesystems are just storage for the overlay and don't care
>> about caller's privileges (as a block device wouldn't care about
>> caller's privileges when allocating space).
>>
>> However I don't see a good way around this, so...
>
>
> Another solution: just always drop CAP_SYS_RESOURCE from capabilities.
>

That sounds like a better (and simpler) solution.

Let overlayfs support mount options noquota|quota (default configurable
from Kconfig and module param) and 'quota' means drop CAP_SYS_RESOURCE.


>> Looks like this also has effect on reserving space in ext4, not sure
>> what that entails.
>
>
> Yes, CAP_SYS_RESOURCE allows to use reserved space and inodes.
>

That's really not good. It's beyond disobeying user quotas, because
file system may get to unrecoverable state when corruption is detected
and already filled the root reserved space.

Amir.

  reply	other threads:[~2017-01-10 18:12 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 [this message]
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
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='CAOQ4uxgYT+dKabuVu7JWWvc7A=s3DCm+n=MrXoM0GcC==UOgBQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=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).