Skip to content

Commit

Permalink
cgroup1: don't call release_agent when it is ""
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tych0 authored and htejun committed Mar 4, 2020
1 parent 190ecb1 commit 2e5383d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cgroup/cgroup-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ void cgroup1_release_agent(struct work_struct *work)

pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL);
if (!pathbuf || !agentbuf)
if (!pathbuf || !agentbuf || !strlen(agentbuf))
goto out;

spin_lock_irq(&css_set_lock);
Expand Down

0 comments on commit 2e5383d

Please sign in to comment.