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

btf,info: Fix bad instruction offset when parsing infos from kernel #1169

Merged
merged 1 commit into from
Oct 19, 2023

Commits on Oct 19, 2023

  1. btf,info: Fix bad instruction offset when parsing infos from kernel

    When BTF ext info is encoded in ELF the instruction offsets are in
    bytes, but when you pass them to the kernel they must be instruction
    indices. Therefore we divide the offset by the instruction size in
    the parsing logic for ELF.
    
    This was missed during the initial implementation of reading back BTF
    ext info from the kernel. This would cause an error when loading
    back ext info which was not a multiple of the instruction size or
    a bad instruction offset if it was.
    
    Fix this by making LoadLineInfos and LoadFuncInfos work on the kernel
    format which contains instruction offsets while the ELF parser uses
    bytes instead.
    
    Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
    Co-developed-by: Lorenz Bauer <lmb@isovalent.com>
    dylandreimerink authored and lmb committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    c748da2 View commit details
    Browse the repository at this point in the history