lib/percpu-refcount: fix use-after-free by late ->release
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | lib/percpu-refcount: support to exit refcount automatically during releasinginclude/ lib/ | +25 | 0 replies | |
| 2/3 | lib/percpu-refcount: apply PERCPU_REF_AUTO_EXITdrivers/ mm/ | +4 | 0 replies | |
| 3/3 | lib/percpu-refcount: drain ->release() in perpcu_ref_exit()include/ lib/ | +50 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] lib/percpu-refcount: fix use-after-free by late ->release
Hi,
The pattern of wait_event(percpu_ref_is_zero()) may cause percpu_ref_exit() to be called before ->release() is done, so user-after-free may be caused, fix the issue by draining ->release() in percpu_ref_exit().
Ming Lei (3):
lib/percpu-refcount: support to exit refcount automatically during
releasing
lib/percpu-refcount: apply PERCPU_REF_AUTO_EXIT lib/percpu-refcount: drain ->release() in perpcu_ref_exit()
drivers/infiniband/ulp/rtrs/rtrs-srv.c | 4 +-- include/linux/percpu-refcount.h | 36 ++++++++++++++++++++++++-- lib/percpu-refcount.c | 31 +++++++++++++++++++--- mm/memcontrol.c | 5 ++-- 4 files changed, 66 insertions(+), 10 deletions(-)
Signature · 1 line
2.38.1