libnoexec: disable exec(3) for dynamically linked executables
  • C 88.5%
  • Shell 6.4%
  • Makefile 5.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-29 09:25:48 -04:00
test LIBNOEXEC_FORK: optionally disable fork() 2026-06-26 09:02:38 -04:00
.gitignore libnoexec: prevent exec(3) for executables 2022-04-26 07:16:48 -04:00
libnoexec.c refactor: libnoexec: move env check into init 2026-06-27 10:06:38 -04:00
LICENSE doc: update copyright dates 2026-04-11 07:45:33 -04:00
Makefile cleanup: set symbol visibility to hidden 2023-05-17 06:43:56 -04:00
README.md doc: README: disable fork(2) 2026-06-29 09:25:48 -04:00
restrict_process.h refactor: libnoexec: move env check into init 2026-06-27 10:06:38 -04:00
restrict_process_seccomp.c refactor: seccomp: add function to enforce seccomp policy 2026-06-28 09:53:17 -04:00

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)