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] [day] [month] [year] [list]
Date:	Mon, 2 May 2011 10:38:56 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Yong Zhang <yong.zhang0@...il.com>
Subject: Re: [PATCH] sched: try to fix mm leak when freeing sched groups

On Thu, Apr 21, 2011 at 10:20 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Thu, 2011-04-21 at 21:46 +0800, Hillf Danton wrote:
>>
>> It is linux-2.6.39-rc1.tar.bz2 downloaded at kernel.org, and
>>           >> --- a/kernel/sched.c  2011-03-30 03:09:48.000000000 +0800
>> is the time stamp, right?
>
> Dunno, but 39-rc1 is like ancient, please send patches against the tip
> git tree:
>
>  git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
>

Hi Peter

I tried again, and please review once more.

thanks

Hillf
---

--- linux-2.6.39-rc5/kernel/sched.c	2011-04-27 11:48:50.000000000 +0800
+++ sched.c	2011-05-02 10:38:02.000000000 +0800
@@ -7120,21 +7120,18 @@ static void free_sched_groups(const stru
 			continue;

 		for (i = 0; i < nr_node_ids; i++) {
-			struct sched_group *oldsg, *sg = sched_group_nodes[i];
+			struct sched_group *sg = sched_group_nodes[i];

 			cpumask_and(nodemask, cpumask_of_node(i), cpu_map);
 			if (cpumask_empty(nodemask))
 				continue;

-			if (sg == NULL)
-				continue;
-			sg = sg->next;
-next_sg:
-			oldsg = sg;
-			sg = sg->next;
-			kfree(oldsg);
-			if (oldsg != sched_group_nodes[i])
-				goto next_sg;
+			if (sg != NULL)
+				do {
+					struct sched_group *next = sg->next;
+					kfree(sg);
+					sg = next;
+				} while (sg != sched_group_nodes[i]);
 		}
 		kfree(sched_group_nodes);
 		sched_group_nodes_bycpu[cpu] = NULL;
--
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