mm/kasan: Detect double-free involving kfree_rcu_sheaf().
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 5 repliesIn review 1 of 2 applied
- v22 patches 5 repliesSuperseded
- v12 patches 6 repliesSuperseded
Changes in v3 from the cover letter
* Collect Alexander and Andrey tags
* Patch 2
* Move migrate_disable() before p = kmem_cache_alloc()
* add KASAN_TEST_NEEDS_CONFIG_OFF() for PREEMPT_RT
Patches in v3 1 of 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm/kasan: Detect double-free involving kfree_rcu_sheaf().include/ mm/ mm/ +2 more | +78 | 2 replies | |
| 2/2 | mm/kasan/kunit: Add double-free tests involving kfree_rcu_sheaf().mm/ | +139 | 3 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Vlastimil Babka (SUSE) | Alexander Potapenko | Andrey Ryabinin |
|---|---|---|---|
| 1/2 | A-b | T-b R-b | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v3 0/2] mm/kasan: Detect double-free involving kfree_rcu_sheaf().
Recently, syzbot has reported several weird use-after-free splats.
What they have in common is that "Freed by" points to rcu_free_sheaf(), whereas the object shown in "Call Trace:" and "Allocated by" is never supposed to be freed via kfree_rcu().
This means the object was a victim of a double-free somewhere else and was silently poisoned by rcu_free_sheaf() after being reallocated.
This happens because kfree_rcu_sheaf() queues an object into the RCU sheaf without invoking any KASAN hooks.
This series enables KASAN to detect double-free involving kfree_rcu_sheaf() immediately and adds KUnit tests for it.
Changes:
v3:
* Collect Alexander and Andrey tags
* Patch 2
* Move migrate_disable() before p = kmem_cache_alloc()
* add KASAN_TEST_NEEDS_CONFIG_OFF() for PREEMPT_RT
v2: https://lore.kernel.org/linux-mm/[email protected]/
* Patch 1
* Collect Vlastimil and Alexander tags
* Add Fixes tag
* Add kdoc for @after_rcu_delay of kasan_slab_pre_free()
* Rename s/kasan_record_aux_stack_rcu/kasan_mark_rcu_free_pending/g
* Add comment for __kasan_record_aux_stack()
* Patch 2
* Move kasan_byte_accessible() check and kvfree_rcu_barrier_on_cache() after switch
v1: https://lore.kernel.org/linux-mm/[email protected]/
Kuniyuki Iwashima (2):
mm/kasan: Detect double-free involving kfree_rcu_sheaf(). mm/kasan/kunit: Add double-free tests involving kfree_rcu_sheaf().
include/linux/kasan.h | 15 +++-- mm/kasan/common.c | 13 ++-- mm/kasan/generic.c | 17 ++++- mm/kasan/kasan.h | 34 +++++++++- mm/kasan/kasan_test_c.c | 139 ++++++++++++++++++++++++++++++++++++++++ mm/slub.c | 13 +++- 6 files changed, 217 insertions(+), 14 deletions(-)
Signature · 1 line
2.56.0.313.g2479322e68-goog