lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A3F3730A-3CB9-4820-A706-C357ED948B22@fb.com>
Date:   Tue, 8 Jan 2019 22:23:27 +0000
From:   Song Liu <songliubraving@...com>
To:     Netdev <netdev@...r.kernel.org>
CC:     Kernel Team <Kernel-team@...com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        "naresh.kamboju@...aro.org" <naresh.kamboju@...aro.org>
Subject: Re: [PATCH bpf] bpf: fix panic in stack_map_get_build_id() on i386
 and arm32



> On Jan 8, 2019, at 2:20 PM, Song Liu <songliubraving@...com> wrote:
> 
> As Naresh reported, test_stacktrace_build_id() causes panic on i386 and
> arm32 systems. This is caused by page_address() returns NULL in certain
> cases.
> 
> This patch fixes this error by using kmap_atomic/kunmap_atomic instead
> of page_address.
> 
> Fixes: 615755a77b24 (" bpf: extend stackmap to save binary_build_id+offset instead of address")
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Signed-off-by: Song Liu <songliubraving@...com>
> ---
> kernel/bpf/stackmap.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> index 90daf285de03..d9e2483669d0 100644
> --- a/kernel/bpf/stackmap.c
> +++ b/kernel/bpf/stackmap.c
> @@ -260,7 +260,7 @@ static int stack_map_get_build_id(struct vm_area_struct *vma,
> 		return -EFAULT;	/* page not mapped */
> 
> 	ret = -EINVAL;
> -	page_addr = page_address(page);
> +	page_addr = kmap_atomic(page);
> 	ehdr = (Elf32_Ehdr *)page_addr;
> 
> 	/* compare magic x7f "ELF" */
> @@ -276,6 +276,7 @@ static int stack_map_get_build_id(struct vm_area_struct *vma,
> 	else if (ehdr->e_ident[EI_CLASS] == ELFCLASS64)
> 		ret = stack_map_get_build_id_64(page_addr, build_id);
> out:
> +	kunmap_atomic(page_addr);
> 	put_page(page);
> 	return ret;
> }
> -- 
> 2.17.1
> 

Hi Naresh,

I only tested this patch on i386 vm. Could you please help test it on
ARM32 systems?

Thanks,
Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ