Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3287495ybb; Tue, 31 Mar 2020 02:08:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvAPfZV91myjhoJAFD0t/GAbEHfy7pi7kP1jZxdSrRazSYOiAsPqofUhNmDHkdmnrFNCBah X-Received: by 2002:a05:6830:144e:: with SMTP id w14mr12797808otp.75.1585645731048; Tue, 31 Mar 2020 02:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645731; cv=none; d=google.com; s=arc-20160816; b=ddmWSN5JSAv7OGaJHWd8S91+kacCp1kNnL8+OOJmRC3FIwXFRVI6a5jLJwMfPsP7Av ddhsQmQHtSAqTRO7gAdp6TESPj49T1OtBJqtOwbCNQvw6MRYZkCdjvfTiFpI7uFk2CTF e6ZJhizNdNucgYSNfwq/BMfFmX9mB0aPcglpiauYwDBFmFuRplVeoXUv+75CjcOE+C3A r/MS8V9mCxzftK600ElKzSKzbROLgcFkqA0cLi16fuQcaee9umWAuqgU6NHhX6jUGAg9 bK9N7ULjst57xyxCywmKW7u13za2uOoIJJ6ZhnfNZi5b0MYqr6XP+D5tzgtJ+JSXxsqI jJIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oaZVL6vEuIdIpmPQ6Q2DKGKtMP4tI9MCRkOCISPq57g=; b=L/BqY0MsI5+lK+oEfKpEt6GktqkqxtnMhla6dSKnztpuUifXTDeLszNv+k1xsC1AXJ YKWStgaP31p2nlSL2FZg25tIKKvgaMXW99JuuBNSfOZG9VxkYEN5CfigAtSTN+HINN4k UB5ba+oQV0CfDLOOTKklLbWJY/+iqCwsMPfN4+wTBa9EPB+fKPGZm8hwM36LOOL0lxME ASwm2MYbiwrZwYTDU0Lez89t63Np7o/JVYBTb+zXrT4I0rcFqjtrJxJEKf4ZO23ZhoZM q0GO2QoUdQQgxrzmNxTtiGWT9VqjtJp7FPIkj6DG/1ToHXBgos1GpTUvmrD2b2IEu+Y0 At2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zFbfKBIe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p125si6949519oig.264.2020.03.31.02.08.38; Tue, 31 Mar 2020 02:08:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zFbfKBIe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731241AbgCaJH1 (ORCPT + 99 others); Tue, 31 Mar 2020 05:07:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:49128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731037AbgCaJHW (ORCPT ); Tue, 31 Mar 2020 05:07:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A8DE20675; Tue, 31 Mar 2020 09:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645641; bh=8HWl7opAVhbfm8fIWKWNIwlkSWCpWGoZz0bx3PKtFJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zFbfKBIewIkZ02UZsS3Sjp4EDGZwmetXnFuab+Sbn5bodh7eNL8j8MBCmedsGNOZT vLFV3VkdI1IAkG52/qRXGE7BYby2b9aXrfNhCCL2MKKB2TWAwQSZGBIJLKpRo2pXin JZdYIQHbzZvJyai46gV5oFdN8H4Nfp78fBz/DcIc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tycho Andersen , Tejun Heo , Sasha Levin Subject: [PATCH 5.5 068/170] cgroup1: dont call release_agent when it is "" Date: Tue, 31 Mar 2020 10:58:02 +0200 Message-Id: <20200331085431.650236415@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tycho Andersen [ Upstream commit 2e5383d7904e60529136727e49629a82058a5607 ] Older (and maybe current) versions of systemd set release_agent to "" when shutting down, but do not set notify_on_release to 0. Since 64e90a8acb85 ("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 Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin --- kernel/cgroup/cgroup-v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 84bedb87ae137..a1fbf500d0af7 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -785,7 +785,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); -- 2.20.1