lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH bpf-next] selftests/bpf: fix prog_tests/uprobe_autoattach compilation error
On Thu, Apr 21, 2022 at 06:53:22PM +0200, Daniel Borkmann wrote:
> On 4/21/22 3:23 PM, Artem Savkov wrote:
> > I am getting the following compilation error for prog_tests/uprobe_autoattach.c
> >
> > tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c: In function ‘test_uprobe_autoattach’:
> > ./test_progs.h:209:26: error: pointer ‘mem’ may be used after ‘free’ [-Werror=use-after-free]
> >
> > mem variable is now used in one of the asserts so it shouldn't be freed right
> > away. Move free(mem) after the assert block.
>
> Looks good, but I rephrased this a bit to avoid confusion. It's false positive given we
> only compare the addresses but don't deref mem, which the compiler might not be able to
> follow in this case.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=6a12b8e20d7e72386594a9dbe7bf2d7fae3b3aa6

Right. Thank you for fixing up the commit message.

--
Artem

\
 
 \ /
  Last update: 2022-04-21 19:30    [W:0.079 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site