]> 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)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 10 Jul 2025 17:55:34 +0000 (11:55 -0600)
commitc4828cb8502d0b2adc39b9cde93df7d2886df897
tree892917d09c4ccfa71fe93463c87a995e13bbaa42
parent6a3e132a1be8c9e649967a4eb341d00731be7f51
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>
linux-user/syscall.c