* [PATCH] - Missing check for TIF_WORK if trace/audit enabled
@ 2006-02-15 21:29 Jack Steiner
2006-02-16 1:03 ` Chen, Kenneth W
2006-02-16 1:46 ` Jack Steiner
0 siblings, 2 replies; 3+ messages in thread
From: Jack Steiner @ 2006-02-15 21:29 UTC (permalink / raw)
To: linux-ia64
It appears that if trace/audit is enabled, the kernel fails to
check for pending work before returning to user mode.
Signed-off-by: Jack Steiner <steiner@sgi.com>
---
Tony / Ken - check this carefully. This is not easy code to understand :-)
I noticed the problem running a signal test that sent SIGUSR2 signals to
itself. Signals were being dropped. I isolated the problem to an uninitialzed
p6:
ia64_trace_syscall -> work_pending_syscall_end -> work_processed_syscall
work_processed_syscall assumes p6 indicates if the kernel is returning to user mode.
Nothing set p6 for this particular path.
Index: linux/arch/ia64/kernel/entry.S
=================================--- linux.orig/arch/ia64/kernel/entry.S 2006-02-15 12:32:49.836316366 -0600
+++ linux/arch/ia64/kernel/entry.S 2006-02-15 15:09:49.983620290 -0600
@@ -569,6 +569,7 @@ GLOBAL_ENTRY(ia64_trace_syscall)
.mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
.mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
+(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
.ret3: br.cond.sptk .work_pending_syscall_end
strace_error:
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] - Missing check for TIF_WORK if trace/audit enabled
2006-02-15 21:29 [PATCH] - Missing check for TIF_WORK if trace/audit enabled Jack Steiner
@ 2006-02-16 1:03 ` Chen, Kenneth W
2006-02-16 1:46 ` Jack Steiner
1 sibling, 0 replies; 3+ messages in thread
From: Chen, Kenneth W @ 2006-02-16 1:03 UTC (permalink / raw)
To: linux-ia64
Jack Steiner wrote on Wednesday, February 15, 2006 1:29 PM
> It appears that if trace/audit is enabled, the kernel fails to
> check for pending work before returning to user mode.
>
> Tony / Ken - check this carefully. This is not easy code to understand :-)
>
> I noticed the problem running a signal test that sent SIGUSR2 signals to
> itself. Signals were being dropped. I isolated the problem to an uninitialzed
> p6:
Jack, I agree with this fix. The only request I have is to move the .ret3
label up before cmp inst, so cmp and br end up in the same instruction bundle
instead of two right now.
> Index: linux/arch/ia64/kernel/entry.S
> =================================> --- linux.orig/arch/ia64/kernel/entry.S 2006-02-15 12:32:49.836316366 -0600
> +++ linux/arch/ia64/kernel/entry.S 2006-02-15 15:09:49.983620290 -0600
> @@ -569,6 +569,7 @@ GLOBAL_ENTRY(ia64_trace_syscall)
> .mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
> .mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
> br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
> +(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
> .ret3: br.cond.sptk .work_pending_syscall_end
>
> strace_error:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] - Missing check for TIF_WORK if trace/audit enabled
2006-02-15 21:29 [PATCH] - Missing check for TIF_WORK if trace/audit enabled Jack Steiner
2006-02-16 1:03 ` Chen, Kenneth W
@ 2006-02-16 1:46 ` Jack Steiner
1 sibling, 0 replies; 3+ messages in thread
From: Jack Steiner @ 2006-02-16 1:46 UTC (permalink / raw)
To: linux-ia64
It appears that if auditing is enabled, the kernel fails to
check for pending signals before returning to user mode.
Signed-off-by: Jack Steiner <steiner@sgi.com>
---
Tony - I think this should go into 2.6.16
Second version. Moved the ".ret" label as suggested by Ken.
I noticed the problem running a signal test that sent SIGUSR2 signals to
itself. Signals were being dropped. I isolated the problem to an uninitialzed
p6:
ia64_trace_syscall -> work_pending_syscall_end -> work_processed_syscall
work_processed_syscall assumes p6 indicates if the kernel is returning to user mode.
Nothing set p6 for this particular path.
Index: linux/arch/ia64/kernel/entry.S
=================================--- linux.orig/arch/ia64/kernel/entry.S 2006-02-15 12:32:49.836316366 -0600
+++ linux/arch/ia64/kernel/entry.S 2006-02-15 19:35:24.539592133 -0600
@@ -569,7 +569,9 @@ GLOBAL_ENTRY(ia64_trace_syscall)
.mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
.mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
-.ret3: br.cond.sptk .work_pending_syscall_end
+.ret3:
+(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
+ br.cond.sptk .work_pending_syscall_end
strace_error:
ld8 r3=[r2] // load pt_regs.r8
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-16 1:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-15 21:29 [PATCH] - Missing check for TIF_WORK if trace/audit enabled Jack Steiner
2006-02-16 1:03 ` Chen, Kenneth W
2006-02-16 1:46 ` Jack Steiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox