linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix corruption error in rh_alloc_fixed()
@ 2008-12-09 14:28 Guillaume Knispel
  2008-12-09 15:03 ` Timur Tabi
  2008-12-17 16:11 ` Kumar Gala
  0 siblings, 2 replies; 11+ messages in thread
From: Guillaume Knispel @ 2008-12-09 14:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Joakim Tjernlund, Pantelis Antoniou, Li Yang, Timur Tabi

There is an error in rh_alloc_fixed() of the Remote Heap code:
If there is at least one free block blk won't be NULL at the end of the
search loop, so -ENOMEM won't be returned and the else branch of
"if (bs == s || be == e)" will be taken, corrupting the management
structures.

Signed-off-by: Guillaume Knispel <gknispel@proformatique.com>
---
Fix an error in rh_alloc_fixed() that made allocations succeed when
they should fail, and corrupted management structures.

diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 29b2941..45907c1 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -556,6 +556,7 @@ unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, co
 		be = blk->start + blk->size;
 		if (s >= bs && e <= be)
 			break;
+		blk = NULL;
 	}
 
 	if (blk == NULL)

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-12-17 16:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09 14:28 [PATCH] Fix corruption error in rh_alloc_fixed() Guillaume Knispel
2008-12-09 15:03 ` Timur Tabi
2008-12-09 15:14   ` Guillaume Knispel
2008-12-09 15:16     ` Timur Tabi
2008-12-14 18:50       ` Guillaume Knispel
2008-12-14 21:21         ` Paul Mackerras
2008-12-15  0:32           ` Guillaume Knispel
2008-12-16 18:23             ` Kumar Gala
2008-12-17  1:13               ` Paul Mackerras
2008-12-17 16:00                 ` Kumar Gala
2008-12-17 16:11 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).