contrib/elf2dmp: add kernel start address checking
PATCH 1/1 contrib/elf2dmp: add kernel start address checking
Before this patch, if elf2dmp failed to find NT kernel PE magic in allowed virtual address range, then it assumes NULL as NT kernel address and cause segfault.
This patch fix the problem described above by checking NT kernel address before futher processing.
--- contrib/elf2dmp/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
contrib/elf2dmp/main.c +6 -0
@@ -524,6 +524,12 @@ int main(int argc, char *argv[]) } } +if (!nt_start_addr) { +eprintf ("Failed to find NT kernel image\n" ); + err =1 ; + goto out_ps; + } +printf ("KernBase = 0x%016" PRIx64", signature is \'%.2s\'\n" , KernBase, (char *)nt_start_addr);
Signature · 1 line
2.17.2
Paolo Bonzini
AppliedQuoted 20 lines · Viktor Prutyanov
Before this patch, if elf2dmp failed to find NT kernel PE magic in allowed virtual address range, then it assumes NULL as NT kernel address and cause segfault.
This patch fix the problem described above by checking NT kernel address before futher processing.
Signed-off-by Viktor Prutyanov <[email protected]>--- contrib/elf2dmp/main.c | 6 ++++++ 1 file changed, 6 insertions(+)contrib/elf2dmp/main.c +0
-0@@ -524,6 +524,12 @@ int main(int argc, char *argv[]) } }
contrib/elf2dmp/main.c int main(int argc, char *argv[]) · line 535
Quoted 10 lines
contrib/elf2dmp/main.c +6
-0+if (!nt_start_addr) { +eprintf ("Failed to find NT kernel image\n" ); + err =1 ; + goto out_ps; + } +printf ("KernBase = 0x%016" PRIx64", signature is \'%.2s\'\n" , KernBase, (char *)nt_start_addr);
Queued, thanks.
Paolo
Quoted 22 lines · Paolo Bonzini
Quoted 20 lines · Viktor Prutyanov
Before this patch, if elf2dmp failed to find NT kernel PE magic in allowed virtual address range, then it assumes NULL as NT kernel address and cause segfault.
This patch fix the problem described above by checking NT kernel address before futher processing.
Signed-off-by Viktor Prutyanov <[email protected]>--- contrib/elf2dmp/main.c | 6 ++++++ 1 file changed, 6 insertions(+)contrib/elf2dmp/main.c +0
-0@@ -524,6 +524,12 @@ int main(int argc, char *argv[]) } }
Quoted 12 lines
contrib/elf2dmp/main.c int main(int argc, char *argv[]) · line 535
Quoted 10 lines
contrib/elf2dmp/main.c +6
-0+if (!nt_start_addr) { +eprintf ("Failed to find NT kernel image\n" ); + err =1 ; + goto out_ps; + } +printf ("KernBase = 0x%016" PRIx64", signature is \'%.2s\'\n" , KernBase, (char *)nt_start_addr);Queued, thanks.
Hi Paolo -- I noticed this fix wasn't in master yet -- is it in a tree you're planning on sending a pullreq for soon?
thanks
-- PMM
Quoted 36 lines · Peter Maydell
Quoted 22 lines · Paolo Bonzini
Quoted 20 lines · Viktor Prutyanov
Before this patch, if elf2dmp failed to find NT kernel PE magic in allowed virtual address range, then it assumes NULL as NT kernel address and cause segfault.
This patch fix the problem described above by checking NT kernel address before futher processing.
Signed-off-by Viktor Prutyanov <[email protected]>--- contrib/elf2dmp/main.c | 6 ++++++ 1 file changed, 6 insertions(+)contrib/elf2dmp/main.c +0
-0@@ -524,6 +524,12 @@ int main(int argc, char *argv[]) } }Quoted 12 lines
contrib/elf2dmp/main.c int main(int argc, char *argv[]) · line 535
Quoted 10 lines
contrib/elf2dmp/main.c +6
-0+if (!nt_start_addr) { +eprintf ("Failed to find NT kernel image\n" ); + err =1 ; + goto out_ps; + } +printf ("KernBase = 0x%016" PRIx64", signature is \'%.2s\'\n" , KernBase, (char *)nt_start_addr);Queued, thanks.
Quoted 2 lines
Hi Paolo -- I noticed this fix wasn't in master yet -- is it in a tree you're planning on sending a pullreq for soon?
Yep, I just wanted to flush kconfig and qgraph before everybody starts sending pull requests for soft freeze.
Paolo