]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Check for EFAULT failure in nanosleep
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Jul 2025 16:43:54 +0000 (17:43 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 13 Jul 2025 08:21:51 +0000 (11:21 +0300)
commit1759558915c5052f560737061ca6333a16a924f5
treecb63a50fd19d8ca7beaebde0a9462a777406de86
parent1714828a56f150327cc05b242cabba4c3f891677
linux-user: Check for EFAULT failure in nanosleep

target_to_host_timespec() returns an error if the memory the guest
passed us isn't actually readable.  We check for this everywhere
except the callsite in the TARGET_NR_nanosleep case, so this mistake
was caught by a Coverity heuristic.

Add the missing error checks to the calls that convert between the
host and target timespec structs.

Coverity: CID 1507104
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250710164355.1296648-1-peter.maydell@linaro.org>
(cherry picked from commit c4828cb8502d0b2adc39b9cde93df7d2886df897)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/syscall.c