From ab57460fa781a1ef9e3860f1314a3cb8738f94ed Mon Sep 17 00:00:00 2001 From: Kenta Tada Date: Wed, 15 Apr 2020 17:14:44 +0900 Subject: api: fix api update to check if SCMP_ACT_NOTIFY is supported Signed-off-by: Kenta Tada Acked-by: Tom Hromatka Signed-off-by: Paul Moore --- include/seccomp.h.in | 3 +++ src/api.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/seccomp.h.in b/include/seccomp.h.in index 8115b50..0266e12 100644 --- a/include/seccomp.h.in +++ b/include/seccomp.h.in @@ -413,6 +413,9 @@ const struct scmp_version *seccomp_version(void); * support for the SCMP_ACT_KILL_PROCESS action * 4 : support for the SCMP_FLTATR_CTL_SSB filter attrbute * 5 : support for the SCMP_ACT_NOTIFY action + * support for using seccomp_notify_receive() + * support for using seccomp_notify_respond() + * support for using seccomp_notify_id_valid() * */ unsigned int seccomp_api_get(void); diff --git a/src/api.c b/src/api.c index 126cbdc..843b6a3 100644 --- a/src/api.c +++ b/src/api.c @@ -115,7 +115,8 @@ static unsigned int _seccomp_api_update(void) level = 4; if (level == 4 && - sys_chk_seccomp_flag(SECCOMP_FILTER_FLAG_NEW_LISTENER) == 1) + sys_chk_seccomp_flag(SECCOMP_FILTER_FLAG_NEW_LISTENER) == 1 && + sys_chk_seccomp_action(SCMP_ACT_NOTIFY) == 1) level = 5; /* update the stored api level and return */ -- cgit v1.2.1