Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp88914lqo; Wed, 15 May 2024 08:28:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUKynlU8xmcAEg705jq72MIMP4ken3KtnJHKWL360+cDJjYMT6ekP8aosXUheoVMZhpy5rgF37WyysbMKUW9l94KESvY0kf/sUWLIp2w== X-Google-Smtp-Source: AGHT+IFnQ1K1wo6DCWiTikwugUXl4M/lKgma8AKmyuXAUW81mHi7f5TyyTE1b4qCEg2GXcHjPImX X-Received: by 2002:a05:6a21:995:b0:1af:abce:986d with SMTP id adf61e73a8af0-1afde1df66fmr17094022637.61.1715786922814; Wed, 15 May 2024 08:28:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715786922; cv=pass; d=google.com; s=arc-20160816; b=SWX41pzpti6wNMVaavGAzXKW4WVe9DFrMX4ivpY9H9w1h3eFFGmTVckuo6yL7rxdrh 2P0ivlqslCnhjGG3161uYdSsCb1kwNgXRFoFx3/+LvvsWU03o0PcexW34dGzijpaxHtW B1IUs7tV0f/HCdsvFBUbE/zdUGsl0AGgHiW4vD9y0t3X3xtFdsKE1XsHoOcrpuW/Sdxn C3efX8owKSq/4R8dKkSarl/XDRfZw7NudWbfABxblChSKJatn7gqVC+LPT0ezSxD/YHY Ty51+am957Gwlk9eYrwFm7lJRCxbQDTDd4BT+Gu/K/jw3MWcxGnJwZxWcSUtPw5kstXL iFWQ== 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=uInC5hWDwqGcx7P6rLG2USi6e9+2nLZVOslbhOtiZQ8=; fh=deHSP9tsOnssHx8aU8vtgUbHWYox5LaAmnyo9y/sAso=; b=lIs5hCtlGVpJxCCeMMV4D5sKLLk6Vb3sQh6O443rcLI5Y8giLmxqJHvBe39xv3Ss82 DSqBC/OdwTXfVHXC9fxwTJm8uKnsr8kvnmETZEPvRb9ai/hzMXbA2+NNBIx4QWL/ZQj0 H/awYb2M47WUXCZ9a/xBQqfQ8YipHDm+O6I9LXu4UpQS0hwI4x1NJR2iAIo7naCq/L3q Ou1sCpNrYa3xgW1POuuICSYV71uSvr5VmfGP1LNJrz/AZ49MSQR8Sgpd1tIU2TwGTehC v9Sbs2fXIGIiMqS+mjiQrKJEpZjyOkut2O3BxNlqo8KF0llRd9d9eCXTSk0rK6Bfuy8P qSXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J+mDcXJ3; 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-180067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f6aa1si13752758a12.342.2024.05.15.08.28.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 08:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J+mDcXJ3; 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-180067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180067-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AD8C4B21C28 for ; Wed, 15 May 2024 15:28:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E4CA156657; Wed, 15 May 2024 15:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J+mDcXJ3" 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 ECEF1155A26 for ; Wed, 15 May 2024 15:28:08 +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=1715786890; cv=none; b=P/5TZNRKoAcW0A4lILxa6naL044uNSWwHAzU9DtFmXRhkYqMnzOHW3SFCLnyRno0zzASdgN8SXt3hVT+LaXJ7Fp93df7S0JhkSLHRL9wCVGhg+ZtEJw0eF+P5tlS7HH+yq/uzNGIda/tbVBwJ8lDkPYhiXp9cemashTuWy3f80s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715786890; c=relaxed/simple; bh=C8kKQKOtylTtvVHkjEFur6xMaFsKzbM5ZDTUlRRicm4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NaG8ENo+g/liCVbFxAVhMSriNP9xK/rwD/ryNVZWNFm+JyzgV3cBRBNQdH+CUywwLMRs1zMgG6M0Whvd9c2v2Ac83D9xHSld2jPoGFqji6EQip08CPFRibbZKl9OGaWEmQpcRMi8YTYj6pAYN1E0D5ddQNwPjONaSbGwiZTPpHU= 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=J+mDcXJ3; 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=1715786887; 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=uInC5hWDwqGcx7P6rLG2USi6e9+2nLZVOslbhOtiZQ8=; b=J+mDcXJ3v4GqpDrK2lt3set2yk+7qU/SWQ7+3uLApxCIhgemcp38lmbAEGoxTDBTK2101H 8HdsBMF6usqcaTulqAN/uhg8X6y8VGSah24DhKwTRyXMBIqNuYl/850iOMizQT2UHvk2y2 bvzd0AVG72+AAQ/jbCnuX4xaWsB9WPI= 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-159-OKrgi6wzN1OJxJUn5UMrTA-1; Wed, 15 May 2024 11:27:42 -0400 X-MC-Unique: OKrgi6wzN1OJxJUn5UMrTA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 4ABD71C0513F; Wed, 15 May 2024 15:27:41 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.39]) by smtp.corp.redhat.com (Postfix) with SMTP id 7395F3C27; Wed, 15 May 2024 15:27:36 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 15 May 2024 17:26:15 +0200 (CEST) Date: Wed, 15 May 2024 17:26:09 +0200 From: Oleg Nesterov To: Jiri Olsa Cc: Deepak Gupta , "Edgecombe, Rick P" , "songliubraving@fb.com" , "luto@kernel.org" , "mhiramat@kernel.org" , "andrii@kernel.org" , "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" , "linux-man@vger.kernel.org" , "yhs@fb.com" , "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: <20240515152609.GD6821@redhat.com> References: <20240513185040.416d62bc4a71e79367c1cd9c@kernel.org> <3e15152888d543d2ee4e5a1d75298c80aa946659.camel@intel.com> <20240515111919.GA6821@redhat.com> 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.1 On 05/15, Jiri Olsa wrote: > > On Wed, May 15, 2024 at 01:19:20PM +0200, Oleg Nesterov wrote: > > Let me ask a couple of really stupid questions. What if the shadow stack > > is "shorter" than the normal stack? I mean, > > > > enable_shstk() > > { > > prctl(ARCH_SHSTK_SHSTK); I meant ARCH_SHSTK_ENABLE, of course > > } > > > > what happens when enable_shstk() returns? > > I think it will crash, there's explanation in the comment in > tools/testing/selftests/x86/test_shadow_stack.c test OK, thanks... But test_shadow_stack.c doesn't do ARCH_PRCTL(ARCH_SHSTK_DISABLE) if all the tests succeed ? Confused but nevermind. > > And what is the purpose of fpregs_lock_and_load() ? Why do we need to > > fpregs_restore_userregs() in shstk_setup() and other places? > > > > Oleg. > > >