Preempt is irrelevant here. To make any difference, there would have
to be an interrupt in the window between reading and updating
p->user->processes _and_ another process would have to be waiting to
enter fork(). Even if that occurred, the result is the user is one
process over their limit, big deal.
>> timing constraints on that small window, I would be surprised if this
>> race could be exploited to gain more than a couple of extra processes.
>> This looks like a case where close enough is good enough.
>
>There's no such thing as a tolerable race :-)
The result is just a slightly elevated process count in rare cases.
Even then it is self correcting. It is not a significant race, just a
bit of fuzzy counting.
>Anyway this code can corrupt the global variable nr_threads.
>Without the BKL it is buggy, so it has to be fixed anyway and we
>can do it right.
nr_threads is protected by tasklist_lock. How on earth can fuzzy
counting on user->processes corrupt nr_threads?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/