• Al Viro's avatar
    [PATCH] sanitize handling of shared descriptor tables in failing execve() · fd8328be
    Al Viro authored
    * unshare_files() can fail; doing it after irreversible actions is wrong
      and de_thread() is certainly irreversible.
    * since we do it unconditionally anyway, we might as well do it in do_execve()
      and save ourselves the PITA in binfmt handlers, etc.
    * while we are at it, binfmt_som actually leaked files_struct on failure.
    
    As a side benefit, unshare_files(), put_files_struct() and reset_files_struct()
    become unexported.
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    fd8328be
binfmt_misc.c 15.2 KB