Skip to contentSkip to conversation

libfuse accepts subtypes with slashes in them??

DISCUSSION Darrick J. Wong 2 participants 2 messages Apr 22 – Apr 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hey everyone,

So today I noticed that this happens on Debian 13:

$ mount -t fuse./bin/ls /root/ /etc/shadow
ls: cannot access 'rw,dev,suid': No such file or directory
-rw-r----- 1 root 1345 Nov 18 10:38 /etc/shadow

ls: cannot open directory '/root': Permission denied

Uh... is that intentional? It looks as though mount does:

execve("/sbin/mount.fuse", ["/sbin/mount.fuse", "/root", "/etc/shadow", "-o", "rw", "-t", "fuse./bin/ls"]...)

and then mount.fuse just trims off everything after the "fuse." and does:

execve("/bin/sh", ["/bin/sh", "-c", "'/bin/ls' '/root' '/etc/shadow' '-o' 'rw,dev,suid'"]...)

with the odd output that you see above. Is that supposed to happen? Or should libfuse reject subtypes with path separators?

--D

maintainer
#1 lore raw
Quoted 15 lines · Darrick J. Wong

Hey everyone,

So today I noticed that this happens on Debian 13:

$ mount -t fuse./bin/ls /root/ /etc/shadow
ls: cannot access 'rw,dev,suid': No such file or directory
-rw-r----- 1 root 1345 Nov 18 10:38 /etc/shadow

ls: cannot open directory '/root': Permission denied

Uh... is that intentional? It looks as though mount does:

execve("/sbin/mount.fuse", ["/sbin/mount.fuse", "/root", "/etc/shadow", "-o", "rw", "-t", "fuse./bin/ls"]...)

Quoted 7 lines

and then mount.fuse just trims off everything after the "fuse." and does:

execve("/bin/sh", ["/bin/sh", "-c", "'/bin/ls' '/root' '/etc/shadow' '-o' 'rw,dev,suid'"]...)

with the odd output that you see above. Is that supposed to happen? Or should libfuse reject subtypes with path separators?

Probably should have done that. But now this is probably abused and would cause breakage if changed.

Thanks,
Miklos