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

From: PaX Team
Date: Wed Nov 25 2015 - 19:38:42 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/