diff options
| author | Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> | 2026-05-07 15:44:32 +0000 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2026-07-31 20:02:03 +0000 |
| commit | 72e3b0311aa90568a4b42a64445d1d3e1dc5a34d (patch) | |
| tree | f3ec0f5fa80589f92223582f07a8858a91912e14 /tools/perf/scripts/python/bin/task-analyzer-record | |
| parent | 92d0593128023cf93ae61b7728dcc3062f8d514f (diff) | |
mshv: Publish VP to pt_vp_array before installing the file descriptor
mshv_partition_ioctl_create_vp() called anon_inode_getfd() before
publishing the new VP into partition->pt_vp_array. anon_inode_getfd()
includes fd_install(), so the fd was live in current->files before the
publish ran.
A concurrent MSHV_RUN_VP ioctl on that fd does not serialise against the
in-progress MSHV_CREATE_VP — it takes vp->vp_mutex, not the partition
mutex. Once the VP starts running and traps, mshv_intercept_isr() can look
up partition->pt_vp_array[vp_index] and observe NULL, silently dropping the
intercept message.
Split the fd creation: reserve an fd with get_unused_fd_flags(), create the
file with anon_inode_getfile(), publish the VP via smp_store_release(), and
finally call fd_install() as the userspace-visibility commit point.
Fixes: 621191d709b14 ("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/bin/task-analyzer-record')
0 files changed, 0 insertions, 0 deletions
