Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3783764ybi; Mon, 29 Jul 2019 12:33:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCnJxV8vCXCWcaCpZbMPu+xnUObkHt4K/ocKzg9tUqfMBlQnMkgv2gtl+oSIrZ60zaQLls X-Received: by 2002:aa7:9092:: with SMTP id i18mr37910779pfa.101.1564428783780; Mon, 29 Jul 2019 12:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428783; cv=none; d=google.com; s=arc-20160816; b=bazoro9q6mllsyb2KfLVQqYccNh3xXZSK2f06m4fgHA+nVmImYJt8aHsDKNPm1CoU0 dKcCB7cf1NCXQKnx3BbuckbnYg5As/SN9rmFbRj1AtYKFZ9m/Wg0UhIvGrMoWSmaThtT /HBNEGZvRuXhbvFknKs+GDjZw2iEsQ55dMvbo+jvKDtxA2UDJMI2xymrL9d9FKKmI0iy Ux7CBN01Rz3CQllBL5p9flfJU9IRHZeSp/5T5af96F5MlertX2nIf1O3CV3DRX/8UbHG g7PGmMjelQD3xxr+ngcwt7w3wwTqfph4K6hB4taiksLyg5SMAdBVi4FNDhHYm+cf5v+N J6Fg== 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=mhwcGc4H81lJYISzE9pPeqgYynCD0c+8P/hZq020fw0=; b=fa9T06Kf7amnEoVm/o/NZYppfs63ztlZ2f2P86MRN/dKmAa8BmkX2EPgXVq+cJByhP xgBNmL4KG9y5OqyACXNNmosZ9Qb2iVMv4Hl9wAfn145oSEO9oNfhpYCQI/wAZWxEiSz4 tLh4v37swW3zB1u+he/YzeoC0BMIDmj8XiCX2agY/lsjeB9asJ+6+Uum8nsYJ2wvRYYC kCf+LDcHFoSdn2EzPYoi/vnwTRJNyrUvkjJeSojZe5rOC8qTcYymAqjI38/PEBcT5iva VHECrTAbDJHBgizwgVqYrZB/YNsj5OC7KadZES/6oXR6B+m9BSPUAGC/5KdcM2kbRqph BRKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vL/8CTU4"; 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 s12si25803829plp.63.2019.07.29.12.32.48; Mon, 29 Jul 2019 12:33:03 -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="vL/8CTU4"; 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 S1729769AbfG2T03 (ORCPT + 99 others); Mon, 29 Jul 2019 15:26:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:38870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbfG2T01 (ORCPT ); Mon, 29 Jul 2019 15:26:27 -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 174CA20C01; Mon, 29 Jul 2019 19:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428386; bh=RdYRD5uZKbN7OnkDT8czaQDN2LdIh8ABplfgRuQLvT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vL/8CTU4fjUQWVUyBAlzSvtm74vI4Wykel98XnQovWrszSia7TSj8bXyg33WIuSYA tKoPqo/xjtktEWOyRb2DN6yCCxZtAsfkAmpsXghXQgqnaHftouidos0TlsmGIZiKwL 4XEf9IHJWdd6ZRmEKeFYvosKXWoC09EJXeyDxljk= 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 4.14 021/293] signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig Date: Mon, 29 Jul 2019 21:18:32 +0200 Message-Id: <20190729190822.545550642@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 4918314893bc..22091c88b3bb 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -351,7 +351,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