From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64071C49EA2 for ; Mon, 21 Jun 2021 23:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FA34611BD for ; Mon, 21 Jun 2021 23:23:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbhFUXZh (ORCPT ); Mon, 21 Jun 2021 19:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhFUXZg (ORCPT ); Mon, 21 Jun 2021 19:25:36 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2F5C061574; Mon, 21 Jun 2021 16:23:21 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvTG3-00Azc5-0G; Mon, 21 Jun 2021 23:23:11 +0000 Date: Mon, 21 Jun 2021 23:23:10 +0000 From: Al Viro To: Linus Torvalds Cc: "Eric W. Biederman" , Michael Schmitz , linux-arch , Jens Axboe , Oleg Nesterov , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Ley Foon Tan , Tejun Heo , Kees Cook , Tetsuo Handa Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads Message-ID: References: <924ec53c-2fd9-2e1c-bbb1-3fda49809be4@gmail.com> <87eed4v2dc.fsf@disp2133> <5929e116-fa61-b211-342a-c706dcb834ca@gmail.com> <87fsxjorgs.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 04:14:36PM -0700, Linus Torvalds wrote: > On Mon, Jun 21, 2021 at 12:45 PM Al Viro wrote: > > > > > > Looks like sys_exit() and do_group_exit() would be the two places to > > > do it (do_group_exit() would handle the signal case and > > > sys_group_exit()). > > > > Maybe... I'm digging through that pile right now, will follow up when > > I get a reasonably complete picture > > We might have another possible way to solve this: > > (a) make it the rule that everybody always saves the full (integer) > register set in pt_regs > > (b) make m68k just always create that switch-stack for all system > calls (it's really not that big, I think it's like six words or > something) > > (c) admit that alpha is broken, but nobody really cares How would it help e.g. oopsen on the way out of timer interrupts? IMO we simply shouldn't allow ptrace access if the tracee is in that kind of state, on any architecture...