Skip to content

Commit 79ca035

Browse files
committed
Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 4152d14 + 058f2e4 commit 79ca035

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/proc/root.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,13 @@ static void proc_kill_sb(struct super_block *sb)
264264
{
265265
struct proc_fs_info *fs_info = proc_sb_info(sb);
266266

267-
if (fs_info->proc_self)
268-
dput(fs_info->proc_self);
267+
if (!fs_info) {
268+
kill_anon_super(sb);
269+
return;
270+
}
269271

270-
if (fs_info->proc_thread_self)
271-
dput(fs_info->proc_thread_self);
272+
dput(fs_info->proc_self);
273+
dput(fs_info->proc_thread_self);
272274

273275
kill_anon_super(sb);
274276
put_pid_ns(fs_info->pid_ns);

0 commit comments

Comments
 (0)