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: <11e2ed15-b3a5-419a-9e9f-cbfe270d0fe8@iogearbox.net>
Date: Wed, 25 Sep 2024 12:36:02 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Jiri Olsa <olsajiri@...il.com>, Tao Chen <chen.dylane@...il.com>
Cc: Andrii Nakryiko <andrii@...nel.org>, Eduard Zingerman
 <eddyz87@...il.com>, Martin KaFai Lau <martin.lau@...ux.dev>,
 Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
 bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3] libbpf: Fix expected_attach_type set when
 kernel not support

On 9/25/24 12:28 PM, Jiri Olsa wrote:
> On Sat, Sep 14, 2024 at 11:40:40PM +0800, Tao Chen wrote:
>> The commit "5902da6d8a52" set expected_attach_type again with
>> field of bpf_program after libpf_prepare_prog_load, which makes
>> expected_attach_type = 0 no sense when kenrel not support the
>> attach_type feature, so fix it.
>>
>> Fixes: 5902da6d8a52 ("libbpf: Add uprobe multi link support to bpf_program__attach_usdt")
>> Suggested-by: Jiri Olsa <jolsa@...nel.org>
>> Signed-off-by: Tao Chen <chen.dylane@...il.com>
>> ---
>>   tools/lib/bpf/libbpf.c | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> Change list:
>> - v2 -> v3:
>>      - update BPF_TRACE_UPROBE_MULTI both in prog and opts suggedted by
>>        Andrri
>> - v1 -> v2:
>>      - restore the original initialization way suggested by Jiri
>>
>> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
>> index 219facd0e66e..a78e24ff354b 100644
>> --- a/tools/lib/bpf/libbpf.c
>> +++ b/tools/lib/bpf/libbpf.c
>> @@ -7352,8 +7352,14 @@ static int libbpf_prepare_prog_load(struct bpf_program *prog,
>>   		opts->prog_flags |= BPF_F_XDP_HAS_FRAGS;
>>   
>>   	/* special check for usdt to use uprobe_multi link */
>> -	if ((def & SEC_USDT) && kernel_supports(prog->obj, FEAT_UPROBE_MULTI_LINK))
>> +	if ((def & SEC_USDT) && kernel_supports(prog->obj, FEAT_UPROBE_MULTI_LINK)) {
>> +		/* for BPF_TRACE_KPROBE_MULTI, user might want to query exected_attach_type
>> +		 * in prog, and expected_attach_type we set in kenrel is from opts, so we
>> +		 * update both.
>> +		 */
> s/K/U/ in BPF_TRACE_KPROBE_MULTI in above comment and 'kenrel' typo
>
> Acked-by: Jiri Olsa <jolsa@...nel.org>
Same typo is also in commit desc, would be good to improve the commit
desc a bit if you spin v4 anyway. Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ