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 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9AC2C43381 for ; Thu, 7 Mar 2019 20:25:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8742520840 for ; Thu, 7 Mar 2019 20:25:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="aBvUi/RZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbfCGUZZ (ORCPT ); Thu, 7 Mar 2019 15:25:25 -0500 Received: from mail.skyhub.de ([5.9.137.197]:55536 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfCGUZY (ORCPT ); Thu, 7 Mar 2019 15:25:24 -0500 Received: from zn.tnic (unknown [IPv6:2003:ec:2f08:1c00:329c:23ff:fea6:a903]) (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 763061EC0310; Thu, 7 Mar 2019 21:25:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1551990322; 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=j/Do6FnvCh9OWtdg4UwDiyiIzDztecvEbbA6xQuvclY=; b=aBvUi/RZBy5hLhXC9ghHsHwWVyhfiXmOlm0vRVntsr42HLaa+xL0sWYOf+zUocpD+0kkli o4ldSkPaUMEFRHUBFH//43BRVvBzk5aPv24Sjn3ok2I4wA0MjBhCvtU6hiKRtfZSLizm9u 3eXMMHV8IynSPH/ZJp2eGLcKZIRwZrM= Date: Thu, 7 Mar 2019 21:25:21 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: "H. Peter Anvin" , Nadav Amit , Rick Edgecombe , Ingo Molnar , LKML , X86 ML , Thomas Gleixner , Dave Hansen , Peter Zijlstra , Damian Tometzki , linux-integrity , LSM List , Andrew Morton , Kernel Hardening , Linux-MM , Will Deacon , Ard Biesheuvel , Kristen Carlson Accardi , "Dock, Deneen T" , Kees Cook , Dave Hansen , Masami Hiramatsu Subject: Re: [PATCH v2 10/20] x86: avoid W^X being broken during modules loading Message-ID: <20190307202521.GI26566@zn.tnic> References: <1533F2BB-2284-499B-9912-6D74D0B87BC1@gmail.com> <20190211190108.GP19618@zn.tnic> <20190211191059.GR19618@zn.tnic> <3996E3F9-92D2-4561-84E9-68B43AC60F43@gmail.com> <20190211194251.GS19618@zn.tnic> <20190307072947.GA26566@zn.tnic> <20190307170629.GG26566@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Thu, Mar 07, 2019 at 12:02:13PM -0800, Andy Lutomirski wrote: > Should we maybe rename these functions? static_cpu_has() is at least > reasonably obvious. But cpu_feature_enabled() is different for > reasons I've never understood, and boot_cpu_has() is IMO terribly > named. It's not about the boot cpu -- it's about doing the same thing > but with less bloat and less performance. Well, it does test bits in boot_cpu_data. I don't care about "boot" in the name though so feel free to suggest something better. > (And can we maybe collapse cpu_feature_enabled() and static_cpu_has() > into the same function?) I'm not sure it would be always ok to involve the DISABLED_MASK* buildtime stuff in the checks. It probably is but it would need careful auditing to be sure, first. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.