Menu

#473 readelf does not properly handle note types for different operating systems

RELEASE_1_0
closed
Kai Wang
None
2015-01-05
2015-01-02
Ed Maste
No

For example on FreeBSD:

% readelf/readelf -n strings.core     

Notes at offset 0x00000190 with length 0x00001d30:
  Owner         Data size       Description
  FreeBSD       0x00000078      NT_PRPSINFO (Process information)
  FreeBSD       0x000000e0      NT_PRSTATUS (Process status)
  FreeBSD       0x00000200      NT_FPREGSET (Floating point information)
  FreeBSD       0x00000018      <unknown: 7>
  FreeBSD       0x00000444      <unknown: 8>
  FreeBSD       0x00000ddc      <unknown: 9>
  FreeBSD       0x0000048c      NT_PSTATUS (Linux process status)
  FreeBSD       0x0000000c      <unknown: 11>
  FreeBSD       0x00000006      NT_FPREGS (Linux floating point regset)
  FreeBSD       0x000000d4      NT_PSINFO (Linux process information)
  FreeBSD       0x00000008      <unknown: 14>
  FreeBSD       0x0000000c      <unknown: 15>
  FreeBSD       0x00000114      NT_LWPSTATUS (Linux lwpstatus_t type)

Note type 10 is NT_PSTATUS on Linux and NT_PROCSTAT_VMMAP on FreeBSD. We need to check the note name ("Owner") field and decode the note type based on that, falling back to a default set if there is no name.

Discussion

  • Ed Maste

    Ed Maste - 2015-01-03

    I've started looking at an implementation for this and will hopefully have something to review next week.

     
  • Ed Maste

    Ed Maste - 2015-01-03

    Change for review here: https://reviews.freebsd.org/D1428

     
  • Kai Wang

    Kai Wang - 2015-01-05
    • status: new --> closed
    • assigned_to: Kai Wang
    • Milestone: 1.0 --> RELEASE_1_0
     
  • Kai Wang

    Kai Wang - 2015-01-05

    The patch looks great! I just committed in [r3140]. Thanks for your work!

    I made a minor change though: it seems that Linux also uses the owner name
    "LINUX". Also, I added a few more Linux-specific core note types.

     

    Related

    Commit: [r3140]


Log in to post a comment.