lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200912011114.09476.rusty@rustcorp.com.au>
Date:	Tue, 1 Dec 2009 11:14:09 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Anton Blanchard <anton@...ba.org>
Cc:	mingo@...e.hu, peterz@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: Fix isolcpus boot option

On Mon, 30 Nov 2009 10:35:32 am Anton Blanchard wrote:
> 
> We allocate and zero cpu_isolated_map after the isolcpus __setup option
> has run. This means cpu_isolated_map always ends up empty and if
> CPUMASK_OFFSTACK is enabled we write to a cpumask that hasn't been
> allocated.
> 
> To keep the fix to a minimum this patch stores a pointer to the cmdline
> option and parses it after we allocate and zero the cpumask.

I introduced this regression in:

	commit 49557e620339cb134127b5bfbcfecc06b77d0232
	Author: Rusty Russell <rusty@...tcorp.com.au>
	Date:   Mon Nov 2 20:37:20 2009 +1030

	    sched: Fix boot crash by zalloc()ing most of the cpu masks

But this change made isolcpus= never work, CPUMASK_OFFSTACK or no.

Your patch works and is minimal.

Acked-by: Rusty Russell <rusty@...tcorp.com.au>

Thanks,
Rusty.

PS. This would have also worked:

diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8045,6 +8045,7 @@ static cpumask_var_t cpu_isolated_map;
 /* Setup the mask of cpus configured for isolated domains */
 static int __init isolated_cpu_setup(char *str)
 {
+	alloc_bootmem_cpumask_var(&cpu_isolated_map);
 	cpulist_parse(str, cpu_isolated_map);
 	return 1;
 }
@@ -9571,7 +9572,9 @@ void __init sched_init(void)
 	zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
 	alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
 #endif
-	zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
+	/* May be allocated at isolcpus cmdline parse time */
+	if (cpu_isolated_map == NULL)
+		zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
 #endif /* SMP */
 
 	perf_event_init();



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ