Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5081336pxj; Tue, 22 Jun 2021 14:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVv4aGBNSKsGcoiq27uJtyw1+LbuNZlgQKJSLN4p3I1uHAVfH8X6dtE2IyfNKeaq7ls8zr X-Received: by 2002:a6b:7609:: with SMTP id g9mr4410612iom.184.1624398635240; Tue, 22 Jun 2021 14:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624398635; cv=none; d=google.com; s=arc-20160816; b=PUAXtVbw3GQV1XjxjerFrtoi0n/bW9npQppZ/WGjmOn+EEM7YLj2zMeFaOJ20d3wb8 ntr6ABEDyfLnsqC9QLt/TuMJuVPZk4/KY1aqreeJrywQAGZFCifd3Ak1pgGUkNFnX/38 RKFilEB4Ly+Jb7FgLezRCXRi8i7CEqd2V9jUW9aJPTyFYjbsAfnnAyuwybd7y2JuAZC1 iWpUxMjsA8DjvRHo1k1MKw2gupD7WAX+muMFld3PLhXk2Bwr64ujB2IE06MB+rltCft0 tcVNNJ7DRT/dw+d0HWJ0Jm0TmYLBtaTX2b/FWwqhqfZjvgNJqfSthalkIMx4YfjBY9Af xmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=/a89jzJmhEpzXyHwVhCcKZ9uKv9DiUWiMoXSo4IAqPE=; b=QFL4qXDDbWAFW63QPP/Hm3L0xbUi4eqXsXqkhhHxWbvH0XPrlUhmPLEURT20E5ST9A 6z6qU71Qa5BD3rhSRwJbqWLU0voBG0SXReQGCu/aPlD6dphM9oRI8vnkwGLHOc5XwQPa yQFw2J6gNzlMn+0ks/fqtXEuiMRBb1xwL8wM/FMsFrW6Tlh9B9fbKwDEzqPm5d0A6AWa 72nmkcL4MmpaMe8mnu70OCcRfqdy8KnrCzFHGCH3NbTOwRBJ+k2PaCp+SwML67cPNx8f l5PL55+/Uv2LtIdpEG+jVUvTyiREUPH78isoY4jYUBJp8LiGXuFEohKNhCgRfUL3iK6D bV5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fj7WoX0N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si671440jat.42.2021.06.22.14.50.21; Tue, 22 Jun 2021 14:50:35 -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=@gmail.com header.s=20161025 header.b=Fj7WoX0N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbhFVVvH (ORCPT + 99 others); Tue, 22 Jun 2021 17:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbhFVVvG (ORCPT ); Tue, 22 Jun 2021 17:51:06 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F8EAC061574; Tue, 22 Jun 2021 14:48:50 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id o21so253pll.6; Tue, 22 Jun 2021 14:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=/a89jzJmhEpzXyHwVhCcKZ9uKv9DiUWiMoXSo4IAqPE=; b=Fj7WoX0NrdmFtDXSPbtKbFgnFmECG0CoEZ4apdWVK9HbJGRvJ+ZBhc5XMlidFXofUP RWjfmZvk+mM6RhZumcg0dSaV1oUyKYulB5H/nEg0lJ3cvPqePy77b0IcPVxSDSISJnIJ dcpLcgeGt3kO1NwuKcgE8BzaK4Y1D7n4IalQxNKpU5rzjl/3eO9988IoJHBxOWH99sio dlNfD9HjdJ+dm7+L/b4tD3GXwtXFTQ3R6hStNTzps39P1kALUFKhlDTgPPlxApk+m7OQ VpgUUKRGveGFPy/XEon+N+/Hos5/Mvs0VE2YkMq1h73qmm76/kJqcqRlEt8oA52XTgfJ 01bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=/a89jzJmhEpzXyHwVhCcKZ9uKv9DiUWiMoXSo4IAqPE=; b=OY7nl6c2C8p16cZX4GpaApJy6oNDJ9a0D3LZmehRIiCDaiMB4lHjboIab61F8Plh5X STx9RJkSRlIrCfpX/8L2dnwdo6hsG2+fKcH+Os7eE/9BfvmPCf5cGzJWrdxjA+xsufPw Uku1tRIj0R3v03xr34RUglyaNKLaQErUfdR5bqTxVq1J/bVrdDgy/z0IOoY+02LOPNAJ qMKJKb7kpptjrrykSI0EMXJLOWYXMiRBXF7URaNhwUNWLEPNjxHeeTmGdre60YpalTOv F9XA5/9GU5vRA4Spv3tOp0dKRhXXfDWa0EJcYEbddNxqSyBeiQ/Jm05e85JxM6l0ftNI EKkg== X-Gm-Message-State: AOAM530PmI98/4nFM6P7Y28V/xKufVmuUoMEuAN75bZFJIX2jvA4fax9 o0G/OP4UmfJbT8MROp/BQM0= X-Received: by 2002:a17:90a:f211:: with SMTP id bs17mr1473026pjb.74.1624398530003; Tue, 22 Jun 2021 14:48:50 -0700 (PDT) Received: from ?IPv6:2001:df0:0:200c:9491:40e4:164d:6ab3? ([2001:df0:0:200c:9491:40e4:164d:6ab3]) by smtp.gmail.com with ESMTPSA id 195sm250960pfw.133.2021.06.22.14.48.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 14:48:49 -0700 (PDT) Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads To: "Eric W. Biederman" , Linus Torvalds Cc: Al Viro , linux-arch , Jens Axboe , Oleg Nesterov , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Tejun Heo , Kees Cook , Tetsuo Handa , John Paul Adrian Glaubitz References: <924ec53c-2fd9-2e1c-bbb1-3fda49809be4@gmail.com> <87eed4v2dc.fsf@disp2133> <5929e116-fa61-b211-342a-c706dcb834ca@gmail.com> <87fsxjorgs.fsf@disp2133> <87h7hpbojt.fsf@disp2133> From: Michael Schmitz Message-ID: <20c787ec-4a3c-061c-c649-5bc3e7ef0464@gmail.com> Date: Wed, 23 Jun 2021 09:48:40 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87h7hpbojt.fsf@disp2133> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On 23/06/21 9:02 am, Eric W. Biederman wrote: > Linus Torvalds writes: > > So I was more thinking of the debug patch for m68k to catch all the > _regular_ cases, and all the other random cases of ptrace_event() or > ptrace_notify(). > > Although maybe we've really caught them all. The exit case was clearly > missing, and the thread fork case was scrogged. There are patches for > the known problems. The patches I really don't like are the > verification ones to find any unknown ones.. > We still have nios2 which copied the m68k logic at some point. I think > that is a processor that is still ``shipping'' and that people might > still be using in new designs. > > I haven't looked closely enough to see what the other architectures with > caller saved registers are doing. > > The challenging ones are /proc/pid/syscall and seccomp which want to see > all of the system call arguments. I think every architecture always > saves the system call arguments unconditionally, so those cases are > probably not as interesting. But they certain look like they could be > trouble. Seccomp hasn't yet been implemented on m68k, though I'm working on that with Adrian. The sole secure_computing() call will happen in syscall_trace_enter(), so all system call arguments have been saved on the stack. Haven't looked at /proc/pid/syscall yet ... Cheers,     Michael > Eric >