]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
seccomp: Sysctl to display available actions
authorTyler Hicks <tyhicks@canonical.com>
Fri, 11 Aug 2017 04:33:52 +0000 (04:33 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:34:57 +0000 (07:34 -0500)
commit9ca58825270c606c59a0a863fed0f683ad1ab862
tree6b2a44da3bee48f2faca3cb8559383ff7b6c6855
parente95596f2392f2b14427a38969771526f7c716153
seccomp: Sysctl to display available actions

This patch creates a read-only sysctl containing an ordered list of
seccomp actions that the kernel supports. The ordering, from left to
right, is the lowest action value (kill) to the highest action value
(allow). Currently, a read of the sysctl file would return "kill trap
errno trace allow". The contents of this sysctl file can be useful for
userspace code as well as the system administrator.

The path to the sysctl is:

  /proc/sys/kernel/seccomp/actions_avail

libseccomp and other userspace code can easily determine which actions
the current kernel supports. The set of actions supported by the current
kernel may be different than the set of action macros found in kernel
headers that were installed where the userspace code was built.

In addition, this sysctl will allow system administrators to know which
actions are supported by the kernel and make it easier to configure
exactly what seccomp logs through the audit subsystem. Support for this
level of logging configuration will come in a future patch.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
(cherry picked from commit 8e5f1ad116df6b0de65eac458d5e7c318d1c05af linux-next)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Documentation/sysctl/kernel.txt
Documentation/userspace-api/seccomp_filter.rst
kernel/seccomp.c