Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9986959ybi; Wed, 24 Jul 2019 13:36:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqznb3m6Mp5b34lwjvFbZeIuUpr87HweqFwStshTSlBrxkUFpu1x1ZCiO+jFWvUUb7Z+MbyW X-Received: by 2002:a63:7e1d:: with SMTP id z29mr82872464pgc.346.1564000579507; Wed, 24 Jul 2019 13:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000579; cv=none; d=google.com; s=arc-20160816; b=cS0C621vIvcMAluLVB9b5Lmc6bflWigp2DwBoUNWwjVxeatcIkkWINnmlB0JEVK5HM sJdaTYcKGwnhLvi7AhWDtpR6D9AIcs48JRRV8II3ZayzKaB6U+jaXm75QCK0qc8CjtYF DXRcebOZTesJ9JN/tes4DNxiW0J8NLzzS8WPT40T1JM8p7p9hBYsZPAYTVxyllNRw/ES il4JeptChNauFy+NYgDFLCQIrngyvJ7LxO8Ge/7DHlGHoE/V6d2x7TUK/Q8tJSVDqm76 By1j9SkgEVhaMFx5AcseGy0cyxYkIBka20DA1UnKj7gEoiWRg0WXoL/WJiE6w3rFhS6R HC8g== 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=UKfduprOUCkVmr0M6IzyIkf/TtwKfnLRu9YkiP8sYvc=; b=TgKErFNHcCfgU9f0lyQoL2lF2HvZYgWaaiW7aVqw7NF5AEVosivRMTTBRqnCzvck5w c6Y6N01P7Ev0lrFPuOKKdGxk0YqSeRw5KxNtA2yJJC/cBHbJvoP4LTxlITfzrIGjsSuE 2LCtx0jwITPjNyom5S/8ACS8zWssRIPeu8hfc27cgtMG0bfKv3WKb92BOjO6kPNnTUP3 mNUnGAbC+vmj0R5mRMrZvJz3LpuFzJ5UdLnycXmXfTomVTn5Kh63zOnl8t+4vF54eA+A grp9jRnNCbySk74XyS8DkbsFIkebUQF1Xxa3raSpNHs4NFSk3Qq63MeH7E6KqBcz20Zw 6ZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MuI2cBKe; 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 185si16080462pgc.522.2019.07.24.13.36.04; Wed, 24 Jul 2019 13:36:19 -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=MuI2cBKe; 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 S2389493AbfGXUev (ORCPT + 99 others); Wed, 24 Jul 2019 16:34:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:43464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbfGXT0Y (ORCPT ); Wed, 24 Jul 2019 15:26:24 -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 36BDF217F4; Wed, 24 Jul 2019 19:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996383; bh=OCfXrBmZJMBGrnD4F2hi1kcSXtrQgBukoTYy1JZQ4ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MuI2cBKeziaqk0ojemYTyPvgW42Zckj9Ds1Sq97Y3KPETupZEf/YCrYd6EAjxBamq Nrs9LWRP1jPwlUbLTvkATS8JQ3rbgaHJW+o/wGqVk6OGMiUzCj9AFMpmS1jDswgIu/ 0R5Ev+MswftIB2DeWIwBr9VXJnKgLCzQOSIJa9iU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Lezcano , Serge Hallyn , Oleg Nesterov , "Eric W. Biederman" , Sasha Levin Subject: [PATCH 5.2 037/413] signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig Date: Wed, 24 Jul 2019 21:15:28 +0200 Message-Id: <20190724191738.272151812@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 [ Upstream commit f9070dc94542093fd516ae4ccea17ef46a4362c5 ] The locking in force_sig_info is not prepared to deal with a task that exits or execs (as sighand may change). The is not a locking problem in force_sig as force_sig is only built to handle synchronous exceptions. Further the function force_sig_info changes the signal state if the signal is ignored, or blocked or if SIGNAL_UNKILLABLE will prevent the delivery of the signal. The signal SIGKILL can not be ignored and can not be blocked and SIGNAL_UNKILLABLE won't prevent it from being delivered. So using force_sig rather than send_sig for SIGKILL is confusing and pointless. Because it won't impact the sending of the signal and and because using force_sig is wrong, replace force_sig with send_sig. Cc: Daniel Lezcano Cc: Serge Hallyn Cc: Oleg Nesterov Fixes: cf3f89214ef6 ("pidns: add reboot_pid_ns() to handle the reboot syscall") Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- kernel/pid_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index f54bc7cb6c2d..6d726cef241c 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -326,7 +326,7 @@ int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd) } read_lock(&tasklist_lock); - force_sig(SIGKILL, pid_ns->child_reaper); + send_sig(SIGKILL, pid_ns->child_reaper, 1); read_unlock(&tasklist_lock); do_exit(0); -- 2.20.1