[makedumpfile PATCH 2/2] Fix physical-to-virtual conversion in exclude_segment()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With kaslr enabled, PAGE_OFFSET may no longer be aligned to allow
calculation using bitwise OR. My fix follows the same idea as
Baoquan's commit 4c53423b995463067fbbd394e724b4d1d6ea3d62 for
set_kcore_vmcoreinfo, i.e. use arithmetic addition instead.

Signed-off-by: Petr Tesarik <ptesarik@xxxxxxxx>
---
 elf_info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf_info.c b/elf_info.c
index 1eaddd9..711601a 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -810,8 +810,8 @@ static int exclude_segment(struct pt_load_segment **pt_loads,
 	int i, j, tidx = -1;
 	unsigned long long	vstart, vend, kvstart, kvend;
 	struct pt_load_segment temp_seg = {0};
-	kvstart = (ulong)start | PAGE_OFFSET;
-	kvend = (ulong)end | PAGE_OFFSET;
+	kvstart = (ulong)start + PAGE_OFFSET;
+	kvend = (ulong)end + PAGE_OFFSET;
 	unsigned long size;
 
 	for (i = 0; i < (*num_pt_loads); i++) {
-- 
2.13.6


_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux