]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/sched_ext: Fix data header access during free in scx_sdt
authorEmil Tsalapatis <emil@etsalapatis.com>
Mon, 2 Feb 2026 00:42:08 +0000 (19:42 -0500)
committerTejun Heo <tj@kernel.org>
Mon, 2 Feb 2026 15:50:14 +0000 (05:50 -1000)
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: 36929ebd17ae ("tools/sched_ext: add arena based scheduler")
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_sdt.bpf.c

index d965f7d209def2592df1ad2d9c466b131a15013b..31b09958e8d5ff3d37c0f645f1bf9061334ca3eb 100644 (file)
@@ -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,
                };