]> granicus.if.org Git - strace/commit
Fix race condition in decoding timeout argument of recvmmsg syscall
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 15 Jul 2016 17:46:07 +0000 (17:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 18 Jul 2016 22:12:45 +0000 (22:12 +0000)
commit7f8ece11c8779a55b63399e21ec53a7a2ff743fc
tree35dce47b62472d9e7fde6e1625012b04019180fb
parentc5d69183af17e4fe7080f3e6835d16ca7f35b40f
Fix race condition in decoding timeout argument of recvmmsg syscall

As the value returned by sprint_timespec points to a static area and may
be overwritten by subsequent calls to sprint_timespec, it is not safe to
save this value on entering syscall and use it later on exiting.

* mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value
returned by sprint_timespec to a dynamically allocated memory, and save
the pointer using set_tcb_priv_data.  On exiting, restore it using
get_tcb_priv_data.
mmsghdr.c