Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755722AbaF3WXM (ORCPT ); Mon, 30 Jun 2014 18:23:12 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:57842 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754715AbaF3WXK (ORCPT ); Mon, 30 Jun 2014 18:23:10 -0400 MIME-Version: 1.0 In-Reply-To: <1404124096-21445-13-git-send-email-drysdale@google.com> References: <1404124096-21445-1-git-send-email-drysdale@google.com> <1404124096-21445-13-git-send-email-drysdale@google.com> From: Andy Lutomirski Date: Mon, 30 Jun 2014 15:22:48 -0700 Message-ID: Subject: Re: [PATCH 1/5] man-pages: open.2: describe O_BENEATH_ONLY flag To: David Drysdale Cc: LSM List , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Alexander Viro , Meredydd Luff , Kees Cook , James Morris , Linux API 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 Mon, Jun 30, 2014 at 3:28 AM, David Drysdale wrote: > Signed-off-by: David Drysdale > --- > man2/open.2 | 33 +++++++++++++++++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) > > diff --git a/man2/open.2 b/man2/open.2 > index 3824ab5be1f0..ba0da01c1a4f 100644 > --- a/man2/open.2 > +++ b/man2/open.2 > @@ -713,7 +713,7 @@ in a fully formed state (using > as described above). > .RE > .IP > -.B O_TMPFILE > +.B O_TMPFILE " (since Linux 3.??)" > requires support by the underlying filesystem; > only a subset of Linux filesystems provide that support. > In the initial implementation, support was provided in > @@ -723,6 +723,31 @@ XFS support was added > .\" commit ab29743117f9f4c22ac44c13c1647fb24fb2bafe > in Linux 3.15. > .TP > +.B O_BENEATH_ONLY > +Ensure that the > +.I pathname > +is beneath the current working directory (for > +.BR open (2)) > +or the > +.I dirfd > +(for > +.BR openat (2)). > +If the > +.I pathname > +is absolute or contains a path component of "..", the > +.BR open () > +fails with the error > +.BR EACCES. > +This occurs even if ".." path component would not actually > +escape the original directory; for example, a > +.I pathname > +of "subdir/../filename" would be rejected. > +Path components that are symbolic links to absolute paths, or that are > +relative paths containing a ".." component, are cause the "are cause" is a typo. Do you mean "will also cause"? --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/