On Thu, 1 Dec 2022 17:37:26 -0000 (UTC)
gaz...@shell.xmission.com (Kenny McCormack) wrote:
> >The idea is to make a small suid-root utility that does the
> >above loopback mount. Much like fusermount.
> >
>
> Sounds good. Can you give me the root password for the machine on
> which I need to do this? Thanks.
>
> 'Cause I'll need that in order to create that suid-root utility...
I think you're asking a reasonable question, and then inhibiting the
discussion with rather too much snark.
I think your question is: Can I mount anything without root
privileges? The answer seems to be No, but might be Yes. I'm just a
Linux security tourist. I don't live there or work there.
On NetBSD, under some security models, the answer is Yes. If the user
has privileges on the device and mount directory, the mount succeeds.
This was especially helpful back in the day of spinning round plastic,
then known as a "CD-ROM".
A quick scan of the Linux mount(8) man page reveals
context=context
and brethren. That looks like the way there.
I don't think the fact that FUSE supplies the device from a
user-owned gadget matters to the security model, because the operations
pass through the kernel.
> Can you give me the root password for the machine
If you expect to do any root thing without root privileges, you're
going to be disappointed. The security begins with deny, and can be
relaxed only by a user with sufficient privileges.
The guy who wrote fusermount didn't know the root password on your
machine, and his executable didn't come with set-uid magically turned
on. The binary gained that privilege when you, as a privileged user,
granted it.
HTH.
--jkl