[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f0f902f7-d3ff-bca8-a17b-d5f8f6ab6310@iogearbox.net>
Date: Tue, 14 Apr 2020 21:44:31 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Martin KaFai Lau <kafai@...com>,
"Daniel T. Lee" <danieltimlee@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH] tools: bpftool: fix struct_ops command invalid pointer
free
On 4/10/20 7:03 AM, Martin KaFai Lau wrote:
> On Fri, Apr 10, 2020 at 11:06:12AM +0900, Daniel T. Lee wrote:
>> From commit 65c93628599d ("bpftool: Add struct_ops support"),
>> a new type of command struct_ops has been added.
>>
>> This command requires kernel CONFIG_DEBUG_INFO_BTF=y, and for retrieving
>> btf info, get_btf_vmlinux() is used.
>>
>> When running this command on kernel without BTF debug info, this will
>> lead to 'btf_vmlinux' variable contains invalid(error) pointer. And by
>> this, btf_free() causes a segfault when executing 'bpftool struct_ops'.
>>
>> This commit adds pointer validation with IS_ERR not to free invalid
>> pointer, and this will fix the segfault issue.
>>
>> Signed-off-by: Daniel T. Lee <danieltimlee@...il.com>
> Fixes: 65c93628599d ("bpftool: Add struct_ops support")
> Acked-by: Martin KaFai Lau
Applied & fixed up email, thanks!
Powered by blists - more mailing lists