Commit 2e5383d7 authored by Tycho Andersen's avatar Tycho Andersen Committed by Tejun Heo

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 64e90a8a ("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: default avatarTycho Andersen <tycho@tycho.ws>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 190ecb19
...@@ -783,7 +783,7 @@ void cgroup1_release_agent(struct work_struct *work) ...@@ -783,7 +783,7 @@ void cgroup1_release_agent(struct work_struct *work)
pathbuf = kmalloc(PATH_MAX, GFP_KERNEL); pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL); agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL);
if (!pathbuf || !agentbuf) if (!pathbuf || !agentbuf || !strlen(agentbuf))
goto out; goto out;
spin_lock_irq(&css_set_lock); spin_lock_irq(&css_set_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment