Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbbH1Vgj (ORCPT ); Fri, 28 Aug 2015 17:36:39 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:33174 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbbH1Vgg (ORCPT ); Fri, 28 Aug 2015 17:36:36 -0400 MIME-Version: 1.0 In-Reply-To: <1438689218-6921-4-git-send-email-agruenba@redhat.com> References: <1438689218-6921-1-git-send-email-agruenba@redhat.com> <1438689218-6921-4-git-send-email-agruenba@redhat.com> From: Andy Lutomirski Date: Fri, 28 Aug 2015 14:36:15 -0700 Message-ID: Subject: Re: [RFC v6 03/40] vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags To: Andreas Gruenbacher Cc: "linux-kernel@vger.kernel.org" , Linux FS Devel , linux-nfs@vger.kernel.org, Linux API , linux-cifs@vger.kernel.org, LSM List , Andreas Gruenbacher Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1114 Lines: 25 On Tue, Aug 4, 2015 at 4:53 AM, Andreas Gruenbacher wrote: > Normally, deleting a file requires write and execute access to the parent > directory. With Richacls, a process with MAY_DELETE_SELF access to a file > may delete the file even without write access to the parent directory. > > To support that, pass the MAY_DELETE_CHILD mask flag to inode_permission() > when checking for delete access inside a directory, and MAY_DELETE_SELF > when checking for delete access to a file itelf. > > The MAY_DELETE_SELF permission does not override the sticky directory > check. It probably should. Silly question from the peanut gallery: is there any such thing as opening an fd pointing at a file such that the "open file description" (i.e. the struct file) captures the right to delete the file? IOW do we need FMODE_DELETE_SELF? --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/