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 8F93BC433FE for ; Tue, 15 Nov 2022 19:43:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29AD46B0071; Tue, 15 Nov 2022 14:43:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 223BD6B0072; Tue, 15 Nov 2022 14:43:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09DFD6B0073; Tue, 15 Nov 2022 14:43:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EB9306B0071 for ; Tue, 15 Nov 2022 14:43:43 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C2DF240376 for ; Tue, 15 Nov 2022 19:43:43 +0000 (UTC) X-FDA: 80136701526.27.DB8F24D Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf29.hostedemail.com (Postfix) with ESMTP id 68BDD120009 for ; Tue, 15 Nov 2022 19:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=QnRFaJdTKibI758I9kj7cXS0kb/T4IK8Fmo0NNbrHpo=; b=RI9MhJbYpg6c3VLPNttnDQb2xQ OrqcxaY9Xgd61XCY8OUVnzvMF/dIS2ryHCuVfKlLsCv0/F5irZgoTtKnKMfiW7XrdluzBWQ0bWK3M 8SrwqVl13LxvaSNQ+Kfo1hC5vDLg8L9haDSBsPkyF54hbvnd5ZAiiYVkfnfK2qNaNK5J81UR+hn2V mR9bBwAcJqNH+gw+HVRkr3UrTGLD0HhCf+tYPu0d2HtvRzPQAJ2K4H0t+JEah8c/V5KUADskjYMI9 tz1fTfFrnjDh4e/c8g1IXN2v4W2zrA4nRI3kAWF0JE+xNithQ91lkY+8kJSqxR9+xzPa4f5PSKYj8 cCO/nCJw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ov1qD-0015RU-1o; Tue, 15 Nov 2022 19:43:29 +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 3754E300F30; Tue, 15 Nov 2022 15:18:25 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 206542CB43B63; Tue, 15 Nov 2022 15:18:25 +0100 (CET) Date: Tue, 15 Nov 2022 15:18:25 +0100 From: Peter Zijlstra To: Rick Edgecombe Cc: x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V . Shankar" , Weijiang Yang , "Kirill A . Shutemov" , John Allen , kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Yu-cheng Yu 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: <20221104223604.29615-28-rick.p.edgecombe@intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668541423; a=rsa-sha256; cv=none; b=IX1w7fRij7l/UXg+mmQjjrMcwW6nc9EZ0P5zV19d2sY9JEG81tCInk2aUw2JT0ocM2m5+1 6a9B87z7lkI3tXjObugKP+jXtESc1GSadF875QgcOtWuYeHH1fDkccTnW/X4Lt4gfDIeMQ OJ9+u19isiEPdoGsxmpDcjrHU8KnQrM= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=RI9MhJbY; dmarc=none; spf=none (imf29.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668541423; 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=QnRFaJdTKibI758I9kj7cXS0kb/T4IK8Fmo0NNbrHpo=; b=LQUBl/vT70DXIr8L73OaLr19nOf1o4Z7z84c3CwwwiO3HJ2GI/22qo6OslBUkbCGwXXXY8 cV3Hhx/AreXPZNeChp2TaxxRUORO7RftIrHoqKNEgfMFm/b2HSFG9gDHBQjFnNQ6C2u5dE JXxIc3SEO+gPfi9hN6h6C7rCJIRS2uE= X-Rspamd-Queue-Id: 68BDD120009 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=RI9MhJbY; dmarc=none; spf=none (imf29.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Rspamd-Server: rspam06 X-Stat-Signature: on1mo4zymg1d613sigddgdzw84xctfrd X-HE-Tag: 1668541423-484328 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 Fri, Nov 04, 2022 at 03:35:54PM -0700, Rick Edgecombe wrote: > +#ifdef CONFIG_X86_USER_SHADOW_STACK > +static inline int write_user_shstk_64(u64 __user *addr, u64 val) > +{ > + asm_volatile_goto("1: wrussq %[val], (%[addr])\n" > + _ASM_EXTABLE(1b, %l[fail]) > + :: [addr] "r" (addr), [val] "r" (val) > + :: fail); > + return 0; > +fail: > + return -EFAULT; > +} > +#endif /* CONFIG_X86_USER_SHADOW_STACK */ Why isn't this modelled after put_user() ? Should you write a 64bit value even if the task receiving a signal is 32bit ?