Lurker News
Back to discussion

Comment by notamy

notamy3 replies#
I actually attempted using ptrace to rewrite syscalls first! It was... horribly painful, and didn't work anywhere near as well as the bind-mount version.
oneplane1 reply#
In the past I used something like inotab to use an inotify-based trigger to pipe data from SSH to a different system that didn't have any NAS or SAN support, it might also work to detect 'who' is touching any files that boxxy has previously seen rules for.

Perhaps still too tricky to make it do magic things and break programs in the process, but it could be used to audit who's working with what paths and let the user print a report so they know what apps to boxx up and make them behave.

notamy1 reply#
That is an excellent idea! Something like could definitely be worth adding. It's why there's a "remount rootfs as ro" flag; that way anything not specified in rules is ro and misbehaving programs will explode.
oneplane#
Love exploding apps. That's what they get for eating my filesystem.
yegle1 reply#
Fun fact, one layer of App Engine's sandbox from a couple years ago was implemented using ptrace. It will redirect filesystem IO to in-memory files.
notamy2 replies#
Interesting! That makes perfect sense, I just don't think I'm smart enough to use ptrace properly right now :P
gary_01 reply#
Were you mostly going off the ptrace man page? I tried reading it to figure out ptrace and it made me feel not smart enough too.

Continue this thread — 1 reply

efreak#
Try checking out proot?
lytigas#
For a structured approach to ptrace/syscall rewriting, you could try FB's reverie. I worked on and used it during an internship a few years back; it's pretty amazing at what it does.

https://github.com/facebookexperimental/reverie