mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 02:05:33 +00:00
sched_ext: initialize kit->cursor.flags
struct bpf_iter_scx_dsq *it maybe not initialized. If we didn't call scx_bpf_dsq_move_set_vtime and scx_bpf_dsq_move_set_slice before scx_bpf_dsq_move, it would cause unexpected behaviors: 1. Assign a huge slice into p->scx.slice 2. Assign a invalid vtime into p->scx.dsq_vtime Signed-off-by: Henry Huang <henry.hj@antgroup.com> Fixes: 6462dd53a260 ("sched_ext: Compact struct bpf_iter_scx_dsq_kern") Cc: stable@vger.kernel.org # v6.12 Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
18b2093f45
commit
35bf430e08
@ -7013,7 +7013,7 @@ __bpf_kfunc int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id,
|
||||
return -ENOENT;
|
||||
|
||||
INIT_LIST_HEAD(&kit->cursor.node);
|
||||
kit->cursor.flags |= SCX_DSQ_LNODE_ITER_CURSOR | flags;
|
||||
kit->cursor.flags = SCX_DSQ_LNODE_ITER_CURSOR | flags;
|
||||
kit->cursor.priv = READ_ONCE(kit->dsq->seq);
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user