linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: do not export const kfree and kstrdup variants
@ 2024-09-24  5:03 Sergey Senozhatsky
  2024-09-24  5:08 ` Sergey Senozhatsky
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Senozhatsky @ 2024-09-24  5:03 UTC (permalink / raw)
  To: Andrew Morton, Andrzej Hajda
  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 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/util.c b/mm/util.c
index 4f1275023eb7..aecdc04652c5 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
-- 
2.46.0.792.g87dc391469-goog



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

* Re: [PATCH] mm: do not export const kfree and kstrdup variants
  2024-09-24  5:03 [PATCH] mm: do not export const kfree and kstrdup variants Sergey Senozhatsky
@ 2024-09-24  5:08 ` Sergey Senozhatsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2024-09-24  5:08 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Andrew Morton, Andrzej Hajda, Christophe JAILLET,
	Andrey Skvortsov, linux-mm, linux-kernel

On (24/09/24 14:03), Sergey Senozhatsky wrote:
> 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.

... and of course I forgot to commit the kstrdup_const() part.
Let me resend.


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24  5:03 [PATCH] mm: do not export const kfree and kstrdup variants Sergey Senozhatsky
2024-09-24  5:08 ` Sergey Senozhatsky

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