Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp74762pxj; Thu, 10 Jun 2021 15:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHfBdjSTTXBzuBnnNVXb61e0g8iXDAcMsI250oN7VF86FCmkWaQILwfYRsr6jS+OA3/PGk X-Received: by 2002:a17:906:1815:: with SMTP id v21mr613764eje.376.1623363330298; Thu, 10 Jun 2021 15:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623363330; cv=none; d=google.com; s=arc-20160816; b=YqHEJJwn/M06h09paFk6lHoTs+I3L5xS5QIH9+edBEs+MW3xI+esRX2yZ8QIS+84Lq be1QEA4vpFltMznyEbFOJ7mX+mucHwnCrS6q4jGGjjc3HuhmDFpNiSgZ9jufTX6HCCG4 5ZfKfbUZQorkMgd26XX+lChyaoASS0IzBfFs3/WEgljtqBOzFhvFLkPOE9Ax/NXzo3Yw zwRUEFzk1JXqiJYPF73Pwp4Eo6HIl0/re4L/eIcc7MHLWyQZTmeHjfUMYiC9JSa84Z4j gIOq61MjWXOFL3fMLCCb45O5Fd3rDSAHRsFJMmXKgroPeI4Y4qI95QexE8h36l0NREw6 hjVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IH1SveIFJ5wJ6kocsX0s8v3WiB0uqtridXReuF2KUMY=; b=PIejY/6Aq/U9vhNa5hwbYxDfXW7VhEDUk51RDVHBRfHbVWdiMlN1uLVSIc1yo09kaS hFO6KuJcNaPv7Ixu1MZyOlKgxkF230RumstUgk2fuzUaKDfDzhL5NcC/bV3xHm9NG5BM WFzKf0G8jeY2BhoSaHQX5QhLWv45OiY9Ah4wxPYxKh7VS7WLsAfIHA0pf8IVmYjxh7xb Pa4GV+NWQaEXd6mmIjy9YS6DCj5b2L28Y6wLJ7AckHT1oSXMky/2GZcNVqWY0K3udxG+ Csm22RBi/JBSraJKwlfRsbo2nQDBMdgHksFc1pHXr1qbHD90oEATwVp84AtmquLquRe5 PNOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Qzof8FNE; 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 m7si2931703edd.133.2021.06.10.15.14.51; Thu, 10 Jun 2021 15:15:30 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Qzof8FNE; 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 S230304AbhFJWNs (ORCPT + 99 others); Thu, 10 Jun 2021 18:13:48 -0400 Received: from mail-ej1-f48.google.com ([209.85.218.48]:46972 "EHLO mail-ej1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhFJWNp (ORCPT ); Thu, 10 Jun 2021 18:13:45 -0400 Received: by mail-ej1-f48.google.com with SMTP id he7so1398979ejc.13 for ; Thu, 10 Jun 2021 15:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IH1SveIFJ5wJ6kocsX0s8v3WiB0uqtridXReuF2KUMY=; b=Qzof8FNEW2Ba5XPZGpDfZSR6rdtd6WGsu717h8Er0yjM+Qrz/xmDEYF47olKQxMaDV /WuPvFIxyme1vchmGP1HhMrAqH5OzNDJ6D669STTMCTBS8PPP8U2SeAmmSAiNv3xHWUT sYS5gTDilCKxc+IrHBQDdFNyeZ8axOedobMUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IH1SveIFJ5wJ6kocsX0s8v3WiB0uqtridXReuF2KUMY=; b=A3QZp3UgOzkirYvEauz+LwrgkkVeL+iC3DIrMQ9FOF4uWrnKDLKLYBmslZcR1yms61 hJx1FmIIK4BhYCPOJQf40O9PQdERTREGERJ7Q2x3IBU7vI8ltvyvuYh3SuPdCfnFMmqX hxCNPIvruTJmTwQog/NoJ7juQdfmkemAiERl6K6an5LeWzSQ1daHKdx1eAJ6X6O4/M0H su2NDIOjAKqCAa8wfTGlu0H0STe6kFTi5ox737c8XV/gDOm64GYSUjHemuVVc4Iy7UIQ Hkk1ILZOtPNgGBZB3kuhVONmfbBg+Sz4ckVdUwMvHjHhweJBAZsySmyAIu8Rij1JzbO7 cQyg== X-Gm-Message-State: AOAM533/tNxTLaM2R6ck+dmFHdLnjH+cfYlyda412OwFg/CSmx1vJ8+N yAEWPEai1i+Y/+tjmTWVUseuoJEA4TDEQV6vacc= X-Received: by 2002:a17:906:b212:: with SMTP id p18mr595521ejz.109.1623363034818; Thu, 10 Jun 2021 15:10:34 -0700 (PDT) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com. [209.85.218.52]) by smtp.gmail.com with ESMTPSA id s2sm1956381edu.89.2021.06.10.15.10.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 15:10:34 -0700 (PDT) Received: by mail-ej1-f52.google.com with SMTP id og14so1454829ejc.5 for ; Thu, 10 Jun 2021 15:10:34 -0700 (PDT) X-Received: by 2002:ac2:43b9:: with SMTP id t25mr578806lfl.253.1623362689248; Thu, 10 Jun 2021 15:04:49 -0700 (PDT) MIME-Version: 1.0 References: <87sg1p30a1.fsf@disp2133> In-Reply-To: <87sg1p30a1.fsf@disp2133> From: Linus Torvalds Date: Thu, 10 Jun 2021 15:04:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads To: "Eric W. Biederman" Cc: linux-arch , Jens Axboe , Oleg Nesterov , Al Viro , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Ley Foon Tan , Tejun Heo , Daniel Jacobowitz , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 1:58 PM Eric W. Biederman wrote: > > The problem is sometimes we read all of the registers from > a context where they are not all saved. Ouch. Yes. And this is really painful because none of the *normal* architectures do this, so it gets absolutely no coverage. > I think at this point we need to say that the architectures that have a > do this need to be fixed to at least call do_exit and the kernel > function in create_io_thread with the deeper stack. Yeah. We traditionally have that requirement for fork() and friends too (vfork/clone), so adding exit and io_uring to do so seems like the most straightforward thing. But I really wish we had some way to test and trigger this so that we wouldn't get caught on this before. Something in task_pt_regs() that catches "this doesn't actually work" and does a WARN_ON_ONCE() on the affected architectures? Linus