Skip to contentSkip to conversation

Are vDSO addresses special?

DISCUSSION Florian Weimer 2 participants 3 messages Feb 11, 2021 – Feb 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

In glibc, we have some code that copies the DT_SONAME string of the kernel vDSO into the heap, commented this way:

/* Work around a kernel problem. The kernel cannot handle
addresses in the vsyscall DSO pages in writev() calls. */

Is this really a problem anymore? vDSO addresses are ordinary userspace addresses, I think. (The vsyscall stuff is very different, of course, and maybe the vDSO started out the same way.)

We only care about Linux 3.2 or later in glibc.

Thanks,
Florian

Signature · 3 lines
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
#1 lore raw
Quoted 6 lines · Florian Weimer

In glibc, we have some code that copies the DT_SONAME string of the kernel vDSO into the heap, commented this way:

Quoted 6 lines

/* Work around a kernel problem. The kernel cannot handle
addresses in the vsyscall DSO pages in writev() calls. */

Is this really a problem anymore? vDSO addresses are ordinary userspace addresses, I think. (The vsyscall stuff is very different, of course, and maybe the vDSO started out the same way.)

I don’t think it was ever a problem, and it certainly haven’t been a problem for a long, long time. vDSO addresses are regular user addresses. The *vsyscall* addresses are not, and most syscalls will not accept them, but that shouldn’t matter especially since modern kernels, by default, won’t let you read those addresses from user code either.

Saying “vsyscall DSO” is odd. There’s no such thing.

—Andy

Quoted 10 lines

We only care about Linux 3.2 or later in glibc.

Thanks,
Florian

Signature · 3 lines
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
#2 lore raw

* Andy Lutomirski:

Quoted 12 lines
Quoted 11 lines · Florian Weimer

In glibc, we have some code that copies the DT_SONAME string of the kernel vDSO into the heap, commented this way:

/* Work around a kernel problem. The kernel cannot handle
addresses in the vsyscall DSO pages in writev() calls. */

Is this really a problem anymore? vDSO addresses are ordinary userspace addresses, I think. (The vsyscall stuff is very different, of course, and maybe the vDSO started out the same way.)

Quoted 6 lines

I don’t think it was ever a problem, and it certainly haven’t been a problem for a long, long time. vDSO addresses are regular user addresses. The *vsyscall* addresses are not, and most syscalls will not accept them, but that shouldn’t matter especially since modern kernels, by default, won’t let you read those addresses from user code either.

Thanks. Patch posted:

<https://sourceware.org/pipermail/libc-alpha/2021-February/122603.html>

Quoted 1 line

Saying “vsyscall DSO” is odd. There’s no such thing.

In the glibc context, it sometimes means “system-call-like function implemented in the vDSO”. But that's not the case here.

Florian

Signature · 3 lines
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill