fs: drop peer group ids under namespace lock
authorChristian Brauner <brauner@kernel.org>
Thu, 30 Mar 2023 07:13:16 +0000 (09:13 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 Mar 2023 10:13:37 +0000 (12:13 +0200)
commitcb2239c198ad9fbd5aced22cf93e45562da781eb
tree5d43c4188c28df77d264af1f4e46e0274a0843cf
parent197b6b60ae7bc51dd0814953c562833143b292aa
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: 2a1867219c7b ("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>
fs/namespace.c