Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp169140imd; Wed, 31 Oct 2018 16:42:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5docw1SlX36XMM3Hkch0KY9YQQ0CaeBk1Zol2u1u0enhLTvSP9y9y7iHroNJ+SpJ77P2ENe X-Received: by 2002:a62:2803:: with SMTP id o3-v6mr5437235pfo.57.1541029368790; Wed, 31 Oct 2018 16:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029368; cv=none; d=google.com; s=arc-20160816; b=JkrOuT3FgfM334d+w8yS+hetstUKN/kN8Uv+AYY3QQKBDyGLs9iwdpdS+kH1idqg0J 8b7Z1Kk3PZinhvPPD8vQqRS1J8FXYnlFoowe/5KZWwHdwmKhTrqMcxeXtyxtHV8ty2H6 7Rj5WHSEhPhCdaQMi9ubz4zI78zpQFDdb5r3GKdDcPx4A3nu0DE+QRylCXm9K+LYYaes 9FLKAqgyn9B5o+uuX9erNNlGVUSpjt0Q+vP/VloA2bE8OuJ+psJWnUeEXUxnW763Gfqn GuuIP4vcapTYddHYZhPW2+ubhHaRSS+X1s+/abSo3kxOT+JvjCcWiTzUlQj28P3sXf+M aQBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=39XJEkSf8u/Isp+gj3bYB1ro2ZYDESOnNvadMCY0ywU=; b=HkLkOYfdKayZIijFvqfTvXMJlQtTvdVAblraznR5zUNFSGl/gJQNqXg5i3A/rgFeQS gqENEZtzD8kH/ZdOjhB9wRa8PMoQwnLU+AuATRQjPd/VQeNiV7zKIWNj5vWk+dL1eIrL 1zCDRqAKwbv1FJqrUZQgf0UmPOKLF4HgiPqyVKlnk6clFbkjrRak4CLDJI4SK8TWjdqV BAuLdZwlE4coYdsDyWF9cYsQCr/vHOyBtyaZcXR+QGIS5nRz7cwHE/HIeNVP0vqQmDes MF5hNdkyhcKltG30AbPg9vZCVeyUmzNYD24L7jP6m6nybPJ0OcILIcoobuJ7c9sdkHw8 B++w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VYYM6Hfv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v66-v6si24508591pgv.289.2018.10.31.16.42.34; Wed, 31 Oct 2018 16:42:48 -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=VYYM6Hfv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729332AbeKAIIA (ORCPT + 99 others); Thu, 1 Nov 2018 04:08:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:56410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729320AbeKAIH7 (ORCPT ); Thu, 1 Nov 2018 04:07:59 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8B8220840; Wed, 31 Oct 2018 23:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027269; bh=7/QdAjn+jUq2rj5Y4MYWOKuwvhaI/yWAG1SId3Dfbhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VYYM6Hfv4innSMxQgznhnLQNYLqN3cZkn7UBxdkl8s724iwbqYY08eGimQKBmUe9O 3df37rI/QJHAi/4OYCBhs8wVngRZMj70BJi0DbhRksb2oEaXTni34Z6MtoIuNlOXtv xLXPXKnxtxmhs5uAheO3W5KEO8TquqOzD9HHgrFw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Eric W. Biederman" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 141/146] signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init Date: Wed, 31 Oct 2018 19:05:36 -0400 Message-Id: <20181031230541.28822-141-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Eric W. Biederman" [ Upstream commit 3597dfe01d12f570bc739da67f857fd222a3ea66 ] Instead of playing whack-a-mole and changing SEND_SIG_PRIV to SEND_SIG_FORCED throughout the kernel to ensure a pid namespace init gets signals sent by the kernel, stop allowing a pid namespace init to ignore SIGKILL or SIGSTOP sent by the kernel. A pid namespace init is only supposed to be able to ignore signals sent from itself and children with SIG_DFL. Fixes: 921cf9f63089 ("signals: protect cinit from unblocked SIG_DFL signals") Reviewed-by: Thomas Gleixner Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index e4aad0e90882..092fb48ed845 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1035,7 +1035,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, result = TRACE_SIGNAL_IGNORED; if (!prepare_signal(sig, t, - from_ancestor_ns || (info == SEND_SIG_FORCED))) + from_ancestor_ns || (info == SEND_SIG_PRIV) || (info == SEND_SIG_FORCED))) goto ret; pending = (type != PIDTYPE_PID) ? &t->signal->shared_pending : &t->pending; -- 2.17.1