From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBovnDR/fWwKTM7UaluRj+wHQwC71JygvG8wU0NoM5/10HQSWDlyOyXzyJzC/mvA2gMYYFTBg ARC-Seal: i=1; a=rsa-sha256; t=1516209590; cv=none; d=google.com; s=arc-20160816; b=bmg30gjIwrDVdcUygcFGlrEA7BmXM50f9hI/QrQv8U5X1az+wJ8E97gZlo932UisXN u5YEJbCtaZC4LZwH/DlnCAl9MjYUUERQ6mUf6/7ajf6gp8TZ7mf5ilOx3PdX+DZLr01o gBQdnw1WYto8P3LuPb8DXllSHeCZfw3AhF4M6A0Y7fN/Uk3/eMCikCtyCrZICFdzCnxh ANNiovTBF40qb3W5+LH/G4fnPXkqlnc4bgKLI/FguqT9HM3JpnSmeWccbWDcJ0iibKxO NqZmrlXNtwgGu7K/g/LHGDtsTESsd7nBkSamsGllfW0Z17tRqdMjWn3UtaTGosCbc5yc ymgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:mime-version:user-agent:message-id:in-reply-to:date :references:cc:to:from:arc-authentication-results; bh=kw5ujduBTgCYu8rZrotq/ognCDLOdpGxGIOXanGUWF0=; b=APHQUW5NVuX9rK0lT/13CLubZnpxAOdKblmxfGkQ/q19m/EZ2hZytyDRvn/cmiB8l+ 3CgHC4S3oWNffdcTpTVKHUWKPJ2O73T5ArQMQBfc5STn5k+XXh8jJtAA6oQZNUoNSvPX g2h0VhYD9l7EznyIZVhKPSWJLDg2etSdv/vtm2uD3beZzruyK+FF6XtNEwkso6jXY0C1 34xvv/vgxA+vfxaax8k6WMUHFShLy3low677CtHFg5dGIYqV25woJXXjixxFFha7ONV1 rTb755Fgr0Cmlmfl/eF9MgjnO32x4gBRZkUztcsX4jTxM1s5/2XOWAbb9b5Zu4l3Wi3P JHZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ebiederm@xmission.com designates 166.70.13.232 as permitted sender) smtp.mailfrom=ebiederm@xmission.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of ebiederm@xmission.com designates 166.70.13.232 as permitted sender) smtp.mailfrom=ebiederm@xmission.com From: ebiederm@xmission.com (Eric W. Biederman) To: Kirill Tkhai Cc: gregkh@linuxfoundation.org, jslaby@suse.com, oleg@redhat.com, linux-kernel@vger.kernel.org References: <151619233415.5683.18062849657787533510.stgit@localhost.localdomain> <151619277281.5683.16110625178528288163.stgit@localhost.localdomain> Date: Wed, 17 Jan 2018 11:18:57 -0600 In-Reply-To: <151619277281.5683.16110625178528288163.stgit@localhost.localdomain> (Kirill Tkhai's message of "Wed, 17 Jan 2018 15:39:32 +0300") Message-ID: <87shb4floe.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1ebrNM-0005I9-Qq;;;mid=<87shb4floe.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.121.73.102;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+SOC198VTCI7Gb5ib62Zf2kVemHWZvjDI= X-SA-Exim-Connect-IP: 97.121.73.102 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Kirill Tkhai X-Spam-Relay-Country: X-Spam-Timing: total 183 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.8 (1.5%), b_tie_ro: 1.93 (1.1%), parse: 0.72 (0.4%), extract_message_metadata: 13 (6.9%), get_uri_detail_list: 1.37 (0.7%), tests_pri_-1000: 8 (4.6%), tests_pri_-950: 1.15 (0.6%), tests_pri_-900: 1.01 (0.6%), tests_pri_-400: 18 (9.9%), check_bayes: 17 (9.4%), b_tokenize: 6 (3.0%), b_tok_get_all: 5 (3.0%), b_comp_prob: 1.76 (1.0%), b_tok_touch_all: 2.8 (1.5%), b_finish: 0.54 (0.3%), tests_pri_0: 131 (71.2%), check_dkim_signature: 0.45 (0.2%), check_dkim_adsp: 2.8 (1.6%), tests_pri_500: 5 (2.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v2 1/3] Revert "do_SAK: Don't recursively take the tasklist_lock" X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589843366609121628?= X-GMAIL-MSGID: =?utf-8?q?1589860987228451027?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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. The alternative and perhaps the better option is to simply remove SAK support, if we can not make it race free. But yes SAK very much does care about races. > Came from discussion in "tty: Iterate only thread group leaders in __do_SAK()" > https://lkml.org/lkml/2018/1/11/492 > > Suggested-by: Oleg Nesterov > Signed-off-by: Kirill Tkhai > --- > drivers/tty/tty_io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c > index dc60aeea87d8..84715ba1aee2 100644 > --- a/drivers/tty/tty_io.c > +++ b/drivers/tty/tty_io.c > @@ -2737,7 +2737,7 @@ void __do_SAK(struct tty_struct *tty) > if (i != 0) { > tty_notice(tty, "SAK: killed process %d (%s): by fd#%d\n", > task_pid_nr(p), p->comm, i - 1); > - force_sig(SIGKILL, p); > + send_sig(SIGKILL, p, 1); > } > task_unlock(p); > } while_each_thread(g, p);