The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 0/5] fix section alignment on i386 when CONFIG_DRM_USE_DYNAMIC_DEBUG=Y
@ 2026-06-30 18:37 Jim Cromie
  2026-06-30 18:37 ` [PATCH v4 1/5] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h Jim Cromie
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jim Cromie @ 2026-06-30 18:37 UTC (permalink / raw)
  To: Arnd Bergmann, Jason Baron, Luis Chamberlain, Petr Pavlu,
	Daniel Gomez, Sami Tolvanen, Aaron Tomlin
  Cc: linux-kernel, linux-arch, linux-modules, Andrew Morton,
	Jim Cromie, Louis Chauvet

This fixes a section misalignement on i386, when CONFIG_DRM=y and
CONFIG_DRM_USE_DYNAMIC_DEBUG=Y

In this config, the __dyndbg_classes section gets a single
struct/record.  On i386 this is 28-bytes, breaking the required
ALIGN(8) on the following __dyndbg section.

This breaks dynamic_debug_init() with a NULL pointer dereference; the
section traversal logic encounters padding bytes instead of a valid
descriptor.

the series:

1. moves BOUNDED_SECTION_* macros from vmlinux.lds.h to its own file.
   v2- adds note that macros are for vmlinux.lds.h only, not for modules.

2. drops unused HEADERED_SECTION_* macros from that new file

3. adds ALIGN(8) into BOUNDED_SECTION* macros
   omission causing NULL ptr on i386
   adds,uses BOUNDED_SECTION _ALIGNED variants

4. removes now redundant ALIGN(8)s in vmlinux.lds.h

5. adds dyndbg.lds.S to KEEP sections in modules
   follows codetag.lds.h model

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
v3:
- move #includes to top of files,
- drop redundant ALIGN(8) in dydnbg.lds.S: DYNDBG_SECTIONS macro
- add Reviewed-by tag (thx Petr)

v2:
- avoid BOUNDED_SECTION in modules, dont need _start & _end symbols.
- sets 0 address to the sections, not just whatever current is.

---
Jim Cromie (5):
      vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h
      vmlinux.lds.h: drop unused HEADERED_SECTION* macros
      vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386
      vmlinux.lds.h: remove redundant ALIGN(8) directives
      dyndbg.lds.S: fix lost dyndbg sections in modules

 MAINTAINERS                                |  1 +
 include/asm-generic/bounded_sections.lds.h | 32 ++++++++++++++
 include/asm-generic/dyndbg.lds.h           | 18 ++++++++
 include/asm-generic/vmlinux.lds.h          | 68 ++++++------------------------
 scripts/module.lds.S                       |  2 +
 5 files changed, 66 insertions(+), 55 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260630-fix-align-589738662161

Best regards,
-- 
Jim Cromie <jim.cromie@gmail.com>


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

end of thread, other threads:[~2026-06-30 18:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 18:37 [PATCH v4 0/5] fix section alignment on i386 when CONFIG_DRM_USE_DYNAMIC_DEBUG=Y Jim Cromie
2026-06-30 18:37 ` [PATCH v4 1/5] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h Jim Cromie
2026-06-30 18:37 ` [PATCH v4 2/5] vmlinux.lds.h: drop unused HEADERED_SECTION* macros Jim Cromie
2026-06-30 18:37 ` [PATCH v4 3/5] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 Jim Cromie
2026-06-30 18:37 ` [PATCH v4 4/5] vmlinux.lds.h: remove redundant ALIGN(8) directives Jim Cromie
2026-06-30 18:37 ` [PATCH v4 5/5] dyndbg.lds.S: fix lost dyndbg sections in modules Jim Cromie

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