linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* General flags to turn things off (getrandom, pid lookup, etc)
@ 2014-07-25 18:30 Andy Lutomirski
  2014-07-25 20:15 ` Dave Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Andy Lutomirski @ 2014-07-25 18:30 UTC (permalink / raw)
  To: Eric W. Biederman, Julien Tinnes, David Drysdale, Al Viro,
	Paolo Bonzini, LSM List, Greg Kroah-Hartman, Paul Moore,
	James Morris, Linux API, Meredydd Luff, Christoph Hellwig,
	linux-kernel@vger.kernel.org, Kees Cook, Theodore Ts'o,
	Andy Lutomirski, Henrique de Moraes Holschuh, linux-crypto

[new thread because this sort of combines two threads]

There is recent interest in having a way to turn generally-available
kernel features off.  Maybe we should add a good one so we can stop
bikeshedding and avoid proliferating dumb interfaces.

Things that might want to be turn-off-able include:
 - getrandom with GRND_RANDOM [from the getrandom threads]
 - Any lookup of a non-self pid [from the capsicum thread]
 - Any lookup of a pid outside the caller thread group [capsicum]
 - Various architectural things (personal wishlist), e.g.:
    - RDTSC and userspace HPET access
    - CPUID?
    - 32-bit GDT code segments [huge attack surface]
    - 64-bit GDT code segments [probably pointless]

I would propose a new syscall for this:

long restrict_userspace(int mode, int type, int value, int flags);

mode is RESTRICT_SET, RESTRICT_GET, or RESTRICT_LOCK.

type is RESTRICT_GRND_RANDOM, RESTRICT_PID_SCOPE, RESTRICT_X86_TIMING, etc.

Value is zero if RESTRICT_GET.  Otherwise value is the desired value,
generally 0 or 1.  For RESTRICT_PID_SCOPE, value would be
RESTRICT_PID_SCOPE_ANY, RESTRICT_PID_SCOPE_THREADGROUP, or
RESTRICT_PID_SCOPE_SELF.

flags must be zero.  Someday, someone will propose a thread-sync flag.

restrict_userspace requires either no_new_privs or CAP_SYS_ADMIN in
the current user namespace.

Thoughts?

--Andy

-- 
Andy Lutomirski
AMA Capital Management, LLC

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-07-31  2:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 18:30 General flags to turn things off (getrandom, pid lookup, etc) Andy Lutomirski
2014-07-25 20:15 ` Dave Jones
     [not found]   ` <20140725201507.GA23410-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-07-25 20:21     ` Andy Lutomirski
     [not found] ` <CALCETrWGvBfrX1W5XaFgJZhKHLf+oac9YrwPR3ppK=deQtu5hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-25 21:35   ` One Thousand Gnomes
2014-07-25 21:41     ` Andy Lutomirski
2014-07-26 19:48       ` Eric W. Biederman
2014-07-30 14:37       ` One Thousand Gnomes
2014-07-25 23:43   ` H. Peter Anvin
2014-07-25 23:54     ` Andy Lutomirski
2014-07-27 12:26   ` David Drysdale
2014-07-27 21:06 ` Theodore Ts'o
2014-07-27 22:17   ` Andy Lutomirski
     [not found]     ` <CALCETrXfzOZEC3mOKkm3_GvitvkEu4kAa3LowRv-fjHnzrQnBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-27 23:53       ` Eric W. Biederman
2014-07-30 14:37         ` One Thousand Gnomes
2014-07-30 18:41           ` Eric W. Biederman
2014-07-30 21:29             ` One Thousand Gnomes
2014-07-31  2:37               ` Eric W. Biederman

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).