Re: mm: OS boot failed when set command-line kmemcheck=1

From: David Rientjes
Date: Wed Feb 19 2014 - 02:49:52 EST


On Wed, 19 Feb 2014, Xishi Qiu wrote:

> Hi all,
>
> CONFIG_KMEMCHECK=y and set command-line "kmemcheck=1", I find OS
> boot failed. The kernel is v3.14.0-rc3
>
> If set "kmemcheck=1 nowatchdog", OS will boot successfully.
>

I have automated kernel boots that have both "kmemcheck=0" and
"kmemcheck=1" as the last parameter in the kernel command line every
night and I've never seen it fail on tip or linux-next before.

So I'm sure I won't be able to reproduce your issue, but it may have
something to do with your bootloader that isn't described above. The
sscanf() really wants to be replaced with kstrtoint().

Could you try this out?

diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -78,10 +78,16 @@ early_initcall(kmemcheck_init);
*/
static int __init param_kmemcheck(char *str)
{
+ int val;
+ int ret;
+
if (!str)
return -EINVAL;

- sscanf(str, "%d", &kmemcheck_enabled);
+ ret = kstrtoint(str, 0, &val);
+ if (ret)
+ return ret;
+ kmemcheck_enabled = val;
return 0;
}

--
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/