File kexec-tools-ia64-kdump-PT_LOAD-order.diff of Package kexec-tools
Date: Wed, 8 Oct 2008 17:49:41 +1100
From: Simon Horman <email@example.com>
To: firstname.lastname@example.org, email@example.com
Cc: Jay Lan <firstname.lastname@example.org>, "Luck, Tony" <email@example.com>,
Bernhard Walle <firstname.lastname@example.org>
Subject: [patch] ia64: Order of operations bug in PT_LOAD segment reader
This bug was discovered by Jay Lan and he also proposed this fix, however
thee is some discussion about what if any related changes should be made at
the same time.
The bug comes about because the break statment was never executed because
the if clause would bever be true because the if clause will never be true
because & has higher precedence than !=.
My position on this is that with the if logic fixed, as per this patch, the
break statment and the rest of the while() loop makes sense and should work
As I understand it, Jay's position is that the code should be simplified,
after all it never worked as intended.
There is a related kernel bug that lead Jay to discover this problem.
The kernel bug has been resolved by Tony Luck and was
included in Linus's tree between 2.6.27-rc8 and 2.6.27-rc9 as
"[IA64] Put the space for cpu0 per-cpu area into .data section".
Now that the kernel bug is out of the way, I am providing this patch to
continue discussion on what to do on the kexec-tools side of things. I do
not intend to apply this patch until there is some conclusion in the
discussion between Jay and myself.
Cc: Jay Lan <email@example.com>
Signed-off-by: Simon Horman <firstname.lastname@example.org>
Acked-by: Bernhard Walle <email@example.com>
kexec/arch/ia64/crashdump-ia64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -91,7 +91,7 @@ static void add_loaded_segments_info(str
if (phdr->p_type != PT_LOAD)
if (loaded_segments[loaded_segments_num].end !=
- phdr->p_paddr & ~(ELF_PAGE_SIZE-1))
+ (phdr->p_paddr & ~(ELF_PAGE_SIZE-1)))
(phdr->p_memsz + ELF_PAGE_SIZE - 1) &