diff options
author | Petr Tesarik <ptesarik@suse.com> | 2018-01-19 20:46:17 +0900 |
---|---|---|
committer | Atsushi Kumagai <ats-kumagai@wm.jp.nec.com> | 2018-01-24 11:51:09 +0900 |
commit | 6c1bf2a029be0615089f55d815fdb78f6e06e06a (patch) | |
tree | 9b29ead61479a849295fffa7b4de372000555262 /elf_info.c | |
parent | 590f35e773dcd51a750b9a181863660a25b66f01 (diff) |
[PATCH 2/2] Fix physical-to-virtual conversion in exclude_segment()
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@suse.com>
Tested-by: Bhupesh Sharma <bhsharma@redhat.com>
Diffstat (limited to 'elf_info.c')
-rw-r--r-- | elf_info.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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++) { |