Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpatch-build: account for __pfx_-less NOP padding #1350

Closed
wants to merge 1 commit into from

Commits on Jul 13, 2023

  1. kpatch-build: account for __pfx_-less NOP padding

    Some kernel configurations generate function NOP padding, but without
    associated __pfx_<function> symbols.  For example:
    
      $ git describe HEAD
      v6.4-rc7-72-gdad9774deaf1
    
      # Initial default config turns on Indirect Branch Tracking and 16-NOP padding bytes
      $ make defconfig
      $ grep -e CONFIG_X86_KERNEL_IBT -e CONFIG_FUNCTION_PADDING_BYTES .config
      CONFIG_X86_KERNEL_IBT=y
      CONFIG_FUNCTION_PADDING_BYTES=16
    
      # Test .o build generates 16 bytes of NOPs but no "__pfx_" symbol
      $ make -j$(nproc) fs/proc/cmdline.o
      $ objdump -Dr -j .text fs/proc/cmdline.o  | grep -e '<.*>:' -e 'Disassembly'
      Disassembly of section .text:
      0000000000000000 <cmdline_proc_show-0x10>:
      0000000000000010 <cmdline_proc_show>:
    
    This is because objtool operation on the object code may be delayed
    under certain configurations.  As such, create-diff-object should be
    prepared to encounter NOP padded functions in object files before any
    __pfx_ symbols are created.
    
    Fixes: 3e54c63 ("create-diff-object: support x86 NOP-padded functions")
    Closes: dynup#1347 ("x86 NOP padded functions without __pfx_ symbol")
    Reported-by: Ryan Sullivan <[email protected]>
    Signed-off-by: Joe Lawrence <[email protected]>
    joe-lawrence committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    16e4a48 View commit details
    Browse the repository at this point in the history