Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp31401pxj; Wed, 16 Jun 2021 19:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/KKZogWG+lVYaR7SKKQiKqe0j2f47VBt8vHet+mMdeIvwDN7FOXEzrZggYyozRcrTXyPA X-Received: by 2002:aa7:c44b:: with SMTP id n11mr3484062edr.4.1623896767670; Wed, 16 Jun 2021 19:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623896767; cv=none; d=google.com; s=arc-20160816; b=yuB6M6GnKy7hF3Tbq/AEM1BOJfUNZ2cX64wiq06bOsagQmcXCgLnAcVXBjZYHn6AWW 5JfS2+isLvm5V1K9qJfpSD2Mo1tUYqfkHDPAJhnuWKfwGPuDL9SqsI5+RLzpwOywDboB CEq3xcuJknRLtqareiLVFeAhnISpAJc+AyvFmK+WNN98qdtcGX1RSX5jWiWDrVdQ/Nf/ hQY2SNIsvqenDf5f8LmCpPQQN2EdEG3Dh6woVlNu574TVVleO5G3Z6U+Y/BiDlchvK1c XzeKSyFBzX2qe73z8Xva25BRyrZK1lb0oOLITrO6Gz1cHluApEL2vVJJa1MSFQMlMFD3 v1bw== 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=GEgFwvG0aEYffAJwnwi/wSvP3mnzTq32F9Igb0VeJKo=; b=m67IY7DguJ7tKwz8OE5kcWkS66Ef1taSjO1ClcBskkeM4JKY0h00VJwHMGQLoY/GPw q3aNAa3aYwpFYuKrkgNiEAYZ1eXHGqgJRIAXhcFupSrj/GpNb/ul3cjhoS7unsEoXd4z 9DyTerB9zspWs0ZweqkXSVYwKev8UzWq2FecNlMhHR73E3lpnH5F+ut+MR+Yo/vShxCG ug/zR1GQXMlakqrRiHVqCjGzK9VMe7pAf6Dfr3zSNv7924u+VF8TU9XP+6eLqTYQCfug IV8MMVblceYtff0o5xKe6replZPkamn2FN7mB5FYsjOynNfCae/5wsLKesrDaFWDLZEa XyGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=czhMl45r; 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 w5si3678402edd.540.2021.06.16.19.25.45; Wed, 16 Jun 2021 19:26:07 -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=czhMl45r; 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 S233904AbhFPVPd (ORCPT + 99 others); Wed, 16 Jun 2021 17:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbhFPVPc (ORCPT ); Wed, 16 Jun 2021 17:15:32 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277EBC061574 for ; Wed, 16 Jun 2021 14:13:25 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id my49so6032691ejc.7 for ; Wed, 16 Jun 2021 14:13:25 -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=GEgFwvG0aEYffAJwnwi/wSvP3mnzTq32F9Igb0VeJKo=; b=czhMl45rFwdrs0pcekybM2QQZCWZb/gXfUU/tObs7oUmAfWaFzGqU3ncQtuzzBoGEp 6TNZuZHFOTzoLk3Kk4ftLDU0XygKDGA3j5horD9drSGEElyEC2cdjMrMkbWUZqNsOMEo d36CyJJhlk3IB7sj2YK9ivIRzIE0TuPNJ1Ugs= 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=GEgFwvG0aEYffAJwnwi/wSvP3mnzTq32F9Igb0VeJKo=; b=Pix4SqEbdK9HIPm9cnUxornWY0hVJ0h65m6YhI0K9dn8rk0A5QTD/mbhaW0rHwSzLZ DG4o+5cCw2lJ1QWIBmhn9/6MTjuGTCAHcAqP7fvEmbRwo6/7+htVwnMyDwTJpWfycvTV jQj/eXunyNf0R9ZvweSUSQplCDsUSDrjiFFfmGvPl+8NcIXfTnBS0lk2C6AVwPFUyEKv LMfHrsOyiVfCVBequeIhiwZmPKt/lYAoXsad3el2FCMHGMGvsYygMfJrVfou8TVvsoR3 HyZdg/d+vD1LQoVlQgsXF45PSj3nKwTV+PUyFYehA4HL1a8zjqMBvyX1bmDryNwmQY4z b4ug== X-Gm-Message-State: AOAM531zfTE8RN0v7+uissniQY0MJ14Ak8jZPkyc4JZLnP3KbVb4so3V QW835E+OavuYfrsEGoAVDp5M31It1ebOnH+Qc+E= X-Received: by 2002:a17:906:f6d7:: with SMTP id jo23mr1567052ejb.302.1623878003467; Wed, 16 Jun 2021 14:13:23 -0700 (PDT) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id e22sm2708352edu.35.2021.06.16.14.13.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jun 2021 14:13:23 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id c5so4167210wrq.9 for ; Wed, 16 Jun 2021 14:13:23 -0700 (PDT) X-Received: by 2002:a2e:9644:: with SMTP id z4mr1503699ljh.507.1623877698306; Wed, 16 Jun 2021 14:08:18 -0700 (PDT) MIME-Version: 1.0 References: <87sg1p30a1.fsf@disp2133> <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> <87zgvqor7d.fsf_-_@disp2133> <87mtrpg47k.fsf@disp2133> <87pmwlek8d.fsf_-_@disp2133> <87k0mtek4n.fsf_-_@disp2133> <878s398r4g.fsf@disp2133> In-Reply-To: <878s398r4g.fsf@disp2133> From: Linus Torvalds Date: Wed, 16 Jun 2021 14:08:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] alpha/ptrace: Record and handle the absence of switch_stack To: "Eric W. Biederman" Cc: Michael Schmitz , 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 , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 1:57 PM Eric W. Biederman wrote: > > Do you know if struct switch_stack or pt_regs is ever exposeed to > usespace? They are both defined in arch/alpha/include/uapi/asm/ptrace.h > which makes me think userspace must see those definitions somewhere. Yeah, that uapi location is a bit unfortunate. It means that user space _could_ have seen it. Which probably means that some user space uses it. Not for any kernel interfaces (the alpha ptrace register offsets are actually sane, and we have that "regoff[]" array to find them) - but I could see some odd program having decided to use the kernel pt_regs and switch_stack structures for their own reasons. Annoying. Because we don't really expose it as-is in any way, afaik. Only incidentally - and by mistake - in a uapi header file. Maybe a flag in thread_info->status (or even a new 32-bit field entirely in thread_info) is the way to go like Al says. Linus