public inbox for linux-modules@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] scalable symbol flags with __kflagstab
@ 2025-11-03 16:19 Siddharth Nayyar
  2025-11-03 16:19 ` [PATCH v3 1/8] define kernel symbol flags Siddharth Nayyar
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Siddharth Nayyar @ 2025-11-03 16:19 UTC (permalink / raw)
  To: petr.pavlu, corbet
  Cc: arnd, linux-arch, linux-kbuild, linux-kernel, linux-modules,
	mcgrof, nathan, nicolas.schier, samitolvanen, sidnayyar, maennich,
	gprocida

This patch series implements a mechanism for scalable exported symbol
flags using a separate section called __kflagstab. The series introduces
__kflagstab support, removes *_gpl sections in favor of a GPL flag,
simplifies symbol resolution during module loading.

This series previously added symbol import protection which aims to
restrict the use of "protected symbol" exported by vmlinux, as a use
case for which __kflagstab is being introduced. Such symbols are only
allowed to be imported by signed modules when symbol protection is
enabled. This functionality requires more thought and discussion [1],
and therefore I will create a separate patch series for it. In the
meantime, this series now only focuses on introduction of __kflagstab
which right is an improvement to the module loader's code health [2].

Thank you Petr Pavlu and Jonathan Corbet for their valuable feedback.

---
Changes from v2:
- removed symbol import protection to spin off into its own series

v2:
https://lore.kernel.org/20251013153918.2206045-1-sidnayyar@google.com/

Changes from v1:
- added a check to ensure __kflagstab is present
- added warnings for the obsolete *_gpl sections
- moved protected symbol check before ref_module() call
- moved protected symbol check failure warning to issue detection point

v1:
https://lore.kernel.org/20250829105418.3053274-1-sidnayyar@google.com/

[1] https://lore.kernel.org/cac5ed5e-3320-4db0-99d8-ea5e97e56bfb@suse.com/
[2] https://lore.kernel.org/2bf54830-ea9c-4962-a7ef-653fbed8f8c0@suse.com/

Siddharth Nayyar (8):
  define kernel symbol flags
  linker: add kflagstab section to vmlinux and modules
  modpost: create entries for kflagstab
  module loader: use kflagstab instead of *_gpl sections
  modpost: put all exported symbols in ksymtab section
  module loader: remove references of *_gpl sections
  linker: remove *_gpl sections from vmlinux and modules
  remove references to *_gpl sections in documentation

 Documentation/kbuild/modules.rst  |  11 ++--
 include/asm-generic/vmlinux.lds.h |  21 ++----
 include/linux/export-internal.h   |  28 +++++---
 include/linux/module.h            |   4 +-
 include/linux/module_symbol.h     |   5 ++
 kernel/module/internal.h          |   4 +-
 kernel/module/main.c              | 102 ++++++++++++++----------------
 scripts/mod/modpost.c             |  16 +++--
 scripts/module.lds.S              |   3 +-
 9 files changed, 99 insertions(+), 95 deletions(-)

-- 
2.51.1.930.gacf6e81ea2-goog


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

end of thread, other threads:[~2025-11-03 16:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 16:19 [PATCH v3 0/8] scalable symbol flags with __kflagstab Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 1/8] define kernel symbol flags Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 2/8] linker: add kflagstab section to vmlinux and modules Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 3/8] modpost: create entries for kflagstab Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 4/8] module loader: use kflagstab instead of *_gpl sections Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 5/8] modpost: put all exported symbols in ksymtab section Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 6/8] module loader: remove references of *_gpl sections Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 7/8] linker: remove *_gpl sections from vmlinux and modules Siddharth Nayyar
2025-11-03 16:19 ` [PATCH v3 8/8] remove references to *_gpl sections in documentation Siddharth Nayyar

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