intel / ccc-linux-guest-hardening

Linux Security Hardening for Confidential Compute
https://intel.github.io/ccc-linux-guest-hardening-docs
MIT License
66 stars 14 forks source link

make prepare fails "section mismatch" #91

Closed williamcroberts closed 1 year ago

williamcroberts commented 1 year ago

Following the steps from:

make prepare fails with:

  CHK     include/generated/compile.h
  LD      vmlinux.o
  MODPOST vmlinux.symvers
WARNING: modpost: vmlinux.o(.text.unlikely+0xab26a): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memremap()
The function __calc_tpm2_event_size() references
the function __init early_memremap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memremap is wrong.

WARNING: modpost: vmlinux.o(.text.unlikely+0xab485): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memunmap()
The function __calc_tpm2_event_size() references
the function __init early_memunmap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memunmap is wrong.

WARNING: modpost: vmlinux.o(.text.unlikely+0xab492): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memremap()
The function __calc_tpm2_event_size() references
the function __init early_memremap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memremap is wrong.

WARNING: modpost: vmlinux.o(.text.unlikely+0xab653): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memunmap()
The function __calc_tpm2_event_size() references
the function __init early_memunmap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memunmap is wrong.

WARNING: modpost: vmlinux.o(.text.unlikely+0xab662): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memremap()
The function __calc_tpm2_event_size() references
the function __init early_memremap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memremap is wrong.

WARNING: modpost: vmlinux.o(.text.unlikely+0xab72d): Section mismatch in reference from the function __calc_tpm2_event_size() to the function .init.text:early_memunmap()
The function __calc_tpm2_event_size() references
the function __init early_memunmap().
This is often because __calc_tpm2_event_size lacks a __init 
annotation or the annotation of early_memunmap is wrong.

ERROR: modpost: Section mismatches detected.
Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
ereshetova commented 1 year ago

This is fixed in the new 6.0 guest kernel, so this PR should address this issue also: https://github.com/intel/ccc-linux-guest-hardening/pull/106