From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbdDBWzZ (ORCPT ); Sun, 2 Apr 2017 18:55:25 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:37075 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbdDBWzX (ORCPT ); Sun, 2 Apr 2017 18:55:23 -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: <20170213141452.GA30203@redhat.com> <20170224160354.GA845@redhat.com> <87shmv6ufl.fsf@xmission.com> <20170303173326.GA17899@redhat.com> <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> Date: Sun, 02 Apr 2017 17:50:02 -0500 In-Reply-To: <878tnkpv8h.fsf_-_@xmission.com> (Eric W. Biederman's message of "Sat, 01 Apr 2017 00:11:58 -0500") Message-ID: <874ly6a0h1.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=1cuoOz-0000eB-El;;;mid=<874ly6a0h1.fsf_-_@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.234.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19HgJpKt0Z/uDqLUBZ5Ve/nZ56WFFbI/eM= 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 TR_Symld_Words too many words that have symbols inside * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4972] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 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 * 1.0 T_XMHurry_00 Hurry and Do Something X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 174 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.7 (1.6%), b_tie_ro: 1.85 (1.1%), parse: 0.73 (0.4%), extract_message_metadata: 2.3 (1.3%), get_uri_detail_list: 0.71 (0.4%), tests_pri_-1000: 3.8 (2.2%), tests_pri_-950: 1.12 (0.6%), tests_pri_-900: 0.96 (0.6%), tests_pri_-400: 18 (10.5%), check_bayes: 17 (9.9%), b_tokenize: 6 (3.2%), b_tok_get_all: 6 (3.3%), b_comp_prob: 1.85 (1.1%), b_tok_touch_all: 2.4 (1.4%), b_finish: 0.52 (0.3%), tests_pri_0: 132 (76.1%), check_dkim_signature: 0.46 (0.3%), check_dkim_adsp: 2.8 (1.6%), tests_pri_500: 3.9 (2.2%), rewrite_mail: 0.00 (0.0%) Subject: [RFC][PATCH v2 0/5] exec: Fixing ptrace'd mulit-threaded hang 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 your comment about kill being able to send signal was an important dimension I had missed thank you. This patchset just denies the case of SIGHAND between different multi-threaded processes as I don't think anyone cares. I can fix that if anyone cares but I am not certain we actally do. I have reworked the ptrace notification code so that we always send notifications if we can but don't wait if it is a coredump or an exec. Which simpilifies the code nicely. A few more tweaks are needed before a final version but I think things are compelling. fs/exec.c | 23 ++------- include/linux/sched/signal.h | 1 + kernel/exit.c | 20 ++++---- kernel/fork.c | 14 +++++- kernel/ptrace.c | 4 ++ kernel/signal.c | 112 +++++++++++++++++++------------------------ 6 files changed, 78 insertions(+), 96 deletions(-) Eric W. Biederman (5): ptrace: Don't wait in PTRACE_O_TRACEEXIT for exec or coredump sighand: Count each thread group once in sighand_struct clone: Disallown CLONE_THREAD with a shared sighand_struct exec: If possible don't wait for ptraced threads to be reaped signal: Don't allow accessing signal_struct by old threads after exec Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: [RFC][PATCH v2 0/5] exec: Fixing ptrace'd mulit-threaded hang Date: Sun, 02 Apr 2017 17:50:02 -0500 Message-ID: <874ly6a0h1.fsf_-_@xmission.com> References: <20170213141452.GA30203@redhat.com> <20170224160354.GA845@redhat.com> <87shmv6ufl.fsf@xmission.com> <20170303173326.GA17899@redhat.com> <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> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <878tnkpv8h.fsf_-_-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> (Eric W. Biederman's message of "Sat, 01 Apr 2017 00:11:58 -0500") Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Oleg Nesterov Cc: Andrew Morton , Aleksa Sarai , Andy Lutomirski , Attila Fazekas , Jann Horn , Kees Cook , Michal Hocko , Ulrich Obergfell , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org Oleg your comment about kill being able to send signal was an important dimension I had missed thank you. This patchset just denies the case of SIGHAND between different multi-threaded processes as I don't think anyone cares. I can fix that if anyone cares but I am not certain we actally do. I have reworked the ptrace notification code so that we always send notifications if we can but don't wait if it is a coredump or an exec. Which simpilifies the code nicely. A few more tweaks are needed before a final version but I think things are compelling. fs/exec.c | 23 ++------- include/linux/sched/signal.h | 1 + kernel/exit.c | 20 ++++---- kernel/fork.c | 14 +++++- kernel/ptrace.c | 4 ++ kernel/signal.c | 112 +++++++++++++++++++------------------------ 6 files changed, 78 insertions(+), 96 deletions(-) Eric W. Biederman (5): ptrace: Don't wait in PTRACE_O_TRACEEXIT for exec or coredump sighand: Count each thread group once in sighand_struct clone: Disallown CLONE_THREAD with a shared sighand_struct exec: If possible don't wait for ptraced threads to be reaped signal: Don't allow accessing signal_struct by old threads after exec Eric