Skip to content

Commit ef90e8f

Browse files
DaanDeMeyerYHNdnzj
authored andcommitted
Make sure we close bpf outer map fd in systemd-executor
Not doing so leaks it into the child service and causes selinux denials.
1 parent b3b33fa commit ef90e8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/execute-serialize.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,12 @@ static int exec_parameters_deserialize(ExecParameters *p, FILE *f, FDSet *fds) {
16251625
if (fd < 0)
16261626
continue;
16271627

1628+
/* This is special and relies on close-on-exec semantics, make sure it's
1629+
* there */
1630+
r = fd_cloexec(fd, true);
1631+
if (r < 0)
1632+
return r;
1633+
16281634
p->bpf_outer_map_fd = fd;
16291635
} else if ((val = startswith(l, "exec-parameters-notify-socket="))) {
16301636
r = free_and_strdup(&p->notify_socket, val);

0 commit comments

Comments
 (0)