[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730185049.6244-2-dakr@kernel.org>
Date: Tue, 30 Jul 2024 20:49:41 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: akpm@...ux-foundation.org,
urezki@...il.com,
hch@...radead.org,
vbabka@...e.cz
Cc: mhocko@...e.com,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
Danilo Krummrich <dakr@...nel.org>
Subject: [PATCH 1/4] mm: kvrealloc: disable KASAN when switching to vmalloc
Disable KASAN accessibility checks when switching from a kmalloc buffer
to a vmalloc buffer.
Fixes: 923a26b4c679 ("mm: kvmalloc: align kvrealloc() with krealloc()")
Signed-off-by: Danilo Krummrich <dakr@...nel.org>
---
mm/util.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/util.c b/mm/util.c
index 29ae93f6344f..bfb2d69b6434 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -753,7 +753,10 @@ void *kvrealloc_noprof(const void *p, size_t size, gfp_t flags)
if (p) {
/* We already know that `p` is not a vmalloc address. */
- memcpy(n, p, ksize(p));
+ kasan_disable_current();
+ memcpy(n, kasan_reset_tag(p), ksize(p));
+ kasan_enable_current();
+
kfree(p);
}
}
--
2.45.2
Powered by blists - more mailing lists