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: <20150209113727.GS5029@twins.programming.kicks-ass.net>
Date:	Mon, 9 Feb 2015 12:37:27 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Jan Beulich <JBeulich@...e.com>, tglx@...utronix.de,
	torvalds@...ux-foundation.org, riel@...hat.com,
	linux-kernel@...r.kernel.org, hpa@...or.com
Subject: Re: [tip:sched/urgent] sched/fair:  Avoid using uninitialized
 variable in preferred_group_nid()

On Mon, Feb 09, 2015 at 09:21:15AM +0100, Ingo Molnar wrote:
> Ok, agreed, please send a separate patch to fix this.

Jan, I didn't want to put your SoB on without feedback, holler and I'll
amend it any way you like.

---
Subject: sched/numa: Avoid some pointless iterations
From: Jan Beulich <JBeulich@...e.com>
Date: Mon Feb  9 12:30:00 CET 2015

Commit 81907478c431 ("sched/fair: Avoid using uninitialized variable
in preferred_group_nid()") unconditionally initializes max_group with
NODE_MASK_NONE, this means that when !max_faults (max_group didn't get
set), we'll now continue the iteration with an empty mask.

Which in turn makes the actual body of the loop go away, so we'll just
iterate until completion; short circuit this by breaking out of the
loop as soon as this would happen.

Maybe-Signed-off-by: Jan Beulich <jbeulich@...e.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 kernel/sched/fair.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1763,6 +1763,8 @@ static int preferred_group_nid(struct ta
 			}
 		}
 		/* Next round, evaluate the nodes within max_group. */
+		if (!max_faults)
+			break;
 		nodes = max_group;
 	}
 	return nid;
--
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