Fix: Use after free in rcu_barrier()
authorKeir Fraser <keir@cohodata.com>
Sat, 19 Apr 2014 19:59:01 +0000 (15:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 20 Apr 2014 13:12:38 +0000 (09:12 -0400)
commit60e5f96dc8e2ca1dc07c0ab92385fa5c3bad77d0
tree70bcf8c7ad97e3f197ad48b978382d66c66c72c7
parent4fdcbc21f1039e67a80ed504d31383115e5f8052
Fix: Use after free in rcu_barrier()

Do not free the rcu_barrier() completion struct until all threads are
done with it.

It cannot reside on the waiter's stack as rcu_barrier() may return
before the call_rcu handlers have finished checking whether it needs a
futex wakeup. Instead we dynamically allocate the structure and
determine its lifetime with a reference count.

Signed-off-by: Keir Fraser <keir@cohodata.com>
[ Edit by Mathieu Desnoyers: use urcu/ref.h. Cleanup: use
  uatomic_sub_return() rather than uatomic_add_return() with negative
  value. ]
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-call-rcu-impl.h
This page took 0.024824 seconds and 4 git commands to generate.