aboutsummaryrefslogtreecommitdiffstats
path: root/main/libseccomp/tests-11-basic-errors-support-older-kernels.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/libseccomp/tests-11-basic-errors-support-older-kernels.patch')
-rw-r--r--main/libseccomp/tests-11-basic-errors-support-older-kernels.patch108
1 files changed, 0 insertions, 108 deletions
diff --git a/main/libseccomp/tests-11-basic-errors-support-older-kernels.patch b/main/libseccomp/tests-11-basic-errors-support-older-kernels.patch
deleted file mode 100644
index 2e80c8e8527..00000000000
--- a/main/libseccomp/tests-11-basic-errors-support-older-kernels.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-Url: https://github.com/seccomp/libseccomp/issues/338
-From 5532444587fa5f33a43179ca5cc710f1bb05f51f Mon Sep 17 00:00:00 2001
-From: Paul Moore <paul@paul-moore.com>
-Date: Mon, 18 Oct 2021 09:42:02 -0600
-Subject: [PATCH] tests: fix 11-basic-basic_errors on old kernels (API level <
- 5)
-
-Reported-by: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
-Reported-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
-Signed-off-by: Paul Moore <paul@paul-moore.com>
-Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
----
- tests/11-basic-basic_errors.c | 72 +++++++++++++++++++----------------
- 1 file changed, 39 insertions(+), 33 deletions(-)
-
-diff --git a/tests/11-basic-basic_errors.c b/tests/11-basic-basic_errors.c
-index 785e094e..dcfa7c28 100644
---- a/tests/11-basic-basic_errors.c
-+++ b/tests/11-basic-basic_errors.c
-@@ -29,9 +29,13 @@ int main(int argc, char *argv[])
- int rc;
- scmp_filter_ctx ctx;
- uint32_t attr;
-+ unsigned int api;
- struct seccomp_notif *req = NULL;
- struct seccomp_notif_resp *resp = NULL;
-
-+ /* get the api level */
-+ api = seccomp_api_get();
-+
- /* seccomp_init errors */
- ctx = seccomp_init(SCMP_ACT_ALLOW + 1);
- if (ctx != NULL)
-@@ -234,39 +238,41 @@ int main(int argc, char *argv[])
- ctx = NULL;
-
- /* seccomp notify errors */
-- ctx = seccomp_init(SCMP_ACT_ALLOW);
-- if (ctx == NULL)
-- return -1;
-- rc = seccomp_notify_alloc(NULL, NULL);
-- if (rc != 0)
-- return -1;
-- rc = seccomp_notify_alloc(&req, NULL);
-- if (rc != 0)
-- return -1;
-- rc = seccomp_notify_alloc(NULL, &resp);
-- if (rc != 0)
-- return -1;
-- seccomp_notify_free(NULL, NULL);
-- seccomp_notify_free(req, resp);
-- req = NULL;
-- resp = NULL;
-- rc = seccomp_notify_receive(-1, NULL);
-- if (rc == 0)
-- return -1;
-- rc = seccomp_notify_respond(-1, NULL);
-- if (rc == 0)
-- return -1;
-- rc = seccomp_notify_id_valid(-1, 0);
-- if (rc == 0)
-- return -1;
-- rc = seccomp_notify_fd(NULL);
-- if (rc == 0)
-- return -1;
-- rc = seccomp_notify_fd(ctx);
-- if (rc == 0)
-- return -1;
-- seccomp_release(ctx);
-- ctx = NULL;
-+ if (api >= 5) {
-+ ctx = seccomp_init(SCMP_ACT_ALLOW);
-+ if (ctx == NULL)
-+ return -1;
-+ rc = seccomp_notify_alloc(NULL, NULL);
-+ if (rc != 0)
-+ return -1;
-+ rc = seccomp_notify_alloc(&req, NULL);
-+ if (rc != 0)
-+ return -1;
-+ rc = seccomp_notify_alloc(NULL, &resp);
-+ if (rc != 0)
-+ return -1;
-+ seccomp_notify_free(NULL, NULL);
-+ seccomp_notify_free(req, resp);
-+ req = NULL;
-+ resp = NULL;
-+ rc = seccomp_notify_receive(-1, NULL);
-+ if (rc == 0)
-+ return -1;
-+ rc = seccomp_notify_respond(-1, NULL);
-+ if (rc == 0)
-+ return -1;
-+ rc = seccomp_notify_id_valid(-1, 0);
-+ if (rc == 0)
-+ return -1;
-+ rc = seccomp_notify_fd(NULL);
-+ if (rc == 0)
-+ return -1;
-+ rc = seccomp_notify_fd(ctx);
-+ if (rc == 0)
-+ return -1;
-+ seccomp_release(ctx);
-+ ctx = NULL;
-+ }
-
- return 0;
- }