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:
Al Viro
2009-05-08 16:05:57 -04:00
parent f9dbd05bc9
commit 2a32cebd6c
7 changed files with 25 additions and 13 deletions

View File

@@ -423,8 +423,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
if (!(*flags & MS_RDONLY)) mark_dirty(s);
kfree(s->s_options);
s->s_options = new_opts;
replace_mount_options(s, new_opts);
return 0;