In do_remount() when we fail to allocate an fs_context object, the code
jumps to the call to put_fs_context(), which then oopses as fc == -ENOMEM.
Fix this by jumping to the return statement after that instead.
Fixes: 37744f3d21f8 ("vfs: Implement a filesystem superblock creation/configuration context")
Reported-by: syzbot+cefb6ac96fc431886ec2@syzkaller.appspotmail.com
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
FS_CONTEXT_FOR_RECONFIGURE);
err = PTR_ERR(fc);
if (IS_ERR(fc))
- goto err_fc;
+ goto err;
err = parse_monolithic_mount_data(fc, data, data_size);
if (err < 0)
up_write(&sb->s_umount);
err_fc:
put_fs_context(fc);
+err:
return err;
}