Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1367047ybz; Wed, 29 Apr 2020 20:53:03 -0700 (PDT) X-Google-Smtp-Source: APiQypIOLhl005ZNXckA6GVNKgkN7ujJXMXd4Q28APypfnVrbKJ/3XvJgjF+Tsjv2mbTppGrPtQn X-Received: by 2002:aa7:dcd7:: with SMTP id w23mr986836edu.300.1588218783267; Wed, 29 Apr 2020 20:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588218783; cv=none; d=google.com; s=arc-20160816; b=Ku0d0Yl/WpyGYviZVr0Tp9m7IXfWGQT9+toImtXvDokoncXGliWnLVTVK+dYiMXeQD KN0Gpav9ofGxVZ0ebb2HiY4efT9jMlNf8aH4jV/I9RzZwyTDeA/wysb9W65Xw6D3lmlY 1wCbQ6yQ0tBhDvQV7BV8H433TQXAlOTD5XnckJrY0wy3UpR+KsnH4bLXIy/0R2olwjX1 /WsBqvWKyaolMlInz9VmC/rv1aald8kHNzyFDypuhor1JD7sFHarWsLTZ4Qy/aiV01BS 954U1KWszqICSlQXjWY42TypODju4fTqReFtkcOyc9GvLXh4ucYNT6Z9wSSwOSUVXxVt Ubtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CW8PCDHX5ISW2m5CWeKILZiugDKRQ2m6b+cmxgYThRo=; b=Ur822tWnR1xA9vTFotoVM7XL3gQqbMBb8FQsXjlGNKvypccnYZnhbu832tTYf8GIzN fu/NWZqiofuw2sueYcxN4ZtI3GT6UGQ0MfYqVkK0bNsQDmLmYmZ0fVgPJRRMxNfkutUE 0emaTaMTKkMyvG2uCzA7mzsUIVaEjkmLdNrQZ6P4WutydLCRjLEECAlqZL16ShikQEiR Z5M9BWiBcHLullkopgfOxMfDZoryFgAJqTofrQbQxr+y/W7z75WryAQBJMjy+8wUDDwS mlh8sAfdvoaAzNZP6svg0bJg1SknhfkNobs4qN/xrbqdWuxMI/E+XyfAv7y7X+jr2SjV G5+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EQ6Y8f6a; 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 b26si4667955edx.291.2020.04.29.20.52.40; Wed, 29 Apr 2020 20:53:03 -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=EQ6Y8f6a; 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 S1726531AbgD3Dug (ORCPT + 99 others); Wed, 29 Apr 2020 23:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726180AbgD3Duf (ORCPT ); Wed, 29 Apr 2020 23:50:35 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B06BC035494 for ; Wed, 29 Apr 2020 20:50:35 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id g4so4953912ljl.2 for ; Wed, 29 Apr 2020 20:50: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=CW8PCDHX5ISW2m5CWeKILZiugDKRQ2m6b+cmxgYThRo=; b=EQ6Y8f6aQgHJ88x1ieqtoWLU7/jMzgTNfBam7Ryk3WqBeXaTQQnn7xG/d1iVGkWW6A QjcgmqeJQt2VR0u30g0+la4Py8bom784g9pKxA/iWUHJ/LxCuucyYOBWuiVQrswtOeha /rN2oG6KngkxYb87Yjs0LTAFKM6E2LTBqBg2c= 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=CW8PCDHX5ISW2m5CWeKILZiugDKRQ2m6b+cmxgYThRo=; b=fY1ejUWN6CCcfzW0JHJ2XTPpaLXxnTODa98Z6RAX0KncdqGufZJLIUSTRUSXqW+SxU 4yG8DpcZISsyi+bvrTxFSZv772oUZ0RhPLClvD3EpkLhHkrZKoxWWryhK1dzU2IYXLMA X1bsUyufiuWfkWPzi5f4VhysouofW8S9h11drpU53KjkVaTNXvT6K6A8jhOejotindpp dFT6CCAC0tgZbBN6MImAme2AVLEo3Rjx06nEUpIEAkdoC75c/TyQxtnOpO/2tuUuSr3l DNZNgZ+hfdt7VBbmJhUl2Uepw26UVAA306FwKzmm2g0Ge8t9NeKQpmw01UtxkYJVDUXV Lmaw== X-Gm-Message-State: AGi0PubFvw8FdGKsFEBE58Adxn5xmq4dTp66QtWSYahyZHc1dzNg58n/ rO5w9RUkr0ysfMg+y8REPgIUThCHnTM= X-Received: by 2002:a2e:8719:: with SMTP id m25mr861780lji.268.1588218633074; Wed, 29 Apr 2020 20:50:33 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id e25sm3929058lfb.89.2020.04.29.20.50.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2020 20:50:32 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id f8so3510604lfe.12 for ; Wed, 29 Apr 2020 20:50:31 -0700 (PDT) X-Received: by 2002:a05:6512:405:: with SMTP id u5mr677432lfk.192.1588218631345; Wed, 29 Apr 2020 20:50:31 -0700 (PDT) MIME-Version: 1.0 References: <20200428190836.GC29960@redhat.com> In-Reply-To: From: Linus Torvalds Date: Wed, 29 Apr 2020 20:50:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Please pull proc and exec work for 5.7-rc1 To: Jann Horn Cc: Bernd Edlinger , Oleg Nesterov , "Eric W. Biederman" , Waiman Long , Ingo Molnar , Will Deacon , Linux Kernel Mailing List , Alexey Gladkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 8:41 PM Jann Horn wrote: > > | So a ptrace() user (or [...] wouldn't even see the impossible EAGAIN error. > > So I assumed you explicitly wanted ptrace() to restart, too. I was > just pointing out that that didn't make sense to me. I'm actually ok with the restart option, simply because I continue to maintain that the program is buggy. "Anything goes". To not be buggy, the program needs to install a SIGCHLD handler so that it can reap its (pseudo-)children. At which point it doesn't actually make any difference whether we fix the kernel or not, because then the non-buggy program will just work - even with a non-modified kernel. Honestly, the main argument for the kernel doing anything different at all is that from a user-mode perspective, silently hanging in the kernel waiting for something to happen is likely the least easy to debug. But if you do a return to user space - even if it's to just rinse and repeat - it's at least not "silent" any more, even if the main noise it makes is just to waste 100% CPU time. At least that's a big hint to somebody to take a look. But yes, we can make ptrace() - and _only_ ptrace() - then not repeat, and return a new error code that it has never returned before. Like EAGAIN. Mainly because in that case we're only breaking semantics of something that was already broken - unlike "write()", which has perfectly well-defined semantics and wasn't broken. Linus