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