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

Fix externalization on Userpsace Livepatching #124

Merged
merged 3 commits into from
Aug 23, 2024

Commits on Aug 22, 2024

  1. Disable const propagation on externalized vars

    The value of the externalized vars are filled by the livepatch system,
    not the compiler.  Hence if there are no writes into the variable
    the compiler won't generate the instructions to read it.  As an
    example:
    
    ```
    static int aa;
    int f(void) { return aa; }
    ```
    generates:
    ```
      xor eax, eax
      ret
    ```
    Notice how there is no memory read.  Adding the `__attribute__((used))`
    to it changes the asm code to:
    ```
      movl	aa(%rip), %eax
      ret
    ```
    Fixing the issue.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    9264544 View commit details
    Browse the repository at this point in the history
  2. Fix symbol visibility

    In the case the symbol is only available on SYMTAB we can't weakly
    externalize it, as the linker will resolve it as not found.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    88f7d52 View commit details
    Browse the repository at this point in the history
  3. Add option to pass two debuginfos

    SUSE packages contain the stripped .so file with .dynsym and the
    debuginfo (.debug) provided in -debuginfo packages.  We need both
    of them in Userspace Livepatching since 15.5 for proper analysis.
    This commit patches the ElfCache and InlineAnalysis so it can use
    both of them.
    
    For kernel we expect it to only use one ELF file for now (the
    first one).
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    74de718 View commit details
    Browse the repository at this point in the history