Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3799528pxj; Mon, 21 Jun 2021 06:56:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9ShE41keVIat8l2iYYgUcO6BvL+i0w/dB/xGoxshpMsU4T0eFy34QnYNfAYD2+gwO4M9f X-Received: by 2002:a02:a810:: with SMTP id f16mr17554181jaj.64.1624283760586; Mon, 21 Jun 2021 06:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624283760; cv=none; d=google.com; s=arc-20160816; b=YkPMXbWtV2oiEkHQflbpldSX57yyNhv56KojrjU3yZCTGPhTdxVI6PhHhCE/wlsjos +KsjP3M7U5KqQXROGvNwuNck0XDyuvFfsVYk+VbMOmFKfImg8tbfVYPlI7qLtq/Y0ReL rpp1n8OdnFPMJUofijrw2ZXLacUAZNGl4QebhG2ZewHpcU5kO/j3bBKYnIusFPK9JXov aMMePkHFpqmqdG3Awg5Jecm9LVcTgahgsnO30RJt+Qbb4Ig2ggmmsgJ17RE+O3xe2P4o E0gw+Bluo5ruhcGXkymgsaxLQFnaBlVhmOzyYNLy+xIGyMN2W8rnJMcjxH7kmRsUQz9B fCvQ== 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=3f/6KzSDDj2Wea6geE+lthZ0HDMousXdwtTSCFO121o=; b=LgfHAzyHBjrL59a1fiVox1hk6eXuvaJ8Htd5LVPqUJ/Bim7vfvSQqpOh6zvXTSHVTG 8EgZuf5WVYBwCZXv7zzNYu0LzFVygV1iZnoF4FACfnQ3x2GeYGota5EcR9nZGQoC2fyW hJEm5E7i4Sv5WNcLl4C9djgr5GcpFQSpMyARstGdmqwlxO1cGjwsXIwEvBGot9wRYwHY G2mgnktdZQ3BQlqe9QIjyHf0NY4qsnap4FDG6JPSh8mFrYFJo42nSGkjYYbbhlv69Eak gFW5PI4WKqVHvoUM8dfD6qbsB+jhNvgdqABAF50YkUcIG/CXx0UEsP59bWgM5yyNiiL9 uYrg== 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 187si18818922iow.86.2021.06.21.06.55.47; Mon, 21 Jun 2021 06:56:00 -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 S229736AbhFUN5b (ORCPT + 99 others); Mon, 21 Jun 2021 09:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbhFUN52 (ORCPT ); Mon, 21 Jun 2021 09:57:28 -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 626FDC061574; Mon, 21 Jun 2021 06:55:14 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvKO8-00AqqE-DK; Mon, 21 Jun 2021 13:54:56 +0000 Date: Mon, 21 Jun 2021 13:54:56 +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 Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads Message-ID: References: <87pmwsytb3.fsf@disp2133> <87sg1lwhvm.fsf@disp2133> <6e47eff8-d0a4-8390-1222-e975bfbf3a65@gmail.com> <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 Tue, Jun 15, 2021 at 02:58:12PM -0700, Linus Torvalds wrote: > And I think our horrible "kernel threads return to user space when > done" is absolutely horrifically nasty. Maybe of the clever sort, but > mostly of the historical horror sort. How would you prefer to handle that, then? Separate magical path from kernel_execve() to switch to userland? We used to have something of that sort, and that had been a real horror... As it is, it's "kernel thread is spawned at the point similar to ret_from_fork(), runs the payload (which almost never returns) and then proceeds out to userland, same way fork(2) would've done." That way kernel_execve() doesn't have to do anything magical. Al, digging through the old notes and current call graph...