linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-api@vger.kernel.org, kernel-hardening@lists.openwall.com,
	linux-x86_64@vger.kernel.org, linux-arch@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Carlos O'Donell <carlos@redhat.com>,
	x86@kernel.org
Subject: Re: Detecting the availability of VSYSCALL
Date: Tue, 25 Jun 2019 18:38:15 +0200	[thread overview]
Message-ID: <87lfxpy614.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1906251824500.32342@nanos.tec.linutronix.de> (Thomas Gleixner's message of "Tue, 25 Jun 2019 18:30:29 +0200 (CEST)")

* Thomas Gleixner:

> On Tue, 25 Jun 2019, Florian Weimer wrote:
>> We're trying to create portable binaries which use VSYSCALL on older
>> kernels (to avoid performance regressions), but gracefully degrade to
>> full system calls on kernels which do not have VSYSCALL support compiled
>> in (or disabled at boot).
>>
>> For technical reasons, we cannot use vDSO fallback.  Trying vDSO first
>> and only then use VSYSCALL is the way this has been tackled in the past,
>> which is why this userspace ABI breakage goes generally unnoticed.  But
>> we don't have a dynamic linker in our scenario.
>
> I'm not following. On newer kernels which usually have vsyscall disabled
> you need to use real syscalls anyway, so why are you so worried about
> performance on older kernels. That doesn't make sense.

We want binaries that run fast on VSYSCALL kernels, but can fall back to
full system calls on kernels that do not have them (instead of
crashing).

We could parse the vDSO and prefer the functions found there, but this
is for the statically linked case.  We currently do not have a (minimal)
dynamic loader there in that version of the code base, so that doesn't
really work for us.

>> Is there any reliable way to detect that VSYSCALL is unavailable,
>> without resorting to parsing /proc/self/maps or opening file
>> descriptors?
>
> Not that I'm aware of except
>
>     sigaction(SIG_SEGV,....)
>
> /me hides

I know people do this for SIGILL to probe for CPU features, but yeah,
let's just not go there. 8-p

Thanks,
Florian

  reply	other threads:[~2019-06-25 16:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 15:15 Detecting the availability of VSYSCALL Florian Weimer
2019-06-25 16:30 ` Thomas Gleixner
2019-06-25 16:38   ` Florian Weimer [this message]
2019-06-25 20:11     ` Andy Lutomirski
2019-06-25 20:47       ` Florian Weimer
2019-06-25 21:49         ` Andy Lutomirski
2019-06-26 12:12           ` Florian Weimer
2019-06-26 14:15             ` Andy Lutomirski
2019-06-26 15:00               ` Florian Weimer
2019-06-26 15:21                 ` Andy Lutomirski
2019-06-26 15:36                   ` Florian Weimer
2019-06-26 16:24                     ` Andy Lutomirski
2019-06-26 16:45                       ` Florian Weimer
2019-06-26 16:52                         ` Andy Lutomirski
2019-06-26 17:04                           ` Florian Weimer
2019-06-26 17:14                             ` Andy Lutomirski
2019-06-25 20:08 ` Kees Cook
2019-06-25 20:13   ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfxpy614.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=carlos@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-x86_64@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).