tools/sched_ext: Fix data header access during free in scx_sdt
PATCH 1/1 tools/sched_ext: Fix data header access during free in scx_sdt
Fix a pointer arithmetic error in scx_sdt during freeing that causes the allocator to use the wrong memory address for the allocation's data header.
Fixes f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")
Signed-off-by Emil Tsalapatis <[email protected]>
--- tools/sched_ext/scx_sdt.bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sched_ext/scx_sdt.bpf.c +1 -1
@@ -312,7 +312,7 @@ int scx_alloc_free_idx(struct scx_allocator *alloc, __u64 idx) pos = idx & mask; data = chunk->data[pos];if (likely (data)) { - data[pos] = (struct sdt_data ) { + *data = (struct sdt_data ) { .tid.genn = data->tid.genn +1 , };
Signature · 1 line
2.49.0
Hi Emil,
Quoted 5 lines · Emil Tsalapatis
Fix a pointer arithmetic error in
scx_sdtduring freeing that causes the allocator to use the wrong memory address for the allocation's data header.Fixes f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")
I think this is fixing commig 36929ebd17ae6 ("tools/sched_ext: add arena based scheduler") in sched_ext/for-6.20, right?
Apart than that, LGTM:
Acked-by Andrea Righi <[email protected]>
Thanks,
-Andrea
Quoted 21 lines
Signed-off-by Emil Tsalapatis <[email protected]>--- tools/sched_ext/scx_sdt.bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/sched_ext/scx_sdt.bpf.c +1
-1@@ -312,7 +312,7 @@ int scx_alloc_free_idx(struct scx_allocator *alloc, __u64 idx) pos = idx & mask; data = chunk->data[pos];if (likely (data)) { - data[pos] = (struct sdt_data ) { + *data = (struct sdt_data ) { .tid.genn = data->tid.genn +1 , };Signature · 1 line
2.49.0
Applied to sched_ext/for-6.20 with the following modification:
Fixes f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")
->
Fixes 36929ebd17ae ("tools/sched_ext: add arena based scheduler")
Thanks.
--
tejun