Conversation

is anyone working on virtualizing process executions particularly filesystem accesses? like sure FUSE exists to mock up a filesystem facade but generally i don't want to make a filesystem facade for the whole system, just for a specific process. some programming languages handle this by doing i/o through a virtual layer but i would really like to be able to intercept all the i/o a single process attempts to do without having to create a generally consistent filesystem

2
0
0

like i know the kernel is a multi-user system and is about managing os resources or whatever but like i think processes are generally good and cool and more parts of them should be virtualizable

1
0
0

there's stuff like jails and namespaces for untrusted code but i'm more interested in e.g. making test harnesses for complex filesystem interactions without having to mock out my entire i/o layer. would be super super fucking cool if i could intercept literally every i/o call

1
0
0

i bet the reason this doesn't exist is because codifying "the i/o visible to a specific process" is very different than codifying the hardware resources in general

1
0
0

i think processes are a nice abstraction and a nice way to compose code together and it's difficult to make use of it when you can't mock out process interactions

1
0
0

i made a rust/scala ffi layer to test out virtualizing i/o at the language level many years ago https://github.com/cosmicexplorer/upc it's a cool idea particularly how it makes memory blocks available through shm mappings but i would really like to intercept every i/o call a process makes

1
0
0

i'm kinda super mad about this now. if FUSE exists why isn't there an "intercept every i/o call" that doesn't go through the libc or other programming language

2
0
0

it looks like strace can indeed tamper with syscalls......wonder if there's overhead

1
0
0

@hipsterelectron I don't think strace has the functionality you want. It's basically equivalent to running the program under a debugger but without the functionality to poke memory & register state which you'd need to be able to change anything.

1
0
0

@hipsterelectron If you're not trying to make a hard security boundary, there are ways to poke the interception & rewriting into the instrumented process. This might be better.

0
0
0

@hipsterelectron FUSE is completely different than that. It's basically a network filesystem with the server on localhost communicating over high performance channels. It's not hacking the processes that access its filesystem.

0
0
0
@hipsterelectron you can put the process in its own mount namespace and mount a FUSE filesystem in that namespace.
1
0
1

@osandov that's really fascinating thank you so much

1
0
0

@osandov it had also not struck me that the entire point of FUSE is to be something you can run as an unprivileged user and ship as a package to your users. when we shipped an osxfuse filesystem for git at twitter we had to go through a very complex signature process to get our engineers' macs to accept it which effectively nullifies the benefit of an unprivileged filesystem. we have been curious about performance benchmarking in pants with this approach for a while

1
0
0

@osandov pants materializes files on demand and runs processes in "chroots" like guix, but we didn't go so far as to actually unshare the rest of the system yet. i'm particularly curious whether the highly specific info build tools usually have about expected reads and writes from subprocesses can be used to optimize highly parallel filesystem operations

1
0
0

@osandov i'm working on a kernel module today which will use the linux vfs layer to dump a serialization of a directory hierarchy into a procfile because i was tired of tracking open fds and max path lengths for a parallel directory walker i've been working on

0
0
0