Skip to content

Comments

locate VDSO by calling libc::getauxval#20

Open
pattop wants to merge 1 commit intoenarx:mainfrom
pattop:main
Open

locate VDSO by calling libc::getauxval#20
pattop wants to merge 1 commit intoenarx:mainfrom
pattop:main

Conversation

@pattop
Copy link

@pattop pattop commented Nov 23, 2023

This is preferred as crt0stack::Reader::from_environ() relies on the global environ pointer and:

  1. The environ pointer is not guaranteed to point to memory before auxv by any standard I am aware of. It just happens to do so in some C library implementations if the environment has not been modified.
  2. The environ pointer is definitely not going to point to memory before auxv after calling any environment modifying function such as setenv(3).

Calling getauxval(3) is the only standards compliant way of accessing values in the auxiliary vector.

This is preferred as crt0stack::Reader::from_environ() relies on the
global environ pointer and:
1. The environ pointer is not guaranteed to point to memory before auxv
   by any standard I am aware of. It just happens to do so in some C
   library implementations if the environment has not been modified.
2. The environ pointer is definitely not going to point to memory before
   auxv after calling any environment modifying function such as
   setenv(3).

Calling getauxval(3) is the only standards compliant way of accessing
values in the auxiliary vector.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
@pattop pattop requested a review from a team as a code owner November 23, 2023 00:56
@pattop pattop requested review from rjzak and removed request for a team November 23, 2023 00:56
@rjzak rjzak mentioned this pull request Mar 9, 2024
@enarx-project-tracking enarx-project-tracking bot moved this to For Review in Enarx Board Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: For Review

Development

Successfully merging this pull request may close these issues.

1 participant