Skip to content

mm: Fix vmap_area_lock deadlock

Waiman Long requested to merge llong1/centos-stream-9:rhel18440_vmap into main

JIRA: https://issues.redhat.com/browse/RHEL-18440
MR: !3479 (merged)

The third change listed in commit d319f344561d ("mm: Fix copy_from_user_nofault().") is relevant to fixing the deadlock.

  • __copy_from_user_inatomic() under CONFIG_HARDENED_USERCOPY is calling check_object_size()->__check_object_size()->check_heap_object()->find_vmap_area()->spin_lock() which is not safe to do from bpf, [ke]probe and perf due to potential deadlock.

The mm/usercopy.c hunk will make sure that copy_from_user_nofault() will not cause find_vmap_area() which takes the vmap_area_lock from being called.

Signed-off-by: Waiman Long longman@redhat.com

Edited by Waiman Long

Merge request reports