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

Read LINUX_VERSION_CODE from vDSO ELF header instead of uname #500

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Nov 24, 2021

Continuation of #489 with a few changes:

  • moved the _AT_SYSINFO_EHDR tag to the end of the auxv test before _AT_NULL to test unmatched/fallthrough cases (ehdr used to be the first element in the vector)
  • read auxv unbuffered without ReadAll() since we don't have any control over its size. Avoids most allocs at the cost of more reads but auxv is already an in-memory structure in practice. Also being a bit more liberal regarding alignment, removing the double-buffering and reading it using an anon struct with Tag and Val fields.
  • removed one of the buffers in parsing ELF notes
  • using unix.ByteSliceToString for reading nul-terminated strings
  • added a test for an auxv blob without a vdso pointer

Thanks @brycekahle!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants