linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Roland McGrath <roland@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] x86: set_personality_ia32() abuses TS_COMPAT
Date: Tue, 16 Feb 2010 18:16:14 +0100	[thread overview]
Message-ID: <20100216171614.GA23503@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1002160738530.18830@localhost.localdomain>

On 02/16, Linus Torvalds wrote:
>
> On Tue, 16 Feb 2010, Oleg Nesterov wrote:
> >
> > In fact I'd say this is not right, but fortunetely do_execve() can
> > never return something which could confuse syscall_get_error().
> > And apart from do_signal() we never check TS_COMPAT during return
> > to user-mode.
>
> But 'do_signal()' _can_ happen the first thing after an execve(), no?

this is what I meant,

> And after we have switched to 32-bit mode, we _are_ inside a 32-bit system
> call: the execve has "changed" from a 64-bit one to a 32-bit one.

And this is what I do not understand, we are still in 64-bit execve.

With ot without TS_COMPAT we take the same return path and I can't
see why should we sign-extend ->ax. But I didn't claim this is wrong,
and it is possible I missed something.

> So I really don't understand why you dislike TS_COMPAT here.

The only reason I dislike TS_COMPAT is that I spent a lot of time
trying to understand the necessity to set it here when I tried to
understand the basics of compat issues.

> I understand not liking TS_COMPAT in the first place (it would be nice to
> not have that flag at all), but considering that it exists, and it is
> supposed to be set while in 32-bit system calls, setting it on a 32-bit
> execve() seems to be the RightThing(tm) to do.

OK, please ignore the patch then.

As I said, only the first patch probably makes sense, and even it
was not tested.



Cough. And since I already made a lot of noise...

Now that we always call setup_new_exec() which does
arch_pick_mmap_layout(), what is the point of
exec_mmap()->arch_pick_mmap_layout() ?

Oleg.


  reply	other threads:[~2010-02-16 17:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 16:17 x86: get rid of the insane TIF_ABI_PENDING bit Oleg Nesterov
2010-02-15 16:23 ` H. Peter Anvin
2010-02-15 16:50   ` Oleg Nesterov
2010-02-15 18:06     ` H. Peter Anvin
2010-02-15 18:52       ` Oleg Nesterov
2010-02-15 19:07 ` H. Peter Anvin
2010-02-15 19:10 ` H. Peter Anvin
2010-02-15 19:41   ` Roland McGrath
2010-02-15 20:07     ` H. Peter Anvin
2010-02-15 21:14       ` Roland McGrath
2010-02-15 20:43     ` H. Peter Anvin
2010-02-15 21:05       ` Roland McGrath
2010-02-16 10:19       ` Oleg Nesterov
2010-02-16 10:23         ` Andi Kleen
2010-02-16 14:01           ` [PATCH 0/3] Was: " Oleg Nesterov
2010-02-16 14:02             ` [PATCH 1/3] x86: set_personality_ia32() misses force_personality32 Oleg Nesterov
2010-02-16 23:27               ` [tip:x86/urgent] " tip-bot for Oleg Nesterov
2010-02-16 14:02             ` [PATCH 2/3] x86: set_personality_ia32() abuses TS_COMPAT Oleg Nesterov
2010-02-16 15:40               ` Linus Torvalds
2010-02-16 17:16                 ` Oleg Nesterov [this message]
2010-02-16 17:38                   ` H. Peter Anvin
2010-02-16 17:44                 ` Oleg Nesterov
2010-02-16 17:51                   ` H. Peter Anvin
2010-02-17 15:40                     ` Oleg Nesterov
2010-02-16 18:43                   ` Linus Torvalds
2010-02-16 14:03             ` [PATCH 3/3] x86: ELF_PLAT_INIT() shouldn't worry about TIF_IA32 Oleg Nesterov
2010-02-16 14:24               ` Oleg Nesterov

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=20100216171614.GA23503@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).