All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, libc-alpha@sourceware.org
Subject: RFC: reject unknown open flags
Date: Thu, 30 Mar 2017 18:33:25 +0200	[thread overview]
Message-ID: <20170330163327.23920-1-hch@lst.de> (raw)

Linux has traditionally accepted random garbage in the flags argument to
the open syscall (including the later added openat).  This really harms
when adding new flags, because applications can't just probe for the
flag to actually work.  While rejecting unknown flags is an ABI change
strictly speaking I can't see what would actually get broken by it
in practice, so by the Linux rules it might not be an issue.

Below is the trivial series to reject unknown flags.  If this is not
acceptable there migh be some other ways, although they seem ugly:

 (a) add a new openat2 system call that enforces this behavior, and
     hope all majors libcs switch to using that by default to implement
     open(3).
 (b) add a new personality flag to enforce this behavior (or maybe
     opt in by default and allow admins to opt out of it)

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Linus Torvalds
	<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Alexander Viro
	<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org
Subject: RFC: reject unknown open flags
Date: Thu, 30 Mar 2017 18:33:25 +0200	[thread overview]
Message-ID: <20170330163327.23920-1-hch@lst.de> (raw)

Linux has traditionally accepted random garbage in the flags argument to
the open syscall (including the later added openat).  This really harms
when adding new flags, because applications can't just probe for the
flag to actually work.  While rejecting unknown flags is an ABI change
strictly speaking I can't see what would actually get broken by it
in practice, so by the Linux rules it might not be an issue.

Below is the trivial series to reject unknown flags.  If this is not
acceptable there migh be some other ways, although they seem ugly:

 (a) add a new openat2 system call that enforces this behavior, and
     hope all majors libcs switch to using that by default to implement
     open(3).
 (b) add a new personality flag to enforce this behavior (or maybe
     opt in by default and allow admins to opt out of it)

             reply	other threads:[~2017-03-30 16:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 16:33 Christoph Hellwig [this message]
2017-03-30 16:33 ` RFC: reject unknown open flags Christoph Hellwig
2017-03-30 16:33 ` [PATCH 1/2] fs: add a VALID_OPEN_FLAGS Christoph Hellwig
2017-03-30 16:33 ` [PATCH 2/2] fs: reject unknown open flags Christoph Hellwig
2017-03-30 17:03   ` Linus Torvalds
2017-03-30 17:03     ` Linus Torvalds
2017-03-30 17:08 ` RFC: " Linus Torvalds
2017-03-30 17:08   ` Linus Torvalds
2017-03-30 17:21   ` Christoph Hellwig
2017-03-30 17:21     ` Christoph Hellwig
2017-03-30 18:19     ` Linus Torvalds
2017-03-30 18:19       ` Linus Torvalds
2017-03-30 18:26       ` Christoph Hellwig
2017-03-30 18:26         ` Christoph Hellwig
2017-03-30 18:45         ` Linus Torvalds
2017-03-30 18:45           ` Linus Torvalds
2017-03-30 20:05           ` Boaz Harrosh
2017-03-30 19:02       ` Paul Eggert
2017-03-30 19:14         ` Linus Torvalds
2017-03-30 19:22   ` Florian Weimer

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=20170330163327.23920-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.