From 38623336fb84eb0df1f72ef8d472a36bb5d60822 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 21 Aug 2024 11:25:46 +0200 Subject: [PATCH] Revert "cgroup-util: Don't try to open pidfd for kernel threads" The kernel patch was reverted so let's try again to open pidfds for kernel threads. This reverts commit ead48ec35c863650944352a3455f26ce3b393058. (cherry picked from commit 1ce69e06615e69692a6d02d447acfd77f5d44631) Related: RHEL-52634 --- src/basic/cgroup-util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 2c64a54906..a6ad711ac0 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -149,9 +149,7 @@ int cg_read_pidref(FILE *f, PidRef *ret, CGroupFlags flags) { if (pid == 0) return -EREMOTE; - /* We might read kernel thread pids from cgroup.procs for which we cannot create a pidfd so - * catch those and don't try to create a pidfd for them. */ - if (FLAGS_SET(flags, CGROUP_NO_PIDFD) || pid_is_kernel_thread(pid) > 0) { + if (FLAGS_SET(flags, CGROUP_NO_PIDFD)) { *ret = PIDREF_MAKE_FROM_PID(pid); return 1; }