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.
1 file changed
tree: 35dce47b62472d9e7fde6e1625012b04019180fb
  1. debian/
  2. linux/
  3. m4/
  4. maint/
  5. qemu_multiarch_testing/
  6. test/
  7. tests/
  8. xlat/
  9. .gitignore
  10. .mailmap
  11. .travis.yml
  12. access.c
  13. affinity.c
  14. aio.c
  15. alpha.c
  16. AUTHORS
  17. bjm.c
  18. block.c
  19. bootstrap
  20. bpf.c
  21. btrfs.c
  22. build_static_example.sh
  23. cacheflush.c
  24. capability.c
  25. caps0.h
  26. caps1.h
  27. ChangeLog-CVS
  28. chdir.c
  29. chmod.c
  30. clone.c
  31. configure.ac
  32. copy_file_range.c
  33. COPYING
  34. count.c
  35. CREDITS.in
  36. defs.h
  37. desc.c
  38. dirent.c
  39. dirent64.c
  40. empty.h
  41. epoll.c
  42. errnoent.sh
  43. evdev.c
  44. eventfd.c
  45. execve.c
  46. exit.c
  47. fadvise.c
  48. fallocate.c
  49. fanotify.c
  50. fchownat.c
  51. fcntl.c
  52. fetch_seccomp_fprog.c
  53. fetch_struct_flock.c
  54. fetch_struct_mmsghdr.c
  55. fetch_struct_msghdr.c
  56. fetch_struct_statfs.c
  57. file.c
  58. file_handle.c
  59. file_ioctl.c
  60. flock.c
  61. flock.h
  62. fs_x_ioctl.c
  63. fstatfs.c
  64. fstatfs64.c
  65. futex.c
  66. gcc_compat.h
  67. generate_mpers_am.sh
  68. generate_sen.sh
  69. generate_xlat_in.sh
  70. get_robust_list.c
  71. getcpu.c
  72. getcwd.c
  73. getrandom.c
  74. git-set-file-times
  75. git-version-gen
  76. gitlog-to-changelog
  77. HACKING-scripts
  78. hdio.c
  79. hostname.c
  80. inotify.c
  81. INSTALL
  82. io.c
  83. ioctl.c
  84. ioctlsort.c
  85. ioperm.c
  86. iopl.c
  87. ioprio.c
  88. ipc_defs.h
  89. ipc_msg.c
  90. ipc_msgctl.c
  91. ipc_sem.c
  92. ipc_shm.c
  93. ipc_shmctl.c
  94. kcmp.c
  95. kernel_types.h
  96. kexec.c
  97. keyctl.c
  98. ldt.c
  99. link.c
  100. lookup_dcookie.c
  101. loop.c
  102. lseek.c
  103. make-dist
  104. make-dsc
  105. Makefile.am
  106. mem.c
  107. membarrier.c
  108. memfd_create.c
  109. mknod.c
  110. mmsghdr.c
  111. mount.c
  112. mpers.awk
  113. mpers.sh
  114. mpers_test.sh
  115. mpers_type.h
  116. mq.c
  117. msghdr.c
  118. msghdr.h
  119. mtd.c
  120. native_defs.h
  121. net.c
  122. netlink.c
  123. NEWS
  124. numa.c
  125. open.c
  126. or1k_atomic.c
  127. pathtrace.c
  128. perf.c
  129. personality.c
  130. poll.c
  131. prctl.c
  132. print_mq_attr.c
  133. print_msgbuf.c
  134. print_sigevent.c
  135. print_statfs.c
  136. print_time.c
  137. print_timex.c
  138. printmode.c
  139. printrusage.c
  140. printsiginfo.c
  141. printsiginfo.h
  142. printstat.h
  143. process.c
  144. process_vm.c
  145. ptp.c
  146. ptrace.h
  147. quota.c
  148. readahead.c
  149. readlink.c
  150. README
  151. README-hacking
  152. README-linux-ptrace
  153. README-mpers
  154. README.md
  155. reboot.c
  156. regs.h
  157. renameat.c
  158. resource.c
  159. rtc.c
  160. sched.c
  161. scsi.c
  162. seccomp.c
  163. seccomp_fprog.h
  164. sendfile.c
  165. sigaltstack.c
  166. sigevent.h
  167. signal.c
  168. signalent.sh
  169. signalfd.c
  170. sigreturn.c
  171. sock.c
  172. sockaddr.c
  173. socketutils.c
  174. sram_alloc.c
  175. statfs.c
  176. statfs.h
  177. statfs64.c
  178. strace-graph
  179. strace-log-merge
  180. strace.1
  181. strace.c
  182. strace.spec.in
  183. swapon.c
  184. sync_file_range.c
  185. sync_file_range2.c
  186. syscall.c
  187. syscallent.sh
  188. sysctl.c
  189. sysinfo.c
  190. syslog.c
  191. sysmips.c
  192. term.c
  193. time.c
  194. times.c
  195. travis-build.sh
  196. travis-install.sh
  197. travis-success.sh
  198. truncate.c
  199. ubi.c
  200. uid.c
  201. uid16.c
  202. umask.c
  203. umount.c
  204. uname.c
  205. unwind.c
  206. upeek.c
  207. userfaultfd.c
  208. util.c
  209. utime.c
  210. utimes.c
  211. v4l2.c
  212. vsprintf.c
  213. wait.c
  214. xattr.c
  215. xlat.h
  216. xlate.el
  217. xmalloc.c
README.md

This is strace -- a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.

strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.

See the file NEWS for information on what has changed in recent versions.

Please send bug reports and enhancements to the strace mailing list.

Build Status Code Coverage