Bugzilla – Attachment 31803 Details for
Bug 65236
VUL-0: kernel: ia64 ptrace local crash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
2.4 version of fix
ia64-ptrace-crash (text/plain), 3.61 KB, created by
Hubert Mantel
on 2005-03-16 10:33:42 UTC
(
hide
)
Description:
2.4 version of fix
Filename:
MIME Type:
Creator:
Hubert Mantel
Created:
2005-03-16 10:33:42 UTC
Size:
3.61 KB
patch
obsolete
>diff -urNp linux-2.4.21/arch/ia64/kernel/entry.S linux-2.4.21.SUSE/arch/ia64/kernel/entry.S >--- linux-2.4.21/arch/ia64/kernel/entry.S 2005-03-16 11:20:33.345751883 +0100 >+++ linux-2.4.21.SUSE/arch/ia64/kernel/entry.S 2005-03-16 11:31:42.545420433 +0100 >@@ -46,8 +46,11 @@ > * setup a null register window frame. > */ > ENTRY(ia64_execve) >- .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3) >- alloc loc1=ar.pfs,3,2,4,0 >+ /* >+ * Allocate 8 input registers since ptrace() may clobber them >+ */ >+ .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) >+ alloc loc1=ar.pfs,8,2,4,0 > mov loc0=rp > .body > mov out0=in0 // filename >@@ -89,8 +92,11 @@ ENTRY(ia64_execve) > END(ia64_execve) > > GLOBAL_ENTRY(sys_clone2) >- .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) >- alloc r16=ar.pfs,3,2,4,0 >+ /* >+ * Allocate 8 input registers since ptrace() may clobber them >+ */ >+ .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) >+ alloc r16=ar.pfs,8,2,4,0 > DO_SAVE_SWITCH_STACK > mov loc0=rp > mov loc1=r16 // save ar.pfs across do_fork >@@ -108,8 +114,11 @@ GLOBAL_ENTRY(sys_clone2) > END(sys_clone2) > > GLOBAL_ENTRY(sys_clone) >- .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) >- alloc r16=ar.pfs,2,2,4,0 >+ /* >+ * Allocate 8 input registers since ptrace() may clobber them >+ */ >+ .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) >+ alloc r16=ar.pfs,8,2,4,0 > DO_SAVE_SWITCH_STACK > mov loc0=rp > mov loc1=r16 // save ar.pfs across do_fork >@@ -938,7 +947,10 @@ END(sys_rt_sigsuspend) > > ENTRY(sys_rt_sigreturn) > PT_REGS_UNWIND_INFO(0) >- alloc r2=ar.pfs,0,0,1,0 >+ /* >+ * Allocate 8 input registers since ptrace() may clobber them >+ */ >+ alloc r2=ar.pfs,8,0,1,0 > .prologue > PT_REGS_SAVES(16) > adds sp=-16,sp >diff -urNp linux-2.4.21/arch/ia64/kernel/ivt.S linux-2.4.21.SUSE/arch/ia64/kernel/ivt.S >--- linux-2.4.21/arch/ia64/kernel/ivt.S 2005-03-16 11:20:33.331754128 +0100 >+++ linux-2.4.21.SUSE/arch/ia64/kernel/ivt.S 2005-03-16 11:20:52.226723605 +0100 >@@ -647,6 +647,12 @@ ENTRY(break_fault) > SAVE_REST > br.call.sptk.many rp=demine_args // clear NaT bits in (potential) syscall args > >+# demine_args exits with r2 containing the frame marker when the syscall was issued. >+ and r18=0x7f,r2 // get sof of issuer's cfm >+ extr.u r17=r2,7,7 // get sol of issuer's cfm >+ ;; >+ add r17=8,r17 // sol + 8 >+ > mov r3=255 > adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 > adds r2=IA64_TASK_PTRACE_OFFSET,r13 // r2 = ¤t->ptrace >@@ -654,6 +660,8 @@ ENTRY(break_fault) > cmp.geu p6,p7=r3,r15 // (syscall > 0 && syscall <= 1024+255) ? > movl r16=sys_call_table > ;; >+(p6) cmp.lt p7,p6=r17,r18 // frame size can't be more than local+8 >+ ;; > (p6) shladd r16=r15,3,r16 > movl r15=ia64_ret_from_syscall > (p7) adds r16=(__NR_ni_syscall-1024)*8,r16 // force __NR_ni_syscall >@@ -693,6 +701,8 @@ ENTRY(break_fault) > // NOT REACHED > END(break_fault) > >+# Ensure that the syscall arguments plus r15 (syscall number) are valid. >+# Exit with r2 containing the frame size when the syscall was issued. > ENTRY(demine_args) > alloc r2=ar.pfs,8,0,0,0 > tnat.nz p8,p0=in0 >diff -urNp linux-2.4.21/arch/ia64/kernel/process.c linux-2.4.21.SUSE/arch/ia64/kernel/process.c >--- linux-2.4.21/arch/ia64/kernel/process.c 2005-03-16 11:20:32.906822281 +0100 >+++ linux-2.4.21.SUSE/arch/ia64/kernel/process.c 2005-03-16 11:20:52.226723605 +0100 >@@ -455,7 +455,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregs > return 1; /* f0-f31 are always valid so we always return 1 */ > } > >-asmlinkage long >+long > sys_execve (char *filename, char **argv, char **envp, struct pt_regs *regs) > { > int error;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 65236
:
28493
|
28648
| 31803 |
32130
|
32962
|
32963
|
37157