Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4203610pxj; Mon, 21 Jun 2021 16:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnb4TZUoY903Noiy6VfcuxLoVZl3/MspnUQx0IPibiYBUMAIII6U9j5uNR4z8Ods+lfzJJ X-Received: by 2002:a5d:80c8:: with SMTP id h8mr401559ior.120.1624317856092; Mon, 21 Jun 2021 16:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624317856; cv=none; d=google.com; s=arc-20160816; b=BuS7DIYNVgwZuB2/P9AjMTcNjt5le7fCW21ScbBfiK4p7+C0zPpcFl7acJ4vdKdhL1 Thqk3kXHx+dhFb+1NwyEvUFoKhc+QIKofZNgNOoc0Gb7wQBkXRhZQ78Ifn/AV/eyfxcD 4rxKUCUEOCV6w/9V8xwRTTZRSPMn4RPfMVJKfp9najuvpOmFtdb2x3nDgvfLXGJoSCF9 zH6mZV/4HjTyd12uYlSHp4A98lWAsIFi2qQepckhtyesD+GwiucW3qY/odnNUt9B9le8 3CHbof3zrP2DMWPZ2n/7N9p3SiGUs0Gk/neo8VSwZ5Ps6KbAu8KC3wRzdNRAHpcpVUm6 soQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VvQ82mAE3nDMOm5gB/aeB/REZEYy6mFVecdzF8HX7jE=; b=NOHtFdYJF3mI2V3PB4VGAYZV6uIJfUrkL++5IH7kmF4jwRYIwIsJ8cX5rxeEUHks8d 9PCToaCoTkNXCAIJWrDxMVBDEqA77zQeFHn+Vet4qXHJT23H0G0G3iI6VW6D0AN1qToL F72Odei3IP4yLJMuP/VU/a/5BalVFUWFo5gk4JiYM8iWDxbUv6NaXM3Lzw0ZobOhyqK/ FasxVVgP6yY9PKu0/XOAlUD9Py2t5bFMaXe9Hlnojcik9HS0hRlSbBMhXA5T4uN6PzZW Oxkhw0LSSWRpYi/IlkBzTxJvSbzmUYGGJX/UlEXawrTf+wZW7su7EqNqP+ogS8TMjbSb H+BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si4358041ilu.12.2021.06.21.16.24.04; Mon, 21 Jun 2021 16:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbhFUXZh (ORCPT + 99 others); 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...