All of lore.kernel.org
 help / color / mirror / Atom feed
* [kernel-hardening] System call interface changes
@ 2015-11-20 10:30 Florian Weimer
  2015-11-20 19:16 ` Rich Felker
  2015-11-24 20:10 ` Kees Cook
  0 siblings, 2 replies; 10+ messages in thread
From: Florian Weimer @ 2015-11-20 10:30 UTC (permalink / raw)
  To: kernel-hardening

Not sure if this in scope for this list.  If not, please say so.

Currently, the system call interface to user space expects the system
call number in a register (on i386 and x86_64, and probably most other
architectures).  This means that once you have a system call instruction
in the process image, it can be theoretically used to run *any* system
call, including ones that are not actually referenced in the binary.  As
a result, you need seccomp or a Linux security module to interdict
certain system calls.

This would have to be an opt-in feature, obviously, and applications
would have to opt in explicitly via some ELF flag (similar to what we
did for non-executable stacks).

Do you think it would be feasible to encode the system call number in
the instruction stream instead, next to the instruction?  I think this
would have to set the system call MSR (LSTAR) on some context switches
at least (to avoid a conditional branch in the system call handler,
depending on whether the process has opted in to the new interface), and
add a few instructions (two loads and an add, so that the system call
number can be encoded in multiple ways, to avoid creating otherwise
useful bit patterns).  On the other hand, it would avoid the need to
load the sixth argument from the stack on i386.

Florian

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

end of thread, other threads:[~2015-12-07 16:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20 10:30 [kernel-hardening] System call interface changes Florian Weimer
2015-11-20 19:16 ` Rich Felker
2015-11-24 19:54   ` Florian Weimer
2015-11-24 20:29     ` Rich Felker
2015-11-24 20:10 ` Kees Cook
2015-11-24 20:54   ` Florian Weimer
2015-11-24 21:43     ` Kees Cook
2015-12-07 15:44       ` Florian Weimer
2015-12-07 16:26         ` lazytyped
2015-11-24 22:33     ` Rich Felker

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.