linux/include/asm-generic
Dimitri John Ledkov d50f210913
kbuild: align modinfo section for Secureboot Authenticode EDK2 compat
Previously linker scripts would always generate vmlinuz that has sections
aligned. And thus padded (correct Authenticode calculation) and unpadded
calculation would be same. As in https://github.com/rhboot/pesign userspace
tool would produce the same authenticode digest for both of the following
commands:

    pesign --padding --hash --in ./arch/x86_64/boot/bzImage
    pesign --nopadding --hash --in ./arch/x86_64/boot/bzImage

The commit 3e86e4d74c ("kbuild: keep .modinfo section in
vmlinux.unstripped") added .modinfo section of variable length. Depending
on kernel configuration it may or may not be aligned.

All userspace signing tooling correctly pads such section to calculation
spec compliant authenticode digest.

However, if bzImage is not further processed and is attempted to be loaded
directly by EDK2 firmware, it calculates unpadded Authenticode digest and
fails to correct accept/reject such kernel builds even when propoer
Authenticode values are enrolled in db/dbx. One can say EDK2 requires
aligned/padded kernels in Secureboot.

Thus add ALIGN(8) to the .modinfo section, to esure kernels irrespective of
modinfo contents can be loaded by all existing EDK2 firmware builds.

Fixes: 3e86e4d74c ("kbuild: keep .modinfo section in vmlinux.unstripped")
Cc: stable@vger.kernel.org
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
Link: https://patch.msgid.link/20251026202100.679989-1-dimitri.ledkov@surgut.co.uk
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2025-10-27 16:21:24 -07:00
..
bitops bitops: Add __attribute_const__ to generic ffs()-family implementations 2025-09-08 14:58:50 -07:00
vdso vdso: Drop Kconfig GENERIC_VDSO_DATA_STORE 2025-09-04 11:23:50 +02:00
Kbuild unwind_user: Add user space unwinding API with frame pointer support 2025-07-29 14:46:07 -04:00
access_ok.h
agp.h
archrandom.h
asm-offsets.h
asm-prototypes.h
atomic.h
atomic64.h
audit_change_attr.h
audit_dir_write.h
audit_read.h
audit_signal.h
audit_write.h
barrier.h
bitops.h
bitsperlong.h
bug.h
cache.h
cacheflush.h
cfi.h
checksum.h
cmpxchg-local.h
cmpxchg.h
codetag.lds.h codetag: avoid unused alloc_tags sections/symbols 2025-07-09 22:42:14 -07:00
compat.h
current.h
delay.h delay: Fix ndelay() spuriously treated as udelay() 2024-11-29 11:40:22 +01:00
device.h
div64.h
dma-mapping.h
dma.h
early_ioremap.h mm/early_ioremap: add null pointer checks to prevent NULL-pointer dereference 2025-01-13 22:40:59 -08:00
emergency-restart.h
error-injection.h
exec.h
extable.h
fixmap.h
flat.h
fprobe.h fprobe: Add fprobe_header encoding feature 2024-12-26 10:50:05 -05:00
ftrace.h
futex.h
getorder.h
hardirq.h
hugetlb.h mm: drop hugetlb_free_pgd_range() 2025-07-24 19:12:32 -07:00
hw_irq.h
int-ll64.h
io.h asm-generic/io.h: Skip trace helpers if rwmmio events are disabled 2025-09-24 16:21:13 +02:00
ioctl.h
iomap.h asm-generic/io.h: rework split ioread64/iowrite64 helpers 2025-03-01 21:00:22 +01:00
irq.h
irq_regs.h
irq_work.h
irqflags.h
kdebug.h
kmap_size.h
kprobes.h
kvm_para.h
kvm_types.h
linkage.h
local.h
local64.h
logic_io.h
mcs_spinlock.h locking: Move MCS struct definition to public header 2025-03-18 10:28:21 -07:00
memory_model.h mm: convert page_to_section() to memdesc_section() 2025-09-13 16:55:07 -07:00
mm_hooks.h
mmiowb.h
mmiowb_types.h
mmu.h
mmu_context.h
mmzone.h
module.h asm-generic: Always define Elf_Rel and Elf_Rela 2025-03-26 15:56:43 -07:00
module.lds.h
mshyperv.h Drivers: hv: Add CONFIG_HYPERV_VMBUS option 2025-10-01 00:00:42 +00:00
msi.h irqchip/gic-v5: Add GICv5 IWB support 2025-07-08 18:35:52 +01:00
nommu_context.h
numa.h
param.h alpha: regularize the situation with asm/param.h 2025-06-24 22:02:05 -04:00
parport.h
pci.h
pci_iomap.h
percpu.h percpu: repurpose __percpu tag as a named address space qualifier 2025-03-16 22:05:53 -07:00
pgalloc.h mm: call ctor/dtor for kernel PTEs 2025-05-11 17:48:21 -07:00
pgtable-nop4d.h
pgtable-nopmd.h
pgtable-nopud.h
pgtable_uffd.h
preempt.h
qrwlock.h
qrwlock_types.h
qspinlock.h
qspinlock_types.h
resource.h
rqspinlock.h bpf: Introduce rqspinlock kfuncs 2025-03-19 08:03:06 -07:00
runtime-const.h
rwonce.h rwonce: fix crash by removing READ_ONCE() for unaligned read 2025-03-26 22:16:50 +01:00
seccomp.h
sections.h percpu: Remove __per_cpu_load 2025-02-18 10:16:00 +01:00
serial.h
set_memory.h
shmparam.h
signal.h
simd.h asm-generic: Add sched.h inclusion in simd.h 2025-05-30 20:56:48 +08:00
softirq_stack.h
spinlock.h
spinlock_types.h
statfs.h
string.h
switch_to.h
syscall.h syscall.h: introduce syscall_set_nr() 2025-05-11 17:48:15 -07:00
syscalls.h
text-patching.h
thread_info_tif.h asm-generic: Provide generic TIF infrastructure 2025-09-17 08:14:03 +02:00
ticket_spinlock.h
timex.h
tlb.h mmu_gather: move tlb flush for VM_PFNMAP/VM_MIXEDMAP vmas into free_pgtables() 2025-05-31 22:46:12 -07:00
tlbflush.h
topology.h
trace_clock.h
uaccess.h
unwind_user.h unwind_user: Add user space unwinding API with frame pointer support 2025-07-29 14:46:07 -04:00
user.h
vermagic.h
vga.h empty include/asm-generic/vga.h 2024-11-11 21:51:42 +01:00
video.h
vmlinux.lds.h kbuild: align modinfo section for Secureboot Authenticode EDK2 compat 2025-10-27 16:21:24 -07:00
word-at-a-time.h
xor.h