mbox series

[v4,0/1] Fix object remain in offline per-cpu quarantine

Message ID 1607330578-417-1-git-send-email-Kuan-Ying.Lee@mediatek.com (mailing list archive)
Headers show
Series Fix object remain in offline per-cpu quarantine | expand

Message

Kuan-Ying Lee (李冠穎) Dec. 7, 2020, 8:42 a.m. UTC
This patch fixes object remain in the offline per-cpu quarantine as
describe below.

Free objects will get into per-cpu quarantine if enable generic KASAN.
If a cpu is offline and users use kmem_cache_destroy, kernel will detect
objects still remain in the offline per-cpu quarantine and report error.

Register a cpu hotplug function to remove all objects in the offline
per-cpu quarantine when cpu is going offline. Set a per-cpu variable
to indicate this cpu is offline.

Changes since v4:
 - Rebase to linux-next
 - Remove the qlist_free for double free issue
 - Thanks Qiang, Qian

Changes since v3:
 - Add a barrier to ensure the ordering
 - Rename the init function

Changes since v2:
 - Thanks for Dmitry suggestion
 - Remove unnecessary code
 - Put offline variable into cpu_quarantine
 - Use single qlist_free_all call instead of iteration over all slabs
 - Add bug reporter in commit message

Kuan-Ying Lee (1):
  kasan: fix object remain in offline per-cpu quarantine

 mm/kasan/quarantine.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)