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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4e278c0-00b3-379a-fe3e-a87d1f442f81@netronome.com>
Date:   Fri, 18 Jan 2019 18:19:47 +0000
From:   Quentin Monnet <quentin.monnet@...ronome.com>
To:     Jiri Olsa <jolsa@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>
Cc:     lkml <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org,
        Lance Digby <ldigby@...hat.com>
Subject: Re: [PATCH] bpftool: Fix prog dump by tag

2019-01-18 13:58 UTC+0100 ~ Jiri Olsa <jolsa@...nel.org>
> Lance reported an issue with bpftool not being able to
> dump program if there are more programs loaded and you
> want to dump any but the first program, like:
> 
>   # bpftool prog
>   28: kprobe  name trace_req_start  tag 1dfc28ba8b3dd597  gpl
>   	loaded_at 2019-01-18T17:02:40+1100  uid 0
>   	xlated 112B  jited 109B  memlock 4096B  map_ids 13
>   29: kprobe  name trace_req_compl  tag 5b6a5ecc6030a683  gpl
>   	loaded_at 2019-01-18T17:02:40+1100  uid 0
>   	xlated 928B  jited 575B  memlock 4096B  map_ids 13,14
>   #  bpftool prog dum jited tag 1dfc28ba8b3dd597
>    0:	push   %rbp
>    1:	mov    %rsp,%rbp
>   ...
> 
>   #  bpftool prog dum jited tag 5b6a5ecc6030a683
>   Error: can't get prog info (29): Bad address
> 
> The problem is in the prog_fd_by_tag function not cleaning
> the struct bpf_prog_info before another request, so the
> previous program length is still in there and kernel assumes
> it needs to dump the program, which fails because there's no
> user pointer set.
> 
> Moving the struct bpf_prog_info declaration into the loop,
> so it gets cleaned before each query.
> 
> Reported-by: Lance Digby <ldigby@...hat.com>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>

Thanks for the fix!

Reviewed-by: Quentin Monnet <quentin.monnet@...ronome.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ