diff options
| author | Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> | 2026-05-07 15:43:59 +0000 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2026-07-22 23:51:30 +0000 |
| commit | a9708e550d11a53b22d932cdbfaa10c26346a2d0 (patch) | |
| tree | 71f67f645f7c95d52368f60bfdca3ab5506f3e66 /tools/perf/scripts/python | |
| parent | 649dd135491945afa544351e3e6d4a727de87020 (diff) | |
mshv: Fix sleeping under spinlock in mshv_portid_alloc
idr_alloc() is called with GFP_KERNEL inside idr_lock(), which holds a
spinlock. GFP_KERNEL allows the allocator to sleep, triggering a
sleeping-while-atomic bug.
Fix by using idr_preload(GFP_KERNEL) before taking the lock to
pre-allocate memory in a sleepable context, then idr_alloc() with
GFP_NOWAIT inside the spinlock-protected section.
Fixes: 621191d709b1 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
