diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2edbd1ef15..caa91c3b1d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8132,17 +8132,19 @@ static int open_self_maps_1(CPUArchState *env, int fd, bool smaps) { struct open_self_maps_data d = { .ts = env_cpu(env)->opaque, - .host_maps = read_self_maps(), .fd = fd, .smaps = smaps }; + mmap_lock(); + d.host_maps = read_self_maps(); if (d.host_maps) { walk_memory_regions(&d, open_self_maps_2); free_self_maps(d.host_maps); } else { walk_memory_regions(&d, open_self_maps_3); } + mmap_unlock(); return 0; }