Re: [uml-devel] FP registers corruption
Stanislav Meduna wrote: >>> Same here with 2.6.26.2 :( >> >> Hmmm. If it's not a problem there, I'm tempted to call it fixed, >> whatever it was. Can you check current 2.6.27-rc? > > OK, I'll try to convince my provider to test 2.6.26.2 and > possibly 27-rc soon - I'll let you know of the result. Sorry for the late response. My provider compiled 2.6.26.3 and the problem is still here :( I'll try to get the host config from him and to reproduce it in a clean environment with the similar config as he has (2.6.23.17 + skas3, i tried with current and without skas). Is the skas3 patch still maintained? He doesn't want to switch to SKAS4 yet, as it is marked experimental and requires building from the same tree, which he does not want. -- Stano - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [PATCH 1/1] system call notification with self_ptrace
Subject: [PATCH] system call notification with self_ptrace
From: Pierre Morel <[EMAIL PROTECTED]>
PTRACE SELF
This patch adds a new functionality to ptrace: system call notification to
the current process.
When a process requests self ptrace, with the new request PTRACE_SELF_ON:
1. the next system call performed by the process will not be executed
2. self ptrace will be disabled for the process
3. a SIGSYS signal will be sent to the process.
With an appropriate SIGSYS signal handler, the process can access its own
data structures to
1. get the system call number from the siginfo structure
2. get the system call arguments from the stack
3. instrument the system call with other system calls
4. emulate the system call with other system calls
5. change the arguments of the system call
6. perform the system call for good
7. change the return value of the system call
8. request self ptrace again before returning.
The new request PTRACE_SELF_OFF disables self ptrace.
Signed-off-by: Pierre Morel <[EMAIL PROTECTED]>
Signed-off-by: Volker Sameske <[EMAIL PROTECTED]>
---
arch/s390/kernel/ptrace.c | 16
arch/s390/kernel/signal.c |5 +
arch/x86/kernel/ptrace.c | 29 +
arch/x86/kernel/signal_32.c |5 +
arch/x86/kernel/signal_64.c |5 +
include/asm-generic/siginfo.h |6 ++
include/linux/ptrace.h| 18 ++
include/linux/sched.h |1 +
kernel/ptrace.c | 32
9 files changed, 117 insertions(+)
Index: linux-2.6.26/arch/s390/kernel/ptrace.c
===
--- linux-2.6.26.orig/arch/s390/kernel/ptrace.c
+++ linux-2.6.26/arch/s390/kernel/ptrace.c
@@ -583,6 +583,22 @@ syscall_trace(struct pt_regs *regs, int
if (!test_thread_flag(TIF_SYSCALL_TRACE))
goto out;
+
+ if (is_self_ptracing(regs->gprs[2])) {
+ if (!entryexit) {
+ struct siginfo info;
+
+ memset(&info, 0, sizeof(struct siginfo));
+ info.si_signo = SIGSYS;
+ info.si_code = SYS_SYSCALL;
+ info.si_errno = regs->gprs[2];
+ info.si_addr = (void *)regs->orig_gpr2;
+ send_sig_info(SIGSYS, &info, current);
+ regs->gprs[2] = -1;
+ }
+ return;
+ }
+
if (!(current->ptrace & PT_PTRACED))
goto out;
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
Index: linux-2.6.26/arch/s390/kernel/signal.c
===
--- linux-2.6.26.orig/arch/s390/kernel/signal.c
+++ linux-2.6.26/arch/s390/kernel/signal.c
@@ -409,6 +409,11 @@ handle_signal(unsigned long sig, struct
spin_unlock_irq(¤t->sighand->siglock);
}
+ if (current->instrumentation) {
+ clear_thread_flag(TIF_SYSCALL_TRACE);
+ current->instrumentation &= ~PTS_SELF;
+ }
+
return ret;
}
Index: linux-2.6.26/arch/x86/kernel/ptrace.c
===
--- linux-2.6.26.orig/arch/x86/kernel/ptrace.c
+++ linux-2.6.26/arch/x86/kernel/ptrace.c
@@ -1394,6 +1394,19 @@ int do_syscall_trace(struct pt_regs *reg
if (!entryexit)
secure_computing(regs->orig_ax);
+ if (is_self_ptracing(regs->orig_ax)) {
+ if (!entryexit) {
+ struct siginfo info;
+
+ memset(&info, 0, sizeof(struct siginfo));
+ info.si_signo = SIGSYS;
+ info.si_code = SYS_SYSCALL;
+ info.si_addr = (void *) regs->orig_ax;
+ send_sig_info(SIGSYS, &info, current);
+ }
+ return 1; /* Skip system call, deliver signal. */
+ }
+
if (unlikely(current->audit_context)) {
if (entryexit)
audit_syscall_exit(AUDITSC_RESULT(regs->ax),
@@ -1486,6 +1499,18 @@ asmlinkage void syscall_trace_enter(stru
/* do the secure computing check first */
secure_computing(regs->orig_ax);
+ if (is_self_ptracing(regs->orig_ax)) {
+ struct siginfo info;
+
+ memset(&info, 0, sizeof(struct siginfo));
+ info.si_signo = SIGSYS;
+ info.si_code = SYS_SYSCALL;
+ info.si_addr = (void *) regs->orig_ax;
+ send_sig_info(SIGSYS, &info, current);
+ regs->ax = -1 ;
+ return; /* Skip system call, deliver signal. */
+ }
+
if (test_thread_flag(TIF_SYSCALL_TRACE)
&& (current->ptrace & PT_PTRACED))
syscall_trace(regs);
@@ -1507,6 +1532,10 @@ asmlinkage void syscall_trace_enter(stru
as
Re: [uml-devel] [PATCH 1/1] system call notification with self_ptrace
On Mon, 08 Sep 2008 14:02:01 +0200 Pierre Morel <[EMAIL PROTECTED]> wrote: > Subject: [PATCH] system call notification with self_ptrace > > From: Pierre Morel <[EMAIL PROTECTED]> > > > PTRACE SELF > > This patch adds a new functionality to ptrace: system call notification to > the current process. > When a process requests self ptrace, with the new request PTRACE_SELF_ON: > > 1. the next system call performed by the process will not be executed > 2. self ptrace will be disabled for the process > 3. a SIGSYS signal will be sent to the process. > > With an appropriate SIGSYS signal handler, the process can access its own > data structures to > > 1. get the system call number from the siginfo structure > 2. get the system call arguments from the stack > 3. instrument the system call with other system calls > 4. emulate the system call with other system calls > 5. change the arguments of the system call > 6. perform the system call for good > 7. change the return value of the system call > 8. request self ptrace again before returning. > > The new request PTRACE_SELF_OFF disables self ptrace. > It sounds like it might be useful. Are there any userspace tools available with which people can utilise this new functionality? Or plans to release them? > arch/s390/kernel/ptrace.c | 16 > arch/s390/kernel/signal.c |5 + > arch/x86/kernel/ptrace.c | 29 + > arch/x86/kernel/signal_32.c |5 + > arch/x86/kernel/signal_64.c |5 + Maintainers of the other 30-odd architectures would appreciate a test application which they can use to develop and test their ports, please. Michael Kerrisk will no doubt be looking for manpage assistance. Please cc him on this material. It would be good to get suitable testcases integrated into LTP (if LTP has ptrace tests). The patch title uses the term "self_ptrace", but the patch itself uses the term "ptrace_self". Let's get it consistent everywhere. The patch adds a + u64 instrumentation; to the task_struct but no explanation is provided as to why this was added, why it is a 64-bit field, what its locking rules are, etc. Please fix this. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
