Re: mpol_to_str revisited.

From: David Rientjes
Date: Mon Oct 08 2012 - 16:46:32 EST


On Mon, 8 Oct 2012, Dave Jones wrote:

> If pol->mode was poisoned, that smells like we have a race where policy is getting freed
> while another process is reading it.
>
> Am I missing something, or is there no locking around that at all ?
>

The only thing that is held during the read() is a reference to the
task_struct so it doesn't disappear from under us. The protection needed
for a task's mempolicy, however, is task_lock() and that is not held.
--
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/