On 8/19/23 02:47, Karim Taha wrote:
+    if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0)) {
+        return -TARGET_EFAULT;
+    }
+    if (host_to_target_ipc_perm(target_addr, &(host_sd->shm_perm))) {
+        return -TARGET_EFAULT;
+    }

While it works, ideally you wouldn't double-lock a memory range, once here and once in host_to_target_ipc_perm. You could split out the middle of the function as host_to_target_ipc_perm__locked.

Anyway,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~

Reply via email to