path: root/drivers
diff options
authorKees Cook <>2018-04-10 16:35:01 -0700
committerLinus Torvalds <>2018-04-11 10:28:37 -0700
commitc31dbb146dd44af44bc60780ce8fa7a9f5f746df (patch)
treeac3f22913cec3082511ab9143d153ad30975a884 /drivers
parentb83838313386f617d6bd8201be7f5b532059bba1 (diff)
exec: pin stack limit during exec
Since the stack rlimit is used in multiple places during exec and it can be changed via other threads (via setrlimit()) or processes (via prlimit()), the assumption that the value doesn't change cannot be made. This leads to races with mm layout selection and argument size calculations. This changes the exec path to use the rlimit stored in bprm instead of in current. Before starting the thread, the bprm stack rlimit is stored back to current. Link: Fixes: 64701dee4178e ("exec: Use sane stack rlimit under secureexec") Signed-off-by: Kees Cook <> Reported-by: Ben Hutchings <> Reported-by: Andy Lutomirski <> Reported-by: Brad Spengler <> Acked-by: Michal Hocko <> Cc: Ben Hutchings <> Cc: Greg KH <> Cc: Hugh Dickins <> Cc: "Jason A. Donenfeld" <> Cc: Laura Abbott <> Cc: Oleg Nesterov <> Cc: Rik van Riel <> Cc: Willy Tarreau <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions