[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] contrib/elf2dmp: add kernel start address check
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] contrib/elf2dmp: add kernel start address checking |
Date: |
Wed, 20 Feb 2019 12:30:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 19/02/19 22:19, Viktor Prutyanov wrote:
> 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 <address@hidden>
> ---
> contrib/elf2dmp/main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
> index 1a45eaf565..1bfeb89ba7 100644
> --- a/contrib/elf2dmp/main.c
> +++ b/contrib/elf2dmp/main.c
> @@ -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);
>
>
Queued, thanks.
Paolo