tommyvn
tommyvn

Reputation: 733

Presenting a virtual filesystem to a Linux process without root access

I'm looking for a way to present a userspace filesystem to a specific Linux process but I don't have root access.

The obvious answer is FUSE but without root access I cannot load the kernel module and so FUSE seems to be out of the question (unless there's a way to LD_PRELOAD it?).

The next best thing seems to be LD_PRELOAD with something that intercepts relevant FS calls and then transforms them, much like FUSE does at the VFS layer.

So my questions are:

  1. Does an LD_PRELOAD-able filesystem like FUSE exist?
  2. If I LD_PRELOAD some FS call intercepts for a process are there any gotchas, like perhaps the FS intercepts not being inherited by forks or children?

Upvotes: 7

Views: 1224

Answers (1)

Akshay Adiga
Akshay Adiga

Reputation: 43

AFAIK LD_PRELOAD can help you only to add some extra libraries (.so) which are not already present to in the system in the default path (nothing to do with filesystem).

Considering normal control flow in linux, all these system calls(filesystem related) will end-up in kernel space and eventually end up to the designated filesystem kernel modules. FUSE routes it back to user-space. I don't think you can intercept at VFS without disturbing kernel level code.

Going by your requirements you may need wrapper over libc which considers these files as a special case and bypasses the system calls

Upvotes: -3

Related Questions