Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2550964imm; Mon, 16 Jul 2018 09:51:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpez38FaqLL/v7T0dCMeZPqnwG3lUJMUtsqoWrxXGGoVkCE7MJTNbG1WskhPWoLkoskIhR1g X-Received: by 2002:a17:902:8f8e:: with SMTP id z14-v6mr17186907plo.139.1531759890122; Mon, 16 Jul 2018 09:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531759890; cv=none; d=google.com; s=arc-20160816; b=ht705Htk8VwyfnHgeuZLifEznLwvxGWG7EAMuc+OXrwM4VPP6mPQe+n0lP0mXj2yDK Nu1lKoU6aQ9KgFjQEnuhijSqipP/gbPiybgp3QyxIFR+sEnN/ek2iROG2a9HNQR6nQ+F 9kL04sjf0CxxZ6FkkXLPKcdPaEqbo2XUuTvsQJWFg4gxRstJtcOoO4O6yrpr6S5zHdP3 OniFZmxDn6H6n7FT6+KMRv3VI+c+NziZLmIO/Da66WlprczD0vBMf41Ld+p4QlVrDJwD 33IjP5tZINFnsPGQ8O9xJx9PqN4zjz78VkbjapYcITHM77tEewfcXp4Zo65hE5UWzy9c PSIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Ugd6oiEPP4zlWxc4yp1ZLyQ7+3nXKDxgaj1LhhHfpVw=; b=n2a4kzL1JImZY3uVFPDZevs1zPyiA0M8qqzabq8uSDI3OIAx1cCvdbdqGSyQ7kQvK+ MHLMPGnX/Xf1qMdExENtS5dbfPbxXG5kPi65O5OGnNiW3jUUPGxwA/SYtoj7Z/LRCedl ATXHQ8FAEiOR9P6s6iXxbteim+GSVCGA00p/2OUUXXxHnp9+6bqUoMf/ZjHw9dWTWkR0 bEvbU2RcckwlMyk6sxRFktleFuV/S1AzDkrdh0KQrb5vqSsyhej0yAEUcrPXsKKBuxhD 4sVaU9DqUDopeW16v8rtqUUSrnWMmOGG5sL8h7z3bBsay++je8WcL91eNHS9qp3toyWf vixw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=WarqWsWX; 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 j63-v6si20022920pgd.425.2018.07.16.09.51.14; Mon, 16 Jul 2018 09:51:30 -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=@linux-foundation.org header.s=google header.b=WarqWsWX; 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 S1728556AbeGPRSy (ORCPT + 99 others); Mon, 16 Jul 2018 13:18:54 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:45692 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727738AbeGPRSy (ORCPT ); Mon, 16 Jul 2018 13:18:54 -0400 Received: by mail-io0-f195.google.com with SMTP id l25-v6so38435261ioh.12 for ; Mon, 16 Jul 2018 09:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ugd6oiEPP4zlWxc4yp1ZLyQ7+3nXKDxgaj1LhhHfpVw=; b=WarqWsWXiMs7nggkYjYtUT8AEkKDCSddkKQDynjcdoX+lShc+vmHcfDtQnv7dp21cc ft2eEBTVqgpQOu/DMxLjF36KRb96AajQkQ8YaVRT4hZ9wmjDcBf5+a5EhaSPvlI4DAWI rIhK4THSBMxHpsJppxRMxPYujYAuem+wprjE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ugd6oiEPP4zlWxc4yp1ZLyQ7+3nXKDxgaj1LhhHfpVw=; b=qCQJVjrGU6Rqul24YaLLtMHTQdTpmB9eSXYjoKGz1rNhYFtekpShjbaS/3W/RvIzZz N7iNrFmL82UjjKEQQlY9mSchvzhqIaYbEe5wb0v5sojkfVew/GHT9oXRhMBXoeOGQhg1 JhOURFLK+7XvpPgjxzdKnJgo63Xq4cLh7pjQh5cR37mdfSVjz08sPENnWeDzojB6TZ1/ fPRNV5JUSacDaPmCSwLYdlSnk2AMrrDsoNxMRtIXw1wFtpGLv0uA3vYxZVoXRluqcJAb P0wYYXV7veiuQ7eiCqbjR1X/yneiG+5dQV3/kL/Q+yBr1UVGUa0V4X284DZqsiU46OTH mvhA== X-Gm-Message-State: APt69E3IcUMLE7BJLy4kDHiu/ydR97+F0uY6M87IZT5TQNThUIjMdbL/ wfU8cofYYFWTLgRgcTUPo9uIwSle2nqtScMYn04= X-Received: by 2002:a6b:1502:: with SMTP id 2-v6mr42670099iov.203.1531759839286; Mon, 16 Jul 2018 09:50:39 -0700 (PDT) MIME-Version: 1.0 References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-9-ebiederm@xmission.com> <20180716145540.GA20960@redhat.com> <87lgabrzfd.fsf@xmission.com> In-Reply-To: <87lgabrzfd.fsf@xmission.com> From: Linus Torvalds Date: Mon, 16 Jul 2018 09:50:28 -0700 Message-ID: Subject: Re: [RFC][PATCH 09/11] tty_io: Use do_send_sig_info in __do_SACK to forcibly kill tasks To: "Eric W. Biederman" Cc: Oleg Nesterov , Andrew Morton , Linux Kernel Mailing List , Wen Yang , majiang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 16, 2018 at 8:08 AM Eric W. Biederman wrote: > > The change for global init is it will now die if init is a member of the > session or init is using this tty as it's controlling tty. > > Semantically killing init with SAK is completely appropriate. No. Semtnaitcally killing init is completely wrong. Because it will kill the whole system. And I don't mean that in "now init won't spawn new things". I mean that in "now we don't have a child reaper any more, and the system will be dead because we'll panic on exit". So it's not about the controlling tty, it's about fundamental kernel internal consistency guarantees. See write_unlock_irq(&tasklist_lock); if (unlikely(pid_ns == &init_pid_ns)) { panic("Attempted to kill init! exitcode=0x%08x\n", father->signal->group_exit_code ?: father->exit_code); } in kernel/exit.c. Linus