]> git.baikalelectronics.ru Git - kernel.git/commit
do_move_mount(): fix an unsafe use of is_anon_ns()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 May 2019 06:32:28 +0000 (02:32 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 May 2019 06:32:50 +0000 (02:32 -0400)
commit4ba802aba0920a37223ee0e4d2ddc977394cd3b0
tree686a142254d360a963f010bb573f4db5fb83e7bc
parent7df697fa973b700f3b3c3409799f403bb39db20e
do_move_mount(): fix an unsafe use of is_anon_ns()

What triggers it is a race between mount --move and umount -l
of the source; we should reject it (the source is parentless *and*
not the root of anon namespace at that), but the check for namespace
being an anon one is broken in that case - is_anon_ns() needs
ns to be non-NULL.  Better fixed here than in is_anon_ns(), since
the rest of the callers is guaranteed to get a non-NULL argument...

Reported-by: syzbot+494c7ddf66acac0ad747@syzkaller.appspotmail.com
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c