From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdDCVKT (ORCPT ); Mon, 3 Apr 2017 17:10:19 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:50160 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdDCVKR (ORCPT ); Mon, 3 Apr 2017 17:10:17 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Oleg Nesterov Cc: Andrew Morton , Aleksa Sarai , Andy Lutomirski , Attila Fazekas , Jann Horn , Kees Cook , Michal Hocko , Ulrich Obergfell , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org References: <87tw7axlr0.fsf@xmission.com> <87d1dyw5iw.fsf@xmission.com> <87tw7aunuh.fsf@xmission.com> <87lgsmunmj.fsf_-_@xmission.com> <20170304170312.GB13131@redhat.com> <8760ir192p.fsf@xmission.com> <878tnkpv8h.fsf_-_@xmission.com> <87vaqooggs.fsf_-_@xmission.com> <20170402153517.GA12637@redhat.com> <877f32k5ew.fsf@xmission.com> <20170403181252.GA31390@redhat.com> Date: Mon, 03 Apr 2017 16:04:58 -0500 In-Reply-To: <20170403181252.GA31390@redhat.com> (Oleg Nesterov's message of "Mon, 3 Apr 2017 20:12:52 +0200") Message-ID: <87inmlnqx1.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=1cv9Es-0001Wt-3g;;;mid=<87inmlnqx1.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.234.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+X7/iu37ZRaGozRu/awVrmo+VSikaQD1w= X-SA-Exim-Connect-IP: 67.3.234.240 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 * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 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 * [sa08 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 1.0 T_XMHurry_00 Hurry and Do Something X-Spam-DCC: XMission; sa08 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ****;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 171 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 4.5 (2.6%), b_tie_ro: 3.1 (1.8%), parse: 1.07 (0.6%), extract_message_metadata: 3.1 (1.8%), get_uri_detail_list: 1.07 (0.6%), tests_pri_-1000: 3.6 (2.1%), tests_pri_-950: 1.05 (0.6%), tests_pri_-900: 0.91 (0.5%), tests_pri_-400: 19 (11.1%), check_bayes: 18 (10.7%), b_tokenize: 3.9 (2.3%), b_tok_get_all: 6 (3.2%), b_comp_prob: 1.18 (0.7%), b_tok_touch_all: 2.9 (1.7%), b_finish: 0.73 (0.4%), tests_pri_0: 127 (74.1%), check_dkim_signature: 0.35 (0.2%), check_dkim_adsp: 2.6 (1.5%), tests_pri_500: 3.5 (2.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH 2/2] exec: If possible don't wait for ptraced threads to be reaped 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Nesterov writes: > On 04/02, Eric W. Biederman wrote: >> >> Oleg Nesterov writes: >> >> > And btw zap_other_threads(may_hang == 0) is racy. Either you need tasklist or >> > exit_notify() should set tsk->exit_state under siglock, otherwise zap() can >> > return the wrong count. >> >> zap_other_thread(tsk, 0) only gets called in the case where we don't >> care about the return value. It does not get called from fs/exec.c > > I meant that may_hang == 0 implies zap_other_threads(do_count => -1) which should > return the number of threads which didn't pass exit_notify(). The returned value > can be wrong unless you change exit_notify() to set exit_state under > siglock. Interesting an existing bug. I won't deny that one. Subtle to catch but easy enough to fix. Eric