Sched_ext development
 help / color / mirror / Atom feed
* [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt
@ 2026-02-02  0:42 Emil Tsalapatis
  2026-02-02  8:37 ` Andrea Righi
  2026-02-02 15:52 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-02-02  0:42 UTC (permalink / raw)
  To: sched-ext; +Cc: tj, void, arighi, changwoo, Emil Tsalapatis

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 <emil@etsalapatis.com>
---
 tools/sched_ext/scx_sdt.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/sched_ext/scx_sdt.bpf.c b/tools/sched_ext/scx_sdt.bpf.c
index d965f7d209de..31b09958e8d5 100644
--- a/tools/sched_ext/scx_sdt.bpf.c
+++ b/tools/sched_ext/scx_sdt.bpf.c
@@ -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,
 		};
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-02 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02  0:42 [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt Emil Tsalapatis
2026-02-02  8:37 ` Andrea Righi
2026-02-02 15:52 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox