linux-user: Sanity check clone flags
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 2 Aug 2016 17:41:27 +0000 (18:41 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Wed, 21 Sep 2016 19:14:27 +0000 (22:14 +0300)
commit5ea2fc84da1bffce749c9d0848f5336def2818bb
treef91d5d85ca51ac4028e82f6e2272cfb13f44e024
parent7cfbd386b92e93fbfae033b9ac89a20d1fe72573
linux-user: Sanity check clone flags

We currently make no checks on the flags passed to the clone syscall,
which means we will not fail clone attempts which ask for features
that we can't implement. Add sanity checking of the flags to clone
(which we were already doing in the "this is a fork" path, but not
for the "this is a new thread" path), tidy up the checking in
the fork path to match it, and check that the fork case isn't trying
to specify a custom termination signal.

This is helpful in causing some LTP test cases to fail cleanly
rather than behaving bizarrely when we let the clone succeed
but didn't provide the semantics requested by the flags.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c