Skip to contentSkip to conversation

fixup! tlsf: move kasan_poison_shadow into tlsf_add_pool

PATCH Applied Ahmad Fatoum 2 participants 2 messages Oct 15, 2025 – Oct 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixup! tlsf: move kasan_poison_shadow into tlsf_add_pool

tlsf: do not poison the control structure more than once

The control_t structure is only associated with a tlsf_t, not a merel pool_t. Poisoning the control structure again in tlsf_pool thus served no purpose.

---
 common/tlsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/tlsf.c +1 -1
index c4ba8259b261..3c72b41c0385 100644
@@ -872,7 +872,6 @@ pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes)
 	block_set_prev_free(next);
 
 	kasan_poison_shadow(mem, bytes, KASAN_TAG_INVALID);
-	kasan_poison_shadow(control, sizeof(control), KASAN_TAG_INVALID);
 
 	return mem;
 }
@@ -949,6 +948,7 @@ tlsf_t tlsf_create_with_pool(void* mem, size_t bytes)
 {
 	tlsf_t tlsf = tlsf_create(mem);
 	tlsf_add_pool(tlsf, (char*)mem + tlsf_size(), bytes - tlsf_size());
+	kasan_poison_shadow(mem, tlsf_size(), KASAN_TAG_INVALID);
 	return tlsf;
 }
 
Signature · 1 line
2.47.3
Applied
#1 lore raw
Quoted 8 lines · Ahmad Fatoum

tlsf: do not poison the control structure more than once

The control_t structure is only associated with a tlsf_t, not a merel pool_t. Poisoning the control structure again in tlsf_pool thus served no purpose.

[...]

Applied, thanks!

[1/1] fixup! tlsf: move kasan_poison_shadow into tlsf_add_pool
https://git.pengutronix.de/cgit/barebox/commit/?id=c2db61d98b09 (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>