Skip to content

Commit

Permalink
Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/ebiederm/user-namespace

Pull proc fix from Eric Biederman:
 "Syzbot found a NULL pointer dereference if kzalloc of s_fs_info fails"

* 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: s_fs_info may be NULL when proc_kill_sb is called
  • Loading branch information
Linus Torvalds committed Jun 10, 2020
2 parents 4152d14 + 058f2e4 commit 79ca035
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,13 @@ static void proc_kill_sb(struct super_block *sb)
{
struct proc_fs_info *fs_info = proc_sb_info(sb);

if (fs_info->proc_self)
dput(fs_info->proc_self);
if (!fs_info) {
kill_anon_super(sb);
return;
}

if (fs_info->proc_thread_self)
dput(fs_info->proc_thread_self);
dput(fs_info->proc_self);
dput(fs_info->proc_thread_self);

kill_anon_super(sb);
put_pid_ns(fs_info->pid_ns);
Expand Down

0 comments on commit 79ca035

Please sign in to comment.