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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CFE8C61DA4 for ; Mon, 13 Mar 2023 11:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbjCMLFw (ORCPT ); Mon, 13 Mar 2023 07:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjCMLFr (ORCPT ); Mon, 13 Mar 2023 07:05:47 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DE19EF1; Mon, 13 Mar 2023 04:05:45 -0700 (PDT) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2DD021EC04DA; Mon, 13 Mar 2023 12:05:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1678705544; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=WNDMylAInwsppeYyZOJK7Jz1yVA+TciusPUv+jlQGkc=; b=ozHa1zi/l5kctzIp5XnqLpQ1KP7+CTEjb8SiUCRN7EFlvoe7oqT/uqk2iab7eLYk7Nisw3 1vVPcM4AMCKBELmtt3XCM8Am3MTzKrQdU7Xt2nQ2Vid/zgq4frHIQ5HqIhQSlGASxZpZDl 3C26yhB6WoPYGZz1c+zLdXwyZ9Ie+VI= Date: Mon, 13 Mar 2023 12:05:43 +0100 From: Borislav Petkov To: "Edgecombe, Rick P" Cc: "david@redhat.com" , "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "keescook@chromium.org" , "dave.hansen@linux.intel.com" , "kirill.shutemov@linux.intel.com" , "Eranian, Stephane" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "rppt@linux.ibm.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "pavel@ucw.cz" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "linux-doc@vger.kernel.org" , "arnd@arndb.de" , "tglx@linutronix.de" , "Schimpe, Christina" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "akpm@linux-foundation.org" , "debug@rivosinc.com" , "jamorris@linux.microsoft.com" , "john.allen@amd.com" , "rppt@kernel.org" , "andrew.cooper3@citrix.com" , "mingo@redhat.com" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" Subject: Re: [PATCH v7 40/41] x86/shstk: Add ARCH_SHSTK_UNLOCK Message-ID: <20230313110543.GBZA8Dh/Ov/Jbmjot1@fat_crate.local> References: <20230227222957.24501-1-rick.p.edgecombe@intel.com> <20230227222957.24501-41-rick.p.edgecombe@intel.com> <2c67ed3b9dd93e215e5e7489ad56373da789a84d.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2c67ed3b9dd93e215e5e7489ad56373da789a84d.camel@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 13, 2023 at 03:04:10AM +0000, Edgecombe, Rick P wrote: > This is how the other arch_prctl()s handle it (if they do handle it, > some don't). So I would think it would be nice to keep all the logic > the same. > > I guess the flag might work based on the assumption that if the task is > being ptraced, the arch_prctl() couldn't be coming from anywhere else. > Maybe it should get a nicely named helper that they could all use and > whatever best logic could be commented. > > Would this maybe be better as a future cleanup that did the change for > them all? Yeah, I'm just being overly paranoid. Because if there's another way to unlock that feature, then this whole "overhead" we're doing is for nothing. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette