Skip to content

Resolve calloc for latest libraries #3

@rupeshkoushik07

Description

@rupeshkoushik07

I am trying to run syspart on docker container library in this case
Sonarqube:latest on libc.so.6

I have noticed a crash with eligato

I have debugged and noticed that

readelf -r /home/rupesh.punna/Prototype/LIBS_sonarqube_latest/libc.so.6 2>/dev/null | grep calloc

000000202bc0 09bb00000007 R_X86_64_JUMP_SLO 00000000000ae7a0 calloc@@GLIBC_2.2.5 + 28454

in case where calloc@@GLIBC_2.2.5 + 28454 which means Resolve calloc, then add 28454 bytes to that address

Image

the crash happens after malloc

000000202fd8 R_X86_64_GLOB_DAT malloc@@GLIBC_2.2.5 + 0 ->no issue
000000202bc0 R_X86_64_JUMP_SLO calloc@@GLIBC_2.2.5 + 28454 -> crashes

The crash happens immediately after processing malloc and while processing calloc. Since calloc is a JUMP_SLOT relocation and the crash is in resolveVariableLink()(But resolveVariableLink() has no explicit case for R_X86_64_JUMP_SLOT,)
https://github.com/stevens-s3lab/egalito/blob/592a43c1a55b600b6d2edf02e985e15d1f7be099/src/pass/handlerelocs.cpp

i think adding explicit handling for this case will fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions