Skip to content

Commit

Permalink
[PATCH] uml: fix lvalue for gcc4
Browse files Browse the repository at this point in the history
      Russell King <rmk+lkml@arm.linux.org.uk>

This construct is refused by GCC 4, so here's the (corrected) fix.  Thanks to
Russell for noticing a stupid mistake I did when first sending this.

As he noted, the code is largely suboptimal however it currently works, and
will be fixed shortly.  Just read the access_ok check on fp which is NULL, or
the pointer arithmetic below which should be done with a cast to void*:

 	frame = (struct rt_sigframe __user *)
 		round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;

The code shows clearly that has been taken from
arch/x86_64/kernel/signal.c:setup_rt_frame(), maybe in a bit of a hurry.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Jul 14, 2005
1 parent 3952db6 commit bcb01b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/um/sys-x86_64/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,

frame = (struct rt_sigframe __user *)
round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
((unsigned char *) frame) -= 128;
frame = (struct rt_sigframe *) ((unsigned long) frame - 128);

if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
goto out;
Expand Down

0 comments on commit bcb01b8

Please sign in to comment.