public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: John Reiser <jreiser@BitWagon.com>, Andi Kleen <ak@suse.de>,
	Ingo Molnar <mingo@elte.hu>,
	Arjan van de Ven <arjan@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: + fully-honor-vdso_enabled.patch added to -mm tree
Date: Fri, 2 Mar 2007 12:48:00 +0900	[thread overview]
Message-ID: <20070302034800.GA12530@linux-sh.org> (raw)
In-Reply-To: <20070301175207.GA849@tv-sign.ru>

On Thu, Mar 01, 2007 at 08:52:07PM +0300, Oleg Nesterov wrote:
> > --- a/arch/i386/kernel/sysenter.c~fully-honor-vdso_enabled
> > +++ a/arch/i386/kernel/sysenter.c
> > @@ -22,6 +22,8 @@
> >  #include <asm/msr.h>
> >  #include <asm/pgtable.h>
> >  #include <asm/unistd.h>
> > +#include <asm/a.out.h>
> > +#include <asm/mman.h>
> >
> >  /*
> >   * Should the kernel map a VDSO page into processes and pass its
> > @@ -105,10 +107,25 @@ int arch_setup_additional_pages(struct l
> >  {
> >  	struct mm_struct *mm = current->mm;
> >  	unsigned long addr;
> > +	unsigned long flags;
> >  	int ret;
> >
> > +	switch (vdso_enabled) {
> > +	case 0:  /* none */
> > +		return 0;
> 
> This means we don't initialize mm->context.vdso and ->sysenter_return.
> 
> Is it ok? For example, setup_rt_frame() uses VDSO_SYM(&__kernel_rt_sigreturn),
> sysenter_past_esp pushes ->sysenter_return on stack.
> 
The setup_rt_frame() case is fairly straightforward, both PPC and SH
already check to make sure there's a valid context before trying to use
VDSO_SYM(), I'm not sure why x86 doesn't.

Though I wonder if there's any point in checking binfmt->hasvdso here?
There shouldn't be a valid mm->context.vdso in the !hasvdso case..

Someone else will have to comment on ->sysenter_return.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

--

 arch/i386/kernel/signal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index 4f99e87..f778d34 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -350,7 +350,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
 			goto give_sigsegv;
 	}
 
-	if (current->binfmt->hasvdso)
+	if (current->binfmt->hasvdso && current->mm->context.vdso)
 		restorer = (void *)VDSO_SYM(&__kernel_sigreturn);
 	else
 		restorer = (void *)&frame->retcode;

  reply	other threads:[~2007-03-02  3:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 17:52 + fully-honor-vdso_enabled.patch added to -mm tree Oleg Nesterov
2007-03-02  3:48 ` Paul Mundt [this message]
2007-03-02 19:32   ` Oleg Nesterov
2007-03-02 21:19     ` John Reiser
2007-03-03 17:38       ` Oleg Nesterov
2007-03-02 21:06 ` John Reiser
2007-03-02 22:18   ` Oleg Nesterov
2007-03-05 10:12     ` Paul Mundt
2007-03-05 10:54       ` Oleg Nesterov
2007-03-05 10:56         ` Paul Mundt
2007-03-02 22:19   ` Chuck Ebbert
2007-03-02 23:11     ` Oleg Nesterov
2007-03-02 23:33     ` John Reiser

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=20070302034800.GA12530@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=jreiser@BitWagon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    /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