public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Arne Georg Gleditsch <arne.gleditsch@dolphinics.no>,
	linux-kernel@vger.kernel.org, John Stultz <johnstul@us.ibm.com>,
	Ingo Molnar <mingo@elte.hu>, Roman Zippel <zippel@linux-m68k.org>
Subject: Re: arch/x86/kernel/vsyscall_64.c: overeager NOP of syscalls
Date: 22 Feb 2008 13:49:50 +0100
Date: Fri, 22 Feb 2008 13:49:50 +0100	[thread overview]
Message-ID: <20080222124950.GA81921@muc.de> (raw)
In-Reply-To: <alpine.LFD.1.00.0802212039240.7583@apollo.tec.linutronix.de>

On Thu, Feb 21, 2008 at 08:45:53PM +0100, Thomas Gleixner wrote:
> On Thu, 21 Feb 2008, Andi Kleen wrote:
> 
> > On Wed, Feb 20, 2008 at 02:57:34PM +0100, Arne Georg Gleditsch wrote:
> > > Hi,
> > > 
> > > I'm looking at 2.6.25-rc2.  vsyscall_sysctl_change contains code to NOP
> > > out the actual system call instructions of the vsyscall page when
> > > vsyscall64 is enabled.  This seems to interact badly with the fallback
> > > code in do_vgettimeofday which tries to call gettimeofday if the
> > > configured clock source does not support vread.  (In effect,
> > > gettimeofday() becomes a nop and time() always returns 0.  Not very
> > > useful.)
> > > 
> > > Is there a good reason to keep this?  Aren't the instructions in
> > > question avoided (or invoked) according to the vsyscall64 flag by the
> > > surrounding logic anyway?
> > 
> > Yes they are.  But a system call sequence at a known fixed address
> > is potentially useful to exploits. That is why it is nop'ed out when
> > it is not needed.
> 
> That's a nice intent, but the reality is that this code is broken as
> hell:

Well it worked when I wrote it, but it's quite possible it didn't survive
the clocksource conversion completely.

-Andi

  parent reply	other threads:[~2008-02-22 12:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 13:57 arch/x86/kernel/vsyscall_64.c: overeager NOP of syscalls Arne Georg Gleditsch
2008-02-20 18:08 ` Thomas Gleixner
2008-02-21 15:58 ` Andi Kleen
2008-02-21 19:45   ` Thomas Gleixner
2008-02-21 20:02     ` john stultz
2008-02-21 20:47       ` Thomas Gleixner
2008-02-21 20:59         ` Thomas Gleixner
2008-02-22 12:55           ` Andi Kleen
2008-02-22 12:49     ` Andi Kleen [this message]
2008-02-22 10:38   ` Arne Georg Gleditsch

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=20080222124950.GA81921@muc.de \
    --to=ak@muc.de \
    --cc=arne.gleditsch@dolphinics.no \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=zippel@linux-m68k.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