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

[PAL] Do not describe RIP location on syscall instruction #2017

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 14, 2024

  1. [PAL] Do not try to describe RIP location on syscall instruction

    Commit b6a2d79 ("[PAL/{Linux,Linux-SGX}] Add trace log for raw syscalls")
    added a debug print for every encountered raw syscall instruction. Each print
    describes what system call number is invoked and at which address in the binary.
    The address is fed to the helper function `pal_describe_location(uc->rip)` which
    tries to find the binary + function name and put them in human-readable form
    into the provided buffer.
    
    For some reason, the snippet used in that commit (allocating a 128-byte buffer
    on signal-handling stack and calling `pal_describe_location()`) leads to a
    non-deterministic memory corruption on some workloads. That bug is hardly
    reproducible, and it is not fixed by e.g. increasing the signal stack size inside
    Gramine. The `pal_describe_location()` control path also seems correct.
    
    As the true root cause for this bug is not yet found, this commit introduces
    a workaround: temporarily removing the stack-allocated buffer and the
    correspoding `pal_describe_location()` call, and instead printing the raw
    RIP value.
    
    Signed-off-by: Adarsh Anand <[email protected]>
    adarshan-intel committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    9de0ec2 View commit details
    Browse the repository at this point in the history