Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • fs
  • exec.c
Find file BlameHistoryPermalink
  • Kees Cook's avatar
    exec: pin stack limit during exec · c31dbb14
    Kees Cook authored Apr 10, 2018
    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: http://lkml.kernel.org/r/1518638796-20819-4-git-send-email-keescook@chromium.org
    Fixes: 64701dee
    
     ("exec: Use sane stack rlimit under secureexec")
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Reported-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
    Reported-by: default avatarAndy Lutomirski <luto@kernel.org>
    Reported-by: default avatarBrad Spengler <spender@grsecurity.net>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Cc: Greg KH <greg@kroah.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
    Cc: Laura Abbott <labbott@redhat.com>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Willy Tarreau <w@1wt.eu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c31dbb14
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7