Skip to content

Commit 2e5383d

Browse files
tych0htejun
authored andcommitted
cgroup1: don't call release_agent when it is ""
Older (and maybe current) versions of systemd set release_agent to "" when shutting down, but do not set notify_on_release to 0. Since 64e90a8 ("Introduce STATIC_USERMODEHELPER to mediate call_usermodehelper()"), we filter out such calls when the user mode helper path is "". However, when used in conjunction with an actual (i.e. non "") STATIC_USERMODEHELPER, the path is never "", so the real usermode helper will be called with argv[0] == "". Let's avoid this by not invoking the release_agent when it is "". Signed-off-by: Tycho Andersen <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 190ecb1 commit 2e5383d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cgroup/cgroup-v1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ void cgroup1_release_agent(struct work_struct *work)
783783

784784
pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
785785
agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL);
786-
if (!pathbuf || !agentbuf)
786+
if (!pathbuf || !agentbuf || !strlen(agentbuf))
787787
goto out;
788788

789789
spin_lock_irq(&css_set_lock);

0 commit comments

Comments
 (0)