mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: John Reiser <jreiser@BitWagon.com>
Cc: Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
	Arjan van de Ven <arjan@infradead.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: + fully-honor-vdso_enabled.patch added to -mm tree
Date: Sat, 3 Mar 2007 01:18:54 +0300	[thread overview]
Message-ID: <20070302221854.GA162@tv-sign.ru> (raw)
In-Reply-To: <45E891E6.7090807@BitWagon.com>

On 03/02, John Reiser wrote:
>
> Oleg Nesterov wrote:
> > John Reiser wrote:
> 
> >>+	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.
> 
> Paul Mundt has commented on setup_rt_frame() and provided a patch which
> bullet-proofs that area.  I will include that patch into the next revision.

Confused. I still think his patch incomplete. Don't we need the same check
in setup_rt_frame() ?

> The value of ->sysenter_return is interpreted in user space by the
> sysexit instruction; nobody else cares what the value is.  The kernel
> is not required to provide a good value when vdso_enabled is zero,

Yes sure.

> Both context.vdso and sysenter_return could be set to zero whenever
> vdso_enabled is zero; those two values might even be defaulted.
> I'll add such a change to the next revision of the patch, if you'll
> defend it against claims of "unnecessary code."

context.vdso == NULL after mm_alloc(). I don't see a "good" arch dependent
function to clear ->sysenter_return (if we really need this). May be
flush_thread().

> > Note also that load_elf_binary does
> > 
> > 	arch_setup_additional_pages()
> > 	create_elf_tables()
> > 
> > , looks like application can crash after exec if vdso_enabled changes from 0
> > to 1 in between.
> 
> Correct.  Changing vdso_enabled from 0 to non-zero must be prepared
> to lose this race if it is not prevented.  Ordinarily it won't matter
> because the administrator will perform such changes at a "quiet" time.

I agree, this problem is mostly theoretical, but I believe it is hardly
possible to document what the "quiet" time is ;)

How about

	 #define ARCH_DLINFO
	-do if (vdso_enabled) {
	+do if (VDSO_BASE) {
?

Oleg.


  reply	other threads:[~2007-03-02 22:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 17:52 Oleg Nesterov
2007-03-02  3:48 ` Paul Mundt
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 [this message]
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=20070302221854.GA162@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=jreiser@BitWagon.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®