mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: john stultz <johnstul@us.ibm.com>,
	Ulrich Drepper <drepper@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>, Andi Kleen <ak@suse.de>,
	Jamie Lokier <jamie@shareable.org>,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	Wim Coekaerts <wim.coekaerts@oracle.com>,
	Joel Becker <Joel.Becker@oracle.com>,
	Chris McDermott <lcm@us.ibm.com>
Subject: Re: [RFC][PATCH] linux-2.6.4-pre1_vsyscall-gtod_B3-part3 (3/3)
Date: Thu, 4 Mar 2004 17:45:45 +0100	[thread overview]
Message-ID: <20040304164545.GL4922@dualathlon.random> (raw)
In-Reply-To: <20040304085735.GN31589@devserv.devel.redhat.com>

On Thu, Mar 04, 2004 at 03:57:36AM -0500, Jakub Jelinek wrote:
> On Wed, Mar 03, 2004 at 06:54:49PM -0800, john stultz wrote:
> > On Wed, 2004-03-03 at 18:47, Andrea Arcangeli wrote:
> > > And sysenter is at a fixed address in 2.6 x86 too (it doesn't even
> > > change between different kernel compiles).
> > 
> > Actually, the 4G patch pushes vsysenter down a page, and glibc seems to
> > handle this properly.
> 
> But the 4G/4G patch relinks the vDSO to the address it uses, this is no
> big problem for glibc which of course doesn't use hardcoded address but
> reads AT_SYSINFO{,_EHDR} values kernel passes to it.
> 
> But the fixed vDSO location is a problem, exploits certainly appreciate
> a fixed address at which they with high probability can enter the kernel.
> 
> Ingo Molnar recently wrote a patch to randomize the vDSO address on
> IA-32.  Unfortunately it revealed some bugs in glibc where ld.so did not

do you have a link to the patch? (I don't see it in his homepage) just
curious to see how much precious address space you're throwing at this
randomization and in turn how many tries are needed to brute force.

if you really care so much about randomization vs performance, it would
been a lot better if you implemented vsysenter in a completely different
way: by exporting some position indipendent bytecode to userspace via a
syscall, and have glibc loadup this code somewhere in the address space
(truly random thing making it trivial to do the intra-page offsets with
byte granularity) and have kernel exporting only data, not exeuctables
in the address space.  The executable bytecode would be returned by a
syscall.  That is something slower at startup but fairly secure, and it
doesn't waste kernel or user address space.  The max-performance way of
x86 vsysenter and x86-64 vgettimeofday simply don't fit for your
security object best IMHO, it wasn't designed for that and it's an hack
to try to randomize it with page-offsets.  Keeping a local copy of the
vsyscall bytecode at different intra-page offsets is something sanely
doable in userspace, doing it in kernel is hairy and non-natural thing
to do for kernel (involve copies, replacation of the vsyscall page etc.,
so one can as well do the copy in a load_usyscall syscall when the
dynamic linker is asked to run gettimeofday, so this page can also be
swapped out).  What kernel can do more or less naturally is to share the
same _physical_ vsyscall "page" (w/o intra page offset differences
making it trivial to brut), and export it at a different addresses for
each task, that is what Ingo implemented I guess, but it's 4096 times *
3.5G faster to crack.

  reply	other threads:[~2004-03-04 16:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-04  0:11 [RFC][PATCH] vsyscall-gtod_B3 (0/3) john stultz
2004-03-04  0:12 ` [RFC][PATCH] linux-2.6.4-pre1_vsyscall-gtod_B3-part1 (1/3) john stultz
2004-03-04  0:13   ` [RFC][PATCH] linux-2.6.4-pre1_vsyscall-gtod_B3-part2 (2/3) john stultz
2004-03-04  0:14     ` [RFC][PATCH] linux-2.6.4-pre1_vsyscall-gtod_B3-part3 (3/3) john stultz
2004-03-04  0:55       ` Andrea Arcangeli
2004-03-04  2:16         ` Ulrich Drepper
2004-03-04  2:43           ` john stultz
2004-03-04  3:14             ` Andrea Arcangeli
2004-03-04  8:09             ` Ulrich Drepper
2004-03-04 19:02               ` john stultz
2004-03-04  2:47           ` Andrea Arcangeli
2004-03-04  2:54             ` john stultz
2004-03-04  3:15               ` Andrea Arcangeli
2004-03-04  8:57               ` Jakub Jelinek
2004-03-04 16:45                 ` Andrea Arcangeli [this message]
2004-03-04  8:00         ` Jamie Lokier
2004-03-04  8:37           ` Jakub Jelinek
2004-03-04 17:48             ` Andrea Arcangeli
2004-03-04  0:15 ` [RFC] vsyscall-gtod_test_B3.tar.gz john stultz

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=20040304164545.GL4922@dualathlon.random \
    --to=andrea@suse.de \
    --cc=Joel.Becker@oracle.com \
    --cc=ak@suse.de \
    --cc=drepper@redhat.com \
    --cc=jakub@redhat.com \
    --cc=jamie@shareable.org \
    --cc=johnstul@us.ibm.com \
    --cc=lcm@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=wim.coekaerts@oracle.com \
    /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

all inboxes | Powered by JetHome®