* [CHECKER] race in 2.5.62/kernel/ptrace.c?
@ 2003-03-22 19:47 Dawson Engler
2003-03-22 21:46 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Dawson Engler @ 2003-03-22 19:47 UTC (permalink / raw)
To: linux-kernel; +Cc: Dawson Engler
Is the following unlocked use of recalc_sigpending a race?
// 2.5.62/kernel/ptrace.c:339:ptrace_notify:
void ptrace_notify(int exit_code)
{
BUG_ON (!(current->ptrace & PT_PTRACED));
/* Let the debugger run. */
current->exit_code = exit_code;
set_current_state(TASK_STOPPED);
notify_parent(current, SIGCHLD);
schedule();
/*
* Signals sent while we were stopped might set TIF_SIGPENDING.
*/
recalc_sigpending();
}
It seems that recalc_sigpending needs to be protected by
¤t->sighand->siglock
E.g.,:
2.5.62/kernel/signal.c:1656:sigprocmask:
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
2.5.62/kernel/signal.c:2115:sys_sigprocmas
spin_lock_irq(¤t->sighand->siglock);
old_set = current->blocked.sig[0];
...
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
Or does it not need a lock? (Or am I missing the lock?)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [CHECKER] race in 2.5.62/kernel/ptrace.c?
2003-03-22 19:47 [CHECKER] race in 2.5.62/kernel/ptrace.c? Dawson Engler
@ 2003-03-22 21:46 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2003-03-22 21:46 UTC (permalink / raw)
To: Dawson Engler; +Cc: linux-kernel
Dawson Engler <engler@csl.stanford.edu> wrote:
>
> Is the following unlocked use of recalc_sigpending a race?
>
> // 2.5.62/kernel/ptrace.c:339:ptrace_notify:
> void ptrace_notify(int exit_code)
> {
> BUG_ON (!(current->ptrace & PT_PTRACED));
>
> /* Let the debugger run. */
> current->exit_code = exit_code;
> set_current_state(TASK_STOPPED);
> notify_parent(current, SIGCHLD);
> schedule();
>
> /*
> * Signals sent while we were stopped might set TIF_SIGPENDING.
> */
> recalc_sigpending();
> }
>
I think so. To find out I shall send a patch to Linus and see if
I get shouted at.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-22 21:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 19:47 [CHECKER] race in 2.5.62/kernel/ptrace.c? Dawson Engler
2003-03-22 21:46 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®