From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752981AbdGXITQ (ORCPT ); Mon, 24 Jul 2017 04:19:16 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34172 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbdGXITI (ORCPT ); Mon, 24 Jul 2017 04:19:08 -0400 MIME-Version: 1.0 X-Originating-IP: [176.63.54.97] In-Reply-To: <20170110191721.GF23108@redhat.com> References: <148404760886.4400.14907571208759802396.stgit@buzz> <148407302133.16047.411379729888561193.stgit@buzz> <20170110191721.GF23108@redhat.com> From: Miklos Szeredi Date: Mon, 24 Jul 2017 10:19:07 +0200 Message-ID: Subject: Re: [PATCH v2] ovl: drop CAP_SYS_RESOURCE from saved mounter's credentials To: Vivek Goyal Cc: Konstantin Khlebnikov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "linux-unionfs@vger.kernel.org" , Amir Goldstein Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2017 at 8:17 PM, Vivek Goyal wrote: > On Tue, Jan 10, 2017 at 09:30:21PM +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. >> Also overlay might deplete reserved space and inodes in ext4. >> >> This patch drops capability SYS_RESOURCE from saved credentials. >> This affects creation new files, whiteouts, and copy-up operations. >> > > I am not an expert in this area, but I thought previous patch was > better. I am not sure why overlay internal operations should be > done without CAP_SYS_RESOURCES when caller has CAP_SYS_RESOURCES. That > might be counter-intuitive. > > If some task is allowed to bypass quota limitations on a file system > then same should be true when task is working on overlay. > > Similary if a task is allowed to use reserved space on filesystem, then same > task should be allowed to use reserved space on underlying filesystem > when doing overlay. It should not be overlay's job to prevent that? > > May be it is just me.... Well, depends how you look at at it. Overlayfs just uses the underlying filesystem as storage. So this patch basically asserts that overlayfs can only use non-reserved space for its storage. I don't see a problem with and it's the simpler fix, but if real use cases turn up then this can be revisited. Thanks, Miklos