Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3254777lqo; Wed, 15 May 2024 04:37:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9sFZnxq8yZB8SoxNbp0mfCphyIncrvmD99iEY0tPuUsG1Y/Tk7x5r8sOHRCZhQELFIGaJXEN36JijtGbufpKU65at+1/teBMAP21N1w== X-Google-Smtp-Source: AGHT+IEKhtIvBJxxHmDnJYJEpYVOfDj/65zfPuMMsjWIMwlCXST28ihpa6+A5gv4p4VYOALeFZAk X-Received: by 2002:a17:906:3c56:b0:a59:f380:1823 with SMTP id a640c23a62f3a-a5a2d66b493mr965256866b.49.1715773060037; Wed, 15 May 2024 04:37:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715773060; cv=pass; d=google.com; s=arc-20160816; b=o1ZjSaixXWRCOhsEfA0Tm2SOR9nTRInfgGTgjHB9m0GW6S2z2WQsE24liWGaIEn0D4 mq9idMELpKyQeMgupCv5CCrCq7m1y/eORSTqMXghhAmk+kiGDo+qgecHX7qX6GRjwg88 oXFODyqwrj57b7NpgJ0gly8Lo5kiva+WKBfreaNag+l4RBXJJp9syNAknnvTRPB6Zx/l 6IaABAW44mNVSWvIoG3Q0kVBIYYfMIjuxYDf34GStQSAx/Rd0Ob2/b1ELyRouGMAgZw7 AQ6Qenqso8hI2MJSjji9BDV3LoE45QWaN7mrGpuu1QDCp/CgSek0NOLg1YNFzVyHUAqf Z7kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=o+uVyj8qUsbsfq+6bn2kM6u9Mh7k22x+zAgMrxxsnbY=; fh=43wGumw23akdbERZIwwo34YRG6SjxKsTCsIneRj2Yps=; b=05SgDpfRQoabWWl1UrMS5TEZPd5qaj/bmoMVSW4iTrWceavsek0Fxc1Ck4AC2kVKnL xHhvOn/w3KQHIKAAyibuKMXKe2MZDYf/MYAUz2irMA0jfWhxdPYJjJMMRIn7FYwoDtwC oSsln7lllDoKMsw5UJOzEU2oB/JgVLxG9P7Dl3PxLg+kPyAr1qhfUOG61Mj7szN6NOX1 P59RfXe27VKv9HRhbApep3S904wuX+wDIFqNtiXD69PHaJfbAJW6O9NXtxhzpPXH86OG UR/XDhAIzm4cRfMtui/t7xmR0KodAN4oeIqpMVFoDFOXSUo8WhNcJOYls4l63DHq6i0s 7kLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bi3Oaxk2; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-179815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179815-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6ee2si741059866b.770.2024.05.15.04.37.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 04:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bi3Oaxk2; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-179815-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179815-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 806E51F22746 for ; Wed, 15 May 2024 11:37:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 158B274432; Wed, 15 May 2024 11:37:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Bi3Oaxk2" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D438E6EB53 for ; Wed, 15 May 2024 11:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715773025; cv=none; b=YUZxx/UQKbh0mixqkPEGe9ym0+YSlVTRr784DnSrrTID8np5bNPQ/pwpmgQdKhHcWlodbO0UURVnccSCR9HlRUYlnV8oxza1vJiIvKzpI/Ad3NKbV5bOZ3IrkrY+5UNK+HvjStKY/9dLW9YUZCdkWAwb6cQC4OZmEVeST2CRtIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715773025; c=relaxed/simple; bh=5b0coiq2Qij7YycX921gmUQ28b31nkq/g83M03VOqAE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I3T1OjVoNzTwt/I5/6MnOVJ2cfgdP30waRqTGn5EeO2M4pgf9z1UkQwoky+C9w4CYBPt/RW9BhDPfnsdo4e0xc3Rb+jyyN9HzMod34Xf2GTRz88MxpMZSzhw/0vEQciqpKk/b/u9O4QBC2fy5IVjue8ZoS3p9A1eBbJZkGoZ0c4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Bi3Oaxk2; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715773022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=o+uVyj8qUsbsfq+6bn2kM6u9Mh7k22x+zAgMrxxsnbY=; b=Bi3Oaxk2bNv88Ikuczh+m8XpL9pmpQ8a+y25Mr9Lr4/nJ2h5v4fIW8XFTZy00JdWFGS49M wsabrrUouoAaUHE3DBglGtxSSBlK/hEHe0MLoUjgVHNRPuVRbJEBLqpE/zeSWkyGpRhlOQ QZ/2fDuhXYc1qGScKlXXi2xjQxfPt6A= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-4OmFr6i4P9O6WgqBKHOTwQ-1; Wed, 15 May 2024 07:36:58 -0400 X-MC-Unique: 4OmFr6i4P9O6WgqBKHOTwQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FA151C0512F; Wed, 15 May 2024 11:36:57 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.39]) by smtp.corp.redhat.com (Postfix) with SMTP id 89945200A08E; Wed, 15 May 2024 11:36:52 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 15 May 2024 13:35:31 +0200 (CEST) Date: Wed, 15 May 2024 13:35:25 +0200 From: Oleg Nesterov To: Jiri Olsa Cc: "Edgecombe, Rick P" , "mhiramat@kernel.org" , "songliubraving@fb.com" , "luto@kernel.org" , "andrii@kernel.org" , "debug@rivosinc.com" , "john.fastabend@gmail.com" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "rostedt@goodmis.org" , "ast@kernel.org" , "tglx@linutronix.de" , "yhs@fb.com" , "linux-man@vger.kernel.org" , "daniel@iogearbox.net" , "peterz@infradead.org" , "linux-trace-kernel@vger.kernel.org" , "bp@alien8.de" , "bpf@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCHv5 bpf-next 6/8] x86/shstk: Add return uprobe support Message-ID: <20240515113525.GB6821@redhat.com> References: <20240507105321.71524-1-jolsa@kernel.org> <20240507105321.71524-7-jolsa@kernel.org> <20240513185040.416d62bc4a71e79367c1cd9c@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Let me repeat I know nothing about shadow stacks, only tried to read Documentation/arch/x86/shstk.rst few minutes ago ;) On 05/13, Jiri Olsa wrote: > > 1) current uretprobe which are not working at the moment and we change > the top value of shadow stack with shstk_push_frame > 2) optimized uretprobe which needs to push new frame on shadow stack > with shstk_update_last_frame > > I think we should do 1) and have current uretprobe working with shadow > stack, which is broken at the moment Agreed, > I'm ok with not using optimized uretprobe when shadow stack is detected > as enabled and we go with current uretprobe in that case But how can we detect it? Again, suppose userspace does enable_shstk() { prctl(ARCH_SHSTK_SHSTK); } what if enable_shstk() is ret-probed ? Oleg.