Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751437AbdFGQGP (ORCPT ); Wed, 7 Jun 2017 12:06:15 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:45586 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbdFGQGO (ORCPT ); Wed, 7 Jun 2017 12:06:14 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: Linux Kernel Mailing List , Linux API , Linux Containers , Oleg Nesterov , Ingo Molnar , Thomas Gleixner , Kees Cook , Roland McGrath , Al Viro , David Howells , "Michael Kerrisk \(man-pages\)" References: <877f0pym71.fsf@xmission.com> Date: Wed, 07 Jun 2017 10:59:13 -0500 In-Reply-To: (Linus Torvalds's message of "Tue, 6 Jun 2017 13:07:53 -0700") Message-ID: <87zidjokku.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=1dIdTB-0000D6-5V;;;mid=<87zidjokku.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.81.159;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19Loq3wJ/MbaqhGTc5s2b5zw/+Z7tqsHIg= X-SA-Exim-Connect-IP: 97.121.81.159 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 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 * [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 X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 5684 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.5 (0.0%), b_tie_ro: 1.78 (0.0%), parse: 0.82 (0.0%), extract_message_metadata: 15 (0.3%), get_uri_detail_list: 2.4 (0.0%), tests_pri_-1000: 9 (0.2%), tests_pri_-950: 1.25 (0.0%), tests_pri_-900: 1.06 (0.0%), tests_pri_-400: 32 (0.6%), check_bayes: 31 (0.5%), b_tokenize: 10 (0.2%), b_tok_get_all: 11 (0.2%), b_comp_prob: 4.6 (0.1%), b_tok_touch_all: 2.7 (0.0%), b_finish: 0.62 (0.0%), tests_pri_0: 482 (8.5%), check_dkim_signature: 0.84 (0.0%), check_dkim_adsp: 131 (2.3%), tests_pri_500: 5137 (90.4%), poll_dns_idle: 5129 (90.2%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 00/26] Fixing wait, exit, ptrace, exec, and CLONE_THREAD 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 Content-Length: 3779 Lines: 80 Linus Torvalds writes: > On Tue, Jun 6, 2017 at 12:01 PM, Eric W. Biederman > wrote: >> >> I am posting this patches in the hope of some review of the strategy I >> am taking and to let the individual patches be reviewed. > > I'm trying to look through these, and finding (as usual) that the > signal handling and exit code is extremely scary from a correctness > and security standpoint. > > I really want Oleg to review/ack these. Oleg? Definitely. The more review I can get the better. > I also would really really want to see the stuff that actually changes > semantics split out. > > For example, I feel much less nervous about things like making the > tasklist RCU-safe. So I'd like to see changes like that be separated > out from the much scarier ones. Would that be possible? Hint hint.. The patches that I posted are the ones that I would really like to have ready for the 4.13 merge window. They are supposed to be the least scary patches that don't really depend on anything else, and the semantic changes. After a first brush with code review the non-scary patches wind up just being these. [PATCH 01/26] alpha: Remove unused TASK_GROUP_LEADER [PATCH 02/26] cgroup: Don't open code tasklist_empty() [PATCH 05/26] exit: Remove the pointless clearing of SIGPENDING in __exit_signal [PATCH 07/26] pidns: Improve the error handling in alloc_pid [PATCH 08/26] exit: Make the runqueue rcu safe This turns out to have a dependency I overlooked so I am dropping it for now. [PATCH 06/26] rlimit: Remove unnecessary grab of tasklist_lock There is a small pair of a semantic change and it's dependency: [PATCH 03/26] signal: Do not perform permission checks when sending pdeath_signal [PATCH 04/26] signal: Make group_send_sig_info static There is a teeny tiny semantic change: [PATCH 09/26] signal: Don't allow sending SIGKILL or SIGSTOP to init The deeply related scarier changes (+ indicates it includes a semantic change): [PATCH 10/26] ptrace: Simplify ptrace_detach & exit_ptrace +[PATCH 11/26] wait: Properly implement __WCLONE handling in the presence of exec and ptrace [PATCH 12/26] wait: Directly test for the two cases where wait_task_zombie is called [PATCH 13/26] wait: Remove unused delay_group_leader +[PATCH 14/26] wait: Move changing of ptrace from wait_consider_task into wait_task_stopped +[PATCH 15/26] wait: Don't delay !ptrace_reparented leaders +[PATCH 16/26] exit: Fix reporting a ptraced !reparented leader has exited [PATCH 17/26] exit: Rework the exit states for ptracees +[PATCH 18/26] wait: Fix WSTOPPED on a ptraced child [PATCH 19/26] wait: Simpler code for clearing notask_error in wait_consider_task [PATCH 20/26] wait: Don't pass the list to wait_consider_task [PATCH 21/26] wait: Optmize waitpid +[PATCH 22/26] exit: Fix auto-wait of ptraced children +[PATCH 23/26] signal: Fix SIGCONT before group stop completes. +[PATCH 24/26] signal: In ptrace_stop improve identical signal detection +[PATCH 25/26] signal: In ptrace_stop use CLD_TRAPPED in all ptrace signals +[PATCH 26/26] pidns: Ensure zap_pid_ns_processes always terminates Out of my 170 or so total changes those are the bulk of the semantic changes and definitely the scariest. Even those above are very conservative and are really just about sorting out the weirdness in the semantics when we are ptracing our own child which causes wait and the siginfo of SIGCHLD to have two sets of meanings. I am hoping we can just get 1,2,5,7, and 8 reviewed and I can just apply them to my for-next branch. If I need to repost I will respect the split-out I have described above. At this point I am happy to see that people are not scared when I suggest killing the concept of the thread group leader. Eric