diff options
author | Helge Deller <deller@gmx.de> | 2018-08-16 16:33:04 -0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2018-08-17 10:45:31 -0400 |
commit | b6fc0cccb6b35815a7d1cfc9279cdbfc2c61d00d (patch) | |
tree | 17a4841baf246e3a0c3f2e5b37e2b2cc40fc3a6b | |
parent | 5b00ca0b8035e49ef7c466e959c5cb457a654351 (diff) |
parisc: Fix ptraced 64-bit applications to call 64-bit syscalls
Fix the strace code path to call 64-bit syscalls in case we are
executing by a 64-bit application.
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/kernel/syscall.S | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 5f7e57fcaeef..be451766e9d0 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
@@ -227,8 +227,7 @@ linux_gateway_entry: | |||
227 | or,= %r2,%r2,%r2 | 227 | or,= %r2,%r2,%r2 |
228 | ldo R%sys_call_table64(%r1), %r19 | 228 | ldo R%sys_call_table64(%r1), %r19 |
229 | #else | 229 | #else |
230 | ldil L%sys_call_table, %r1 | 230 | load32 sys_call_table, %r19 |
231 | ldo R%sys_call_table(%r1), %r19 | ||
232 | #endif | 231 | #endif |
233 | comiclr,>> __NR_Linux_syscalls, %r20, %r0 | 232 | comiclr,>> __NR_Linux_syscalls, %r20, %r0 |
234 | b,n .Lsyscall_nosys | 233 | b,n .Lsyscall_nosys |
@@ -331,8 +330,6 @@ tracesys_next: | |||
331 | * task->thread.regs.gr[20] above. | 330 | * task->thread.regs.gr[20] above. |
332 | */ | 331 | */ |
333 | copy %ret0,%r20 | 332 | copy %ret0,%r20 |
334 | ldil L%sys_call_table,%r1 | ||
335 | ldo R%sys_call_table(%r1), %r19 | ||
336 | 333 | ||
337 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ | 334 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ |
338 | LDREG TI_TASK(%r1), %r1 | 335 | LDREG TI_TASK(%r1), %r1 |
@@ -354,6 +351,23 @@ tracesys_next: | |||
354 | comiclr,>> __NR_Linux_syscalls, %r20, %r0 | 351 | comiclr,>> __NR_Linux_syscalls, %r20, %r0 |
355 | b,n .Ltracesys_nosys | 352 | b,n .Ltracesys_nosys |
356 | 353 | ||
354 | /* Note! We cannot use the syscall table that is mapped | ||
355 | nearby since the gateway page is mapped execute-only. */ | ||
356 | |||
357 | #ifdef CONFIG_64BIT | ||
358 | LDREG TASK_PT_GR30(%r1), %r19 /* get users sp back */ | ||
359 | extrd,u %r19,63,1,%r2 /* W hidden in bottom bit */ | ||
360 | |||
361 | ldil L%sys_call_table, %r1 | ||
362 | or,= %r2,%r2,%r2 | ||
363 | addil L%(sys_call_table64-sys_call_table), %r1 | ||
364 | ldo R%sys_call_table(%r1), %r19 | ||
365 | or,= %r2,%r2,%r2 | ||
366 | ldo R%sys_call_table64(%r1), %r19 | ||
367 | #else | ||
368 | load32 sys_call_table, %r19 | ||
369 | #endif | ||
370 | |||
357 | LDREGX %r20(%r19), %r19 | 371 | LDREGX %r20(%r19), %r19 |
358 | 372 | ||
359 | /* If this is a sys_rt_sigreturn call, and the signal was received | 373 | /* If this is a sys_rt_sigreturn call, and the signal was received |