Re: [PATCH tracing/kprobes] kprobes: Disable booster whenCONFIG_PREEMPT=y

From: Mathieu Desnoyers
Date: Fri Jan 29 2010 - 12:33:20 EST


* Peter Zijlstra (peterz@xxxxxxxxxxxxx) wrote:
> On Fri, 2010-01-29 at 12:08 -0500, Mathieu Desnoyers wrote:
> >
> > If a task is set as stopped, and the preempted before calling schedule,
> > can this result in a preempted task staying in that state for an
> > arbitrary long period of time ? Or is there some mechanism prohibiting
> > that in the scheduler ?
>
> PREEMPT_ACTIVE does that:
>
> preempt_schedule()
> add_preempt_count(PREEMPT_ACTIVE);
> schedule();
>
>
> schedule()
> if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
> if (unlikely(signal_pending_state(prev->state, prev)))
> prev->state = TASK_RUNNING;
> else
> deactivate_task(rq, prev, 1);
> switch_count = &prev->nvcsw;
> }

OK, it looks safe for preemption. Is there any unforeseen weird way a
task can be scheduled out and stopped that would permit it to either:

- stall the algorithm forever (DoS)
- appear as quiescent to the algorithm while its stack would hold return
pointers to incorrect locations

?

I'm concerned about page faults here.

Thanks,

Mathieu

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/