From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 176D5C433FE for ; Thu, 17 Nov 2022 14:18:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 467AD6B0071; Thu, 17 Nov 2022 09:18:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 418316B0072; Thu, 17 Nov 2022 09:18:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B8DC8E0001; Thu, 17 Nov 2022 09:18:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 18ADB6B0071 for ; Thu, 17 Nov 2022 09:18:03 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E4077C0B7E for ; Thu, 17 Nov 2022 14:18:02 +0000 (UTC) X-FDA: 80143138404.28.1A7D436 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 19D2D16000A for ; Thu, 17 Nov 2022 14:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LF9qnU9ueFzG/Bylc7E69vWwnL1I+GU41GAT4rdB6kA=; b=nIXpURg+Y8f25kudoCA5olsfHz /EltvxuuE17XMktIvYP8zRCyJMQ454nHHssGgB9fBxgz9pC/AOB/0PX2dVi5rGivxesVgsNqjZ+8P RLqtXObfkKAly5eeVWGMbsineXGePk3E8JuBFPh5rl2BjLZA7lVezFemk0JkY5grwVSknNRxe2ULT XJtC4ToTtg3nKJ/SzwQj+12JBEa3B9sV8LSW0Aad1T0ZO0lHXJgi9L8UBP8U3qIRpA1JhVoZyHHig t3RkBPvHEmZvWiP1C2WJkl5kijRDdsq8bAWyFmtaYhm0V02dY++1D3qN7ycAZ7nLwpBZDN3Ha3Yj3 ZA/nUKQQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovfi8-0015ca-Mx; Thu, 17 Nov 2022 14:17:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F0FFE300220; Thu, 17 Nov 2022 15:17:40 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D92D02C12E288; Thu, 17 Nov 2022 15:17:40 +0100 (CET) Date: Thu, 17 Nov 2022 15:17:40 +0100 From: Peter Zijlstra To: "Edgecombe, Rick P" Cc: "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Yu, Yu-cheng" , "Eranian, Stephane" , "kirill.shutemov@linux.intel.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "jamorris@linux.microsoft.com" , "arnd@arndb.de" , "tglx@linutronix.de" , "pavel@ucw.cz" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "linux-doc@vger.kernel.org" , "rppt@kernel.org" , "john.allen@amd.com" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" , "akpm@linux-foundation.org" Subject: Re: [PATCH v3 27/37] x86/shstk: Introduce routines modifying shstk Message-ID: References: <20221104223604.29615-1-rick.p.edgecombe@intel.com> <20221104223604.29615-28-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668694682; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LF9qnU9ueFzG/Bylc7E69vWwnL1I+GU41GAT4rdB6kA=; b=ZhoL7BbsyokWOyLduBXl8HuXtfJFGC1ADfGhkPKAIwwH8omd1S3iFlHxBpmB28+NnRvJbW NjPhq30Rl7QngGbut8wl4tOerq8I/qybKz5SS+Qi2bPEBq4Vjgdlr7Q/DIipIuZgUPR1Jm bRSYtqz+lRIWnQQx/n8aeO6itnYgcto= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nIXpURg+; spf=none (imf08.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668694682; a=rsa-sha256; cv=none; b=x/ToVpcamT4dR8G02P1Quhsc643guiBKwzDrAwqMBGlhNc74/zPR11pZp92ylaTTp8eO1w XqdPyz7Wbg+o40nbjFXff1v8uJLLP0QAZ/q8zgCymRANt1dMggFy6o9jOfkOwNHN3DBj2L UAmdtH/n8ekGavgIkXF5IVLeuy+fl28= X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 19D2D16000A Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nIXpURg+; spf=none (imf08.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none X-Stat-Signature: 1inp6a9rrrfnyrwyuk13dibq76dze4ag X-HE-Tag: 1668694681-203401 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 16, 2022 at 10:38:19PM +0000, Edgecombe, Rick P wrote: > On Wed, 2022-11-16 at 11:18 +0100, Peter Zijlstra wrote: > > > > > > > > Should you write a 64bit value even if the task receiving a > > > > signal is > > > > 32bit ? > > > > > > 32 bit support was also dropped. > > > > How? Task could start life as 64bit, frob LDT to set up 32bit code > > segment and jump into it and start doing 32bit syscalls, then what? > > > > AFAICT those 32bit syscalls will end up doing SA_IA32_ABI sigframes. > > Hmm, good point. This series used to support normal 32 bit apps via > ia32 emulation which would have handled this. But I removed it (blocked > in the enabling logic) because it didn't seem like it would get enough > use to justify the extra code. That doesn't block this scenario here > though. > > Pardon the possibly naive question, but is this 32/64 bit mixing > something any normal, shstk-desiring, applications would actually do? O > r more that they could do? It is not something common, but it is something that things like Wine do IIRC, and it would be a real shame if Wine could not use shadow stacks or something, right ;-) But more to the point; since the kernel cannot forbit this scenario (aside from taking away the LDT entirely) it is something that needs handling.