File openat2.patch of Package qemu

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8469b81878..7b8d7b10fa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8827,6 +8827,11 @@ static int do_openat2(CPUArchState *cpu_env, abi_long dirfd,
         return -TARGET_EFAULT;
     }
 
+    if (tswap64(how.flags) >> 32) {
+        unlock_user(pathname, guest_pathname, 0);
+        return -TARGET_EINVAL;
+    }
+
     how.flags = target_to_host_bitmask(tswap64(how.flags), fcntl_flags_tbl);
     how.mode = tswap64(how.mode);
     how.resolve = tswap64(how.resolve);
openSUSE Build Service is sponsored by