• Kees Cook's avatar
    exec: Correct comments about "point of no return" · a9208e42
    Kees Cook authored
    In commit 221af7f8 ("Split 'flush_old_exec' into two functions"),
    the comment about the point of no return should have stayed in
    flush_old_exec() since it refers to "bprm->mm = NULL;" line, but prior
    changes in commits c89681ed ("remove steal_locks()"), and
    fd8328be ("sanitize handling of shared descriptor tables in failing
    execve()") made it look like it meant the current->sas_ss_sp line instead.
    
    The comment was referring to the fact that once bprm->mm is NULL, all
    failures from a binfmt load_binary hook (e.g. load_elf_binary), will
    get SEGV raised against current. Move this comment and expand the
    explanation a bit, putting it above the assignment this time, and add
    details about the true nature of "point of no return" being the call
    to flush_old_exec() itself.
    
    This also removes an erroneous commet about when credentials are being
    installed. That has its own dedicated function, install_exec_creds(),
    which carries a similar (and correct) comment, so remove the bogus comment
    where installation is not actually happening.
    
    Cc: David Howells <dhowells@redhat.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    Acked-by: default avatarSerge Hallyn <serge@hallyn.com>
    a9208e42
exec.c 45.6 KB