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-next>] [day] [month] [year] [list]
Date:	Wed, 9 May 2012 14:39:48 +0200
From:	Michael Holzheu <holzheu@...ux.vnet.ibm.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] percpu: Fix rollback in pcpu_embed_first_chunk()

From: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Subject: percpu: Fix rollback in pcpu_embed_first_chunk()

The "out_free_areas" rollback in pcpu_embed_first_chunk calls the
free_fn() function for all elements in area[]. This is not correct
because not all elements have been allocated.

To fix this we call free_fn() only for allocated elements.

Signed-off-by: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
---
diff --git a/mm/percpu.c b/mm/percpu.c
index f47af91..5a7f631 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1692,9 +1692,9 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
 	goto out_free;
 
 out_free_areas:
-	for (group = 0; group < ai->nr_groups; group++)
-		free_fn(areas[group],
-			ai->groups[group].nr_units * ai->unit_size);
+	for (;group > 0; group--)
+		free_fn(areas[group - 1],
+			ai->groups[group - 1].nr_units * ai->unit_size);
 out_free:
 	pcpu_free_alloc_info(ai);
 	if (areas)

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