Linux Modules
 help / color / mirror / Atom feed
* [PATCH v3] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Vlastimil Babka @ 2025-07-15  8:43 UTC (permalink / raw)
  To: Daniel Gomez, Matthias Maennich, Jonathan Corbet,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Masahiro Yamada,
	Nathan Chancellor, Nicolas Schier, Alexander Viro,
	Christian Brauner, Jan Kara
  Cc: Christoph Hellwig, Peter Zijlstra, David Hildenbrand,
	Shivank Garg, Greg Kroah-Hartman, Jiri Slaby (SUSE),
	Stephen Rothwell, linux-doc, linux-kernel, linux-modules,
	linux-kbuild, linux-fsdevel, Vlastimil Babka, Nicolas Schier

Christoph suggested that the explicit _GPL_ can be dropped from the
module namespace export macro, as it's intended for in-tree modules
only. It would be possible to restrict it technically, but it was
pointed out [2] that some cases of using an out-of-tree build of an
in-tree module with the same name are legitimate. But in that case those
also have to be GPL anyway so it's unnecessary to spell it out in the
macro name.

Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Shivank Garg <shivankg@amd.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Nicolas Schier <n.schier@avm.de>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
Daniel, please clarify if you'll take this via module tree or Christian
can take it via vfs tree?

Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
part to avoid controversy converting selected existing EXPORT_SYMBOL().
Christoph argued [2] that the _FOR_MODULES() export is intended for
in-tree modules and thus GPL is implied anyway and can be simply dropped
from the export macro name. Peter agreed [3] about the intention for
in-tree modules only, although nothing currently enforces it.

It seemed straightforward to add this enforcement, so v1 did that. But
there were concerns of breaking the (apparently legitimate) usecases of
loading an updated/development out of tree built version of an in-tree
module.

So leave out the enforcement part and just drop the _GPL_ from the
export macro name and so we're left with EXPORT_SYMBOL_FOR_MODULES()
only. Any in-tree module used in an out-of-tree way will have to be GPL
anyway by definition.

Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
8250: export RSA functions"). Hopefully it's resolvable by a merge
commit fixup and we don't need to provide a temporary alias.

[1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
[2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
[3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
---
Changes in v3:
- Clarified the macro documentation about in-tree intention and GPL
  implications, per Daniel.
- Applied tags.
- Link to v2: https://patch.msgid.link/20250711-export_modules-v2-1-b59b6fad413a@suse.cz

Changes in v2:
- drop the patch to restrict module namespace export for in-tree modules
- fix a pre-existing documentation typo (Nicolas Schier)
- Link to v1: https://patch.msgid.link/20250708-export_modules-v1-0-fbf7a282d23f@suse.cz
---
 Documentation/core-api/symbol-namespaces.rst | 11 ++++++-----
 fs/anon_inodes.c                             |  2 +-
 include/linux/export.h                       |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
index 32fc73dc5529e8844c2ce2580987155bcd13cd09..034898e81ba201097330ab9875429e7d3fa30c0f 100644
--- a/Documentation/core-api/symbol-namespaces.rst
+++ b/Documentation/core-api/symbol-namespaces.rst
@@ -76,20 +76,21 @@ A second option to define the default namespace is directly in the compilation
 within the corresponding compilation unit before the #include for
 <linux/export.h>. Typically it's placed before the first #include statement.
 
-Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
------------------------------------------------
+Using the EXPORT_SYMBOL_FOR_MODULES() macro
+-------------------------------------------
 
 Symbols exported using this macro are put into a module namespace. This
-namespace cannot be imported.
+namespace cannot be imported. These exports are GPL-only as they are only
+intended for in-tree modules.
 
 The macro takes a comma separated list of module names, allowing only those
 modules to access this symbol. Simple tail-globs are supported.
 
 For example::
 
-  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
+  EXPORT_SYMBOL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
 
-will limit usage of this symbol to modules whoes name matches the given
+will limit usage of this symbol to modules whose name matches the given
 patterns.
 
 How to use Symbols exported in Namespaces
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 1d847a939f29a41356af3f12e5f61372ec2fb550..180a458fc4f74249d674ec3c6e01277df1d9e743 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -129,7 +129,7 @@ struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *n
 	}
 	return inode;
 }
-EXPORT_SYMBOL_GPL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
+EXPORT_SYMBOL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
 
 static struct file *__anon_inode_getfile(const char *name,
 					 const struct file_operations *fops,
diff --git a/include/linux/export.h b/include/linux/export.h
index f35d03b4113b19798036d2993d67eb932ad8ce6f..a686fd0ba406509da5f397e3a415d05c5a051c0d 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -91,6 +91,6 @@
 #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", ns)
 #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "GPL", ns)
 
-#define EXPORT_SYMBOL_GPL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
+#define EXPORT_SYMBOL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
 
 #endif /* _LINUX_EXPORT_H */

---
base-commit: d7b8f8e20813f0179d8ef519541a3527e7661d3a
change-id: 20250708-export_modules-12908fa41006

Best regards,
-- 
Vlastimil Babka <vbabka@suse.cz>


^ permalink raw reply related

* Re: [PATCH v3 7/8] x86/kprobes: enable EXECMEM_ROX_CACHE for kprobes allocations
From: Masami Hiramatsu @ 2025-07-15  0:21 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Andy Lutomirski, Borislav Petkov, Christophe Leroy,
	Daniel Gomez, Dave Hansen, Ingo Molnar, Liam R. Howlett,
	Luis Chamberlain, Mark Rutland, Masami Hiramatsu, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-8-rppt@kernel.org>

On Sun, 13 Jul 2025 10:17:29 +0300
Mike Rapoport <rppt@kernel.org> wrote:

> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> 
> x86::alloc_insn_page() always allocates ROX memory.
> 
> Instead of overriding this method, add EXECMEM_KPROBES entry in
> execmem_info with pgprot set to PAGE_KERNEL_ROX and  use ROX cache when
> configuration and CPU features allow it.
> 

Looks good to me.

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks!

> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
>  arch/x86/kernel/kprobes/core.c | 18 ------------------
>  arch/x86/mm/init.c             |  9 ++++++++-
>  2 files changed, 8 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index 47cb8eb138ba..6079d15dab8c 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -481,24 +481,6 @@ static int prepare_singlestep(kprobe_opcode_t *buf, struct kprobe *p,
>  	return len;
>  }
>  
> -/* Make page to RO mode when allocate it */
> -void *alloc_insn_page(void)
> -{
> -	void *page;
> -
> -	page = execmem_alloc(EXECMEM_KPROBES, PAGE_SIZE);
> -	if (!page)
> -		return NULL;
> -
> -	/*
> -	 * TODO: Once additional kernel code protection mechanisms are set, ensure
> -	 * that the page was not maliciously altered and it is still zeroed.
> -	 */
> -	set_memory_rox((unsigned long)page, 1);
> -
> -	return page;
> -}
> -
>  /* Kprobe x86 instruction emulation - only regs->ip or IF flag modifiers */
>  
>  static void kprobe_emulate_ifmodifiers(struct kprobe *p, struct pt_regs *regs)
> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
> index dbc63f0d538f..442fafd8ff52 100644
> --- a/arch/x86/mm/init.c
> +++ b/arch/x86/mm/init.c
> @@ -1098,7 +1098,14 @@ struct execmem_info __init *execmem_arch_setup(void)
>  				.pgprot	= pgprot,
>  				.alignment = MODULE_ALIGN,
>  			},
> -			[EXECMEM_KPROBES ... EXECMEM_BPF] = {
> +			[EXECMEM_KPROBES] = {
> +				.flags	= flags,
> +				.start	= start,
> +				.end	= MODULES_END,
> +				.pgprot	= PAGE_KERNEL_ROX,
> +				.alignment = MODULE_ALIGN,
> +			},
> +			[EXECMEM_FTRACE ... EXECMEM_BPF] = {
>  				.flags	= EXECMEM_KASAN_SHADOW,
>  				.start	= start,
>  				.end	= MODULES_END,
> -- 
> 2.47.2
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply

* Re: [PATCH v3 8/8] x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations
From: Steven Rostedt @ 2025-07-14 16:22 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Andy Lutomirski, Borislav Petkov, Christophe Leroy,
	Daniel Gomez, Dave Hansen, Ingo Molnar, Liam R. Howlett,
	Luis Chamberlain, Mark Rutland, Masami Hiramatsu, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Thomas Gleixner,
	Yann Ylavic, linux-kernel, linux-mm, linux-modules,
	linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-9-rppt@kernel.org>

On Sun, 13 Jul 2025 10:17:30 +0300
Mike Rapoport <rppt@kernel.org> wrote:

> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> 
> For the most part ftrace uses text poking and can handle ROX memory.
> The only place that requires writable memory is create_trampoline() that
> updates the allocated memory and in the end makes it ROX.
> 
> Use execmem_alloc_rw() in x86::ftrace::alloc_tramp() and enable ROX cache
> for EXECMEM_FTRACE when configuration and CPU features allow that.
> 
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply

* Re: [PATCH v4 0/7] Add generated modalias to modules.builtin.modinfo
From: Alexey Gladkov @ 2025-07-14 13:41 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, linux-scsi
In-Reply-To: <cover.1750511018.git.legion@kernel.org>

On Sat, Jun 21, 2025 at 03:57:12PM +0200, Alexey Gladkov wrote:
> The modules.builtin.modinfo file is used by userspace (kmod to be specific) to
> get information about builtin modules. Among other information about the module,
> information about module aliases is stored. This is very important to determine
> that a particular modalias will be handled by a module that is inside the
> kernel.
> 
> There are several mechanisms for creating modalias for modules:
> 
> The first is to explicitly specify the MODULE_ALIAS of the macro. In this case,
> the aliases go into the '.modinfo' section of the module if it is compiled
> separately or into vmlinux.o if it is builtin into the kernel.
> 
> The second is the use of MODULE_DEVICE_TABLE followed by the use of the
> modpost utility. In this case, vmlinux.o no longer has this information and
> does not get it into modules.builtin.modinfo.
> 
> For example:
> 
> $ modinfo pci:v00008086d0000A36Dsv00001043sd00008694bc0Csc03i30
> modinfo: ERROR: Module pci:v00008086d0000A36Dsv00001043sd00008694bc0Csc03i30 not found.
> 
> $ modinfo xhci_pci
> name:           xhci_pci
> filename:       (builtin)
> license:        GPL
> file:           drivers/usb/host/xhci-pci
> description:    xHCI PCI Host Controller Driver
> 
> The builtin module is missing alias "pci:v*d*sv*sd*bc0Csc03i30*" which will be
> generated by modpost if the module is built separately.
> 
> To fix this it is necessary to add the generated by modpost modalias to
> modules.builtin.modinfo.
> 
> Fortunately modpost already generates .vmlinux.export.c for exported symbols. It
> is possible to use this file to create a '.modinfo' section for builtin modules.
> The modules.builtin.modinfo file becomes a composite file. One part is extracted
> from vmlinux.o, the other part from .vmlinux.export.o.

Masahiro Yamada, does this version of the patchset look better to you ?

> Notes:
> - v4:
>   * Rework the patchset based on top of Masahiro Yamada's patches.
>   * Add removal of unnecessary __mod_device_table__* symbols to avoid symbol
>     table growth in vmlinux.
>   * rust code takes into account changes in __mod_device_table__*.
>   * v3: https://lore.kernel.org/all/cover.1748335606.git.legion@kernel.org/
> 
> - v3:
>   * Add `Reviewed-by` tag to patches from Petr Pavlu.
>   * Rebase to v6.15.
>   * v2: https://lore.kernel.org/all/20250509164237.2886508-1-legion@kernel.org/
> 
> - v2:
>   * Drop patch for mfd because it was already applied and is in linux-next.
>   * The generation of aliases for builtin modules has been redone as
>     suggested by Masahiro Yamada.
>   * Rebase to v6.15-rc5-136-g9c69f8884904
>   * v1: https://lore.kernel.org/all/cover.1745591072.git.legion@kernel.org/
> 
> 
> Alexey Gladkov (3):
>   scsi: Always define blogic_pci_tbl structure
>   modpost: Add modname to mod_device_table alias
>   modpost: Create modalias for builtin modules
> 
> Masahiro Yamada (4):
>   module: remove meaningless 'name' parameter from __MODULE_INFO()
>   kbuild: always create intermediate vmlinux.unstripped
>   kbuild: keep .modinfo section in vmlinux.unstripped
>   kbuild: extract modules.builtin.modinfo from vmlinux.unstripped
> 
>  drivers/scsi/BusLogic.c           |  2 -
>  include/asm-generic/vmlinux.lds.h |  2 +-
>  include/crypto/algapi.h           |  4 +-
>  include/linux/module.h            | 21 ++++-----
>  include/linux/moduleparam.h       |  9 ++--
>  include/net/tcp.h                 |  4 +-
>  rust/kernel/device_id.rs          |  8 ++--
>  scripts/Makefile.vmlinux          | 74 +++++++++++++++++++++----------
>  scripts/Makefile.vmlinux_o        | 26 +----------
>  scripts/mksysmap                  |  6 +++
>  scripts/mod/file2alias.c          | 34 ++++++++++++--
>  scripts/mod/modpost.c             | 17 ++++++-
>  scripts/mod/modpost.h             |  2 +
>  13 files changed, 131 insertions(+), 78 deletions(-)
> 
> -- 
> 2.49.0
> 

-- 
Rgrds, legion


^ permalink raw reply

* Re: [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Christian Brauner @ 2025-07-14  8:08 UTC (permalink / raw)
  To: Vlastimil Babka, Greg Kroah-Hartman
  Cc: Matthias Maennich, Jonathan Corbet, Luis Chamberlain, Petr Pavlu,
	Sami Tolvanen, Daniel Gomez, Masahiro Yamada, Nathan Chancellor,
	Nicolas Schier, Alexander Viro, Jan Kara, Christoph Hellwig,
	Peter Zijlstra, David Hildenbrand, Shivank Garg,
	Jiri Slaby (SUSE), Stephen Rothwell, linux-doc, linux-kernel,
	linux-modules, linux-kbuild, linux-fsdevel
In-Reply-To: <20250711-export_modules-v2-1-b59b6fad413a@suse.cz>

On Fri, Jul 11, 2025 at 04:05:16PM +0200, Vlastimil Babka wrote:
> Christoph suggested that the explicit _GPL_ can be dropped from the
> module namespace export macro, as it's intended for in-tree modules
> only. It would be possible to resrict it technically, but it was pointed
> out [2] that some cases of using an out-of-tree build of an in-tree
> module with the same name are legitimate. But in that case those also
> have to be GPL anyway so it's unnecessary to spell it out.
> 
> Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
> Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Reviewed-by: Shivank Garg <shivankg@amd.com>
> Acked-by: Christian Brauner <brauner@kernel.org>
> Acked-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
> part to avoid controversy converting selected existing EXPORT_SYMBOL().

Thank you!
Reviewed-by: Christian Brauner <brauner@kernel.org>

Am I supposed to take this or how's that going to work?

> Christoph argued [2] that the _FOR_MODULES() export is intended for
> in-tree modules and thus GPL is implied anyway and can be simply dropped
> from the export macro name. Peter agreed [3] about the intention for
> in-tree modules only, although nothing currently enforces it.
> 
> It seemed straightforward to add this enforcement, so v1 did that. But
> there were concerns of breaking the (apparently legitimate) usecases of
> loading an updated/development out of tree built version of an in-tree
> module.
> 
> So leave out the enforcement part and just drop the _GPL_ from the
> export macro name and so we're left with EXPORT_SYMBOL_FOR_MODULES()
> only. Any in-tree module used in an out-of-tree way will have to be GPL
> anyway by definition.
> 
> Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
> in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
> 8250: export RSA functions"). Hopefully it's resolvable by a merge
> commit fixup and we don't need to provide a temporary alias.
> 
> [1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
> [2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
> [3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
> ---

^ permalink raw reply

* Re: [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Vlastimil Babka @ 2025-07-14  7:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Daniel Gomez
  Cc: Matthias Maennich, Jonathan Corbet, Luis Chamberlain, Petr Pavlu,
	Sami Tolvanen, Daniel Gomez, Masahiro Yamada, Nathan Chancellor,
	Nicolas Schier, Alexander Viro, Christian Brauner, Jan Kara,
	Christoph Hellwig, Peter Zijlstra, David Hildenbrand,
	Shivank Garg, Jiri Slaby (SUSE), Stephen Rothwell, linux-doc,
	linux-kernel, linux-modules, linux-kbuild, linux-fsdevel
In-Reply-To: <2025071355-debunk-sprang-e1ad@gregkh>

On 7/13/25 10:31, Greg Kroah-Hartman wrote:
> On Sat, Jul 12, 2025 at 08:26:17PM +0200, Daniel Gomez wrote:
>> On 11/07/2025 16.05, Vlastimil Babka wrote:
>> > Changes in v2:
>> > - drop the patch to restrict module namespace export for in-tree modules
>> > - fix a pre-existing documentation typo (Nicolas Schier)
>> > - Link to v1: https://patch.msgid.link/20250708-export_modules-v1-0-fbf7a282d23f@suse.cz
>> > ---
>> >  Documentation/core-api/symbol-namespaces.rst | 8 ++++----
>> >  fs/anon_inodes.c                             | 2 +-
>> >  include/linux/export.h                       | 2 +-
>> >  3 files changed, 6 insertions(+), 6 deletions(-)
>> > 
>> > diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
>> > index 32fc73dc5529e8844c2ce2580987155bcd13cd09..6f7f4f47d43cdeb3b5008c795d254ca2661d39a6 100644
>> > --- a/Documentation/core-api/symbol-namespaces.rst
>> > +++ b/Documentation/core-api/symbol-namespaces.rst
>> > @@ -76,8 +76,8 @@ A second option to define the default namespace is directly in the compilation
>> >  within the corresponding compilation unit before the #include for
>> >  <linux/export.h>. Typically it's placed before the first #include statement.
>> >  
>> > -Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
>> > ------------------------------------------------
>> > +Using the EXPORT_SYMBOL_FOR_MODULES() macro
>> > +-------------------------------------------
>> >  
>> >  Symbols exported using this macro are put into a module namespace. This
>> >  namespace cannot be imported.
>> 
>> The new naming makes sense, but it breaks the pattern with _GPL suffix:
>> 
>> * EXPORT_SYMBOL(sym)
>> * EXPORT_SYMBOL_GPL(sym)
>> * EXPORT_SYMBOL_NS(sym, ns)
>> * EXPORT_SYMBOL_NS_GPL(sym, ns)
>> * EXPORT_SYMBOL_FOR_MODULES(sym, mods)
>> 
>> So I think when reading this one may forget about the _obvious_ reason. That's
>> why I think clarifying that in the documentation would be great. Something like:
>> 
>> Symbols exported using this macro are put into a module namespace. This
>> namespace cannot be imported. And it's implicitly GPL-only as it's only intended
>> for in-tree modules.
> 
> s/implicitly/explicitly/

From the point of the macro name,
it was explicit with "EXPORT_SYMBOL_GPL_FOR_MODULES()"
it's implicit with "EXPORT_SYMBOL_FOR_MODULES()"

> thanks,
> 
> greg k-h


^ permalink raw reply

* Re: [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Greg Kroah-Hartman @ 2025-07-13  8:31 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Vlastimil Babka, Matthias Maennich, Jonathan Corbet,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Alexander Viro, Christian Brauner, Jan Kara, Christoph Hellwig,
	Peter Zijlstra, David Hildenbrand, Shivank Garg,
	Jiri Slaby (SUSE), Stephen Rothwell, linux-doc, linux-kernel,
	linux-modules, linux-kbuild, linux-fsdevel
In-Reply-To: <b9b74600-4467-4c76-aa41-0a36b1cce1f4@kernel.org>

On Sat, Jul 12, 2025 at 08:26:17PM +0200, Daniel Gomez wrote:
> On 11/07/2025 16.05, Vlastimil Babka wrote:
> > Christoph suggested that the explicit _GPL_ can be dropped from the
> > module namespace export macro, as it's intended for in-tree modules
> > only. It would be possible to resrict it technically, but it was pointed
> > out [2] that some cases of using an out-of-tree build of an in-tree
> > module with the same name are legitimate. But in that case those also
> > have to be GPL anyway so it's unnecessary to spell it out.
> > 
> > Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
> > Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
> > Suggested-by: Christoph Hellwig <hch@infradead.org>
> > Reviewed-by: Shivank Garg <shivankg@amd.com>
> > Acked-by: Christian Brauner <brauner@kernel.org>
> > Acked-by: David Hildenbrand <david@redhat.com>
> > Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> > ---
> > Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
> > part to avoid controversy converting selected existing EXPORT_SYMBOL().
> > Christoph argued [2] that the _FOR_MODULES() export is intended for
> > in-tree modules and thus GPL is implied anyway and can be simply dropped
> > from the export macro name. Peter agreed [3] about the intention for
> > in-tree modules only, although nothing currently enforces it.
> > 
> > It seemed straightforward to add this enforcement, so v1 did that. But
> > there were concerns of breaking the (apparently legitimate) usecases of
> > loading an updated/development out of tree built version of an in-tree
> > module.
> > 
> > So leave out the enforcement part and just drop the _GPL_ from the
> > export macro name and so we're left with EXPORT_SYMBOL_FOR_MODULES()
> > only. Any in-tree module used in an out-of-tree way will have to be GPL
> > anyway by definition.
> > 
> > Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
> > in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
> > 8250: export RSA functions"). Hopefully it's resolvable by a merge
> > commit fixup and we don't need to provide a temporary alias.
> > 
> > [1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
> > [2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
> > [3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
> > ---
> > Changes in v2:
> > - drop the patch to restrict module namespace export for in-tree modules
> > - fix a pre-existing documentation typo (Nicolas Schier)
> > - Link to v1: https://patch.msgid.link/20250708-export_modules-v1-0-fbf7a282d23f@suse.cz
> > ---
> >  Documentation/core-api/symbol-namespaces.rst | 8 ++++----
> >  fs/anon_inodes.c                             | 2 +-
> >  include/linux/export.h                       | 2 +-
> >  3 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
> > index 32fc73dc5529e8844c2ce2580987155bcd13cd09..6f7f4f47d43cdeb3b5008c795d254ca2661d39a6 100644
> > --- a/Documentation/core-api/symbol-namespaces.rst
> > +++ b/Documentation/core-api/symbol-namespaces.rst
> > @@ -76,8 +76,8 @@ A second option to define the default namespace is directly in the compilation
> >  within the corresponding compilation unit before the #include for
> >  <linux/export.h>. Typically it's placed before the first #include statement.
> >  
> > -Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
> > ------------------------------------------------
> > +Using the EXPORT_SYMBOL_FOR_MODULES() macro
> > +-------------------------------------------
> >  
> >  Symbols exported using this macro are put into a module namespace. This
> >  namespace cannot be imported.
> 
> The new naming makes sense, but it breaks the pattern with _GPL suffix:
> 
> * EXPORT_SYMBOL(sym)
> * EXPORT_SYMBOL_GPL(sym)
> * EXPORT_SYMBOL_NS(sym, ns)
> * EXPORT_SYMBOL_NS_GPL(sym, ns)
> * EXPORT_SYMBOL_FOR_MODULES(sym, mods)
> 
> So I think when reading this one may forget about the _obvious_ reason. That's
> why I think clarifying that in the documentation would be great. Something like:
> 
> Symbols exported using this macro are put into a module namespace. This
> namespace cannot be imported. And it's implicitly GPL-only as it's only intended
> for in-tree modules.

s/implicitly/explicitly/

thanks,

greg k-h

^ permalink raw reply

* [PATCH v3 8/8] x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

For the most part ftrace uses text poking and can handle ROX memory.
The only place that requires writable memory is create_trampoline() that
updates the allocated memory and in the end makes it ROX.

Use execmem_alloc_rw() in x86::ftrace::alloc_tramp() and enable ROX cache
for EXECMEM_FTRACE when configuration and CPU features allow that.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/x86/kernel/ftrace.c | 2 +-
 arch/x86/mm/init.c       | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 252e82bcfd2f..4450acec9390 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -263,7 +263,7 @@ void arch_ftrace_update_code(int command)
 
 static inline void *alloc_tramp(unsigned long size)
 {
-	return execmem_alloc(EXECMEM_FTRACE, size);
+	return execmem_alloc_rw(EXECMEM_FTRACE, size);
 }
 static inline void tramp_free(void *tramp)
 {
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 442fafd8ff52..bb57e93b4caf 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1105,7 +1105,14 @@ struct execmem_info __init *execmem_arch_setup(void)
 				.pgprot	= PAGE_KERNEL_ROX,
 				.alignment = MODULE_ALIGN,
 			},
-			[EXECMEM_FTRACE ... EXECMEM_BPF] = {
+			[EXECMEM_FTRACE] = {
+				.flags	= flags,
+				.start	= start,
+				.end	= MODULES_END,
+				.pgprot	= pgprot,
+				.alignment = MODULE_ALIGN,
+			},
+			[EXECMEM_BPF] = {
 				.flags	= EXECMEM_KASAN_SHADOW,
 				.start	= start,
 				.end	= MODULES_END,
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 7/8] x86/kprobes: enable EXECMEM_ROX_CACHE for kprobes allocations
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

x86::alloc_insn_page() always allocates ROX memory.

Instead of overriding this method, add EXECMEM_KPROBES entry in
execmem_info with pgprot set to PAGE_KERNEL_ROX and  use ROX cache when
configuration and CPU features allow it.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/x86/kernel/kprobes/core.c | 18 ------------------
 arch/x86/mm/init.c             |  9 ++++++++-
 2 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 47cb8eb138ba..6079d15dab8c 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -481,24 +481,6 @@ static int prepare_singlestep(kprobe_opcode_t *buf, struct kprobe *p,
 	return len;
 }
 
-/* Make page to RO mode when allocate it */
-void *alloc_insn_page(void)
-{
-	void *page;
-
-	page = execmem_alloc(EXECMEM_KPROBES, PAGE_SIZE);
-	if (!page)
-		return NULL;
-
-	/*
-	 * TODO: Once additional kernel code protection mechanisms are set, ensure
-	 * that the page was not maliciously altered and it is still zeroed.
-	 */
-	set_memory_rox((unsigned long)page, 1);
-
-	return page;
-}
-
 /* Kprobe x86 instruction emulation - only regs->ip or IF flag modifiers */
 
 static void kprobe_emulate_ifmodifiers(struct kprobe *p, struct pt_regs *regs)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index dbc63f0d538f..442fafd8ff52 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1098,7 +1098,14 @@ struct execmem_info __init *execmem_arch_setup(void)
 				.pgprot	= pgprot,
 				.alignment = MODULE_ALIGN,
 			},
-			[EXECMEM_KPROBES ... EXECMEM_BPF] = {
+			[EXECMEM_KPROBES] = {
+				.flags	= flags,
+				.start	= start,
+				.end	= MODULES_END,
+				.pgprot	= PAGE_KERNEL_ROX,
+				.alignment = MODULE_ALIGN,
+			},
+			[EXECMEM_FTRACE ... EXECMEM_BPF] = {
 				.flags	= EXECMEM_KASAN_SHADOW,
 				.start	= start,
 				.end	= MODULES_END,
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 6/8] execmem: drop writable parameter from execmem_fill_trapping_insns()
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

After update of execmem_cache_free() that made memory writable before
updating it, there is no need to update read only memory, so the writable
parameter to execmem_fill_trapping_insns() is not needed. Drop it.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/x86/mm/init.c      | 8 ++------
 include/linux/execmem.h | 3 +--
 mm/execmem.c            | 4 ++--
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 7456df985d96..dbc63f0d538f 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1063,13 +1063,9 @@ unsigned long arch_max_swapfile_size(void)
 static struct execmem_info execmem_info __ro_after_init;
 
 #ifdef CONFIG_ARCH_HAS_EXECMEM_ROX
-void execmem_fill_trapping_insns(void *ptr, size_t size, bool writeable)
+void execmem_fill_trapping_insns(void *ptr, size_t size)
 {
-	/* fill memory with INT3 instructions */
-	if (writeable)
-		memset(ptr, INT3_INSN_OPCODE, size);
-	else
-		text_poke_set(ptr, INT3_INSN_OPCODE, size);
+	memset(ptr, INT3_INSN_OPCODE, size);
 }
 #endif
 
diff --git a/include/linux/execmem.h b/include/linux/execmem.h
index 8b61b05da7d5..7de229134e30 100644
--- a/include/linux/execmem.h
+++ b/include/linux/execmem.h
@@ -60,12 +60,11 @@ enum execmem_range_flags {
  *				 will trap
  * @ptr:	pointer to memory to fill
  * @size:	size of the range to fill
- * @writable:	is the memory poited by @ptr is writable or ROX
  *
  * A hook for architecures to fill execmem ranges with invalid instructions.
  * Architectures that use EXECMEM_ROX_CACHE must implement this.
  */
-void execmem_fill_trapping_insns(void *ptr, size_t size, bool writable);
+void execmem_fill_trapping_insns(void *ptr, size_t size);
 
 /**
  * execmem_restore_rox - restore read-only-execute permissions
diff --git a/mm/execmem.c b/mm/execmem.c
index 04c35c3a9361..0822305413ec 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -304,7 +304,7 @@ static int execmem_cache_populate(struct execmem_range *range, size_t size)
 		goto err_free_mem;
 
 	/* fill memory with instructions that will trap */
-	execmem_fill_trapping_insns(p, alloc_size, /* writable = */ true);
+	execmem_fill_trapping_insns(p, alloc_size);
 
 	err = set_memory_rox((unsigned long)p, vm->nr_pages);
 	if (err)
@@ -363,7 +363,7 @@ static int __execmem_cache_free(struct ma_state *mas, void *ptr, gfp_t gfp_mask)
 	if (err)
 		return err;
 
-	execmem_fill_trapping_insns(ptr, size, /* writable = */ true);
+	execmem_fill_trapping_insns(ptr, size);
 	execmem_restore_rox(ptr, size);
 
 	err = execmem_cache_add_locked(ptr, size, gfp_mask);
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 5/8] execmem: add fallback for failures in vmalloc(VM_ALLOW_HUGE_VMAP)
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

When execmem populates ROX cache it uses vmalloc(VM_ALLOW_HUGE_VMAP).
Although vmalloc falls back to allocating base pages if high order
allocation fails, it may happen that it still cannot allocate enough
memory.

Right now ROX cache is only used by modules and in majority of cases the
allocations happen at boot time when there's plenty of free memory, but
upcoming enabling ROX cache for ftrace and kprobes would mean that execmem
allocations can happen when the system is under memory pressure and a
failure to allocate large page worth of memory becomes more likely.

Fallback to regular vmalloc() if vmalloc(VM_ALLOW_HUGE_VMAP) fails.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 mm/execmem.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/execmem.c b/mm/execmem.c
index 056d3caaf4a1..04c35c3a9361 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -291,6 +291,11 @@ static int execmem_cache_populate(struct execmem_range *range, size_t size)
 
 	alloc_size = round_up(size, PMD_SIZE);
 	p = execmem_vmalloc(range, alloc_size, PAGE_KERNEL, vm_flags);
+	if (!p) {
+		alloc_size = size;
+		p = execmem_vmalloc(range, alloc_size, PAGE_KERNEL, vm_flags);
+	}
+
 	if (!p)
 		return err;
 
@@ -462,7 +467,7 @@ void *execmem_alloc(enum execmem_type type, size_t size)
 	bool use_cache = range->flags & EXECMEM_ROX_CACHE;
 	unsigned long vm_flags = VM_FLUSH_RESET_PERMS;
 	pgprot_t pgprot = range->pgprot;
-	void *p;
+	void *p = NULL;
 
 	size = PAGE_ALIGN(size);
 
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 4/8] execmem: move execmem_force_rw() and execmem_restore_rox() before use
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

to avoid static declarations.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 mm/execmem.c | 44 +++++++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/mm/execmem.c b/mm/execmem.c
index 4670e97f8e4e..056d3caaf4a1 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -137,6 +137,27 @@ static int execmem_set_direct_map_valid(struct vm_struct *vm, bool valid)
 	return err;
 }
 
+static int execmem_force_rw(void *ptr, size_t size)
+{
+	unsigned int nr = PAGE_ALIGN(size) >> PAGE_SHIFT;
+	unsigned long addr = (unsigned long)ptr;
+	int ret;
+
+	ret = set_memory_nx(addr, nr);
+	if (ret)
+		return ret;
+
+	return set_memory_rw(addr, nr);
+}
+
+int execmem_restore_rox(void *ptr, size_t size)
+{
+	unsigned int nr = PAGE_ALIGN(size) >> PAGE_SHIFT;
+	unsigned long addr = (unsigned long)ptr;
+
+	return set_memory_rox(addr, nr);
+}
+
 static void execmem_cache_clean(struct work_struct *work)
 {
 	struct maple_tree *free_areas = &execmem_cache.free_areas;
@@ -328,8 +349,6 @@ static inline void *pending_free_clear(void *ptr)
 	return (void *)((unsigned long)ptr & ~PENDING_FREE_MASK);
 }
 
-static int execmem_force_rw(void *ptr, size_t size);
-
 static int __execmem_cache_free(struct ma_state *mas, void *ptr, gfp_t gfp_mask)
 {
 	size_t size = mas_range_len(mas);
@@ -415,27 +434,6 @@ static bool execmem_cache_free(void *ptr)
 	return true;
 }
 
-static int execmem_force_rw(void *ptr, size_t size)
-{
-	unsigned int nr = PAGE_ALIGN(size) >> PAGE_SHIFT;
-	unsigned long addr = (unsigned long)ptr;
-	int ret;
-
-	ret = set_memory_nx(addr, nr);
-	if (ret)
-		return ret;
-
-	return set_memory_rw(addr, nr);
-}
-
-int execmem_restore_rox(void *ptr, size_t size)
-{
-	unsigned int nr = PAGE_ALIGN(size) >> PAGE_SHIFT;
-	unsigned long addr = (unsigned long)ptr;
-
-	return set_memory_rox(addr, nr);
-}
-
 #else /* CONFIG_ARCH_HAS_EXECMEM_ROX */
 /*
  * when ROX cache is not used the permissions defined by architectures for
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 3/8] execmem: rework execmem_cache_free()
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Currently execmem_cache_free() ignores potential allocation failures that
may happen in execmem_cache_add(). Besides, it uses text poking to fill the
memory with trapping instructions before returning it to cache although it
would be more efficient to make that memory writable, update it using
memcpy and then restore ROX protection.

Rework execmem_cache_free() so that in case of an error it will defer
freeing of the memory to a delayed work.

With this the happy fast path will now change permissions to RW, fill the
memory with trapping instructions using memcpy, restore ROX permissions,
add the memory back to the free cache and clear the relevant entry in
busy_areas.

If any step in the fast path fails, the entry in busy_areas will be marked
as pending_free. These entries will be handled by a delayed work and freed
asynchronously.

To make the fast path faster, use __GFP_NORETRY for memory allocations and
let asynchronous handler try harder with GFP_KERNEL.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 mm/execmem.c | 125 +++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 102 insertions(+), 23 deletions(-)

diff --git a/mm/execmem.c b/mm/execmem.c
index 6b040fbc5f4f..4670e97f8e4e 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -93,8 +93,15 @@ struct execmem_cache {
 	struct mutex mutex;
 	struct maple_tree busy_areas;
 	struct maple_tree free_areas;
+	unsigned int pending_free_cnt;	/* protected by mutex */
 };
 
+/* delay to schedule asynchronous free if fast path free fails */
+#define FREE_DELAY	(msecs_to_jiffies(10))
+
+/* mark entries in busy_areas that should be freed asynchronously */
+#define PENDING_FREE_MASK	(1 << (PAGE_SHIFT - 1))
+
 static struct execmem_cache execmem_cache = {
 	.mutex = __MUTEX_INITIALIZER(execmem_cache.mutex),
 	.busy_areas = MTREE_INIT_EXT(busy_areas, MT_FLAGS_LOCK_EXTERN,
@@ -155,20 +162,17 @@ static void execmem_cache_clean(struct work_struct *work)
 
 static DECLARE_WORK(execmem_cache_clean_work, execmem_cache_clean);
 
-static int execmem_cache_add(void *ptr, size_t size)
+static int execmem_cache_add_locked(void *ptr, size_t size, gfp_t gfp_mask)
 {
 	struct maple_tree *free_areas = &execmem_cache.free_areas;
-	struct mutex *mutex = &execmem_cache.mutex;
 	unsigned long addr = (unsigned long)ptr;
 	MA_STATE(mas, free_areas, addr - 1, addr + 1);
 	unsigned long lower, upper;
 	void *area = NULL;
-	int err;
 
 	lower = addr;
 	upper = addr + size - 1;
 
-	mutex_lock(mutex);
 	area = mas_walk(&mas);
 	if (area && mas.last == addr - 1)
 		lower = mas.index;
@@ -178,12 +182,14 @@ static int execmem_cache_add(void *ptr, size_t size)
 		upper = mas.last;
 
 	mas_set_range(&mas, lower, upper);
-	err = mas_store_gfp(&mas, (void *)lower, GFP_KERNEL);
-	mutex_unlock(mutex);
-	if (err)
-		return err;
+	return mas_store_gfp(&mas, (void *)lower, gfp_mask);
+}
 
-	return 0;
+static int execmem_cache_add(void *ptr, size_t size, gfp_t gfp_mask)
+{
+	guard(mutex)(&execmem_cache.mutex);
+
+	return execmem_cache_add_locked(ptr, size, gfp_mask);
 }
 
 static bool within_range(struct execmem_range *range, struct ma_state *mas,
@@ -278,7 +284,7 @@ static int execmem_cache_populate(struct execmem_range *range, size_t size)
 	if (err)
 		goto err_free_mem;
 
-	err = execmem_cache_add(p, alloc_size);
+	err = execmem_cache_add(p, alloc_size, GFP_KERNEL);
 	if (err)
 		goto err_reset_direct_map;
 
@@ -307,29 +313,102 @@ static void *execmem_cache_alloc(struct execmem_range *range, size_t size)
 	return __execmem_cache_alloc(range, size);
 }
 
+static inline bool is_pending_free(void *ptr)
+{
+	return ((unsigned long)ptr & PENDING_FREE_MASK);
+}
+
+static inline void *pending_free_set(void *ptr)
+{
+	return (void *)((unsigned long)ptr | PENDING_FREE_MASK);
+}
+
+static inline void *pending_free_clear(void *ptr)
+{
+	return (void *)((unsigned long)ptr & ~PENDING_FREE_MASK);
+}
+
+static int execmem_force_rw(void *ptr, size_t size);
+
+static int __execmem_cache_free(struct ma_state *mas, void *ptr, gfp_t gfp_mask)
+{
+	size_t size = mas_range_len(mas);
+	int err;
+
+	err = execmem_force_rw(ptr, size);
+	if (err)
+		return err;
+
+	execmem_fill_trapping_insns(ptr, size, /* writable = */ true);
+	execmem_restore_rox(ptr, size);
+
+	err = execmem_cache_add_locked(ptr, size, gfp_mask);
+	if (err)
+		return err;
+
+	mas_store_gfp(mas, NULL, gfp_mask);
+	return 0;
+}
+
+static void execmem_cache_free_slow(struct work_struct *work);
+static DECLARE_DELAYED_WORK(execmem_cache_free_work, execmem_cache_free_slow);
+
+static void execmem_cache_free_slow(struct work_struct *work)
+{
+	struct maple_tree *busy_areas = &execmem_cache.busy_areas;
+	MA_STATE(mas, busy_areas, 0, ULONG_MAX);
+	void *area;
+
+	guard(mutex)(&execmem_cache.mutex);
+
+	if (!execmem_cache.pending_free_cnt)
+		return;
+
+	mas_for_each(&mas, area, ULONG_MAX) {
+		if (!is_pending_free(area))
+			continue;
+
+		area = pending_free_clear(area);
+		if (__execmem_cache_free(&mas, area, GFP_KERNEL))
+			continue;
+
+		execmem_cache.pending_free_cnt--;
+	}
+
+	if (execmem_cache.pending_free_cnt)
+		schedule_delayed_work(&execmem_cache_free_work, FREE_DELAY);
+	else
+		schedule_work(&execmem_cache_clean_work);
+}
+
 static bool execmem_cache_free(void *ptr)
 {
 	struct maple_tree *busy_areas = &execmem_cache.busy_areas;
-	struct mutex *mutex = &execmem_cache.mutex;
 	unsigned long addr = (unsigned long)ptr;
 	MA_STATE(mas, busy_areas, addr, addr);
-	size_t size;
 	void *area;
+	int err;
+
+	guard(mutex)(&execmem_cache.mutex);
 
-	mutex_lock(mutex);
 	area = mas_walk(&mas);
-	if (!area) {
-		mutex_unlock(mutex);
+	if (!area)
 		return false;
-	}
-	size = mas_range_len(&mas);
 
-	mas_store_gfp(&mas, NULL, GFP_KERNEL);
-	mutex_unlock(mutex);
-
-	execmem_fill_trapping_insns(ptr, size, /* writable = */ false);
-
-	execmem_cache_add(ptr, size);
+	err = __execmem_cache_free(&mas, area, GFP_KERNEL | __GFP_NORETRY);
+	if (err) {
+		/*
+		 * mas points to exact slot we've got the area from, nothing
+		 * else can modify the tree because of the mutex, so there
+		 * won't be any allocations in mas_store_gfp() and it will just
+		 * change the pointer.
+		 */
+		area = pending_free_set(area);
+		mas_store_gfp(&mas, area, GFP_KERNEL);
+		execmem_cache.pending_free_cnt++;
+		schedule_delayed_work(&execmem_cache_free_work, FREE_DELAY);
+		return true;
+	}
 
 	schedule_work(&execmem_cache_clean_work);
 
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 2/8] execmem: introduce execmem_alloc_rw()
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Some callers of execmem_alloc() require the memory to be temporarily
writable even when it is allocated from ROX cache. These callers use
execemem_make_temp_rw() right after the call to execmem_alloc().

Wrap this sequence in execmem_alloc_rw() API.

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 arch/x86/kernel/alternative.c |  3 +--
 include/linux/execmem.h       | 38 ++++++++++++++++++++---------------
 kernel/module/main.c          | 13 ++----------
 mm/execmem.c                  | 27 ++++++++++++++++++++++++-
 4 files changed, 51 insertions(+), 30 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index ea1d984166cd..526a5fef93ab 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -120,7 +120,7 @@ struct its_array its_pages;
 
 static void *__its_alloc(struct its_array *pages)
 {
-	void *page __free(execmem) = execmem_alloc(EXECMEM_MODULE_TEXT, PAGE_SIZE);
+	void *page __free(execmem) = execmem_alloc_rw(EXECMEM_MODULE_TEXT, PAGE_SIZE);
 	if (!page)
 		return NULL;
 
@@ -237,7 +237,6 @@ static void *its_alloc(void)
 	if (!page)
 		return NULL;
 
-	execmem_make_temp_rw(page, PAGE_SIZE);
 	if (pages == &its_pages)
 		set_memory_x((unsigned long)page, 1);
 
diff --git a/include/linux/execmem.h b/include/linux/execmem.h
index 734fbe83d98e..8b61b05da7d5 100644
--- a/include/linux/execmem.h
+++ b/include/linux/execmem.h
@@ -67,21 +67,6 @@ enum execmem_range_flags {
  */
 void execmem_fill_trapping_insns(void *ptr, size_t size, bool writable);
 
-/**
- * execmem_make_temp_rw - temporarily remap region with read-write
- *			  permissions
- * @ptr:	address of the region to remap
- * @size:	size of the region to remap
- *
- * Remaps a part of the cached large page in the ROX cache in the range
- * [@ptr, @ptr + @size) as writable and not executable. The caller must
- * have exclusive ownership of this range and ensure nothing will try to
- * execute code in this range.
- *
- * Return: 0 on success or negative error code on failure.
- */
-int execmem_make_temp_rw(void *ptr, size_t size);
-
 /**
  * execmem_restore_rox - restore read-only-execute permissions
  * @ptr:	address of the region to remap
@@ -95,7 +80,6 @@ int execmem_make_temp_rw(void *ptr, size_t size);
  */
 int execmem_restore_rox(void *ptr, size_t size);
 #else
-static inline int execmem_make_temp_rw(void *ptr, size_t size) { return 0; }
 static inline int execmem_restore_rox(void *ptr, size_t size) { return 0; }
 #endif
 
@@ -165,6 +149,28 @@ struct execmem_info *execmem_arch_setup(void);
  */
 void *execmem_alloc(enum execmem_type type, size_t size);
 
+/**
+ * execmem_alloc_rw - allocate writable executable memory
+ * @type: type of the allocation
+ * @size: how many bytes of memory are required
+ *
+ * Allocates memory that will contain executable code, either generated or
+ * loaded from kernel modules.
+ *
+ * Allocates memory that will contain data coupled with executable code,
+ * like data sections in kernel modules.
+ *
+ * Forces writable permissions on the allocated memory and the caller is
+ * responsible to manage the permissions afterwards.
+ *
+ * For architectures that use ROX cache the permissions will be set to R+W.
+ * For architectures that don't use ROX cache the default permissions for @type
+ * will be used as they must be writable.
+ *
+ * Return: a pointer to the allocated memory or %NULL
+ */
+void *execmem_alloc_rw(enum execmem_type type, size_t size);
+
 /**
  * execmem_free - free executable memory
  * @ptr: pointer to the memory that should be freed
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 413ac6ea3702..d009326ef7bb 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1292,20 +1292,11 @@ static int module_memory_alloc(struct module *mod, enum mod_mem_type type)
 	else
 		execmem_type = EXECMEM_MODULE_TEXT;
 
-	ptr = execmem_alloc(execmem_type, size);
+	ptr = execmem_alloc_rw(execmem_type, size);
 	if (!ptr)
 		return -ENOMEM;
 
-	if (execmem_is_rox(execmem_type)) {
-		int err = execmem_make_temp_rw(ptr, size);
-
-		if (err) {
-			execmem_free(ptr);
-			return -ENOMEM;
-		}
-
-		mod->mem[type].is_rox = true;
-	}
+	mod->mem[type].is_rox = execmem_is_rox(execmem_type);
 
 	/*
 	 * The pointer to these blocks of memory are stored on the module
diff --git a/mm/execmem.c b/mm/execmem.c
index 0712ebb4eb77..6b040fbc5f4f 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -336,7 +336,7 @@ static bool execmem_cache_free(void *ptr)
 	return true;
 }
 
-int execmem_make_temp_rw(void *ptr, size_t size)
+static int execmem_force_rw(void *ptr, size_t size)
 {
 	unsigned int nr = PAGE_ALIGN(size) >> PAGE_SHIFT;
 	unsigned long addr = (unsigned long)ptr;
@@ -358,6 +358,16 @@ int execmem_restore_rox(void *ptr, size_t size)
 }
 
 #else /* CONFIG_ARCH_HAS_EXECMEM_ROX */
+/*
+ * when ROX cache is not used the permissions defined by architectures for
+ * execmem ranges that are updated before use (e.g. EXECMEM_MODULE_TEXT) must
+ * be writable anyway
+ */
+static inline int execmem_force_rw(void *ptr, size_t size)
+{
+	return 0;
+}
+
 static void *execmem_cache_alloc(struct execmem_range *range, size_t size)
 {
 	return NULL;
@@ -387,6 +397,21 @@ void *execmem_alloc(enum execmem_type type, size_t size)
 	return kasan_reset_tag(p);
 }
 
+void *execmem_alloc_rw(enum execmem_type type, size_t size)
+{
+	void *p __free(execmem) = execmem_alloc(type, size);
+	int err;
+
+	if (!p)
+		return NULL;
+
+	err = execmem_force_rw(p, size);
+	if (err)
+		return NULL;
+
+	return no_free_ptr(p);
+}
+
 void execmem_free(void *ptr)
 {
 	/*
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 1/8] execmem: drop unused execmem_update_copy()
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <20250713071730.4117334-1-rppt@kernel.org>

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

The execmem_update_copy() that used text poking was required when memory
allocated from ROX cache was always read-only. Since now its permissions
can be switched to read-write there is no need in a function that updates
memory with text poking.

Remove it.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 include/linux/execmem.h | 13 -------------
 mm/execmem.c            |  5 -----
 2 files changed, 18 deletions(-)

diff --git a/include/linux/execmem.h b/include/linux/execmem.h
index 3be35680a54f..734fbe83d98e 100644
--- a/include/linux/execmem.h
+++ b/include/linux/execmem.h
@@ -185,19 +185,6 @@ DEFINE_FREE(execmem, void *, if (_T) execmem_free(_T));
 struct vm_struct *execmem_vmap(size_t size);
 #endif
 
-/**
- * execmem_update_copy - copy an update to executable memory
- * @dst:  destination address to update
- * @src:  source address containing the data
- * @size: how many bytes of memory shold be copied
- *
- * Copy @size bytes from @src to @dst using text poking if the memory at
- * @dst is read-only.
- *
- * Return: a pointer to @dst or NULL on error
- */
-void *execmem_update_copy(void *dst, const void *src, size_t size);
-
 /**
  * execmem_is_rox - check if execmem is read-only
  * @type - the execmem type to check
diff --git a/mm/execmem.c b/mm/execmem.c
index 2b683e7d864d..0712ebb4eb77 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -399,11 +399,6 @@ void execmem_free(void *ptr)
 		vfree(ptr);
 }
 
-void *execmem_update_copy(void *dst, const void *src, size_t size)
-{
-	return text_poke_copy(dst, src, size);
-}
-
 bool execmem_is_rox(enum execmem_type type)
 {
 	return !!(execmem_info->ranges[type].flags & EXECMEM_ROX_CACHE);
-- 
2.47.2


^ permalink raw reply related

* [PATCH v3 0/8] x86: enable EXECMEM_ROX_CACHE for ftrace and kprobes
From: Mike Rapoport @ 2025-07-13  7:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, Mike Rapoport, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Hi,

These patches enable use of EXECMEM_ROX_CACHE for ftrace and kprobes
allocations on x86.

They also include some ground work in execmem.

Since the execmem model for caching large ROX pages changed from the
initial assumption that the memory that is allocated from ROX cache is
always ROX to the current state where memory can be temporarily made RW and
then restored to ROX, we can stop using text poking to update it. This also
saves the hassle of trying lock text_mutex in execmem_cache_free() when
kprobes already hold that mutex.

The patches 1-6 update and cleanup execmem ROX cache management,
patch 7 enables EXECMEM_ROX_CACHE for kprobes and
patch 8 enables EXECMEM_ROX_CACHE for frace.

The patches are also available at git:

https://git.kernel.org/rppt/h/execmem/x86-rox/ftrace%2bkprobes/v3

v3:
* Fix spelling (Petr)
* Add ack and review tags, thanks all!

v2: https://lore.kernel.org/all/20250709134933.3848895-1-rppt@kernel.org
* Fix setting and clearing pending_free for an area (Yann)
* Reorder execmem_cache_free() to avoid error goto (Peter)
* Add comment why mas_store_gfp() cannot fail in execmem_cache_free() (Peter)


Mike Rapoport (Microsoft) (8):
  execmem: drop unused execmem_update_copy()
  execmem: introduce execmem_alloc_rw()
  execmem: rework execmem_cache_free()
  execmem: move execmem_force_rw() and execmem_restore_rox() before use
  execmem: add fallback for failures in vmalloc(VM_ALLOW_HUGE_VMAP)
  execmem: drop writable parameter from execmem_fill_trapping_insns()
  x86/kprobes: enable EXECMEM_ROX_CACHE for kprobes allocations
  x86/ftrace: enable EXECMEM_ROX_CACHE for ftrace allocations

 arch/x86/kernel/alternative.c  |   3 +-
 arch/x86/kernel/ftrace.c       |   2 +-
 arch/x86/kernel/kprobes/core.c |  18 ---
 arch/x86/mm/init.c             |  24 ++--
 include/linux/execmem.h        |  54 ++++-----
 kernel/module/main.c           |  13 +--
 mm/execmem.c                   | 198 +++++++++++++++++++++++++--------
 7 files changed, 194 insertions(+), 118 deletions(-)


base-commit: 86731a2a651e58953fc949573895f2fa6d456841
--
2.47.2

^ permalink raw reply

* Re: [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Daniel Gomez @ 2025-07-12 18:26 UTC (permalink / raw)
  To: Vlastimil Babka, Matthias Maennich, Jonathan Corbet,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Alexander Viro, Christian Brauner, Jan Kara
  Cc: Christoph Hellwig, Peter Zijlstra, David Hildenbrand,
	Shivank Garg, Greg Kroah-Hartman, Jiri Slaby (SUSE),
	Stephen Rothwell, linux-doc, linux-kernel, linux-modules,
	linux-kbuild, linux-fsdevel
In-Reply-To: <20250711-export_modules-v2-1-b59b6fad413a@suse.cz>

On 11/07/2025 16.05, Vlastimil Babka wrote:
> Christoph suggested that the explicit _GPL_ can be dropped from the
> module namespace export macro, as it's intended for in-tree modules
> only. It would be possible to resrict it technically, but it was pointed
> out [2] that some cases of using an out-of-tree build of an in-tree
> module with the same name are legitimate. But in that case those also
> have to be GPL anyway so it's unnecessary to spell it out.
> 
> Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
> Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Reviewed-by: Shivank Garg <shivankg@amd.com>
> Acked-by: Christian Brauner <brauner@kernel.org>
> Acked-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
> part to avoid controversy converting selected existing EXPORT_SYMBOL().
> Christoph argued [2] that the _FOR_MODULES() export is intended for
> in-tree modules and thus GPL is implied anyway and can be simply dropped
> from the export macro name. Peter agreed [3] about the intention for
> in-tree modules only, although nothing currently enforces it.
> 
> It seemed straightforward to add this enforcement, so v1 did that. But
> there were concerns of breaking the (apparently legitimate) usecases of
> loading an updated/development out of tree built version of an in-tree
> module.
> 
> So leave out the enforcement part and just drop the _GPL_ from the
> export macro name and so we're left with EXPORT_SYMBOL_FOR_MODULES()
> only. Any in-tree module used in an out-of-tree way will have to be GPL
> anyway by definition.
> 
> Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
> in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
> 8250: export RSA functions"). Hopefully it's resolvable by a merge
> commit fixup and we don't need to provide a temporary alias.
> 
> [1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
> [2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
> [3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
> ---
> Changes in v2:
> - drop the patch to restrict module namespace export for in-tree modules
> - fix a pre-existing documentation typo (Nicolas Schier)
> - Link to v1: https://patch.msgid.link/20250708-export_modules-v1-0-fbf7a282d23f@suse.cz
> ---
>  Documentation/core-api/symbol-namespaces.rst | 8 ++++----
>  fs/anon_inodes.c                             | 2 +-
>  include/linux/export.h                       | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
> index 32fc73dc5529e8844c2ce2580987155bcd13cd09..6f7f4f47d43cdeb3b5008c795d254ca2661d39a6 100644
> --- a/Documentation/core-api/symbol-namespaces.rst
> +++ b/Documentation/core-api/symbol-namespaces.rst
> @@ -76,8 +76,8 @@ A second option to define the default namespace is directly in the compilation
>  within the corresponding compilation unit before the #include for
>  <linux/export.h>. Typically it's placed before the first #include statement.
>  
> -Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
> ------------------------------------------------
> +Using the EXPORT_SYMBOL_FOR_MODULES() macro
> +-------------------------------------------
>  
>  Symbols exported using this macro are put into a module namespace. This
>  namespace cannot be imported.

The new naming makes sense, but it breaks the pattern with _GPL suffix:

* EXPORT_SYMBOL(sym)
* EXPORT_SYMBOL_GPL(sym)
* EXPORT_SYMBOL_NS(sym, ns)
* EXPORT_SYMBOL_NS_GPL(sym, ns)
* EXPORT_SYMBOL_FOR_MODULES(sym, mods)

So I think when reading this one may forget about the _obvious_ reason. That's
why I think clarifying that in the documentation would be great. Something like:

Symbols exported using this macro are put into a module namespace. This
namespace cannot be imported. And it's implicitly GPL-only as it's only intended
for in-tree modules.

Other than that, it looks good.

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

^ permalink raw reply

* Re: [PATCH v2 2/8] execmem: introduce execmem_alloc_rw()
From: Mike Rapoport @ 2025-07-12 10:41 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Andrew Morton, Andy Lutomirski, Borislav Petkov, Christophe Leroy,
	Daniel Gomez, Dave Hansen, Ingo Molnar, Liam R. Howlett,
	Luis Chamberlain, Mark Rutland, Masami Hiramatsu, H. Peter Anvin,
	Peter Zijlstra, Petr Pavlu, Sami Tolvanen, Steven Rostedt,
	Thomas Gleixner, Yann Ylavic, linux-kernel, linux-mm,
	linux-modules, linux-trace-kernel, x86
In-Reply-To: <784081fa-0fee-4df6-b8d5-6435eead877f@kernel.org>

On Fri, Jul 11, 2025 at 04:29:48PM +0200, Daniel Gomez wrote:
> On 09/07/2025 15.49, Mike Rapoport wrote:
> > From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> > 
> > Some callers of execmem_alloc() require the memory to be temporarily
> > writable even when it is allocated from ROX cache. These callers use
> > execemem_make_temp_rw() right after the call to execmem_alloc().
> > 
> > Wrap this sequence in execmem_alloc_rw() API.
> > 
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> 
> Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
> 
> > ---
> > diff --git a/mm/execmem.c b/mm/execmem.c
> > index 0712ebb4eb77..6b040fbc5f4f 100644
> > --- a/mm/execmem.c
> > +++ b/mm/execmem.c
> 
> {...}
> 
> > @@ -387,6 +397,21 @@ void *execmem_alloc(enum execmem_type type, size_t size)
> >  	return kasan_reset_tag(p);
> >  }
> >  
> > +void *execmem_alloc_rw(enum execmem_type type, size_t size)
> > +{
> > +	void *p __free(execmem) = execmem_alloc(type, size);
> > +	int err;
> > +
> > +	if (!p)
> > +		return NULL;
> > +
> > +	err = execmem_force_rw(p, size);
> > +	if (err)
> > +		return NULL;
> 
> You don't need to save the error here. That, allows err declaration to be
> dropped.

I prefer to keep err = ... It's more explicit and clear this way.

-- 
Sincerely yours,
Mike.

^ permalink raw reply

* Re: [PATCH 0/2] Restrict module namespace to in-tree modules and rename macro
From: David Laight @ 2025-07-11 17:16 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Vlastimil Babka, Matthias Maennich, Jonathan Corbet,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Alexander Viro, Jan Kara, Christoph Hellwig, Peter Zijlstra,
	David Hildenbrand, Shivank Garg, Jiri Slaby (SUSE),
	Stephen Rothwell, linux-doc, linux-kernel, linux-modules,
	linux-kbuild, linux-fsdevel
In-Reply-To: <20250708-merkmal-erhitzen-23e7e9daa150@brauner>

On Tue, 8 Jul 2025 09:40:37 +0200
Christian Brauner <brauner@kernel.org> wrote:

> On Tue, Jul 08, 2025 at 09:28:56AM +0200, Vlastimil Babka wrote:
> > Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
> > part to avoid controversy converting selected existing EXPORT_SYMBOL().
> > Christoph argued [2] that the _FOR_MODULES() export is intended for
> > in-tree modules and thus GPL is implied anyway and can be simply dropped
> > from the export macro name. Peter agreed [3] about the intention for
> > in-tree modules only, although nothing currently enforces it.
> > 
> > It seems straightforward to add this enforcement, so patch 1 does that.
> > Patch 2 then drops the _GPL_ from the name and so we're left with
> > EXPORT_SYMBOL_FOR_MODULES() restricted to in-tree modules only.

Bikeshedding somewhat, isn't that a silly name.
All EXPORT_SYMBOL are 'for modules'.
Wouldn't something like EXPORT_SYMBOL_IN_TREE be more descriptive.

	David

> > 
> > Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
> > in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
> > 8250: export RSA functions"). Hopefully it's resolvable by a merge
> > commit fixup and we don't need to provide a temporary alias.
> > 
> > [1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
> > [2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
> > [3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
> > 
> > Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> > ---  
> 
> Love this. It'd be great to get this in as a bugfix,
> Acked-by: Christian Brauner <brauner@kernel.org>
> 


^ permalink raw reply

* Re: [PATCH v2 2/8] execmem: introduce execmem_alloc_rw()
From: Daniel Gomez @ 2025-07-11 14:29 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton
  Cc: Andy Lutomirski, Borislav Petkov, Christophe Leroy, Daniel Gomez,
	Dave Hansen, Ingo Molnar, Liam R. Howlett, Luis Chamberlain,
	Mark Rutland, Masami Hiramatsu, H. Peter Anvin, Peter Zijlstra,
	Petr Pavlu, Sami Tolvanen, Steven Rostedt, Thomas Gleixner,
	Yann Ylavic, linux-kernel, linux-mm, linux-modules,
	linux-trace-kernel, x86
In-Reply-To: <20250709134933.3848895-3-rppt@kernel.org>

On 09/07/2025 15.49, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> 
> Some callers of execmem_alloc() require the memory to be temporarily
> writable even when it is allocated from ROX cache. These callers use
> execemem_make_temp_rw() right after the call to execmem_alloc().
> 
> Wrap this sequence in execmem_alloc_rw() API.
> 
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

> ---
> diff --git a/mm/execmem.c b/mm/execmem.c
> index 0712ebb4eb77..6b040fbc5f4f 100644
> --- a/mm/execmem.c
> +++ b/mm/execmem.c

{...}

> @@ -387,6 +397,21 @@ void *execmem_alloc(enum execmem_type type, size_t size)
>  	return kasan_reset_tag(p);
>  }
>  
> +void *execmem_alloc_rw(enum execmem_type type, size_t size)
> +{
> +	void *p __free(execmem) = execmem_alloc(type, size);
> +	int err;
> +
> +	if (!p)
> +		return NULL;
> +
> +	err = execmem_force_rw(p, size);
> +	if (err)
> +		return NULL;

You don't need to save the error here. That, allows err declaration to be
dropped.

^ permalink raw reply

* Re: [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Nicolas Schier @ 2025-07-11 14:13 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Matthias Maennich, Jonathan Corbet, Luis Chamberlain, Petr Pavlu,
	Sami Tolvanen, Daniel Gomez, Masahiro Yamada, Nathan Chancellor,
	Alexander Viro, Christian Brauner, Jan Kara, Christoph Hellwig,
	Peter Zijlstra, David Hildenbrand, Shivank Garg,
	Greg Kroah-Hartman, Jiri Slaby (SUSE), Stephen Rothwell,
	linux-doc, linux-kernel, linux-modules, linux-kbuild,
	linux-fsdevel
In-Reply-To: <20250711-export_modules-v2-1-b59b6fad413a@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

On Fri, Jul 11, 2025 at 04:05:16PM +0200, Vlastimil Babka wrote:
> Christoph suggested that the explicit _GPL_ can be dropped from the
> module namespace export macro, as it's intended for in-tree modules
> only. It would be possible to resrict it technically, but it was pointed

s/resrict/restrict/

> out [2] that some cases of using an out-of-tree build of an in-tree
> module with the same name are legitimate. But in that case those also
> have to be GPL anyway so it's unnecessary to spell it out.
> 
> Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
> Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Reviewed-by: Shivank Garg <shivankg@amd.com>
> Acked-by: Christian Brauner <brauner@kernel.org>
> Acked-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---

Looks good to me, thanks!

Acked-by: Nicolas Schier <n.schier@avm.de>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH v2 0/3] module: make structure definitions always visible
From: Daniel Gomez @ 2025-07-11 14:06 UTC (permalink / raw)
  To: Thomas Weißschuh, Daniel Gomez
  Cc: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Brendan Higgins,
	David Gow, Rae Moar, linux-modules, linux-kernel, linux-kselftest,
	kunit-dev
In-Reply-To: <20250711155016-f403d5b2-478d-4666-913d-45318cdaa3cf@linutronix.de>

On 11/07/2025 15.51, Thomas WeiÃschuh wrote:
> On Fri, Jul 11, 2025 at 03:39:04PM +0200, Daniel Gomez wrote:
>>
>> On Fri, 11 Jul 2025 15:31:35 +0200, Thomas Weißschuh wrote:
>>> Code using IS_ENABLED(CONFIG_MODULES) as a C expression may need access
>>> to the module structure definitions to compile.
>>> Make sure these structure definitions are always visible.
>>>
>>> This will conflict with commit 6bb37af62634 ("module: Move modprobe_path
>>> and modules_disabled ctl_tables into the module subsys") from the sysctl
>>> tree, but the resolution is trivial.
>>>
>>> [...]
>>
>> Applied, thanks!
>>
>> [1/3] module: move 'struct module_use' to internal.h
>>       commit: bb02f22eaabc4d878577e2b8c46ed7b6be5f5459
>> [2/3] module: make structure definitions always visible
>>       commit: 02281b559cd1fdfdc8f7eb05bbbe3ab7b35246f0
>> [3/3] kunit: test: Drop CONFIG_MODULE ifdeffery
>>       commit: dffcba8acea3a80b3478750ac32f17bd5345b68e
> 
> Thanks!
> 
> FYI If you apply a patch you need to add yourself to the Signed-off-by chain.
> And Link tags are nice. For example:
> 
> b4 shazam --add-my-sob --add-link

You're correct. I had a lapse there. Branch updated. Thanks!

[1/3] module: move 'struct module_use' to internal.h
      commit: 6633d3a45a8c075193304d12ba10a1771d1dbf10
[2/3] module: make structure definitions always visible
      commit: a55842991352a8b512f40d1424b65c911ffbf6fa
[3/3] kunit: test: Drop CONFIG_MODULE ifdeffery
      commit: 699657e8e50ae967ae26f704f6fbfa598fcb0cef

^ permalink raw reply

* [PATCH v2] module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES
From: Vlastimil Babka @ 2025-07-11 14:05 UTC (permalink / raw)
  To: Matthias Maennich, Jonathan Corbet, Luis Chamberlain, Petr Pavlu,
	Sami Tolvanen, Daniel Gomez, Masahiro Yamada, Nathan Chancellor,
	Nicolas Schier, Alexander Viro, Christian Brauner, Jan Kara
  Cc: Christoph Hellwig, Peter Zijlstra, David Hildenbrand,
	Shivank Garg, Greg Kroah-Hartman, Jiri Slaby (SUSE),
	Stephen Rothwell, linux-doc, linux-kernel, linux-modules,
	linux-kbuild, linux-fsdevel, Vlastimil Babka

Christoph suggested that the explicit _GPL_ can be dropped from the
module namespace export macro, as it's intended for in-tree modules
only. It would be possible to resrict it technically, but it was pointed
out [2] that some cases of using an out-of-tree build of an in-tree
module with the same name are legitimate. But in that case those also
have to be GPL anyway so it's unnecessary to spell it out.

Link: https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/ [1]
Link: https://lore.kernel.org/all/CAK7LNATRkZHwJGpojCnvdiaoDnP%2BaeUXgdey5sb_8muzdWTMkA@mail.gmail.com/ [2]
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Shivank Garg <shivankg@amd.com>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
Christian asked [1] for EXPORT_SYMBOL_FOR_MODULES() without the _GPL_
part to avoid controversy converting selected existing EXPORT_SYMBOL().
Christoph argued [2] that the _FOR_MODULES() export is intended for
in-tree modules and thus GPL is implied anyway and can be simply dropped
from the export macro name. Peter agreed [3] about the intention for
in-tree modules only, although nothing currently enforces it.

It seemed straightforward to add this enforcement, so v1 did that. But
there were concerns of breaking the (apparently legitimate) usecases of
loading an updated/development out of tree built version of an in-tree
module.

So leave out the enforcement part and just drop the _GPL_ from the
export macro name and so we're left with EXPORT_SYMBOL_FOR_MODULES()
only. Any in-tree module used in an out-of-tree way will have to be GPL
anyway by definition.

Current -next has some new instances of EXPORT_SYMBOL_GPL_FOR_MODULES()
in drivers/tty/serial/8250/8250_rsa.c by commit b20d6576cdb3 ("serial:
8250: export RSA functions"). Hopefully it's resolvable by a merge
commit fixup and we don't need to provide a temporary alias.

[1] https://lore.kernel.org/all/20250623-warmwasser-giftig-ff656fce89ad@brauner/
[2] https://lore.kernel.org/all/aFleJN_fE-RbSoFD@infradead.org/
[3] https://lore.kernel.org/all/20250623142836.GT1613200@noisy.programming.kicks-ass.net/
---
Changes in v2:
- drop the patch to restrict module namespace export for in-tree modules
- fix a pre-existing documentation typo (Nicolas Schier)
- Link to v1: https://patch.msgid.link/20250708-export_modules-v1-0-fbf7a282d23f@suse.cz
---
 Documentation/core-api/symbol-namespaces.rst | 8 ++++----
 fs/anon_inodes.c                             | 2 +-
 include/linux/export.h                       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst
index 32fc73dc5529e8844c2ce2580987155bcd13cd09..6f7f4f47d43cdeb3b5008c795d254ca2661d39a6 100644
--- a/Documentation/core-api/symbol-namespaces.rst
+++ b/Documentation/core-api/symbol-namespaces.rst
@@ -76,8 +76,8 @@ A second option to define the default namespace is directly in the compilation
 within the corresponding compilation unit before the #include for
 <linux/export.h>. Typically it's placed before the first #include statement.
 
-Using the EXPORT_SYMBOL_GPL_FOR_MODULES() macro
------------------------------------------------
+Using the EXPORT_SYMBOL_FOR_MODULES() macro
+-------------------------------------------
 
 Symbols exported using this macro are put into a module namespace. This
 namespace cannot be imported.
@@ -87,9 +87,9 @@ modules to access this symbol. Simple tail-globs are supported.
 
 For example::
 
-  EXPORT_SYMBOL_GPL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
+  EXPORT_SYMBOL_FOR_MODULES(preempt_notifier_inc, "kvm,kvm-*")
 
-will limit usage of this symbol to modules whoes name matches the given
+will limit usage of this symbol to modules whose name matches the given
 patterns.
 
 How to use Symbols exported in Namespaces
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 1d847a939f29a41356af3f12e5f61372ec2fb550..180a458fc4f74249d674ec3c6e01277df1d9e743 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -129,7 +129,7 @@ struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *n
 	}
 	return inode;
 }
-EXPORT_SYMBOL_GPL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
+EXPORT_SYMBOL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
 
 static struct file *__anon_inode_getfile(const char *name,
 					 const struct file_operations *fops,
diff --git a/include/linux/export.h b/include/linux/export.h
index f35d03b4113b19798036d2993d67eb932ad8ce6f..a686fd0ba406509da5f397e3a415d05c5a051c0d 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -91,6 +91,6 @@
 #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", ns)
 #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "GPL", ns)
 
-#define EXPORT_SYMBOL_GPL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
+#define EXPORT_SYMBOL_FOR_MODULES(sym, mods) __EXPORT_SYMBOL(sym, "GPL", "module:" mods)
 
 #endif /* _LINUX_EXPORT_H */

---
base-commit: d7b8f8e20813f0179d8ef519541a3527e7661d3a
change-id: 20250708-export_modules-12908fa41006

Best regards,
-- 
Vlastimil Babka <vbabka@suse.cz>


^ permalink raw reply related

* Re: [PATCH v2 0/3] module: make structure definitions always visible
From: Thomas Weißschuh @ 2025-07-11 13:51 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Brendan Higgins,
	David Gow, Rae Moar, linux-modules, linux-kernel, linux-kselftest,
	kunit-dev
In-Reply-To: <175224114462.57001.15162198119283395382.b4-ty@samsung.com>

On Fri, Jul 11, 2025 at 03:39:04PM +0200, Daniel Gomez wrote:
> 
> On Fri, 11 Jul 2025 15:31:35 +0200, Thomas Weißschuh wrote:
> > Code using IS_ENABLED(CONFIG_MODULES) as a C expression may need access
> > to the module structure definitions to compile.
> > Make sure these structure definitions are always visible.
> > 
> > This will conflict with commit 6bb37af62634 ("module: Move modprobe_path
> > and modules_disabled ctl_tables into the module subsys") from the sysctl
> > tree, but the resolution is trivial.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/3] module: move 'struct module_use' to internal.h
>       commit: bb02f22eaabc4d878577e2b8c46ed7b6be5f5459
> [2/3] module: make structure definitions always visible
>       commit: 02281b559cd1fdfdc8f7eb05bbbe3ab7b35246f0
> [3/3] kunit: test: Drop CONFIG_MODULE ifdeffery
>       commit: dffcba8acea3a80b3478750ac32f17bd5345b68e

Thanks!

FYI If you apply a patch you need to add yourself to the Signed-off-by chain.
And Link tags are nice. For example:

b4 shazam --add-my-sob --add-link

^ permalink raw reply

* Re: [PATCH v2 0/3] module: make structure definitions always visible
From: Daniel Gomez @ 2025-07-11 13:39 UTC (permalink / raw)
  To: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Brendan Higgins,
	David Gow, Rae Moar, Thomas Weißschuh
  Cc: linux-modules, linux-kernel, linux-kselftest, kunit-dev
In-Reply-To: <20250711-kunit-ifdef-modules-v2-0-39443decb1f8@linutronix.de>


On Fri, 11 Jul 2025 15:31:35 +0200, Thomas Weißschuh wrote:
> Code using IS_ENABLED(CONFIG_MODULES) as a C expression may need access
> to the module structure definitions to compile.
> Make sure these structure definitions are always visible.
> 
> This will conflict with commit 6bb37af62634 ("module: Move modprobe_path
> and modules_disabled ctl_tables into the module subsys") from the sysctl
> tree, but the resolution is trivial.
> 
> [...]

Applied, thanks!

[1/3] module: move 'struct module_use' to internal.h
      commit: bb02f22eaabc4d878577e2b8c46ed7b6be5f5459
[2/3] module: make structure definitions always visible
      commit: 02281b559cd1fdfdc8f7eb05bbbe3ab7b35246f0
[3/3] kunit: test: Drop CONFIG_MODULE ifdeffery
      commit: dffcba8acea3a80b3478750ac32f17bd5345b68e

Best regards,
-- 
Daniel Gomez <da.gomez@samsung.com>


^ permalink raw reply


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