public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386
@ 2019-07-19 17:03 Sean Christopherson
  2019-07-19 17:40 ` Andy Lutomirski
  0 siblings, 1 reply; 27+ messages in thread
From: Sean Christopherson @ 2019-07-19 17:03 UTC (permalink / raw)
  To: Thomas Gleixner, Andy Lutomirski, Vincenzo Frascino; +Cc: x86, linux-kernel

The generic vDSO implementation, starting with commit

   7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")

breaks seccomp-enabled userspace on 32-bit x86 (i386) kernels.  Prior to
the generic implementation, the x86 vDSO used identical code for both
x86_64 and i386 kernels, which worked because it did all calcuations using
structs with naturally sized variables, i.e. didn't use __kernel_timespec.

The generic vDSO does its internal calculations using __kernel_timespec,
which in turn requires the i386 fallback syscall to use the 64-bit
variation, __NR_clock_gettime64.

Using __NR_clock_gettime64 instead of __NR_clock_gettime breaks userspace
applications that use seccomp filtering to block syscalls, as applications
are completely unaware of the newly added of __NR_clock_gettime64, e.g.
sshd gets zapped on syscall(403) when attempting to ssh into the system.

I can fudge around the issue easily enough, but I have no idea how to fix
this properly without duplicating __cvdso_clock_gettime, do_hres, etc...,
especially now that the i386 vDSO exposes __vdso_clock_gettime64().

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-07-28 18:19 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-19 17:03 [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386 Sean Christopherson
2019-07-19 17:40 ` Andy Lutomirski
2019-07-22 17:16   ` Kees Cook
2019-07-22 18:31     ` Thomas Gleixner
2019-07-22 18:39       ` Kees Cook
2019-07-22 19:17         ` Andy Lutomirski
2019-07-22 23:28           ` Kees Cook
2019-07-22 23:47             ` Andy Lutomirski
2019-07-23  9:18               ` Peter Zijlstra
2019-07-23 14:04                 ` Andy Lutomirski
2019-07-23 15:14                   ` Peter Zijlstra
2019-07-23 21:55               ` Kees Cook
2019-07-23 22:55                 ` Andy Lutomirski
2019-07-23 22:59                 ` Thomas Gleixner
2019-07-23 23:43                   ` Kees Cook
2019-07-23 23:56                     ` Thomas Gleixner
2019-07-26 18:01                       ` Sean Christopherson
2019-07-27 17:49                         ` Andy Lutomirski
2019-07-27 18:43                           ` Thomas Gleixner
2019-07-27 21:52                             ` Thomas Gleixner
2019-07-28  0:33                               ` Andy Lutomirski
2019-07-28  9:57                           ` Arnd Bergmann
2019-07-28 10:30                             ` Thomas Gleixner
2019-07-28 15:27                               ` Arnd Bergmann
2019-07-28 18:14                                 ` Thomas Gleixner
2019-07-28 18:16                                   ` Thomas Gleixner
2019-07-28 11:13                             ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox