]> Git Repo - qemu.git/commit - linux-user/syscall.c
linux-user: Fix 'utimensat()' implementation
authorFilip Bozuta <[email protected]>
Tue, 11 Aug 2020 11:31:01 +0000 (13:31 +0200)
committerLaurent Vivier <[email protected]>
Sun, 23 Aug 2020 14:57:58 +0000 (16:57 +0200)
commitb3a3af70c377a3e67d43f3be39a333228487b50c
tree9ef5d065d786c8f33bc38b784084d1c56073a1f5
parent828cb3a1a89e3ed4b1284c085eeabff39313ddfc
linux-user: Fix 'utimensat()' implementation

Implementation of syscall 'utimensat()' in 'syscall.c' uses functions
target_to_host/host_to_target_timespec() to convert values of
'struct timespec' between host and target. However, the implementation
doesn't check whether the conversion succeeds and thus can cause an
inappropriate error or succeed unappropriately instead of setting errno
EFAULT ('Bad address') which is supposed to be set in these cases.

This was confirmed with the LTP test for utimensat ('testcases/utimensat')
which fails for test cases when the errno EFAULT is expected. After changes
from this patch, the test passes for all test cases.

Signed-off-by: Filip Bozuta <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20200811113101[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
linux-user/syscall.c
This page took 0.022079 seconds and 4 git commands to generate.