mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] fixup! tlsf: move kasan_poison_shadow into tlsf_add_pool
Date: Wed, 15 Oct 2025 10:30:01 +0200	[thread overview]
Message-ID: <20251015083009.4096076-1-a.fatoum@barebox.org> (raw)

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.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 common/tlsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/tlsf.c b/common/tlsf.c
index c4ba8259b261..3c72b41c0385 100644
--- a/common/tlsf.c
+++ b/common/tlsf.c
@@ -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;
 }
 
-- 
2.47.3




             reply	other threads:[~2025-10-15  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  8:30 Ahmad Fatoum [this message]
2025-10-20 10:59 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251015083009.4096076-1-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox