Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] uml: fix signal frame alignment

Use the same signal frame alignment calculations as the underlying
architecture. x86_64 appeared to do this, but the "- 8" was really
subtracting 8 * sizeof(struct rt_sigframe) rather than 8 bytes.

UML/i386 might have been OK, but I changed the calculation to match
i386 just to be sure.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: <stable@kernel.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Antoine Martin <antoine@nagafix.co.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jeff Dike and committed by
Linus Torvalds
3896625d 99abaf51

+5 -3
+2 -1
arch/um/sys-i386/signal.c
··· 219 219 unsigned long save_sp = PT_REGS_SP(regs); 220 220 int err = 0; 221 221 222 - stack_top &= -8UL; 222 + /* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */ 223 + stack_top = ((stack_top + 4) & -16UL) - 4; 223 224 frame = (struct sigframe __user *) stack_top - 1; 224 225 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 225 226 return 1;
+3 -2
arch/um/sys-x86_64/signal.c
··· 191 191 struct task_struct *me = current; 192 192 193 193 frame = (struct rt_sigframe __user *) 194 - round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 195 - frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128); 194 + round_down(stack_top - sizeof(struct rt_sigframe), 16); 195 + /* Subtract 128 for a red zone and 8 for proper alignment */ 196 + frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128 - 8); 196 197 197 198 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 198 199 goto out;