Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1729659ybl; Thu, 9 Jan 2020 00:16:01 -0800 (PST) X-Google-Smtp-Source: APXvYqznalizp0ziv8mY9K9XjLBO45MOIjehBmnWusJRzifeM0Hc92FRhtJcZK2BcCRSzCbCFWii X-Received: by 2002:a05:6830:1615:: with SMTP id g21mr7847956otr.49.1578557761014; Thu, 09 Jan 2020 00:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578557760; cv=none; d=google.com; s=arc-20160816; b=Jm1gnZCmVw7ApX7CTb5mHKMaqJnSvuB+T6IFx3E4eH9eTy/6yLfDaTCZe+Fr4kOiwd qH12UjpBdBgL+IJdldUerd0N4MUCl6ytJ8wFZQ/dlNECMRNOZ4RnciINTE8Gz4+Bkwps Zho7sR4COIV1rsB4DxrXRc2RBQ/4b4ADmGhWbRKQFqFKH8+72EgSQ3XGKIdFYP7dPl7v OcCahf03YBE3TGIInseIHlkYduBchxMHLaWC6nsgoGhAl035W78F79R2bfHSv/hPRJ6O oTSG0RWsprfIQypgntI+X4xvs8j1L07u2cS0IpgGVILQybxptGabyliqJWjcW4IJp3Mk yQwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=aCJX3qfRGAn+3jSeLTC1vMzfBDwGoUIdPhX/7aLEOfc=; b=VY426WU8BKYQ56y7E9fGg9hS89aNks4lek5DQZi0Jy+BS/xY/Ev5sqwBWTU1ektk8h rINIuqEmzJ7TCxaZeEmbXKaXH068L2Mk08Ht2kHdkAVXBdfyW4t8mk0N4aDjmOzyNa/z mzZTbhBadvlms8kJoti60ZhmOVhnXvF9AVlQy4o1/kGLxZDsS8qPx3wYxiDlXAUK3oak +ccyt7evizhc5AmUebz4nXd4lyFRjZcZGK2TjIUnpzxfYPKNoMf0WePlGOynd5cP/Jqa wb9J/mi+Pfiv7EL0F/mL9bcrkrv553g38RsYzavossk1gMUJ5CUXG6jJmMnblOSoZaDX 39hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=HQBqJeCO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si3168812oib.252.2020.01.09.00.15.46; Thu, 09 Jan 2020 00:16:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=HQBqJeCO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728352AbgAIIPF (ORCPT + 99 others); Thu, 9 Jan 2020 03:15:05 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:1261 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728267AbgAIIPE (ORCPT ); Thu, 9 Jan 2020 03:15:04 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47tf6s3zYvz9v3KW; Thu, 9 Jan 2020 09:15:01 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=HQBqJeCO; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Gi7YKr0mKWYK; Thu, 9 Jan 2020 09:15:01 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47tf6s2gGzz9v3KV; Thu, 9 Jan 2020 09:15:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1578557701; bh=aCJX3qfRGAn+3jSeLTC1vMzfBDwGoUIdPhX/7aLEOfc=; h=From:Subject:To:Cc:Date:From; b=HQBqJeCOIdc7xFwr0PRHYkj4U7bbp7zWf3xeRiO2hJAUEtL60jYN9+P1OJF6vinSV nyT7rLmW2/LHPUB+CNknG8UTjGOm5SyJC9B1RNM8gBNoKgp67fzQdnkDswZf1A0CZj 2+JzV/+Sp00UtvAhYVMkNPxsmLaHNYb2DpHj07Yg= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 54C348B816; Thu, 9 Jan 2020 09:15:02 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id fEx0BEfzzKAO; Thu, 9 Jan 2020 09:15:02 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0EDCA8B769; Thu, 9 Jan 2020 09:15:02 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id B2EB063B8D; Thu, 9 Jan 2020 08:15:01 +0000 (UTC) Message-Id: <62477e446d9685459d4f27d193af6ff1bd69d55f.1578557581.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH] init: fix misleading "This architecture does not have kernel memory protection" message To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Andrew Morton , Kees Cook Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Date: Thu, 9 Jan 2020 08:15:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message leads to think that memory protection is not implemented for the said architecture, whereas absence of CONFIG_STRICT_KERNEL_RWX only means that memory protection has not been selected at compile time. Don't print this message when CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is selected by the architecture. Instead, print "Kernel memory protection not selected by kernel config." Signed-off-by: Christophe Leroy --- init/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/main.c b/init/main.c index 2cd736059416..fd31b15cc910 100644 --- a/init/main.c +++ b/init/main.c @@ -1090,6 +1090,11 @@ static void mark_readonly(void) } else pr_info("Kernel memory protection disabled.\n"); } +#elif defined(CONFIG_ARCH_HAS_STRICT_KERNEL_RWX) +static inline void mark_readonly(void) +{ + pr_warn("Kernel memory protection not selected by kernel config.\n"); +} #else static inline void mark_readonly(void) { -- 2.13.3