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] [day] [month] [year] [list]
Message-Id: <baead0e0a77a98f1f54703a05fcc861f40d8f9eec0a24f96cf26df249dd1cd1f@mail.kernel.org>
Date: Sat, 24 Jan 2026 01:50:37 +0000 (UTC)
From: bot+bpf-ci@...nel.org
To: wusamuel@...gle.com,rafael@...nel.org,lenb@...nel.org,pavel@...nel.org,gregkh@...uxfoundation.org,dakr@...nel.org,ast@...nel.org,daniel@...earbox.net,andrii@...nel.org,martin.lau@...ux.dev,eddyz87@...il.com,song@...nel.org,yonghong.song@...ux.dev,john.fastabend@...il.com,kpsingh@...nel.org,sdf@...ichev.me,haoluo@...gle.com,jolsa@...nel.org,shuah@...nel.org
Cc: wusamuel@...gle.com,kernel-team@...roid.com,linux-kernel@...r.kernel.org,linux-pm@...r.kernel.org,bpf@...r.kernel.org,linux-kselftest@...r.kernel.org,ast@...nel.org,andrii@...nel.org,daniel@...earbox.net,martin.lau@...nel.org,eddyz87@...il.com,yonghong.song@...ux.dev,clm@...a.com,ihor.solodrai@...ux.dev
Subject: Re: [PATCH bpf-next v3 2/3] bpf: Add wakeup_source iterator

> diff --git a/kernel/bpf/wakeup_source_iter.c b/kernel/bpf/wakeup_source_iter.c
> new file mode 100644
> index 000000000000..ab83d212a1f9
> --- /dev/null
> +++ b/kernel/bpf/wakeup_source_iter.c

[ ... ]

> +static void wakeup_source_iter_seq_stop(struct seq_file *seq, void *v)
> +{
> +	int *srcuidx = seq->private;
> +
> +	if (*srcuidx >= 0)
> +		wakeup_sources_read_unlock(*srcuidx);
> +	*srcuidx = -1;
> +}

Should this function call __wakeup_source_seq_show(seq, v, true) when v is
NULL to notify the BPF program that iteration has completed?

Looking at other BPF iterators like map_iter, prog_iter, link_iter,
task_iter, and kmem_cache_iter, they all invoke the BPF program with
in_stop=true when the stop callback receives a NULL pointer. For example,
map_iter does:

    static void bpf_map_seq_stop(struct seq_file *seq, void *v)
    {
        if (!v)
            (void)__bpf_map_seq_show(seq, v, true);
        ...
    }

The bpf_seq_read() function in kernel/bpf/bpf_iter.c has this comment at
the stop label: "/* bpf program called if !p */", which suggests this
callback is expected.

The __wakeup_source_seq_show() function already accepts an in_stop
parameter but is never called with true. Without this callback, BPF
programs using this iterator cannot detect when iteration has finished.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21306880863

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ