Re: [PATCH] ksys_mount: check for permissions before resource allocation

From: Ilya Matveychikov
Date: Tue Jun 05 2018 - 08:42:49 EST



> On Jun 5, 2018, at 4:28 PM, David Sterba <dsterba@xxxxxxx> wrote:
>
>> BTW, sys_umount() has this check in the right place - before doing anything.
>> So, why not to have the same logic for mount/umount?
>
> What if the check is not equivalent to the one done later? may_mount
> needs namespace, it will be available at umount time but not necessarily
> during mount due to the security hooks.

Might be the issue, youâre right. I canât tell it for sure as Iâm not so
familiar with linux/fs code.