Commit 3cbe8b8
committed
sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
JIRA: https://issues.redhat.com/browse/RHEL-92921
commit 428dc9f
Author: Tejun Heo <tj@kernel.org>
Date: Mon May 5 11:30:39 2025 -1000
sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
BPF programs may call next() and destroy() on BPF iterators even after new()
returns an error value (e.g. bpf_for_each() macro ignores error returns from
new()). bpf_iter_scx_dsq_new() could leave the iterator in an uninitialized
state after an error return causing bpf_iter_scx_dsq_next() to dereference
garbage data. Make bpf_iter_scx_dsq_new() always clear $kit->dsq so that
next() and destroy() become noops.
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 650ba21 ("sched_ext: Implement DSQ iterator")
Cc: stable@vger.kernel.org # v6.12+
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Phil Auld <pauld@redhat.com>1 parent 8c63e08 commit 3cbe8b8
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7170 | 7170 | | |
7171 | 7171 | | |
7172 | 7172 | | |
| 7173 | + | |
| 7174 | + | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
| 7178 | + | |
7173 | 7179 | | |
7174 | 7180 | | |
7175 | 7181 | | |
| |||
0 commit comments