Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3386456pxj; Sun, 20 Jun 2021 19:36:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz378bItaYYo82BRV9vRfSeHYjzWX3kGgn8Qj16Yekm+O4XeHBnNnPnaoK6rraXPos4LSLq X-Received: by 2002:a50:fd0d:: with SMTP id i13mr6584071eds.123.1624242992821; Sun, 20 Jun 2021 19:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624242992; cv=none; d=google.com; s=arc-20160816; b=nCFD1BCHMVfsQdVrVre3K4hjfNSCJNIeQrYHGVA3Z6Go2MsdFGERnMONPB7sbZJMqR e79NEA/CjZf/2V2GyPcVuKFaD0OgUd9sW81TDvHhDT/v8R6q4U7vbXvi8oqmX+K7JVKx P9OqOOQWqqt2sYT5V25HSJHWkd3mXZvBAUxTpj/NA2iFg9LrSNWN1NDo+QwX+/I3PRQ1 frADRw/EjSZTpueNYdsL31W0/QyqyWLRNN6Ly9kIsedY2MpaPxdIiC70Wu29XPOCqJGT pVf3iXud8QMY1V+VdpaSVF9NtW/jEZ6gVAGA3FhoU3Q9TGtfuDZJIZgwstajq3ii+DcG TRcQ== 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=5bZm/C21nFRrsVTQ9yQ8RR3x7O5bii53yaD7C7P5A+U=; b=Wvjq3p2twU/rivQo6EAeg88L+ZFoS8jh+1alZKXsIED+OtC5E2XzvHEmZbeCy8s0CS I+KX4yvi0ZeWUXGLKqbSssD//Z2dGvXKfVV3vIr2gNTkktZVWMY1tfc2MQvFubsGVL7m iMribrrEiY/rJNIWJGkpX0h7fF0eFpMi3IwND5x86bK3hJC/Uvx5vAQP/iVu+wmnqeG0 LoSyNzXT9H7gynoJjLj3RimPOp9XUy92r1lMFALgkFTtAu7eJ083A96sooGEmzlM0+xu xSdEVkfcfdD6MSons0bKzBzpS3XDixRu2cACR3d9IVu+v6s0JIIC+3z/9NIHQY1n6pyM Kghg== 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 zh8si10045994ejb.213.2021.06.20.19.35.59; Sun, 20 Jun 2021 19:36:32 -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 S230028AbhFUCaV (ORCPT + 99 others); Sun, 20 Jun 2021 22:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbhFUCaU (ORCPT ); Sun, 20 Jun 2021 22:30:20 -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 A21FAC061574; Sun, 20 Jun 2021 19:28:07 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lv9fE-00AfVg-W3; Mon, 21 Jun 2021 02:27:53 +0000 Date: Mon, 21 Jun 2021 02:27:52 +0000 From: Al Viro To: Michael Schmitz Cc: "Eric W. Biederman" , Linus Torvalds , 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: [PATCH 1/2] alpha/ptrace: Record and handle the absence of switch_stack Message-ID: References: <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> <393c37de-5edf-effc-3d06-d7e63f34a317@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <393c37de-5edf-effc-3d06-d7e63f34a317@gmail.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 02:01:18PM +1200, Michael Schmitz wrote: > Hi Eric, > > instrumenting get_reg on m68k and using a similar patch to yours to warn > when unsaved registers are accessed on the switch stack, I get a hit from > getegid and getegid32, just by running a simple ptrace on ls. > > Going to wack those two moles now ... Explain, please. get_reg() is called by tracer; whose state are you checking? Because you are *not* accessing the switch stack of the caller of get_reg(). And tracee should be in something like syscall_trace() or do_notify_resume(); both have SAVE_SWITCH_STACK done by the glue...