44f80b
From 21cb5a8c7bcc90c42743ffd15cd11a55bf66993d Mon Sep 17 00:00:00 2001
44f80b
From: Giuseppe Scrivano <gscrivan@redhat.com>
44f80b
Date: Mon, 28 Feb 2022 11:06:50 +0100
44f80b
Subject: [PATCH 2/2] exec: --cap do not set inheritable capabilities
44f80b
44f80b
Closes: CVE-2022-27650
44f80b
44f80b
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
44f80b
(cherry picked from commit 1aeeed2e4fdeffb4875c0d0b439915894594c8c6)
44f80b
---
44f80b
 src/exec.c | 4 ++--
44f80b
 1 file changed, 2 insertions(+), 2 deletions(-)
44f80b
44f80b
diff --git a/src/exec.c b/src/exec.c
44f80b
index bf6c05f..8c9862d 100644
44f80b
--- a/src/exec.c
44f80b
+++ b/src/exec.c
44f80b
@@ -250,8 +250,8 @@ crun_command_exec (struct crun_global_arguments *global_args, int argc, char **a
44f80b
           capabilities->effective = exec_options.cap;
44f80b
           capabilities->effective_len = exec_options.cap_size;
44f80b
 
44f80b
-          capabilities->inheritable = dup_array (exec_options.cap, exec_options.cap_size);
44f80b
-          capabilities->inheritable_len = exec_options.cap_size;
44f80b
+          capabilities->inheritable = NULL;
44f80b
+          capabilities->inheritable_len = 0;
44f80b
 
44f80b
           capabilities->bounding = dup_array (exec_options.cap, exec_options.cap_size);
44f80b
           capabilities->bounding_len = exec_options.cap_size;
44f80b
-- 
44f80b
2.35.1
44f80b