Re: [PATCH bpf-next v11 04/10] libbpf: Probe percpu data feature

Leon Hwang <[email protected]>
Newsgroups dev.linux.lists.sashiko-reviews,org.kernel.vger.bpf
Message-ID <[email protected]>
On 7/8/26 01:05, [email protected] wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The newly added feature probe `FEAT_PERCPU_DATA` is never used to make capability decisions.
> --
> 
> --- Patch [4]: [PATCH bpf-next v11 04/10] libbpf: Probe percpu data feature ---
> commit 925264284b89c241360ff401bd914f9c19997613
> Author: Leon Hwang <[email protected]>
> 
> libbpf: Probe percpu data feature
> 
> This commit adds a feature probe to detect if the kernel supports global
> percpu data. It aims to allow libbpf to fail predictably when this feature
> is unavailable on older kernels.
> 
>> diff --git a/tools/lib/bpf/features.c b/tools/lib/bpf/features.c
>> index b7e388f99d0bb..ef9581c113035 100644
>> --- a/tools/lib/bpf/features.c
>> +++ b/tools/lib/bpf/features.c
> [ ... ]
>> @@ -707,6 +739,9 @@ static struct kern_feature_desc {
>>  	[FEAT_BPF_SYSCALL_COMMON_ATTRS] = {
>>  		"BPF syscall common attributes support", probe_bpf_syscall_common_attrs,
>>  	},
>> +	[FEAT_PERCPU_DATA] = {
>> +		"kernel supports percpu data", probe_kern_percpu_data,
>> +	},
>>  };
> 
> [Severity: Medium]
> Are there any callers that actually query this new feature probe?
> 
> The commit message notes that libbpf can make capability decisions early
> and fail predictably when global percpu data is unavailable. However,
> FEAT_PERCPU_DATA appears to only be defined and registered, without being
> queried in the loader code.
> 
> Is there a missing update to the loader, perhaps using kernel_supports(),
> that checks this flag before attempting to load percpu global data?
> 

No. The loader checks this flag in the next commit. The selftests also
check this flag to decide whether to run.

Thanks,
Leon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.