diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-11 03:07:40 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-11 15:50:29 +0200 |
commit | f57c2d64bfc646c16fd1f30c8e3557183f8a5369 (patch) | |
tree | 8d5c9f497b1070e757454fabc37ed7749b49be2c /src/queueing.c | |
parent | 8f03a5a22c3de97473a562a7cfe76c6fde674b0e (diff) |
receive: disable bh before using stats seq lock
Otherwise we might get a situation like this:
CPU0 CPU1
---- ----
lock(tstats lock);
local_irq_disable();
lock(queue lock);
lock(tstats lock);
<Interrupt>
lock(queue lock);
CPU1 is waiting for CPU0 to release tstats lock. But CPU0, in the
interrupt handler, is waiting for CPU1 to release queue lock. The
solution is to disable interrupts on CPU0, so that this can't happen.
Note that this only affects 32-bit, since u64_stats_update_begin nops
out on native 64-bit platforms.
Reported-by: René van Dorst <opensource@vdorst.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/queueing.c')
0 files changed, 0 insertions, 0 deletions