Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752513AbbKZAij (ORCPT ); Wed, 25 Nov 2015 19:38:39 -0500 Received: from r00tworld.com ([212.85.137.150]:58610 "EHLO r00tworld.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbbKZAih (ORCPT ); Wed, 25 Nov 2015 19:38:37 -0500 From: "PaX Team" To: linux-kernel@vger.kernel.org, Kees Cook Date: Thu, 26 Nov 2015 01:37:51 +0100 MIME-Version: 1.0 Subject: Re: [PATCH v2 1/4] init: create cmdline param to disable readonly Reply-to: pageexec@freemail.hu CC: Kees Cook , Andy Lutomirski , "H. Peter Anvin" , Michael Ellerman , Mathias Krause , Ingo Molnar , Thomas Gleixner , x86@kernel.org, Arnd Bergmann , Emese Revfy , kernel-hardening@lists.openwall.com, linux-arch Message-ID: <5656545F.29919.10A1CE2B@pageexec.freemail.hu> In-reply-to: <1448494286-16029-2-git-send-email-keescook@chromium.org> References: <1448494286-16029-1-git-send-email-keescook@chromium.org>, <1448494286-16029-2-git-send-email-keescook@chromium.org> X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.12 (r00tworld.com [212.85.137.150]); Thu, 26 Nov 2015 01:37:44 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 44 On 25 Nov 2015 at 15:31, Kees Cook wrote: > + rodata= [KNL] > + on Mark read-only kernel memory as read-only (default). > + off Leave read-only kernel memory writable for debugging. > + > +#ifdef CONFIG_DEBUG_RODATA > +bool disable_mark_readonly; __initdata? > +static int __init set_debug_rodata(char *str) > +{ > + if (!str) > + return -EINVAL; > + if (!strncmp(str, "on", 2)) > + disable_mark_readonly = false; > + else if (!strncmp(str, "off", 3)) > + disable_mark_readonly = true; maybe it's just me but the double negatives make my head spin, perhaps call it enable_rodata instead (so that the variable name isn't so disconnected from the option name)? > + > + return 0; > +} > +__setup("rodata=", set_debug_rodata); > + > +static void mark_readonly(void) > +{ > + if (disable_mark_readonly) > + pr_info("Kernel read-only memory marking disabled.\n"); > + else > + mark_rodata_ro(); > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/