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

aarch64: userspace fails to parse vdso through auxv #1324

Open
shrik3 opened this issue Jul 9, 2024 · 7 comments
Open

aarch64: userspace fails to parse vdso through auxv #1324

shrik3 opened this issue Jul 9, 2024 · 7 comments
Assignees

Comments

@shrik3
Copy link
Collaborator

shrik3 commented Jul 9, 2024

test code (note: should be GPL but I forgot where the code was from).

https://paste.sr.ht/blob/2bd3b5a16686b99fe4790d298d90d6a38c90f3a8

on native aarch64 (kernel 5.15)

$ ./test
VDSO @ 0xffff871d8000
__kernel_rt_sigreturn  @ (nil) 
__kernel_clock_getres  @ 0xffff871d8760 
__kernel_clock_gettime @ 0xffff871d8720 
__kernel_gettimeofday  @ 0xffff871d8740

with Quark:

docker run --rm --runtime=quark_d test
VDSO @ 0xa000001000
__kernel_rt_sigreturn  @ (nil) 
__kernel_clock_getres  @ (nil) 
__kernel_clock_gettime @ (nil) 
__kernel_gettimeofday  @ (nil)

(note: I didn't include @chl337 's vdso patch as it has nothing to do with userspace and auxv)

@shrik3 shrik3 assigned shrik3 and QuarkContainer and unassigned shrik3 Jul 9, 2024
@shrik3
Copy link
Collaborator Author

shrik3 commented Jul 9, 2024

Note: regarding vdso symbols see man vDSO (7)

@chl337
Copy link
Collaborator

chl337 commented Jul 9, 2024

Interesting, I will give it a look later.

@QuarkContainer
Copy link
Owner

I can repro similar issue happened in x86.

@shrik3
Copy link
Collaborator Author

shrik3 commented Jul 9, 2024 via email

@QuarkContainer
Copy link
Owner

QuarkContainer commented Jul 9, 2024 via email

@QuarkContainer
Copy link
Owner

Looks like our vdso binary build has issue. I tried to use https://github.com/enarx/vdso to parse our vdso.so and get wrong result.

@QuarkContainer
Copy link
Owner

QuarkContainer commented Jul 9, 2024

for x86, we need to change the test code

vdso_sym("LINUX_2.6", "__vdso_clock_gettime")) instead of vdso_sym("LINUX_2.6.39", "__vdso_clock_gettime"))

Then it will work.

So it is false alarm for x86.

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

No branches or pull requests

3 participants