Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3818502pxj; Mon, 21 Jun 2021 07:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWz38oVwhPHfzoO44sUkmVUO6QVdaEgeqrYSu0lan5N2KnBAllPx0CQtrwzCaG2sqY44PD X-Received: by 2002:a02:8246:: with SMTP id q6mr13505118jag.130.1624285048495; Mon, 21 Jun 2021 07:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624285048; cv=none; d=google.com; s=arc-20160816; b=E3de8Ph5pLvnp70mvz6z/gwZ4sqemhBxQSFyLf0w8lziJo8EUvC6cx+ntd/PPtmUOL 2a2PoHkJo4kbeIYV41gLRSPDWP316rFbeIsdF+wsMbDtdG3uSqf9zJZ9WZqrJo7SJgA6 qnXoZGljwJzyGbMm9TmLpcBFV1qtSYFpCAwu14fMN6lAwaR90/qMu9xfPXfDjcFTbo9u NWHPfzPDVl2KEsmHnVW0WwGLkiUFEqG8RpmLtkJQRf7YYX+Pqkwa1uSsdAtix81r9Gd9 qHP7AgtYQ9xz9dww8J8hRZiU4LkD2IPnN90lcB/aT67OwiU9JTZMugplsSottjyA7AeR dFxQ== 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=4IXS19OjoPtqGNj2+ZRy5APF1+u5GO0JAqmvobHXz/g=; b=KE2s5OQ4y0KL1OOMu8fYntdzw1cgkZ7K5b9+0D2UOzCKGb01dzBgltJtqrkz8X7Gu6 L883EaKfJlglYrTINW/sZtm8Qiu/47yqr1tZIAH0/1UbxGuyU/HI9nUIlcgmtRTKWfMQ Cg/I2V5Z4eMBrKuj7dXq8AOxxwdKQ+ODWZEgrpOHGeNndtKIYD6z7prhX5vlsK+2uGgG zFEI0NmzrCcFA5P/y5NXmI753+wki8Tu5y0N81c+X0ZQmcCvRGuqJoY5T2eZ/nCDxnuA i71gwHEOVgFYvKJpZxgIaUo+MmJkqLmZzcnQV2vuiu/KWycuxG9UDqZSCpLUu8a6MB81 C/8w== 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 d198si19586421jac.70.2021.06.21.07.17.16; Mon, 21 Jun 2021 07:17:28 -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 S230182AbhFUOSv (ORCPT + 99 others); Mon, 21 Jun 2021 10:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbhFUOSr (ORCPT ); Mon, 21 Jun 2021 10:18:47 -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 8FB70C061574; Mon, 21 Jun 2021 07:16:32 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvKir-00Ar4K-2D; Mon, 21 Jun 2021 14:16:21 +0000 Date: Mon, 21 Jun 2021 14:16:21 +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: <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 Mon, Jun 21, 2021 at 01:54:56PM +0000, Al Viro wrote: > 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... FWIW, the major assumption back then had been that get_signal(), signal_delivered() and all associated machinery (including coredumps) runs *only* from SIGPENDING/NOTIFY_SIGNAL handling. And "has complete registers on stack" is only a part of that; there was other fun stuff in the area ;-/ Do we want coredumps for those, and if we do, will the de_thread stuff work there?