mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: Russell King <rmk+lkml@arm.linux.org.uk>, jdike@addtoit.com
Cc: user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [uml-devel] Re: [patch 1/1] uml: fix lvalue for gcc4
Date: Tue, 12 Jul 2005 00:05:14 +0200	[thread overview]
Message-ID: <200507120005.14985.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20050709120703.C2175@flint.arm.linux.org.uk>

On Saturday 09 July 2005 13:07, Russell King wrote:
> On Sat, Jul 09, 2005 at 01:01:33PM +0200, blaisorblade@yahoo.it wrote:
> > diff -puN arch/um/sys-x86_64/signal.c~uml-fix-for-gcc4-lvalue
> > arch/um/sys-x86_64/signal.c ---
> > linux-2.6.git/arch/um/sys-x86_64/signal.c~uml-fix-for-gcc4-lvalue	2005-07
> >-09 13:01:03.000000000 +0200 +++
> > linux-2.6.git-paolo/arch/um/sys-x86_64/signal.c	2005-07-09
> > 13:01:03.000000000 +0200 @@ -168,7 +168,7 @@ int
> > setup_signal_stack_si(unsigned long
> >
> >  	frame = (struct rt_sigframe __user *)
> >  		round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
> > -	((unsigned char *) frame) -= 128;
> > +	frame -= 128 / sizeof(frame);
>
> Are you sure these two are identical?
SOOOOOOOOORRY, I've become crazy, I meant sizeof(*frame)... thanks for 
noticing.

> The above code fragment looks suspicious anyway, particularly:
>
>  	frame = (struct rt_sigframe __user *)
>  		round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
>
> which will put the frame at 8 * sizeof(struct rt_sigframe) below
> the point which round_down() would return (which would be 1 struct
> rt_sigframe below stack_top, rounded down).

You're completely right.

The code is copied from arch/x86_64/kernel/signal.c:setup_rt_frame(), so it 
should make some sense; but in the source, the cast is to (void*).

Surely Jeff, seeing that the result is assigned to a struct rt_sigframe 
__user, "fixed" it. The line I'm patching is new from Jeff, and I don't know 
what's about (I just remember that 

Also, the below access_ok() called on fp (which is still NULL) is surely 
completely wrong, though it won't fail (after all, NULL is under TASK_SIZE. 
right?).

On x86_64 the code is always used from arch/um/kernel/signal_kern.c, since 
CONFIG_whatever is not enabled.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

      parent reply	other threads:[~2005-07-11 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-09 11:01 blaisorblade
2005-07-09 11:07 ` Russell King
2005-07-11 19:12   ` unregister_netdevice: waiting for tap24 to become free Peter
2005-07-11 22:20     ` [uml-devel] " Blaisorblade
2005-07-11 22:26       ` Peter
2005-07-11 22:47         ` Blaisorblade
2005-07-14  9:20           ` [uml-devel] " Peter
2005-07-11 22:05   ` Blaisorblade [this message]

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=200507120005.14985.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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®