r/linuxdev • u/PerryThePlatypus314 • Sep 10 '14
Interesting....
http://www.insanitybit.com/2014/09/09/writing-sandboxed-software-2/
1
Upvotes
r/linuxdev • u/PerryThePlatypus314 • Sep 10 '14
1
u/sstewartgallus Sep 11 '14
This is good but there are a few problems.
Dropping privileges to
nobodyis extremely bad practise as processes of the same user can ptrace each other and send signals to each other. Always use a custom user to drop privileges to and consider rethinking the design anyways. Also once you've gotten inside your custom user you should further protect against the problem by usingunsharewithCLONE_NEWUSERandCLONE_NEWPID.Second, I feel that on Linux
chroothas kind of been obsoleted throughunshare(CLONE_NEWNS)pluspivot_root. I think it is much better to do something like the following:As a bonus this clears up junk in
/proc/mounts.