libseccomp: initial import of project
This patch is the initial import of the libseccomp library, a library
intended for use by application developers who wish to leverage the
enhanced seccomp (mode 2) support in the Linux Kernel but who do not
want to craft their own seccomp filter code by hand. This library will
provide a high-level API for developers which will allow them to
generate and load seccomp filter code into the kernel by specifying
which syscalls, optionally with argument values, are to be allowed or
denied by the kernel.
Needless to say, this is an initial import into the git repository so
everything is still subject to change, and the usual caveats about
untested code apply quite strongly.
This code is licensed under the GPLv2, with some portions taken from
examples provided by Will Drewry <wad@chromium.org> and copyrighted
by the Chromium OS Authors <chromium-os-dev@chromium.org> which carries
the following license (included in the associated files as well):
"The code may be used by anyone for any purpose, and can serve as a
starting point for developing applications using
prctl(PR_ATTACH_SECCOMP_FILTER).
No guarantees are provided with respect to the correctness or
functionality of this code."
Signed-off-by:
Paul Moore <pmoore@redhat.com>
Showing
- LICENSE 339 additions, 0 deletionsLICENSE
- Makefile 88 additions, 0 deletionsMakefile
- README 1 addition, 0 deletionsREADME
- include/seccomp.h 59 additions, 0 deletionsinclude/seccomp.h
- include/seccomp_filter.h 84 additions, 0 deletionsinclude/seccomp_filter.h
- macros.mk 71 additions, 0 deletionsmacros.mk
- src/Makefile 53 additions, 0 deletionssrc/Makefile
- src/bpf_helper.c 89 additions, 0 deletionssrc/bpf_helper.c
- src/bpf_helper.h 223 additions, 0 deletionssrc/bpf_helper.h
- src/filter_db.c 365 additions, 0 deletionssrc/filter_db.c
- src/filter_db.h 98 additions, 0 deletionssrc/filter_db.h
- src/library_api.c 192 additions, 0 deletionssrc/library_api.c
- src/translator_bpf.c 407 additions, 0 deletionssrc/translator_bpf.c
- src/translator_bpf.h 36 additions, 0 deletionssrc/translator_bpf.h
- src/translator_str.c 141 additions, 0 deletionssrc/translator_str.c
- src/translator_str.h 29 additions, 0 deletionssrc/translator_str.h
- tests/01-basic.c 37 additions, 0 deletionstests/01-basic.c
- tests/02-basic-pfc.c 61 additions, 0 deletionstests/02-basic-pfc.c
- tests/Makefile 61 additions, 0 deletionstests/Makefile
- version_info 6 additions, 0 deletionsversion_info
Loading
Please register or sign in to comment