From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBosAQZLzvALK/EujhNhLVHujBOSd9hY6TCosvt5RQOhVb25Cc/O7B1pREmm+pm69ouY8h1ou ARC-Seal: i=1; a=rsa-sha256; t=1516210458; cv=none; d=google.com; s=arc-20160816; b=yyRLCOOddcVTO7pgCTfDUUcRiao1JQJvPt+pgnWwvdAVa/RSGS7PDrJ+bEaR7f8YC+ pQ35W31w79TRqdzmVD+4xTm3BZD94AMjJh9E53Wn1uc81VCpwUJXyDpdNnR62pyUoGD6 lvvPZ4jUY1P7CAJ/3ihlLS8u8g/pmgesK5cwpt2gHgxe4e7wINWWh0rWYuyDqYoWEyvt bc1giTXzNyE14RMAuF+F2hHRix3Rul+yrOTm4kKEeZD7BeC06nP/fPNllyQJdo50FLww mbLeABQYcBlCFlA+hEUc6xkPDnCtueAUeapdJjXiN//RkksOkRkMyyhRDvbtpAqOgTnB 1T0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=Hl2N0dluviJ5sKX9Fsmm61Mtql6O5qN3ibjrB/V3ZIc=; b=dktgYgpgxjiw6J7ywC40U0uAHRsSqSgQS21TPYX1JgnNXRWs+rotw8OjLi286cUdxS NvyBKfCS8xa//pgf9H1VyLtwM40Ej3GxKFxH+7UVmj8QlStsNVm5EJko38VUnSrkwbcE gIi8vhaihcSzpOkcqgpsi1tKN2Yep6fQANuDRDPTcksAQv5R8/yfctKVGR3AaSpx/WYY w9BsspO84h6WoUZkDu+Vc7RF3P5s6wSeofffccS0Ln+fWMYuF5bVtbddC03vMpJp1VeG RUaVSlAQwgMJEf6ukJzGRrhrszaATfh6X4lroekt8zvXLV10wpq0eAiI+lkWGvG0lMuV Pz0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of oleg@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=oleg@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of oleg@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=oleg@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Date: Wed, 17 Jan 2018 18:34:15 +0100 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Kirill Tkhai , gregkh@linuxfoundation.org, jslaby@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] Revert "do_SAK: Don't recursively take the tasklist_lock" Message-ID: <20180117173415.GA7964@redhat.com> References: <151619233415.5683.18062849657787533510.stgit@localhost.localdomain> <151619277281.5683.16110625178528288163.stgit@localhost.localdomain> <87shb4floe.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87shb4floe.fsf@xmission.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589843366609121628?= X-GMAIL-MSGID: =?utf-8?q?1589861897656748675?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On 01/17, Eric W. Biederman wrote: > Kirill Tkhai writes: > > > This reverts commit 20ac94378de5. > > > > send_sig() does not take tasklist_lock for a long time, > > so this commit and the problem it solves are not relevant > > anymore. > > > > Also, the problem of force_sig() is it clears SIGNAL_UNKILLABLE > > flag, thus even global init may be killed by __do_SAK(), > > which is definitely not the expected behavior. > > Actually it is. > > SAK should kill everything that has the tty open. If init opens the tty > I am so sorry, it can not operate correctly. init should not have your > tty open. OK, but then we need "force" in other places too. __do_SAK() does send_sig(SIGKILL) in do_each_pid_task(PIDTYPE_SID) and if signal->tty == tty. Plus force_sig() is not rcu-friendly. So I personally agree with this change. Whether we want to kill the global init or not should be discussed, if we want to do this __do_SAK() should use SEND_SIG_FORCED and this is what Kirill is going to do (iiuc), but this needs another patch. Oleg.