linux_dsm_epyc7002/tools/testing/selftests
Tyler Hicks 59f5cf44a3 seccomp: Action to log before allowing
Add a new action, SECCOMP_RET_LOG, that logs a syscall before allowing
the syscall. At the implementation level, this action is identical to
the existing SECCOMP_RET_ALLOW action. However, it can be very useful when
initially developing a seccomp filter for an application. The developer
can set the default action to be SECCOMP_RET_LOG, maybe mark any
obviously needed syscalls with SECCOMP_RET_ALLOW, and then put the
application through its paces. A list of syscalls that triggered the
default action (SECCOMP_RET_LOG) can be easily gleaned from the logs and
that list can be used to build the syscall whitelist. Finally, the
developer can change the default action to the desired value.

This provides a more friendly experience than seeing the application get
killed, then updating the filter and rebuilding the app, seeing the
application get killed due to a different syscall, then updating the
filter and rebuilding the app, etc.

The functionality is similar to what's supported by the various LSMs.
SELinux has permissive mode, AppArmor has complain mode, SMACK has
bring-up mode, etc.

SECCOMP_RET_LOG is given a lower value than SECCOMP_RET_ALLOW as allow
while logging is slightly more restrictive than quietly allowing.

Unfortunately, the tests added for SECCOMP_RET_LOG are not capable of
inspecting the audit log to verify that the syscall was logged.

With this patch, the logic for deciding if an action will be logged is:

if action == RET_ALLOW:
  do not log
else if action == RET_KILL && RET_KILL in actions_logged:
  log
else if action == RET_LOG && RET_LOG in actions_logged:
  log
else if filter-requests-logging && action in actions_logged:
  log
else if audit_enabled && process-is-being-audited:
  log
else:
  do not log

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2017-08-14 13:46:47 -07:00
..
bpf bpf: more tests for mixed signed and unsigned bounds checks 2017-07-20 15:20:27 -07:00
breakpoints selftests: breakpoints: breakpoint_test_arm64: convert test to use TAP13 2017-06-30 16:16:17 -06:00
capabilities selftests/capabilities: Fix the test_execve test 2017-06-30 10:06:24 -06:00
cpu-hotplug
cpufreq
drivers/gpu
efivarfs
exec
filesystems
firmware
ftrace A few more minor updates: 2017-07-13 13:17:19 -07:00
futex selftests: futex: print testcase-name and PASS/FAIL/ERROR status 2017-06-07 10:07:21 -06:00
gpio
ia64
intel_pstate selftests: intel_pstate: add .gitignore 2017-06-30 10:06:24 -06:00
ipc
kcmp
kmod kmod: throttle kmod thread limit 2017-07-14 15:05:13 -07:00
lib selftests: lib: Skip tests on missing test modules 2017-06-23 09:41:53 -06:00
locking
media_tests
membarrier selftests: membarrier: use ksft_* var arg msg api 2017-06-30 16:16:23 -06:00
memfd selftest/memfd/Makefile: Fix build error 2017-06-23 13:35:00 -06:00
memory-hotplug selftests: fix memory-hotplug test 2017-06-30 10:06:23 -06:00
mount
mqueue
net selftest/net/Makefile: Specify output with $(OUTPUT) 2017-06-23 13:35:15 -06:00
networking/timestamping
nsfs
ntb NTB: ntb_test: add parameter for doorbell bitmask 2017-07-06 11:30:06 -04:00
powerpc selftests/powerpc: context_switch use private futexes with threads 2017-06-05 16:55:01 +10:00
prctl
pstore
ptp
ptrace
rcutorture rcu: Remove RCU CPU stall warnings from Tiny RCU 2017-06-08 18:52:45 -07:00
seccomp seccomp: Action to log before allowing 2017-08-14 13:46:47 -07:00
sigaltstack
size kselftest: convert get_size to use stricter TAP13 format 2017-06-14 18:23:27 -06:00
splice
static_keys
sync selftests: sync: Skip the test if kernel support is not found 2017-06-07 10:07:21 -06:00
sysctl test_sysctl: test against int proc_dointvec() array support 2017-07-12 16:26:00 -07:00
tc-testing selftests: Introduce tc testsuite 2017-06-20 13:15:10 -04:00
timers RTC for 4.13 2017-07-13 12:15:06 -07:00
user
vDSO
vm selftests/vm: Fix test for virtual address range mapping for arm64 2017-06-07 10:07:21 -06:00
watchdog
x86
zram
.gitignore
gen_kselftest_tar.sh
kselftest_harness.h Documentation/dev-tools: Add kselftest_harness documentation 2017-06-07 10:07:22 -06:00
kselftest_install.sh
kselftest.h kselftest: add ksft_print_msg() function to output general information 2017-06-30 16:15:04 -06:00
lib.mk
Makefile