Skip to content

Commit 84e6025

Browse files
saschagrunertcyphar
authored andcommitted
Add support for seccomp actions ActKillThread and ActKillProcess
Two new seccomp actions have been added to the libseccomp-golang dependency, which can be now supported by runc, too. ActKillThread kills the thread that violated the rule. It is the same as ActKill. All other threads from the same thread group will continue to execute. ActKillProcess kills the process that violated the rule. All threads in the thread group are also terminated. This action is only usable when libseccomp API level 3 or higher is supported. Signed-off-by: Sascha Grunert <sgrunert@redhat.com> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
1 parent c289934 commit 84e6025

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libcontainer/configs/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ const (
5050
Trace
5151
Log
5252
Notify
53+
KillThread
54+
KillProcess
5355
)
5456

5557
// Operator is a comparison operator to be used when matching syscall arguments in Seccomp

libcontainer/seccomp/seccomp_linux.go

+4
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ func getAction(act configs.Action, errnoRet *uint) (libseccomp.ScmpAction, error
133133
return libseccomp.ActLog, nil
134134
case configs.Notify:
135135
return libseccomp.ActNotify, nil
136+
case configs.KillThread:
137+
return libseccomp.ActKillThread, nil
138+
case configs.KillProcess:
139+
return libseccomp.ActKillProcess, nil
136140
default:
137141
return libseccomp.ActInvalid, errors.New("invalid action, cannot use in rule")
138142
}

0 commit comments

Comments
 (0)