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: <20131210105820.GC12849@twins.programming.kicks-ass.net>
Date:	Tue, 10 Dec 2013 11:58:20 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	David Rientjes <rientjes@...gle.com>,
	Ingo Molnar <mingo@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	srikar@...ux.vnet.ibm.com, Thomas Gleixner <tglx@...utronix.de>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:sched/urgent] sched: Check sched_domain before computing
 group power

On Thu, Dec 05, 2013 at 10:24:25PM -0800, Yinghai Lu wrote:
> ---
>  kernel/sched/core.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: linux-2.6/kernel/sched/core.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched/core.c
> +++ linux-2.6/kernel/sched/core.c
> @@ -5737,6 +5737,9 @@ static int __sdt_alloc(const struct cpum
>  			if (!sgp)
>  				return -ENOMEM;
>  
> +			/* avoid divide-by-zero in sg_capacity() */
> +			sgp->power_orig = 1;
> +
>  			*per_cpu_ptr(sdd->sgp, j) = sgp;
>  		}
>  	}


Ooh, sg_capacity() is generating the /0.. 

Does the below work too?

---
 kernel/sched/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 87c3bc47d99d..40b185f5a3ec 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5115,6 +5115,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)
 		 * die on a /0 trap.
 		 */
 		sg->sgp->power = SCHED_POWER_SCALE * cpumask_weight(sg_span);
+		sg->sgp->power_orig = sg->sgp->power;
 
 		/*
 		 * Make sure the first group of this domain contains the
--
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