linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] mm: do not export const kfree and kstrdup variants
@ 2024-09-24  5:08 Sergey Senozhatsky
  2024-09-24  6:14 ` Sergey Senozhatsky
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sergey Senozhatsky @ 2024-09-24  5:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christophe JAILLET, Andrey Skvortsov, linux-mm, linux-kernel,
	Sergey Senozhatsky

Both kfree_const() and kstrdup_const() use __start_rodata
and __end_rodata, which do not work for modules.  This is
especially important for kfree_const().  Stop exporting
these functions, as they cannot be used in the modules.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
 mm/util.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/util.c b/mm/util.c
index 4f1275023eb7..24dadbd5727a 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -42,7 +42,6 @@ void kfree_const(const void *x)
 	if (!is_kernel_rodata((unsigned long)x))
 		kfree(x);
 }
-EXPORT_SYMBOL(kfree_const);
 
 /**
  * kstrdup - allocate space for and copy an existing string
@@ -86,7 +85,6 @@ const char *kstrdup_const(const char *s, gfp_t gfp)
 
 	return kstrdup(s, gfp);
 }
-EXPORT_SYMBOL(kstrdup_const);
 
 /**
  * kstrndup - allocate space for and copy an existing string
-- 
2.46.0.792.g87dc391469-goog



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

end of thread, other threads:[~2024-09-24 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24  5:08 [PATCHv2] mm: do not export const kfree and kstrdup variants Sergey Senozhatsky
2024-09-24  6:14 ` Sergey Senozhatsky
2024-09-24  6:43 ` Christoph Hellwig
2024-09-24  6:56   ` Sergey Senozhatsky
2024-09-24  7:02     ` Christoph Hellwig
2024-09-24 19:45       ` Christophe JAILLET
2024-09-24 17:41 ` kernel test robot

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