Browse Source

linux-user: properly check flags in openat2

target_to_host_bitmask truncates the bitmask to int.  Check that the upper
half of the flags do not have any bits set.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
master^2
Andreas Schwab 6 months ago
committed by Helge Deller
parent
commit
2cf1cb3363
  1. 4
      linux-user/syscall.c

4
linux-user/syscall.c

@ -8831,6 +8831,10 @@ static int do_openat2(CPUArchState *cpu_env, abi_long dirfd,
}
return ret;
}
if (tswap64(how.flags) >> 32) {
return -TARGET_EINVAL;
}
pathname = lock_user_string(guest_pathname);
if (!pathname) {
return -TARGET_EFAULT;

Loading…
Cancel
Save