Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1937822imm; Thu, 12 Jul 2018 10:13:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcP42xsEwyR6VXLyE8dfXPmb2yyXmo70hN8bluUfGmBCunW+otjzV2PBdsawH1QMvdtfhBy X-Received: by 2002:a62:1089:: with SMTP id 9-v6mr3259891pfq.30.1531415611972; Thu, 12 Jul 2018 10:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531415611; cv=none; d=google.com; s=arc-20160816; b=wtS/+iiNctVEofJvdFYo0jqFMA52PQmYblV9O8dAJ4Xow7xfIo964yJTPh7EfVTSYG KcR8dJaop/vxV4YCgOshPH76cMFP08akEDqCne8g5Yx27sTh7JWwVMhAsGhmberujaR1 FGAFvE40Q361Vpi0CDC3wFk/aQFe/qqo/XMOwOlgr12EHhK+srPwjCzdQpgGbPPQGeKG Vu7xPlNK8NInR541r0WVZWSTpUzLHgTQ9GpOpopCuZiCCEcbuTYHuq3I9IDRxTyBbH+7 7R66DykshedUIcGcz8FdBb7KzCBWESxzFpFtuDtTGZ0HNZv1bK9BuuoYQax77tF8fzhG 4TMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=ec+5mnDi7QLdm+DDahZwXg6rEsdSflMmz0qzgUvnP0s=; b=IgGW+12e1MjBTjKGNGOacpgOm0G73sIQ5aYU2sMKeMCMFJkaH/NSk2sBuqWK6rG6Um DuypTjJogjr9+mTSu6NBx+xNBXORD0gmFO11zJerz+argx/DmJP+OuAB/yMTuvjzAGHW tQlk3OnqblI6iKu/P+LXj+N4OhbFmrWbCcJnTPARcWM8TL9rWtR77vjtIEsA9sLAetiZ ovrNZMvfpMJTXtFBDbMPB4nsf93O9xv9zjSwMOVN0ynwtOBM5DwQ+RM5bpbChwv6X9Vo Z9bAbbtktRgqp2mpJ/hJGAPHVYsy0veRFLR1Cf+IoOqG+PiAm4Pj+vo+ohSdhrZJd1dF 6mmg== ARC-Authentication-Results: i=1; mx.google.com; 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 p5-v6si22042179pgl.516.2018.07.12.10.13.17; Thu, 12 Jul 2018 10:13:31 -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; 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 S1732378AbeGLRW1 (ORCPT + 99 others); Thu, 12 Jul 2018 13:22:27 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:37361 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbeGLRW0 (ORCPT ); Thu, 12 Jul 2018 13:22:26 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fdf8J-0006ah-VZ; Thu, 12 Jul 2018 11:12:00 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fdf8J-0000zl-3r; Thu, 12 Jul 2018 11:11:59 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Oleg Nesterov Cc: Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Wen Yang , majiang References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-11-ebiederm@xmission.com> <20180711141456.GA6636@redhat.com> <87h8l5g3qi.fsf@xmission.com> <20180712134220.GA15075@redhat.com> Date: Thu, 12 Jul 2018 12:11:53 -0500 In-Reply-To: <20180712134220.GA15075@redhat.com> (Oleg Nesterov's message of "Thu, 12 Jul 2018 15:42:20 +0200") Message-ID: <87601k5qg6.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=1fdf8J-0000zl-3r;;;mid=<87601k5qg6.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18SWne0Jm3Irz6jwHDkRo6fABgbFE6uHO8= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 TR_Symld_Words too many words that have symbols inside * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 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: ***;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 210 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.6 (1.2%), b_tie_ro: 1.76 (0.8%), parse: 0.78 (0.4%), extract_message_metadata: 3.3 (1.5%), get_uri_detail_list: 1.52 (0.7%), tests_pri_-1000: 3.6 (1.7%), tests_pri_-950: 1.23 (0.6%), tests_pri_-900: 1.02 (0.5%), tests_pri_-400: 27 (12.8%), check_bayes: 26 (12.3%), b_tokenize: 6 (2.9%), b_tok_get_all: 13 (6.0%), b_comp_prob: 2.2 (1.1%), b_tok_touch_all: 2.3 (1.1%), b_finish: 0.53 (0.3%), tests_pri_0: 159 (75.9%), check_dkim_signature: 0.56 (0.3%), check_dkim_adsp: 2.7 (1.3%), tests_pri_500: 3.9 (1.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH 11/11] signal: Ignore all but multi-process signals that come in during fork. 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Nesterov writes: > On 07/11, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> >> - recalc_sigpending(); >> >> - if (signal_pending(current)) { >> >> + if (read_seqcount_retry(¤t->signal->multi_process_seq, seq) || >> >> + fatal_signal_pending(current)) { >> >> retval = -ERESTARTNOINTR; >> >> goto bad_fork_cancel_cgroup; >> > >> > So once again, I think this is not right, see the discussion on >> > bugzilla. >> >> I am trying to dig through and understand your concerns. I am having >> difficulty understanding your concerns. >> >> Do the previous patches look good to you? > > Yes, yes, personally I like 1-10 after a quick glance. I'll try to read this > series carefully later, but I don't think I will find something really > wrong. Good. Then I will consider those acked by both you and Linus. Oleg do you mind if I add: Acked-by: Oleg Nesterov To those patches? >> If I understand you correctly. Your concern is that since we added the: >> >> recalc_sigpending(); >> if (signal_pending(current)) >> return -ERESTARTNOINTR; >> >> Other (non-signal) code such as the freezer has come to depend upon that >> test. Changing the test in the proposed way will allow the new child to >> escape the freezer, as it is not guaranteed the new child will be >> frozen. > > Yes. >> It seems reasonable to look at other things that set TIF_SIGPENDING and >> see if any of them are broken by the fork changes. > > Again, please look at do_signal_stop(). If it was the source of signal_pending(), > copy_process() should fail. Or we should update the new thread to participate in > group-stop, but then we need to set TIF_SIGPENDING, copy the relevant part of > current->jobctl, and increment ->group_stop_count at least. Hmm. That is an interesting twist. In general for do_signal_stop is fine as long as we have the recalc_sigpending at the start of fork. But yes. What happens when it isn't a fork but it is a clone. Signals that affect the entire thread group (STOP CLONE) are very interesting from this perspective. Same issue as with fork, but different scope. Eric