Re: [PATCH linux-next] mqueue: fix IPC namespace use-after-free

From: Giuseppe Scrivano
Date: Tue Dec 19 2017 - 13:40:54 EST


Giuseppe Scrivano <gscrivan@xxxxxxxxxx> writes:

> The only issue I've seen with my version is that if I do:
>
> # unshare -im /bin/sh
> # mount -t mqueue mqueue /dev/mqueue
> # touch /dev/mqueue/foo
> # umount /dev/mqueue
> # mount -t mqueue mqueue /dev/mqueue
>
> then /dev/mqueue/foo doesn't exist at this point. Your patch does not
> have this problem and /dev/mqueue/foo is again accessible after the
> second mount.

although, how much is that of an issue? Is there any other way to delay
the cost of kern_mount_data()? Most containers have /dev/mqueue mounted
but it is not really going to be used.

Would it be possible somehow to postpone it until the first inode is
created?

Thanks,
Giuseppe