1. 25 Apr, 2008 6 commits
    • Al Viro's avatar
      [PATCH] sanitize locate_fd() · f8f95702
      Al Viro authored
      * 'file' argument is unused; lose it.
      * move setting flags from the caller (dupfd()) to locate_fd();
        pass cloexec flag as new argument.  Note that files_fdtable()
        that used to be in dupfd() isn't needed in the place in
        locate_fd() where the moved code ends up - we know that ->file_lock
        hadn't been dropped since the last time we calculated fdt because
        we can get there only if expand_files() returns 0 and it doesn't
        drop/reacquire in that case.
      * move getting/dropping ->file_lock into locate_fd().  Now the caller
        doesn't need to do anything with files_struct *files anymore and
        we can move that inside locate_fd() as well, killing the
        struct files_struct * argument.
      
      At that point locate_fd() is extremely similar to get_unused_fd_flags()
      and the next patches will merge those two.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      f8f95702
    • Al Viro's avatar
      [PATCH] sanitize unshare_files/reset_files_struct · 3b125388
      Al Viro authored
      * let unshare_files() give caller the displaced files_struct
      * don't bother with grabbing reference only to drop it in the
        caller if it hadn't been shared in the first place
      * in that form unshare_files() is trivially implemented via
        unshare_fd(), so we eliminate the duplicate logics in fork.c
      * reset_files_struct() is not just only called for current;
        it will break the system if somebody ever calls it for anything
        else (we can't modify ->files of somebody else).  Lose the
        task_struct * argument.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3b125388
    • 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
    • Al Viro's avatar
      [PATCH] close race in unshare_files() · 6b335d9c
      Al Viro authored
      updating current->files requires task_lock
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      6b335d9c
    • Al Viro's avatar
      [PATCH] restore sane ->umount_begin() API · 42faad99
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      42faad99
    • Igor Mammedov's avatar
      cifs: timeout dfs automounts +little fix. · 78d31a3a
      Igor Mammedov authored
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      78d31a3a
  2. 24 Apr, 2008 34 commits