From: Oleg Nesterov <oleg@redhat.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Stephen Wilson <wilsons@start.ca>, linux-kernel@vger.kernel.org
Subject: Re: Q: x86: add context tag to mark mm when running a task in 32-bit compatibility mode
Date: Wed, 28 Sep 2011 17:55:39 +0200 [thread overview]
Message-ID: <20110928155539.GA10550@redhat.com> (raw)
In-Reply-To: <20110927183219.GL2203@ZenIV.linux.org.uk>
On 09/27, Al Viro wrote:
>
> On Tue, Sep 27, 2011 at 07:04:48PM +0200, Oleg Nesterov wrote:
> > --- x/arch/x86/kernel/process_64.c
> > +++ x/arch/x86/kernel/process_64.c
> > @@ -502,10 +502,6 @@ void set_personality_64bit(void)
> > /* Make sure to be in 64bit mode */
> > clear_thread_flag(TIF_IA32);
> >
> > - /* Ensure the corresponding mm is not marked. */
> > - if (current->mm)
> > - current->mm->context.ia32_compat = 0;
>
> What happens when 32bit task does exec on 64bit binary?
Nothing. This bit is always zero after init_mm(), it can't copy
MMF_COMPAT.
But. This is wrong anyway. I forgot about fork(). We do not want to
uglify copy_mm(), MMF_INIT_MASK should include MMF_COMPAT and then
set_personality_64bit() needs to clear this bit.
Thanks!
> > - if (current->mm)
> > - current->mm->context.ia32_compat = 1;
> > + set_bit(MMF_COMPAT, ¤t->mm->flags);
>
> ... assuming current->mm is never NULL here.
Yes, but it can't be NULL?
SET_PERSONALITY() can only be called during exec, and it must be called
after exec_mmap() has already installed the new mm != NULL, otherwise
the current code is buggy anyway.
Oleg.
next prev parent reply other threads:[~2011-09-28 15:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 17:04 Q: x86: add context tag to mark mm when running a task in 32-bit compatibility mode Oleg Nesterov
2011-09-27 18:32 ` Al Viro
2011-09-28 15:55 ` Oleg Nesterov [this message]
2011-09-28 2:07 ` Stephen Wilson
2011-09-28 15:56 ` Oleg Nesterov
2011-09-28 18:41 ` [PATCH] x86: replace mm_context_t.ia32_compat by MMF_COMPAT Oleg Nesterov
2011-10-07 9:31 ` Johannes Weiner
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=20110928155539.GA10550@redhat.com \
--to=oleg@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
--cc=wilsons@start.ca \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.