Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10350501ybi; Wed, 24 Jul 2019 21:30:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6SWyuXk4F8QeIgrygVQR1CNzbC3jrEswOvpa8BBa9+2N++ZTaBomFTQFthkqreIYBkXbC X-Received: by 2002:a65:6454:: with SMTP id s20mr84555131pgv.15.1564029059259; Wed, 24 Jul 2019 21:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564029059; cv=none; d=google.com; s=arc-20160816; b=Vip/uG6YJDzNXXJQTa5Pepv/H5Z2tv+3gDdEAiev4Ba9tPcumXyEa6B/ZBOG7FgmVv LlqlhKSyLkCHsQTiSncBRxmU99mppKDL+L30Sbw1bh/Qr9mQLZSjMi9X3a8luHk12SM9 IBYggDtVuTvtttftE2HTh53Vq9B2NZfs86PoS/rycXfiadJydC79lmJlEL6Q+Swousll NYWWeFOdv+x3isjN1G50AGfD9bnSYXv950lC/8mAYcV0IjJNVoQ7ouXRboiBTnOZiVIK BBGeeopfWXL+Mvr7tmZbMFPiZaN1WnOhHvrai/HURIfSK5LweRlslFYZbRrM64oIavqw qs0w== 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=AcKda398JfnjlKU+sWSa19O5g0YvCYD/0/EvJ/T+Xe8=; b=arWzIPn800BzHk+W7GiFTW2RIcFN3qLelBv6vKjNvx4SghCxGCovcAmgiNYCZBKcfF VPdwk2Hnzb0wG63RUk6BxrFUIvI6RwpfxjVaoPEX1qMnjIEW/FoNuspPfat+kHY3T6DD cCf/fOj/WOfCGUFdlG6wbT5LUKOF+AACr5l9QomECRso5wxMMvghdeVdOlU8prLIZT1r xD+kiBM8AoP86XTflhRl3SJ5yVLMlBpu3fDebUSoxBz1bVvqpKpomIV89DSKpFNAoiVZ 0kYbRVTlK6Y9JYoneCxUiHdg6grAEE5oiE4zsbEBMEsddLJngTNbMsyEm/+lalBtUv22 KTYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N+FW0Vn6; 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 v7si21148077pfb.132.2019.07.24.21.30.44; Wed, 24 Jul 2019 21:30:59 -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=N+FW0Vn6; 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 S2390754AbfGXTqm (ORCPT + 99 others); Wed, 24 Jul 2019 15:46:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:52436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391104AbfGXTqj (ORCPT ); Wed, 24 Jul 2019 15:46:39 -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 EB70C205C9; Wed, 24 Jul 2019 19:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997598; bh=bSy0U5yVi9iyH1R9tnjzF1EO7KPdJi0N7GTkYrzC4Hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N+FW0Vn6HkDtv6Nd//mEGpTzfxp7GGt6J9/gFL6y8JYO017/HwtRCsDDsf8EDtT36 eYwe48lgjNxGjrJF3f5TwoRvbydIIHQrW7xzO705DRjyhg1iXm8D9t72tRudtBq42Y 6VdBF90XkxVpuRkuC6I1Fjl6cHHBfcuGPJaK1Wrc= 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.1 037/371] signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig Date: Wed, 24 Jul 2019 21:16:29 +0200 Message-Id: <20190724191727.326676535@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191724.382593077@linuxfoundation.org> References: <20190724191724.382593077@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 aa6e72fb7c08..098233ebe589 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -325,7 +325,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