Comment 4 for bug 161795

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

The original cause of this patch appears to be http://www.ussg.indiana.edu/hypermail/linux/kernel/0509.3/1322.html, where Oleg Nesterov proposes moving TASK_NONINTERACTIVE to attempt to avoid it being caught by < and > in state checks.

In that thread, Oleg asks why the specific line we are testing is the way it is; noting that it would appear to imply that WNOWAIT for TASK_PTRACED is illegal:
http://www.ussg.indiana.edu/hypermail/linux/kernel/0509.3/1763.html -- he proposes a patch to remove the check altogether.

Linus argues that it is correct for reasons that baffle me: http://www.ussg.indiana.edu/hypermail/linux/kernel/0509.3/1774.html

Oleg argues that it's ok to wait() so must be ok to WNOWAIT: http://www.ussg.indiana.edu/hypermail/linux/kernel/0510.0/0036.html

Roland pitches in with an even more unlikely patch, http://www.ussg.indiana.edu/hypermail/linux/kernel/0510.0/0112.html -- so it appears that this check is to make sure that the ptraceness doesn't "go away" during this code.

That appears to be the end of the thread; the code was changed from > TASK_STOPPED to & TASK_TRACED and otherwise left as it was.