Fix races around the access to ->s_options
Put generic_show_options read access to s_options under rcu_read_lock, split save_mount_options() into "we are setting it the first time" (uses in foo_fill_super()) and "we are relacing and freeing the old one", synchronize_rcu() before kfree() in the latter. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@ -507,8 +507,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
||||
kfree(new_opts);
|
||||
return -EINVAL;
|
||||
}
|
||||
kfree(sb->s_options);
|
||||
sb->s_options = new_opts;
|
||||
replace_mount_options(sb, new_opts);
|
||||
|
||||
sbi->s_flags = mount_flags;
|
||||
sbi->s_mode = mode;
|
||||
|
Reference in New Issue
Block a user