Skip to content

[libunwind] use __unw_add_dynamic_eh_frame_section to register dynamic eh_frame section cause segment fault #76957

Closed
@SihangZhu

Description

@SihangZhu

In libgcc, we register the eh_frame section of the live patching. We can use the __register_frame interface. This libunwind library also provides __register_frame and __deregister_frame functions, but they are aliases for __unw_add_dynamic_fde and __unw_remove_dynamic_fde and thus can only take a single FDE. I found the __unw_add_dynamic_eh_frame_section function, but during live patching, the eh_frame section may be followed by all 0. Scenario, the content of all 0 will be regarded as legal CIE.
We will fall into an infinite loop or access illegal memory.
the data of patchArea as below
image

Is it better for this function to have length of eh_frame section as a formal parameter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions