sparc32.patch 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. commit 07b5ab3f71d318e52c18cc3b73c1d44c908aacfa
  2. Author: Andreas Larsson <andreas@gaisler.com>
  3. Date: Wed Nov 9 10:43:05 2016 +0100
  4. sparc32: Fix inverted invalid_frame_pointer checks on sigreturns
  5. Signed-off-by: Andreas Larsson <andreas@gaisler.com>
  6. Signed-off-by: David S. Miller <davem@davemloft.net>
  7. diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
  8. index c3c12ef..9c0c8fd 100644
  9. --- a/arch/sparc/kernel/signal_32.c
  10. +++ b/arch/sparc/kernel/signal_32.c
  11. @@ -89,7 +89,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
  12. sf = (struct signal_frame __user *) regs->u_regs[UREG_FP];
  13. /* 1. Make sure we are not getting garbage from the user */
  14. - if (!invalid_frame_pointer(sf, sizeof(*sf)))
  15. + if (invalid_frame_pointer(sf, sizeof(*sf)))
  16. goto segv_and_exit;
  17. if (get_user(ufp, &sf->info.si_regs.u_regs[UREG_FP]))
  18. @@ -150,7 +150,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
  19. synchronize_user_stack();
  20. sf = (struct rt_signal_frame __user *) regs->u_regs[UREG_FP];
  21. - if (!invalid_frame_pointer(sf, sizeof(*sf)))
  22. + if (invalid_frame_pointer(sf, sizeof(*sf)))
  23. goto segv;
  24. if (get_user(ufp, &sf->regs.u_regs[UREG_FP]))