small ptrace fixes
Subsystems (2)
cover small ptrace fixes
Hi,
while working on kprobes i found two small issues in ptrace.h.
Sven Schnelle (2):
parisc: regs_return_value() should return gpr28
parisc: also set iaoq_b in instruction_pointer_set()
arch/parisc/include/asm/ptrace.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/2 parisc: regs_return_value() should return gpr28
While working on kretprobes for PA-RISC i was wondering while the kprobes sanity test always fails on kretprobes. This is caused by returning gpr20 instead of gpr28.
--- arch/parisc/include/asm/ptrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/include/asm/ptrace.h +1 -1
@@ -22,7 +22,7 @@ unsigned long profile_pc(struct pt_regs *);static inline unsigned long regs_return_value (struct pt_regs *regs) { -return regs->gr[20 ]; +return regs->gr[28 ]; } static inline void instruction_pointer_set(struct pt_regs *regs,
Signature · 1 line
2.20.1
PATCH 2/2 parisc: also set iaoq_b in instruction_pointer_set()
In reply to Sven SchnelleWhen setting the instruction pointer on PA-RISC we also need to set the back of the instruction queue to the new offset, otherwise we will execute on instruction from the new location, and jumping back to the old location stored in iaoq_b.
--- arch/parisc/include/asm/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/parisc/include/asm/ptrace.h +2 -1
@@ -28,7 +28,8 @@ static inline unsigned long regs_return_value(struct pt_regs *regs)static inline void instruction_pointer_set (struct pt_regs *regs,unsigned long val) { - regs->iaoq[0 ] = val; + regs->iaoq[0 ] = val; + regs->iaoq[1 ] = val +4 ; }/* Query offset/name of register from its name/offset */
Signature · 1 line
2.20.1
Quoted 8 lines · Sven Schnelle
while working on kprobes i found two small issues in
ptrace.h.Sven Schnelle (2):
parisc:regs_return_value()should return gpr28
parisc: also setiaoq_bininstruction_pointer_set()arch/parisc/include/asm/ptrace.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Thanks, applied to my for-next tree.
Helge