Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161713 Details for
Bug 247174
bogus arguments to PTRACE_POKEUSER makes IA64 kernel crash
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
ia64 utrace update
utrace-update-for-rhel5.2.patch (text/plain), 6.34 KB, created by
Luming Yu
on 2007-08-17 02:35:07 UTC
(
hide
)
Description:
ia64 utrace update
Filename:
MIME Type:
Creator:
Luming Yu
Created:
2007-08-17 02:35:07 UTC
Size:
6.34 KB
patch
obsolete
>diff -Bru linux-2.6.18.ia64.0/arch/ia64/kernel/process.c linux-2.6.18.ia64/arch/ia64/kernel/process.c >--- linux-2.6.18.ia64.0/arch/ia64/kernel/process.c 2007-08-17 00:55:32.000000000 -0400 >+++ linux-2.6.18.ia64/arch/ia64/kernel/process.c 2007-08-17 00:59:50.000000000 -0400 >@@ -174,6 +174,10 @@ > /* deal with pending signal delivery */ > if (test_thread_flag(TIF_SIGPENDING)) > ia64_do_signal(oldset, scr, in_syscall); >+ >+ /* copy user rbs to kernel rbs */ >+ if (test_thread_flag(TIF_PTRACED)) >+ ia64_sync_krbs(current); > } > > static int pal_halt = 1; >diff -Bru linux-2.6.18.ia64.0/arch/ia64/kernel/ptrace.c linux-2.6.18.ia64/arch/ia64/kernel/ptrace.c >--- linux-2.6.18.ia64.0/arch/ia64/kernel/ptrace.c 2007-08-17 00:55:32.000000000 -0400 >+++ linux-2.6.18.ia64/arch/ia64/kernel/ptrace.c 2007-08-17 01:13:13.000000000 -0400 >@@ -554,6 +554,25 @@ > return 0; > } > >+long >+ia64_sync_kernel_rbs (struct task_struct *child, struct switch_stack *sw, >+ unsigned long user_rbs_start, unsigned long user_rbs_end) >+{ >+ unsigned long addr, val; >+ long ret; >+ >+ /* now copy word for word from user rbs to kernel rbs: */ >+ for (addr = user_rbs_start; addr < user_rbs_end; addr += 8) { >+ if (access_process_vm(child, addr, &val, sizeof(val), 0) >+ != sizeof(val)) >+ return -EIO; >+ ret = ia64_poke(child, sw, user_rbs_end, addr, val); >+ if (ret < 0) >+ return ret; >+ } >+ return 0; >+} >+ > /* > * Write f32-f127 back to task->thread.fph if it has been modified. > */ >@@ -728,6 +747,10 @@ > if (test_thread_flag(TIF_SYSCALL_TRACE)) > tracehook_report_syscall(®s, 0); > >+ /* copy user rbs to kernel rbs */ >+ if (test_thread_flag(TIF_PTRACED)) >+ ia64_sync_krbs(current); >+ > if (unlikely(current->audit_context)) { > long syscall; > int arch; >@@ -1003,10 +1026,14 @@ > *data = cfm; > return 0; > case ELF_CR_IPSR_OFFSET: >- if (write_access) >- pt->cr_ipsr = ((*data & IPSR_MASK) >+ if (write_access) { >+ unsigned long tmp = *data; >+ /* psr.ri bits 11 are reserved */ >+ if ((tmp & IA64_PSR_RI) == IA64_PSR_RI) >+ tmp &= ~IA64_PSR_RI; >+ pt->cr_ipsr = ((tmp & IPSR_MASK) > | (pt->cr_ipsr & ~IPSR_MASK)); >- else >+ } else > *data = (pt->cr_ipsr & IPSR_MASK); > return 0; > } >@@ -1419,6 +1446,27 @@ > return do_regset_call(do_gpregs_writeback, target, regset, 0, 0, NULL, NULL); > } > >+static void do_gpregs_readback(struct unw_frame_info *info, void *arg) >+{ >+ struct pt_regs *pt; >+ utrace_getset_t *dst = arg; >+ unsigned long urbs_end; >+ >+ if (unw_unwind_to_user(info) < 0) >+ return; >+ pt = task_pt_regs(dst->target); >+ urbs_end = ia64_get_user_rbs_end(dst->target, pt, NULL); >+ dst->ret = ia64_sync_kernel_rbs(dst->target, info->sw, pt->ar_bspstore, urbs_end); >+} >+/* >+ * This is called to read back the register backing store. >+ */ >+long ia64_sync_krbs(struct task_struct *target) >+{ >+ clear_tsk_thread_flag(target, TIF_PTRACED); >+ return do_regset_call(do_gpregs_readback, target, NULL, 0, 0, NULL, NULL); >+} >+ > static int > fpregs_active(struct task_struct *target, const struct utrace_regset *regset) > { >diff -Bru linux-2.6.18.ia64.0/include/asm-ia64/ptrace.h linux-2.6.18.ia64/include/asm-ia64/ptrace.h >--- linux-2.6.18.ia64.0/include/asm-ia64/ptrace.h 2007-08-17 00:55:37.000000000 -0400 >+++ linux-2.6.18.ia64/include/asm-ia64/ptrace.h 2007-08-17 00:57:00.000000000 -0400 >@@ -292,6 +292,7 @@ > unsigned long, long); > extern void ia64_flush_fph (struct task_struct *); > extern void ia64_sync_fph (struct task_struct *); >+ extern long ia64_sync_krbs(struct task_struct *); > extern long ia64_sync_user_rbs (struct task_struct *, struct switch_stack *, > unsigned long, unsigned long); > >diff -Bru linux-2.6.18.ia64.0/include/asm-ia64/thread_info.h linux-2.6.18.ia64/include/asm-ia64/thread_info.h >--- linux-2.6.18.ia64.0/include/asm-ia64/thread_info.h 2007-08-17 00:55:37.000000000 -0400 >+++ linux-2.6.18.ia64/include/asm-ia64/thread_info.h 2007-08-17 01:06:33.000000000 -0400 >@@ -85,6 +85,7 @@ > #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ > #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ > #define TIF_SINGLESTEP 5 /* restore singlestep on return to user mode */ >+#define TIF_PTRACED 6 /* task is ptraced */ > #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ > #define TIF_MEMDIE 17 > #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ >@@ -93,6 +94,7 @@ > #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) > #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) > #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) >+#define _TIF_PTRACED (1 << TIF_PTRACED) > #define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP) > #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) > #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) >@@ -102,7 +104,7 @@ > #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) > > /* "work to do on user-return" bits */ >-#define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) >+#define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_PTRACED) > /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ > #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) > >diff -Bru linux-2.6.18.ia64.0/kernel/ptrace.c linux-2.6.18.ia64/kernel/ptrace.c >--- linux-2.6.18.ia64.0/kernel/ptrace.c 2007-08-17 00:55:52.000000000 -0400 >+++ linux-2.6.18.ia64/kernel/ptrace.c 2007-08-17 00:57:00.000000000 -0400 >@@ -477,8 +477,9 @@ > */ > regset = utrace_regset(task, engine, > utrace_native_view(task), 0); >- if (regset->writeback) >- (*regset->writeback)(task, regset, 1); >+ if (!test_and_set_tsk_thread_flag(task, TIF_PTRACED)) >+ if (regset->writeback) >+ (*regset->writeback)(task, regset, 1); > } > > pr_debug("%d ptrace_attach %d complete (%sstopped)" >@@ -1620,8 +1621,9 @@ > * ptrace_start in our tracer doing a PTRACE_PEEKDATA or the like. > */ > regset = utrace_regset(tsk, engine, utrace_native_view(tsk), 0); >- if (regset->writeback) >- (*regset->writeback)(tsk, regset, 0); >+ if (!test_and_set_tsk_thread_flag(tsk, TIF_PTRACED)) >+ if (regset->writeback) >+ (*regset->writeback)(tsk, regset, 0); > > return UTRACE_ACTION_RESUME; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247174
:
158614
| 161713