4 ms·
If you fork, can you change your pledge?
by calvinmorrison 4y ago
If you fork, can you change your pledge?
- elbigbad 4y agoNo a forked process only inherits the broadest permissions of the parent and can only downscope.
- notaplumber1 4y agoIt's not the broadest permissions from the parent, but the promises at the time of the fork, for example you can setup the parent in such a way that you fork off early a unprivileged (or privileged) child that has a different set of promises from the parent.
- waynesonfire 4y agokinda lose the setup / steady state benefit for child processes.
- notaplumber1 4y agoNot at all.
- loeg 4y agoIf you can exec, pledges disappear (by default, and also in common practice).
- KerrAvon 4y agoThis statement conflicts with other statements here -- is this actually true? It sounds like a security hole.
- legalcorrection 4y agoWhy not just pledge not to exec?
- ben_bai 4y agoif you have exec permission (pledge "exec") you can exec another program and it starts with a clean slate. It's about dropping privileges so it's assumed you know what your doing and in the best case scenario the executed binary will pledge itself. Pledge is not some external security feature but something that every program itself manages.
- loeg 4y agoFork and exec are different operations.
- tel 4y agoThere’s a second explicit a am list of pledged capabilities available if/when you exec.