Skip to content

Commit cb2239c

Browse files
committed
fs: drop peer group ids under namespace lock
When cleaning up peer group ids in the failure path we need to make sure to hold on to the namespace lock. Otherwise another thread might just turn the mount from a shared into a non-shared mount concurrently. Link: https://lore.kernel.org/lkml/00000000000088694505f8132d77@google.com Fixes: 2a18672 ("fs: add mount_setattr()") Reported-by: syzbot+8ac3859139c685c4f597@syzkaller.appspotmail.com Cc: stable@vger.kernel.org # 5.12+ Message-Id: <20230330-vfs-mount_setattr-propagation-fix-v1-1-37548d91533b@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 197b6b6 commit cb2239c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4183,9 +4183,9 @@ static int do_mount_setattr(struct path *path, struct mount_kattr *kattr)
41834183
unlock_mount_hash();
41844184

41854185
if (kattr->propagation) {
4186-
namespace_unlock();
41874186
if (err)
41884187
cleanup_group_ids(mnt, NULL);
4188+
namespace_unlock();
41894189
}
41904190

41914191
return err;

0 commit comments

Comments
 (0)