Files
linux/arch/ia64/include/asm
Sergei Trofimovich e77d5abccd ia64: fix user_stack_pointer() for ptrace()
commit 7ad1e36616 upstream.

ia64 has two stacks:

 - memory stack (or stack), pointed at by by r12

 - register backing store (register stack), pointed at by
   ar.bsp/ar.bspstore with complications around dirty
   register frame on CPU.

In [1] Dmitry noticed that PTRACE_GET_SYSCALL_INFO returns the register
stack instead memory stack.

The bug comes from the fact that user_stack_pointer() and
current_user_stack_pointer() don't return the same register:

  ulong user_stack_pointer(struct pt_regs *regs) { return regs->ar_bspstore; }
  #define current_user_stack_pointer() (current_pt_regs()->r12)

The change gets both back in sync.

I think ptrace(PTRACE_GET_SYSCALL_INFO) is the only affected user by
this bug on ia64.

The change fixes 'rt_sigreturn.gen.test' strace test where it was
observed initially.

Link: https://bugs.gentoo.org/769614 [1]
Link: https://lkml.kernel.org/r/20210331084447.2561532-1-slyfox@gentoo.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 10:51:32 +09:00
..
2015-06-10 14:26:32 -07:00
2016-04-18 12:45:54 +02:00
2014-08-26 13:45:52 -04:00
2016-01-12 20:46:55 +02:00
2014-04-18 14:20:35 +02:00
2023-05-15 13:57:01 +09:00
2013-02-26 02:46:08 -05:00
2016-08-07 23:55:50 -04:00
2015-06-10 14:26:32 -07:00
2015-06-10 14:26:32 -07:00
2016-03-17 15:09:34 -07:00
2016-03-31 13:35:08 +02:00
2015-06-10 14:26:32 -07:00
2012-03-28 18:30:02 +01:00
2010-06-09 11:12:36 +02:00
2012-03-28 18:30:02 +01:00
2010-05-18 14:45:52 -07:00
2015-06-10 14:26:32 -07:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:02 +01:00
2013-01-03 15:57:13 -08:00
2014-08-26 13:45:52 -04:00