linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] exec: Use sane stack rlimit under secureexec
@ 2017-07-10  7:57 Kees Cook
  2017-07-10  7:57 ` [PATCH v2 1/8] exec: Correct comments about "point of no return" Kees Cook
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Kees Cook @ 2017-07-10  7:57 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Kees Cook, Andy Lutomirski, David Howells, Serge Hallyn,
	John Johansen, Casey Schaufler, Eric W. Biederman, Alexander Viro,
	Michal Hocko, Ben Hutchings, Hugh Dickins, Oleg Nesterov,
	Jason A. Donenfeld, Rik van Riel, James Morris, Greg Ungerer,
	Ingo Molnar, Nicolas Pitre, Stephen Smalley, Paul Moore,
	Vivek Goyal, Mickaël Salaün, Tetsuo Handa,
	linux-fsdevel, linux-kernel, linux-security-module, selinux

As discussed with Linus and Andy, we need to reset the stack rlimit
before we do memory layouts when execing a privilege-gaining (e.g.
setuid) program. This moves security_bprm_secureexec() earlier (with
required changes), and then lowers the stack limit when appropriate.

As a side-effect, dumpability and pdeath_signal clearing is expanded
to cover LSM definitions of secureexec (and Smack can drop its special
handler for pdeath_signal clearing).

I'd appreciate some extra eyes on this to make sure this isn't
broken in some special way. I couldn't find anything that _depended_
on security_bprm_secureexec() being called late.

Thanks!

-Kees

v2:
- fix missed current_security() uses in LSMs.
- research/consolidate dumpability setting logic
- research/consolidate pdeath_signal clearing logic
- split up logical steps a little more for easier review (and bisection)
- fix some old broken comments

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

end of thread, other threads:[~2017-07-18 13:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10  7:57 [PATCH v2 0/8] exec: Use sane stack rlimit under secureexec Kees Cook
2017-07-10  7:57 ` [PATCH v2 1/8] exec: Correct comments about "point of no return" Kees Cook
2017-07-10  8:46   ` Eric W. Biederman
2017-07-10 16:04     ` Kees Cook
     [not found]       ` <CAGXu5jKTaXLU+H6DnNuy6ggxcMDgo9G-wEmZ4RP=QneJaZuNDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-10 17:07         ` Eric W. Biederman
2017-07-18  6:39           ` Kees Cook
2017-07-18 13:12             ` Eric W. Biederman
2017-07-18 13:42               ` Kees Cook
2017-07-10  7:57 ` [PATCH v2 2/8] exec: Move security_bprm_secureexec() earlier Kees Cook
2017-07-10  8:57   ` Eric W. Biederman
2017-07-10 16:06     ` Kees Cook
     [not found]       ` <CAGXu5jLw6SsXM66x7ZHdj+Pb8Aepq7rHn1saNHRhq-wqk8p=4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-10 17:18         ` Eric W. Biederman
2017-07-11  2:07           ` Kees Cook
2017-07-18  6:45             ` Kees Cook
2017-07-10  7:57 ` [PATCH v2 3/8] exec: Use secureexec for setting dumpability Kees Cook
2017-07-10  7:57 ` [PATCH v2 4/8] exec: Use secureexec for clearing pdeath_signal Kees Cook
2017-07-10  7:57 ` [PATCH v2 5/8] smack: Remove redundant pdeath_signal clearing Kees Cook
2017-07-10  7:57 ` [PATCH v2 6/8] exec: Consolidate dumpability logic Kees Cook
2017-07-10  7:57 ` [PATCH v2 7/8] exec: Consolidate pdeath_signal clearing Kees Cook
2017-07-10  7:57 ` [PATCH v2 8/8] exec: Use sane stack rlimit under secureexec Kees Cook
2017-07-10 14:08   ` Ben Hutchings

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