libnoexec: disable exec(3) for dynamically linked executables
- C 88.5%
- Shell 6.4%
- Makefile 5.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| test | ||
| .gitignore | ||
| libnoexec.c | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| restrict_process.h | ||
| restrict_process_seccomp.c | ||
libnoexec
libnoexec: disable exec(3) for dynamically linked executables
DESCRIPTION
libnoexec prevents dynamically linked executables from calling exec(3) and optionally fork(2).
EXAMPLES
$ LD_PRELOAD=libnoexec.so sh -c "ls"
sh: 1: ls: Permission denied
# echo is a shell builtin
$ LD_PRELOAD=libnoexec.so sh -c "echo test"
test
$ LD_PRELOAD=libnoexec.so LIBNOEXEC_FORK=1 sh -c "echo $$; ( echo $$ ) & echo $$"
25341
sh: 0: Cannot fork
ENVIRONMENT VARIABLES
LIBNOEXEC_FORK :set to any value to disallow executables from calling fork(2) (or clone(2) on linux) (default: unset)