diff options
author | Tejun Heo <tj@kernel.org> | 2025-05-05 11:30:39 -1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-22 14:29:44 +0200 |
commit | 0102989af4c334d1d98b2a0fd4d61a5152e39b72 (patch) | |
tree | d97e86d3fe724c2cbb4615a1d73f55b8f29136ac /net/nsh/nsh.c | |
parent | a0c2478218136616e1ebc3c544bdc94988a9ac5f (diff) |
sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
commit 428dc9fc0873989d73918d4a9cc22745b7bbc799 upstream.
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: 650ba21b131e ("sched_ext: Implement DSQ iterator")
Cc: stable@vger.kernel.org # v6.12+
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/nsh/nsh.c')
0 files changed, 0 insertions, 0 deletions