Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277912

Re: [PATCH v2 1/4] init: create cmdline param to disable readonly

From "PaX Team" <pageexec@freemail.hu>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/4] init: create cmdline param to disable readonly
Date 2015-11-26 01:40 +0100
Message-ID <qySLn-57X-7@gated-at.bofh.it> (permalink)
References <qySs2-51l-33@gated-at.bofh.it> <qyRPj-4wz-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] introduce post-init read-only memory Kees Cook <keescook@chromium.org> - 2015-11-26 00:40 +0100
  [PATCH v2 1/4] init: create cmdline param to disable readonly Kees Cook <keescook@chromium.org> - 2015-11-26 00:40 +0100
    Re: [PATCH v2 1/4] init: create cmdline param to disable readonly "PaX Team" <pageexec@freemail.hu> - 2015-11-26 01:40 +0100
    Re: [kernel-hardening] [PATCH v2 1/4] init: create cmdline param to  disable readonly Greg KH <greg@kroah.com> - 2015-11-26 02:10 +0100
    Re: [PATCH v2 1/4] init: create cmdline param to disable readonly Ingo Molnar <mingo@kernel.org> - 2015-11-26 09:00 +0100
  [PATCH v2 3/4] lkdtm: verify that __ro_after_init works correctly Kees Cook <keescook@chromium.org> - 2015-11-26 00:40 +0100
  [PATCH v2 2/4] introduce post-init read-only memory Kees Cook <keescook@chromium.org> - 2015-11-26 00:40 +0100
    Re: [PATCH v2 2/4] introduce post-init read-only memory "PaX Team" <pageexec@freemail.hu> - 2015-11-26 01:20 +0100
  [PATCH v2 4/4] x86, vdso: mark vDSO read-only after init Kees Cook <keescook@chromium.org> - 2015-11-26 00:40 +0100

csiph-web