Message ID | 20180531224911.23725-5-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show |
Series | linux-user: Reorg interp_prefix handling | expand |
Le 01/06/2018 à 00:49, Richard Henderson a écrit : > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > linux-user/syscall.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5339f0bc1c..b98125829b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1506,6 +1506,11 @@ static abi_long do_select(int n, if (ret) { return ret; } + if (contains_hostfd(&rfds) || + contains_hostfd(&wfds) || + contains_hostfd(&efds)) { + return -TARGET_EBADF; + } if (target_tv_addr) { if (copy_from_user_timeval(&tv, target_tv_addr)) @@ -9392,6 +9397,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, if (ret) { goto fail; } + if (contains_hostfd(&rfds) || + contains_hostfd(&wfds) || + contains_hostfd(&efds)) { + goto ebadf; + } /* * This takes a timespec, and not a timeval, so we cannot
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.17.0