1 2017-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 2 3 Prepare for 4.18 release. 4 * NEWS: Update for 4.18 release. 5 6 2017-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 7 8 tests: robustify create_nl_socket based tests against the race condition 9 There is a race condition between the moment a netlink socket is created 10 and the moment it is reported via SOCK_DIAG_BY_FAMILY interface. 11 Add one more operation on the socket created by create_nl_socket 12 to increase chances of winning the race. 13 14 * tests/create_nl_socket.c (create_nl_socket_ext): Add a getsockopt call 15 with the created socket. 16 17 2017-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 18 19 Update NEWS. 20 21 2017-07-04 Romain Naour <romain.naour (a] smile.fr> 22 23 nios2: fix wrong access to "SP" register in user_pt_regs. 24 Starting with linux commit v4.0-rc4~21^2, "SP" register 25 is available via regs[PTR_SP] member of struct user_pt_regs. 26 27 * linux/nios2/arch_regs.h (nios2_sp_ptr): Change type 28 to "unsigned int *". 29 * linux/nios2/arch_regs.c (nios2_sp_ptr): Likewise. 30 Replace .sp with .regs[PTR_SP]. 31 32 Fixes: http://autobuild.buildroot.net/results/b9f/b9fc25b82f3280872fe1593ac252a8529ba83576 33 Fixes: v4.16-34-g6117728a ("nios2: export nios2_sp_ptr") 34 35 2017-07-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 36 Dmitry V. Levin <ldv (a] altlinux.org> 37 38 tests: add multi-process check to qual_fault.test. 39 Check that syscall counters used for tampering are per-tcb. 40 41 * tests/qual_fault.c: Include <fcntl.h> for open(), 42 <sys/param.h> for PATH_MAX, and <sys/wait.h> for wait(). 43 (expfd): Rename to exp_fd, remove const qualifier and initialization. 44 (gotfd): Rename to got_fd, remove const qualifier and initialization. 45 (out_fd): New variable, for the expected strace output. 46 (open_file): New helper function. 47 (main): Remove st, add num_procs, proc, exp_prefix, got_prefix, 48 out_prefix, pid_prefix. Remove stat asserts, update argc assert. 49 Add num_procs, exp_prefix, got_prefix, out_prefix, pid_prefix 50 initialization. Add per-process loop, open expfd, gotfd, out_fd, pidfd 51 in each one, print process's pid to pidfd, print exit message to out_fd. 52 Add wait() call for each forked process. 53 * tests/qual_fault.test (N): increase to 100 in order to check 54 concurrent process execution. 55 (check_fault_injection): Take additional argument for the process 56 count, pass it to qual_fault, add filename variables for expected strace 57 output and pid file, pass them to qual_fault. 58 Specify -ff parameter to strace invocation. 59 Compare write and strace output for the each process. 60 Update all check_fault_injection invocation with process count argument, 61 add an invocation with 4 concurrent processes. 62 * tests/init.sh (TIMEOUT_DURATION): Raise from 120 to 300. 63 64 2017-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 65 66 tests: adjust TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects 67 * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Add 68 support for objects larger than DEFAULT_STRLEN. 69 * tests/nlattr_inet_diag_msg.c (main): Change pattern size 70 from DEFAULT_STRLEN to 4096. 71 * tests/nlattr_netlink_diag_msg.c: Likewise. 72 * tests/nlattr_unix_diag_msg.c: Likewise. 73 74 Reported-by: JingPiao Chen <chenjingpiao (a] gmail.com> 75 76 2017-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 77 78 tests: move DEFAULT_STRLEN macro to tests.h. 79 * tests/tests.h [!DEFAULT_STRLEN] (DEFAULT_STRLEN): New macro. 80 * tests/mincore.c (DEFAULT_STRLEN): Remove. 81 * tests/mmsg_name.c: Likewise. 82 * tests/msg_control.c: Likewise. 83 * tests/netlink_protocol.c: Likewise. 84 * tests/nlattr.c: Likewise. 85 * tests/nlattr_inet_diag_msg.c: Likewise. 86 * tests/nlattr_netlink_diag_msg.c: Likewise. 87 * tests/nlattr_unix_diag_msg.c: Likewise. 88 * tests/printstr.c: Likewise. 89 * tests/xattr.c: Likewise. 90 * tests/execve.c: Likewise. 91 (main): Initialize str_a and str_b arrays at run time. 92 * tests/execveat.c: Likewise. 93 94 Suggested-by: JingPiao Chen <chenjingpiao (a] gmail.com> 95 96 2017-07-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 97 98 tests: use unified diff in order to improve test log readability. 99 * tests/init.sh (match_diff): Add -u option to the diff invocation. 100 101 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 102 103 Fix error diagnostics in case of zero argc. 104 * strace.c (init): Adjust argc along with argv, 105 check that adjusted argc is sane. 106 * tests/zeroargc.c: New file. 107 * tests/.gitignore: Add zeroargc. 108 * tests/Makefile.am (check_PROGRAMS): Likewise. 109 * tests/options-syntax.test: Check strace error diagnostics 110 in case of zero argc. 111 112 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 113 114 Use program_invocation_name instead of a local progname variable. 115 Emulate program_invocation_name only if it is not provided by libc. 116 117 * configure.ac: Check for program_invocation_name variable. 118 * strace.c (progname): Remove. 119 [!HAVE_PROGRAM_INVOCATION_NAME] (program_invocation_name): New variable. 120 (verror_msg, error_msg_and_help): Use it instead of progname. 121 (init): Initialize program_invocation_name instead of progname. 122 123 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 124 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 125 126 Introduce generic STRINGIFY and STRINGIFY_VAL macros. 127 * macros.h (STRINGIFY, STRINGIFY_VAL): New macros. 128 * mpers_type.h: Include "macros.h". 129 [IN_MPERS] (STRINGIFY): Remove. 130 * tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove. 131 (TEST_SYSCALL_STR): Use STRINGIFY_VAL. 132 133 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 134 135 Introduce macros.h. 136 Introduce a separate header file for generic macros shared between 137 strace and its tests. Start this unification with ARRAY_SIZE macro. 138 139 * defs.h: Include "macros.h". 140 (ARRAY_SIZE): Move ... 141 * macros.h: ... to new file. 142 * Makefile.am (strace_SOURCES): Add it. 143 * tests/tests.h: Include "macros.h". 144 (ARRAY_SIZE): Remove. All callers updated. 145 146 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 147 148 quota: use PRINT_FIELD_FLAGS. 149 * quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t 150 to uint8_t. 151 (decode_cmd_data): Use PRINT_FIELD_FLAGS. 152 153 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 154 155 Unify different generic PRINT_FIELD_* implementations. 156 Create a new header print_fields.h and move generic PRINT_FIELD_* 157 macros there. 158 159 * print_fields.h: New file. 160 * Makefile.am (strace_SOURCES): Add it. 161 * netlink_sock_diag.c: Include "print_fields.h". 162 (PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS, 163 PRINT_FIELD_XVAL): Move to print_fields.h file. 164 * quota.c: Include "print_fields.h". 165 (PRINT_FIELD_D): Move to print_fields.h file. 166 (PRINT_FIELD_U, PRINT_FIELD_X): Remove. 167 * statx.c: Include "print_fields.h". 168 (PRINT_FIELD_U): Remove. 169 (SYS_FUNC(statx)): Update PRINT_FIELD_U callers. 170 * tests/quotactl.h: Include "print_fields.h". 171 * tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros. 172 * tests/quotactl.c: Likewise. 173 (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove. 174 * tests/test_nlattr.h: Include "print_fields.h". 175 (PRINT_FIELD_U, PRINT_FIELD_X): Remove. 176 * tests/xstatx.c: Include "print_fields.h". 177 (PRINT_FIELD_U): Remove. 178 (print_stat): Update PRINT_FIELD_U callers. 179 * tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf. 180 181 2017-07-01 Eugeniy Paltsev <Eugeniy.Paltsev (a] synopsys.com> 182 183 arc: fix wrong access to "sp" member in user_regs_struct. 184 "sp" register is a member of "scratch" structure (which is nested 185 in user_regs_struct) 186 187 * linux/arc/arch_regs.c: Replace .sp with .scratch.sp . 188 189 Fixes: v4.16-31-g134042a5 ("arc: export arc_sp_ptr") 190 191 2017-07-01 Khem Raj <raj.khem (a] gmail.com> 192 193 aarch64, tile: replace struct ucontext with ucontext_t. 194 glibc >= 2.26 has dropped the tag struct ucontext from ucontext_t type. 195 196 * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Replace 197 struct ucontext with ucontext_t. 198 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 199 200 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 201 202 tests: enhance nlattr_unix_diag_msg test. 203 * tests/nlattr_unix_diag_msg.c: Include "test_nlattr.h". 204 (test_unix_diag_vfs, test_unix_diag_icons, test_unix_diag_rqlen): 205 Remove. 206 (init_unix_diag_msg): Add const qualifier to arguments and variables. 207 (print_unix_diag_msg, print_uint): New functions. 208 (main): Use them and macros from test_nlattr.h file. 209 210 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 211 212 tests: check decoding of netlink unix_diag_msg attributes. 213 * tests/nlattr_unix_diag_msg.c: New file. 214 * tests/gen_tests.in (nlattr_unix_diag_msg): New entry. 215 * tests/pure_executables.list: Add nlattr_unix_diag_msg. 216 * tests/.gitignore: Likewise. 217 218 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 219 220 netlink_sock_diag: ensure that structure field names are printed properly 221 * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_rqlen): 222 Use PRINT_FIELD_U to print structure fields. 223 224 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 225 226 netlink_sock_diag: add const qualifiers. 227 Add const qualifiers to auto variables and function arguments. 228 This change does not affect the code generated by the compiler, 229 the purpose of these "const" qualifiers is to highlight the intent. 230 231 * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_inode, 232 decode_unix_diag_rqlen): Add const qualifier to tcp, addr, and len 233 arguments. 234 235 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 236 237 netlink: decode AF_UNIX unix_diag_msg attributes. 238 * netlink_sock_diag.c (unix_diag_msg_nla_decoders): New array. 239 (decode_unix_diag_msg): Use it. 240 * linux/unix_diag.h (unix_diag_vfs, unix_diag_rqlen): New structures. 241 242 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 243 244 tests: enhance nlattr_netlink_diag_msg test. 245 * tests/nlattr_netlink_diag_msg.c: Include "test_nlattr.h". 246 (test_netlink_diag_groups, test_netlink_diag_rx_ring, 247 test_netlink_diag_flags): Remove. 248 (init_netlink_diag_msg): Add const qualifier to arguments and variables. 249 (print_netlink_diag_msg, print_xlong): New functions. 250 (main): Use them and macros from test_nlattr.h file. 251 252 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 253 254 tests: check decoding of netlink_diag_msg attributes. 255 * tests/nlattr_netlink_diag_msg.c: New file. 256 * tests/gen_tests.in (nlattr_netlink_diag_msg): New entry. 257 * tests/pure_executables.list: Add nlattr_netlink_diag_msg. 258 * tests/.gitignore: Likewise. 259 260 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 261 262 netlink_sock_diag: ensure that structure field names are printed properly 263 * netlink_sock_diag.c (decode_netlink_diag_ring): Use PRINT_FIELD_U 264 to print structure fields. 265 266 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 267 268 netlink_sock_diag: add const qualifiers. 269 Add const qualifiers to auto variables and function arguments. 270 This change does not affect the code generated by the compiler, 271 the purpose of these "const" qualifiers is to highlight the intent. 272 273 * netlink_sock_diag.c (print_group, decode_netlink_diag_groups, 274 decode_netlink_diag_ring, decode_netlink_diag_flags): Add const 275 qualifier to tcp, addr, and len arguments. 276 277 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 278 279 netlink: decode AF_NETLINK netlink_diag_msg attributes. 280 * linux/netlink_diag.h (netlink_diag_ring): New structure. 281 (NDIAG_FLAG_*): New macros. 282 * netlink_sock_diag.c: Include "xlat/netlink_socket_flags.h". 283 (print_group, decode_netlink_diag_groups, decode_netlink_diag_ring, 284 decode_netlink_diag_flags): New functions. 285 (netlink_diag_msg_nla_decoders): New array. 286 (decode_netlink_diag_msg): Use it. 287 * xlat/netlink_socket_flags.in: New file. 288 289 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 290 291 netlink_sock_diag: print inet_diag_sockid.idiag_if as an interface index 292 * netlink_sock_diag.c (print_inet_diag_sockid): Print idiag_if field 293 using print_ifindex. 294 * tests/nlattr_inet_diag_msg.c: Include <net/if.h>. 295 (IFINDEX_LO): New macro. 296 (init_inet_diag_msg): Set inet_diag_sockid.idiag_if field. 297 (print_inet_diag_msg): Update expected output. 298 299 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 300 JingPiao Chen <chenjingpiao (a] gmail.com> 301 302 tests: check decoding of several standard netlink attributes. 303 * tests/nlattr_inet_diag_msg.c (main): Check decoding of uint32_t, 304 uint8_t, and zero-terminated string attributes. 305 306 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 307 308 tests: enhance nlattr_inet_diag_msg test. 309 * tests/test_nlattr.h: New file. 310 * tests/Makefile.am (libtests_a_SOURCES): Add it. 311 * tests/nlattr_inet_diag_msg.c: Include "test_nlattr.h". 312 (test_inet_diag_meminfo, test_inet_diag_vegasinfo, 313 test_inet_diag_dctcpinfo, test_inet_diag_bbrinfo): Remove. 314 (address): New variable. 315 (init_inet_diag_msg): Remove "address" argument, add const qualifier 316 to all remaining arguments. 317 (print_inet_diag_msg, print_uint): New functions. 318 (main): Use macros from test_nlattr.h file. 319 320 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 321 322 tests: check decoding of netlink inet_diag_msg attributes. 323 * tests/nlattr_inet_diag_msg.c: New file. 324 * tests/gen_tests.in (nlattr_inet_diag_msg): New entry. 325 * tests/pure_executables.list: Add nlattr_inet_diag_msg. 326 * tests/.gitignore: Likewise. 327 328 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 329 330 netlink_sock_diag: ensure that structure field names are printed properly 331 * netlink_sock_diag.c (PRINT_FIELD_X): New macro. 332 (decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, 333 decode_tcp_bbr_info): Use it and PRINT_FIELD_U to print structure 334 fields. 335 336 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 337 338 netlink_sock_diag: add const qualifiers. 339 Add const qualifiers to auto variables and function arguments. 340 This change does not affect the code generated by the compiler, 341 the purpose of these "const" qualifiers is to highlight the intent. 342 343 * netlink_sock_diag.c (print_meminfo, decode_meminfo, 344 decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, 345 decode_tcp_bbr_info): Add const qualifier to tcp, addr, and len 346 arguments. 347 348 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 349 350 netlink: decode AF_INET inet_diag_msg attributes. 351 * linux/inet_diag.h (inet_diag_meminfo, tcpvegas_info, 352 tcp_dctcp_info, tcp_bbr_info): New structures. 353 * linux/sock_diag.h (SK_MEMINFO_VARS): New macro. 354 * netlink_sock_diag.c: Include <linux/sock_diag.h>. 355 (print_meminfo, decode_meminfo, decode_inet_diag_meminfo, 356 decode_tcpvegas_info, decode_tcp_dctcp_info, decode_tcp_bbr_info): 357 New functions. 358 (inet_diag_msg_nla_decoders): New array. 359 (decode_inet_diag_msg): Use it. 360 361 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 362 363 nlattr: add const qualifiers to auto variables and function arguments. 364 This change does not affect the code generated by the compiler, 365 the purpose of these "const" qualifiers is to highlight the intent. 366 367 * nlattr.c (decode_nlattr_with_data, decode_nla_str, decode_nla_strn, 368 decode_nla_##name): Add const qualifier to tcp, addr, and len arguments. 369 370 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 371 Fabien Siron <fabien.siron (a] epita.fr> 372 373 netlink: introduce nla_decoder_t to parse netlink attributes data. 374 * nlattr.h (nla_decoder_t): New typedef. 375 (DECL_NLA): New macro. 376 (decode_nlattr): Add decoders, size and opaque_data argument. 377 * nlattr.c: (decode_nlattr_with_data): Likewise. 378 (decode_nla_*): New functions. 379 * netlink_sock_diag.c (decode_inet_diag_req_compat) 380 (decode_inet_diag_req_v2, decode_inet_diag_msg) 381 (decode_netlink_diag_msg, (decode_packet_diag_msg) 382 (decode_smc_diag_msg, decode_unix_diag_msg): Add decoders, 383 size and opaque_data arguments. All callers updated. 384 385 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 386 387 netlink: add a basic netlink attribute parser of AF_SMC diag. 388 * netlink_sock_diag.c: Include "xlat/smc_diag_attrs.h". 389 (decode_smc_diag_msg): Use decode_nlattr. 390 * xlat/smc_diag_attrs.in: New file. 391 392 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 393 Fabien Siron <fabien.siron (a] epita.fr> 394 395 netlink: add a basic netlink attribute parser of AF_INET diag. 396 * linux/inet_diag.h (INET_DIAG_REQ_*): New enum. 397 * netlink_sock_diag.c: Include "xlat/inet_diag_attrs.h" 398 and "xlat/inet_diag_req_attrs.h". 399 (decode_inet_diag_req_compat, decode_inet_diag_req_v2, 400 decode_inet_diag_msg): Use decode_nlattr. 401 * xlat/inet_diag_attrs.in: New file. 402 * xlat/inet_diag_req_attrs.in: Likewise. 403 404 netlink: add a basic netlink attribute parser of AF_PACKET diag. 405 * linux/packet_diag.h (PACKET_DIAG_*): New enum. 406 * netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h". 407 (decode_packet_diag_msg): Use decode_nlattr. 408 * xlat/packet_diag_attrs.in: New file. 409 410 netlink: add a basic netlink attribute parser of AF_NETLINK diag. 411 * linux/netlink_diag.h (NETLINK_DIAG_*): New enum. 412 * netlink_sock_diag.c: Include "xlat/netlink_diag_attrs.h". 413 (decode_netlink_diag_msg): Use decode_nlattr. 414 * xlat/netlink_diag_attrs.in: New file. 415 416 2017-06-29 Dmitry V. Levin <ldv (a] altlinux.org> 417 418 netlink_sock_diag: ensure that structure field names are printed properly 419 * netlink_sock_diag.c (PRINT_FIELD_U, PRINT_FIELD_COOKIE, 420 PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): New macros. 421 (decode_unix_diag_req, decode_unix_diag_msg, decode_netlink_diag_req, 422 decode_netlink_diag_msg, decode_packet_diag_req, decode_packet_diag_msg, 423 print_inet_diag_sockid, decode_inet_diag_req_compat, 424 decode_inet_diag_req_v2, decode_inet_diag_msg, decode_smc_diag_req, 425 decode_smc_diag_msg): Use them to print structure fields. 426 427 2017-06-29 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 428 429 Update ioctl entries from linux v4.12-rc7. 430 * linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7 431 (with f7a320ff commit applied on top) using ioctls_gen.sh. 432 * linux/32/ioctls_inc_align32.h: Likewise. 433 * linux/32/ioctls_inc_align64.h: Likewise. 434 * linux/64/ioctls_inc.h: Likewise. 435 * linux/x32/ioctls_inc0.h: Likewise. 436 * NEWS: Mention this. 437 438 2017-06-29 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 439 440 maint: fix ioctls_sym.sh premature termination. 441 When the list of headers do not fit into the command line, xargs splits 442 it into several lists and then passes them to grep. If no headers from 443 a list match the grep pattern, grep exits with a non-zero status that 444 causes xargs to exit with a non-zero status, too. 445 446 * maint/ioctls_sym.sh: Use "find -exec +" instead of xargs, 447 ignore its exit status. 448 449 2017-06-27 JingPiao Chen <chenjingpiao (a] gmail.com> 450 451 tests: introduce NLMSG_ATTR macro. 452 * tests/tests.h (NLMSG_ATTR): New macro. 453 * tests/nlattr.c (test_nlattr, test_nla_type): Use it. 454 455 2017-06-27 JingPiao Chen <chenjingpiao (a] gmail.com> 456 457 netlink: pass NLMSG_DONE messages to family specific payload decoders. 458 While many NLMSG_DONE messages indeed have payload containing 459 just one integer, there are exceptions. Handle this by passing 460 payloads of NLMSG_DONE messages to family specific netlink 461 payload decoders. 462 463 * netlink.c (print_nlmsghdr): Do not skip family detection 464 for nlmsg_type == NLMSG_DONE. 465 (decode_nlmsg_type): Skip family specific type decoders 466 for type == NLMSG_DONE. 467 (decode_nlmsg_flags): Skip family specific decoding of flags 468 for type == NLMSG_DONE. 469 (decode_netlink_sock_diag): Skip for nlmsg_type == NLMSG_DONE. 470 471 2017-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 472 473 Unexport die_out_of_memory. 474 Print more specific error diagnostics than a generic "Out of memory" 475 when an error happens outside xmalloc.c. 476 477 * defs.h (die_out_of_memory): Remove prototype. 478 * strace.c (strace_popen, init): Call perror_msg_and_die instead 479 of die_out_of_memory. 480 * unwind.c (unwind_tcb_init): Likewise. 481 * xmalloc.c (die_out_of_memory): Add static qualifier. 482 483 2017-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 484 485 Check -s argument early. 486 * util.c (printstr_ex): Move the check that -s argument 487 does not exceed -1U / 4 ... 488 * strace.c (init): ... here. 489 * tests/options-syntax.test: Check it. 490 491 2017-06-25 Dmitry V. Levin <ldv (a] altlinux.org> 492 493 Include "netlink.h" instead of <linux/netlink.h> 494 * net.c: Include "netlink.h" instead of <linux/netlink.h>. 495 * sockaddr.c: Likewise. 496 * tests/create_nl_socket.c: Likewise. 497 * tests/net-sockaddr.c: Likewise. 498 * tests/netlink_audit.c: Likewise. 499 * tests/netlink_generic.c: Likewise. 500 * tests/netlink_inet_diag.c: Likewise. 501 * tests/netlink_netfilter.c: Likewise. 502 * tests/netlink_route.c: Likewise. 503 * tests/netlink_selinux.c: Likewise. 504 * tests/netlink_xfrm.c: Likewise. 505 * tests/net-yy-netlink.c: Include "netlink.h" instead 506 of <linux/netlink.h>, remove fallback definition of NETLINK_SOCK_DIAG. 507 * tests/netlink_netlink_diag.c: Likewise. 508 * tests/netlink_protocol.c: Likewise. 509 * tests/netlink_sock_diag.c: Likewise. 510 * tests/netlink_unix_diag.c: Likewise. 511 * tests/nlattr.c: Likewise. 512 513 2017-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 514 515 netlink: provide a fallback definition of NETLINK_SOCK_DIAG. 516 Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h 517 instead of adding these fallback definitions to every file. 518 519 * netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG. 520 * socketutils.c: Include "netlink.h" instead of <linux/netlink.h>, 521 remove fallback definition of NETLINK_SOCK_DIAG. 522 523 2017-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 524 525 Update prctl ARCH_* constants. 526 * xlat/archvals.in: Add ARCH_GET_CPUID and ARCH_SET_CPUID 527 introduced by linux kernel commit v4.12-rc1~153^2~2. 528 529 2017-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 530 531 Update V4L2_* constants. 532 * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_META_CAPTURE introduced 533 by linux kernel commit v4.12-rc1~85^2~71. 534 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_META_CAPTURE 535 introduced by the same commit. 536 * xlat/v4l2_control_flags.in: Add V4L2_CTRL_FLAG_HAS_PAYLOAD, 537 V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and V4L2_CTRL_FLAG_MODIFY_LAYOUT 538 introduced by linux kernel commits v3.17-rc1~112^2~363, 539 v4.1-rc1~59^2~1^2~63, and v4.12-rc1~85^2~62, respectively. 540 * xlat/v4l2_control_types.in: Add V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16, 541 and V4L2_CTRL_TYPE_U32 introduced by linux kernel commits 542 v3.17-rc1~112^2~343 and v3.17-rc1~112^2~112. 543 544 Update SCTP_* constants. 545 * xlat/socksctpoptions.in: Add SCTP_ENABLE_STREAM_RESET, 546 SCTP_RESET_STREAMS, SCTP_RESET_ASSOC, SCTP_ADD_STREAMS, 547 SCTP_RECONFIG_SUPPORTED, and SCTP_PR_STREAM_STATUS introduced 548 by linux kernel commits v4.11-rc1~124^2~387^2~1, v4.11-rc1~124^2~387^2, 549 v4.11-rc1~124^2~166^2~2, v4.11-rc1~124^2~166^2, v4.12-rc1~64^3~469^2, 550 and v4.12-rc1~64^3~276, respectively. 551 552 Update RTM_* constants. 553 * xlat/nl_route_types.in: Add RTM_DELNETCONF introduced 554 by linux kernel commit v4.12-rc1~64^3~312^2~6. 555 556 Update NDIAG_SHOW_* constants. 557 * linux/netlink_diag.h (NDIAG_SHOW_FLAGS): New constant introduced 558 by linux kernel commit v4.12-rc1~64^3~260. 559 * xlat/netlink_diag_show.in: Add it. 560 561 Update KEYCTL_* constants. 562 * xlat/keyctl_commands.in: Add KEYCTL_RESTRICT_KEYRING introduced 563 by linux kernel commit v4.12-rc1~123^2~7^2~2^2~3. 564 565 Update ARPHRD_* constants. 566 * xlat/arp_hardware_types.in: Add ARPHRD_VSOCKMON introduced 567 by linux kernel commit v4.12-rc1~129^2~118^2~2. 568 569 Update SO_* constants. 570 * xlat/sockoptions.in: Add SO_MEMINFO, SO_INCOMING_NAPI_ID, 571 and SO_COOKIE introduced by linux kernel commits v4.12-rc1~64^3~389, 572 v4.12-rc1~64^3~341^2, and v4.12-rc1~64^3~221^2~1, respectively. 573 574 2017-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 575 576 tests: check more corner cases of nlattr decoding. 577 * tests/nlattr.c (test_nlattr): Check decoding in case of invalid 578 struct nlattr.nla_len. 579 580 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 581 582 tests: check decoding of netlink attribute. 583 * tests/nlattr.c: New file. 584 * tests/gen_tests.in (nlattr): New entry. 585 * tests/pure_executables.list: Add nlattr. 586 * tests/.gitignore: Likewise. 587 588 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 589 Fabien Siron <fabien.siron (a] epita.fr> 590 591 netlink: introduce a basic netlink attributes parser. 592 * linux/unix_diag.h (UNIX_DIAG_*): New enum. 593 * nlattr.c: New file. 594 * nlattr.h: Likewise. 595 * Makefile.am (strace_SOURCES): Add them. 596 * netlink_sock_diag.c: Include "nlattr.h" and "xlat/unix_diag_attrs.h". 597 (decode_unix_diag_msg): Use decode_nlattr. 598 * xlat/unix_diag_attrs.in: New file. 599 600 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 601 602 netlink: introduce netlink.h. 603 * netlink.h: New file. 604 * Makefile.am (strace_SOURCES): Add it. 605 * netlink_sock_diag.c: Include "netlink.h", 606 remove <sys/socket.h> and <linux/netlink.h>. 607 * netlink.c: Likewise. 608 (NLMSG_HDRLEN): Move to netlink.h. 609 * tests/netlink_protocol.c: Replace <linux/netlink.h> with "netlink.h". 610 * tests/netlink_sock_diag.c: Likewise. 611 612 2017-06-20 Dmitry V. Levin <ldv (a] altlinux.org> 613 614 tests: add SET_STRUCT macro to tests.h. 615 * tests/netlink_sock_diag.c (INIT_STRUCT): Rename to SET_STRUCT, 616 all callers updated. Move ... 617 * tests/tests.h: ... here. 618 619 2017-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 620 621 tests: fix potential unaligned access in netlink_sock_diag.test. 622 Despite our efforts made to avoid unaligned access, gcc appears to be 623 generating instructions that might cause unaligned access when copying 624 structures to unaligned addresses. 625 626 Fix this issue by replacing copying of structures to unaligned addresses 627 with memcpy calls. 628 629 * tests/netlink_sock_diag.c (INIT_STRUCT): New macro. 630 (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, 631 test_unix_diag_msg, test_netlink_diag_req, test_netlink_diag_msg, 632 test_packet_diag_req, test_packet_diag_msg, test_inet_diag_sockid, 633 test_inet_diag_req, test_inet_diag_req_v2, test_inet_diag_msg, 634 test_smc_diag_req, test_smc_diag_msg): Use it to initialize potentially 635 unaligned struct nlmsghdr. Do not access nlh->nlmsg_len. 636 637 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 638 639 tests: check decoding of NETLINK_GENERIC message types. 640 * tests/netlink_generic.c: New file. 641 * tests/gen_tests.in (netlink_generic): New entry. 642 * tests/pure_executables.list: Add netlink_generic. 643 * tests/.gitignore: Likewise. 644 645 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 646 647 netlink: add decoding of NETLINK_GENERIC protocol families. 648 NETLINK_GENERIC is a protocol stacked on netlink protocol. 649 650 When a NETLINK_GENERIC subsystem registers its "family" name in the 651 kernel at run time, an integer value associated with this name is 652 assigned by the kernel. This integer value is specified in struct 653 nlmsghdr.nlmsg_type of subsequent communications with the 654 NETLINK_GENERIC subsystem. 655 656 This change implements decoding of NETLINK_GENERIC message types in 657 symbolic form, for example: 658 659 $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null 660 sendto(4<NETLINK:[GENERIC:12345]>, {{len=20, type=tcp_metrics, ... 661 +++ exited with 0 +++ 662 663 Note that type= specifying the NETLINK_GENERIC protocol family 664 is decoded properly. 665 666 * netlink.c (decode_nlmsg_type_generic): New function. 667 (nlmsg_types): Add NETLINK_GENERIC entry. 668 669 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 670 671 socketutils: build a dynamic xlat table for NETLINK_GENERIC decoding. 672 * configure.ac (AC_CHECK_HEADERS): Add linux/genetlink.h. 673 * defs.h (genl_families_xlat): New prototype. 674 * socketutils.c [HAVE_LINUX_GENETLINK_H]: Include <linux/genetlink.h>. 675 [HAVE_LINUX_GENETLINK_H] (genl_send_dump_families, 676 genl_parse_families_response): New helper functions. 677 (genl_families_xlat): New function for building the xlat table 678 for NETLINK_GENERIC decoding. 679 680 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 681 682 dyxlat: new interface for building xlat tables dynamically. 683 xlat tables are usually generated at build time. 684 685 printxval is suitable for printing struct nlmsghdr.nlmsg_type for 686 NETLINK_GENERIC protocol. However, the corresponding xlat table 687 cannot be defined at build time because the values are registered 688 by the kernel at run time. 689 690 This change introduces dyxlat functions for building xlat tables 691 dynamically. The primary use case is decoding nlmsg_type but this 692 interface can be used for other purposes. 693 694 * defs.h (struct dyxlat): New opaque data type. 695 (dyxlat_alloc, dyxlat_free, dyxlat_add_pair): New function declarations. 696 * dyxlat.c: New file. 697 * Makefile.am (strace_SOURCES): Add it. 698 699 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 700 701 Introduce xstrndup function. 702 * configure.ac (AC_CHECK_FUNCS): Add strndup. 703 * defs.h (xstrndup): New prototype. 704 * xmalloc.c (xstrndup): New function. 705 706 2017-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 707 708 netlink: do not print extra braces around payloadless nlmsghdr. 709 * netlink.c (decode_nlmsghdr_with_payload): Print braces before 710 print_nlmsghdr and after decode_payload iff decode_payload is invoked. 711 * tests/netlink_audit.c (test_nlmsg_type): Update expected output. 712 * tests/netlink_netfilter.c: Likewise. 713 * tests/netlink_selinux.c: Likewise. 714 * tests/netlink_protocol.c (send_query): Likewise. 715 * tests/netlink_route.c (test_nlmsg_type, test_nlmsg_flags): Likewise. 716 * tests/netlink_sock_diag.c: Likewise. 717 * tests/netlink_xfrm.c: Likewise. 718 719 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 720 721 Strip argument name of type "struct tcb *" from function prototypes. 722 "struct tcb *" was used in most prototypes along with "struct tcb *tcp", 723 this change converts the latter form to the former for consistency. 724 725 Fix a few spacing style issues. 726 Reported by kernel's checkpatch.pl script. 727 728 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 729 730 Strip redundant trailing semicolons. 731 Strip trailing semicolons from macro definitions. 732 Strip extra semicolons from statements terminations. 733 734 Reported by kernel's checkpatch.pl script. 735 736 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 737 738 Fix macros encosure in a do/while loop. 739 Enclose macros with multiple statements and macros starting 740 with "if" statement in a do/while loop. 741 Do not enclose single statement macros in a do/while loop. 742 743 Reported by kernel's checkpatch.pl script. 744 745 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 746 747 Use __func__ instead of gcc specific __FUNCTION__ 748 Reported by kernel's checkpatch.pl script. 749 750 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 751 752 Fix a few initialization style issues. 753 Do not initialise statics and globals to 0, NULL, or false. 754 755 Reported by kernel's checkpatch.pl script. 756 757 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 758 759 Fix function prototypes with unspecified arguments. 760 Change functions declared as taking unspecified number of arguments 761 of unspecified type to functions that take no arguments. 762 763 Reported by kernel's checkpatch.pl script. 764 765 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 766 767 Fix a few sizeof style issues. 768 Reported by kernel's checkpatch.pl script. 769 770 Fix a few misspellings in comments. 771 Reported by kernel's checkpatch.pl script. 772 773 2017-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 774 775 print_mreq: remove superfluous print_quoted_string calls. 776 The string returned by inet_ntoa(3) has IPv4 dotted-decimal notation, 777 no need to quote it. 778 779 * net.c (print_mreq): Remove print_quoted_string calls. 780 781 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 782 783 tests: check decoding of incomplete SCM_TIMESTAMP* control messages. 784 * tests/msg_control.c (test_scm_timestamp, test_scm_timestampns, 785 test_scm_timestamping): Check decoding of incomplete control messages. 786 787 2017-06-15 Miroslav Lichvar <mlichvar (a] redhat.com> 788 789 msghdr: print SCM_TIMESTAMP* control messages. 790 Add support for printing control messages containing software and/or 791 hardware timestamps, which are typically enabled by NTP and PTP 792 implementations. 793 794 * print_timeval.c (print_struct_timeval_data_size): New mpers printer. 795 * print_timespec.c (print_struct_timespec_data_size, 796 print_struct_timespec_array_data_size): Likewise. 797 * msghdr.c (print_scm_timestamp, print_scm_timestampns, 798 print_scm_timestamping): New functions. 799 (cmsg_socket_printers): Add them. 800 * NEWS: Mention this change. 801 * tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h". 802 (test_scm_timestamp, test_scm_timestampns, test_scm_timestamping): 803 New functions. 804 (test_sol_socket): Use them. 805 806 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 807 808 tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages. 809 * tests/netlink_sock_diag.c: Include <linux/smc_diag.h>. 810 (SMC_ACTIVE): New macro. 811 (test_smc_diag_req, test_smc_diag_msg): New functions. 812 (main): Use them. 813 814 netlink: add a basic socket diag parser of AF_SMC messages. 815 * linux/smc_diag.h: New file. 816 * Makefile.am (EXTRA_DIST): Add it. 817 * netlink_sock_diag.c: Include <linux/smc_diag.h>, 818 "xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h". 819 (decode_smc_diag_req, decode_smc_diag_msg): New functions. 820 (diag_decoders): Add AF_SMC. 821 * xlat/smc_diag_extended_flags.in: New file. 822 * xlat/smc_states.in: Likewise. 823 824 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 825 Fabien Siron <fabien.siron (a] epita.fr> 826 827 tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages. 828 * tests/netlink_sock_diag.c: Include <arpa/inet.h> 829 and <linux/inet_diag.h>. 830 (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2, 831 test_inet_diag_msg): New functions. 832 (mian): Use them. 833 834 netlink: add a basic socket diag parser of AF_INET and AF_INET6 messages 835 * defs.h (inet_protocols): New xlat prototype. 836 * linux/inet_diag.h (inet_diag_req): New structure. 837 (INET_DIAG_*): New enum. 838 * netlink_sock_diag.c: Include <arpa/inet.h>, <linux/inet_diag.h> 839 and "xlat/inet_diag_extended_flags.h". 840 (print_inet_diag_sockid, decode_inet_diag_req_compat) 841 (decode_inet_diag_req_v2, decode_inet_diag_req) 842 (decode_inet_diag_msg): New functions. 843 (diag_decoders): Add AF_INET and AF_INET6; 844 * xlat/inet_diag_extended_flags.in: New file. 845 846 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 847 848 Introduce print_inet_addr. 849 * defs.h (print_inet_addr): New prototype. 850 * sockaddr.c (print_inet_addr): New function. 851 (print_sockaddr_data_in6): Use it. 852 * net.c (print_mreq6): Likewise. 853 * tests/ip_mreq.c (main): Update expected output. 854 855 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 856 Fabien Siron <fabien.siron (a] epita.fr> 857 858 tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages. 859 * tests/netlink_sock_diag.c: Include <linux/if_ether.h> 860 and <linux/packet_diag.h>. 861 (test_packet_diag_req, test_packet_diag_msg): New functions. 862 (main): Use them. 863 864 netlink: add a basic socket diag parser of AF_PACKET messages. 865 * linux/packet_diag.h: New file. 866 * Makefile.am (EXTRA_DIST): Add it. 867 * defs.h (ethernet_protocols): New xlat prototype. 868 * netlink_sock_diag.c: Include <linux/packet_diag.h> 869 and "xlat/packet_diag_show.h". 870 (decode_packet_diag_req, decode_packet_diag_msg): New functions. 871 (diag_decoders): Add AF_PACKET. 872 * xlat/packet_diag_show.in: New file. 873 874 tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages. 875 * tests/netlink_sock_diag.c: Include <linux/netlink_diag.h>. 876 (test_netlink_diag_req, test_netlink_diag_msg): New functions. 877 (main): Use them. 878 879 netlink: add a basic socket diag parser of AF_NETLINK messages. 880 * linux/netlink_diag.h (NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG): 881 New macros. 882 * netlink_sock_diag.c: Include <linux/netlink_diag.h>, 883 "xlat/netlink_diag_show.h" and "xlat/netlink_states.h". 884 (decode_netlink_diag_req, decode_netlink_diag_msg): New functions. 885 (diag_decoders): Add AF_NETLINK. 886 * xlat/netlink_diag_show.in: New file. 887 * xlat/netlink_states.in: Likewise. 888 889 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 890 Fabien Siron <fabien.siron (a] epita.fr> 891 JingPiao Chen <chenjingpiao (a] gmail.com> 892 893 tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages. 894 * tests/netlink_sock_diag.c: Include <netinet/tcp.h> 895 and <linux/unix_diag.h>. 896 (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, 897 test_unix_diag_msg): New functions. 898 (main): Use them. 899 900 netlink: add a basic socket diag parser of AF_UNIX messages. 901 * defs.h (socktypes): New xlat prototype. 902 * linux/unix_diag.h (UDIAG_SHOW_VFS, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN, 903 UDIAG_SHOW_MEMINFO): New macros. 904 * netlink_sock_diag.c: Include <sys/socket.h>, <linux/netlink.h>, 905 <linux/unix_diag.h>, "xlat/tcp_states.h", "xlat/tcp_state_flags.h", 906 and "xlat/unix_diag_show.h". 907 (decode_unix_diag_req, decode_unix_diag_msg): New functions. 908 (netlink_diag_decoder_t): New typedef. 909 (diag_decoders): New array. 910 (decode_netlink_sock_diag): Use it. 911 * xlat/tcp_state_flags.in: New file. 912 * xlat/tcp_states.in: Likewise. 913 * xlat/unix_diag_show.in: Likewise. 914 915 netlink: introduce family specific payload decoders. 916 * defs.h (netlink_decoder_t): New typedef. 917 (DECL_NETLINK): New macro. 918 (decode_netlink_sock_diag): New prototype. 919 * netlink.c (netlink_decoders): New array. 920 (decode_payload): Use it to invoke netlink family specific decoders. 921 * netlink_sock_diag.c: New file. 922 * Makefile.am (strace_SOURCES): Add it. 923 924 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 925 926 Update SCM_* constants. 927 * xlat/scmvals.in: Add SCM_TIMESTAMP, SCM_TIMESTAMPNS, SCM_TIMESTAMPING, 928 SCM_WIFI_STATUS, and SCM_TIMESTAMPING_OPT_STATS. 929 930 2017-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 931 932 netlink: refactor decode_nlmsg_type. 933 * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_netfilter): 934 New functions. 935 (nlmsg_types_decoder_t): New typedef. 936 (nlmsg_types): Add decoder field. 937 (decode_nlmsg_type): Use it. 938 939 2017-06-14 JingPiao Chen <chenjingpiao (a] gmail.com> 940 941 tests: extend printstr test. 942 * tests/printstr.c (main): Add a case for short read. 943 944 2017-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 945 946 v4l2: fix preprocessor checks. 947 Fix checks for struct v4l2_window.global_alpha and struct 948 v4l2_sdr_format.buffersize. 949 950 * v4l2.c (print_v4l2_format_fmt): Do not assume that 951 HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA and 952 HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE are defined. 953 * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise. 954 955 2017-06-12 Dmitry V. Levin <ldv (a] altlinux.org> 956 957 Move xlat related functions to a separate file. 958 * util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals, 959 printxval_searchn, addflags, sprintflags, printflags_ex): Move ... 960 * xlat.c: ... to this new file. 961 * Makefile.am (strace_SOURCES): Add it. 962 963 2017-06-12 Masatake YAMATO <yamato (a] redhat.com> 964 965 socketeutils: extend receive_responses further. 966 This is the second patch in series of implementing NETLINK_GENERIC 967 protocol decoder. 968 969 This change allows passing of opaque user data to the callback function. 970 971 * socketutils.c (receive_responses): Change the type of proto_name 972 argument from "const char *" to "void *" to allow passing 973 of arbitrary data to the callback function. 974 Rename proto_name to opaque_data, make it the last argument. 975 Pass it to the callback function as the last argument. 976 (inet_parse_response, unix_parse_response, netlink_parse_response): 977 Change the type of proto_name argument from "const char *" to "void *", 978 rename it to opaque_data, make it the last argument. 979 Introduce a local variable proto_name to convert the type 980 of opaque_data argument from "void *" to "const char *". 981 (unix_get, inet_get, netlink_get): Cast the protocol name from 982 "const char *" to "void *" for passing to the callback function. 983 984 2017-06-12 Masatake YAMATO <yamato (a] redhat.com> 985 986 socketeutils: extend receive_responses to handle other netlink types. 987 This is the first patch in series of implementing NETLINK_GENERIC 988 protocol decoder. 989 990 receive_responses was written for decoding kernel responses of type 991 SOCK_DIAG_BY_FAMILY, other types were ignored. 992 993 This change makes the type of netlink response a parameter 994 so the function can be used for other types of communication. 995 996 * socketutils.c (receive_responses): add a new parameter 997 expected_msg_type to handle types other than SOCK_DIAG_BY_FAMILY. 998 999 2017-06-12 JingPiao Chen <chenjingpiao (a] gmail.com> 1000 1001 tests: fix typo. 1002 * tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&. 1003 1004 2017-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 1005 1006 Introduce printflags_ex function. 1007 Add printflags_ex extension over printflags64 that, similar 1008 to printxvals, takes a NULL-terminated sequence of xlat pointers. 1009 1010 * defs.h (printflags_ex): New prototype. 1011 (printflags64): Turn into a thin wrapper around printflags_ex. 1012 * netlink.c (decode_nlmsg_flags): Use printflags_ex. 1013 * util.c (printflags_ex): New function. 1014 (printflags64): Remove. 1015 * xlat/netlink_get_flags.in: Remove entries listed 1016 in xlat/netlink_flags.in file. 1017 * xlat/netlink_new_flags.in: Likewise. 1018 1019 2017-06-08 JingPiao Chen <chenjingpiao (a] gmail.com> 1020 1021 tests: add check for decoding netlink get and new flags. 1022 * tests/netlink_route.c (test_nlmsg_flags): New function, checks 1023 decoding of NETLINK_ROUTE get and new flags. 1024 (main): Use it. 1025 * tests/netlink_sock_diag.c (test_nlmsg_flags): New function, checks 1026 decoding of NETLINK_SOCK_DIAG get flags. 1027 (main): Use it. 1028 * tests/netlink_xfrm.c: (test_nlmsg_flags): New function, checks 1029 decoding of NETLINK_XFRM get and new flags. 1030 (main): Use it. 1031 1032 2017-06-08 JingPiao Chen <chenjingpiao (a] gmail.com> 1033 Fabien Siron <fabien.siron (a] epita.fr> 1034 Dmitry V. Levin <ldv (a] altlinux.org> 1035 1036 netlink: implement generic nlmsg_flags decoding. 1037 * netlink.c: Include "xlat/netlink_get_flags.h" 1038 and "xlat/netlink_new_flags.h". 1039 (decode_nlmsg_flags): New function. 1040 (print_nlmsghdr): Use it. 1041 * xlat/netlink_get_flags.in: New file. 1042 * xlat/netlink_new_flags.in: Likewise. 1043 1044 2017-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 1045 1046 xlat: provide fallback definitions for XFRM_MSG_* constants. 1047 Some of XFRM_MSG_* constants were introduced later than the header file 1048 where they are defined. 1049 1050 * xlat/nl_xfrm_types.in: Add default values for constants. 1051 1052 2017-06-05 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 1053 1054 syscall.c: split trace_syscall() into 6 functions. 1055 This change removes the trace_syscall function. Now, the code that uses 1056 syscall.c trace functions is expected to check whether it is a syscall 1057 entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make 1058 an appropriate sequence of function calls. 1059 1060 * defs.h: Update comment on TCB_INSYSCALL. 1061 (trace_syscall): Remove prototype. 1062 (syscall_entering_decode, syscall_entering_trace, 1063 syscall_entering_finish, syscall_exiting_decode, syscall_exiting_trace, 1064 syscall_exiting_finish): New prototypes. 1065 * strace.c (trace_syscall): New static replacement for old trace_syscall. 1066 * syscall.c (trace_syscall): Remove. 1067 (trace_syscall_entering): Split into ... 1068 (syscall_entering_decode, syscall_entering_trace, 1069 syscall_entering_finish): ... new functions. 1070 (trace_syscall_exiting): Split into ... 1071 (syscall_exiting_decode, syscall_exiting_trace, 1072 syscall_exiting_finish): ... new functions. 1073 1074 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1075 1076 tests: guard against missing linux/netfilter/nfnetlink.h. 1077 nfnetlink was introduced in linux by commit v2.6.14-rc1~1035^2~217, 1078 add a guard for the case when system headers are not fresh enough. 1079 1080 * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nfnetlink.h. 1081 * tests/netlink_netfilter.c: Check for HAVE_LINUX_NETFILTER_NFNETLINK_H. 1082 1083 2017-06-05 JingPiao Chen <chenjingpiao (a] gmail.com> 1084 1085 tests: check decoding of NETLINK_XFRM message types. 1086 * tests/netlink_xfrm.c: New file. 1087 * tests/gen_tests.in (netlink_xfrm): New entry. 1088 * tests/pure_executables.list: Add netlink_xfrm. 1089 * tests/.gitignore: Likewise. 1090 1091 tests: check decoding of NETLINK_SELINUX message types. 1092 * tests/netlink_selinux.c: New file. 1093 * tests/gen_tests.in (netlink_selinux): New entry. 1094 * tests/pure_executables.list: Add netlink_selinux. 1095 * tests/.gitignore: Likewise. 1096 1097 tests: check decoding of NETLINK_NETFILTER message types. 1098 * tests/netlink_netfilter.c: New file. 1099 * tests/gen_tests.in (netlink_netfilter): New entry. 1100 * tests/pure_executables.list: Add netlink_netfilter. 1101 * tests/.gitignore: Likewise. 1102 1103 tests: check decoding of NETLINK_AUDIT message types. 1104 * tests/netlink_audit.c: New file. 1105 * tests/gen_tests.in (netlink_audit): New entry. 1106 * tests/pure_executables.list: Add netlink_audit. 1107 * tests/.gitignore: Likewise. 1108 1109 tests: check decoding of NETLINK_ROUTE message types. 1110 * tests/netlink_route.c: New file. 1111 * tests/gen_tests.in (netlink_route): New entry. 1112 * tests/pure_executables.list: Add netlink_route. 1113 * tests/.gitignore: Likewise. 1114 1115 tests: check decoding of NETLINK_SOCK_DIAG message types. 1116 * tests/netlink_sock_diag.c: New file. 1117 * tests/netlink_sock_diag.test: New test. 1118 * tests/pure_executables.list: Add netlink_sock_diag. 1119 * tests/.gitignore: Likewise. 1120 * tests/Makefile.am (DECODER_TESTS): Add netlink_sock_diag.test. 1121 1122 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1123 1124 tests: use create_nl_socket in netlink_protocol.test. 1125 * tests/netlink_protocol.c (main): Use create_nl_socket. 1126 1127 tests: change netlink_protocol.test to trace sendto syscalls only. 1128 * tests/gen_tests.in (netlink_protocol): Replace %network with sendto. 1129 * tests/netlink_protocol.c (main): Update expected output. 1130 1131 tests: enhance create_nl_socket diagnostics messages. 1132 * tests/tests.h (create_nl_socket): Rename to create_nl_socket_ext, 1133 add a string argument. 1134 (create_nl_socket): New macro wrapper around create_nl_socket_ext. 1135 * tests/create_nl_socket.c (create_nl_socket): Rename 1136 to create_nl_socket_ext, add a string argument, include it 1137 in diagnostic messages. 1138 1139 tests: use const and designated initializers in create_nl_socket.c. 1140 * tests/create_nl_socket.c: Stop including <string.h>. 1141 (create_nl_socket): Use const and designated initializers. 1142 1143 2017-06-05 JingPiao Chen <chenjingpiao (a] gmail.com> 1144 1145 tests: add create_nl_socket function to libtests. 1146 * tests/create_nl_socket.c: New file. 1147 * tests/tests.h (create_nl_socket): New prototype. 1148 * tests/Makefile.am (libtests_a_SOURCES): Add create_nl_socket.c. 1149 1150 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1151 Fabien Siron <fabien.siron (a] epita.fr> 1152 1153 netlink: add decoding of NETLINK_NETFILTER message types. 1154 * xlat/nl_netfilter_msg_types.in: New file. 1155 * xlat/nl_netfilter_subsys_ids.in: Likewise. 1156 * netlink.c: Include "xlat/nl_netfilter_msg_types.h" 1157 and "xlat/nl_netfilter_subsys_ids.h". 1158 (nlmsg_types): Add NETLINK_NETFILTER. 1159 (decode_nlmsg_type): Handle NETLINK_NETFILTER. 1160 1161 netlink: add decoding of NETLINK_XFRM message types. 1162 * xlat/nl_xfrm_types.in: New file. 1163 * netlink.c: Include "xlat/nl_xfrm_types.h". 1164 (nlmsg_types): Add NETLINK_XFRM. 1165 1166 netlink: add decoding of NETLINK_SELINUX message types. 1167 * xlat/nl_selinux_types.in: New file. 1168 * netlink.c: Include "xlat/nl_selinux_types.h". 1169 (nlmsg_types): Add NETLINK_SELINUX. 1170 1171 netlink: add decoding of NETLINK_ROUTE message types. 1172 * xlat/nl_route_types.in: New file. 1173 * netlink.c: Include <linux/rtnetlink.h> and "xlat/nl_route_types.h". 1174 (nlmsg_types): Add NETLINK_ROUTE. 1175 1176 netlink: add decoding of NETLINK_AUDIT message types. 1177 * xlat/nl_audit_types.in: New file. 1178 * netlink.c: Include <linux/audit.h> and "xlat/nl_audit_types.h". 1179 (nlmsg_types): Add NETLINK_AUDIT. 1180 1181 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1182 Fabien Siron <fabien.siron (a] epita.fr> 1183 1184 netlink: implement generic nlmsg_type decoding. 1185 Implement a pluggable mechanism of nlmsg_type decoding. 1186 Add decoding of NETLINK_SOCK_DIAG types. 1187 1188 * linux/sock_diag.h (SOCK_DESTROY): New macro. 1189 * xlat/nl_sock_diag_types.in: New file. 1190 * netlink.c: Include xlat/nl_sock_diag_types.h. 1191 (get_fd_nl_family, decode_nlmsg_type): New functions. 1192 (print_nlmsghdr): Use them for nlmsg_type decoding. 1193 1194 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1195 1196 netlink: add netlink family argument to printers and decoders. 1197 * netlink.c (NL_FAMILY_ERROR, NL_FAMILY_DEFAULT): New constants. 1198 (print_nlmsghdr): Add netlink family argument, change return type 1199 to int, return family. 1200 (decode_nlmsghdr_with_payload, decode_nlmsgerr, decode_payload): Add 1201 netlink family argument. All callers updated. 1202 1203 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 1204 Dmitry V. Levin <ldv (a] altlinux.org> 1205 1206 Add file descriptor argument to decode_netlink. 1207 * defs.h (decode_netlink): Add file descriptor argument. 1208 * io.c (print_iovec): Specify file descriptor to decode_netlink. 1209 * net.c (decode_sockbuf): Likewise. 1210 * netlink.c (print_nlmsghdr, decode_nlmsghdr_with_payload, 1211 decode_nlmsgerr, decode_payload, decode_nlmsghdr_with_payload, 1212 decode_netlink): Likewise. 1213 All callers updated. 1214 1215 Introduce getfdinode to obtain inode from fd. 1216 * defs.h (getfdinode): New prototype. 1217 * utils.c (getfdinode): New function. 1218 1219 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 1220 Dmitry V. Levin <ldv (a] altlinux.org> 1221 1222 Introduce get_sockaddr_by_inode. 1223 Add a way to get socket information without printing it. 1224 1225 * defs.h (get_sockaddr_by_inode): New prototype. 1226 * socketutils.c (get_sockaddr_by_inode): New function. 1227 1228 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1229 1230 socketutils.c: introduce get_sockaddr_by_inode_uncached. 1231 * socketutils.c (get_sockaddr_by_inode_uncached): New function. 1232 (print_sockaddr_by_inode_uncached): Use it. 1233 1234 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 1235 Dmitry V. Levin <ldv (a] altlinux.org> 1236 1237 socketutils.c: use get_sockaddr_by_inode_cached. 1238 * socketutils.c (unix_print, inet_print, tcp_v4_print, tcp_v6_print, 1239 udp_v4_print, udp_v6_print, netlink_print): Remove. 1240 (unix_get, inet_get, tcp_v4_get, tcp_v6_get, udp_v4_get, 1241 udp_v6_get, netlink_get): New functions. 1242 (protocols): Update. 1243 1244 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 1245 1246 socketutils.c: move inet_print closer to its first use. 1247 * socketutils.c (inet_print): Move right before tcp_v4_print. 1248 1249 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 1250 Dmitry V. Levin <ldv (a] altlinux.org> 1251 1252 socketutils.c: introduce cache_inode_details. 1253 cache_inode_details gives a way to obtain cache information without 1254 printing it. 1255 1256 * socketutils.c (cache_and_print_inode_details): Rename 1257 to cache_inode_details. Do not print cached information. 1258 (inet_parse_response, unix_parse_response, netlink_parse_response): 1259 Use cache_inode_details instead of cache_and_print_inode_details. 1260 (inet_print, unix_print, netlink_print): Call 1261 print_sockaddr_by_inode_cached. 1262 1263 2017-06-05 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 1264 1265 strace.c: move termination code to a separate function. 1266 This will be needed for the pull-style API. 1267 1268 * strace.c (terminate): New function. 1269 (main): Use it. 1270 1271 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 1272 1273 tests: avoid hitting SO_SNDBUF limit in sendfile/sendfile64 tests. 1274 Do not assume that an executable is small enough and SO_SNDBUF is large 1275 enough so that the executable could be sendfile'ed into a socket pair. 1276 1277 * tests/sendfile.c (main): Create a regular file of the right size 1278 to avoid hitting SO_SNDBUF limit. 1279 * tests/sendfile64.c: Likewise. 1280 1281 Reported-by: Andreas Schwab <schwab (a] linux-m68k.org> 1282 1283 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 1284 1285 Move netlink_protocols definition from net.c to netlink.c. 1286 The side effect of #include "xlat/netlink_protocols.h" is 1287 NETLINK_* constants properly defined in that header file. 1288 While net.c does not use these constants itself, netlink.c 1289 is going to need them soon. 1290 1291 * net.c: Move inclusion of "xlat/netlink_protocols.h" ... 1292 * netlink.c: ... here. 1293 1294 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 1295 1296 travis: switch from gcc-6 to gcc-7. 1297 * .travis.yml (matrix): Change gcc-6 to gcc-7. 1298 1299 tests: extend checking of NLMSG_DONE decoding. 1300 * tests/netlink_protocol.c (test_nlmsg_done): Use designated 1301 initializers. Check decoding of messages with non-integer payload. 1302 1303 2017-06-04 JingPiao Chen <chenjingpiao (a] gmail.com> 1304 1305 netlink: decode NLMSG_DONE messages. 1306 * netlink.c (decode_payload): Decode NLMSG_DONE messages. 1307 * tests/netlink_protocol.c (test_nlmsg_done): New function 1308 for checking decoding of NLMSG_DONE messages. 1309 (main): Use it. 1310 1311 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 1312 1313 socketutils.c: introduce get_sockaddr_by_inode_cached. 1314 * socketutils.c (get_sockaddr_by_inode_cached): New function. 1315 (print_sockaddr_by_inode_cached): Use it. 1316 1317 2017-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 1318 1319 Unexport print_sockaddr_by_inode_cached. 1320 Change print_sockaddr_by_inode to be the only function exposed, 1321 hide print_sockaddr_by_inode_cached as a part of implementation. 1322 1323 * defs.h (print_sockaddr_by_inode_cached): Remove prototype. 1324 (print_sockaddr_by_inode): Add struct tcb * and descriptor arguments. 1325 * socketutils.c (print_sockaddr_by_inode_cached): Make static. 1326 (print_sockaddr_by_inode): Rename to print_sockaddr_by_inode_uncached, 1327 make static. 1328 (print_sockaddr_by_inode): New function. 1329 * util.c (printfd): Update to use new print_sockaddr_by_inode. 1330 1331 2017-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 1332 1333 Introduce str_strip_prefix_len function and STR_STRIP_PREFIX macro. 1334 Address proliferation of string prefix check implementations. 1335 1336 * defs.h (str_strip_prefix_len): New inline function. 1337 (STR_STRIP_PREFIX): New macro. 1338 * qualify.c (strip_prefix): Remove. 1339 (parse_inject_token): Use STR_STRIP_PREFIX instead of strip_prefix. 1340 (qualify): Use str_strip_prefix_len. 1341 * socketutils.c (netlink_parse_response): Likewise. 1342 * util.c (printfd): Likewise. 1343 1344 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 1345 1346 netlink: move NLMSG_ERROR payload length check to nlmsgerr decoder. 1347 Move decoder specific check to the decoder. 1348 1349 * netlink.c (decode_payload): Move NLMSG_ERROR payload length check ... 1350 (decode_nlmsgerr): ... here. 1351 1352 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 1353 1354 strace.c: handle PTRACE_EVENT_EXEC like other events. 1355 There is nothing unusual about PTRACE_EVENT_EXEC that would require 1356 a special treatment. 1357 1358 * strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main 1359 switch statement. 1360 1361 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 1362 1363 strace.c: remove dead code. 1364 As strace does not use WCONTINUED flag, there is no need to handle 1365 WIFCONTINUED status. 1366 1367 * strace.c (print_debug_info) [WIFCONTINUED]: Remove. 1368 (next_event): Remove redundant !WIFSTOPPED check. 1369 1370 2017-06-02 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 1371 1372 strace.c: refactor trace into two functions. 1373 This change decouples waiting for next event from reacting to it. This 1374 makes the control flow easier to understand, and serves as a preparation 1375 for implementing a pull-style API for LuaJIT. 1376 1377 * strace.c (enum trace_event): New enum. 1378 (trace): Split into ... 1379 (next_event, dispatch_event): ... new functions. 1380 (main): Use them. 1381 1382 2017-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 1383 1384 scno.am: include config.h before syscallent.h. 1385 This fixes generation of syscallent.i and subsequent scno.h files 1386 on mips where syscallent.h checks macros defined in config.h. 1387 1388 * scno.am (syscallent.i): Add $(top_builddir)/config.h 1389 to prerequisites, include it. 1390 * NEWS: Mention this fix. 1391 1392 Reported-by: David Robins <dbrobins (a] i4031.net> 1393 1394 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1395 1396 tests: check decoding of sigaction syscall. 1397 * tests/sigaction.c: New file. 1398 * tests/gen_tests.in (sigaction): New entry. 1399 * tests/pure_executables.list: Add sigaction. 1400 * tests/.gitignore: Likewise. 1401 1402 tests: rename sigaction.test to rt_sigaction.test. 1403 * tests/sigaction.awk: Rename to rt_sigaction.awk. 1404 * tests/sigaction.c: Rename to tests/rt_sigaction.c. 1405 * tests/sigaction.test: Rename to tests/rt_sigaction.test. 1406 * tests/.gitignore: Replace sigaction with rt_sigaction. 1407 * tests/pure_executables.list: Likewise. 1408 * tests/Makefile.am (DECODER_TESTS): Replace sigaction.test 1409 with rt_sigaction.test. 1410 (EXTRA_DIST): Replace sigaction.awk with rt_sigaction.awk. 1411 1412 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1413 1414 sparc: enhance decoding of signal number argument of sigaction syscall. 1415 On sparc, unlike all other architectures, old sigaction syscall takes 1416 a negated signal number. 1417 1418 * signal.c (SYS_FUNC(sigaction)) [SPARC || SPARC64]: Enhance printing 1419 of negative signal number argument. 1420 1421 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1422 1423 signal: enhance printing of old_sigaction.mask. 1424 * signal.c (decode_old_sigaction): Print old_sigaction.mask 1425 using tprint_old_sigmask_val. 1426 1427 signal: limit scope of struct old_sigaction32 definition. 1428 * signal.c (struct old_sigaction32): Define only if [!current_wordsize]. 1429 1430 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1431 1432 signal: fix decoding of struct old_sigaction on some architectures. 1433 On alpha, struct old_sigaction.sa_flags has a 32-bit type. 1434 1435 On mips, only first word of old_sigaction.sa_mask is read. 1436 1437 On all architectures except alpha and mips that have old sigaction 1438 syscall, struct old_sigaction has sa_restorer field that has to be 1439 decoded. 1440 1441 * signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type 1442 to unsigned int, add ATTRIBUTE_PACKED. 1443 [MIPS]: Dhrink sa_mask array to 1 element. 1444 [!ALPHA && !MIPS]: Define sa_restorer field unconditionally. 1445 (struct old_sigaction32): Likewise. 1446 (decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field 1447 from old_sigaction32.sa_restorer unconditionally. 1448 [!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag 1449 is set. 1450 * NEWS: Mention this change. 1451 1452 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1453 1454 xlat: rename SA_STACK to SA_ONSTACK. 1455 SA_ONSTACK is the standard name while its alias SA_STACK is not even 1456 defined on many platforms. 1457 1458 * xlat/sigact_flags.in (SA_STACK): Rename to SA_ONSTACK. 1459 1460 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1461 1462 tests: check decoding of sigpending syscall. 1463 * tests/sigpending.c: New file. 1464 * tests/gen_tests.in (sigpending): New entry. 1465 * tests/pure_executables.list: Add sigpending. 1466 * tests/.gitignore: Likewise. 1467 1468 tests: check decoding of sigprocmask syscall. 1469 * tests/sigprocmask.c: New file. 1470 * tests/gen_tests.in (sigprocmask): New entry. 1471 * tests/pure_executables.list: Add sigprocmask. 1472 * tests/.gitignore: Likewise. 1473 1474 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 1475 1476 alpha: rename sys_sigprocmask to sys_osf_sigprocmask. 1477 Parsers of sigprocmask and osf_sigprocmask syscalls are different 1478 anyway, so rename the function to match the syscall name. 1479 1480 * signal.c [ALPHA] (SYS_FUNC(sigprocmask)): Rename 1481 to SYS_FUNC(osf_sigprocmask). 1482 * linux/alpha/syscallent.h: Update sys_func. 1483 1484 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1485 1486 Enable coverage when strace is self terminated by signal. 1487 The data collected by -fprofile-arcs during program run is saved 1488 on program exit. When program is terminated by signal, the data 1489 is not saved. However, libgcov provides an interface to dump 1490 the data at runtime. 1491 1492 * m4/ax_code_coverage.m4 (AX_CODE_COVERAGE): Add -DENABLE_COVERAGE_GCOV 1493 to CODE_COVERAGE_CPPFLAGS. 1494 * strace.c [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype. 1495 (main) [ENABLE_COVERAGE_GCOV]: Call __gcov_flush() before raise() 1496 and sigprocmask() calls that might cause program termination. 1497 1498 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1499 1500 tests: check termination signal forwarding. 1501 * tests/run_expect_termsig.c: New file. 1502 * tests/unblock_reset_raise.c: Likewise. 1503 * tests/termsig.test: New test. 1504 * tests/.gitignore: Add run_expect_termsig and unblock_reset_raise. 1505 * tests/Makefile.am (check_PROGRAMS): Likewise. 1506 (MISC_TESTS): Add termsig.test. 1507 1508 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1509 1510 Fix termination signal forwarding. 1511 When traced command is terminated by a blocked signal, unblock 1512 that signal to ensure strace termination with the same signal. 1513 1514 * strace.c (main): Unblock the signal raised for strace termination. 1515 * NEWS: Mention this change. 1516 1517 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1518 1519 Do not reset SIGCHLD handler in tracees to SIG_DFL. 1520 While strace resets SIGCHLD handler to the default action so that 1521 waitpid definitely works without losing track of children, tracees 1522 should not inherit this change. 1523 1524 * strace.c (struct exec_params): Add child_sa field. 1525 (init): When setting SIGCHLD handler to SIG_DFL, save the old handler. 1526 (exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL 1527 at startup. 1528 * NEWS: Mention this change. 1529 1530 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1531 1532 Refactor setting of signal handlers to reduce redundancy. 1533 * strace.c (set_sigaction): New function. 1534 (init): Use it instead of sigaction with sigaddset. 1535 1536 tests: check how signals are unblocked in interactive mode. 1537 * tests/block_reset_raise_run.c: New file. 1538 * tests/interactive_block.test: New test. 1539 * tests/.gitignore: Add block_reset_raise_run. 1540 * tests/Makefile.am (check_PROGRAMS): Likewise. 1541 (MISC_TESTS): Add interactive_block.test. 1542 1543 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 1544 1545 Fix unblocking of signals in interactive mode. 1546 In interactive mode (-I2), those signals that were blocked at startup 1547 will remain blocked for the whole period of strace execution. 1548 1549 * strace.c (empty_set): Rename to start_set. All users changed. 1550 (init): Initialize start_set and blocked_set to the set of currently 1551 blocked signals. 1552 (startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK. 1553 * NEWS: Mention this change. 1554 1555 2017-05-26 Dmitry V. Levin <ldv (a] altlinux.org> 1556 1557 Cleanup interactive check. 1558 * strace.c (init): Check for INTR_WHILE_WAIT mode the same way 1559 as in other places. 1560 1561 tests: check decoding of signal syscall. 1562 * tests/signal.c: New file. 1563 * tests/gen_tests.in (signal): New entry. 1564 * tests/pure_executables.list: Add signal. 1565 * tests/.gitignore: Likewise. 1566 1567 2017-05-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1568 1569 Unify capitalisation of (c) in copyright notices. 1570 1571 2017-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 1572 1573 Post-release administrivia. 1574 * NEWS: Add a header line for the next release. 1575 * debian/changelog.in: Add a changelog entry for 4.17-1. 1576 * strace.spec.in: Likewise. 1577 1578 2017-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 1579 1580 Prepare for 4.17 release. 1581 * NEWS: Update for 4.17 release. 1582 1583 powerpc64, sparc, sparc64: wire up statx syscall. 1584 * linux/powerpc64/syscallent.h [383]: Add statx entry. 1585 * linux/sparc/syscallent.h [360]: Likewise. 1586 * linux/sparc64/syscallent.h [360]: Likewise. 1587 1588 2017-05-23 Dmitry V. Levin <ldv (a] altlinux.org> 1589 1590 Fix compat personality support for sgetmask syscall. 1591 * signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val 1592 with sprint_old_sigmask_val. 1593 * tests/sxetmask.c (main): Check decoding of signal mask containing 1594 RT signals. 1595 1596 2017-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 1597 1598 Fix decoding of sgetmask and ssetmask syscalls. 1599 Old ssetmask syscall takes an argument and returns a value of type int. 1600 Old sgetmask syscall may return an error. 1601 1602 * signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument 1603 and return value to unsigned int, print it using sprint_old_sigmask_val. 1604 (SYS_FUNC(sgetmask)): Do not print the mask in case of syserror. 1605 * tests/sxetmask.c: New file. 1606 * tests/gen_tests.in (sxetmask): New entry. 1607 * tests/pure_executables.list: Add sxetmask. 1608 * tests/.gitignore: Likewise. 1609 * NEWS: Mention this fix. 1610 1611 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1612 1613 Add copyright headers. 1614 1615 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1616 Elvira Khabirova <lineprinter0 (a] gmail.com> 1617 1618 Add scripts for automating copyright notices update. 1619 * maint/update_copyright_years.awk: New file. 1620 * maint/update_copyright_years.sh: Likewise. 1621 1622 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1623 1624 Fix typos in copyright notices. 1625 1626 unwind.c: remove non-ASCII character from comment. 1627 1628 2017-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 1629 1630 Rename sys_sig[gs]etmask to sys_s[gs]etmask to match syscall names. 1631 * signal.c (SYS_FUNC(sigsetmask)): Rename to SYS_FUNC(ssetmask). 1632 (SYS_FUNC(siggetmask)): Rename to SYS_FUNC(sgetmask). 1633 * linux/arm/syscallent.h (sgetmask, ssetmask): Update sys_func. 1634 * linux/bfin/syscallent.h: Likewise. 1635 * linux/crisv10/syscallent.h: Likewise. 1636 * linux/hppa/syscallent.h: Likewise. 1637 * linux/i386/syscallent.h: Likewise. 1638 * linux/m68k/syscallent.h: Likewise. 1639 * linux/microblaze/syscallent.h: Likewise. 1640 * linux/mips/syscallent-o32.h: Likewise. 1641 * linux/powerpc/syscallent.h: Likewise. 1642 * linux/powerpc64/syscallent.h: Likewise. 1643 * linux/sh/syscallent.h: Likewise. 1644 * linux/sh64/syscallent.h: Likewise. 1645 * linux/sparc/syscallent.h: Likewise. 1646 * linux/sparc64/syscallent.h: Likewise. 1647 1648 tests: enhance sigsuspend.test. 1649 * tests/sigsuspend.c (sigtxt): New variable. 1650 (main): Change signal masks to contain all signals except USR1 and USR2. 1651 1652 2017-05-20 Dmitry V. Levin <ldv (a] altlinux.org> 1653 1654 Fix compat personality support for old sigsuspend syscall. 1655 * signal.c (sprint_old_sigmask_val): New function. 1656 (tprint_old_sigmask_val): New macro. 1657 (SYS_FUNC(sigsuspend)): Use it. 1658 1659 2017-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 1660 1661 Move errnoent.sh, signalent.sh, and syscallent.sh to maint subdirectory. 1662 Also do not include them into release tarballs. These files are 1663 intended for developers who are expected to use a git repository. 1664 1665 * errnoent.sh: Move to maint subdirectory. 1666 * signalent.sh: Likewise. 1667 * syscallent.sh: Likewise. 1668 * HACKING-scripts: Update. 1669 * Makefile.am (EXTRA_DIST): Remove errnoent.sh, signalent.sh, 1670 and syscallent.sh. 1671 1672 2017-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 1673 1674 Do not include maint subdirectory into release tarballs. 1675 These files are intended for developers who are expected to use 1676 a git repository. 1677 1678 * Makefile.am (EXTRA_DIST): Remove maint/ioctls_gen.sh, 1679 maint/ioctls_hex.sh, maint/ioctls_sym.sh, and maint/print_ioctlent.c. 1680 1681 2017-05-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1682 1683 linux/ia64/syscallent.h: remove tabulation, add spaces in file comment. 1684 1685 linux/mtd-abi.h: remove non-ASCII character from file comment. 1686 1687 2017-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 1688 1689 alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall. 1690 On some architectures old sigsuspend syscall takes the signal mask from 1691 the 3rd argument, on some from the 1st. And, if it wasn't peculiar 1692 enough, the signal mask is passed by value on all architectures except 1693 mips where it's passed by reference. 1694 1695 * signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last 1696 argument. 1697 * linux/alpha/syscallent.h (sigsuspend): Set nargs to 1. 1698 * linux/crisv10/syscallent.h: Likewise. 1699 * linux/mips/syscallent-o32.h: Likewise. 1700 * linux/powerpc/syscallent.h: Likewise. 1701 * linux/powerpc64/syscallent.h: Likewise. 1702 * linux/sh/syscallent.h: Likewise. 1703 * linux/sh64/syscallent.h: Likewise. 1704 * linux/sparc/syscallent.h: Likewise. 1705 * linux/sparc64/syscallent.h: Likewise. 1706 * tests/sigsuspend.c: New file. 1707 * tests/gen_tests.in (sigsuspend): New entry. 1708 * tests/pure_executables.list: Add sigsuspend. 1709 * tests/.gitignore: Likewise. 1710 * NEWS: Mention this fix. 1711 1712 2017-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 1713 1714 tests: raise default timeout for individual tests. 1715 Recently added tests based on pure_executables.list are quite slow 1716 by their nature, the one minute default timeout is no longer enough 1717 for some of not so fast architectures. 1718 1719 * tests/init.sh (TIMEOUT_DURATION): Raise from 60 to 120. 1720 1721 2017-05-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1722 1723 Update NEWS. 1724 1725 2017-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 1726 1727 Update TCP_* constants. 1728 * xlat/socktcpoptions.in: Add TCP_FASTOPEN_CONNECT introduced 1729 by linux kernel commit v4.11-rc1~124^2~321^2. 1730 1731 2017-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 1732 1733 Update AF_* constants. 1734 * xlat/addrfams.in: Add AF_SMC introduced by linux kernel 1735 commit v4.11-rc1~94^2~43^2~13. 1736 1737 2017-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 1738 1739 tests: enhance madvise decoder check. 1740 * tests/mmap.c (main): Remove madvise check. 1741 * tests/madvise.c: New file. 1742 * tests/gen_tests.in (madvise): New entry. 1743 * tests/.gitignore: Add madvise. 1744 * tests/pure_executables.list: Likewise. 1745 1746 2017-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1747 1748 tests: add -etrace=?... test. 1749 Check for some architecture-specific syscalls which are not present 1750 on most architectures. 1751 1752 * gen_tests.in: Add trace_question test. 1753 * tests/trace_question.in: New file. 1754 * tests/Makefile.am (EXTRA_DIST): Add it. 1755 1756 2017-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1757 1758 tests: add more information to generated header comments. 1759 * tests/gen_tests.sh: Update header comment with the source string 1760 used for test generation. 1761 1762 tests: move generated common header comment into a variable. 1763 * tests/gen_tests.sh: Move generated file header comment 1764 into a variable, use it in all cases. 1765 1766 2017-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 1767 1768 tests: use TAIL_ALLOC_OBJECT_CONST_PTR in v4l2 test. 1769 * tests/ioctl_v4l2.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR. 1770 1771 2017-04-25 Edgar Kaziahmedov <edos (a] linux.com> 1772 1773 tests: Check decoding of VIDIOC_G/S_TUNER's arg. 1774 * tests/ioctl_v4l2.c (main): Add checks for VIDIOC_G/S_TUNER's arg. 1775 1776 v4l2: Add decoding for VIDIOC_G/S_TUNER's arg. 1777 * v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h", 1778 "xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h". 1779 (print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg. 1780 (v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg. 1781 * xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and 1782 V4L2_TUNER_ANALOG_TV introduced by linux kernel commit 1783 2.5.46~39^2~23^2~4. 1784 Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel 1785 commit v2.6.11-rc4~55^2~20. 1786 Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit 1787 v3.15-rc1~85^2~215. 1788 Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17 1789 (as the replacement of V4L2_TUNER_ADC). 1790 * xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW, 1791 V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2, 1792 V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel 1793 commit 2.5.46~39^2~23^2~4. 1794 Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP 1795 introduced by linux kernel commit v3.6-rc1~28^2~306. 1796 Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189. 1797 Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS 1798 introduced by linux kernel commit v2.6.37-rc1~64^2~110. 1799 Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit 1800 v3.6-rc1~28^2~46. 1801 Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit 1802 v3.6-rc1~28^2~40. 1803 Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit 1804 v3.15-rc1~85^2~214. 1805 * xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO, 1806 V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and 1807 V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit 1808 2.5.46~39^2~23^2~4. 1809 Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit 1810 v2.6.17-rc1~739^2~9. 1811 * xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO, 1812 V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and 1813 V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit 1814 2.5.46~39^2~23^2~4. 1815 Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit 1816 v2.6.32-rc1~679^2~189. 1817 1818 2017-04-24 Dmitry V. Levin <ldv (a] altlinux.org> 1819 1820 tests: check decoding of invalid tv_sec and tv_usec values. 1821 * tests/futimesat.c (main): Check decoding of invalid tv_sec and tv_usec 1822 values. 1823 * tests/xetitimer.c (main): Likewise. 1824 * tests/xettimeofday.c (main): Likewise. 1825 * tests/xselect.c (main): Likewise. 1826 * tests/xutimes.c (main): Likewise. 1827 1828 tests: check decoding of invalid tv_sec and tv_nsec values. 1829 * tests/aio.c (main): Check decoding of invalid tv_sec and tv_nsec 1830 values. 1831 * tests/clock_nanosleep.c (main): Likewise. 1832 * tests/clock_xettime.c (main): Likewise. 1833 * tests/futex.c (main): Likewise. 1834 * tests/nanosleep.c (main): Likewise. 1835 * tests/ppoll.c (main): Likewise. 1836 * tests/pselect6.c (main): Likewise. 1837 * tests/recvmmsg-timeout.c (main): Likewise. 1838 * tests/rt_sigtimedwait.c (main): Likewise. 1839 * tests/semop.c (main): Likewise. 1840 * tests/timer_xettime.c (main): Likewise. 1841 * tests/timerfd_xettime.c (main): Likewise. 1842 * tests/utimensat.c (main): Likewise. 1843 1844 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1845 1846 Print time in ISO 8601 format in time syscall decoder. 1847 * print_time.c (SYS_FUNC(time)): Print timestamp stringification 1848 (via sprinttime) for the value stored in the argument and return value 1849 (return RVAL_STR in the latter case). 1850 * tests/time.c (main): Update expected output. 1851 1852 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1853 Dmitry V. Levin <ldv (a] altlinux.org> 1854 1855 Print string representation of timestamps in parsers of *utime* syscalls 1856 * print_timespec.c (print_timespec_t_utime): Use sprinttime_nsec 1857 to format a string representation of time, use tprints_comment 1858 to print it as a comment. 1859 * print_timeval.c (print_timeval_t_utime): New function. 1860 (print_timeval_utimes): Use it instead of print_timeval_t. 1861 [ALPHA] (print_timeval32_t_utime): New function. 1862 [ALPHA] (print_timeval32_utimes): Use it instead of print_timeval32_t. 1863 * tests/futimesat.c (print_tv): Update expected output. 1864 * tests/utimensat.c (print_ts): Likewise. 1865 * tests/xutimes.c (print_tv): Likewise. 1866 1867 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1868 1869 tests: add support for printing timestamp with microsecond precision. 1870 It will be needed later. 1871 1872 * tests/tests.h (print_time_t_usec): New prototype. 1873 * tests/print_time.c (print_time_t_usec): New function, a thin wrapper 1874 around print_time_t_ex. 1875 1876 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1877 Dmitry V. Levin <ldv (a] altlinux.org> 1878 1879 Print microseconds/nanoseconds as non-negative. 1880 Negative micro/nanoseconds values are treated as invalid by kernel 1881 anyway, and in one case (timespec_valid in include/linux/time.h) 1882 it is even checked by conversion to unsigned long. 1883 1884 * print_timespec.c (timespec_fmt): Change tv_sec format to %lld and 1885 tv_nsec format to %llu. 1886 (print_timespec_t): Cast tv_sec to long long and process tv_nsec with 1887 zero_extend_signed_to_ull. 1888 (sprint_timespec): Likewise. 1889 * print_timeval.c (timeval_fmt): Change tv_sec format to %lld and 1890 tv_usec format to %llu. 1891 (print_timeval_t): Cast tv_sec to long long and process tv_nsec with 1892 zero_extend_signed_to_ull. 1893 (sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise. 1894 * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. 1895 * tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast 1896 it to long long; change tv_usec printing format to %llu, process it with 1897 zero_extend_signed_to_ull. 1898 * tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld, 1899 cast it to long long; change tv_nsec printing format to %llu, process it 1900 with zero_extend_signed_to_ull. 1901 * tests/clock_xettime.c (main): Likewise. 1902 * tests/futex.c (main): Likewise. 1903 * tests/futimesat.c (print_tv): Likewise. 1904 * tests/getrusage.c (invoke_print): Likewise. 1905 * tests/mq_sendrecv.c (do_send, do_recv, main): Likewise. 1906 * tests/nanosleep.c (main): Likewise. 1907 * tests/pselect6.c (main): Likewise. 1908 * tests/restart_syscall.c (main): Likewise. 1909 * tests/rt_sigtimedwait.c (iterate, main): Likewise. 1910 * tests/sched_rr_get_interval.c (main): Likewise. 1911 * tests/semop.c (main): Likewise. 1912 * tests/timer_xettime.c (main): Likewise. 1913 * tests/timerfd_xettime.c (main): Likewise. 1914 * tests/waitid.c (main): Likewise. 1915 * tests/xetitimer.c (main): Likewise. 1916 * tests/xettimeofday.c (main): Likewise. 1917 * tests/xselect.c (main): Likewise. 1918 * tests/xutimes.c (print_tv): Likewise. 1919 * tests/wait4.c (sprint_rusage): Likewise. 1920 * tests/waitid.c (sprint_rusage): Likewise. 1921 * tests/utimensat.c (print_ts): Likewise. 1922 (main): Add check for higher bits of tv_sec/tv_nsec. 1923 1924 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1925 Dmitry V. Levin <ldv (a] altlinux.org> 1926 1927 Always print raw values of time data fields. 1928 Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec 1929 that handle nanoseconds and microseconds, respectively. 1930 Always print raw values of time data fields, format string 1931 representations of time as comments. 1932 1933 * defs.h (sprinttime): Change argument type from time_t to long long. 1934 (sprinttime_nsec, sprinttime_usec): New prototypes. 1935 * util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New 1936 functions. 1937 (sprinttime): Turn into a thin wrapper around sprinttime_ex. 1938 * stat.h (struct strace_stat): Add has_nsec field. 1939 * fetch_struct_stat.c (HAVE_NSEC): New macro. 1940 (fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC. 1941 * fetch_struct_stat64.c (HAVE_NSEC): New macro. 1942 (fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC. 1943 * print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>: 1944 Print raw values of time fields, use sprinttime_nsec to format a string 1945 representation of time, use tprints_comment to print it as a comment. 1946 * statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise. 1947 * utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime 1948 and struct utimbuf.modtime fields, use sprinttime to format a string 1949 representation of time, use tprints_comment to print it as a comment. 1950 * tests/tests.h (print_time_t_nsec): Add int argument. 1951 * tests/print_time.c (print_time_t_ex): New function. 1952 (print_time_t_nsec): Add int argument, turn into a thin wrapper around 1953 print_time_t_ex. 1954 * tests/utime.c (main): Update expected output. 1955 * tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro. 1956 [!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update 1957 expected output. 1958 * NEWS: Mention this timestamps representation improvement. 1959 1960 2017-04-24 Dmitry V. Levin <ldv (a] altlinux.org> 1961 1962 Introduce tprintf_comment and tprints_comment functions. 1963 * defs.h (tprintf_comment, tprints_comment): New prototypes. 1964 * strace.c (tvprintf): New function. 1965 (tprintf): Use it. 1966 (tprintf_comment, tprints_comment): New functions. 1967 * aio.c (tprint_lio_opcode): Use tprints_comment. 1968 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 1969 dm_decode_dm_name_list, dm_decode_dm_target_versions, 1970 dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise. 1971 * futex.c (SYS_FUNC(futex)): Likewise. 1972 * perf.c (print_perf_event_attr): Likewise. 1973 * seccomp.c (decode_bpf_code): Likewise. 1974 * util.c (printxvals, printxval_searchn, printflags64): Likewise. 1975 * btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid, 1976 print_key_value_internal): Likewise. 1977 (btrfs_ioctl): Use tprints_comment and tprintf_comment. 1978 * dirent.c (SYS_FUNC(getdents)): Likewise. 1979 * dirent64.c (SYS_FUNC(getdents64)): Likewise. 1980 * execve.c (printargc): Use tprintf_comment. 1981 * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl, 1982 btrfs_test_features_ioctls): Update expected output. 1983 1984 Make output of execve/execveat syscall parsers more structured. 1985 * execve.c (printargc): Always print the address, format the number 1986 of variables as a comment. 1987 * tests/execve.c: Update expected output. 1988 * tests/execveat.c: Likewise. 1989 * tests/qual_syscall.test: Likewise. 1990 * tests/strace-r.expected: Likewise. 1991 * tests/strace-t.test: Likewise. 1992 * tests/strace-tt.test: Likewise. 1993 * tests/strace-ttt.test: Likewise. 1994 * tests/threads-execve.c: Likewise. 1995 * tests/threads-execve.test: Likewise. 1996 1997 dm: fix diagnostics about misplaced parts of struct dm_ioctl. 1998 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 1999 dm_decode_dm_name_list, dm_decode_dm_target_versions, 2000 dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Fix 2001 diagnostics about various misplaced parts of struct dm_ioctl. 2002 * tests/ioctl_dm.c: Update expected output. 2003 2004 print_mq_attr: fix typo. 2005 * print_mq_attr.c (printmqattr): Fix the last argument of printflags64. 2006 2007 2017-04-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2008 2009 tests: add faulty pointer check to time test. 2010 * tests/time.c (main): Add check for an inaccessible pointer. 2011 2012 2017-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 2013 2014 tests: fix print_time_t_nsec usage in xstatx.c. 2015 * tests/xstatx.c (print_stat): Pass tv_nsec field through 2016 zero_extend_signed_to_ull before feeding it to print_time_t_nsec. 2017 2018 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2019 2020 tests: fix netlink_protocol on sparc. 2021 * tests/netlink_protocol.c (test_nlmsgerr): Do not access fields of an 2022 unaligned structure, this makes architectures like sparc very unhappy. 2023 2024 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2025 2026 util: return pointer to string literal directly in sprinttime. 2027 There is no sense to copy it to static buffer first. 2028 2029 * util.c (sprinttime): Just return "0", do not copy it to internal 2030 buffer first. 2031 2032 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2033 2034 tests: remove stat.sample creation from gen_tests.in. 2035 stat.sample is created by appropriate executables and never removed. 2036 2037 * tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat, 2038 trace_stat_like): Remove stat.sample creation. 2039 2040 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2041 2042 tests: tabulate fstat.test. 2043 * tests/gen_tests.in (fstat): New entry. 2044 (fstat64, oldfstat): Update. 2045 * tests/fstat.test: Remove. 2046 * tests/Makefile.am (DECODER_TESTS): Remove fstat.test. 2047 2048 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2049 2050 Implement -e trace=%stat option. 2051 linux/*/syscallent*.h part is updated automatically by: 2052 2053 sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h 2054 2055 * sysent.h (TRACE_STAT): New macro. 2056 * syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion. 2057 * qualify.c (lookup_class): Add TRACE_STAT for "%stat". 2058 * strace.1 (.SS Filtering): Add information about %stat syscall class. 2059 * NEWS: Mention this change. 2060 * linux/aarch64/syscallent.h (stat): Add TST flag. 2061 * linux/ia64/syscallent.h: Likewise. 2062 * linux/mips/syscallent-n32.h: Likewise. 2063 * linux/mips/syscallent-n64.h: Likewise. 2064 * linux/s390x/syscallent.h: Likewise. 2065 * linux/x32/syscallent.h: Likewise. 2066 * linux/x86_64/syscallent.h: Likewise. 2067 * linux/arm/syscallent.h (oldstat, stat, stat64): Likewise. 2068 * linux/bfin/syscallent.h: Likewise. 2069 * linux/crisv10/syscallent.h: Likewise. 2070 * linux/i386/syscallent.h: Likewise. 2071 * linux/m68k/syscallent.h: Likewise. 2072 * linux/microblaze/syscallent.h: Likewise. 2073 * linux/mips/syscallent-o32.h: Likewise. 2074 * linux/powerpc/syscallent.h: Likewise. 2075 * linux/sh64/syscallent.h: Likewise. 2076 * linux/sh/syscallent.h: Likewise. 2077 * linux/avr32/syscallent.h (stat, stat64): Likewise. 2078 * linux/hppa/syscallent.h: Likewise. 2079 * linux/s390/syscallent.h: Likewise. 2080 * linux/sparc64/syscallent.h: Likewise. 2081 * linux/sparc/syscallent.h: Likewise. 2082 * linux/xtensa/syscallent.h: Likewise. 2083 * linux/powerpc64/syscallent.h (oldstat, stat): Likewise. 2084 * linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise. 2085 * linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat, 2086 svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise. 2087 * tests/gen_tests.in (trace_stat): New entry. 2088 * tests/trace_stat.in: New file. 2089 * tests/Makefile.am (EXTRA_DIST): Add it. 2090 * tests/ksysent.c (TST): New macro, defined to 0. 2091 * tests/nsyscalls.c: Likewise. 2092 2093 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2094 2095 Implement -e trace=%lstat option. 2096 linux/*/syscallent*.h part is updated automatically by: 2097 2098 sed -i '/TSTA,.*lx\?stat/ s/TSTA,/TLST|&/' linux/*/syscallent*.h 2099 2100 * sysent.h (TRACE_LSTAT): New macro. 2101 * syscall.c: Alias TLST to TRACE_LSTAT around syscallent.h inclusion. 2102 * qualify.c (lookup_class): Add TRACE_LSTAT for "%lstat". 2103 * strace.1 (.SS Filtering): Add information about %lstat syscall class. 2104 * NEWS: Mention this change. 2105 * linux/aarch64/syscallent.h (lstat): Likewise. 2106 * linux/ia64/syscallent.h: Likewise. 2107 * linux/mips/syscallent-n32.h: Likewise. 2108 * linux/mips/syscallent-n64.h: Likewise. 2109 * linux/s390x/syscallent.h: Likewise. 2110 * linux/x32/syscallent.h: Likewise. 2111 * linux/x86_64/syscallent.h: Likewise. 2112 * linux/arm/syscallent.h (lstat, lstat64, oldlstat): Likewise. 2113 * linux/bfin/syscallent.h: Likewise. 2114 * linux/crisv10/syscallent.h: Likewise. 2115 * linux/i386/syscallent.h: Likewise. 2116 * linux/m68k/syscallent.h: Likewise. 2117 * linux/microblaze/syscallent.h: Likewise. 2118 * linux/mips/syscallent-o32.h: Likewise. 2119 * linux/powerpc/syscallent.h: Likewise. 2120 * linux/sh64/syscallent.h: Likewise. 2121 * linux/sh/syscallent.h: Likewise. 2122 * linux/sparc64/syscallent.h: Likewise. 2123 * linux/sparc/syscallent.h: Likewise. 2124 * linux/avr32/syscallent.h (lstat, lstat64): Likewise. 2125 * linux/hppa/syscallent.h: Likewise. 2126 * linux/powerpc64/syscallent.h: Likewise. 2127 * linux/s390/syscallent.h: Likewise. 2128 * linux/xtensa/syscallent.h: Likewise. 2129 * linux/alpha/syscallent.h (lstat, lstat64, osf_lstat, osf_old_lstat): Likewise. 2130 * linux/mips/syscallent-compat.h (bsd43_lstat, posix_lstat, svr4_lstat, 2131 sysv_lstat): Likewise. 2132 * tests/gen_tests.in (trace_lstat): New entry. 2133 * tests/trace_lstat.in: New file. 2134 * tests/Makefile.am (EXTRA_DIST): Add it. 2135 * tests/ksysent.c (TLST): New macro, defined to 0. 2136 * tests/nsyscalls.c: Likewise. 2137 2138 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2139 2140 Implement -e trace=%fstat option. 2141 linux/*/syscallent*.h part is updated automatically by: 2142 2143 sed -i -e '/TSTA.*fx\?stat/ s/TSTA,/TFST|&/' \ 2144 -e 's/\(TD|TF|TFST|TSTA,\)[[:space:]]/\1/' linux/*/syscallent*.h 2145 2146 * sysent.h (TRACE_FSTAT): New macro. 2147 * syscall.c: Alias TFST to TRACE_FSTAT around syscallent.h inclusion. 2148 * qualify.c (lookup_class): Add TRACE_FSTAT for "%fstat". 2149 * strace.1 (.SS Filtering): Add information about %fstat syscall class. 2150 * NEWS: Mention this change. 2151 * linux/32/syscallent.h (fstat64, fstatat64): Add TFST flag. 2152 * linux/64/syscallent.h (fstat, newfstatat): Likewise. 2153 * linux/aarch64/syscallent.h: Likewise. 2154 * linux/ia64/syscallent.h: Likewise. 2155 * linux/mips/syscallent-n32.h: Likewise. 2156 * linux/mips/syscallent-n64.h: Likewise. 2157 * linux/s390x/syscallent.h: Likewise. 2158 * linux/x32/syscallent.h: Likewise. 2159 * linux/x86_64/syscallent.h: Likewise. 2160 * linux/arm/syscallent.h (fstat, fstat64, fstatat64, oldfstat): Likewise. 2161 * linux/bfin/syscallent.h: Likewise. 2162 * linux/crisv10/syscallent.h: Likewise. 2163 * linux/i386/syscallent.h: Likewise. 2164 * linux/m68k/syscallent.h: Likewise. 2165 * linux/microblaze/syscallent.h: Likewise. 2166 * linux/mips/syscallent-o32.h: Likewise. 2167 * linux/powerpc/syscallent.h: Likewise. 2168 * linux/sh64/syscallent.h: Likewise. 2169 * linux/sh/syscallent.h: Likewise. 2170 * linux/avr32/syscallent.h (fstat, fstat64, fstatat64): Likewise. 2171 * linux/hppa/syscallent.h: Likewise. 2172 * linux/s390/syscallent.h: Likewise. 2173 * linux/sparc64/syscallent.h: Likewise. 2174 * linux/sparc/syscallent.h: Likewise. 2175 * linux/xtensa/syscallent.h: Likewise. 2176 * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, osf_fstat, 2177 osf_old_fstat): Likewise. 2178 * linux/powerpc64/syscallent.h (fstat, newfstatat, oldfstat): Likewise. 2179 * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_oldfstat, posix_fstat, 2180 svr4_fstat, sysv_fstat): Likewise. 2181 * tests/gen_tests.in (trace_fstat): New entry. 2182 * tests/trace_fstat.in: New file. 2183 * tests/Makefile.am (EXTRA_DIST): Add it. 2184 * tests/ksysent.c (TFST): New macro, defined to 0. 2185 * tests/nsyscalls.c: Likewise. 2186 2187 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2188 2189 Implement -e trace=%%stat option. 2190 linux/*/syscallent*.h part is updated automatically by: 2191 2192 sed -i '/TSFA\|stat[iu]s/! s/,[[:space:]]\?\([[:space:]]*SEN(.*stat\)/|TSTA,\1/' \ 2193 linux/*/syscallent*.h 2194 2195 * sysent.h (TRACE_STAT_LIKE): New macro. 2196 * syscall.c: Alias TSTA to TRACE_STAT_LIKE around syscallent.h inclusion. 2197 * qualify.c (lookup_class): Add TRACE_STAT_LIKE for "%%stat". 2198 * strace.1 (.SS Filtering): Add information about %%stat syscall class. 2199 * NEWS: Mention this change. 2200 * linux/32/syscallent.h (fstat64, fstatat64, statx): Add TSTA flag. 2201 * linux/64/syscallent.h (fstat, newfstatat, statx): Likewise. 2202 * linux/aarch64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. 2203 * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2204 osf_fstat, osf_lstat, osf_old_fstat, osf_old_lstat, osf_old_stat, osf_stat, 2205 stat, stat64): Likewise. 2206 * linux/arm/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 2207 oldlstat, oldstat, stat, stat64, statx): Likewise. 2208 * linux/avr32/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 2209 stat64): Likewise. 2210 * linux/bfin/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2211 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 2212 * linux/crisv10/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2213 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 2214 * linux/hppa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 2215 stat64): Likewise. 2216 * linux/i386/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 2217 oldlstat, oldstat, stat, stat64, statx): Likewise. 2218 * linux/ia64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. 2219 * linux/m68k/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 2220 oldlstat, oldstat, stat, stat64, statx): Likewise. 2221 * linux/microblaze/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2222 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 2223 * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_lstat, bsd43_oldfstat, 2224 bsd43_oldstat, bsd43_stat, posix_fstat, posix_lstat, posix_stat, svr4_fstat, 2225 svr4_fxstat, svr4_lstat, svr4_lxstat, svr4_stat, svr4_xstat, sysv_fstat, 2226 sysv_fxstat, sysv_lstat, sysv_lxstat, sysv_stat, sysv_xstat): Likewise. 2227 * linux/mips/syscallent-n32.h (fstat, lstat, newfstatat, stat, statx): Likewise. 2228 * linux/mips/syscallent-n64.h (fstat, lstat, newfstatat, stat, statx): Likewise. 2229 * linux/mips/syscallent-o32.h (fstat, fstat64, fstatat64, lstat, lstat64, 2230 oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. 2231 * linux/powerpc64/syscallent.h (fstat, lstat, newfstatat, oldfstat, oldlstat, 2232 oldstat, stat): Likewise. 2233 * linux/powerpc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2234 oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. 2235 * linux/s390/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 2236 stat64, statx): Likewise. 2237 * linux/s390x/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 2238 * linux/sh64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 2239 oldlstat, oldstat, stat, stat64): Likewise. 2240 * linux/sh/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 2241 oldlstat, oldstat, stat, stat64): Likewise. 2242 * linux/sparc64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2243 oldlstat, stat, stat64): Likewise. 2244 * linux/sparc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 2245 oldlstat, stat, stat64): Likewise. 2246 * linux/x32/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 2247 * linux/x86_64/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 2248 * linux/xtensa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 2249 stat64, statx): Likewise. 2250 * tests/gen_tests.in (trace_stat_like): New entry. 2251 * tests/trace_stat_like.in: New file. 2252 * tests/Makefile.am (EXTRA_DIST): Add it. 2253 * tests/ksysent.c (TSTA): New macro, defined to 0. 2254 * tests/nsyscalls.c: Likewise. 2255 2256 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2257 2258 qualify: add syntax for optional non-matching syscall qualification. 2259 It may be useful in case syscall is not present on the target 2260 architecture. 2261 2262 * qualify.c (qualify_syscall): Add ignore_fail flag, set it to true 2263 in case syscall qualification is led by a question mark(s). 2264 * strace.1 (.SS Filtering): Document ability to use question marks 2265 in syscall qualification. 2266 2267 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2268 2269 linux/alpha/syscallent.h: add TSFA flag to osf_getfsstat. 2270 In accordance with [1]. 2271 2272 [1] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2 2273 2274 * linux/alpha/syscallent.h (osf_getfsstat): Add TSFA flag. 2275 * strace.1 (.SS Filtering) <%%statfs>: Update equivalent regexp. 2276 2277 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2278 2279 linux/mips/syscallent-compat.h: add some TD/TF flags for *stat* variants 2280 *xstat syscalls are, according to [1], like their *stat counterparts, 2281 but with additional argument with fixed value. 2282 2283 [1] http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf 2284 2285 * linux/mips/syscallent-compat.h (*_xstat, *_lxstat, bsd43_oldstat): 2286 Add TF flag. 2287 (*_fxstat, bsd43_oldfstat): Add TD flag. 2288 2289 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2290 2291 Implement -e trace=%%statfs option. 2292 linux/*/syscallent*.h part is updated automatically by: 2293 2294 sed -i 's/\(TSF\),[[:space:]]\?/\1|TSFA,/' linux/*/syscallent*.h 2295 sed -i 's/\(TFSF\),/\1|TSFA,/' linux/*/syscallent*.h 2296 sed -i 's/0\(,.*ustat\)/TSFA\1/' linux/*/syscallent*.h 2297 2298 * sysent.h (TRACE_STATFS_LIKE): New macro. 2299 * syscall.c: Alias TSFA to TRACE_STATFS_LIKE around syscallent.h inclusion. 2300 * qualify.c (lookup_class): Add SCHED_STATFS_LIKE for "%%statfs". 2301 * strace.1 (.SS Filtering): Add information about %%statfs syscall class. 2302 * NEWS: Mention this change. 2303 * linux/32/syscallent.h (statfs64, fstatfs64): Add TSFA flag. 2304 * linux/64/syscallent.h (statfs, fstatfs): Likewise. 2305 * linux/aarch64/syscallent.h (statfs, fstatfs, ustat): Likewise. 2306 * linux/mips/syscallent-n64.h: Likewise. 2307 * linux/x32/syscallent.h: Likewise. 2308 * linux/x86_64/syscallent.h: Likewise. 2309 * linux/arm/syscallent.h (statfs, statfs64, fstatfs, fstatfs64, ustat): 2310 Likewise. 2311 * linux/avr32/syscallent.h: Likewise. 2312 * linux/bfin/syscallent.h: Likewise. 2313 * linux/crisv10/syscallent.h: Likewise. 2314 * linux/hppa/syscallent.h: Likewise. 2315 * linux/i386/syscallent.h: Likewise. 2316 * linux/ia64/syscallent.h: Likewise. 2317 * linux/m68k/syscallent.h: Likewise. 2318 * linux/microblaze/syscallent.h: Likewise. 2319 * linux/mips/syscallent-n32.h: Likewise. 2320 * linux/mips/syscallent-o32.h: Likewise. 2321 * linux/powerpc/syscallent.h: Likewise. 2322 * linux/powerpc64/syscallent.h: Likewise. 2323 * linux/s390/syscallent.h: Likewise. 2324 * linux/s390x/syscallent.h: Likewise. 2325 * linux/sh/syscallent.h: Likewise. 2326 * linux/sh64/syscallent.h: Likewise. 2327 * linux/sparc/syscallent.h: Likewise. 2328 * linux/sparc64/syscallent.h: Likewise. 2329 * linux/xtensa/syscallent.h: Likewise. 2330 * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs, 2331 ofs_fstatfs, osf_fstatfs64, ustat): Likewise. 2332 * linux/mips/syscallent-compat.h (*_statfs, *_statvfs, *_fstatfs): Likewise. 2333 * tests/gen_tests.in (trace_statfs_like): New entry. 2334 * tests/trace_statfs_like.in: New file. 2335 * tests/Makefile.am (EXTRA_DIST): Add it. 2336 * tests/ksysent.c (TSFA): New macro, defined to 0. 2337 * tests/nsyscalls.c: Likewise. 2338 2339 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2340 2341 Implement -e trace=%fstatfs option. 2342 linux/*/syscallent*.h part is updated automatically by: 2343 2344 sed -i 's/TD,[[:space:]]\([[:space:]]*SEN.*[_"]fstatv\?fs\)/TD|TFSF,\1/' \ 2345 linux/*/syscallent*.h 2346 2347 * sysent.h (TRACE_FSTATFS): New macro. 2348 * syscall.c: Alias TFSF to TRACE_FSTATFS around syscallent.h inclusion. 2349 * qualify.c (lookup_class): Add SCHED_FSTATFS for "%fstatfs". 2350 * strace.1 (.SS Filtering): Add information about %fstatfs syscall class. 2351 * NEWS: Mention this change. 2352 * linux/32/syscallent.h (fstatfs64): Add TFSF flag. 2353 * linux/64/syscallent.h (fstatfs): Likewise. 2354 * linux/aarch64/syscallent.h: Likewise. 2355 * linux/mips/syscallent-n64.h: Likewise. 2356 * linux/x32/syscallent.h: Likewise. 2357 * linux/x86_64/syscallent.h: Likewise. 2358 * linux/arm/syscallent.h (fstatfs, fstatfs64): 2359 Likewise. 2360 * linux/avr32/syscallent.h: Likewise. 2361 * linux/bfin/syscallent.h: Likewise. 2362 * linux/crisv10/syscallent.h: Likewise. 2363 * linux/hppa/syscallent.h: Likewise. 2364 * linux/i386/syscallent.h: Likewise. 2365 * linux/ia64/syscallent.h: Likewise. 2366 * linux/m68k/syscallent.h: Likewise. 2367 * linux/microblaze/syscallent.h: Likewise. 2368 * linux/mips/syscallent-n32.h: Likewise. 2369 * linux/mips/syscallent-o32.h: Likewise. 2370 * linux/powerpc/syscallent.h: Likewise. 2371 * linux/powerpc64/syscallent.h: Likewise. 2372 * linux/s390/syscallent.h: Likewise. 2373 * linux/s390x/syscallent.h: Likewise. 2374 * linux/sh/syscallent.h: Likewise. 2375 * linux/sh64/syscallent.h: Likewise. 2376 * linux/sparc/syscallent.h: Likewise. 2377 * linux/sparc64/syscallent.h: Likewise. 2378 * linux/xtensa/syscallent.h: Likewise. 2379 * linux/alpha/syscallent.h (ofs_fstatfs, osf_fstatfs64): Likewise. 2380 * linux/mips/syscallent-compat.h (*_fstatfs, *_fstatvfs): Likewise. 2381 * tests/gen_tests.in (trace_fstatfs): New entry. 2382 * tests/trace_fstatfs.in: New file. 2383 * tests/Makefile.am (EXTRA_DIST): Add it. 2384 * tests/ksysent.c (TFSF): New macro, defined to 0. 2385 * tests/nsyscalls.c: Likewise. 2386 2387 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2388 2389 sysent.h: format syscall flag macros. 2390 Add some tabulation and leading zeroes to the values. 2391 2392 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2393 2394 tests: tabulate sched.test. 2395 Rewrite sched.test using test_trace_expr(). 2396 2397 * tests/gen_tests.in (sched): New entry. 2398 * tests/sched.in: New file, derived from a set of tests in sched.test. 2399 * tests/sched.test: Remove. 2400 * tests/Makefile.am (DECODER_TESTS): Remove sched.test. 2401 (EXTRA_DIST): Add sched.in. 2402 2403 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2404 2405 tests: tabulate regex.test. 2406 Rewrite regex.test using test_trace_expr(). 2407 2408 * tests/gen_tests.in (regex): New entry. 2409 * tests/regex.in: New file, derived from a set of tests in regex.test. 2410 * tests/regex.test: Remove. 2411 * tests/Makefile.am (DECODER_TESTS): Remove regex.test. 2412 (EXTRA_DIST): Add regex.in. 2413 2414 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 2415 2416 tests: tabulate clock.test. 2417 Rewrite clock.test using test_trace_expr(). 2418 2419 * tests/gen_tests.in (clock): New entry. 2420 * tests/clock.in: New file, derived from a set of tests in clock.test. 2421 * tests/clock.test: Remove. 2422 * tests/Makefile.am (DECODER_TESTS): Remove clock.test. 2423 (EXTRA_DIST): Add clock.in. 2424 2425 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2426 2427 tests: tabulate trace_statfs.test. 2428 Rewrite trace_statfs.test using test_trace_expr(). 2429 2430 * tests/gen_tests.in (trace_statfs): New entry. 2431 * tests/trace_statfs.in: New file, derived from a set of tests 2432 in trace_statfs.test. 2433 * tests/trace_statfs.test: Remove. 2434 * tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test. 2435 (EXTRA_DIST): Add trace_statfs.in. 2436 2437 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2438 2439 tests/init.sh: add helpers for running set of programs. 2440 This introduces three new helpers: 2441 prog_set_subtract subtracts one program set from another, 2442 test_pure_prog_set runs strace check on a set of programs, 2443 test_trace_expr tests trace expressions. 2444 2445 * tests/init.sh (prog_set_subtract, test_pure_prog_set, 2446 test_trace_expr): New functions. 2447 2448 2017-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 2449 2450 tests: extend gen_tests.sh further. 2451 * tests/gen_tests.sh: Extend support of arbitrary rules. 2452 2453 2017-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2454 2455 tests/xstat.c: do not remove sample file after test. 2456 As tests are executed in separate directories now, there is no need to 2457 remove sample file. 2458 2459 * tests/xstat.c (main): Remove unlink calls. 2460 2461 2017-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2462 2463 tests: use fixed name for stat tests sample file. 2464 As tests are now run in separate directories. 2465 2466 * tests/xstatx.c: Use fixed "stat.sample" name for sample file. 2467 * tests/fstat.test: Use it as an argument for -P option. 2468 * tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat, 2469 oldstat, stat, stat64, statx): Likewise. 2470 2471 2017-04-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2472 2473 Derive copyright year from the git commit date. 2474 This solves problems like the need to update test suite on every 2475 New Year's Eve. 2476 2477 * Makefile.am (dist-hook): Generate .year. 2478 * copyright-year-gen: New file. 2479 * configure.ac (copyright_year): New m4 variable, defined as the output 2480 of copyright-year-gen script. 2481 (AC_COPYRIGHT): Use it. 2482 (COPYRIGHT_YEAR): New output variable and preprocessor macro. 2483 * strace.c (print_version): Use COPYRIGHT_YEAR. 2484 * strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf 2485 variable to .year file. 2486 * tests/strace-V.test (config_year): New variable, derived from config.h. 2487 Add sanity checks for $config_year and use it in expected output. 2488 2489 Reported-by: Andreas Schwab <schwab (a] suse.de> 2490 2491 2017-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 2492 2493 tests: move /proc/ checks from scripts to executables. 2494 Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts 2495 to xecutables. 2496 2497 * tests/attach-f-p.test: Move /proc/self/task/ check ... 2498 * tests/attach-f-p-cmd.c (main): ... here. 2499 * tests/fstat.test: Move /proc/self/fd/ check ... 2500 * tests/xstatx.c (main): ... here. 2501 * tests/net-y-unix.test: Move /proc/self/fd/ check ... 2502 * tests/net-y-unix.c (main): ... here. 2503 * tests/net-yy-inet.test: Move /proc/self/fd/ check ... 2504 * tests/net-yy-inet.c (main): ... here. 2505 * tests/net-yy-netlink.test: Move /proc/self/fd/ check ... 2506 * tests/net-yy-netlink.c (main): ... here. 2507 * tests/net-yy-unix.test: Move /proc/self/fd/ check ... 2508 * tests/net-yy-unix.c (main): ... here. 2509 2510 2017-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 2511 2512 tests: tabulate pread64-pwrite64.test. 2513 * tests/gen_tests.in (pread64-pwrite64): New entry. 2514 * tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/ 2515 is not available. 2516 * tests/pread64-pwrite64.test: Remove. 2517 * tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test. 2518 2519 tests: tabulate read-write.test. 2520 * tests/gen_tests.in (read-write): New entry. 2521 * tests/read-write.c: (main): Skip the test if /proc/self/fd/ 2522 is not available. 2523 * tests/read-write.test: Remove. 2524 * tests/Makefile.am (DECODER_TESTS): Remove read-write.test. 2525 2526 tests: add skip_if_unavailable function to libtests. 2527 * tests/skip_unavailable.c: New file. 2528 * tests/tests.h (skip_if_unavailable): New prototype. 2529 * tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c. 2530 2531 tests: tabulate netlink_protocol.test. 2532 * tests/gen_tests.in (netlink_protocol): New entry. 2533 * tests/netlink_protocol.test: Remove. 2534 * tests/Makefile.am (DECODER_TESTS): Remove netlink_protocol.test. 2535 2536 tests: tabulate statfs.test. 2537 * tests/gen_tests.in (statfs): New entry. 2538 (fstatfs, fstatfs64, statfs64): Update. 2539 * tests/statfs.test: Remove. 2540 * tests/Makefile.am (DECODER_TESTS): Remove statfs.test. 2541 2542 2017-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 2543 2544 tests: skip statfs related tests if their sample files are not available 2545 * tests/xstatfsx.c (print_statfs): Skip the test if open failed. 2546 2547 tests: extend gen_tests.sh to support arbitrary test_* rules. 2548 * tests/gen_tests.sh: Add support of arbitrary test_* rules. 2549 2550 tests: change gen_tests.sh to read its input as raw input. 2551 * tests/gen_tests.sh: Specify -r option to read. 2552 * tests/gen_tests.in (shmxt): Update. 2553 2554 2017-04-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2555 2556 strace.1: s/regex expression/regular expression/ 2557 2558 2017-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 2559 2560 strace.1: enhance %statfs description. 2561 * strace.1 (.SS Filtering) <%statfs>: Fix the list of syscalls, 2562 add an equivalent regex expression. 2563 2564 netlink: decode NLMSG_ERROR messages. 2565 * netlink.c (decode_nlmsgerr, decode_payload): New functions. 2566 (decode_nlmsghdr_with_payload): Use decode_payload. 2567 * tests/netlink_protocol.c (send_query): Check decoding 2568 of NLMSG_ERROR messages. 2569 * NEWS: Mention this change. 2570 2571 netlink: avoid using unaligned sizeof(struct nlmsghdr) unnecessarily. 2572 * netlink.c (NLMSG_HDRLEN): Redefine. 2573 (decode_nlmsghdr_with_payload, decode_netlink): Use it instead 2574 of sizeof(struct nlmsghdr). 2575 2576 Fix the length argument passed from print_iovec to decode_netlink. 2577 * io.c (print_iovec): Pass the actual length to decode_netlink 2578 instead of the original length. 2579 * NEWS: Mention this fix. 2580 2581 numa: fix printing of error values in move_pages status array. 2582 * numa.c (print_status): Do not lose a minus sign when printing 2583 a symbolic error code. 2584 * tests/move_pages.c (print_status_array): Update expected output. 2585 2586 tests: generate pure_executables part of check_PROGRAMS automatically. 2587 * tests/gen_pure_executables.sh: New file. 2588 * bootstrap: Invoke it. 2589 * tests/Makefile.am: Include pure_executables.am. 2590 (check_PROGRAMS): Add $(PURE_EXECUTABLES). Remove everything listed 2591 in pure_executables.list. 2592 (EXTRA_DIST): Add gen_pure_executables.sh. 2593 * tests/.gitignore: Add pure_executables.am. 2594 2595 tests: make EXTRA_DIST sorted. 2596 * tests/Makefile.am (EXTRA_DIST): Sort. 2597 2598 tests: check decoding of alpha specific osf_utimes syscall. 2599 * tests/osf_utimes.c: New file. 2600 * tests/gen_tests.in (osf_utimes): New entry. 2601 * tests/Makefile.am (check_PROGRAMS): Add osf_utimes. 2602 * tests/pure_executables.list: Likewise. 2603 * tests/.gitignore: Likewise. 2604 2605 tests: parametrize utimes.c. 2606 * tests/xutimes.c: New file, based on utimes.c. 2607 * tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR, 2608 TEST_STRUCT): New macros. 2609 [__NR_utimes]: Replace all the rest with include "xutimes.c". 2610 * tests/Makefile.am (EXTRA_DIST): Add xutimes.c. 2611 2612 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2613 2614 alpha: fix tracing flags of osf_select and osf_utimes syscalls. 2615 * linux/alpha/syscallent.h (osf_select): Add TD flag. 2616 (osf_utimes): Add TF flag. 2617 * NEWS: Mention alpha specific fixes. 2618 2619 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2620 2621 alpha: rename print_timeval32_pair to print_timeval32_utimes. 2622 This follows the rename of print_timeval_item to print_timeval_utimes. 2623 2624 * defs.h [ALPHA] (print_timeval32_pair): Rename 2625 to print_timeval32_utimes. 2626 * print_timeval.c [ALPHA] (print_timeval32_pair): Likewise. 2627 * utimes.c [ALPHA] (SYS_FUNC(osf_utimes)): Replace print_timeval32_pair 2628 with print_timeval32_utimes. 2629 2630 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2631 2632 tests: do more rigorous testing of utimes syscall parser. 2633 * tests/utimes.c (errstr): New variable. 2634 (print_ts, k_utimes): New functions. 2635 (main): Use them to do more rigorous testing of utimes syscall parser. 2636 * tests/gen_tests.in (utimes): Update -a option. 2637 2638 tests: do more rigorous testing of futimesat syscall parser. 2639 * tests/futimesat.c (errstr): New variable. 2640 (print_ts, k_futimesat): New functions. 2641 (main): Use them to do more rigorous testing of futimesat syscall parser. 2642 2643 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2644 2645 Fix printing of inaccessible times argument of utimes and futimesat syscalls 2646 When the whole pair of struct timeval structures cannot be fetched from 2647 tracee's memory, print the address. This behavior follows the kernel's 2648 that uses copy_from_user for the whole pair, too. 2649 2650 * print_timeval.c (print_timeval_item): Remove. 2651 (print_timeval_pair): Rename to print_timeval_utimes, all callers 2652 updated. Fetch the whole timeval_t array with a single 2653 umove_or_printaddr call. 2654 * tests/futimesat.c (main): Update expected output. 2655 * tests/utimes.c (main): Likewise. 2656 2657 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2658 2659 tests: rewrite utimensat.test without relying on libc utimensat wrapper. 2660 The new test also does more rigorous testing. 2661 2662 * tests/utimensat.c: Stop including <assert.h> and <errno.h>, include 2663 <unistd.h> and <asm/unistd.h>, check __NR_utimensat instead 2664 of HAVE_UTIMENSAT. 2665 (errstr): New variable. 2666 (k_utimensat): New function, a thin wrapper around 2667 syscall(__NR_utimensat). 2668 (main): Use them instead of utimensat. 2669 * tests/gen_tests.in (utimensat): New entry. 2670 * tests/utimensat.test: Remove. 2671 * tests/Makefile.am (DECODER_TESTS): Remove it. 2672 2673 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 2674 2675 tests: use fixed timestamps in utime related tests. 2676 * tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests 2677 from the list of exceptions. 2678 * tests/utime.c (main): Do not use time(), use fixed timestamp instead. 2679 * tests/futimesat.c (main): Do not use gettimeofday(), use fixed 2680 timestamps instead. 2681 * tests/utimensat.c (main): Likewise. 2682 * tests/utimes.c (main): Likewise. 2683 2684 2017-04-15 Dmitry V. Levin <ldv (a] altlinux.org> 2685 2686 xtensa: wire up new syscalls. 2687 * linux/xtensa/syscallent.h [348..350]: New pkey_* entries. 2688 2689 Reported-by: Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 2690 2691 2017-04-15 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 2692 2693 Update statx parser and syscall entries lists to the upstream. 2694 * linux/32/syscallent.h [291]: Add statx entry. 2695 * linux/64/syscallent.h [291]: Likewise. 2696 * linux/arm/syscallent.h [397]: Likewise. 2697 * linux/m68k/syscallent.h [379]: Likewise. 2698 * linux/mips/syscallent-n32.h [6330]: Likewise. 2699 * linux/mips/syscallent-n64.h [5326]: Likewise. 2700 * linux/mips/syscallent-o32.h [4366]: Likewise. 2701 * linux/powerpc/syscallent.h [383]: Likewise. 2702 * linux/s390/syscallent.h [379]: Likewise. 2703 * linux/s390x/syscallent.h [379]: Likewise. 2704 * linux/xtensa/syscallent.h [351]: Likewise. 2705 * statx.h (struct_statx): Update. 2706 * statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask. 2707 * tests/xstatx.c (print_stat, main): Update to test decoding 2708 of struct_statx.stx_attributes_mask. 2709 2710 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2711 2712 tests: add more regex match checks. 2713 * tests/qual_syscall.test: Add regex match checks. 2714 2715 tests: make mq_sendrecv* test executables reenterable. 2716 * tests/mq_sendrecv.c (MQ_NAME): Remove. 2717 (mq_name): New static variable. 2718 (cleanup): Use it instead of MQ_NAME. 2719 (main): Initialize it dynamically using the pid of process. Use it 2720 instead of MQ_NAME. 2721 2722 tests: make mq test executable reenterable. 2723 * tests/mq.c (NAME): Remove. 2724 (main): Replace the fixed message queue name with a dynamically 2725 made name containing the pid of process. 2726 * tests/gen_tests.in (mq): Update -a option. 2727 2728 tests: make net-yy-netlink test executable reenterable. 2729 * tests/net-yy-netlink.c (main): Use getpid() instead of a fixed 2730 magic number. 2731 2732 tests: tabulate shmxt.test. 2733 * tests/gen_tests.in (shmxt): New entry. 2734 * tests/shmxt.test: Remove. 2735 * tests/Makefile.am (DECODER_TESTS): Remove shmxt.test. 2736 2737 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2738 2739 Revert "Implement -e trace=%sched option" 2740 -e trace=%sched became redundant as -e trace=/sched does the same. 2741 2742 This reverts commit 811638e9c1805438a63c14f9704b8b00ac922623. 2743 2744 * syscall.c (TSC): Remove. 2745 * sysent.h (TRACE_SCHED): Remove. 2746 * qualify.c (lookup_class): Remove %sched. 2747 * strace.1 (.SS Filtering): Likewise. 2748 * NEWS: Likewise. 2749 * linux/32/syscallent.h: Remove TSC flag from sched* syscalls. 2750 * linux/64/syscallent.h: Likewise. 2751 * linux/alpha/syscallent.h: Likewise. 2752 * linux/arm/syscallent.h: Likewise. 2753 * linux/avr32/syscallent.h: Likewise. 2754 * linux/bfin/syscallent.h: Likewise. 2755 * linux/crisv10/syscallent.h: Likewise. 2756 * linux/hppa/syscallent.h: Likewise. 2757 * linux/i386/syscallent.h: Likewise. 2758 * linux/ia64/syscallent.h: Likewise. 2759 * linux/m68k/syscallent.h: Likewise. 2760 * linux/microblaze/syscallent.h: Likewise. 2761 * linux/mips/syscallent-n32.h: Likewise. 2762 * linux/mips/syscallent-n64.h: Likewise. 2763 * linux/mips/syscallent-o32.h: Likewise. 2764 * linux/powerpc/syscallent.h: Likewise. 2765 * linux/powerpc64/syscallent.h: Likewise. 2766 * linux/s390/syscallent.h: Likewise. 2767 * linux/s390x/syscallent.h: Likewise. 2768 * linux/sh/syscallent.h: Likewise. 2769 * linux/sh64/syscallent.h: Likewise. 2770 * linux/sparc/syscallent.h: Likewise. 2771 * linux/sparc64/syscallent.h: Likewise. 2772 * linux/x32/syscallent.h: Likewise. 2773 * linux/x86_64/syscallent.h: Likewise. 2774 * linux/xtensa/syscallent.h: Likewise. 2775 * tests/sched.test: Replace trace=%sched with trace=/sched. 2776 * tests/ksysent.c (TSC): Remove. 2777 * tests/nsyscalls.c: Likewise. 2778 2779 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2780 2781 Revert "Implement -e trace=%clock option" 2782 -e trace=%clock became redundant as -e trace=/clock does the same. 2783 2784 This reverts commit 0a13d2391c413e3847b71ec0c1d38f56e353b1b5. 2785 2786 * syscall.c (TCL): Remove. 2787 * sysent.h (TRACE_CLOCK): Remove. 2788 * qualify.c (lookup_class): Remove %clock. 2789 * strace.1 (.SS Filtering): Likewise. 2790 * NEWS: Likewise. 2791 * linux/32/syscallent.h: Remove TCL flag from clock_* syscalls. 2792 * linux/64/syscallent.h: Likewise. 2793 * linux/alpha/syscallent.h: Likewise. 2794 * linux/arm/syscallent.h: Likewise. 2795 * linux/avr32/syscallent.h: Likewise. 2796 * linux/bfin/syscallent.h: Likewise. 2797 * linux/crisv10/syscallent.h: Likewise. 2798 * linux/hppa/syscallent.h: Likewise. 2799 * linux/i386/syscallent.h: Likewise. 2800 * linux/ia64/syscallent.h: Likewise. 2801 * linux/m68k/syscallent.h: Likewise. 2802 * linux/microblaze/syscallent.h: Likewise. 2803 * linux/mips/syscallent-n32.h: Likewise. 2804 * linux/mips/syscallent-n64.h: Likewise. 2805 * linux/mips/syscallent-o32.h: Likewise. 2806 * linux/powerpc/syscallent.h: Likewise. 2807 * linux/powerpc64/syscallent.h: Likewise. 2808 * linux/s390/syscallent.h: Likewise. 2809 * linux/s390x/syscallent.h: Likewise. 2810 * linux/sh/syscallent.h: Likewise. 2811 * linux/sh64/syscallent.h: Likewise. 2812 * linux/sparc/syscallent.h: Likewise. 2813 * linux/sparc64/syscallent.h: Likewise. 2814 * linux/x32/syscallent.h: Likewise. 2815 * linux/x86_64/syscallent.h: Likewise. 2816 * linux/xtensa/syscallent.h: Likewise. 2817 * tests/clock.test: Replace trace=%clock with trace=/clock. 2818 * tests/ksysent.c (TCL): Remove. 2819 * tests/nsyscalls.c: Likewise. 2820 2821 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2822 2823 tests: robustify regex.test. 2824 * tests/regex.test: Use trace_statfs.test as a template instead 2825 of clock.test and sched.test, not because of more interesting 2826 regular expressions but to fix build on platforms where 2827 clock.test and sched.test are not reenterable. 2828 2829 2017-04-14 JingPiao Chen <chenjingpiao (a] gmail.com> 2830 2831 Implement -e trace=/regex option. 2832 * qualify.c: Include <regex.h>. 2833 (qualify_syscall_regex): New function. 2834 (qualify_syscall): Use it. 2835 * strace.1: Document -e trace=/regex option. 2836 * NEWS: Mention -e trace=/regex option. 2837 * tests/regex.test: New test. 2838 * tests/Makefile.am (DECODER_TESTS): Add it. 2839 * tests/options-syntax.test: Add checks for invaild regexp 2840 and for regexp that doesn't match a syscall. 2841 2842 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2843 2844 tests: fix ioctl_nsfs.test on hppa. 2845 * tests/ioctl_nsfs.c (test_user_namespace): Specify an address 2846 in the middle of a mapped page as child_stack address argument 2847 of the clone call. 2848 [IA64] (clone): Update. 2849 2850 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 2851 2852 tests: fix ioctl_nsfs.test on ia64. 2853 glibc on ia64 provides no clone() function, but there is a __clone2 2854 function instead. It is documented but no prototype is provided by 2855 glibc. 2856 2857 * tests/ioctl_nsfs.c [IA64] (__clone2): New prototype. 2858 [IA64] (clone): New macro wrapper around __clone2. 2859 2860 2017-04-13 Edgar Kaziahmedov <edos (a] linux.com> 2861 2862 tests: check decoding of the remaining V4L2_BUF_TYPE_* types. 2863 * tests/ioctl_v4l2.c (init_v4l2_format, print_ioctl_v4l2): New functions 2864 to avoid code duplication in VIDIOC_S_FMT and VIDIOC_TRY_FMT tests. 2865 (main) <VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT>: Use them. Add 2866 checks for remaining V4L2_BUF_TYPE_* types. 2867 2868 v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types. 2869 * v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h". 2870 (struct_v4l2_clip): New typedef. Mpersify it. 2871 (print_v4l2_clip): New function. 2872 (print_v4l2_format_fmt): Use it. Add struct tcb argument. Implement 2873 decoding of the remaining V4L2_BUF_TYPE_* types. 2874 * xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED 2875 introduced by linux kernel commit v2.5.46~39^2~23^2~4. 2876 Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START, 2877 V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by 2878 linux kernel commit v3.17-rc1~112^2~217. 2879 * xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS, 2880 V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and 2881 V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64. 2882 * configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and 2883 V4L2_BUF_TYPE_SDR_OUTPUT. 2884 (AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and 2885 struct v4l2_sdr_format.buffersize. 2886 * NEWS: Mention this change. 2887 2888 2017-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 2889 2890 travis: use mainline kernel uapi headers for coverage. 2891 * .travis.yml (matrix) <CHECK=coverage>: Add KHEADERS=torvalds/linux. 2892 * travis-build.sh: Handle $KHEADERS. 2893 * travis-install.sh: Likewise. 2894 2895 travis: switch from clang-3.6 to clang-3.8. 2896 * .travis.yml (matrix): Change clang-3.6 to clang-3.8. 2897 2898 2017-04-13 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 2899 2900 Implement decoding of NS_* ioctl commands. 2901 * configure.ac (AC_CHECK_HEADERS): Add linux/nsfs.h. 2902 * defs.h (DECL_IOCTL(nsfs)): New prototype. 2903 (setns_types): Make global. 2904 * ioctl.c (ioctl_decode): Call nsfs_ioctl for 0xb7 code. 2905 * nsfs.c: New file. 2906 * nsfs.h: Likewise. 2907 * Makefile.am (strace_SOURCES): Add them. 2908 * tests/ioctl_nsfs.c: New file. 2909 * tests/ioctl_nsfs.test: Likewise. 2910 * tests/.gitignore: Add ioctl_nsfs. 2911 * tests/Makefile.am (check_PROGRAMS): Likewise. 2912 (DECODER_TESTS): Add ioctl_nsfs.test. 2913 * NEWS: Mention this change. 2914 2915 2017-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 2916 2917 travis: copy coverage test suite log to the travis log. 2918 * travis-build.sh (coverage): Print tests*/test-suite.log 2919 and tests*/ksysent.log. 2920 2921 2017-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 2922 2923 travis: add gcc-6. 2924 * .travis.yml (matrix): Add gcc-6 entries. 2925 * travis-build.sh: Handle gcc*. 2926 * travis-install.sh: Handle gcc-*. 2927 2928 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2929 2930 tests: robustify gen_tests.sh against in-tree builds. 2931 * tests/gen_tests.sh: Use abs_srcdir instead of srcdir to construct 2932 a path to gen_tests.sh in implicit make rules. 2933 2934 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2935 2936 trace_syscall_exiting: do not call get_regs for filtered syscalls. 2937 This saves up to 25% of ptrace syscalls in case of trace filtering. 2938 2939 * syscall.c (trace_syscall_exiting): Do not call gettimeofday 2940 and get_regs for filtered syscalls. 2941 * NEWS: Mention this change. 2942 * tests/get_regs.test: New test. 2943 * tests/Makefile.am (MISC_TESTS): Add it. 2944 2945 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2946 2947 Delay get_regs invocation. 2948 strace used to call get_regs on every stop of a tracee, including cases 2949 when the result is going to be discarded. Prepare to change this lavish 2950 practice by delaying get_regs invocation until its result is actually 2951 needed. 2952 2953 * defs.h (get_regs): Remove. 2954 * strace.c (trace): Do not call get_regs. 2955 * syscall.c (get_regs): Add static qualifier. 2956 (trace_syscall_exiting, print_pc, get_scno): Call get_regs. 2957 2958 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2959 2960 startup_tcb: move get_scno invocation to a more convenient place. 2961 * strace.c (trace): Move get_scno invocation ... 2962 (startup_tcb): ... here. This is a no-op change that slightly improves 2963 readability. 2964 2965 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2966 2967 get_regs: guard against subsequent invocations. 2968 At this moment there is only one call to get_regs, 2969 but there is going to be more of them, so a guard is needed. 2970 2971 This change also adds a clear_regs call before get_regs, 2972 which essentially reverts commit v4.9-288-ge9bfff6. 2973 2974 * strace.c (trace): Call clear_regs before get_regs. 2975 * syscall.c (get_regs): Skip if get_regs_error != -1. 2976 2977 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2978 2979 syscall: move definitions of automatic variables closer to their use. 2980 * syscall.c (trace_syscall_entering, trace_syscall_exiting): Move 2981 definitions of automatic variables closer to their first use. This 2982 change slightly improves readability. 2983 2984 tests: check decoding of gettid syscall. 2985 * tests/gettid.c: New file. 2986 * tests/.gitignore: Add gettid. 2987 * tests/Makefile.am (check_PROGRAMS): Likewise. 2988 * tests/gen_tests.in (gettid): New entry. 2989 2990 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2991 2992 tests: fix build on alpha. 2993 * tests/getpid.c: Skip if __NR_getpid is not defined. 2994 * tests/getppid.c: Skip if __NR_getppid is not defined. 2995 2996 Fixes: fd1041f6 ("tests: add tests for getpid and getppid syscalls") 2997 2998 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 2999 3000 Fix build with old linux/netlink.h. 3001 * socketutils.c: Provide a fallback definition of NETLINK_SOCK_DIAG. 3002 3003 Fixes: 5c256356 ("Do not include xlat/netlink_protocols.h twice") 3004 3005 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 3006 3007 Do not include xlat/netlink_protocols.h twice. 3008 Make netlink_protocols a global xlat array defined in net.c file. 3009 3010 * defs.h (netlink_protocols): New prototype. 3011 * socketutils.c: Stop including "xlat/netlink_protocols.h". 3012 3013 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 3014 3015 Do not include xlat/clocknames.h twice. 3016 Make clocknames a global xlat array defined in time.c file. 3017 3018 * defs.h (clocknames): New prototype. 3019 * perf.c: Stop including "xlat/clocknames.h". 3020 3021 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 3022 3023 Remove unused xlat/openmodessol.in. 3024 * xlat/openmodessol.in: Remove file unused since commit 3025 v4.10-45-gdf4dd8b. 3026 3027 Remove unused xlat/aclipc.in. 3028 * xlat/aclipc.in: Remove file unused since commit v4.9-46-g681452b. 3029 3030 2017-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 3031 3032 tests: remove statfs.expected. 3033 statfs.expected is unused since commit v4.11-515-g67c2f67. 3034 3035 * tests/statfs.expected: Remove. 3036 * tests/Makefile.am (EXTRA_DIST): Remove it. 3037 3038 2017-04-07 Sandhya Bankar <bankarsandhya512 (a] gmail.com> 3039 3040 tests: add tests for getpid and getppid syscalls. 3041 3042 [ldv: rewritten everything] 3043 3044 * tests/getpid.c: New file. 3045 * tests/getppid.c: Likewise. 3046 * tests/.gitignore: Add getpid and getppid. 3047 * tests/pure_executables.list: Likewise. 3048 * tests/Makefile.am (check_PROGRAMS): Likewise. 3049 * tests/gen_tests.in (getpid, getppid): New entries. 3050 3051 2017-04-07 Edgar Kaziahmedov <edos (a] linux.com> 3052 3053 Update V4L2_* constants. 3054 * xlat/v4l2_buf_flags.in: Add V4L2_BUF_FLAG_PREPARED, 3055 V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, and V4L2_BUF_FLAG_NO_CACHE_CLEAN 3056 introduced by linux kernel commit v3.2-rc1~63^2~55. 3057 Add V4L2_BUF_FLAG_TIMESTAMP_MASK, V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, 3058 and V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC introduced by linux kernel commit 3059 v3.9-rc1~93^2~536. 3060 Add V4L2_BUF_FLAG_TIMESTAMP_COPY introduced by linux kernel commit 3061 v3.10-rc1~136^2~560. 3062 Add V4L2_BUF_FLAG_TSTAMP_SRC_MASK, V4L2_BUF_FLAG_TSTAMP_SRC_EOF, 3063 and V4L2_BUF_FLAG_TSTAMP_SRC_SOE introduced by linux kernel commit 3064 v3.15-rc1~85^2~186. 3065 Add V4L2_BUF_FLAG_LAST introduced by linux kernel commit 3066 v4.2-rc1~107^2~389. 3067 * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_SDR_CAPTURE 3068 and V4L2_BUF_TYPE_SDR_OUTPUT introduced by linux kernel commits 3069 v3.15-rc1~85^2~213 and v4.4-rc1~118^2~14, respectively. 3070 * xlat/xlat/v4l2_colorspaces.in: Add V4L2_COLORSPACE_ADOBERGB 3071 and V4L2_COLORSPACE_BT2020 introduced by linux kernel commit 3072 v3.19-rc1~29^2~72. 3073 Add V4L2_COLORSPACE_RAW and V4L2_COLORSPACE_DCI_P3 introduced by linux 3074 kernel commits v4.2-rc1~107^2~182 and v4.4-rc1~118^2~120, respectively. 3075 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_SDR_CAPTURE, 3076 V4L2_CAP_EXT_PIX_FORMAT, and V4L2_CAP_SDR_OUTPUT introduced by linux 3077 kernel commits v3.15-rc1~85^2~210, v3.17-rc1~112^2~327, 3078 and v4.4-rc1~118^2~14, respectively. 3079 * xlat/v4l2_memories.in: Add V4L2_MEMORY_OVERLAY introduced 3080 in linux 2.5.46. Add V4L2_MEMORY_DMABUF introduced by linux kernel 3081 commit v3.8-rc1~115^2^2~52. 3082 3083 2017-04-07 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 3084 3085 Implement -e trace=%statfs option. 3086 linux/*/syscallent*.h part is modified automatically by: 3087 3088 sed -i 's/TF\(,[[:space:]]*SEN.*[_"]statv\?fs\)/TF|TSF\1/' \ 3089 linux/*/syscallent*.h 3090 3091 [ldv: rewritten trace_statfs.test using sched.test as a template] 3092 3093 * sysent.h (TRACE_STATFS): New macro. 3094 * syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion. 3095 * qualify.c (lookup_class): Add SCHED_STATFS for "%statfs". 3096 * strace.1 (.SS Filtering): Add information about %statfs syscall class. 3097 * NEWS: Mention this change. 3098 * linux/64/syscallent.h (statfs): Add TSF flag. 3099 * linux/aarch64/syscallent.h: Likewise. 3100 * linux/x32/syscallent.h: Likewise. 3101 * linux/x86_64/syscallent.h: Likewise. 3102 * linux/mips/syscallent-n64.h: Likewise. 3103 * linux/32/syscallent.h (statfs64): Likewise. 3104 * linux/arm/syscallent.h (statfs, statfs64): Likewise. 3105 * linux/avr32/syscallent.h: Likewise. 3106 * linux/bfin/syscallent.h: Likewise. 3107 * linux/crisv10/syscallent.h: Likewise. 3108 * linux/hppa/syscallent.h: Likewise. 3109 * linux/i386/syscallent.h: Likewise. 3110 * linux/ia64/syscallent.h: Likewise. 3111 * linux/m68k/syscallent.h: Likewise. 3112 * linux/microblaze/syscallent.h: Likewise. 3113 * linux/mips/syscallent-n32.h: Likewise. 3114 * linux/mips/syscallent-o32.h: Likewise. 3115 * linux/powerpc/syscallent.h: Likewise. 3116 * linux/powerpc64/syscallent.h: Likewise. 3117 * linux/s390/syscallent.h: Likewise. 3118 * linux/s390x/syscallent.h: Likewise. 3119 * linux/sh/syscallent.h: Likewise. 3120 * linux/sh64/syscallent.h: Likewise. 3121 * linux/sparc/syscallent.h: Likewise. 3122 * linux/sparc64/syscallent.h: Likewise. 3123 * linux/xtensa/syscallent.h: Likewise. 3124 * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs): Likewise. 3125 * linux/mips/syscallent-compat.h (*_statfs, *_statvfs): Likewise. 3126 * tests/trace_statfs.test: New test. 3127 * tests/Makefile.am (DECODER_TESTS): Add it. 3128 * tests/ksysent.c (TSF): New macro, defined to 0. 3129 * tests/nsyscalls.c: Likewise. 3130 3131 2017-04-06 Rishi Bhatt <bhatt.rishi062 (a] gmail.com> 3132 3133 Implement -e trace=%clock option. 3134 linux/*/syscallent.h part is modified automatically by 3135 sed -i 's/0\(,[[:space:]]*SEN(clock_\)/TCL\1/' linux/*/syscallent*.h 3136 3137 [ldv: rewritten clock.test using sched.test as a template] 3138 3139 * sysent.h (TRACE_CLOCK): New macro. 3140 * syscall.c: Alias TCL to TRACE_CLOCK around syscallent.h inclusion. 3141 * qualify.c (lookup_class): Add TRACE_CLOCK for "%clock". 3142 * strace.1 (.SS Filtering): Add information about %clock syscall class. 3143 * NEWS: Mention this change. 3144 * linux/32/syscallent.h: Add TCL flag for clock_* syscalls. 3145 * linux/64/syscallent.h: Likewise. 3146 * linux/alpha/syscallent.h: Likewise. 3147 * linux/arm/syscallent.h: Likewise. 3148 * linux/avr32/syscallent.h: Likewise. 3149 * linux/bfin/syscallent.h: Likewise. 3150 * linux/crisv10/syscallent.h: Likewise. 3151 * linux/hppa/syscallent.h: Likewise. 3152 * linux/i386/syscallent.h: Likewise. 3153 * linux/ia64/syscallent.h: Likewise. 3154 * linux/m68k/syscallent.h: Likewise. 3155 * linux/microblaze/syscallent.h: Likewise. 3156 * linux/mips/syscallent-n32.h: Likewise. 3157 * linux/mips/syscallent-n64.h: Likewise. 3158 * linux/mips/syscallent-o32.h: Likewise. 3159 * linux/powerpc/syscallent.h: Likewise. 3160 * linux/powerpc64/syscallent.h: Likewise. 3161 * linux/s390/syscallent.h: Likewise. 3162 * linux/s390x/syscallent.h: Likewise. 3163 * linux/sh/syscallent.h: Likewise. 3164 * linux/sh64/syscallent.h: Likewise. 3165 * linux/sparc/syscallent.h: Likewise. 3166 * linux/sparc64/syscallent.h: Likewise. 3167 * linux/x32/syscallent.h: Likewise. 3168 * linux/x86_64/syscallent.h: Likewise. 3169 * linux/xtensa/syscallent.h: Likewise. 3170 * tests/clock.test: New test. 3171 * tests/Makefile.am (DECODER_TESTS): Add it. 3172 * tests/ksysent.c (TCL): New macro, defined to 0. 3173 * tests/nsyscalls.c: Likewise. 3174 3175 2017-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 3176 3177 tests: tabulate xattr.test. 3178 * tests/gen_tests.in (xattr): New entry. 3179 * tests/xattr.test: Remove. 3180 * tests/Makefile.am (DECODER_TESTS): Remove xattr.test. 3181 3182 2017-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 3183 3184 tests: generalize scripts that check non-abbreviated decoding of ioctls. 3185 * tests/ioctl-v.sh: New file. 3186 * tests/Makefile.am (EXTRA_DIST): Add it. 3187 (DECODER_TESTS): Remove ioctl_evdev-v.test, ioctl_loop-v.test, 3188 and ioctl_rtc-v.test. 3189 * tests/gen_tests.in (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): 3190 New entries. 3191 * tests/ioctl_evdev-v.test: Remove. 3192 * tests/ioctl_loop-v.test: Ditto. 3193 * tests/ioctl_rtc-v.test: Ditto. 3194 3195 2017-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 3196 3197 tests: tabulate stereotypical test scripts. 3198 Convert test scripts that follow simple testing patterns to a table. 3199 Generate all these scripts from gen_tests.in file using gen_tests.sh 3200 script at bootstrap time. 3201 3202 The largest set of test scripts has been converted using 3203 the following command: 3204 3205 grep -l ^run_strace_match_diff *.test |while read f; do 3206 n="${f%.test}" 3207 grep '^[^#]' "$f" | 3208 grep -Evq '^(\. "\${srcdir=\.}/init\.sh"|run_strace_match_diff)' || 3209 sed -n 's/^run_strace_match_diff\(.*\)/'$n'\1/p' "$f" 3210 done 3211 3212 The second largest set of test scripts has been converted using 3213 the following command: 3214 3215 grep -l srcdir= *.test |while read f; do 3216 n="${f%.test}" 3217 grep '^[^#]' "$f" | 3218 grep -Fvq srcdir= || 3219 sed -n 's/^. "\${srcdir=.}\/\([^"]\+\)".*/'$n'\t+\1/p' "$f" 3220 done 3221 3222 * tests/gen_tests.in: New file. 3223 * tests/gen_tests.sh: New file. 3224 * bootstrap: Invoke it. 3225 * tests/.gitignore: Add *.gen.test and gen_tests.am. 3226 * tests/_newselect.test: Remove. 3227 * tests/accept.test: Ditto. 3228 * tests/accept4.test: Ditto. 3229 * tests/access.test: Ditto. 3230 * tests/acct.test: Ditto. 3231 * tests/add_key.test: Ditto. 3232 * tests/adjtimex.test: Ditto. 3233 * tests/aio.test: Ditto. 3234 * tests/alarm.test: Ditto. 3235 * tests/bpf.test: Ditto. 3236 * tests/btrfs.test: Ditto. 3237 * tests/chmod.test: Ditto. 3238 * tests/chown.test: Ditto. 3239 * tests/chown32.test: Ditto. 3240 * tests/chroot.test: Ditto. 3241 * tests/clock_adjtime.test: Ditto. 3242 * tests/clock_nanosleep.test: Ditto. 3243 * tests/clock_xettime.test: Ditto. 3244 * tests/copy_file_range.test: Ditto. 3245 * tests/creat.test: Ditto. 3246 * tests/delete_module.test: Ditto. 3247 * tests/dup.test: Ditto. 3248 * tests/dup2.test: Ditto. 3249 * tests/dup3.test: Ditto. 3250 * tests/epoll_create.test: Ditto. 3251 * tests/epoll_create1.test: Ditto. 3252 * tests/epoll_ctl.test: Ditto. 3253 * tests/epoll_pwait.test: Ditto. 3254 * tests/epoll_wait.test: Ditto. 3255 * tests/erestartsys.test: Ditto. 3256 * tests/execveat-v.test: Ditto. 3257 * tests/execveat.test: Ditto. 3258 * tests/faccessat.test: Ditto. 3259 * tests/fadvise64_64.test: Ditto. 3260 * tests/fallocate.test: Ditto. 3261 * tests/fanotify_init.test: Ditto. 3262 * tests/fanotify_mark.test: Ditto. 3263 * tests/fchdir.test: Ditto. 3264 * tests/fchmod.test: Ditto. 3265 * tests/fchmodat.test: Ditto. 3266 * tests/fchown.test: Ditto. 3267 * tests/fchown32.test: Ditto. 3268 * tests/fchownat.test: Ditto. 3269 * tests/fcntl.test: Ditto. 3270 * tests/fcntl64.test: Ditto. 3271 * tests/fdatasync.test: Ditto. 3272 * tests/file_handle.test: Ditto. 3273 * tests/file_ioctl.test: Ditto. 3274 * tests/finit_module.test: Ditto. 3275 * tests/flock.test: Ditto. 3276 * tests/fork-f.test: Ditto. 3277 * tests/fstat64.test: Ditto. 3278 * tests/fstatat64.test: Ditto. 3279 * tests/fstatfs.test: Ditto. 3280 * tests/fstatfs64.test: Ditto. 3281 * tests/fsync.test: Ditto. 3282 * tests/ftruncate.test: Ditto. 3283 * tests/ftruncate64.test: Ditto. 3284 * tests/futimesat.test: Ditto. 3285 * tests/get_mempolicy.test: Ditto. 3286 * tests/getcpu.test: Ditto. 3287 * tests/getcwd.test: Ditto. 3288 * tests/getdents.test: Ditto. 3289 * tests/getdents64.test: Ditto. 3290 * tests/getegid.test: Ditto. 3291 * tests/getegid32.test: Ditto. 3292 * tests/geteuid.test: Ditto. 3293 * tests/geteuid32.test: Ditto. 3294 * tests/getgid.test: Ditto. 3295 * tests/getgid32.test: Ditto. 3296 * tests/getgroups.test: Ditto. 3297 * tests/getgroups32.test: Ditto. 3298 * tests/getpeername.test: Ditto. 3299 * tests/getpgrp.test: Ditto. 3300 * tests/getrandom.test: Ditto. 3301 * tests/getresgid.test: Ditto. 3302 * tests/getresgid32.test: Ditto. 3303 * tests/getresuid.test: Ditto. 3304 * tests/getresuid32.test: Ditto. 3305 * tests/getrlimit.test: Ditto. 3306 * tests/getrusage.test: Ditto. 3307 * tests/getsid.test: Ditto. 3308 * tests/getsockname.test: Ditto. 3309 * tests/getuid32.test: Ditto. 3310 * tests/getxxid.test: Ditto. 3311 * tests/inet-cmsg.test: Ditto. 3312 * tests/init_module.test: Ditto. 3313 * tests/inotify.test: Ditto. 3314 * tests/inotify_init1.test: Ditto. 3315 * tests/int_0x80.test: Ditto. 3316 * tests/ioctl_block.test: Ditto. 3317 * tests/ioctl_evdev.test: Ditto. 3318 * tests/ioctl_loop.test: Ditto. 3319 * tests/ioctl_mtd.test: Ditto. 3320 * tests/ioctl_rtc.test: Ditto. 3321 * tests/ioctl_scsi.test: Ditto. 3322 * tests/ioctl_sg_io_v3.test: Ditto. 3323 * tests/ioctl_sg_io_v4.test: Ditto. 3324 * tests/ioctl_uffdio.test: Ditto. 3325 * tests/ioctl_v4l2.test: Ditto. 3326 * tests/ioperm.test: Ditto. 3327 * tests/iopl.test: Ditto. 3328 * tests/ioprio.test: Ditto. 3329 * tests/ip_mreq.test: Ditto. 3330 * tests/ipc.test: Ditto. 3331 * tests/ipc_msg.test: Ditto. 3332 * tests/ipc_sem.test: Ditto. 3333 * tests/ipc_shm.test: Ditto. 3334 * tests/kcmp.test: Ditto. 3335 * tests/kexec_file_load.test: Ditto. 3336 * tests/kexec_load.test: Ditto. 3337 * tests/keyctl.test: Ditto. 3338 * tests/kill.test: Ditto. 3339 * tests/lchown.test: Ditto. 3340 * tests/lchown32.test: Ditto. 3341 * tests/link.test: Ditto. 3342 * tests/linkat.test: Ditto. 3343 * tests/lookup_dcookie.test: Ditto. 3344 * tests/lstat.test: Ditto. 3345 * tests/lstat64.test: Ditto. 3346 * tests/mbind.test: Ditto. 3347 * tests/membarrier.test: Ditto. 3348 * tests/memfd_create.test: Ditto. 3349 * tests/migrate_pages.test: Ditto. 3350 * tests/mincore.test: Ditto. 3351 * tests/mkdir.test: Ditto. 3352 * tests/mkdirat.test: Ditto. 3353 * tests/mknod.test: Ditto. 3354 * tests/mknodat.test: Ditto. 3355 * tests/mlock.test: Ditto. 3356 * tests/mlock2.test: Ditto. 3357 * tests/mlockall.test: Ditto. 3358 * tests/mmap64.test: Ditto. 3359 * tests/mmsg-silent.test: Ditto. 3360 * tests/mmsg.test: Ditto. 3361 * tests/mmsg_name-v.test: Ditto. 3362 * tests/mmsg_name.test: Ditto. 3363 * tests/mount.test: Ditto. 3364 * tests/move_pages.test: Ditto. 3365 * tests/mq.test: Ditto. 3366 * tests/mq_sendrecv-read.test: Ditto. 3367 * tests/mq_sendrecv-write.test: Ditto. 3368 * tests/mq_sendrecv.test: Ditto. 3369 * tests/msg_control-v.test: Ditto. 3370 * tests/msg_control.test: Ditto. 3371 * tests/msg_name.test: Ditto. 3372 * tests/munlockall.test: Ditto. 3373 * tests/nanosleep.test: Ditto. 3374 * tests/net-icmp_filter.test: Ditto. 3375 * tests/net-sockaddr.test: Ditto. 3376 * tests/newfstatat.test: Ditto. 3377 * tests/old_mmap.test: Ditto. 3378 * tests/oldfstat.test: Ditto. 3379 * tests/oldlstat.test: Ditto. 3380 * tests/oldstat.test: Ditto. 3381 * tests/open.test: Ditto. 3382 * tests/openat.test: Ditto. 3383 * tests/pause.test: Ditto. 3384 * tests/perf_event_open.test: Ditto. 3385 * tests/perf_event_open_nonverbose.test: Ditto. 3386 * tests/perf_event_open_unabbrev.test: Ditto. 3387 * tests/pipe2.test: Ditto. 3388 * tests/pkey_alloc.test: Ditto. 3389 * tests/pkey_free.test: Ditto. 3390 * tests/pkey_mprotect.test: Ditto. 3391 * tests/ppoll-v.test: Ditto. 3392 * tests/ppoll.test: Ditto. 3393 * tests/preadv-pwritev.test: Ditto. 3394 * tests/preadv.test: Ditto. 3395 * tests/preadv2-pwritev2.test: Ditto. 3396 * tests/printstr.test: Ditto. 3397 * tests/prlimit64.test: Ditto. 3398 * tests/process_vm_readv.test: Ditto. 3399 * tests/process_vm_writev.test: Ditto. 3400 * tests/pselect6.test: Ditto. 3401 * tests/ptrace.test: Ditto. 3402 * tests/pwritev.test: Ditto. 3403 * tests/quotactl-v.test: Ditto. 3404 * tests/quotactl-xfs-v.test: Ditto. 3405 * tests/quotactl-xfs.test: Ditto. 3406 * tests/quotactl.test: Ditto. 3407 * tests/readahead.test: Ditto. 3408 * tests/readdir.test: Ditto. 3409 * tests/readlink.test: Ditto. 3410 * tests/readlinkat.test: Ditto. 3411 * tests/reboot.test: Ditto. 3412 * tests/recvfrom.test: Ditto. 3413 * tests/recvmmsg-timeout.test: Ditto. 3414 * tests/recvmsg.test: Ditto. 3415 * tests/remap_file_pages.test: Ditto. 3416 * tests/rename.test: Ditto. 3417 * tests/renameat.test: Ditto. 3418 * tests/renameat2.test: Ditto. 3419 * tests/request_key.test: Ditto. 3420 * tests/rmdir.test: Ditto. 3421 * tests/rt_sigpending.test: Ditto. 3422 * tests/rt_sigprocmask.test: Ditto. 3423 * tests/rt_sigqueueinfo.test: Ditto. 3424 * tests/rt_sigreturn.test: Ditto. 3425 * tests/rt_sigsuspend.test: Ditto. 3426 * tests/rt_sigtimedwait.test: Ditto. 3427 * tests/rt_tgsigqueueinfo.test: Ditto. 3428 * tests/sched_get_priority_mxx.test: Ditto. 3429 * tests/sched_rr_get_interval.test: Ditto. 3430 * tests/sched_xetaffinity.test: Ditto. 3431 * tests/sched_xetattr.test: Ditto. 3432 * tests/sched_xetparam.test: Ditto. 3433 * tests/sched_xetscheduler.test: Ditto. 3434 * tests/sched_yield.test: Ditto. 3435 * tests/seccomp-filter-v.test: Ditto. 3436 * tests/seccomp-filter.test: Ditto. 3437 * tests/select.test: Ditto. 3438 * tests/semop.test: Ditto. 3439 * tests/sendfile.test: Ditto. 3440 * tests/sendfile64.test: Ditto. 3441 * tests/set_mempolicy.test: Ditto. 3442 * tests/setdomainname.test: Ditto. 3443 * tests/setfsgid.test: Ditto. 3444 * tests/setfsgid32.test: Ditto. 3445 * tests/setfsuid.test: Ditto. 3446 * tests/setfsuid32.test: Ditto. 3447 * tests/setgid.test: Ditto. 3448 * tests/setgid32.test: Ditto. 3449 * tests/setgroups.test: Ditto. 3450 * tests/setgroups32.test: Ditto. 3451 * tests/sethostname.test: Ditto. 3452 * tests/setns.test: Ditto. 3453 * tests/setregid.test: Ditto. 3454 * tests/setregid32.test: Ditto. 3455 * tests/setresgid.test: Ditto. 3456 * tests/setresgid32.test: Ditto. 3457 * tests/setresuid.test: Ditto. 3458 * tests/setresuid32.test: Ditto. 3459 * tests/setreuid.test: Ditto. 3460 * tests/setreuid32.test: Ditto. 3461 * tests/setrlimit.test: Ditto. 3462 * tests/setuid.test: Ditto. 3463 * tests/setuid32.test: Ditto. 3464 * tests/shutdown.test: Ditto. 3465 * tests/siginfo.test: Ditto. 3466 * tests/signal_receive.test: Ditto. 3467 * tests/signalfd4.test: Ditto. 3468 * tests/sigreturn.test: Ditto. 3469 * tests/socketcall.test: Ditto. 3470 * tests/splice.test: Ditto. 3471 * tests/stat.test: Ditto. 3472 * tests/stat64.test: Ditto. 3473 * tests/statfs64.test: Ditto. 3474 * tests/statx.sh: Ditto. 3475 * tests/statx.test: Ditto. 3476 * tests/swap.test: Ditto. 3477 * tests/symlink.test: Ditto. 3478 * tests/symlinkat.test: Ditto. 3479 * tests/sync.test: Ditto. 3480 * tests/sync_file_range.test: Ditto. 3481 * tests/sync_file_range2.test: Ditto. 3482 * tests/sysinfo.test: Ditto. 3483 * tests/syslog.test: Ditto. 3484 * tests/tee.test: Ditto. 3485 * tests/time.test: Ditto. 3486 * tests/timer_create.test: Ditto. 3487 * tests/timer_xettime.test: Ditto. 3488 * tests/timerfd_xettime.test: Ditto. 3489 * tests/times-fail.test: Ditto. 3490 * tests/times.test: Ditto. 3491 * tests/truncate.test: Ditto. 3492 * tests/truncate64.test: Ditto. 3493 * tests/ugetrlimit.test: Ditto. 3494 * tests/umask.test: Ditto. 3495 * tests/umoven-illptr.test: Ditto. 3496 * tests/umovestr-illptr.test: Ditto. 3497 * tests/umovestr3.test: Ditto. 3498 * tests/unlink.test: Ditto. 3499 * tests/unlinkat.test: Ditto. 3500 * tests/unshare.test: Ditto. 3501 * tests/userfaultfd.test: Ditto. 3502 * tests/ustat.test: Ditto. 3503 * tests/utime.test: Ditto. 3504 * tests/utimes.test: Ditto. 3505 * tests/vfork-f.test: Ditto. 3506 * tests/vhangup.test: Ditto. 3507 * tests/vmsplice.test: Ditto. 3508 * tests/wait4-v.test: Ditto. 3509 * tests/wait4.test: Ditto. 3510 * tests/waitid-v.test: Ditto. 3511 * tests/waitid.test: Ditto. 3512 * tests/waitpid.test: Ditto. 3513 * tests/xattr-strings.test: Ditto. 3514 * tests/xet_robust_list.test: Ditto. 3515 * tests/xetitimer.test: Ditto. 3516 * tests/xetpgid.test: Ditto. 3517 * tests/xetpriority.test: Ditto. 3518 * tests/xettimeofday.test: Ditto. 3519 * tests/Makefile.am (DECODER_TESTS, MISC_TESTS): Remove them. 3520 Include gen_tests.am. 3521 (TESTS): Add $(GEN_TESTS). 3522 (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Rename int_0x80.test 3523 to int_0x80.gen.test. 3524 (EXTRA_DIST): Add gen_tests.in and gen_tests.sh, remove statx.sh. 3525 (clean-local-check): Remove $(GEN_TESTS:.gen.test=.dir). 3526 3527 2017-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 3528 3529 tests: handle test scripts with .gen.test suffix. 3530 * tests/init.sh: If script name ends with .gen.test, 3531 set NAME variable with .gen.test suffix stripped. 3532 3533 2017-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3534 3535 mpers.awk: add support for multidimensional arrays. 3536 * mpers.awk (update_upper_bound): New function, which maintains new "count" 3537 property for storing total element count and updates "upper_bound" 3538 property which now contains string with array dimensions. 3539 (/^DW_AT_upper_bound/, /^DW_AT_count/): Use it. 3540 (what_is) <case "array_type">: Use "count" property in order to calculate 3541 returned_size, do not embody returned string in square brackets. 3542 * mpers_test.sh: Add checks for multidimensional arrays. 3543 3544 2017-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 3545 3546 mpers.awk: prepare for adding support of multidimensional arrays. 3547 * mpers.awk (what_is) <case "structure_type", case "union_type">: 3548 Move formatting of array upper_bound ... 3549 <case "array_type">: ... here. 3550 3551 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3552 3553 tests: cleanup temporary files removals. 3554 As every test now runs in its own subdirectory, there is no need 3555 to remove leftover files manually by each test. 3556 3557 * tests/init.sh (run_strace_match_diff): Do not remove $EXP. 3558 * tests/brk.test: Likewise. 3559 * tests/options-syntax.test: Likewise. 3560 * tests/qual_inject-retval.test (check_injection): Likewise. 3561 * tests/qual_signal.test (test_one_sig): Likewise. 3562 * tests/sched.test: Likewise. 3563 * tests/seccomp-strict.test: Likewise. 3564 * tests/strace-V.test: Likewise. 3565 * tests/strace-tt.test: Likewise. 3566 * tests/strace-ttt.test: Likewise. 3567 * tests/threads-execve.test: Likewise. 3568 * tests/attach-f-p.test: Use $EXP instead of $OUT, do not remove it. 3569 * tests/personality.test: Likewise. 3570 * tests/poll.test: Likewise. 3571 * tests/fstat.test: Likewise. 3572 * tests/ipc.sh: Likewise. 3573 * tests/restart_syscall.test: Likewise. 3574 * tests/utimensat.test: Likewise. 3575 * tests/attach-p-cmd.test: Likewise. Do not remove 3576 attach-p-cmd.test-lock. 3577 * tests/detach-running.test: Do not remove $LOG. 3578 * tests/detach-sleeping.test: Likewise. 3579 * tests/detach-stopped.test: Likewise. 3580 * tests/redirect.test: Do not remove $OUT. 3581 * tests/strace-S.test: Likewise. 3582 * tests/getdents.test: Do not remove $LOG.dir. 3583 * tests/getdents64.test: Likewise. 3584 * tests/readdir.test: Likewise. 3585 * tests/btrfs-v.test: Do not remove $EXP and $OUT. 3586 * tests/btrfs-vw.test: Likewise. 3587 * tests/btrfs-w.test: Likewise. 3588 * tests/execve-v.test: Likewise. 3589 * tests/execve.test: Likewise. 3590 * tests/fadvise64.test: Likewise. 3591 * tests/getuid.test: Likewise. 3592 * tests/ioctl.test: Likewise. 3593 * tests/ioctl_dm-v.test: Likewise. 3594 * tests/ioctl_dm.test: Likewise. 3595 * tests/ioctl_evdev-v.test: Likewise. 3596 * tests/ioctl_loop-nv.test: Likewise. 3597 * tests/ioctl_loop-v.test: Likewise. 3598 * tests/ioctl_loop.test: Likewise. 3599 * tests/ioctl_rtc-v.test: Likewise. 3600 * tests/ioctl_sock_gifconf.test: Likewise. 3601 * tests/llseek.test: Likewise. 3602 * tests/lseek.test: Likewise. 3603 * tests/mmap.test: Likewise. 3604 * tests/net-y-unix.test: Likewise. 3605 * tests/net-yy-inet.test: Likewise. 3606 * tests/net-yy-netlink.test: Likewise. 3607 * tests/net-yy-unix.test: Likewise. 3608 * tests/opipe.test: Likewise. 3609 * tests/prctl-arg2-intptr.test: Likewise. 3610 * tests/prctl-dumpable.test: Likewise. 3611 * tests/prctl-name.test: Likewise. 3612 * tests/prctl-no-args.test: Likewise. 3613 * tests/prctl-pdeathsig.test: Likewise. 3614 * tests/prctl-seccomp-filter-v.test: Likewise. 3615 * tests/prctl-seccomp-strict.test: Likewise. 3616 * tests/prctl-securebits.test: Likewise. 3617 * tests/prctl-tid_address.test: Likewise. 3618 * tests/prctl-tsc.test: Likewise. 3619 * tests/umovestr2.test: Likewise. 3620 * tests/uname.test: Likewise. 3621 * tests/pread64-pwrite64.test: Do nore remove pread64-pwrite64-tmpfile. 3622 * tests/read-write.test: Do nore remove read-write-tmpfile. 3623 * tests/qual_fault.test (check_fault_injection): Do not remove $EXP, 3624 $outexp, and $outgot. 3625 * tests/redirect-fds.test (check_fd): Reorder removal of work files. 3626 * tests/pc.test: Use $EXP instead of $EXPECTED, do not remove it. 3627 * tests/strace-t.test: Likewise. 3628 * tests/scm_rights-fd.test: Likewise. Use dir instead of $LOG.dir, 3629 do not remove it. 3630 * tests/strace-ff.test: Do not remove $OUT and $LOG.* files. 3631 3632 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3633 3634 tests: enhance sched.test negative check. 3635 * tests/sched.test: Test that trace=%sched doesn't match 3636 anything besides sched_* syscalls by checking it against all test 3637 executables without side effects listed in pure_executables.list 3638 except sched_* and times. 3639 3640 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3641 3642 tests: add a list of executables without side effects. 3643 These are executables that could be used by several different tests 3644 simultaneously. 3645 3646 * tests/pure_executables.list: New file. 3647 * tests/Makefile.am (EXTRA_DIST): Add it. 3648 3649 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3650 3651 tests: use fixed socket address in net-yy-unix.test. 3652 This allows net-yy-unix invocation without arguments. 3653 3654 * tests/net-yy-unix.c (TEST_SOCKET): New macro. 3655 (void): Use it instead of av[1]. 3656 * tests/net-yy-unix.test: Do not specify arguments for the test 3657 executable. 3658 3659 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3660 3661 tests: use fixed socket address in net-y-unix.test. 3662 This allows net-y-unix invocation without arguments. 3663 3664 * tests/net-y-unix.c (TEST_SOCKET): New macro. 3665 (void): Use it instead of av[1]. 3666 * tests/net-y-unix.test: Do not specify arguments for the test 3667 executable. 3668 3669 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3670 3671 tests: run every test except ksysent.test in its own subdirectory. 3672 Many test executables create temporary files in the current work 3673 directory for the duration of their execution. 3674 This level of test isolation allows more test executables to be invoked 3675 several times simultaneously. 3676 3677 * tests/.gitignore: Add *.dir, remove *.log.*, *.tmp, *.tmp-*, 3678 and *.tmp.* patterns. 3679 * tests/Makefile.am (clean-local, clean-local-check): New rules. 3680 (.PHONY): Add clean-local-check. 3681 (CLEANFILES): Remove all but ksysent.h. 3682 * tests/init.sh: Strip test-specific prefix from LOG, OUT, and EXP 3683 variables. When invoked from a test, create a new test-specific 3684 directory, chdir into it, and add more ../ prefix to STRACE variable. 3685 (run_prog): Replace "./" with "../". 3686 * tests/attach-f-p.test: Replace "./" with "../". 3687 * tests/attach-p-cmd.test: Likewise. 3688 * tests/bexecve.test: Likewise. 3689 * tests/btrfs-v.test: Likewise. 3690 * tests/btrfs-vw.test: Likewise. 3691 * tests/btrfs-w.test: Likewise. 3692 * tests/count.test: Likewise. 3693 * tests/detach-running.test: Likewise. 3694 * tests/detach-sleeping.test: Likewise. 3695 * tests/detach-stopped.test: Likewise. 3696 * tests/mmap.test: Likewise. 3697 * tests/net-y-unix.test: Likewise. 3698 * tests/net-yy-inet.test: Likewise. 3699 * tests/net-yy-netlink.test: Likewise. 3700 * tests/net-yy-unix.test: Likewise. 3701 * tests/net.test: Likewise. 3702 * tests/opipe.test: Likewise. 3703 * tests/poll.test: Likewise. 3704 * tests/prctl-seccomp-strict.test: Likewise. 3705 * tests/qual_fault-exit_group.test: Likewise. 3706 * tests/qual_fault.test: Likewise. 3707 * tests/qual_inject-error-signal.test: Likewise. 3708 * tests/qual_inject-retval.test: Likewise. 3709 * tests/qual_inject-signal.test: Likewise. 3710 * tests/qual_signal.test: Likewise. 3711 * tests/qual_syscall.test: Likewise. 3712 * tests/readv.test: Likewise. 3713 * tests/redirect-fds.test: Likewise. 3714 * tests/sched.test: Likewise. 3715 * tests/scm_rights-fd.test: Likewise. 3716 * tests/seccomp-strict.test: Likewise. 3717 * tests/strace-C.test: Likewise. 3718 * tests/strace-E.expected: Likewise. 3719 * tests/strace-E.test: Likewise. 3720 * tests/strace-S.test: Likewise. 3721 * tests/strace-T.test: Likewise. 3722 * tests/strace-V.test: Likewise. 3723 * tests/strace-ff.test: Likewise. 3724 * tests/strace-k.test: Likewise. 3725 * tests/strace-r.expected: Likewise. 3726 * tests/strace-r.test: Likewise. 3727 * tests/strace-t.test: Likewise. 3728 * tests/strace-tt.test: Likewise. 3729 * tests/strace-ttt.test: Likewise. 3730 * tests/sun_path.test: Likewise. 3731 * tests/uname.test: Likewise. 3732 * tests/unix-pair-send-recv.test: Likewise. 3733 * tests/unix-pair-sendto-recvfrom.test: Likewise. 3734 3735 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 3736 3737 tests: make test executables invocable outside current work directory. 3738 Most of test executables were ready for the upcoming change, 3739 this change prepares all the rest. 3740 3741 * tests/getdents.c (main): Use fixed name for the sample directory. 3742 * tests/getdents64.c (main): Likewise. 3743 * tests/readdir.c (main): Likewise. 3744 * tests/mknod.c (sample): Change to a pointer. 3745 (main): Use av[0] as a sample. 3746 * tests/symlink.c (main): Use av[0] as a linkpath. 3747 * tests/umode_t.c (sample): Change to a pointer. 3748 (test_syscall): Fix expected output. 3749 (main): Use av[0] as a sample. 3750 3751 2017-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 3752 3753 tests: cleanup access.test. 3754 * tests/access.test: Use run_strace_match_diff. 3755 * tests/access.c (main): Update expected output. 3756 3757 2017-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 3758 3759 tests: cleanup oldfstat.test. 3760 * tests/oldfstat.test: Use fstat.test. 3761 3762 2017-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 3763 3764 aarch64: workaround gcc+kernel bug. 3765 Due to a subtle gcc bug that leads to miscompiled aarch64 kernels, 3766 the 3rd argument of sched_getattr syscall is not quite 32-bit 3767 on aarch64 as on other architectures. For more details see 3768 https://sourceforge.net/p/strace/mailman/message/35721703/ 3769 3770 * defs.h (print_abnormal_hi): New prototype. 3771 * util.c (print_abnormal_hi): New function. 3772 * sched.c (SYS_FUNC(sched_getattr)) [AARCH64]: Use it. 3773 * tests/sched_xetattr.c (main) [__arm64__ || __aarch64__]: Test it. 3774 3775 2017-03-29 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 3776 3777 alpha, mips: fix missing flags in stat related compatibility syscalls. 3778 Following commands do the fix: 3779 3780 Add TF flag, fixed by: 3781 git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ 3782 's/0\(,[[:space:]]*SEN(.*_l\?stat[^i]\)/TF\1/' 3783 3784 Add TD flag, fixed by: 3785 git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ 3786 's/0\(,[[:space:]]*SEN(.*_fstat\)/TD\1/' 3787 3788 * linux/alpha/syscallent.h: Add TF and TD flags to stat related 3789 compat syscall entries. 3790 * linux/mips/syscallent-compat.h: Likewise. 3791 3792 2017-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 3793 3794 alpha: fix the number of arguments in alpha specific syscalls. 3795 * linux/alpha/syscallent.h (getxgid, osf_stat, osf_lstat, osf_fstat, 3796 osf_sysinfo, sethae): Set nargs according to arch/alpha/kernel/osf_sys.c 3797 from linux v4.10. 3798 3799 alpha: update comments about not implemented syscalls. 3800 * linux/alpha/syscallent.h: Sync "not implemented" comments 3801 with arch/alpha/kernel/systbls.S from linux v4.10. 3802 3803 2017-03-23 Quentin Monnet <quentin.monnet (a] 6wind.com> 3804 3805 Update BPF_MAP_TYPE_* constants. 3806 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_ARRAY_OF_MAPS 3807 and BPF_MAP_TYPE_HASH_OF_MAPS constants. 3808 3809 2017-03-23 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 3810 3811 Update ioctl entries from linux v4.11-rc3. 3812 * linux/32/ioctls_inc_align16.h: Update from linux v4.11-rc3 using ioctls_gen.sh. 3813 * linux/32/ioctls_inc_align32.h: Likewise. 3814 * linux/32/ioctls_inc_align64.h: Likewise. 3815 * linux/64/ioctls_inc.h: Likewise. 3816 * linux/x32/ioctls_inc0.h: Likewise. 3817 * linux/arm/ioctls_arch0.h: Likewise. 3818 * linux/i386/ioctls_arch0.h: Likewise. 3819 * linux/powerpc/ioctls_arch0.h: Likewise. 3820 * linux/s390/ioctls_arch0.h: Likewise. 3821 * linux/s390x/ioctls_arch0.h: Likewise. 3822 * linux/x86_64/ioctls_arch0.h: Likewise. 3823 * NEWS: Mention this. 3824 3825 maint: update for linux 4.11. 3826 * maint/ioctls_sym.sh (ppc_list): Add KVM_PPC_GET_RMMU_INFO 3827 and KVM_PPC_CONFIGURE_V3_MMU. 3828 3829 2017-03-19 Dmitry V. Levin <ldv (a] altlinux.org> 3830 3831 test: rename README to README.md. 3832 * test/README: Rename to README.md, turn ../tests reference into an URL. 3833 3834 test: update README. 3835 * test/README: Tell the reader what this directory is actually for. 3836 3837 test: rewrite skodic.c demo. 3838 * test/skodic.c: Rewrite this demo to simplify its use. 3839 3840 2017-03-18 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 3841 3842 Implement decoding of statx syscall. 3843 * linux/i386/syscallent.h [383]: Add statx entry. 3844 * linux/x32/syscallent.h [332]: Likewise. 3845 * linux/x86_64/syscallent.h [332]: Likewise. 3846 * pathtrace.c (pathtrace_match): Handle SEN_statx. 3847 * statx.c: New file. 3848 * statx.h: Likewise. 3849 * Makefile.am (strace_SOURCES): Add them. 3850 * tests/.gitignore: Add statx. 3851 * tests/Makefile.am (check_PROGRAMS): Likewise. 3852 (DECODER_TESTS): Add statx.test. 3853 * tests/statx.c: New file. 3854 * tests/statx.test: Likewise. 3855 * tests/xstatx.c: Modify to support statx. 3856 * xlat/at_statx_sync_types.in: New file. 3857 * xlat/statx_attrs.in: Likewise. 3858 * xlat/statx_masks.in: Likewise. 3859 * NEWS: Mention this change. 3860 3861 2017-03-17 Dmitry V. Levin <ldv (a] altlinux.org> 3862 3863 tests: check for out of bounds fetch in parsers of stat family syscalls. 3864 * tests/xstatx.c (main): Create STRUCT_STAT object using 3865 TAIL_ALLOC_OBJECT_CONST_PTR. 3866 3867 tests: check unexpected syscall errors returned by stat family syscalls. 3868 * tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test 3869 in case of EOVERFLOW. 3870 Treat errors other than ENOSYS and EOVERFLOW as fatal. 3871 3872 2017-03-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3873 3874 tests: move try_run_prog to init.sh. 3875 Looks like try_run_prog may be of general use by other syscall class 3876 tests. 3877 3878 * tests/sched.test (try_run_prog): Move it... 3879 * tests/init: ... here. 3880 3881 2017-03-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3882 3883 tests/sched.test: rc should be a local variable in try_run_prog. 3884 * tests/sched.test (try_run_prog): Add local rc. 3885 3886 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 3887 3888 tests: check decoding of int 0x80 on x86_64, x32, and x86. 3889 * tests/int_0x80.c: New file. 3890 * tests/int_0x80.test: New test. 3891 * tests/.gitignore: Add int_0x80. 3892 * tests/Makefile.am (check_PROGRAMS): Likewise. 3893 (MISC_TESTS, XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Add int_0x80.test. 3894 (XFAIL_TESTS): Add $(XFAIL_TESTS_$(ARCH)). 3895 (CLEANFILES): Add $(TESTS:=.tmp.out) and $(TESTS:=.tmp.exp). 3896 3897 2017-03-16 Damien Profeta <damien.profeta (a] amadeus.com> 3898 3899 strace-graph: handle pid looping. 3900 * strace-graph: On long running process or heavily forking one (like 3901 compilation), it can happen that a parent get 2 different children with 3902 the same pid. By tracking the currently runnig pid and adding the start 3903 timestamp to the pid, the graph can now handle that case. 3904 3905 Closes: https://github.com/strace/strace/pull/7 3906 3907 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 3908 3909 tests: use TAIL_ALLOC_OBJECT_CONST_PTR. 3910 Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro 3911 with the following sed expression: 3912 3913 sed -ri \ 3914 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \ 3915 tests/*.c 3916 3917 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 3918 3919 tests: use TAIL_ALLOC_OBJECT_VAR_PTR. 3920 Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro 3921 with the following sed expression: 3922 3923 sed -ri \ 3924 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \ 3925 tests/{move_pages,net-sockaddr,sendfile}.c 3926 3927 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 3928 3929 tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h. 3930 Introduce a new macros for the most widespread use of tail_alloc. 3931 3932 * tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR, 3933 TAIL_ALLOC_OBJECT_VAR_PTR): New macros. 3934 3935 2017-03-16 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 3936 3937 Decode RUSAGE_THREAD. 3938 * xlat/usagewho.in: Add values for existing entities, add 3939 RUSAGE_THREAD. 3940 * tests/getrusage.c: Test decoding of RUSAGE_THREAD. 3941 3942 2017-03-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3943 3944 tests/sched.test: use heredoc in order to avoid spawning of subprocess. 3945 Pipelined commands executed in subprocesses (some shells have special 3946 provision for last command in the pipeline, but it is not guaranteed 3947 and not POSIX), so exit codes of these subprocesses can be lost. 3948 In order to avoid creating subprocesses, input for read commands 3949 is better to supply via heredoc and not pipe. 3950 3951 * tests/sched.test: Move test cases to heredoc. 3952 3953 2017-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 3954 3955 tests: do not skip sched.test if one of its subtests skips. 3956 * tests/sched.test (try_run_prog): New function. 3957 Use it instead of run_prog. 3958 3959 2017-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 3960 3961 tests: do not check decoding of setitimer syscall outside xetitimer.test 3962 xetitimer.test already implements a comprehensive test of setitimer 3963 syscall parser, no need to duplicate its parts in other tests. 3964 3965 * tests/clock_nanosleep.c (main): Remove setitimer expected output. 3966 * tests/nanosleep.c (main): Likewise. 3967 * tests/clock_nanosleep.test: Remove setitimer from the trace set. 3968 * tests/nanosleep.test: Likewise. 3969 3970 2017-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 3971 3972 tests: check decoding of getitimer and setitimer corner cases. 3973 * tests/sched_xetattr.c: Include <unistd.h> and <asm/unistd.h>. 3974 (main): Check that pointer and integer arguments of getitimer 3975 and setitimer syscalls are decoded properly. 3976 * tests/xetitimer.test: Add -a option. 3977 3978 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 3979 3980 tests: rewrite sigreturn syscall decoding check from match_grep to match_diff 3981 Unlike the former test that was based on match_grep, 3982 the new one uses match_diff and does more rigorous testing. 3983 3984 * tests/sigreturn.c: Rewrite. 3985 * tests/sigreturn.test: Likewise. 3986 3987 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 3988 3989 ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls. 3990 As there is no sigreturn syscall on ia64, mips n32, mips n64, x32, 3991 and x86_64, no longer used parsers could be safely removed. 3992 3993 * linux/ia64/arch_sigreturn.c: Remove. 3994 * Makefile.am (EXTRA_DIST): Remove it. 3995 * linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32]. 3996 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove. 3997 3998 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 3999 4000 Move sigreturn parser to libstrace. 4001 All architectures have rt_sigreturn, but only old ones also have 4002 sigreturn. Since not all architectures need a parser of sigreturn 4003 syscall, remove the warning and move the parser to libstrace. 4004 4005 * Makefile.am (strace_SOURCES): Move sigreturn.c ... 4006 (libstrace_a_SOURCES): ... here. 4007 * linux/arch_sigreturn.c: Remove warning. 4008 4009 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 4010 4011 tests: check decoding of rt_sigreturn syscall. 4012 * tests/rt_sigreturn.c: New file. 4013 * tests/rt_sigreturn.test: New test. 4014 * tests/.gitignore: Add rt_sigreturn. 4015 * tests/Makefile.am (check_PROGRAMS): Likewise. 4016 (DECODER_TESTS): Add rt_sigreturn.test. 4017 4018 Implement proper decoding of rt_sigreturn syscall. 4019 * rt_sigreturn.c: New file. 4020 * Makefile.am (strace_SOURCES): Add it. 4021 * linux/dummy.h (sys_rt_sigreturn): Remove. 4022 * linux/64/syscallent.h (rt_sigreturn): Change sys_func to rt_sigreturn. 4023 * linux/hppa/syscallent.h (rt_sigreturn): Likewise. 4024 * linux/ia64/syscallent.h (rt_sigreturn): Likewise. 4025 * linux/s390/syscallent.h (rt_sigreturn): Likewise. 4026 * linux/s390x/syscallent.h (rt_sigreturn): Likewise. 4027 * linux/x86_64/syscallent.h (rt_sigreturn): Likewise. 4028 * linux/x32/syscallent.h (rt_sigreturn, 64:rt_sigreturn): Likewise. 4029 * NEWS: Mention this change. 4030 4031 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 4032 4033 Introduce get_rt_sigframe_addr function. 4034 Add get_rt_sigframe_addr function for all supported architectures. 4035 It is going to be used in a parser of rt_sigreturn syscall. 4036 4037 * defs.h (get_rt_sigframe_addr): New function prototype. 4038 * rt_sigframe.c: New file. 4039 * Makefile.am (strace_SOURCES): Add it. 4040 * linux/aarch64/arch_rt_sigframe.c: New file. 4041 * linux/alpha/arch_rt_sigframe.c: Likewise. 4042 * linux/arc/arch_rt_sigframe.c: Likewise. 4043 * linux/arm/arch_rt_sigframe.c: Likewise. 4044 * linux/avr32/arch_rt_sigframe.c: Likewise. 4045 * linux/bfin/arch_rt_sigframe.c: Likewise. 4046 * linux/crisv10/arch_rt_sigframe.c: Likewise. 4047 * linux/crisv32/arch_rt_sigframe.c: Likewise. 4048 * linux/hppa/arch_rt_sigframe.c: Likewise. 4049 * linux/i386/arch_rt_sigframe.c: Likewise. 4050 * linux/ia64/arch_rt_sigframe.c: Likewise. 4051 * linux/m68k/arch_rt_sigframe.c: Likewise. 4052 * linux/metag/arch_rt_sigframe.c: Likewise. 4053 * linux/microblaze/arch_rt_sigframe.c: Likewise. 4054 * linux/mips/arch_rt_sigframe.c: Likewise. 4055 * linux/nios2/arch_rt_sigframe.c: Likewise. 4056 * linux/or1k/arch_rt_sigframe.c: Likewise. 4057 * linux/powerpc/arch_rt_sigframe.c: Likewise. 4058 * linux/powerpc64/arch_rt_sigframe.c: Likewise. 4059 * linux/riscv/arch_rt_sigframe.c: Likewise. 4060 * linux/s390/arch_rt_sigframe.c: Likewise. 4061 * linux/s390x/arch_rt_sigframe.c: Likewise. 4062 * linux/sh/arch_rt_sigframe.c: Likewise. 4063 * linux/sh64/arch_rt_sigframe.c: Likewise. 4064 * linux/sparc/arch_rt_sigframe.c: Likewise. 4065 * linux/sparc64/arch_rt_sigframe.c: Likewise. 4066 * linux/tile/arch_rt_sigframe.c: Likewise. 4067 * linux/x32/arch_rt_sigframe.c: Likewise. 4068 * linux/x86_64/arch_rt_sigframe.c: Likewise. 4069 * linux/xtensa/arch_rt_sigframe.c: Likewise. 4070 * Makefile.am (EXTRA_DIST): Add them. 4071 4072 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 4073 4074 Introduce struct_rt_sigframe type. 4075 Add rt_sigframe.h files with definitions of struct_rt_sigframe type 4076 for all supported architectures. 4077 These definitions are going to be used in a parser of rt_sigreturn 4078 syscall. 4079 4080 * linux/rt_sigframe.h: New file. 4081 * linux/bfin/rt_sigframe.h: Likewise. 4082 * linux/crisv10/rt_sigframe.h: Likewise. 4083 * linux/crisv32/rt_sigframe.h: Likewise. 4084 * linux/hppa/rt_sigframe.h: Likewise. 4085 * linux/i386/rt_sigframe.h: Likewise. 4086 * linux/ia64/rt_sigframe.h: Likewise. 4087 * linux/m68k/rt_sigframe.h: Likewise. 4088 * linux/mips/rt_sigframe.h: Likewise. 4089 * linux/powerpc64/rt_sigframe.h: Likewise. 4090 * linux/s390/rt_sigframe.h: Likewise. 4091 * linux/s390x/rt_sigframe.h: Likewise. 4092 * linux/sh64/rt_sigframe.h: Likewise. 4093 * linux/sparc/rt_sigframe.h: Likewise. 4094 * linux/sparc64/rt_sigframe.h: Likewise. 4095 * linux/tile/rt_sigframe.h: Likewise. 4096 * linux/x32/rt_sigframe.h: Likewise. 4097 * linux/x86_64/rt_sigframe.h: Likewise. 4098 * Makefile.am (EXTRA_DIST): Add them. 4099 4100 2017-03-13 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 4101 4102 unwind.c: fix a possible buffer overflow. 4103 Linux does not prevent a user from creating a lot of nested directories 4104 with length of the absolute path of the deepest one exceeding PATH_MAX, 4105 then chdir'ing into it, creating a file there and mmap'ing it. Since the 4106 length of the prefix preceding the pathname in /proc/[pid]/maps is not 4107 necessary 80 (it's 73 on my machine), an overflow is possible. 4108 4109 * unwind.c (build_mmap_cache): Fix a possible buffer overflow. 4110 4111 2017-03-13 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 4112 4113 util.c: remove a wrong comment. 4114 4924dbd6d750665cf383b20ab4fd67e48219ab91 modified the return type, but 4115 not the comment. 4116 4117 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4118 4119 riscv: export riscv_sp_ptr. 4120 Export SP register for later use by get_rt_sigframe_addr. 4121 4122 * linux/riscv/arch_regs.h: New file. 4123 * Makefile.am (EXTRA_DIST): Add it. 4124 * linux/riscv/arch_regs.c (riscv_sp_ptr): New variable. 4125 4126 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4127 4128 or1k: export or1k_sp_ptr. 4129 Export SP register for later use by get_rt_sigframe_addr. 4130 4131 * linux/or1k/arch_regs.h: New file. 4132 * Makefile.am (EXTRA_DIST): Add it. 4133 * linux/or1k/arch_regs.c (or1k_sp_ptr): New variable. 4134 4135 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4136 4137 nios2: export nios2_sp_ptr. 4138 Export SP register for later use by get_rt_sigframe_addr. 4139 4140 * linux/nios2/arch_regs.h: New file. 4141 * Makefile.am (EXTRA_DIST): Add it. 4142 * linux/nios2/arch_regs.c (nios2_sp_ptr): New variable. 4143 4144 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4145 4146 metag: export metag_sp_ptr. 4147 Export SP register for later use by get_rt_sigframe_addr. 4148 4149 * linux/metag/arch_regs.h: New file. 4150 * Makefile.am (EXTRA_DIST): Add it. 4151 * linux/metag/arch_regs.c (metag_sp_ptr): New variable. 4152 4153 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4154 4155 avr32: export avr32_sp_ptr. 4156 Export SP register for later use by get_rt_sigframe_addr. 4157 4158 * linux/avr32/arch_regs.h: New file. 4159 * Makefile.am (EXTRA_DIST): Add it. 4160 * linux/avr32/arch_regs.c (avr32_sp_ptr): New variable. 4161 4162 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 4163 4164 arc: export arc_sp_ptr. 4165 Export SP register for later use by get_rt_sigframe_addr. 4166 4167 * linux/arc/arch_regs.h: New file. 4168 * Makefile.am (EXTRA_DIST): Add it. 4169 * linux/arc/arch_regs.c (arc_sp_ptr): New variable. 4170 4171 2017-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 4172 4173 Introduce print_sigset_addr function. 4174 As the definition of NSIG_BYTES is based on NSIG defined in <signal.h>, 4175 NSIG_BYTES cannot be used in files that use kernel sigset_t. 4176 4177 Add another wrapper around print_sigset_addr_len_limit function that 4178 takes one argument less than print_sigset_addr_len wrapper. This new 4179 wrapper is going to be used in cases when the length argument is equal 4180 to NSIG_BYTES. 4181 4182 * defs.h (print_sigset_addr): New function prototype. 4183 * signal.c (print_sigset_addr): New function. 4184 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Replace 4185 print_sigset_addr_len with print_sigset_addr. 4186 * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. 4187 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. 4188 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 4189 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 4190 * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. 4191 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 4192 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. 4193 4194 2017-03-08 Dmitry V. Levin <ldv (a] altlinux.org> 4195 4196 README.md: rework guidelines about sending bug reports. 4197 4198 2017-03-08 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 4199 4200 Update information on how to build strace from git repository. 4201 * INSTALL-git.md: Describe how to build strace from git repository. 4202 * README.md: Add reference to INSTALL-git.md. 4203 * README-hacking: Likewise. 4204 4205 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 4206 4207 README.md: fix references to in-tree files. 4208 * README.md: Change references to COPYING and NEWS files from absolute 4209 to relative. 4210 4211 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 4212 4213 INSTALL: regenerate from install.texi. 4214 Regenerate INSTALL from install.texi using the following command: 4215 makeinfo --plaintext install.texi > INSTALL 4216 4217 * INSTALL: Regenerate from install.texi. 4218 4219 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 4220 4221 install.texi: remove irrelevant sections. 4222 Remove "Multiple Architectures" and "Particular Systems" sections using 4223 the following filter script: 4224 4225 awk '/^@node (Multiple Architectures|Particular Systems)/{skip=1;next} 4226 /^@node/{skip=0} {if(!skip)print}' 4227 4228 * install.texi (Multiple Architectures, Particular Systems): Remove. 4229 4230 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 4231 4232 install.texi: import from GNU Autoconf. 4233 install.texi from GNU Autoconf is the ultimate source of INSTALL file. 4234 This edition of install.texi has been downloaded from 4235 https://git.savannah.gnu.org/cgit/autoconf.git/plain/doc/install.texi?id=63f3c78cdb0ccc85751543e387ef2a7252d5f0a2 4236 4237 * install.texi: Import from GNU Autoconf. 4238 4239 2017-03-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4240 Md Haris Iqbal <haris.phnx (a] gmail.com> 4241 4242 Implement -e trace=%sched option for tracing sched_* syscalls. 4243 Based on the patch by Md Haris Iqbal 4244 (https://sourceforge.net/p/strace/mailman/message/35111320/) 4245 4246 linux/*/syscallent.h part is modified automatically by: 4247 4248 git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \ 4249 's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/' 4250 4251 * sysent.h (TRACE_SCHED): New definition. 4252 * syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion. 4253 * linux/32/syscallent.h: Add TSC flag for sched_* sycalls. 4254 * linux/64/syscallent.h: Likewise. 4255 * linux/alpha/syscallent.h: Likewise. 4256 * linux/arm/syscallent.h: Likewise. 4257 * linux/avr32/syscallent.h: Likewise. 4258 * linux/bfin/syscallent.h: Likewise. 4259 * linux/crisv10/syscallent.h: Likewise. 4260 * linux/hppa/syscallent.h: Likewise. 4261 * linux/i386/syscallent.h: Likewise. 4262 * linux/ia64/syscallent.h: Likewise. 4263 * linux/m68k/syscallent.h: Likewise. 4264 * linux/microblaze/syscallent.h: Likewise. 4265 * linux/mips/syscallent-n32.h: Likewise. 4266 * linux/mips/syscallent-n64.h: Likewise. 4267 * linux/mips/syscallent-o32.h: Likewise. 4268 * linux/powerpc/syscallent.h: Likewise. 4269 * linux/powerpc64/syscallent.h: Likewise. 4270 * linux/s390/syscallent.h: Likewise. 4271 * linux/s390x/syscallent.h: Likewise. 4272 * linux/sh/syscallent.h: Likewise. 4273 * linux/sh64/syscallent.h: Likewise. 4274 * linux/sparc/syscallent.h: Likewise. 4275 * linux/sparc64/syscallent.h: Likewise. 4276 * linux/x32/syscallent.h: Likewise. 4277 * linux/x86_64/syscallent.h: Likewise. 4278 * linux/xtensa/syscallent.h: Likewise. 4279 * qualify.c (lookup_class): Add TRACE_SCHED for "%sched". 4280 * tests/ksysent.c: Define TSC to 0. 4281 * tests/nsyscalls.c: Likewise. 4282 * tests/sched.test: New test. 4283 * tests/Makefile.am (DECODER_TESTS): Add sched.test. 4284 * strace.1 (.SS Filtering): Add information about %sched syscall class. 4285 * NEWS: Mention this change. 4286 4287 2017-03-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4288 4289 Add "%" prefix for syscall classes in qualify. 4290 (as suggested in 4291 https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html ) 4292 4293 In order to move them to a different namespace than syscall names. This is 4294 already a problem in case of ipc class which shadows ipc syscall. 4295 4296 Old behaviour is retained in order to preserve backwards compatibility. 4297 4298 * qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions. 4299 * strace.1 (.SS Filtering): Add information regarding %-prefixed class 4300 syntax, declare legacy class syntax deprecated. 4301 * tests/net.test: Update to use %-prefixed syscall class name. 4302 * tests/netlink_protocol.test: Likewise. 4303 * tests/qual_fault-exit_group.test: Likewise. 4304 * tests/qual_syscall.test: Likewise. 4305 * tests/scm_rights-fd.test: Likewise. 4306 * tests/sigreturn.test: Likewise. 4307 * tests/uio.test: Likewise. 4308 * NEWS: Mention this change. 4309 4310 2017-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 4311 4312 tests: simplify print_time_t. 4313 * tests/print_time.c (print_time_t): Treat localtime errors as fatal. 4314 4315 2017-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 4316 4317 Update homepage URL. 4318 * README: Change homepage URL to https://strace.io 4319 * debian/control: Likewise. 4320 * strace.spec.in: Likewise. 4321 4322 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 4323 4324 tests: transform print_time_t into print_time_t_nsec. 4325 * tests/print_time.c (print_time_t): Rename to print_time_t_nsec, 4326 take second argument and print it. 4327 * tests/tests.h (print_time_t): Rename to print_time_t_nsec, 4328 add second argument. 4329 * tests/utime.c (main): Use print_time_t_nsec instead of print_time_t. 4330 * tests/xstatx.c (print_stat): Likewise. Pass nanoseconds 4331 to print_time_t_nsec instead of printing them. 4332 4333 tests: use print_time_t in utime.test. 4334 * tests/utime.c (print_tm): Remove. 4335 (main): Use print_time_t instead of print_tm. 4336 4337 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 4338 4339 tests: move print_time function to libtests. 4340 Rename print_time function to print_time_t and move it to libtests. 4341 4342 * tests/print_time.c: New file. 4343 * tests/Makefile.am (libtests_a_SOURCES): Add it. 4344 * tests/tests.h (print_time_t): New prototype. 4345 * tests/print_time.c (print_time): Remove. 4346 (print_stat): Replace print_time with print_time_t. 4347 4348 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 4349 4350 tests: macroize printing of atime, mtime, and ctime fields in xstatx.c. 4351 Introduce a macro for printing similar time related fields. 4352 4353 * print_struct_stat.c (PRINT_ST_TIME): New macro. 4354 (print_stat): Use it. 4355 4356 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 4357 4358 print_struct_stat.c: macroize printing of atime, mtime, and ctime fields 4359 Introduce a macro for printing similar time related fields. 4360 4361 * print_struct_stat.c (PRINT_ST_TIME): New macro. 4362 (print_struct_stat): Use it. 4363 4364 2017-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 4365 4366 x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls. 4367 x32 is the only linux architecture where preadv2 and pwritev2 syscalls 4368 take 5 arguments instead of 6. 4369 4370 * io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro. 4371 (SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it. 4372 * linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5. 4373 * NEWS: Mention this fix. 4374 * tests/preadv2-pwritev2.c (main): Fix invocation of preadv2 4375 and pwritev2 syscalls on x32. 4376 4377 2017-02-21 Dmitry V. Levin <ldv (a] altlinux.org> 4378 4379 tests: rewrite ppoll syscall decoding check from match_grep to match_diff 4380 Unlike the former test that was based on match_grep, 4381 the new one uses match_diff and does more rigorous testing. 4382 4383 * tests/ppoll-v.c: New file. 4384 * tests/ppoll-v.test: New test. 4385 * tests/ppoll.c: Rewrite. 4386 * tests/ppoll.test: Likewise. 4387 * tests/ppoll.expected: Remove. 4388 * tests/ppoll-v.expected: Remove. 4389 * tests/.gitignore: Add ppoll-v. 4390 * tests/Makefile.am (check_PROGRAMS): Likewise. 4391 (DECODER_TESTS): Add ppoll-v.test. 4392 (EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected. 4393 4394 2017-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 4395 4396 tests: move get_sigset_size function to libtests. 4397 * tests/get_sigset_size.c: New file. 4398 * tests/Makefile.am (libtests_a_SOURCES): Add it. 4399 * tests/tests.h (get_sigset_size): New prototype. 4400 * tests/ptrace.c: Do not check for __NR_rt_sigprocmask. 4401 (main): Use get_sigset_size. 4402 * tests/signalfd4.c: Do not check for __NR_rt_sigprocmask. 4403 (get_sigset_size): Remove. 4404 4405 2017-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 4406 4407 sched: enhance decoding of sched_setattr syscall. 4408 Implement read/write semantics of struct sched_attr.size argument 4409 of sched_setattr syscall. Do not print members of struct sched_attr 4410 besides sched_attr.size when the specified structure size is less than 4411 the minimal size allowed by the kernel. 4412 4413 * sched.c (print_sched_attr): Fetch struct sched_attr.size and use it 4414 as the structure size. Print struct sched_attr.size only when the 4415 structure size is less than SCHED_ATTR_MIN_SIZE. 4416 (SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size 4417 argument. Print struct sched_attr.size returned by the kernel 4418 on exiting syscall in case of E2BIG. Print the last syscall argument 4419 on exiting syscall. 4420 (SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size 4421 argument. 4422 * NEWS: Mention it. 4423 * tests/sched_xetattr.c (main): Check it. 4424 4425 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 4426 4427 tests: check decoding of sched_[gs]etattr corner cases. 4428 * tests/sched_xetattr.c (main): Check that integer arguments 4429 of sched_getattr and sched_setattr syscalls are decoded properly 4430 by adding a few cases with filled higher 32 bits. 4431 Check that pointer argument is decoded properly 4432 on F8ILL_KULONG_SUPPORTED architectures. 4433 4434 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 4435 4436 Move definition of struct sched_attr to a separate header file. 4437 Avoid multiple defintions of struct sched_attr by creating a separate 4438 header file with its definition and using it in other places. 4439 4440 * sched_attr.h: New file. 4441 * Makefile.am (strace_SOURCES): Add it. 4442 * sched.c: Include it. 4443 (print_sched_attr): Use it. 4444 * tests/sched_xetattr.c: Include it. 4445 (main): Use it. 4446 4447 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 4448 4449 tests: rewrite sched_xetattr.test from match_grep to match_diff. 4450 Unlike the previous edition of the test that was based on match_grep, 4451 the new one is match_diff based and does more rigorous testing. 4452 4453 * tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h", 4454 (sys_sched_getattr, sys_sched_setattr): New functions. 4455 (main): Use them. Update expected output. 4456 * tests/adjtimex.test: Use run_strace_match_diff. 4457 4458 2017-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 4459 4460 Use tprints instead of tprintf in a few more places. 4461 * bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf 4462 with tprints for printing strings without format specifiers. 4463 * dm.c (dm_decode_dm_target_spec): Likewise. 4464 * mq.c (SYS_FUNC(mq_timedreceive)): Likewise. 4465 * perf.c (print_perf_event_attr): Likewise. 4466 * syscall.c (trace_syscall_exiting): Likewise. 4467 4468 2017-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 4469 4470 bpf: update BPF_PROG_ATTACH decoding. 4471 Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH 4472 command introduced by linux kernel commit v4.10-rc7-174-g7f67763. 4473 4474 * configure.ac: Check for union bpf_attr.attach_flags 4475 instead of union bpf_attr.attach_type. 4476 * xlat/bpf_attach_flags.in: New file. 4477 * bpf.c: Include "xlat/bpf_attach_flags.h". 4478 (bpf_prog_attach_detach): Rename print_attach_bpf_fd argument 4479 to print_attach. Add attach_flags field to the structure, 4480 print it in case of BPF_PROG_ATTACH. 4481 * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 4482 instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE. 4483 (prog_cgroup): Initialize attach_flags field. 4484 (main): Update expected output. 4485 4486 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 4487 4488 tests: rewrite adjtimex.test from match_grep to match_diff. 4489 Unlike the previous edition of the test that was based on match_grep, 4490 the new one is match_diff based and does more rigorous testing. 4491 4492 * tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h", 4493 and "xlat/adjtimex_status.h". 4494 (main): Update expected output. 4495 * tests/adjtimex.test: Use run_strace_match_diff. 4496 4497 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 4498 4499 tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 4500 * tests/init_delete_module.h (bogus_zero): Remove. 4501 * tests/delete_module.c (main): Replace bogus_zero and 4502 (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 4503 * tests/finit_module.c (main): Replace bogus_zero 4504 with F8ILL_KULONG_MASK. 4505 * tests/init_module.c (main): Likewise. 4506 * tests/pipe2.c (main): Likewise. 4507 * tests/epoll_ctl.c (invoke_syscall): Replace 4508 (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 4509 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise. 4510 * tests/fanotify_init.c (main): Likewise. 4511 * tests/xetpgid.c (main): Likewise. 4512 * tests/xetpriority.c (main): Likewise. 4513 (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 4514 * tests/fanotify_mark.c (main): Likewise. 4515 * tests/file_handle.c (main): Likewise. 4516 * tests/kexec_load.c (main): Likewise. 4517 * tests/setfsugid.c (main): Likewise. 4518 * tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL 4519 with F8ILL_KULONG_MASK. 4520 * tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL 4521 and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 4522 4523 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 4524 4525 tests: fill higher bits of integer arguments of fcntl* syscalls. 4526 Check that integer arguments of fcntl and fcntl64 syscalls are decoded 4527 properly by casting them to kernel_ulong_t and filling higher bits. 4528 4529 * tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd" 4530 syscall arguments to kernel_ulong_t, fill their higher 32 bits. 4531 4532 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 4533 4534 tests: use sprintrc in tests of fcntl and fcntl64 syscalls. 4535 * tests/struct_flock.c (EINVAL_STR): Remove. 4536 (test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR. 4537 * tests/fcntl.c (test_flock64_einval): Likewise. 4538 * tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise. 4539 4540 2017-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 4541 4542 Post-release administrivia. 4543 * NEWS: Add a header line for the next release. 4544 * debian/changelog.in: Add a changelog entry for 4.16-1. 4545 * strace.spec.in: Likewise. 4546 4547 2017-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 4548 4549 Prepare for 4.16 release. 4550 * NEWS: Update for 4.16 release. 4551 4552 2017-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 4553 4554 .mailmap: add addresses of JingPiao Chen. 4555 * .mailmap: Add both addresses of JingPiao Chen here to avoid 4556 duplications in CREDITS file. 4557 4558 tests: skip scno tampering tests on compat mips abi. 4559 * tests/scno_tampering.sh: In case of mips abi, skip the test 4560 unless it is the native abi. 4561 4562 2017-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 4563 4564 Fix -Werror=duplicate-decl-specifier compilation issues. 4565 capability.c:82:28: error: duplicate "const" declaration specifier 4566 capability.c:110:33: error: duplicate "const" declaration specifier 4567 rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier 4568 utime.c:66:23: error: duplicate "const" declaration specifier 4569 waitid.c:147:20: error: duplicate "const" declaration specifier 4570 4571 * capability.c (cap_user_header_t, cap_user_data_t): Remove. 4572 (get_cap_header): Change return type 4573 to "const struct user_cap_header_struct *". 4574 (print_cap_header, print_cap_data): Change the type of last argument 4575 to "const struct user_cap_header_struct * const". 4576 (SYS_FUNC(capget)): Change type of "h" variable 4577 to "const struct user_cap_header_struct *". 4578 (SYS_FUNC(capset)): Change type of "h" variable 4579 to "const struct user_cap_header_struct * const". 4580 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last 4581 argument to "const void *const". 4582 * tests/utime.c (main): Change the type of "tail_u" variable 4583 to "const struct utimbuf *const". 4584 * tests/waitid.c (do_waitid): Change the type of 3rd argument 4585 to "const siginfo_t *const". 4586 4587 2017-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 4588 4589 tests: rewrite pipe syscall decoding check from match_grep to match_diff 4590 * configure.ac (AC_CHECK_FUNCS): Remove pipe2. 4591 * tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe] 4592 instead of [!HAVE_PIPE2]. 4593 (main): Do not call pipe2. 4594 * tests/pipe.test: Skip the test if libc pipe wrapper does not use 4595 pipe syscall, rewrite from match_grep to match_diff. 4596 * tests/pipe.expected: Update expected output. 4597 4598 2017-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 4599 4600 tests: rewrite pipe2 syscall decoding check from match_grep to match_diff 4601 Unlike pipe.test that is based on match_grep, the new test 4602 is based on match_diff and does more rigorous testing. 4603 4604 * tests/pipe2.c: New file. 4605 * tests/pipe2.test: New test. 4606 * tests/.gitignore: Add pipe2. 4607 * tests/Makefile.am (check_PROGRAMS): Likewise. 4608 (DECODER_TESTS): Add pipe2.test. 4609 4610 2017-02-10 Dmitry V. Levin <ldv (a] altlinux.org> 4611 4612 tests: rewrite mq.test from match_grep to match_diff. 4613 Unlike the previous edition of the test that was based on match_grep, 4614 the new one is match_diff based and does more rigorous testing. 4615 4616 * tests/mq.c: Include <stdio.h>. 4617 (NAME): New macro. 4618 (main): Use it. Print expected output. 4619 * tests/mq.expected: Remove. 4620 * tests/Makefile.am (EXTRA_DIST): Remove mq.expected. 4621 * tests/mq.test: Use run_strace_match_diff. 4622 4623 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 4624 4625 Simplify struct inject_opts.rval semantics. 4626 Drop use of INJECT_OPTS_RVAL_DISABLE special inject_opts.rval value, 4627 INJECT_OPTS_RVAL_DEFAULT is enough. 4628 4629 * defs.h (INJECT_OPTS_RVAL_DISABLE): Remove. 4630 * qualify.c (qualify_inject_common): Do not replace 4631 INJECT_OPTS_RVAL_DEFAULT with INJECT_OPTS_RVAL_DISABLE 4632 in inject_opts.rval. 4633 * syscall.c (tamper_with_syscall_entering): Check 4634 for INJECT_OPTS_RVAL_DEFAULT instead of INJECT_OPTS_RVAL_DISABLE. 4635 4636 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 4637 4638 tests: check signal injection along with fault injection. 4639 * tests/qual_inject-error-signal.c: New file. 4640 * tests/qual_inject-error-signal.expected: Likewise. 4641 * tests/qual_inject-error-signal.test: New test. 4642 * tests/.gitignore: Add qual_inject-error-signal. 4643 * tests/Makefile.am (check_PROGRAMS): Likewise. 4644 (MISC_TESTS): Add qual_inject-error-signal.test. 4645 (EXTRA_DIST): Add qual_inject-error-signal.expected. 4646 4647 tests: simplify qual_inject-signal.test. 4648 * tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal. 4649 4650 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 4651 4652 Make symbolic errno values match case-insensitive. 4653 Follow the example of case-insensitive symbolic signal values in signal 4654 and inject expressions and make symbolic errno values in inject 4655 expressions case-insensitive. 4656 4657 * qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp 4658 to match symbolic errno values. 4659 * tests/qual_fault.c (main): Likewise. 4660 * tests/qual_fault.test: Test case-insensitive symbolic errno match. 4661 4662 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 4663 4664 tests: check case-insensitive symbolic signal match. 4665 * tests/qual_signal.test: Test case-insensitive symbolic signal match. 4666 4667 2017-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4668 4669 Update NEWS. 4670 4671 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4672 4673 Update NEWS. 4674 4675 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4676 4677 strace.spec.in: fix dist version checks. 4678 * strace.spec.in: Fix libunwind availability check. 4679 4680 Reported-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 4681 4682 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4683 4684 tests: update ipc_sem.test for new glibc. 4685 Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL 4686 address to semctl like other libcs. 4687 4688 * tests/ipc_sem.c (main) [__GLIBC__]: Remove. 4689 4690 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4691 4692 tests: fix typo in bpf.test. 4693 * tests/bpf.c (main): Add missing semicolon. 4694 4695 Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff") 4696 4697 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4698 4699 tests: check signal injection. 4700 * tests/qual_inject-signal.c: New file. 4701 * tests/qual_inject-signal.expected: Likewise. 4702 * tests/qual_inject-signal.test: New test. 4703 * tests/.gitignore: Add qual_inject-signal. 4704 * tests/Makefile.am (check_PROGRAMS): Likewise. 4705 (MISC_TESTS): Add qual_inject-signal.test. 4706 (EXTRA_DIST): Add qual_inject-signal.expected. 4707 4708 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4709 4710 Implement -e inject= option. 4711 Introduce -e inject= as a general injection option, 4712 limit -e fault= option to syscall fault injection. 4713 4714 Change default return code of syscall fault injection to ENOSYS. 4715 4716 * qualify.c (parse_inject_token): Add fault_tokens_only argument, 4717 do not accept retval= and signal= tokens when fault_tokens_only 4718 is set to true. 4719 (parse_inject_expression): Add fault_tokens_only argument, 4720 forward it to parse_inject_token. 4721 (qualify_inject_common): New function. 4722 (qualify_fault): Use it. 4723 (qualify_inject): New function. 4724 (qual_options): New entry. 4725 * strace.1: Describe -e inject= option. 4726 * NEWS: Mention -e inject= option. 4727 * tests/qual_fault-syntax.test: Test that -e fault= option does not 4728 support retval=, signal=, and multiple error= tokens. 4729 * tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally. 4730 * tests/qual_inject-retval.test: Replace -e fault= option 4731 with -e inject= option. 4732 * tests/qual_inject-syntax.test: New test. 4733 * tests/Makefile.am (MISC_TESTS): Add it. 4734 4735 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4736 4737 tests: prepare for introduction of -e inject= option. 4738 Rename files related to fault injection to avoid further confusion. 4739 4740 * tests/fault_injection-exit_group.expected: Rename 4741 to tests/qual_fault-exit_group.expected. 4742 * tests/fault_injection-exit_group.test: Rename 4743 to tests/qual_fault-exit_group.test. 4744 * tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test. 4745 * tests/fault_injection.c: Rename to tests/qual_fault.c. 4746 * tests/fault_injection.test: Rename to tests/qual_fault.test. 4747 * tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c. 4748 * tests/fault_injection-retval.test: Rename 4749 to tests/qual_inject-retval.test. 4750 * tests/fault_injection.sh: Rename to tests/scno_tampering.sh. 4751 * tests/.gitignore: Update. 4752 * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, 4753 EXTRA_DIST): Update. 4754 4755 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 4756 4757 Prepare for introduction of -e inject= option. 4758 As -e fault= injection syntax has been extended to configure various 4759 kinds of injections besides fault injection, the original option name 4760 bacame too narrow. 4761 4762 This change renames internal constants, types, and functions from 4763 "fault" to more generic inject/tamper ones. 4764 4765 * defs.h (fault_opts): Rename to inject_opts. 4766 (FAULT_OPTS_RVAL_DEFAULT): Rename to INJECT_OPTS_RVAL_DEFAULT. 4767 (FAULT_OPTS_RVAL_DISABLE): Rename to INJECT_OPTS_RVAL_DISABLE. 4768 (struct tcb): Rename fault_vec field to inject_vec. 4769 (TCB_FAULT_INJ): Rename to TCB_TAMPERED. 4770 (QUAL_FAULT): Rename to QUAL_INJECT. 4771 (fault_vec): Rename to inject_vec. 4772 All users changed. 4773 * qualify.c (fault_set): Rename to inject_set. 4774 (parse_fault_token): Rename to parse_inject_token. 4775 (parse_fault_expression): Rename to parse_inject_expression. 4776 All callers changed. 4777 * syscall.c (fault_vec): Rename to inject_vec. 4778 (tcb_fault_opts): Rename to tcb_inject_opts. 4779 (inject_syscall_fault_entering): Rename to tamper_with_syscall_entering. 4780 (update_syscall_fault_exiting): Rename to tamper_with_syscall_exiting. 4781 (syscall_fault_injected): Rename to syscall_tampered. 4782 All callers changed. 4783 4784 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 4785 4786 tests: make Makefile.am lists sorted in C locale. 4787 * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, 4788 EXTRA_DIST): Make sorted in C locale. 4789 4790 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 4791 4792 tests: use ARG_STR in msg_control.test. 4793 Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h. 4794 4795 * tests/msg_control.c (VAL_STR): Remove. 4796 (test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR. 4797 4798 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 4799 4800 powerpc, powerpc64: wire up new syscalls. 4801 * linux/powerpc/syscallent.h [382]: Add kexec_file_load entry. 4802 * linux/powerpc64/syscallent.h [382]: Likewise. 4803 4804 microblaze: wire up new syscalls. 4805 * linux/microblaze/syscallent.h [392..397]: New entries. 4806 4807 avr32: wire up new syscalls. 4808 * linux/avr32/syscallent.h [328..330]: New entries. 4809 4810 2017-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 4811 4812 Update IPV6_* constants. 4813 * xlat/sockipv6options.in: Add IPV6_RECVFRAGSIZE introduced 4814 by linux kernel commit v4.10-rc1~202^2~340^2~1. 4815 4816 Update IP_* constants. 4817 * xlat/sockipoptions.in: Add IP_RECVFRAGSIZE introduced 4818 by linux kernel commit v4.10-rc1~202^2~340^2~2. 4819 4820 2017-02-06 Jacob Goense <dugo (a] xs4all.nl> 4821 4822 or1k: fix build. 4823 This fixes a typo in the arch_set_success for the or1k architecture. 4824 4825 * linux/or1k/set_error.c (arch_setsuccess): Rename to arch_set_success. 4826 4827 Fixes: 41d647c ("Implement success injection") 4828 Closes: https://github.com/strace/strace/pull/6 4829 4830 2017-02-04 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 4831 4832 Update ioctl entries from linux 4.10. 4833 * linux/32/ioctls_inc_align16.h: Update from linux v4.10 using ioctls_gen.sh. 4834 * linux/32/ioctls_inc_align32.h: Likewise. 4835 * linux/32/ioctls_inc_align64.h: Likewise. 4836 * linux/64/ioctls_inc.h: Likewise. 4837 * linux/x32/ioctls_inc0.h: Likewise. 4838 * NEWS: Mention this. 4839 4840 maint: update for linux 4.10. 4841 * maint/ioctls_sym.sh: Update workaround for linux/if_pppox.h file. 4842 4843 maint: add workaround for m68k. 4844 * maint/ioctls_sym.sh: Skip asm/amigayle.h. 4845 4846 2017-01-31 Dmitry V. Levin <ldv (a] altlinux.org> 4847 4848 tests: check decoding of bpf corner cases. 4849 * tests/bpf.c (bogus_bpf): New function. 4850 (BOGUS_BPF): New macro. 4851 (main): Use them. 4852 * tests/bpf.test: Add -a option. 4853 4854 2017-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 4855 4856 tests: rewrite bpf.test from match_grep to match_diff. 4857 * tests/bpf.c (errstr): New variable. 4858 (sys_bpf): New function. 4859 (map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it. 4860 (main): Update expected output. 4861 * tests/bpf.test: Use run_strace_match_diff. 4862 4863 bpf: move common code to a separate function. 4864 * bpf.c (bpf_prog_attach_detach): New function. 4865 (bpf_prog_attach, bpf_prog_detach): Use it. 4866 4867 2017-01-29 Quentin Monnet <quentin.monnet (a] 6wind.com> 4868 4869 Update bpf syscall decoding. 4870 Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH, 4871 and BPF_PROG_DETACH commands. 4872 4873 * bpf.c: Include "xlat/bpf_attach_type.h". 4874 (bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions. 4875 (SYS_FUNC(bpf)): Use them. 4876 * configure.ac: Check for union bpf_attr.bpf_fd and union 4877 bpf_attr.attach_type. 4878 * xlat/bpf_attach_type.in: New file. 4879 * xlat/bpf_commands.in: Update list of BPF_* command constants. 4880 * xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants. 4881 * xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants. 4882 * tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function. 4883 [HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise. 4884 (main): Use them. 4885 4886 2017-01-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 4887 4888 tests: check success injection. 4889 * tests/fault_injection-retval.c: New file. 4890 * tests/fault_injection-retval.test: New test. 4891 * tests/.gitignore: Add fault_injection-retval. 4892 * tests/Makefile.am (check_PROGRAMS): Likewise. 4893 (MISC_TESTS): Add fault_injection-retval.test. 4894 4895 2017-01-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 4896 4897 Implement success injection. 4898 This extends fault injection syntax with :retval= option. 4899 When :retval=VALUE is specified, the syscall number is replaced by -1 4900 and a bogus success VALUE is returned to the callee. 4901 4902 * defs.h (fault_opts): Remove err field, add rval field. 4903 (MAX_ERRNO_VALUE, FAULT_OPTS_RVAL_DEFAULT, FAULT_OPTS_RVAL_DISABLE): 4904 New macros. 4905 * qualify.c (parse_fault_token): Handle retval= token. 4906 (qualify_fault): Update fault_opts initialization after the move 4907 from struct fault_opts.err to struct fault_opts.rval. 4908 * syscall.c (arch_set_success): New prototype. 4909 (inject_syscall_fault_entering): Check opts->rval instead of opts->err. 4910 (update_syscall_fault_exiting): Implement retval injection. 4911 * strace.1: Update the section on fault injection. 4912 * NEWS: Mention retval= option. 4913 * linux/aarch64/set_error.c (arch_set_success): New function. 4914 * linux/alpha/set_error.c: Likewise. 4915 * linux/arc/set_error.c: Likewise. 4916 * linux/arm/set_error.c: Likewise. 4917 * linux/avr32/set_error.c: Likewise. 4918 * linux/bfin/set_error.c: Likewise. 4919 * linux/crisv10/set_error.c: Likewise. 4920 * linux/hppa/set_error.c: Likewise. 4921 * linux/i386/set_error.c: Likewise. 4922 * linux/ia64/set_error.c: Likewise. 4923 * linux/m68k/set_error.c: Likewise. 4924 * linux/metag/set_error.c: Likewise. 4925 * linux/microblaze/set_error.c: Likewise. 4926 * linux/mips/set_error.c: Likewise. 4927 * linux/nios2/set_error.c: Likewise. 4928 * linux/or1k/set_error.c: Likewise. 4929 * linux/powerpc/set_error.c: Likewise. 4930 * linux/riscv/set_error.c: Likewise. 4931 * linux/s390/set_error.c: Likewise. 4932 * linux/sh/set_error.c: Likewise. 4933 * linux/sh64/set_error.c: Likewise. 4934 * linux/sparc/set_error.c: Likewise. 4935 * linux/sparc64/set_error.c: Likewise. 4936 * linux/tile/set_error.c: Likewise. 4937 * linux/x86_64/set_error.c: Likewise. 4938 * linux/xtensa/set_error.c: Likewise. 4939 4940 Closes: https://github.com/strace/strace/issues/3 4941 4942 2017-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 4943 4944 mips: rewrite configure check without sgidefs.h. 4945 Use builtin macros provided by gcc >= 3.4 instead of sgidefs.h macros. 4946 4947 * configure.ac <mips>: Do not include <asm/sgidefs.h>, use _ABIO32 4948 instead of _MIPS_SIM_ABI32, _ABIN32 instead of _MIPS_SIM_NABI32, 4949 and _ABI64 instead of _MIPS_SIM_ABI64. 4950 4951 2017-01-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 4952 4953 .gitignore: add missing files that should be ignored. 4954 * .gitignore: Add /ioctl_iocdef.[ih]. 4955 4956 Fixes: 5679fad ("ioctlsort: get ioctl definitions from host, not build") 4957 4958 2017-01-20 Andre McCurdy <armccurdy (a] gmail.com> 4959 4960 mips: use <asm/sgidefs.h> 4961 Build fix for MIPS with musl libc. 4962 4963 The MIPS specific header <sgidefs.h> is provided by glibc and uclibc 4964 but not by musl. Regardless of the libc, the kernel headers provide 4965 <asm/sgidefs.h> which provides the same definitions, so use that 4966 instead. 4967 4968 * configure.ac: Replace <sgidefs.h> with <asm/sgidefs.h>. 4969 4970 2017-01-20 JingPiao Chen <chenjingpiao (a] gmail.com> 4971 4972 Implement decoding of ustat syscall. 4973 * configure.ac (AC_CHECK_HEADERS): Add ustat.h. 4974 * ustat.c: New file. 4975 * Makefile.am (strace_SOURCES): Add it. 4976 * linux/dummy.h: Remove sys_ustat. 4977 * tests/ustat.c: New file. 4978 * tests/ustat.test: New test. 4979 * tests/.gitignore: Add ustat. 4980 * tests/Makefile.am (check_PROGRAMS): Likewise. 4981 (DECODER_TESTS): Add ustat.test. 4982 4983 Makefile.am: allow indented DEF_MPERS_TYPE includes. 4984 * Makefile.am (m%_type_defs.h): Change sed regular expression to allow 4985 arbitrary number of whitespace characters between "#" symbol 4986 and "include" directive. 4987 4988 strace.1: fix formatting. 4989 * strace.1: Remove misplaced .TP macros. 4990 4991 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 4992 4993 tests: drop non-USE_ASM_STAT case support. 4994 With the switch of fstatat family tests to USE_ASM_STAT variant, 4995 there are no non-USE_ASM_STAT users left. Remove support of unused 4996 non-USE_ASM_STAT case. 4997 4998 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec. 4999 * tests/fstatat.c (USE_ASM_STAT): Remove. 5000 * tests/fstatx.c: Likewise. 5001 * tests/lstatx.c: Likewise. 5002 * tests/xstatx.c: Assume USE_ASM_STAT. 5003 [!USE_ASM_STAT]: Remove. 5004 5005 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 5006 5007 tests: call newfstatat and fstatat64 syscalls directly. 5008 Do not use glibc wrappers to call newfstatat and fstatat64. 5009 These wrappers have various problems, e.g. they segfault on sparc64 5010 and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong 5011 conversion of timestamps on mips64. 5012 5013 * tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall 5014 directly. 5015 (USE_ASM_STAT): Define. 5016 * tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove. 5017 (STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define. 5018 5019 Based on patch by James Cowgill <james410 (a] cowgill.org.uk>. 5020 5021 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 5022 5023 tests: remove redundant SAMPLE_SIZE definitions. 5024 Remove all definitions of SAMPLE_SIZE that are identical to the fallback 5025 definition in tests/xstatx.c. 5026 5027 * tests/fstat64.c (SAMPLE_SIZE): Remove. 5028 * tests/lstat64.c (SAMPLE_SIZE): Remove. 5029 * tests/stat64.c (SAMPLE_SIZE): Remove. 5030 5031 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 5032 5033 tests: change SAMPLE_SIZE type to libc_off_t. 5034 As ftruncate libc function and our create_sample function that calls 5035 ftruncate both take size argument of type libc_off_t, change the type 5036 of SAMPLE_SIZE constant to libc_off_t. 5037 5038 * tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t. 5039 * tests/lstat.c (SAMPLE_SIZE): Likewise. 5040 * tests/oldfstat.c (SAMPLE_SIZE): Likewise. 5041 * tests/oldlstat.c (SAMPLE_SIZE): Likewise. 5042 * tests/oldstat.c (SAMPLE_SIZE): Likewise. 5043 * tests/stat.c (SAMPLE_SIZE): Likewise. 5044 * tests/xstatx.c (SAMPLE_SIZE): Likewise. 5045 5046 2017-01-13 Alexey Neyman <stilor (a] att.net> 5047 5048 ioctlsort: get ioctl definitions from host, not build. 5049 When cross-compiling, ioctlsort must obtain _IOC_* values from the 5050 host, build's values may be incompatible. 5051 5052 * ioctl_iocdef.c: New file. 5053 * Makefile.am (EXTRA_DIST): Add it. 5054 (ioctl_iocdef.i, ioctl_iocdef.h): New rules. 5055 (ioctlsort%.o): Depend on ioctl_iocdef.h. 5056 (CLEANFILES): Add ioctl_iocdef.h and ioctl_iocdef.i. 5057 * ioctlsort.c: Include "ioctl_iocdef.h" instead of <linux/ioctl.h>. 5058 5059 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 5060 5061 tests: treat struct stat mismatch as an error. 5062 If the test detects struct stat mismatch, this is likely an error 5063 in definitions of a stat structure that might affect strace as well. 5064 Fail the test instead of skipping it to attract more attention. 5065 5066 * tests/xstatx.c (main): Return 1 instead of 77 5067 in case of struct stat mismatch. 5068 5069 2017-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 5070 5071 tests: rewrite diagnostics about struct stat mismatch. 5072 * tests/xstatx.c (LOG_STAT_OFFSETOF_SIZEOF): New macro. 5073 (main): Use it to print struct stat mismatch details. 5074 5075 tests: fix typo in tests/xstatx.c. 5076 * tests/xstatx.c [!IS_FSTAT]: Define IS_FSTAT instead of IS_STAT. 5077 5078 2017-01-12 JingPiao Chen <chenjingpiao (a] gmail.com> 5079 5080 tests: fix typo in mlock.c. 5081 * tests/mlock.c [!(__NR_mlock && __NR_munlock)]: Fix spelling 5082 of SKIP_MAIN_UNDEFINED. 5083 5084 2017-01-12 JingPiao Chen <chenjingpiao (a] gmail.com> 5085 5086 strace: move description of -k option to the appropriate place. 5087 Follow the example of strace.1 and put the description of -k option 5088 into the output format group. 5089 5090 * strace.c (usage): Move description of -k option to the output 5091 format group. 5092 5093 2017-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 5094 5095 Remove redundant commas at the end of structure initializers. 5096 Automatically remove redundant commas using the following 5097 sed expression: 5098 5099 git grep -El ',[[:space:]]+}' |xargs sed -ri 's/,([[:space:]]+\})/\1/' 5100 5101 * linux/32/syscallent.h: Remove redundant commas at the end of structure 5102 initializers. 5103 * linux/64/syscallent.h: Likewise. 5104 * linux/alpha/syscallent.h: Likewise. 5105 * linux/arm/syscallent.h: Likewise. 5106 * linux/avr32/syscallent.h: Likewise. 5107 * linux/bfin/syscallent.h: Likewise. 5108 * linux/crisv10/syscallent.h: Likewise. 5109 * linux/hppa/syscallent.h: Likewise. 5110 * linux/i386/syscallent.h: Likewise. 5111 * linux/ia64/syscallent.h: Likewise. 5112 * linux/m68k/syscallent.h: Likewise. 5113 * linux/microblaze/syscallent.h: Likewise. 5114 * linux/microblaze/userent.h: Likewise. 5115 * linux/mips/syscallent-n32.h: Likewise. 5116 * linux/mips/syscallent-n64.h: Likewise. 5117 * linux/mips/syscallent-o32.h: Likewise. 5118 * linux/powerpc/syscallent.h: Likewise. 5119 * linux/powerpc64/syscallent.h: Likewise. 5120 * linux/s390/syscallent.h: Likewise. 5121 * linux/s390x/syscallent.h: Likewise. 5122 * linux/sh/syscallent.h: Likewise. 5123 * linux/sh64/syscallent.h: Likewise. 5124 * linux/sparc/syscallent.h: Likewise. 5125 * linux/sparc64/syscallent.h: Likewise. 5126 * linux/x32/syscallent.h: Likewise. 5127 * linux/x86_64/syscallent.h: Likewise. 5128 * linux/xtensa/syscallent.h: Likewise. 5129 * tests/kexec_file_load.c: Likewise. 5130 5131 Reported-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 5132 5133 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5134 5135 tests: check decoding of scsi ioctl commands. 5136 * tests/ioctl_scsi.c: New file. 5137 * tests/ioctl_scsi.test: New test. 5138 * tests/.gitignore: Add ioctl_scsi. 5139 * tests/Makefile.am (check_PROGRAMS): Likewise. 5140 (DECODER_TESTS): Add ioctl_scsi.test. 5141 5142 scsi: implement decoding of all SG_* ioctl commands. 5143 * print_sg_req_info.c: New file. 5144 * Makefile.am (strace_SOURCES): Add it. 5145 * xlat/sg_scsi_reset.in: New file. 5146 * scsi.c: Include "xlat/sg_scsi_reset.h". 5147 (scsi_ioctl): Implement decoding of all SG_* ioctl commands. 5148 5149 scsi: prepare for decoding of other SG_* ioctl commands. 5150 * scsi.c (scsi_ioctl): Introduce a switch statement. 5151 5152 tests: check decoding of ioctl SG_IO v3 commands. 5153 * tests/ioctl_sg_io_v3.c: New file. 5154 * tests/ioctl_sg_io_v3.test: New test. 5155 * tests/.gitignore: Add ioctl_sg_io_v3. 5156 * tests/Makefile.am (check_PROGRAMS): Likewise. 5157 (DECODER_TESTS): Add ioctl_sg_io_v3.test. 5158 5159 tests: check decoding of ioctl SG_IO v4 commands. 5160 * tests/ioctl_sg_io_v4.c: New file. 5161 * tests/ioctl_sg_io_v4.test: New test. 5162 * tests/.gitignore: Add ioctl_sg_io_v4. 5163 * tests/Makefile.am (check_PROGRAMS): Likewise. 5164 (DECODER_TESTS): Add ioctl_sg_io_v4.test. 5165 5166 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5167 5168 scsi: add fallback definitions for SG_* ioctl command constants. 5169 Unfortunately, <scsi/sg.h> from libc does not provide all constants 5170 recognized by the kernel. 5171 5172 * xlat/scsi_sg_commands.in: New file. 5173 * scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing 5174 a fallback definition of SG_IO. 5175 5176 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5177 5178 xlat: provide fallback definitions for BSG_FLAG_* constants. 5179 BSG_FLAG_* constants were introduced later than the header file where 5180 they are defined. 5181 5182 * xlat/bsg_flags.in: Add default values for constants. 5183 5184 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5185 5186 xlat: provide fallback definitions for SG_FLAG_* constants. 5187 Unfortunately, <scsi/sg.h> from libc does not provide all constants 5188 recognized by the kernel. 5189 5190 * xlat/sg_io_flags.in: Add default values for constants. 5191 5192 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5193 5194 sg_io_v4: print din_resid and dout_resid fields as signed integers. 5195 * sg_io_v4.c (decode_response): Print din_resid and dout_resid fields 5196 using %d format. 5197 5198 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5199 5200 sg_io: cleanup printing of sg_io buffers. 5201 Turn print_sg_io_buffer into a universal sg_io buffer printer. 5202 5203 * sg_io_v3.c (print_sg_io_buffer): Add iovec_count argument. 5204 Call tprint_iov_upto when iovec_count is non-zero. 5205 (decode_request, decode_response): Do not call tprint_iov_upto directly, 5206 use print_sg_io_buffer instead. 5207 * sg_io_v4.c: Likewise. 5208 5209 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 5210 5211 sg_io: decode structures on exiting syscall in case of syserror. 5212 The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78, 5213 translates its "struct request.errors" to ioctl errors after 5214 filling in all the output members of the SG_IO header structure. 5215 5216 As there is no easy way to tell SCSI layer errors from other syscall 5217 errors, decode the structure on exiting syscall in case of syserror, 5218 too. 5219 5220 * scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use 5221 get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io 5222 unconditionally. 5223 * sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using 5224 set_tcb_priv_data. 5225 (decode_response): Restore it using get_tcb_priv_data. Print its i/o 5226 fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto 5227 unconditionally. 5228 * sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using 5229 set_tcb_priv_data. 5230 (decode_response): Restore it using get_tcb_priv_data. Print its i/o 5231 fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto 5232 unconditionally. 5233 5234 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5235 5236 sg_io: reorder printing of fields to follow structure order. 5237 * sg_io_v4.c (decode_request): Print timeout, flags, and usr_ptr fields 5238 after dout_xferp field. 5239 5240 sg_io_v3: print sg_io_hdr.duration field as unsigned integer. 5241 * sg_io_v3.c (decode_response): Print duration field using %u format. 5242 5243 sg_io_v3: print msg_status field. 5244 * sg_io_v3.c (decode_response): Print msg_status field. 5245 5246 sg_io: print names of array fields and corresponding length fields. 5247 * sg_io_v3.c (decode_request): Print names of cmd_len, cmdp, 5248 and dxferp fields. 5249 (decode_response): Print names of dxferp, sb_len_wr, and sbp fields. 5250 * sg_io_v4.c (decode_request): Print names of request_len, request, 5251 dout_xfer_len, and dout_xferp fields. 5252 (decode_response): Print names of response_len, response, 5253 and din_xferp fields. 5254 5255 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5256 5257 sg_io_v3: print status fields using %#x format specifier. 5258 The formerly used format string %02x led to misleading output as there 5259 was no clear indication sometimes whether the printed integer was 5260 decimal or hexadecimal. 5261 5262 * sg_io_v3.c (decode_response): Print status and masked_status fields 5263 using %#x format specifier instead of %02x. 5264 5265 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5266 5267 sg_io_v4: print status fields in a hexadecimal form. 5268 The tradition is to print scsi status codes in a hexadecimal form. 5269 5270 * sg_io_v4.c (decode_response): Print driver_status, transport_status, 5271 and device_status fields using %#x format specifier instead of %u. 5272 5273 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5274 5275 sg_io_v4: print request_tag and generated_tag fields in hex. 5276 The tradition is to print scsi tags in a hexadecimal form. 5277 5278 * sg_io_v4.c (decode_request): Print request_tag field 5279 using ("%#" PRI__x64) format string. 5280 (decode_response): Print generated_tag field using ("%#" PRI__x64) 5281 format string. 5282 5283 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5284 5285 sg_io_v4: print usr_ptr field in a hexadecimal form. 5286 As the nature of this field is pointer-like, print it 5287 in a hexadecimal form. 5288 5289 * sg_io_v4.c (decode_request): Print usr_ptr field 5290 using ("%#" PRI__x64) format string. 5291 5292 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5293 5294 sg_io_v4: do not print spare_in and spare_out fields. 5295 As the kernel does not touch these fields, there is no use 5296 to print them. 5297 5298 * sg_io_v4.c (decode_request): Do not print spare_in field. 5299 (decode_response): Do not print spare_out field. 5300 5301 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5302 5303 sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info. 5304 Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags. 5305 5306 * xlat/sg_io_info.in: New file. 5307 * defs.h (sg_io_info): New xlat prototype. 5308 * sg_io_v3.c: Include "xlat/sg_io_info.h". 5309 (decode_response): Print struct_sg_io_hdr.info using printflags. 5310 * sg_io_v4.c: (decode_response): Print struct sg_io_v4.info 5311 using printflags. 5312 5313 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5314 5315 sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags. 5316 Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags. 5317 5318 * xlat/sg_io_flags.in: New file. 5319 * sg_io_v3.c: Include "xlat/sg_io_flags.h". 5320 (decode_request): Print struct_sg_io_hdr.flags using printflags. 5321 * xlat/bsg_flags.in: New file. 5322 * sg_io_v4.c: Include "xlat/bsg_flags.h". 5323 (decode_request): Print struct sg_io_v4.flags using printflags. 5324 5325 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5326 5327 Mpersify struct sg_io_hdr. 5328 struct sg_io_hdr contains pointers and therefore has to be mpersified. 5329 5330 * defs.h (decode_sg_io_v3): Remove prototype. 5331 * sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr. 5332 Mpersify it. 5333 (decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL. 5334 5335 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 5336 5337 Split scsi.c. 5338 Move decoders of SG_IO v3 and v4 APIs into separate files, 5339 compile generic SG_IO decoder unconditionally. 5340 5341 * sg_io_v3.c: New file. 5342 * sg_io_v4.c: Likewise. 5343 * Makefile.am (strace_SOURCES): Add them. 5344 * defs.h (decode_sg_io_v3, decode_sg_io_v4): New prototypes. 5345 * ioctl.c (ioctl_decode): Remove [HAVE_SCSI_SG_H] condition. 5346 * scsi.c: (print_sg_io_res): Remove. 5347 (print_sg_io_req): Rename to decode_sg_io, replace print_sg_io_v3_req 5348 with decode_sg_io_v3, replace print_sg_io_v4_req with decode_sg_io_v4, 5349 compile uncoditionally. 5350 (scsi_ioctl): Replace print_sg_io_req and print_sg_io_res 5351 with decode_sg_io, compile uncoditionally. 5352 Move [HAVE_SCSI_SG_H] code to sg_io_v3.c. 5353 Move [HAVE_LINUX_BSG_H] code to sg_io_v4.c. 5354 5355 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 5356 5357 scsi: detect and print changes of interface id. 5358 * scsi.c (print_sg_io_v3_res): Detect and print changes 5359 of struct sg_io_hdr.interface_id field between entering and exiting 5360 syscall. 5361 (print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard 5362 field between entering and exiting syscall. 5363 5364 scsi: print field names of all fields being printed. 5365 * scsi.c (print_sg_io_v3_req): Always print the name 5366 of struct sg_io_hdr.interface_id field. 5367 (print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard 5368 field. 5369 (print_sg_io_req): Print unknown interface id as an integer. 5370 (scsi_ioctl): Save interface id on entering syscall and use it 5371 on exiting syscall. 5372 5373 scsi: print struct sg_io_hdr.dxfer_direction field name. 5374 * scsi.c (print_sg_io_v3_req): Print struct sg_io_hdr.dxfer_direction 5375 field name. 5376 5377 scsi: print "protocol" and "subprotocol" field names of struct sg_io_v4. 5378 * scsi.c (print_sg_io_v4_req): Print field names 5379 of struct sg_io_v4.protocol and struct sg_io_v4.subprotocol. 5380 5381 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 5382 5383 Print hexadecimal integer in error diagnostics using %#x. 5384 The formerly used format string %x led to misleading output as there was 5385 no clear indication sometimes whether the printed integer was decimal or 5386 hexadecimal. 5387 5388 * aio.c (startup_child, test_ptrace_seize): Print status 5389 using %#x format specifier instead of %x. 5390 5391 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 5392 5393 aio: print hexadecimal integer using %#x. 5394 The formerly used format string %x led to misleading output as there was 5395 no clear indication sometimes whether the printed integer was decimal or 5396 hexadecimal. 5397 5398 * aio.c (print_common_flags): Print struct iocb.aio_flags using %#x 5399 format specifier instead of %x. 5400 * tests/aio.c (main): Likewise. 5401 5402 2017-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 5403 5404 scsi: rewrite print_sg_io_buffer using printstr_ex(QUOTE_FORCE_HEX) 5405 As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need 5406 to implement it manually any longer. 5407 5408 * scsi.c (print_uchar): Remove. 5409 (print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX). 5410 5411 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5412 5413 getrandom: print string as hex-escaped. 5414 Since there is no reason to interpret the value returned by getrandom as 5415 ASCII string, it makes sense to always print it as a hex-escaped string. 5416 5417 * getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead 5418 of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order 5419 to force hex-escaped string formatting. 5420 * tests/getrandom.test: Remove no longer needed -xx flag as the string 5421 is always printed in hexadecimal format now. 5422 5423 Suggested-by: JingPiao Chen <chenjingpiao (a] gmail.com> 5424 5425 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5426 5427 util: add support for forcing printing string as hex-escaped. 5428 This could be useful in cases when some binary data should not be 5429 interpreted as an ASCII string, but rather as an array of byte values. 5430 5431 * defs.h (QUOTE_FORCE_HEX): New macro constant. 5432 * util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set 5433 in user_style parameter. 5434 5435 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5436 5437 term: do not abort decoding in case of non-verbose output. 5438 The case of unset verbose is handled by umoven_or_printaddr, moreover, 5439 exiting at this point is plain wrong and leads to last argument not 5440 being printed while it should be. 5441 5442 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 5443 decode_modem_flags): Do not check verbose flags explicitly and do not 5444 exit early if it is not set. 5445 5446 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 5447 5448 tests: skip fault injection tests on hppa if the kernel is too old. 5449 * tests/fault_injection.sh: Add the minimal kernel version for hppa. 5450 5451 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 5452 5453 tests: skip readahead.test on MIPS n64 when built with glibc < 2.25. 5454 Due to a bug in glibc readahead syscall wrapper on MIPS n64, 5455 this wrapper cannot be used in readahead.test. 5456 5457 * tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]: 5458 Undefine HAVE_READAHEAD. 5459 5460 Reported-by: James Cowgill <james410 (a] cowgill.org.uk> 5461 5462 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 5463 5464 tests: replace init_magic with fill_memory. 5465 Use the same fill_memory/fill_memory_ex interface in all affected tests. 5466 5467 * tests/ioctl_block.c (init_magic): Remove. 5468 (main): Replace init_magic with fill_memory. 5469 * tests/ioctl_evdev.c: Likewise. 5470 * tests/ioctl_v4l2.c: Likewise. 5471 * tests/ioctl_mtd.c (magic, init_magic): Remove. 5472 (main): Replace init_magic with fill_memory. 5473 * tests/ioctl_rtc.c: Likewise. 5474 5475 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 5476 5477 tests: rewrite ioctl_v4l2 test without reliance on init_magic. 5478 * tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros. 5479 (main): Use them. Rewrite expected output without assumptions 5480 on any particular magic data. 5481 5482 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 5483 5484 tests: remove redundant casts in fill_memory{,_ex} invocations. 5485 * tests/ioctl_loop.c (main): Remove redundant casts of fill_memory 5486 first argument. 5487 * tests/kexec_load.c (main): Likewise. 5488 * tests/perf_event_open.c (main): Likewise. 5489 * tests/quotactl.c (main): Likewise. 5490 * tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex 5491 first argument. 5492 * tests/quotactl-xfs.c (main): Likewise. 5493 5494 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 5495 5496 tests: change the type of fill_memory{,_ex} first argument to void * 5497 As these functions behave like memset, it's more convenient to have 5498 the first argument of type void * like memset. 5499 5500 * tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type 5501 of first argument from "char *" to "void *". 5502 * tests/tests.h (fill_memory, fill_memory_ex): Likewise. 5503 5504 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5505 5506 tests: check non-verbose decoding of LOOP_* ioctls. 5507 * tests/ioctl_loop-nv.c: New file. 5508 * tests/ioctl_loop-nv.test: New test. 5509 * tests/ioctl_loop.c [!ABBREV] (ABBREV): Define to 0. 5510 (print_loop_info, print_loop_info64): Handle [ABBREV != 0] case. 5511 * tests/.gitignore: Add ioctl_loop-nv. 5512 * tests/Makefile.am (check_PROGRAMS): Likewise. 5513 5514 tests: add more checks of LOOP_* ioctls decoding. 5515 * tests/ioctl_loop.c: Include <linux/ioctl.h>. 5516 (magic, lmagic): Move static constants ... 5517 (main): ... here. Change types of magic constants to kernel_ulong_t. 5518 Add more checks. 5519 5520 2017-01-04 JingPiao Chen <chenjingpiao (a] gmail.com> 5521 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5522 5523 tests: check decoding of LOOP_* ioctls. 5524 * tests/ioctl_loop.c: New file. 5525 * tests/ioctl_loop-v.c: Likewise. 5526 * tests/ioctl_loop.test: New test. 5527 * tests/ioctl_loop-v.test: Likewise. 5528 * tests/.gitignore: Add ioctl_loop and ioctl_loop-v. 5529 * tests/Makefile.am (check_PROGRAMS): Likewise. 5530 (DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test. 5531 5532 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 5533 5534 Drop vsprintf.c. 5535 Drop custom vfprintf implementation that was disabled by default. 5536 Apparently nobody tests strace with this vfprintf enabled, otherwise 5537 multiple uses of format specifiers not supported by this custom vfprintf 5538 would not left unnoticed. 5539 5540 The GNU C library is not the only libc available, so those who want 5541 faster implementations of libc functions are encouraged to try building 5542 strace with other libc implementations. 5543 5544 * vsprintf.c: Remove. 5545 * Makefile.am (strace_SOURCES): Remove vsprintf.c. 5546 * defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove. 5547 * strace.c (tprintf): Replace strace_vfprintf with vfprintf. 5548 5549 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5550 5551 loop: remove unnecessary verbose check. 5552 The verbose flag is responsible for dereferencing of addresses, and it 5553 is perfectly handled by umove_or_printaddr; moreover, this early exit 5554 leads to incorrect formatting of last argument. 5555 5556 * loop.c (loop_ioctl): Do not check verbose flag explicitly and do not 5557 exit early if it is not set. 5558 5559 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5560 5561 loop: fix lo_encrypt_key field output. 5562 lo_encrypt_key is a sized string with its size specified by 5563 lo_encrypt_key_size field, so take lo_encrypt_key_size into account. 5564 5565 * loop.c (decode_loop_info, decode_loop_info64): Use minimum of 5566 LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size. 5567 5568 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5569 5570 loop: print lo_encrypt_key_size field of struct loop_info as unsigned. 5571 It is converted to an unsigned value in kernel (see loop_info64_from_old 5572 in drivers/block/loop.c), so let's print it that way despite its type. 5573 5574 * loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t 5575 value. 5576 5577 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5578 5579 tests: add more checks of unknown ioctl command formatting. 5580 * tests/ioctl.c (main): Additional check for unknown ioctl command 5581 decoding. 5582 * tests/ioctl_evdev.c (main): Likewise. 5583 * tests/ioctl_dm.c: Include <linux/ioctl.h> for _IOC_SIZE and _IOC_NR. 5584 (main) <dummy_dm_ioctl1, dummy_dm_ioctl2, dummy_dm_arg>: New constants. 5585 Add more checks for unknown command formatting. 5586 5587 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5588 5589 ioctl: do not print explicit 0x prefix and do not specify minimum width. 5590 Specifying output width for size argument is rather misleading - it can 5591 be up to 14 bits in size. The use of explicit "0x" prefix is 5592 discouraged because 0x0 looks ugly. Usage of width specification along 5593 with alternate form flag leads to inconsistent output for 0. 5594 Let's use just plain %#x qualifiers instead. 5595 5596 * ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command 5597 type, number and size to "%#x". 5598 * tests/ioctl.c (main): Update expected test output. 5599 * tests/ioctl_dm.c (main): Likewise. 5600 * tests/ioctl_evdev.c (main): Likewise. 5601 5602 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5603 5604 loop: fix printing of the reserved field array items. 5605 They are of char type, so "hh" length modifier should be used (otherwise 5606 they are printed incorrectly as they are sign extended implicitly when 5607 passed as printf arguments in case char is a signed type which is true 5608 for most compilers). 5609 5610 * loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx" 5611 in printing routine for array elements of the "reserved" field of 5612 loop_info structure. 5613 5614 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5615 5616 tests: check ioctl(SIOCGIFCONF) decoding. 5617 * tests/ioctl_sock_gifconf.c: New file. 5618 * tests/ioctl_sock_gifconf.test: New test. 5619 * tests/.gitignore: Add ioctl_sock_gifconf. 5620 * tests/Makefile.am (check_PROGRAMS): Likewise. 5621 (DECODER_TESTS): Add ioctl_sock_gifconf.test. 5622 5623 dm.c: add copyright notice. 5624 5625 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 5626 5627 Add scno.h and syscallent.i to .gitignore files. 5628 * .gitignore: Add /scno.h and /syscallent.i. 5629 * tests/.gitignore: Add scno.h and syscallent.i. 5630 5631 2017-01-04 JingPiao Chen <chenjingpiao (a] gmail.com> 5632 5633 tests/.gitignore: add generated files that should be ignored. 5634 * tests/.gitignore: Replace addkey with add_key, add attach-f-p-cmd. 5635 5636 2017-01-03 Dmitry V. Levin <ldv (a] altlinux.org> 5637 5638 Remove checks of __NR_* availability from strace source code. 5639 * strace.c: Remove __NR_tkill checks, assume it is always defined. 5640 * util.c: Remove __NR_process_vm_readv checks and fallback definitions, 5641 assume it is always defined. 5642 5643 Include "scno.h" in files that check __NR_* constants. 5644 * strace.c: Include "scno.h". 5645 * util.c: Likewise. 5646 5647 Generate scno.h for use during the build of strace itself. 5648 * Makefile.am: Include scno.am. 5649 ($(strace_OBJECTS)): New rule. 5650 5651 2017-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 5652 5653 Generate scno.h without invoking a generated executable helper. 5654 Generate scno.h using only those tools that are available for cross 5655 build. This allows to use scno.h during the build of strace itself. 5656 5657 * scno.am: New file. 5658 * scno.head: New file. 5659 * Makefile.am (EXTRA_DIST): Add it. 5660 * tests/generate_scno.c: Remove. 5661 * tests/.gitignore: Remove generate_scno. 5662 * tests/Makefile.am (check_PROGRAMS): Likewise. 5663 (CLEANFILES): Remove scno.h. 5664 (scno.h, $(scno_dependants)): Remove rules. 5665 (scno_dependants): Remove. 5666 ($(objects)): New rule. 5667 Include ../scno.am. 5668 5669 2017-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 5670 5671 Update all publicly shown copyright year number ranges. 5672 * COPYING: Update copyright year number range. 5673 * configure.ac: Likewise. 5674 * strace.c: Likewise. 5675 * tests/strace-V.test: Use the current year for the check. 5676 5677 2016-12-31 Dmitry V. Levin <ldv (a] altlinux.org> 5678 5679 defs.h: stop including <asm/unistd.h> 5680 Limit the number of files where <asm/unistd.h> is included 5681 to only those few that need it. 5682 5683 * defs.h: Do not include <asm/unistd.h>. 5684 * clone.c: Include <asm/unistd.h>. 5685 * strace.c: Likewise. 5686 * syscall.c: Likewise. 5687 * util.c: Likewise. 5688 5689 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 5690 5691 tests: do not use BUILT_SOURCES. 5692 * tests/Makefile.am (ksysent.$(OBJEXT)): New rule. 5693 (BUILT_SOURCES): Remove. 5694 5695 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 5696 5697 Fix cross build. 5698 This fixes cross build regression introduced by commit 5699 v4.15-39-g605a705a63d533dceb3c2d489468fcd3aed3963c. 5700 5701 * tests/Makefile.am (BUILT_SOURCES): Remove scno.h 5702 (objects, scno_dependants): New variables. 5703 ($(scno_dependants)): New rule. 5704 5705 Reported-by: Joakim Bech <joakim.bech (a] linaro.org> 5706 5707 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 5708 5709 tests: do not use defs.h and syscall.h. 5710 * tests/generate_scno.c: Include "tests.h", "sysent.h", <stdio.h>, 5711 <string.h>, and <asm/unistd.h> instead of "defs.h" and "syscall.h". 5712 * tests/ksysent.c: Likewise. 5713 * tests/nsyscalls.c: Include "tests.h", "sysent.h", <errno.h>, 5714 <stdio.h>, and <unistd.h> instead of "defs.h" and "syscall.h". 5715 5716 Move definition of struct sysent and trace flags to a separate file. 5717 * sysent.h: New file. 5718 * Makefile.am (strace_SOURCES): Add it. 5719 * defs.h: Include it. 5720 (struct sysent, TRACE_FILE, TRACE_IPC, TRACE_NETWORK, TRACE_PROCESS, 5721 TRACE_SIGNAL, TRACE_DESC, TRACE_MEMORY, SYSCALL_NEVER_FAILS, 5722 STACKTRACE_INVALIDATE_CACHE, STACKTRACE_CAPTURE_ON_ENTER, 5723 TRACE_INDIRECT_SUBCALL, COMPAT_SYSCALL_TYPES): Remove. 5724 5725 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5726 5727 Mpersify SIOC* ioctls. 5728 struct ifreq and struct ifconf are ABI-dependent and should have been 5729 mpersified. 5730 5731 * defs.h (sock_ioctl): Remove prototype. 5732 * sock.c (struct_ifconf, struct_ifreq): New typedefs. 5733 (DEF_MPERS_TYPE(struct_ifconf), DEF_MPERS_TYPE(struct_ifreq), 5734 MPERS_DEFS): New includes. 5735 (print_ifreq, print_ifc_len, print_ifconf_ifreq): Replace struct ifreq 5736 with struct_ifreq. 5737 (decode_ifconf): Replace struct ifconf with struct_ifconf, struct ifreq 5738 with struct_fireq. 5739 (sock_ioctl): Wrap into MPERS_PRINTER_DECL. 5740 5741 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5742 Dmitry V. Levin <ldv (a] altlinux.org> 5743 5744 sock: rewrite decode_ifconf. 5745 * sock.c (decode_ifconf): Rewrite. 5746 5747 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5748 5749 xlat: update LOOP_* ioctl flags constants. 5750 * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_USE_AOPS 5751 and LO_FLAGS_DIRECT_IO. 5752 * xlat/loop_flags_options.in: Likewise. Add default values 5753 for constants. 5754 5755 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5756 5757 loop: add fallback definitions for LOOP_* ioctl command constants. 5758 Since these are architecture-independent and have been added over the 5759 kernel's lifetime, it makes sense to have these definitions in strace 5760 itself. 5761 5762 * xlat/loop_cmds.in: New file. 5763 * loop.c: Include "xlat/loop_cmds.h". 5764 (loop_ioctl): Eliminate conditional compilation based on availability 5765 of LOOP_* constant definitions. 5766 5767 2016-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 5768 5769 xlat: extend syntax. 5770 * xlat/gen.sh: Implement #stop directive that stops preprocessor 5771 at the line it has been encountered during the first pass. This could 5772 be used, for example, to provide fallback definitions for constants 5773 without defining xlat tables. 5774 5775 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5776 Dmitry V. Levin <ldv (a] altlinux.org> 5777 5778 loop: mpersify struct loop_info and loop_ioctl function. 5779 struct loop_info contains fields of type long, so it definitely should 5780 have been mpersified. 5781 5782 * defs.h (loop_ioctl): Remove prototype. 5783 * loop.c (struct_loop_info): New typedef. 5784 Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS. 5785 (decode_loop_info): Replace struct loop_info with struct_loop_info. 5786 Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print 5787 them using appropriate format specifiers. 5788 (loop_ioctl): Wrap into MPERS_PRINTER_DECL. 5789 5790 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5791 5792 loop: print lo_device and lo_rdevice fields using print_dev_t. 5793 * loop.c (decode_loop_info, decode_loop_info64): Use print_dev_t 5794 for printing lo_device and lo_rdevice fields. 5795 5796 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5797 Dmitry V. Levin <ldv (a] altlinux.org> 5798 5799 Move device number printing code into a separate routine. 5800 * print_dev_t.c: New file. 5801 * Makefile.am (strace_SOURCES): Add it. 5802 * defs.h (print_dev_t): New prototype. 5803 * dm.c: Do not include <sys/sysmacros.h>. 5804 (dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use 5805 print_dev_t function for printing device numbers. 5806 * mknod.c: Do not include <sys/sysmacros.h>. 5807 (decode_mknod): Use print_dev_t function for printing device number. 5808 * print_struct_stat.c: Do not include <sys/sysmacros.h>. 5809 (print_struct_stat): Use print_dev_t function for printing device 5810 numbers. 5811 5812 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 5813 5814 tests: enhance invalid address decoding check in seccomp-strict.test. 5815 * tests/seccomp-strict.c (main): Change the type of addr variable 5816 containg the invalid address from unsigned long to kernel_ulong_t, 5817 print it using %#llx format. 5818 5819 2016-12-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5820 5821 tests: check decoding of prctl PR_GET_TID_ADDRESS operation. 5822 * tests/prctl-tid_address.c: New file. 5823 * tests/prctl-tid_address.test: New test. 5824 * tests/.gitignore: Add prctl-tid_address. 5825 * tests/Makefile.am (check_PROGRAMS): Likewise. 5826 (DECODER_TESTS): Add prctl-tid_address.test. 5827 5828 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 5829 5830 Update the publicly shown copyright information. 5831 Set the publicly shown copyright holder to "The strace developers.". 5832 5833 * COPYING: Update copyright information. 5834 * configure.ac: Add AC_COPYRIGHT. 5835 * strace.c (print_version): New function. 5836 (init): Use it. 5837 * tests/strace-V.test: Update expected output. 5838 5839 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 5840 5841 configure: specify project URL. 5842 * configure.ac (AC_INIT): Add URL. 5843 5844 2016-12-28 Seraphime Kirkovski <kirkseraph (a] gmail.com> 5845 5846 Document signal injection. 5847 * strace.1: Describe :signal=SIG option of the fault injection syntax. 5848 * NEWS: Mention signal injection. 5849 5850 2016-12-28 Seraphime Kirkovski <kirkseraph (a] gmail.com> 5851 5852 Implement signal injection. 5853 This extends the fault injection capability with :signal=SIG option 5854 which injects a signal on entering each syscall from the specified set. 5855 5856 :signal and :error options are complementary, if they are both specified 5857 the syscall will be fault injected as usual and the specified signal 5858 will be delivered to the tracee. 5859 5860 * defs.h (struct fault_opts): Change the type of err field to int16_t, 5861 add signo field. 5862 (trace_syscall): Add a pointer argument. 5863 * qualify.c: Include "nsig.h". 5864 (parse_fault_token): Handle signal= option. 5865 (qualify_fault): Update default fault_opts. 5866 * strace.c (trace): Forward signal number from trace_syscall 5867 to ptrace_restart(PTRACE_SYSCALL). 5868 * syscall.c (inject_syscall_fault_entering): Add pointer argument, 5869 save there the signal number specified by fault options. Do not inject 5870 a syscall fault unless instructed by fault options. 5871 (update_syscall_fault_exiting): Update the error code injection check. 5872 (trace_syscall_entering): Add pointer argument, forward it to 5873 inject_syscall_fault_entering. 5874 (trace_syscall): Add pointer argument, forward it to 5875 trace_syscall_entering. 5876 5877 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 5878 5879 Update README.md. 5880 * README.md: Update homepage URL, mention command-line interface 5881 and tampering capabilities in the description. 5882 5883 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 5884 5885 tests: robustify prctl-arg2-intptr.test. 5886 Robustify prctl-arg2-intptr.test against unrelated prctl invocations. 5887 5888 * tests/prctl-arg2-intptr.test: Filter out unrelated PR_GET_* 5889 and PR_SET_* prctl calls. 5890 5891 2016-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 5892 5893 signal: remove redundant checks around NSIG. 5894 * signal.c (struct old_sigaction, struct new_sigaction, 5895 struct new_sigaction32): Remove safety checks for NSIG >= sizeof(long). 5896 5897 Introduce NSIG_BYTES. 5898 * nsig.h (NSIG_BYTES): New macro. 5899 * desc.c: Use it in comments instead of NSIG. 5900 * epoll.c: Likewise. 5901 * poll.c: Likewise. 5902 * signalfd.c: Likewise. 5903 * signal.c: Likewise. 5904 (sprintsigmask_n, print_sigset_addr_len_limit): Use it instead of NSIG. 5905 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise. 5906 * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. 5907 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. 5908 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 5909 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. 5910 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 5911 * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. 5912 * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. 5913 * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. 5914 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. 5915 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 5916 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. 5917 * tests/pselect6.c (main): Likewise. 5918 5919 Move NSIG ifdefery to a separate header file. 5920 * nsig.h: New file. 5921 * Makefile.am (strace_SOURCES): Add it. 5922 * signal.c: Include "nsig.h" instead of <signal.h>, remove 5923 NSIG workarounds. 5924 * sigreturn.c: Likewise. 5925 * syscall.c: Likewise. 5926 * tests/pselect6.c: Likewise. 5927 5928 Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro. 5929 * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): New macro. 5930 (truncate_klong_to_current_wordsize, 5931 truncate_kulong_to_current_wordsize): Use it. 5932 * mem.c (SYS_FUNC(old_mmap)): Likewise. 5933 * util.c (umoven, umovestr, dumpiov_upto): Likewise. 5934 * syscall.c (trace_syscall_exiting): Likewise. 5935 5936 Simplify personality checks in msghdr.c and signal.c. 5937 * msghdr.c: Check for [!current_wordsize] instead 5938 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]. 5939 * signal.c: Likewise. 5940 5941 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 5942 5943 Replace widen_to_long with truncate_klong_to_current_wordsize. 5944 * defs.h (widen_to_long): Remove. 5945 (truncate_klong_to_current_wordsize): New static inline function. 5946 * aio.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents): Use it 5947 instead of widen_to_long. 5948 * linux/sparc64/get_syscall_args.c (get_syscall_args): Update comment. 5949 * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise. 5950 5951 Replace widen_to_ulong with truncate_kulong_to_current_wordsize. 5952 * defs.h (widen_to_ulong): Remove. 5953 (truncate_kulong_to_current_wordsize): New static inline function. 5954 * io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong. 5955 5956 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 5957 5958 Simplify print_lld_from_low_high_val ifdefery. 5959 The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler 5960 implementation. 5961 5962 * io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4 5963 && SIZEOF_LONG == SIZEOF_LONG_LONG] 5964 and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases 5965 into a single [SIZEOF_KERNEL_LONG_T > 4] case. 5966 [SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long 5967 instead of zero_extend_signed_to_ull. 5968 5969 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 5970 5971 Simplify getllval ifdefery. 5972 The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler 5973 implementation. 5974 5975 * util.c (getllval): Merge [SIZEOF_LONG > 4 5976 && SIZEOF_LONG == SIZEOF_LONG_LONG] 5977 and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases 5978 into a single [SIZEOF_KERNEL_LONG_T > 4] case. 5979 5980 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5981 5982 prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long. 5983 Since there is no compat handler for x32/n32, kernel returns kernel's 5984 long as a result of the call. 5985 5986 Interesting, does any callee out there actually care to have enough room 5987 allocated for kernel long? 5988 5989 * prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr 5990 to print the value stored at address pointed by addr2 argument 5991 of PR_GET_TID_ADDRESS operation. 5992 5993 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5994 5995 Add functions for printing pointers of kernel_ulong_t size. 5996 In cases where no compat for x32/n32 is implemented, pointer is of 5997 kernel's long size, so it should be printed appropriately. 5998 5999 * defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype. 6000 (printnum_kptr): New macro. 6001 * util.c [!current_klongsize] (printnum_addr_klong_int): New function. 6002 6003 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6004 Dmitry V. Levin <ldv (a] altlinux.org> 6005 6006 Print indirect pointers as pointers. 6007 Originally, printnum_long_int was used, but it prints NULL incorrectly. 6008 6009 * defs.h (DECL_PRINTNUM_ADDR): New macro. 6010 (DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes. 6011 [!current_wordsize] (printnum_addr_long_int): New prototype. 6012 [!current_wordsize] (printnum_ptr): Use it. 6013 [current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64. 6014 [current_wordsize == 4] (printnum_ptr) Use printnum_addr_int. 6015 * util.c (DEF_PRINTNUM_ADDR): New macro. 6016 (DEF_PRINTNUM_ADDR(int, unsigned int), 6017 DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that 6018 provide printnum_addr_int and printnum_addr_int64, accordingly. 6019 [!current_wordsize] (printnum_addr_long_int): New function. 6020 * xet_robust_list.c (sprintaddr): New function. 6021 (main): Use it, update expected output. 6022 * tests/ipc_sem.c (main): Update expected output. 6023 6024 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6025 6026 ipc_sem: print 4th argument of semctl syscall as an address. 6027 * ipc_sem.c (SYS_FUNC(semctl)): Print 4th argument using printaddr. 6028 * tests/ipc_sem.c (cleanup): Update expected output. 6029 6030 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6031 6032 Do not define printnum_long_int on systems with constant current_wordsize 6033 * defs.h: Check [!current_wordsize] instead 6034 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to select 6035 definitions of printnum_slong, printnum_ulong, and printnum_ptr. 6036 * util.c: Check [!current_wordsize] instead 6037 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to decide 6038 whether to compile printnum_long_int. 6039 6040 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6041 6042 umoven: detect invalid addresses. 6043 Do not silently truncate tracee addresses to current_wordsize. 6044 After transition from long to kernel_ulong_t there should be no sign 6045 extension issues with tracee addresses, and invalid addresses should 6046 be printed properly. 6047 6048 * util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead 6049 of [SIZEOF_LONG > 4], reject addresses that do not fit into 6050 current_wordsize. 6051 * tests/umoven-illptr.c: New file. 6052 * tests/umoven-illptr.test: New test. 6053 * tests/.gitignore: Add umoven-illptr. 6054 * tests/Makefile.am (check_PROGRAMS): Likewise. 6055 (DECODER_TESTS): Add umoven-illptr.test. 6056 6057 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6058 6059 umovestr: detect invalid addresses. 6060 Do not silently truncate tracee addresses to current_wordsize. 6061 After transition from long to kernel_ulong_t there should be no sign 6062 extension issues with tracee addresses, and invalid addresses should 6063 be printed properly. 6064 6065 * util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead 6066 of [SIZEOF_LONG > 4], reject addresses that do not fit into 6067 current_wordsize. 6068 * tests/umovestr-illptr.c: New file. 6069 * tests/umovestr-illptr.test: New test. 6070 * tests/.gitignore: Add umovestr-illptr. 6071 * tests/Makefile.am (check_PROGRAMS): Likewise. 6072 (DECODER_TESTS): Add umovestr-illptr.test. 6073 6074 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6075 6076 lseek: simplify _llseek syscall decoder. 6077 After transition from long to kernel_ulong_t the implementation 6078 could be made a bit simpler. 6079 6080 * lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead 6081 of zero_extend_signed_to_ull. 6082 6083 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6084 6085 lseek: merge two different implementations of lseek syscall decoder. 6086 After transition from long to kernel_ulong_t there are no mo 6087 complications that required to keep a separate implementation 6088 for x32 and mips n32. 6089 6090 * lseek.c (SYS_FUNC(lseek)): Merge two different implementations 6091 into a single one. 6092 6093 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6094 6095 Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval. 6096 After transition from long to kernel_ulong_t these fields 6097 are no longer needed. 6098 6099 * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove. 6100 (struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 6101 [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 6102 (RVAL_MASK): Update. 6103 * io.c (print_lld_from_low_high_val): Check 6104 [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 6105 instead of [HAVE_STRUCT_TCB_EXT_ARG]. 6106 Use u_arg instead of ext_arg. 6107 * linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove. 6108 * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]: 6109 Remove. 6110 [LINUX_MIPSN64]: Extend to [LINUX_MIPSN32]. 6111 * linux/x86_64/get_error.c (get_error) [X32]: Remove. 6112 * linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove. 6113 * lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 6114 instead of [HAVE_STRUCT_TCB_EXT_ARG]. 6115 [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg 6116 instead of ext_arg. Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL. 6117 * mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly 6118 to print_mmap. 6119 * syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 6120 * times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead 6121 of RVAL_LUDECIMAL. 6122 * util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 6123 instead of [HAVE_STRUCT_TCB_EXT_ARG]. Use u_arg instead of ext_arg. 6124 6125 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6126 6127 Remove getarg_klu. 6128 After transition from long to kernel_ulong_t we no longer need 6129 tcp->ext_arg, and therefore a function to access it is also no longer 6130 needed. 6131 6132 * defs.h (getarg_klu): Remove prototype. 6133 * util.c (getarg_klu): Remove. 6134 (printargs): Access tcp->u_arg directly 6135 * bjm.c (SYS_FUNC(init_module)): Likewise. 6136 * clone.c (SYS_FUNC(unshare)): Likewise. 6137 * fadvise.c (SYS_FUNC(fadvise64)): Likewise. 6138 * kcmp.c (SYS_FUNC(kcmp)): Likewise. 6139 * kexec.c (SYS_FUNC(kexec_file_load)): Likewise. 6140 * keyctl.c (SYS_FUNC(keyctl)): Likewise. 6141 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. 6142 * mem.c (do_mprotect): Likewise. 6143 * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. 6144 * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. 6145 * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): 6146 Likewise. 6147 6148 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6149 6150 Remove printaddr_klu. 6151 After transition from long to kernel_ulong_t we no longer need 6152 two versions of printaddr function. 6153 6154 * defs.h (printaddr): Remove. 6155 (printaddr_klu): Rename to printaddr. 6156 * util.c (printaddr_klu): Likewise. 6157 * bjm.c (SYS_FUNC(init_module)): Replace printaddr_klu with printaddr. 6158 * mem.c (do_mprotect): Likewise. 6159 6160 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6161 6162 tests: check decoding of a subset of prctl operations. 6163 Check decoding of prctl operations that take the second syscall argument 6164 as a pointer to an integer. 6165 6166 * tests/prctl-arg2-intptr.c: New file. 6167 * tests/prctl-arg2-intptr.test: New test. 6168 * tests/.gitignore: Add prctl-arg2-intptr. 6169 * tests/Makefile.am (check_PROGRAMS): Likewise. 6170 (DECODER_TESTS): Add prctl-arg2-intptr.test. 6171 6172 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6173 6174 Automatically replace PRI_kr[dux] with PRI_kl[dux] 6175 Remove temporary macros created for transition from long 6176 to kernel_ulong_t. 6177 6178 Automatically replace PRI_kr[dux] with PRI_kl[dux] using 6179 $ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g' 6180 6181 * defs.h (PRI_krd, PRI_kru, PRI_krx): Remove. All users updated. 6182 6183 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6184 6185 Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t. 6186 Remove temporary types created for transition from long 6187 to kernel_ulong_t. 6188 6189 Automatically replace kernel_scno_t and kernel_ureg_t with 6190 kernel_ulong_t using 6191 $ git grep -El 'kernel_(scno|ureg)_t' | 6192 xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g' 6193 6194 * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove. 6195 All users updated. 6196 6197 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6198 6199 Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t 6200 * defs.h (struct tcb): Change u_rval type from long to kernel_long_t. 6201 (PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx. 6202 * kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect 6203 to kernel_ulong_t. 6204 6205 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6206 6207 Print kernel_ureg_t and kernel_scno_t using dedicated format strings. 6208 Prepare for the change of kernel_ureg_t and kernel_scno_t from 6209 unsigned long to kernel_ulong_t. 6210 6211 * defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros. 6212 All users updated. 6213 6214 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6215 6216 vm_read_mem: detect address truncation. 6217 When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed 6218 to vm_read_mem could be silently truncated. Detect this situation 6219 and return EIO when the tracee address does not fit into unsigned long. 6220 6221 * util.c (vm_read_mem): Save raddr argument into a temporary variable 6222 truncated_raddr of type unsigned long. Set errno to EIO and return -1 6223 when truncated_raddr does not equal to raddr. 6224 6225 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6226 6227 trace_syscall_exiting: prepare personality check for u_rval type change. 6228 * syscall.c (trace_syscall_exiting): Check for sizeof(tcp->u_rval) 6229 instead of sizeof(long) when deciding how to print tcp->u_rval. 6230 6231 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6232 6233 Use ptr_to_kulong instead of explicit casts of pointers to kernel_ureg_t 6234 Direct casts to kernel_ureg_t will not work after the change 6235 of kernel_ureg_t from unsigned long to kernel_ulong_t. 6236 6237 * defs.h (ptr_to_kulong): New macro. 6238 * block.c (print_blkpg_req): Use it instead of explicit casts 6239 to kernel_ureg_t. 6240 * btrfs.c (btrfs_ioctl): Likewise. 6241 * evdev.c (ff_effect_ioctl): Likewise. 6242 * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. 6243 * msghdr.c (print_struct_msghdr, dumpiov_in_msghdr): Likewise. 6244 * mtd.c (decode_mtd_oob_buf): Likewise. 6245 * printsiginfo.c (printsigval, print_si_info): Likewise. 6246 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Likewise. 6247 * sigaltstack.c (print_stack_t): Likewise. 6248 * sock.c (decode_ifconf): Likewise. 6249 * sysctl.c (SYS_FUNC(sysctl)): Likewise. 6250 * util.c (dumpiov_upto): Likewise. 6251 * v4l2.c (print_v4l2_framebuffer, print_v4l2_ext_control, 6252 print_v4l2_ext_controls): Likewise. 6253 6254 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 6255 6256 umove*: remove redundant casts. 6257 * util.c (umoven, umovestr): Remove casts from unsigned long to pointer. 6258 6259 upoke: remove redundant casts. 6260 * upoke.c (upoke): Remove casts from unsigned long to pointer. 6261 6262 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6263 6264 signal: cleanup decoding of sa_handler and sa_restorer. 6265 Change type of sa_handler and sa_restorer fields from function pointers 6266 to unsigned long. This saves the code from a lot of casts between 6267 pointers and integers. 6268 6269 Rename __sa_handler to sa_handler__ as names starting with underscore 6270 symbol are reserved and should not be used. 6271 6272 * signal.c (old_sigaction): Rename __sa_handler to sa_handler__, 6273 all users updated. Change the type of sa_handler__ and sa_restorer 6274 from pointer to unsigned long. 6275 (old_sigaction32): Rename __sa_handler to sa_handler__, all users 6276 updated. 6277 (decode_old_sigaction): Remove now redundant casts from 6278 old_sigaction32.sa_handler__ to old_sigaction.sa_handler__, 6279 from old_sigaction32.sa_restorer to old_sigaction.sa_restorer, 6280 and from old_sigaction.sa_handler__ to unsigned long. Print 6281 old_sigaction.sa_restorer using printaddr. 6282 * signal.c (new_sigaction): Rename __sa_handler to sa_handler__, 6283 all users updated. Change the type of sa_handler__ and sa_restorer 6284 from pointer to unsigned long. 6285 (new_sigaction32): Rename __sa_handler to sa_handler__, all users 6286 updated. 6287 (decode_new_sigaction): Remove now redundant casts from 6288 new_sigaction32.sa_handler__ to new_sigaction.sa_handler__, 6289 from new_sigaction32.sa_restorer to new_sigaction.sa_restorer, 6290 and from new_sigaction.sa_handler__ to unsigned long. Print 6291 new_sigaction.sa_restorer using printaddr. 6292 6293 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6294 6295 signal: change signal handler address type from unsigned long to kernel_ureg_t 6296 * signal.c (get_sa_handler_str, print_sa_handler): Change handler type 6297 from unsigned long to kernel_ureg_t. 6298 6299 quota: change address argument type from unsigned long to kernel_ureg_t. 6300 * quota.c (decode_cmd_data): Change the type of data argument 6301 from unsigned long to kernel_ureg_t. 6302 6303 execve: prepare for handling big pointers. 6304 * execve.c (printargv): Change cp.p64 type from unsigned long 6305 to kernel_ulong_t so it could handle wordsize > sizeof(long) properly. 6306 6307 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6308 6309 clone: print clone flags without truncation. 6310 The flags argument is defined in kernel as unsigned long, 6311 so change its decoding to avoid truncation. 6312 6313 * clone.c (SYS_FUNC(clone)): Change flags type from unsigned long 6314 to kernel_ureg_t, print it using printflags64 instead of printflags. 6315 6316 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6317 6318 Use printxval64 instead of printxval_long. 6319 After the change of tcb.u_arg type from long to kernel_ureg_t it is safe 6320 to stop using printxval_long proxy and pass syscall arguments directly 6321 to printxval64. 6322 6323 * defs.h (printxval_long): Remove. 6324 * fcntl.c (print_fcntl): Replace printxval_long with printxval64. 6325 * mtd.c (mtd_ioctl): Likewise. 6326 * numa.c (SYS_FUNC(mbind)): Likewise. 6327 * or1k_atomic.c [OR1K] (SYS_FUNC(or1k_atomic)): Likewise. 6328 * sysmips.c [MIPS] (SYS_FUNC(sysmips)): Likewise. 6329 * term.c (term_ioctl): Likewise. 6330 6331 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6332 6333 Use printflags64 instead of printflags_long. 6334 After the change of tcb.u_arg type from long to kernel_ureg_t it is safe 6335 to stop using printflags_long proxy and pass syscall arguments directly 6336 to printflags64. 6337 6338 * defs.h (printflags_long): Remove. 6339 * fcntl.c (print_fcntl): Replace printflags_long with printflags64. 6340 * numa.c (SYS_FUNC(get_mempolicy)): Likewise. 6341 * perf.c (SYS_FUNC(perf_event_open)): Likewise. 6342 * sram_alloc.c [BFIN] (SYS_FUNC(sram_alloc)): Likewise. 6343 6344 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6345 6346 upeek, upoke: change argument types from long to unsigned long. 6347 * defs.h (upeek, upoke): Change offset argument type from long 6348 to unsigned long. Change res argument type from long to kernel_ureg_t. 6349 * upeek.c (upeek): Likewise. 6350 * upoke.c (upoke.c): Likewise. 6351 * syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long 6352 to kernel_ureg_t. 6353 * linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast. 6354 * linux/metag/get_syscall_args.c (get_syscall_args): Likewise. 6355 * linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise. 6356 * linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise. 6357 * linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts. 6358 * linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long 6359 to unsigned long. 6360 * linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long 6361 to unsigned long. 6362 * linux/bfin/arch_regs.c (bfin_r0): Likewise. 6363 * linux/crisv10/arch_regs.c (cris_r10): Likewise. 6364 * linux/hppa/arch_regs.c (hppa_r28): Likewise. 6365 * linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise. 6366 * linux/microblaze/arch_regs.c (microblaze_r3): Likewise. 6367 * linux/sh/arch_regs.c (sh_r0): Likewise. 6368 * linux/sh64/arch_regs.c (sh64_r9): Likewise. 6369 * linux/xtensa/arch_regs.c (xtensa_a2): Likewise. 6370 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type 6371 from long to unsigned long. 6372 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 6373 * linux/alpha/get_scno.c (arch_get_scno): Update for the change 6374 of signedness. 6375 * linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type 6376 from pointer to long to pointer to unsigned long. 6377 * linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long 6378 to pointer to unsigned long. 6379 * linux/arm/arch_regs.h (arm_sp_ptr): Likewise. 6380 * linux/i386/arch_regs.c (i386_esp_ptr): Likewise. 6381 * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. 6382 * linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise. 6383 * linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise. 6384 * linux/ia64/get_syscall_args.c (get_syscall_args): Use umove 6385 instead of umoven. 6386 * linux/sh/arch_getrval2.c (getrval2): Change val type from long 6387 to unsigned long. 6388 6389 arch_sigreturn: change tracee address type from long to unsigned long. 6390 * linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable 6391 type from long to unsigned long. 6392 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 6393 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. 6394 * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. 6395 * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. 6396 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. 6397 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 6398 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type 6399 of addr and regs variables from long to unsigned long. 6400 * linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable 6401 type from long to kernel_ureg_t. 6402 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type 6403 of offset and addr variables from long to kernel_ureg_t. 6404 6405 kexec: change flags type from unsigned long to kernel_ureg_t. 6406 * kexec.c (SYS_FUNC(kexec_load)): Change n variable type 6407 from unsigned long to kernel_ureg_t. Use printxval64 instead 6408 of printxval_long. Use printflags64 instead of printflags_long. 6409 6410 kexec: change types of pointers and sizes to kernel_ureg_t. 6411 * kexec.c (print_seg): Change the type of *seg and seg_buf variables 6412 from unsigned long to kernel_ureg_t. 6413 (print_kexec_segments): Change len argument type from unsigned long 6414 to kernel_ureg_t. Change seg variable type from unsigned long 6415 to kernel_ureg_t. 6416 6417 printsiginfo: change len argument type from unsigned long to kernel_ureg_t 6418 * printsiginfo.c (print_siginfo_array): Change len argument type 6419 from unsigned long to kernel_ureg_t. 6420 6421 signal: change address argument type from unsigned long to kernel_ureg_t 6422 * signal.c (print_sigqueueinfo): Change address argument type 6423 from unsigned long to kernel_ureg_t. 6424 6425 statfs64: change size argument type from unsigned long to kernel_ureg_t. 6426 * defs.h (print_struct_statfs64): Change size argument type 6427 from unsigned long to kernel_ureg_t. 6428 * print_statfs.c (print_struct_statfs64): Likewise. 6429 * fetch_struct_statfs.c (fetch_struct_statfs64): Likewise. 6430 * fstatfs64.c (SYS_FUNC(fstatfs64)): Pass size argument directly 6431 to print_struct_statfs64. 6432 * statfs64.c (SYS_FUNC(statfs64)): Likewise. 6433 6434 Cast tcp->u_rval to kernel_ureg_t instead of unsigned long. 6435 * fcntl.c (print_fcntl): Cast tcp->u_rval to kernel_ureg_t instead 6436 of unsigned long. 6437 * membarrier.c (SYS_FUNC(membarrier)): Likewise. 6438 * prctl.c (SYS_FUNC(prctl)): Likewise. 6439 * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. 6440 * time.c (do_adjtimex): Likewise. 6441 6442 decode_sockbuf: change addrlen argument type from long to kernel_ureg_t. 6443 * net.c (decode_sockbuf): Change addrlen argument type from long 6444 to kernel_ureg_t. 6445 6446 netlink: change size types from unsigned long to kernel_ureg_t. 6447 * defs.h (decode_netlink): Change len argument type from unsigned long 6448 to kernel_ureg_t. 6449 * netlink.c (fetch_nlmsghdr): Likewise. 6450 (decode_nlmsghdr_with_payload): Likewise. Change nlmsg_len variable 6451 type from unsigned long to unsigned int. 6452 (decode_netlink): Change the type of len argument and next_len variable 6453 from unsigned long to kernel_ureg_t. Change nlmsg_len variable type 6454 from unsigned long to unsigned int. 6455 6456 ipc_msg: change size types from unsigned long to kernel_ureg_t. 6457 * ipc_msg.c (tprint_msgsnd): Change count argument type 6458 from unsigned long to kernel_ureg_t. Change flags argument type 6459 from unsigned long to unsigned int. 6460 (tprint_msgrcv): Change the type of count and msgtyp arguments 6461 from unsigned long to kernel_ureg_t. 6462 (fetch_msgrcv_args): Change *pair type from unsigned long 6463 to kernel_ureg_t. 6464 (SYS_FUNC(msgrcv)): Change pair type from unsigned long 6465 to kernel_ureg_t. 6466 * print_msgbuf.c (tprint_msgbuf): Change count argument type 6467 from unsigned long to kernel_ureg_t. 6468 6469 dumpiov_upto: change size types from unsigned long to kernel_ureg_t. 6470 * defs.h (dumpiov_upto): Change data_size argument type 6471 from unsigned long to kernel_ureg_t. 6472 * util.c (dumpiov_upto): Change the type of data_size argument 6473 and iov_len variable from unsigned long to kernel_ureg_t. 6474 6475 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6476 6477 msghdr: change cmsghdr size types from size_t to unsigned int. 6478 As the kernel does not accept control messages longer than the value 6479 of int sysctl_optmem_max kernel variable exported as 6480 /proc/sys/net/core/optmem_max, we do not print them either. 6481 6482 Since unsigned int has enough room to contain any valid control message 6483 size, change all internal cmsghdr size types from size_t 6484 to unsigned int. 6485 6486 * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, 6487 print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t, 6488 print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr, 6489 cmsg_printer, print_cmsg_type_data): Change data_len argument type 6490 from size_t to unsigned int. 6491 (cmsg_socket_printers): Change min_len type from size_t to unsigned int. 6492 (decode_msg_control): Change the type of in_control_len argument, 6493 cmsg_len, and len variables from size_t to kernel_ureg_t. 6494 Change the type of cmsg_size, control_len, and buf_len variables 6495 from size_t to unsigned int. 6496 6497 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6498 6499 msghdr: change register based size types from unsigned long to kernel_ureg_t 6500 * defs.h (dumpiov_in_msghdr): Change data_size argument type 6501 from unsigned long to kernel_ureg_t. 6502 * msghdr.h (print_struct_msghdr): Likewise. 6503 * msghdr.c (print_struct_msghdr): Likewise. Cast msghdr.msg_iovlen 6504 and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long. 6505 (decode_msghdr, dumpiov_in_msghdr): Change data_size argument type 6506 from unsigned long to kernel_ureg_t. 6507 (SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument 6508 to decode_msghdr. 6509 * mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead 6510 of -1UL as data_size argument to print_struct_msghdr. 6511 (dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead 6512 of unsigned long. 6513 * syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument 6514 to dumpiov_in_msghdr 6515 6516 mq: remove redundant u_rval check. 6517 * mq.c (SYS_FUNC(mq_timedreceive)): Do not check for tcp->u_rval < 0, 6518 syserror(tcp) is enough, and printstrn can handle len < 0 anyway. 6519 6520 io: change size types from unsigned long to kernel_ureg_t. 6521 * defs.h (tprint_iov_upto): Change the type of len and data_size 6522 arguments from unsigned long to kernel_ureg_t. 6523 (tprint_iov): Change the type of len argument from unsigned long 6524 to kernel_ureg_t. 6525 * io.c (print_iovec_config): Change data_size type from unsigned long 6526 to kernel_ureg_t. 6527 (print_iovec): Change the type of *iov, iov_buf, and len variables 6528 from unsigned long to kernel_ureg_t. 6529 (tprint_iov_upto): Change the type of len and data_size arguments, and 6530 the type of iov variable from unsigned long to kernel_ureg_t. 6531 6532 mount: change flags type from unsigned long to kernel_ureg_t. 6533 * mount.c (SYS_FUNC(mount)): Change the type of flags from unsigned long 6534 to kernel_ureg_t, use printflags64 instead of printflags_long 6535 to print it. 6536 6537 mem: change mmap arguments type from unsigned long to kernel_ureg_t. 6538 * mem.c (print_mmap): Change the type of len, prot, and flags 6539 from unsigned long to kernel_ureg_t. Use printflags64 instead 6540 of printflags_long. Use printxval64 instead of printxval_long. 6541 (SYS_FUNC(old_mmap)): Check for current_klongsize instead 6542 of [AARCH64 || X86_64] to take X32 into account. 6543 (SYS_FUNC(mremap)): Use printflags64 instead of printflags_long. 6544 (SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and 6545 flags from unsigned long to kernel_ureg_t. Use printflags64 instead 6546 of printflags_long. Use printxval64 instead of printxval_long. 6547 [POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb 6548 from unsigned long to kernel_ureg_t. 6549 6550 numa: change size arguments type from unsigned long to kernel_ureg_t. 6551 * numa.c (print_node, print_addr): Add kernel_ureg_t support. 6552 (print_nodemask): Change type of maxnodes argument from unsigned long 6553 to kernel_ureg_t. 6554 (SYS_FUNC(move_pages)): Change npages type from unsigned long 6555 to kernel_ureg_t. Change buf type from long to kernel_ureg_t. 6556 6557 print_sigset_addr_len: change len argument type from long to kernel_ureg_t 6558 * defs.h (print_sigset_addr_len): Change len argument type from long 6559 to kernel_ureg_t. 6560 * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise. 6561 6562 process_vm: change size arguments type from unsigned long to kernel_ureg_t 6563 * process_vm.c (SYS_FUNC(process_vm_readv), 6564 SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt, 6565 remote_iovcnt, and flags from unsigned long to kernel_ureg_t. 6566 6567 printstr*: change len argument type from long to kernel_ureg_t. 6568 * defs.h (printstr_ex, printstrn): Change len argument type from long 6569 to kernel_ureg_t. 6570 * util.c (printstr_ex): Likewise. 6571 6572 xattr: change size arguments type from unsigned long to kernel_ureg_t. 6573 * xattr.c (print_xattr_val): Change type of insize and size arguments 6574 from unsigned long to kernel_ureg_t. 6575 (print_xattr_list): Change type of size argument from unsigned long 6576 to kernel_ureg_t. 6577 6578 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6579 6580 printstr_ex: fix decoding of non-NUL-terminated strings when len == -1. 6581 Do not treat len == -1 in any special way. All users who need the 6582 string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED 6583 bit in user_style flags already. 6584 6585 * util.c (printstr_ex): Remove (len == -1) check. 6586 * tests/printstr.c: New file. 6587 * tests/printstr.test: New test. 6588 * tests/.gitignore: Add printstr. 6589 * tests/Makefile.am (check_PROGRAMS): Likewise. 6590 (DECODER_TESTS): Add printstr.test. 6591 6592 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6593 6594 Fix decoding of sethostname syscall. 6595 The second argument of sethostname syscall is not an unsigned long but 6596 unsigned int. The kernel does not look at the string argument when 6597 the length argument is too long. 6598 6599 * hostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>. 6600 [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. 6601 (SYS_FUNC(sethostname)): Treat the second argument as unsigned int. 6602 Print the first argument as a pointer when the second argument exceeds 6603 __NEW_UTS_LEN. 6604 * tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>. 6605 [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. 6606 (main): Use it. Check that the second argument of sethostname 6607 is handled as unsigned int. Check that the first argument is printed 6608 as a pointer when the second argument exceeds __NEW_UTS_LEN. 6609 6610 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6611 6612 tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h. 6613 * tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros. 6614 (f8ill_ptr_to_kulong): New static inline function. 6615 6616 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6617 6618 printstr: rename to printstrn, add printstr as a thin wrapper. 6619 As about half of all printstr uses cases are invocations with the last 6620 argument set to -1, create a dedicated function for this use case. 6621 6622 * defs.h (printstr): Rename to printstrn. All callers updated. 6623 (printstr): New static inline function. All callers updated. 6624 6625 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 6626 6627 process: change ptrace arguments type from unsigned long to kernel_ureg_t 6628 (SYS_FUNC(ptrace)): Change type of request and data arguments 6629 from unsigned long to kernel_ureg_t. 6630 6631 process: change tracee address type from unsigned long to kernel_ureg_t. 6632 * process.c (print_user_offset_addr): Change address argument type 6633 from unsigned long to kernel_ureg_t. 6634 (SYS_FUNC(ptrace)): Change addr variable type from unsigned long 6635 to kernel_ureg_t. 6636 6637 net: change address argument type from long to kernel_ureg_t. 6638 * net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred, 6639 print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq, 6640 print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq, 6641 print_setsockopt): Change address argument type from long 6642 to kernel_ureg_t. 6643 6644 print_mq_attr: change address argument type from long to kernel_ureg_t. 6645 * print_mq_attr.c (printmqattr): Change address argument type from long 6646 to kernel_ureg_t. 6647 6648 ipc_*: change address argument type from long to kernel_ureg_t. 6649 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change 6650 address argument type from long to kernel_ureg_t. 6651 * ipc_msgctl.c (print_msqid_ds): Likewise. 6652 * ipc_sem.c (tprint_sembuf_array): Likewise. 6653 * ipc_shmctl.c (print_shmid_ds): Likewise. 6654 6655 print_msgbuf: change address argument type from long to kernel_ureg_t. 6656 * print_msgbuf.c (tprint_msgbuf): Change address argument type 6657 from long to kernel_ureg_t. 6658 6659 desc: change tracee address type from long to kernel_ureg_t. 6660 * desc.c (decode_select): Rename arg to addr, change its type 6661 from long to kernel_ureg_t. 6662 6663 uid: change address argument type from long to kernel_ureg_t. 6664 * uid.c (get_print_uid): Change address argument type 6665 from long to kernel_ureg_t. 6666 6667 time: change address argument type from long to kernel_ureg_t. 6668 * time.c (print_timezone, do_adjtimex): Change address argument type 6669 from long to kernel_ureg_t. 6670 6671 sched: change address argument type from long to kernel_ureg_t. 6672 * sched.c (print_sched_attr): Change address argument type 6673 from long to kernel_ureg_t. 6674 6675 printsiginfo: change address argument type from long to kernel_ureg_t. 6676 * printsiginfo.c (printsiginfo_at): Change address argument type 6677 from long to kernel_ureg_t. 6678 6679 print_timex: change address argument type from long to kernel_ureg_t. 6680 * print_timex.c (print_timex): Change address argument type 6681 from long to kernel_ureg_t. 6682 6683 print_sigevent: change address argument type from long to kernel_ureg_t. 6684 * print_sigevent.c (print_sigevent): Change address argument type 6685 from long to kernel_ureg_t. 6686 6687 poll: change address argument type from long to kernel_ureg_t. 6688 * poll.c (decode_poll_exiting): Change tracee address argument type 6689 from long to kernel_ureg_t. 6690 6691 printrusage*: change tracee address argument type from long to kernel_ureg_t 6692 * defs.h [ALPHA] (printrusage32): Change address argument type 6693 from long to kernel_ureg_t. 6694 * printrusage.c (printrusage): Likewise. 6695 [ALPHA] (printrusage32): Likewise. 6696 * wait.c (printwaitn): Change the type of tracee address argument 6697 of print_rusage from long to kernel_ureg_t. 6698 6699 print_time*: change tracee address argument type from long to kernel_ureg_t 6700 * defs.h [ALPHA] (sprint_timeval32, print_timeval32, 6701 print_timeval32_pair, print_itimerval32): Change address argument type 6702 from long to kernel_ureg_t. 6703 * desc.c (decode_select): Change the type of tracee address argument 6704 of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t. 6705 * print_timespec.c (print_timespec, sprint_timespec, 6706 print_timespec_utime_pair, print_itimerspec): Change address argument 6707 type from long to kernel_ureg_t. 6708 * print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval, 6709 print_itimerval, print_timeval32, print_timeval32_pair, 6710 print_itimerval32, sprint_timeval32): Likewise. 6711 6712 rtc: change type of ioctl 3rd argument from long to kernel_ureg_t. 6713 * rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info): 6714 Change addr type from long to kernel_ureg_t. 6715 (rtc_ioctl): Change arg type from long to kernel_ureg_t. 6716 6717 mtd: change type of ioctl 3rd argument from long to kernel_ureg_t. 6718 * mtd.c (decode_erase_info_user, decode_erase_info_user64, 6719 decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info, 6720 decode_otp_select, decode_mtd_write_req, decode_mtd_info_user, 6721 decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats): 6722 Change addr type from long to kernel_ureg_t. 6723 (mtd_ioctl): Change arg type from long to kernel_ureg_t. 6724 6725 hdio: change type of ioctl 3rd argument from long to kernel_ureg_t. 6726 * hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t. 6727 6728 v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t. 6729 * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format, 6730 print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer, 6731 print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard, 6732 print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl, 6733 print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls, 6734 print_v4l2_frmsizeenum, print_v4l2_frmivalenum, 6735 print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long 6736 to kernel_ureg_t. 6737 6738 evdev: change type of ioctl 3rd argument from long to kernel_ureg_t. 6739 * evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl, 6740 getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl, 6741 evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type 6742 from long to kernel_ureg_t. 6743 6744 btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t. 6745 * btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long 6746 to kernel_ureg_t. 6747 6748 block: change type of ioctl 3rd argument from long to kernel_ureg_t. 6749 * block.c (block_ioctl): Change arg type from long to kernel_ureg_t. 6750 6751 Change type of ioctl 3rd argument from long to kernel_ureg_t. 6752 * defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t. 6753 * dm.c (dm_known_ioctl, dm_ioctl): Likewise. 6754 * file_ioctl.c (file_ioctl): Likewise. 6755 * fs_x_ioctl.c (fs_x_ioctl): Likewise. 6756 * ioctl.c (ioctl_decode): Likewise. 6757 * loop.c (decode_loop_info, decode_loop_info64): Change addr type 6758 from long to kernel_ureg_t. 6759 (loop_ioctl): Change arg type from long to kernel_ureg_t. 6760 * ptp.c (ptp_ioctl): Likewise. 6761 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 6762 print_sg_io_v4_res, scsi_ioctl): Likewise. 6763 * sock.c (print_ifreq, sock_ioctl): Likewise. 6764 (decode_ifconf): Change addr type from long to kernel_ureg_t. 6765 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 6766 decode_modem_flags): Likewise. 6767 (term_ioctl): Change arg type from long to kernel_ureg_t. 6768 * ubi.c (ubi_ioctl): Likewise. 6769 * userfaultfd.c (uffdio_ioctl): Likewise. 6770 6771 ldt: change address argument type from long to kernel_ureg_t. 6772 * defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address 6773 argument type from long to kernel_ureg_t. 6774 * ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise. 6775 6776 fcntl: change address argument type from long to kernel_ureg_t. 6777 * fcntl.c (printflock64, printflock, print_f_owner_ex): Change 6778 address argument type from long to kernel_ureg_t. 6779 6780 execve: change address argument type from long to kernel_ureg_t. 6781 * execve.c (printargv, printargc): Change address argument type 6782 from long to kernel_ureg_t. 6783 6784 dirent: change address argument type from long to kernel_ureg_t. 6785 * dirent.c (print_old_dirent): Change address argument type from long 6786 to kernel_ureg_t. 6787 6788 bpf: change address argument type from long to kernel_ureg_t. 6789 * bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem, 6790 bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument 6791 type from long to kernel_ureg_t. 6792 6793 dump*: change address argument type from long to kernel_ureg_t. 6794 * defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr): 6795 Change address argument type from long to kernel_ureg_t. 6796 * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. 6797 * msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr): 6798 Likewise. 6799 * util.c (dumpiov_upto, dumpstr): Likewise. 6800 6801 print_sigset_addr_len: change address argument type from long to kernel_ureg_t 6802 * defs.h (print_sigset_addr_len) Change address argument type from long 6803 to kernel_ureg_t. 6804 * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len, 6805 decode_old_sigaction, decode_new_sigaction): Likewise. 6806 6807 decode_sockaddr: change address argument type from long to kernel_ureg_t 6808 * defs.h (decode_sockaddr) Change tracee address argument type from long 6809 to kernel_ureg_t. 6810 * sockaddr.c (decode_sockaddr): Likewise. 6811 6812 print_struct_statfs*: change address argument type from long to kernel_ureg_t 6813 * defs.h (print_struct_statfs, print_struct_statfs64): Change address 6814 argument type from long to kernel_ureg_t. 6815 * print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise. 6816 * fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64): 6817 Likewise. 6818 6819 fetch_struct_flock: change address argument type from long to kernel_ureg_t 6820 * fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64): 6821 Change address argument type from long to kernel_ureg_t. 6822 6823 fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t 6824 * fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument 6825 type from long to kernel_ureg_t. 6826 6827 printnum_*, printpair_*: change address argument type from long to kernel_ureg_t 6828 * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change 6829 address argument type from long to kernel_ureg_t. 6830 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. 6831 6832 printpath*: change address argument type from long to kernel_ureg_t. 6833 * defs.h (printpath, printpathn): Change address argument type 6834 from long to kernel_ureg_t. 6835 * util.c (printpath, printpathn): Likewise. 6836 6837 printstr*: change address argument type from long to kernel_ureg_t. 6838 * defs.h (printstr_ex, printstr_ex): Change address argument type 6839 from long to kernel_ureg_t. 6840 * util.c (printstr_ex): Likewise. 6841 6842 umove*: change tracee address argument type from long to kernel_ureg_t. 6843 * defs.h (umovestr, umoven, umoven_or_printaddr, 6844 umoven_or_printaddr_ignore_syserror): Change tracee address argument 6845 type from long to kernel_ureg_t. 6846 (print_array): Change the type of tracee address argument of umoven_func 6847 from long to kernel_ureg_t. 6848 * util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr, 6849 umoven_or_printaddr_ignore_syserror): Change tracee address argument 6850 type from long to kernel_ureg_t. 6851 (print_array): Change the type of tracee address argument of umoven_func 6852 from long to kernel_ureg_t. 6853 * desc.c (umove_kulong_array_or_printaddr): Change tracee address 6854 argument type from long to kernel_ureg_t. 6855 * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise. 6856 6857 futex: change address type from long to kernel_ureg_t. 6858 * futex.c (SYS_FUNC(futex)): Change address type from long 6859 to kernel_ureg_t. 6860 6861 file_handle: change address type from long to kernel_ureg_t. 6862 * file_handle.c (SYS_FUNC(name_to_handle_at), 6863 SYS_FUNC(open_by_handle_at)): Change address type from long 6864 to kernel_ureg_t. 6865 6866 printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long. 6867 * printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer 6868 to kernel_ureg_t instead of unsigned long. 6869 (print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers 6870 to kernel_ureg_t instead of unsigned long. 6871 6872 sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long 6873 * sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer 6874 and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long. 6875 6876 v4l2: cast pointers to kernel_ureg_t instead of long. 6877 * v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer 6878 to kernel_ureg_t instead of long. 6879 6880 v4l2: cast pointers to kernel_ureg_t instead of unsigned long. 6881 * v4l2.c (print_v4l2_buffer): Remove redundant cast. 6882 (print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer 6883 to kernel_ureg_t instead of unsigned long. 6884 (print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer 6885 to kernel_ureg_t instead of unsigned long. 6886 6887 2016-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 6888 6889 sysctl: cast pointers to kernel_ureg_t instead of size_t. 6890 * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and 6891 __sysctl_args.newval pointers to kernel_ureg_t instead of size_t. 6892 6893 sysctl: cast pointers to kernel_ureg_t instead of long. 6894 * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer 6895 to kernel_ureg_t instead of long. 6896 6897 block: cast pointers to kernel_ureg_t instead of long. 6898 * block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer 6899 to kernel_ureg_t instead of long. 6900 6901 dumpiov_upto: cast pointers to kernel_ureg_t instead of long. 6902 * util.c (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t 6903 instead of long. 6904 6905 msghdr: cast pointers to kernel_ureg_t instead of long. 6906 * msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer 6907 to kernel_ureg_t instead of long. 6908 (dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t 6909 instead of long. 6910 6911 mmsghdr: cast pointers to kernel_ureg_t instead of long. 6912 * mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer 6913 to kernel_ureg_t instead of long. 6914 6915 Remove redundant casts of ptrace arguments. 6916 * strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument 6917 from pointer to long type. 6918 6919 ptrace_restart: cleanup. 6920 * strace.c (ptrace_restart): Replace the sequence of "if" statements 6921 with a "switch" statement. 6922 6923 ptrace_restart: change types of integer arguments to unsigned. 6924 * strace.c (ptrace_restart): Change types of "op" and "sig" 6925 from int to unsigned int. 6926 6927 process: remove redundant syserror checks. 6928 * process.c (SYS_FUNC(ptrace)): Remove syserror checks as both 6929 print_siginfo_array and print_seccomp_fprog do the right thing 6930 by using umoven_or_printaddr. 6931 6932 sparc64: remove redundant casts. 6933 * linux/sparc64/get_syscall_args.c (get_syscall_args): Remove 6934 redundant casts from uint32_t to long. 6935 6936 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 6937 6938 numa: change address argument type from unsigned long to kernel_ureg_t. 6939 * numa.c (print_nodemask): Change address argument type from 6940 unsigned long to kernel_ureg_t. 6941 6942 net: change address argument type from unsigned long to kernel_ureg_t. 6943 * net.c (fetch_socklen): Change address argument type from 6944 unsigned long to kernel_ureg_t. 6945 6946 mem: change tracee address type from unsigned long to kernel_ureg_t. 6947 * mem.c (print_mmap, SYS_FUNC(remap_file_pages), 6948 SYS_FUNC(subpage_prot)): Change the type of variables containing tracee 6949 addresses from unsigned long to kernel_ureg_t. 6950 6951 kexec: change address argument type from unsigned long to kernel_ureg_t. 6952 * kexec.c (print_kexec_segments): Change address argument type 6953 from unsigned long to kernel_ureg_t. 6954 6955 poll: change counter type from unsigned long to unsigned int. 6956 * poll.c (decode_poll_exiting): Change the type of printed and 6957 max_printed counters from unsigned long to unsigned int. 6958 6959 xattr: change address argument type from unsigned long to kernel_ureg_t. 6960 * xattr.c (print_xattr_val, print_xattr_list): Change address 6961 argument type from unsigned long to kernel_ureg_t. 6962 6963 uid: change address argument type from unsigned long to kernel_ureg_t. 6964 * uid.c (print_groups): Change address argument type 6965 from unsigned long to kernel_ureg_t. 6966 6967 stat64: change address argument type from unsigned long to kernel_ureg_t 6968 * stat64.c (decode_struct_stat64): Change address argument type 6969 from unsigned long to kernel_ureg_t. 6970 6971 stat: change address argument type from unsigned long to kernel_ureg_t. 6972 * stat.c (decode_struct_stat): Change address argument type 6973 from unsigned long to kernel_ureg_t. 6974 6975 sigaltstack: change address argument type from unsigned long to kernel_ureg_t 6976 * sigaltstack.c (print_stack_t): Change address argument type 6977 from unsigned long to kernel_ureg_t. 6978 6979 resource: change address argument type from unsigned long to kernel_ureg_t 6980 * resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change 6981 address argument type from unsigned long to kernel_ureg_t. 6982 6983 printsiginfo: change address argument type from unsigned long to kernel_ureg_t 6984 * printsiginfo.c (print_siginfo_array): Change address argument type 6985 from unsigned long to kernel_ureg_t. 6986 6987 poll: change tracee address type from unsigned long to kernel_ureg_t. 6988 * poll.c (decode_poll_entering, decode_poll_exiting): Change the type 6989 all tracee address variables from unsigned long to kernel_ureg_t. 6990 6991 perf: change address argument type from unsigned long to kernel_ureg_t. 6992 * perf.c (fetch_perf_event_attr, print_perf_event_attr): Change 6993 address argument type from unsigned long to kernel_ureg_t. 6994 6995 pathtrace: change tracee address type from unsigned long to kernel_ureg_t 6996 * pathtrace.c (upathmatch): Change address argument type 6997 from unsigned long to kernel_ureg_t. 6998 (pathtrace_match): Change the type of all tracee address variables 6999 from unsigned long to kernel_ureg_t. 7000 7001 scsi: change address argument type from unsigned long to kernel_ureg_t. 7002 * scsi.c (print_sg_io_buffer): Change address argument type 7003 from unsigned long to kernel_ureg_t. 7004 7005 dm: change address argument type from unsigned long to kernel_ureg_t. 7006 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 7007 dm_decode_dm_name_list, dm_decode_dm_target_versions, 7008 dm_decode_dm_target_msg, dm_decode_string): Change address argument type 7009 from unsigned long to kernel_ureg_t. 7010 7011 oldstat: change address argument type from unsigned long to kernel_ureg_t 7012 * oldstat.c (print_old_kernel_stat): Change address argument type 7013 from unsigned long to kernel_ureg_t. 7014 7015 capability: change address argument type from unsigned long to kernel_ureg_t 7016 * capability.c (get_cap_header, print_cap_header, print_cap_data): 7017 Change address argument type from unsigned long to kernel_ureg_t. 7018 7019 btrfs: change address argument type from unsigned long to kernel_ureg_t. 7020 * btrfs.c (btrfs_print_qgroup_inherit): Change address argument type 7021 from unsigned long to kernel_ureg_t. 7022 7023 affinity: change address argument type from unsigned long to kernel_ureg_t 7024 * affinity.c (print_affinitylist): Change address argument type from 7025 unsigned long to kernel_ureg_t. 7026 7027 aio: change address type from unsigned long to kernel_ureg_t. 7028 * aio.c (print_iocb): Remove casts to unsigned long. 7029 (print_iocbp, SYS_FUNC(io_submit)): Change address type 7030 from unsigned long to kernel_ureg_t. 7031 7032 mmsghdr: change address argument type from unsigned long to kernel_ureg_t 7033 * mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change 7034 address argument type from unsigned long to kernel_ureg_t. 7035 7036 msghdr: change address argument type from unsigned long to kernel_ureg_t 7037 * msghdr.c (decode_msg_control): Change address argument type 7038 from unsigned long to kernel_ureg_t. 7039 7040 fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t 7041 * fetch_struct_stat64.c (fetch_struct_stat64): Change address argument 7042 type from unsigned long to kernel_ureg_t. 7043 7044 fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t 7045 * fetch_struct_stat.c (fetch_struct_stat): Change address argument 7046 type from unsigned long to kernel_ureg_t. 7047 7048 fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t 7049 * fetch_struct_msghdr.c (fetch_struct_msghdr): Change 7050 address argument type from unsigned long to kernel_ureg_t. 7051 7052 fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t 7053 * fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change 7054 address argument type from unsigned long to kernel_ureg_t. 7055 7056 decode_netlink: change address argument type from unsigned long to kernel_ureg_t 7057 * defs.h (decode_netlink) Change address argument type 7058 from unsigned long to kernel_ureg_t. 7059 * netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload, 7060 decode_netlink): Likewise. 7061 7062 print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t 7063 * defs.h (print_seccomp_filter, print_seccomp_fprog): Change 7064 address argument type from unsigned long to kernel_ureg_t. 7065 * seccomp.c (print_seccomp_filter, print_seccomp_fprog, 7066 decode_seccomp_set_mode_strict): Likewise. 7067 7068 tprint_iov*: change address argument type from unsigned long to kernel_ureg_t 7069 * defs.h (tprint_iov, tprint_iov_upto): Change address argument type 7070 from unsigned long to kernel_ureg_t. 7071 * io.c (tprint_iov, tprint_iov_upto): Likewise. 7072 7073 print_array: change tracee address type from unsigned long to kernel_ureg_t 7074 * defs.h (print_array): Change start_addr type from unsigned long 7075 to kernel_ureg_t. 7076 * util.c (print_array): Likewise. Change the type of all tracee 7077 address variables from unsigned long to kernel_ureg_t. 7078 7079 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 7080 7081 Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long 7082 In all places where LONG_LONG is used the destination already has type 7083 unsigned long long, so it is quite natural to change LONG_LONG as well. 7084 7085 * defs.h (LONG_LONG): Rename to ULONG_LONG, change return type 7086 from long long to unsigned long long. All callers updated. 7087 7088 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 7089 7090 mem: remove redundant casts. 7091 * mem.c (SYS_FUNC(old_mmap)): Remove redundant cast 7092 from kernel_ureg_t to unsigned long. 7093 [S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast 7094 from unsigned int to unsigned long. 7095 7096 desc: remove redundant casts. 7097 * desc.c (umove_kulong_array_or_printaddr): Remove redundant cast 7098 from uint32_t to kernel_ulong_t. 7099 (SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t 7100 to unsigned long. 7101 7102 2016-12-22 Dmitry V. Levin <ldv (a] altlinux.org> 7103 7104 print_sigevent: remove redundant cast. 7105 * print_sigevent.c (print_sigevent): Remove redundant cast from 7106 struct_sigevent.sigev_value.sival_ptr to unsigned long as the former 7107 is not a pointer but an unsigned integer. 7108 7109 tests: fix xattr.test for the case when listxattr returns a long list. 7110 * tests/xattr.c (DEFAULT_STRLEN): New macro. 7111 (main): Use it to limit the length passed to print_quoted_memory. 7112 Print ellipsis when the list returned by listxattr is too long. 7113 7114 2016-12-22 Gabriel Laskar <gabriel (a] lse.epita.fr> 7115 7116 tests: test for correct ellipsis with -s in xattr. 7117 * tests/xattr-strings.c: New file. 7118 * tests/xattr-strings.test: New test. 7119 * tests/.gitignore: Add xattr-string. 7120 * tests/Makefile.am (check_PROGRAMS): Likewise. 7121 (DECODER_TESTS): Add xattr-string.test. 7122 7123 2016-12-22 Gabriel Laskar <gabriel (a] lse.epita.fr> 7124 7125 xattr: use printstr_ex instead of print_quoted_string. 7126 This fixes the display when using `-s` to limit the string size 7127 of the values displayed by {get,set}xattr. 7128 7129 * xattr.c (print_xattr_val): Remove static buffer. Use printstr_ex 7130 instead of print_quoted_string. 7131 7132 Reported-by: <socketpair (a] gmail.com> 7133 7134 2016-12-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7135 7136 tests: use scno.h in finit_module, kcmp, renameat2 tests. 7137 * tests/finit_module.c: Include "scno.h". 7138 * tests/kcmp.c: Likewise. 7139 * tests/renameat2.c: Likewise. 7140 7141 2016-12-21 Dmitry V. Levin <ldv (a] altlinux.org> 7142 7143 sock: cast pointers to kernel_ureg_t instead of unsigned long. 7144 * sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t 7145 instead of unsigned long. 7146 7147 scsi: cast pointers to kernel_ureg_t instead of unsigned long. 7148 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Cast sg_io_hdr.cmdp, 7149 sg_io_hdr.dxferp, and sg_io_hdr.sbp pointers to kernel_ureg_t instead 7150 of unsigned long. 7151 7152 mtd: cast pointers to kernel_ureg_t instead of unsigned long. 7153 * mtd.c (decode_mtd_oob_buf): Cast mtd_oob_buf.ptr pointer 7154 to kernel_ureg_t instead of unsigned long. 7155 7156 msghdr: cast pointers to kernel_ureg_t instead of unsigned long. 7157 * msghdr.c (print_struct_msghdr): Cast msghdr.msg_iov and 7158 msghdr.msg_control pointers to kernel_ureg_t instead of unsigned long. 7159 7160 evdev: cast tcp->u_rval to kernel_ureg_t instead of unsigned long. 7161 * evdev.c (decode_bitset): Cast tcp->u_rval to kernel_ureg_t 7162 instead of unsigned long. 7163 7164 evdev: cast pointers to kernel_ureg_t instead of unsigned long. 7165 * evdev.c (ff_effect_ioctl): Cast ff_periodic_effect.custom_data 7166 pointer to kernel_ureg_t instead of unsigned long. 7167 7168 btrfs: cast pointers to kernel_ureg_t instead of unsigned long. 7169 * btrfs.c (btrfs_ioctl): Cast btrfs_ioctl_send_args.clone_sources 7170 and btrfs_ioctl_vol_args_v2.qgroup_inherit pointers to kernel_ureg_t 7171 instead of unsigned long. 7172 7173 Rework ifdefery around print_user_desc. 7174 * configure.ac (AC_CHECK_TYPES): Check for struct user_desc 7175 in <asm/ldt.h>. 7176 * clone.c (print_tls_arg): New function. 7177 (SYS_FUNC(clone)): Use it. 7178 (print_user_desc): Move prototype ... 7179 * defs.h [HAVE_STRUCT_USER_DESC]: ... here. 7180 * ldt.c: Check for HAVE_STRUCT_USER_DESC instead of architectures. 7181 * linux/dummy.h: Likewise. 7182 7183 Introduce DECL_IOCTL macro to declare *_ioctl functions. 7184 * defs.h (DECL_IOCTL): New macro. 7185 (dm_ioctl, file_ioctl, fs_x_ioctl, loop_ioctl, ptp_ioctl, scsi_ioctl, 7186 sock_ioctl, term_ioctl, ubi_ioctl, uffdio_ioctl): Rewrite prototypes 7187 using DECL_IOCTL. 7188 7189 Introduce DECL_PRINT* macros to declare printnum_* and printpair_* 7190 * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR): New macros. 7191 (printnum_short, printnum_int, printnum_int64): Rewrite prototypes 7192 using DECL_PRINTNUM. 7193 (printpair_int, printpair_int64): Rewrite prototypes 7194 using DECL_PRINTPAIR. 7195 7196 ioctl: use uintptr_t for casts between 32-bit integers and pointers. 7197 * ioctl.c (compare): Cast pointer to uintptr_t before assigning 7198 it to an integer. 7199 (ioctl_lookup): Cast integer to uintptr_t before passing it 7200 as a pointer. 7201 7202 scsi: use umove_or_printaddr. 7203 * scsi.c (scsi_ioctl): Use umove_or_printaddr. 7204 7205 Remove dumpiov wrapper. 7206 * defs.h (dumpiov): Remove. 7207 * syscall.c (dumpio): Use dumpiov_upto instead of dumpiov. 7208 7209 travis: fix enabling of gcc -Werror builds. 7210 * travis-build.sh: Use DISTCHECK_CONFIGURE_FLAGS instead 7211 of CHECK_CONFIGURE_FLAGS and ENABLE_GCC_WERROR. 7212 [$CC == gcc]: Add --enable-gcc-Werror to DISTCHECK_CONFIGURE_FLAGS 7213 instead of ENABLE_GCC_WERROR. 7214 [$CHECK == coverage]: Add --enable-code-coverage 7215 to DISTCHECK_CONFIGURE_FLAGS instead of CHECK_CONFIGURE_FLAGS. 7216 7217 printaddr: change argument type to kernel_ureg_t. 7218 * defs.h (printaddr): Change argument type from unsigned long 7219 to kernel_ureg_t. 7220 7221 tests: check decoding of unreadable ip_mreq and ipv6_mreq structures. 7222 * tests/ip_mreq.c (main): Check short read. 7223 7224 tests: rewrite ip_mreq.c using arrays and iterators. 7225 * tests/ip_mreq.c (main): Create arrays of setsockopt arguments to test. 7226 Iterate over these arrays invoking setsockopt and printing expected 7227 output. 7228 7229 tests: rewrite ip_mreq.c using tail_alloc. 7230 * tests/ip_mreq.c (main): Allocate objects of struct ip_mreq 7231 and struct ipv6_mreq using tail_alloc instead of using stack. 7232 7233 tests: rewrite ip_mreq.c without asserts. 7234 * tests/ip_mreq.c: Do not include <assert.h>. 7235 (main): Do not use assert. Use sprintrc instead of errno2name. 7236 7237 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7238 7239 Remove NEED_PTRACE_PROTOTYPE_WORKAROUND. 7240 Remove the workaround for broken ptrace prototypes 7241 that seems to be unneeded for quite a long time. 7242 7243 * defs.h [NEED_PTRACE_PROTOTYPE_WORKAROUND]: Remove. 7244 7245 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7246 7247 tests: use scno.h in tests of relatively new syscalls. 7248 * tests/add_key.c: Include "scno.h" after <asm/unistd.h>. 7249 * tests/copy_file_range.c: Likewise. 7250 * tests/execveat.c: Likewise. 7251 * tests/kexec_file_load.c: Likewise. 7252 * tests/membarrier.c: Likewise. 7253 * tests/memfd_create.c: Likewise. 7254 * tests/mlock2.c: Likewise. 7255 * tests/pkey_alloc.c: Likewise. 7256 * tests/pkey_free.c: Likewise. 7257 * tests/pkey_mprotect.c: Likewise. 7258 * tests/preadv2-pwritev2.c: Likewise. 7259 * tests/userfaultfd.c: Likewise. 7260 7261 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7262 7263 tests: generate scno.h from syscallent.h for use by other tests. 7264 Provide scno.h with fallback definitions of all __NR_* constants known 7265 to strace for the personbality being tested. 7266 7267 Some tests need just __NR_* constants without any kernel support. 7268 Such tests can include "scno.h" after <asm/unistd.h> to get definitions 7269 of these constants when system headers are too old. 7270 7271 * tests/generate_scno.c: New file. 7272 * tests/.gitignore: Add generate_scno. 7273 * tests/Makefile.am (check_PROGRAMS): Likewise. 7274 (scno.h): New rule. 7275 (BUILT_SOURCES, CLEANFILES): Add scno.h. 7276 7277 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7278 7279 tests: fix potential errno clobbering in membarrier test. 7280 * tests/membarrier.c (main): Save errno. 7281 7282 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7283 7284 Do not use widen_to_ulong in kexec.c and process_vm.c. 7285 Automatic argument truncation makes use of this function redundant. 7286 7287 * kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong. 7288 * process_vm.c (SYS_FUNC(process_vm_readv), 7289 SYS_FUNC(process_vm_writev)): Likewise. 7290 7291 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7292 7293 x32: implement automatic argument truncation for compat syscalls. 7294 x32 syscalls starting with number 512 are compat syscalls that operate 7295 on compat types. Set COMPAT_SYSCALL_TYPES flag to these syscall entries 7296 and make get_syscall_args truncate arguments of syscalls that have this 7297 flag set, to avoid unpleasant alternative of adding multiple 7298 widen_to_ulong invocations to individual syscall parsers. 7299 7300 preadv, pwritev, preadv2, and pwritev2 are exceptions: while these 7301 syscalls operate on compat types, the offset argument has a regular 7302 64-bit type, so the automatic argument truncation cannot be applied. 7303 7304 * defs.h (COMPAT_SYSCALL_TYPES): New macro. 7305 * syscall.c (CST): New macro, defined to COMPAT_SYSCALL_TYPES. 7306 * linux/ia64/syscallent.h: Do not include "../i386/syscallent.h" 7307 unless [CST > 0]. 7308 * linux/x32/syscallent.h [512..533, 536..545]: Add CST flag. 7309 * linux/x86_64/get_syscall_args.c (get_syscall_args): Truncate arguments 7310 of compat syscalls to 32-bit values. 7311 * tests/ksysent.c (CST): New macro, defined to 0. 7312 * tests/nsyscalls.c (CST): Likewise. 7313 7314 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7315 7316 x32: fix decoding of mprotect and pkey_mprotect syscall arguments. 7317 As there are no compat versions of mprotect or pkey_mprotect syscalls 7318 in x32 personality, "addr", "len", and "prot" syscall arguments have 7319 kernel_ulong_t type and should be printed accordingly. 7320 7321 * mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using 7322 getarg_klu, print them using printaddr_klu, PRI_klu format, 7323 and printflags64, correspondingly. 7324 7325 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 7326 7327 Make tprint_iov function a static inline wrapper. 7328 * io.c (tprint_iov): Move ... 7329 * defs.h: ... here, add static inline keywords. 7330 7331 2016-12-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7332 7333 x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls. 7334 In x32 personality these syscalls use compat type for the 3rd argument, 7335 therefore it has to be truncated there. 7336 7337 * io.c (do_preadv, do_pwritev): Truncate tcp->u_arg[2] using 7338 widen_to_ulong. 7339 7340 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7341 7342 tests: fix preadv2-pwritev2 test on x32. 7343 On x32 p(read|write)v(|2) syscalls are implemented via compat, which 7344 truncates len argument to unsigned int. 7345 7346 * tests/preadv2-pwritev2.c (main): Print vlen argument as unsigned long. 7347 7348 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7349 7350 kexec: fix for the x32 ABI. 7351 There is no compat (and no 32-bit version, ever) for x32 ABI, so 7352 kernel's long type should be used for arguments' values. 7353 7354 The only remaining thing is a pointer to cmdline string, but it is 7355 currently broken on x32 anyway. 7356 7357 * kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument 7358 as kernel long, retrieve it via getarg_klu; use printflags64 for 7359 printing the flags argument, retrieve it via getarg_klu. 7360 7361 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7362 7363 Check for current_klongsize instead of current_personality where appropriate 7364 current_klongsize checks are more universal, therefore they are usually 7365 shorter and easier to comprehend. 7366 7367 * desc.c (umove_kulong_array_or_printaddr): Check for current_klongsize 7368 instead of current_personality and current_wordsize. 7369 * io.c (print_lld_from_low_high_val): Likewise. 7370 * lseek.c (SYS_FUNC(lseek)): Likewise. 7371 * resource.c (decode_rlimit): Likewise. 7372 * syscall.c (is_negated_errno): Likewise. 7373 * util.c (getllval, getarg_klu): Likewise. 7374 7375 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7376 7377 Use kernel_ulong_t instead of unsigned long long where appropriate. 7378 * defs.h (printaddr_ull): Rename to printaddr_klu, change argument 7379 type from unsigned long long to kernel_ulong_t. All callers updated. 7380 (getarg_ull): Rename to getarg_klu, change return value type 7381 from unsigned long long to kernel_ulong_t. All callers updated. 7382 (PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros. 7383 * bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using 7384 PRI_klu format. 7385 * desc.c (SYS_FUNC(pselect6)): Likewise. 7386 * fadvise.c (SYS_FUNC(fadvise64)): Likewise. 7387 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. 7388 * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. 7389 * kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using 7390 PRI_klx format. 7391 * keyctl.c (SYS_FUNC(keyctl)): Likewise. 7392 * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. 7393 * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): 7394 Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format. 7395 * util.c (printaddr_ull): Rename to printaddr_klu, change argument 7396 type from unsigned long long to kernel_ulong_t, print it using 7397 PRI_klx format. 7398 (getarg_ull): Rename to getarg_klu, change return value type 7399 from unsigned long long to kernel_ulong_t, print it using 7400 PRI_klx format. 7401 7402 fcntl.c: print 64-bit fields of struct_kernel_flock64 using PRId64 format 7403 * fcntl.c (print_struct_flock64): Print l_start and l_len fields 7404 of struct_kernel_flock64 using PRId64 format. 7405 7406 v4l2.c: print v4l2_ext_control.value64 using PRId64 format. 7407 * v4l2.c (print_v4l2_ext_control): Print value64 field 7408 of struct_v4l2_ext_control using PRId64 format. 7409 7410 perf.c: print perf_event_attr.__reserved_1 using PRIx64 format. 7411 * perf.c (print_perf_event_attr): Print __reserved_1 field 7412 of perf_event_attr using PRIx64 format. 7413 7414 btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format 7415 * block.c (btrfs_ioctl): Print size and transid fields 7416 of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format. 7417 7418 block.c: change type of long long fileds to int64_t. 7419 * block.c (struct_blkpg_partition): Change type of start and length 7420 fields from long long to int64_t. 7421 (print_blkpg_req): Print them using PRId64 format. 7422 7423 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7424 7425 Introduce current_klongsize in addition to current_wordsize. 7426 Subsequent commits are going to use current_klongsize 7427 as the tracee's size of kernel_ulong_t type. 7428 7429 * defs.h (PERSONALITY0_KLONGSIZE): New macro. 7430 [X86_64] (PERSONALITY2_KLONGSIZE): Likewise. 7431 [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise. 7432 [SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise. 7433 [SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == 7434 PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise. 7435 [SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 || 7436 PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize): 7437 New variable prototype. 7438 * syscall.c [!current_klongsize] (current_klongsize): New variable. 7439 [!current_klongsize] (personality_klongsize): New array. 7440 (set_personality) [!current_klongsize]: Update current_klongsize 7441 with the appropriate value from personality_klongsize. 7442 7443 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7444 7445 configure: define SIZEOF_KERNEL_LONG_T macro. 7446 Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and 7447 SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t 7448 types at the time of preprocessing. 7449 7450 * configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t. 7451 7452 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7453 7454 Remove getarg_ll. 7455 This function has never been used in the code, and in perspective 7456 the whole ext_arg thing will go away. 7457 7458 * defs.h (getarg_ll): Remove prototype. 7459 * util.c (getarg_ll): Remove. 7460 7461 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7462 7463 struct tcb: make types of syscall arguments unsigned. 7464 This is the first step in the direction of revisiting current practice 7465 of indiscriminate use of signed types for syscall arguments and memory 7466 addresses. 7467 7468 * kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long. 7469 * defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t. 7470 [HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long 7471 to unsigned long long. 7472 * desc.c (decode_select): Change type of syscall arguments from long 7473 to kernel_ureg_t. 7474 (SYS_FUNC(oldselect)): Change type of select_args from long 7475 to kernel_ureg_t. 7476 * io.c (print_lld_from_low_high_val): Remove no longer needed cast 7477 of syscall arguments to unsigned long. 7478 * lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long 7479 to long. 7480 * mem.c (print_mmap): Change type of syscall arguments from long 7481 to kernel_ureg_t. 7482 (SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg 7483 from long to kernel_ureg_t. 7484 (SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove 7485 no longer needed cast of syscall arguments to unsigned long. 7486 * pathtrace.c (pathtrace_match): Change type of args and select_args 7487 from long to kernel_ureg_t. 7488 * util.c (getarg_ull): Remove no longer needed casts of syscall 7489 arguments to unsigned types. 7490 7491 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 7492 7493 s390: fix decoding of mmap2 syscall when arguments are not available. 7494 * mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr 7495 instead of umoven to fetch mmap arguments, fix return value when this 7496 fetch fails. 7497 7498 Fix pathmatch of oldselect syscall on 64-bit architectures. 7499 * pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect 7500 arguments on 64-bit architectures. 7501 7502 Cleanup oldselect. 7503 * desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros. 7504 7505 2016-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 7506 7507 Change scno type from long to unsigned long. 7508 Use an unsigned type for syscall numbers as they are not intended 7509 for signed arithmetics. Introduce kernel_scno_t as a typedef 7510 to unsigned long, that could be changed later to kernel_ulong_t. 7511 7512 * kernel_types.h (kernel_scno_t): New type, typedef to unsigned long. 7513 * defs.h (struct tcb): Change type of scno field from long 7514 to kernel_scno_t. 7515 (syscall_name): Change argument type from long to kernel_scno_t. 7516 (scno_in_range, scno_is_valid): Change argument type from unsigned long 7517 to kernel_scno_t. 7518 * linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type 7519 from long to kernel_scno_t. 7520 * linux/alpha/set_scno.c (arch_set_scno): Likewise. 7521 * linux/arc/set_scno.c (arch_set_scno): Likewise. 7522 * linux/arm/set_scno.c (arch_set_scno): Likewise. 7523 * linux/avr32/set_scno.c (arch_set_scno): Likewise. 7524 * linux/bfin/set_scno.c (arch_set_scno): Likewise. 7525 * linux/crisv10/set_scno.c (arch_set_scno): Likewise. 7526 * linux/hppa/set_scno.c (arch_set_scno): Likewise. 7527 * linux/i386/set_scno.c (arch_set_scno): Likewise. 7528 * linux/ia64/set_scno.c (arch_set_scno): Likewise. 7529 * linux/m68k/set_scno.c (arch_set_scno): Likewise. 7530 * linux/metag/set_scno.c (arch_set_scno): Likewise. 7531 * linux/microblaze/set_scno.c (arch_set_scno): Likewise. 7532 * linux/mips/set_scno.c (arch_set_scno): Likewise. 7533 * linux/nios2/set_scno.c (arch_set_scno): Likewise. 7534 * linux/or1k/set_scno.c (arch_set_scno): Likewise. 7535 * linux/powerpc/set_scno.c (arch_set_scno): Likewise. 7536 * linux/riscv/set_scno.c (arch_set_scno): Likewise. 7537 * linux/s390/set_scno.c (arch_set_scno): Likewise. 7538 * linux/sh/set_scno.c (arch_set_scno): Likewise. 7539 * linux/sh64/set_scno.c (arch_set_scno): Likewise. 7540 * linux/sparc/set_scno.c (arch_set_scno): Likewise. 7541 * linux/tile/set_scno.c (arch_set_scno): Likewise. 7542 * linux/x86_64/set_scno.c (arch_set_scno): Likewise. 7543 * linux/xtensa/set_scno.c (arch_set_scno): Likewise. 7544 * linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type 7545 from long to kernel_scno_t. 7546 * linux/alpha/get_scno.c (arch_get_scno): Likewise. 7547 * linux/arm/get_scno.c (arch_get_scno): Likewise. 7548 * linux/sh/get_scno.c (arch_get_scno): Likewise. 7549 * linux/x86_64/get_scno.c (arch_get_scno): Likewise. 7550 * syscall.c (arch_set_scno): Likewise. 7551 (shuffle_scno): Change return type from long to kernel_scno_t. 7552 (syscall_name): Change argument type from long to kernel_scno_t. 7553 7554 2016-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 7555 7556 Lowercase SCNO_IN_RANGE and SCNO_IS_VALID. 7557 * defs.h (SCNO_IN_RANGE): Rename to scno_in_range. All callers updated. 7558 (SCNO_IS_VALID): Rename to scno_is_valid. All callers updated. 7559 7560 Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions. 7561 * defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline 7562 functions. 7563 7564 count.c: use syserror instead of direct u_error access. 7565 * count.c (count_syscall): Use syserror instead of u_error. 7566 7567 Replace "(unsigned long) -1L" with -1UL. 7568 * defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL. 7569 * io.c (print_iovec, tprint_iov): Likewise. 7570 * msghdr.c (SYS_FUNC(sendmsg)): Likewise. 7571 * syscall.c (dumpio): Likewise. 7572 * poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U. 7573 7574 Add toplevel recursive check-valgrind rule. 7575 * Makefile.am (.PHONY): Add check-valgrind-local. 7576 (check-valgrind): New rule. 7577 * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it. 7578 7579 m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK. 7580 * m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend 7581 on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am 7582 instead of check-TESTS. 7583 7584 travis: do coverage using a dedicated build. 7585 * .travis.yml (after_success): Remove. 7586 (matrix): Create an entry for the regular x86_64 target. 7587 * travis-success.sh: Merge into ... 7588 * travis-build.sh: ... this file. Disable optimization 7589 for coverage builds. 7590 * travis-install.sh: Rename COVERAGE=true to CHECK=coverage. 7591 7592 2016-12-17 Dmitry V. Levin <ldv (a] altlinux.org> 7593 7594 mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t. 7595 * kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) && 7596 LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types. 7597 7598 2016-12-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7599 7600 util: simplify definitions of bit mask constants in umovestr. 7601 * util.c (umovestr): Do not check for SIZEOF_LONG in definitions 7602 of bit mask constants. 7603 7604 tests: check decoding of prctl operations without arguments. 7605 * tests/prctl-no-args.c: New file. 7606 * tests/prctl-no-args.test: New test. 7607 * tests/.gitignore: Add prctl-no-args. 7608 * tests/Makefile.am (check_PROGRAMS): Likewise. 7609 (DECODER_TESTS): Add prctl-no-args.test. 7610 7611 tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations. 7612 * tests/prctl-securebits.c: New file. 7613 * tests/prctl-securebits.test: New test. 7614 * tests/.gitignore: Add prctl-securebits. 7615 * tests/Makefile.am (check_PROGRAMS): Likewise. 7616 (DECODER_TESTS): Add prctl-securebits.test. 7617 7618 tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations. 7619 * tests/prctl-dumpable.c: New file. 7620 * tests/prctl-dumpable.test: New test. 7621 * tests/.gitignore: Add prctl-dumpable. 7622 * tests/Makefile.am (check_PROGRAMS): Likewise. 7623 (DECODER_TESTS): Add prctl-dumpable.test. 7624 7625 prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE 7626 * xlat/pr_dumpable.in: New file. 7627 * prctl.c: Include "xlat/pr_dumpable.h". 7628 (SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation 7629 and the second syscall argument of PR_SET_DUMPABLE operation 7630 as SUID_DUMP_* constants. 7631 7632 2016-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 7633 7634 Include "kernel_types.h" in defs.h and tests/tests.h. 7635 As kernel_ulong_t type is going to be used in the definition 7636 of struct tcb and in many function prototypes, make it readily 7637 available for every source file by including "kernel_types.h" 7638 in defs.h and tests/tests.h files. 7639 7640 * defs.h: Include "kernel_types.h". 7641 * tests/tests.h: Likewise. 7642 * desc.c: Do not include "kernel_types.h". 7643 * dirent.c: Likewise. 7644 * keyctl.c: Likewise. 7645 * syscall.c: Likewise. 7646 * linux/asm_stat.h: Likewise. 7647 * tests/answer.c: Likewise. 7648 * tests/epoll_pwait.c: Likewise. 7649 * tests/fanotify_init.c: Likewise. 7650 * tests/fanotify_mark.c: Likewise. 7651 * tests/file_handle.c: Likewise. 7652 * tests/ftruncate.c: Likewise. 7653 * tests/getdents.c: Likewise. 7654 * tests/init_delete_module.h: Likewise. 7655 * tests/inotify.c: Likewise. 7656 * tests/inotify_init1.c: Likewise. 7657 * tests/ioprio.c: Likewise. 7658 * tests/ipc_msgbuf.c: Likewise. 7659 * tests/kcmp.c: Likewise. 7660 * tests/kexec_file_load.c: Likewise. 7661 * tests/kexec_load.c: Likewise. 7662 * tests/keyctl.c: Likewise. 7663 * tests/lookup_dcookie.c: Likewise. 7664 * tests/lseek.c: Likewise. 7665 * tests/mq_sendrecv.c: Likewise. 7666 * tests/nsyscalls.c: Likewise. 7667 * tests/pkey_alloc.c: Likewise. 7668 * tests/pkey_free.c: Likewise. 7669 * tests/pkey_mprotect.c: Likewise. 7670 * tests/prctl-pdeathsig.c: Likewise. 7671 * tests/prctl-tsc.c: Likewise. 7672 * tests/preadv2-pwritev2.c: Likewise. 7673 * tests/process_vm_readv_writev.c: Likewise. 7674 * tests/read-write.c: Likewise. 7675 * tests/setfsugid.c: Likewise. 7676 * tests/setns.c: Likewise. 7677 * tests/truncate.c: Likewise. 7678 * tests/unshare.c: Likewise. 7679 * tests/xgetrlimit.c: Likewise. 7680 7681 2016-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 7682 7683 Post-release administrivia. 7684 * NEWS: Add a header line for the next release. 7685 * debian/changelog.in: Add a changelog entry for 4.15-1. 7686 * strace.spec.in: Likewise. 7687 7688 2016-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 7689 7690 xlat: provide fallback definitions for NETLINK_* constants. 7691 As new constants have been added gradually over kernel releases, define 7692 all constant values to make newer constants decoded properly when strace 7693 is built with older kernel headers. 7694 7695 * xlat/netlink_protocols.in: Add default values for constants. 7696 * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove. 7697 * socketutils.c: Likewise. 7698 7699 2016-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 7700 7701 tests: relax getaffinity return value check in tests/sched_xetaffinity.c 7702 * tests/sched_xetaffinity.c (errstr): New variable. 7703 (getaffinity, setaffinity): Initialize it. 7704 (main): Use it. Allow getaffinity return value to be less than 7705 its cpusetsize argument. 7706 7707 tests: fix threads-execve.test for large pids. 7708 * tests/threads-execve.c (main): Fix expected output for large pids. 7709 7710 2016-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 7711 7712 Prepare for 4.15 release. 7713 * NEWS: Update for 4.15 release. 7714 7715 .mailmap: add addresses of Thomas De Schampheleire. 7716 * .mailmap: Add both addresses of Thomas De Schampheleire here to avoid 7717 duplications in CREDITS file. 7718 7719 Sync strace.spec and debian/ with packages. 7720 * debian/control: Add Vcs-* metadata from 4.13-0.1. 7721 * debian/watch: Sync with 4.13-0.1. 7722 * strace.spec.in: Sync with 4.14.0.100.622a-1. 7723 7724 2016-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 7725 7726 tests: workaround a bug in GNU grep. 7727 Workaround a bug introduced in GNU grep 2.27, for details see 7728 https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html 7729 7730 * tests/init.sh (grep_pid_status): New function. 7731 * tests/detach-running.test: Use it instead of grep to search 7732 in /proc/$pid/status. 7733 * tests/detach-sleeping.test: Likewise. 7734 * tests/detach-stopped.test: Likewise. 7735 7736 2016-12-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7737 7738 tests: fix typo in comment inside prctl-tsc.c. 7739 7740 2016-12-13 Sean Stangl <sstangl (a] mozilla.com> 7741 Dmitry V. Levin <ldv (a] altlinux.org> 7742 7743 Fix libunwind segfault when -p is passed before -k. 7744 * strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after 7745 unwind_init for all allocated tcb structures if stack trace is enabled. 7746 * unwind.c (unwind_tcb_init): Skip if tcb is already initialized. 7747 7748 2016-12-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7749 Dmitry V. Levin <ldv (a] altlinux.org> 7750 7751 Update NEWS. 7752 7753 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7754 7755 tests: skip fault injection tests on unsupported platforms. 7756 * tests/fault_injection.sh: New file. 7757 * tests/Makefile.am (EXTRA_DIST): Add it. 7758 * tests/fault_injection-exit_group.test: Use it. 7759 * tests/fault_injection.test: Likewise. 7760 7761 tests: introduce require_min_kernel_version_or_skip function. 7762 * tests/init.sh (kernel_version_code, 7763 require_min_kernel_version_or_skip): New functions. 7764 * tests/threads-execve.test: Use require_min_kernel_version_or_skip. 7765 7766 2016-12-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7767 7768 tests: add descriptions to prctl-pdeathsig and prctl-tsc tests. 7769 7770 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7771 7772 tests: robustify prctl-pdeathsig.test and prctl-tsc.test. 7773 Rrobustify remaining prctl tests against unrelated prctl invocations 7774 7775 * tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_* 7776 prctl calls. 7777 * tests/prctl-tsc.test: Likewise. 7778 7779 2016-12-07 Thomas De Schampheleire <thomas.de_schampheleire (a] nokia.com> 7780 7781 Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD. 7782 Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra 7783 warning flags through configure.ac. The configure script will determine 7784 dynamically if CC supports these flags before adding them to WARN_CFLAGS. 7785 7786 ioctlsort is compiled with CC_FOR_BUILD, rather than CC. Nevertheless, 7787 the flags passed to this compilation also include WARN_CFLAGS (through 7788 AM_CFLAGS). This is incorrect: in a cross-compilation use case, CC 7789 and CC_FOR_BUILD are not the same. The former is the cross-compiler, 7790 the latter is the host compiler. Both may be of different versions 7791 and support different warning flags. 7792 7793 In particular, this posed a problem when cross-compiling with a host 7794 compiler gcc 4.1, which does not support all the new flags: 7795 7796 /usr/bin/gcc -DHAVE_CONFIG_H -I./linux/arm -I./linux/arm -I./linux 7797 -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body 7798 -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op 7799 -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration 7800 -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 7801 -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o 7802 ioctlsort0.o ./ioctlsort.c 7803 cc1: error: unrecognized command line option "-Wempty-body" 7804 cc1: error: unrecognized command line option "-Wignored-qualifiers" 7805 cc1: error: unrecognized command line option "-Wlogical-op" 7806 cc1: error: unrecognized command line option "-Wmissing-parameter-type" 7807 cc1: error: unrecognized command line option "-Wold-style-declaration" 7808 cc1: error: unrecognized command line option "-Wtype-limits" 7809 make[2]: *** [ioctlsort0.o] Error 1 7810 7811 * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New 7812 variables. 7813 (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS. 7814 (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS. 7815 (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS. 7816 * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect 7817 WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS, 7818 substitute WARN_CFLAGS_FOR_BUILD. 7819 7820 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7821 7822 m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers. 7823 * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use 7824 _AC_LANG_PREFIX[]FLAGS in unquoted form. Change gl_Warn to use gl_Flags 7825 instead of _AC_LANG_ABBREV. Change notification message to mention 7826 the variable name of the compiler. 7827 (gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if 7828 gl_unknown_warnings_are_errors is set. 7829 (gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from 7830 AC_REQUIRE to a regular call. 7831 7832 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7833 7834 AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler. 7835 Some of these variables cannot be redirected using traditional 7836 pushdef/popdef mechanism because of complex constructions like 7837 [ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros. 7838 Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue. 7839 7840 * m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc, 7841 ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89, 7842 am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using 7843 pushdef/popdef. 7844 Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag, 7845 ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu, 7846 ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR. 7847 7848 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7849 7850 Move all gl_WARN_ADD calls to a separate m4 macro. 7851 This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD 7852 change. 7853 7854 * configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD. 7855 Move all gl_WARN_ADD calls ... 7856 * m4/st_warn_cflags.m4: ... here. 7857 7858 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 7859 7860 m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros. 7861 These new macros are going to be needed for the upcoming 7862 AX_PROG_CC_FOR_BUILD change. 7863 7864 * m4/st_save_restore_var.m4: New file. 7865 7866 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7867 7868 tests: add valgrind support to "make check" 7869 * m4/ax_valgrind_check.m4: Import from the autoconf-archive package. 7870 * configure.ac: Invoke AX_VALGRIND_CHECK. 7871 * valgrind.supp: Move to tests/strace.supp. 7872 * Makefile.am (EXTRA_DIST): Remove valgrind.supp. 7873 * tests/Makefile.am: Add @VALGRIND_CHECK_RULES@. 7874 (VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables. 7875 (EXTRA_DIST): Add strace.supp. 7876 * tests/init.sh: Add valgrind command prefix to $STRACE when appropriate. 7877 7878 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7879 7880 tests: robustify threads-execve.test against race conditions. 7881 Due to probabilistic nature of the test, try it several times. 7882 7883 * tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1. 7884 * tests/threads-execve.test: Iterate up to 10 times. 7885 7886 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7887 7888 tests: fix expected output in strace-ttt.test. 7889 If strace -ttt is running too long, it might happen that time stamps 7890 before and after its invocation differ for more than a second. 7891 Adjust expected output to handle this rare but possible case. 7892 7893 * tests/strace-ttt.test: Allow any time stamp between start and finish 7894 of strace invocation. 7895 7896 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7897 7898 tests: fix expected output in strace-tt.test. 7899 If strace -tt is running too long, it might happen that time stamps 7900 before and after its invocation differ for more than a second. 7901 Adjust expected output to handle this rare but possible case. 7902 7903 * tests/strace-tt.test: Allow any time stamp between start and finish 7904 of strace invocation. 7905 7906 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7907 7908 tests: robustify redirect.test against race conditions. 7909 Introduce a synchronization mechanism between the tracee and its peer. 7910 7911 * tests/redirect.test: Change timeout file to $OUT. Let the tracee 7912 remove $LOG, wait for $LOG removal in its peer. 7913 7914 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7915 7916 tests: robustify attach-f-p.test against race conditions. 7917 Introduce a synchronization mechanism between attach-f-p and strace. 7918 7919 * tests/attach-f-p-cmd.c: New file. 7920 * tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd. 7921 * tests/attach-f-p.c: Include <sys/stat.h>. 7922 (main): Write to stdout instead of descriptor 3. Wait for the peer 7923 writing to stdout. 7924 * tests/attach-f-p.test: Assume that ./attach-f-p-cmd works. 7925 Use $OUT for expected output. Use attach-f-p-cmd for unlocking $OUT. 7926 7927 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 7928 7929 tests: robustify attach-p-cmd.test against race conditions. 7930 Introduce a synchronization mechanism between attach-p-cmd-p 7931 and attach-p-cmd-cmd processes. 7932 7933 * tests/attach-p-cmd-cmd.c: Include <errno.h> and <sys/stat.h>. 7934 (main): Wait for the lock directory creation by attach-p-cmd-p. 7935 * tests/attach-p-cmd-p.c: Include <errno.h> and <sys/stat.h>. 7936 (main): Create a lock directory and wait for its removal 7937 by attach-p-cmd-cmd. 7938 * tests/attach-p-cmd.test: Assume that test programs work. 7939 7940 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 7941 7942 Rewrite remaining qual_* parsers using bit sets. 7943 * defs.h (struct fault_opts): Replace forward declaration 7944 with a definition. 7945 (qualbits_t, qualify_read, qualify_write, qualify_signals): Remove. 7946 (qual_flags): New function prototype. 7947 (nsyscall_vec, sysent_vec, fault_vec): New variable prototypes. 7948 * qualify.c (abbrev_set, fault_set, raw_set, trace_set, verbose_set): 7949 New variables. 7950 (qualify_read, qualify_write, qualify_signals): Add static qualifier. 7951 (find_errno_by_name, lookup_class, parse_fault_expression, 7952 parse_fault_token, qual_flags, qualify, qualify_abbrev, qualify_fault, 7953 qualify_raw, qualify_syscall, qualify_syscall_class, 7954 qualify_syscall_name, qualify_syscall_number, qualify_syscall_tokens, 7955 qualify_trace, qualify_verbose, strip_prefix): New functions. 7956 * syscall.c (nsyscall_vec, nsysent_vec): Remove static qualifier. 7957 (MAX_NSYSCALLS1, MAX_NSYSCALLS2, MAX_NSYSCALLS, qual_vec, qual_flags, 7958 qual_fault, qual_syscall, qual_options, fault_opts, qualify_one, 7959 qualify_scno, lookup_class, qualify_syscall_class, qualify_syscall_name, 7960 qual_syscall_ex, qual_syscall, strip_prefix, find_errno_by_name, 7961 parse_fault_token, parse_fault_expression, qual_fault, qualify): Remove. 7962 (decode_socket_subcall, decode_ipc_subcall, decode_mips_subcall, 7963 get_scno): Update use of qual_flags. 7964 (inject_syscall_fault_entering): Update per-personality allocation 7965 of tcp->fault_vec. 7966 * tests/fault_injection-exit_group.test: Check parsing of inversed 7967 fault sets. 7968 * tests/fault_injection.test: Check parsing of -efault=none. 7969 * tests/options-syntax.test: Check parsing of invalid syscall numbers. 7970 7971 Change qual_vec/qual_fault into static fixed size arrays. 7972 * defs.h (qual_vec, num_quals): Remove. 7973 (qual_flags): Move ... 7974 * syscall.c: ... here. 7975 (num_quals, num_faults, MIN_QUALS, reallocate_vec, reallocate_qual, 7976 reallocate_fault): Remove. 7977 (qual_vec, qual_fault): Change into static fixed size arrays. 7978 (qualify_one): Remove reallocate_qual and reallocate_fault calls. 7979 (qualify): Likewise. Replace num_quals and num_faults with 7980 MAX_NSYSCALLS. 7981 7982 Rewrite qual_signal using bit sets. 7983 * defs.h (signal_set): New variable prototypes. 7984 (qualify_signals): New function prototypes. 7985 (QUAL_SIGNAL): Change to a value greater than 0xff. 7986 (QUAL_FAULT): Change to a lower value. 7987 * qualify.c (signal_set): New variable. 7988 (sigstr_to_uint, qualify_signals): New functions. 7989 * syscall.c (qual_signal): Remove. 7990 (qual_options): Replace qual_signal with NULL. 7991 (qualify): Use qualify_signals. 7992 * strace.c (print_signalled, print_stopped): Use is_number_in_set 7993 with signal_set argument. 7994 7995 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 7996 7997 Rewrite qual_desc using bit sets. 7998 As a side effect, this also fixes support of negated sets 7999 of descriptors. 8000 8001 * defs.h (struct number_set): New forward declaration. 8002 (read_set, write_set): New variable prototypes. 8003 (is_number_in_set, qualify_read, qualify_write): New function 8004 prototypes. 8005 (QUAL_READ, QUAL_WRITE): Change to values greater than 0xff. 8006 * qualify.c: New file. 8007 * Makefile.am (strace_SOURCES): Add it. 8008 * syscall.c (qual_desc): Remove. 8009 (qual_options): Replace qual_desc with NULL. 8010 (qualify): Use qualify_read and qualify_write. 8011 (dumpio): Use is_number_in_set. 8012 * tests/options-syntax.test: Check invalid sets of descriptors. 8013 * tests/readv.test: Check dumping of negated sets of descriptors. 8014 8015 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 8016 8017 tests: skip redirect-fds.test when strace is wrapped with valgrind. 8018 valgrind is not as transparent as strace wrt standard descriptors, 8019 so if strace is wrapped with valgrind, the test would check valgrind 8020 transparency properties and fail imminently. 8021 8022 * tests/redirect-fds.test: Skip the test when $STRACE shows a presence 8023 of valgrind. 8024 8025 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 8026 8027 Add valgrind.supp. 8028 As valgrind is not quite happy about the way how get_cpuset_size uses 8029 sched_getaffinity, add a suppression file for this case. 8030 8031 * valgrind.supp: New file. 8032 * Makefile.am (EXTRA_DIST): Add it. 8033 8034 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 8035 8036 affinity: pass 0 as a pid to sched_getaffinity. 8037 * affinity.c (get_cpuset_size): Pass 0 instead of getpid() 8038 to sched_getaffinity. 8039 8040 affinity: document the method of finding out the cpuset size. 8041 * affinity.c (get_cpuset_size): Add a comment about sched_getaffinity. 8042 8043 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 8044 8045 tests: make options-syntax.test tolerant of strace wrappers. 8046 Change the test to allow wrappers like STRACE="valgrind ./strace". 8047 8048 * tests/options-syntax.test: Strip all words but last from $STRACE 8049 variable in all contexts where the name of strace executable is expected 8050 in its output. 8051 8052 2016-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 8053 8054 Do not allocate memory for line buffered output. 8055 libc is perfectly capable of allocating memory for its buffers, 8056 so let it do its job. 8057 8058 * strace.c (init): Do not allocate memory for setvbuf invocation. 8059 8060 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8061 8062 Update NEWS. 8063 8064 tests: use kernel_ulong_t as argument type in setfsuid/setfsgid tests. 8065 * setfsugid.c: Include "kernel_types.h". 8066 (main): Change type of entries of the "tests" array from long to 8067 kernel_ulong_t. 8068 8069 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8070 Elvira Khabirova <lineprinter0 (a] gmail.com> 8071 8072 uid: print size as signed in setgroups/getgroups. 8073 As this is the type used in kernel. 8074 8075 * uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter 8076 as "%d". 8077 * tests/getgroups.c: Update expected output. 8078 * tests/setgroups.c: Likewise. 8079 8080 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8081 Elvira Khabirova <lineprinter0 (a] gmail.com> 8082 8083 uid: use printuid for printing UID/GID value. 8084 * uid.c (setfsuid, get_print_uid, print_gid): Use printuid. 8085 * tests/setfsugid.c (printuid): New function. 8086 (main): Use it to print UID/GID values. 8087 * tests/setgroups.c: Likewise. 8088 * tests/setugid.c (ugid2int): Remove. 8089 (printuid): New function. 8090 (main): Use it to print UID/GID values. 8091 8092 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8093 8094 tests: additional check for PTRACE_SETSIGINFO ptrace command. 8095 * tests/ptrace.c (main): Add an additional PTRACE_SETSIGINFO check. 8096 8097 2016-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 8098 8099 syscall_name: clear __X32_SYSCALL_BIT from syscall number on x32. 8100 * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro. 8101 * syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]: 8102 Clear __X32_SYSCALL_BIT from scno on x32 personality. 8103 8104 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8105 8106 Print syscall names only for defined syscalls. 8107 The string literal "__NR_syscall_4294967295" is semantically incorrect 8108 as there is no such constant defined. 8109 8110 * syscall.c (syscall_name): Return NULL if there is no syscall 8111 corresponding to the given number. 8112 * defs.h (syscall_name): Document this behaviour. 8113 * printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix 8114 only if there is a syscall corresponding to si_syscall number; print 8115 a plain syscall number otherwise. 8116 * tests/ptrace.c (main): Update expected output. 8117 8118 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8119 8120 affinity: print cpu set as an array. 8121 * affinity.c: Add comma between elements of cpu set. 8122 * tests/sched_xetaffinity.c (main): Update expected output. 8123 8124 statfs: fix printing format of f_fsid field. 8125 * print_statfs.c: Print f_fsid as a structure containing field "val" 8126 which, in turn, is an array of two elements that used to be printed 8127 as members of f_fsid structure. 8128 * tests/statfs.expected: Update expected output. 8129 * tests/xstatfsx.c (print_statfs): Likewise. 8130 8131 swap: always print priority value. 8132 * swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value 8133 of the prio variable in order to print it. 8134 * tests/swap.c (main): Update expected output. 8135 8136 2016-12-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 8137 8138 tests: show pattern line number in match_grep. 8139 This makes debugging of failing test a bit easier. 8140 8141 * tests/init.sh (match_grep): Add the cnt variable, increment it on every 8142 pattern line read, print it as a prefix for non-matched pattern. 8143 8144 2016-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8145 Elvira Khabirova <lineprinter0 (a] gmail.com> 8146 8147 futex: make output of the val3 argument of the FUTEX_WAKE_OP command more structured 8148 It is a number which consists of several xlat values, not a structure. 8149 8150 * futex.c (SYS_FUNC(futex)): Modify output of the val3 argument 8151 of the FUTEX_WAKE_OP futex syscall command. 8152 * tests/futex.c (main): Update expected output. 8153 8154 2016-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8155 8156 tests: additional checks for prctl-* tests. 8157 * tests/prctl-pdeathsig.c (main): Additional checks. 8158 * tests/prctl-tsc.c (main): Likewise. 8159 * tests/prctl-pdeathsig.test: Update value of -a argument. 8160 * tests/prctl-tsc.test: Likewise. 8161 8162 2016-11-30 JingPiao Chen <chenjingpiao (a] foxmail.com> 8163 8164 tests: add prctl-pdeathsig.test and prctl-tsc.test. 8165 * tests/prctl-pdeathsig.c: New file. 8166 * tests/prctl-tsc.c: Likewise. 8167 * tests/prctl-pdeathsig.test: New test. 8168 * tests/prctl-tsc.test: Likewise. 8169 * tests/.gitignore: Add prctl-pdeathsig and prctl-tsc. 8170 * tests/Makefile.am (check_PROGRAMS): Likewise. 8171 (DECODER_TESTS): Add prctl-pdeathsig.test and prctl-tsc.test. 8172 8173 2016-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 8174 8175 syscall: Simplify strip_prefix. 8176 * syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp. 8177 8178 util: fix integer overflow check in string_to_uint_ex. 8179 * util.c (string_to_uint_ex): Fix the check for integer overflow 8180 on systems where LONG_MAX == INT_MAX. 8181 8182 Check dumping of io syscalls when descriptor arguments are sensibly large 8183 * tests/tests.h (pipe_maxfd): New prototype. 8184 * tests/pipe_maxfd.c: New file. 8185 * tests/print_maxfd.c: Likewise. 8186 * tests/.gitignore: Add print_maxfd. 8187 * tests/Makefile.am (check_PROGRAMS): Likewise. 8188 (libtests_a_SOURCES): Add pipe_maxfd.c. 8189 * tests/readv.c (main): Use pipe_maxfd() instead of pipe(), 8190 fds[0] instead of 0, fds[1] instead of 1. 8191 * tests/readv.test: Use print_maxfd to specify dump descriptor numbers. 8192 8193 dumpio: remove useless check. 8194 * syscall.c (dumpio): Remove SEN_printargs check. Use tcp->s_ent->sen 8195 directly. 8196 8197 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 8198 8199 Fix dumping of io syscalls when descriptor argument has unused bits set. 8200 * syscall.c (dumpio): Explicitly cast the first argument of syscall 8201 to "int", the same way as the kernel does. 8202 * tests/read-write.c: Include <asm/unistd.h> and "kernel_types.h". 8203 (k_read, k_write): New functions. 8204 (test_dump, main): Use them. 8205 8206 x32: fix preadv2-pwritev2.test. 8207 * tests/preadv2-pwritev2.c: Include "kernel_types.h". 8208 (main): Use kernel_ulong_t instead of unsigned long as types 8209 of arguments of preadv2 and pwritev2 syscalls. 8210 8211 x32: wire up preadv2 and pwritev2 syscalls. 8212 * linux/x32/syscallent.h [546]: Add preadv2 entry. 8213 [547]: Add pwritev2 entry. 8214 8215 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8216 Elvira Khabirova <lineprinter0 (a] gmail.com> 8217 8218 signal: fix omission of field names in sigaction printers. 8219 * signal.c (decode_old_sigaction, decode_new_sigaction): Add printing 8220 of the field names. 8221 * tests/sigaction.awk: Update expected output. 8222 8223 2016-11-29 Elvira Khabirova <lineprinter0 (a] gmail.com> 8224 8225 Make date output format conform to ISO 8601. 8226 * util.c (sprinttime): Make date output conform to ISO 8601. 8227 * tests/utime.c (print_tm): Update expected output. 8228 * tests/xstatx.c (print_time): Likewise. 8229 8230 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 8231 8232 tests: rewrite utime.test without relying on libc utime wrapper. 8233 * tests/utime.c (k_utime): New function, a thin wrapper around 8234 syscall(__NR_utime). 8235 (main): Use it instead of utime. 8236 * tests/utime.test: Update. 8237 8238 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 8239 8240 Fix meaning of negated sets in fault expressions. 8241 Change the parser of fault expression to follow the POLA: 8242 -e fault=!SET 8243 means that all syscalls except those from SET are subject to fault 8244 injection; 8245 -e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2 8246 means that all syscalls except those from SET2 are subject to fault 8247 injection with error code ERRNO2, and all syscalls from SET2 that are 8248 not in SET1 are subject to fault injection with error code ERRNO1. 8249 8250 * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): 8251 Handle negated QUAL_FAULT case differently. 8252 * tests/fault_syntax.test: Add checks of negated sets. 8253 8254 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8255 8256 print_sigevent: fix field names of sigev_value structure. 8257 * print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr" 8258 to "sival_ptr". 8259 * tests/mq_sendrecv.c (main): Update expected output in accordance with 8260 fixed field names. 8261 * tests/timer_create.c (main): Likewise. 8262 8263 tests: add more utime checks. 8264 * tests/utime.c: Include <unistd.h> and <asm/unistd.h>. 8265 (main): Add checks for invalid pointers. 8266 8267 utime: fix omission of field names in utimbuf structure printing. 8268 * utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure, 8269 not as an array (use curly brackets instead of square ones). 8270 Add field names to the output. 8271 * tests/utime.c (main): Update expected output. 8272 8273 mem: print mincore output as an array. 8274 * mem.c (SYS_FUNC(minore)): Print commas between elements. 8275 * tests/mincore.c (print_mincore): Update expected output in accordance 8276 with syscall decoder formatting change. 8277 8278 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8279 8280 util: provide information whether xlat value has been found. 8281 This is necessary for the upcoming change in the output format 8282 of the val3 argument of the FUTEX_WAKE_OP futex command. 8283 8284 * defs.h (printxvals, printxval_searchn): Change return type to int. 8285 (printxval64, printxval, printxval_long): Likewise. Forward the value 8286 returned by printxvals call. 8287 * util.c (printxvals, printxval_searchn): Change return type to int, 8288 return 1 if xlat value has been found, 0 otherwise. 8289 8290 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8291 8292 util: check dflt argument for NULL in printxvals. 8293 This is necessary for the upcoming change in the output format 8294 of the val3 argument of the FUTEX_WAKE_OP futex command. 8295 8296 * util.c (printxvals): Do not print dflt if it is NULL. 8297 8298 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8299 8300 capability: fix omission of capability structure field names. 8301 * capability.c (print_cap_header, print_cap_data): Add field names 8302 to the output. 8303 * tests/caps.awk: Update test output. 8304 8305 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8306 8307 tests: fix "comparison between signed and unsigned" compilation warnings 8308 * tests/readv.c (main): Cast r_len to int. 8309 * tests/preadv2-pwritev2.c (dumpio): Likewise. 8310 8311 aarch64, arm, sparc: add comments on fault injection support in kernel. 8312 * linux/aarch64/set_scno.c: Note the kernel commit that introduced 8313 NT_ARM_SYSTEM_CALL support. 8314 * linux/arm/set_scno.c: Note the kernel commit that introduced 8315 PTRACE_SET_SYSCALL support. 8316 * linux/sparc/set_scno.c: Note the kernel commit that introduced 8317 reloading from the syscall number register. 8318 8319 tests: check -C option. 8320 * tests/strace-C.expected: New file. 8321 * tests/strace-C.test: New test. 8322 * tests/Makefile.am (MISC_TESTS): Add strace-C.test. 8323 (EXTRA_DIST): Add strace-C.expected. 8324 8325 tests: check basic options syntax. 8326 * tests/options-syntax.test: New file. 8327 * tests/Makefile.am (MISC_TESTS): Add it. 8328 8329 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8330 8331 Fix -r option syntax. 8332 While -r option implies -t, it should not literally have the effect 8333 of -t option, e.g. -rr should not increment tflag twice. 8334 8335 * strace.c (init): In the getopt loop, do not increment tflag for each 8336 occurrence of -r option. After the getopt loop, if rflag is set, set 8337 tflag to 1. Issue a warning that -tt has no effect with -r. 8338 8339 2016-11-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8340 8341 Print timeval pair as an array of timeval entries. 8342 * print_timeval.c (print_timeval_item): New function. 8343 (print_timeval_pair): Use it as a print_function in print_array call. 8344 * tests/futimesat.c (main): Update to test new behaviour. 8345 * tests/utimes.c (main): Likewise. 8346 8347 tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests 8348 * tests/futimesat.c: Print tv_sec and tv_usec fields as signed types. 8349 * tests/utimes.c: Likewise. 8350 8351 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8352 8353 alpha: print struct timeval32 consistently. 8354 * defs.h [ALPHA] (timeval32_t): New type. 8355 [ALPHA] (print_timeval32_t): New prototype. 8356 * print_timeval.c [ALPHA] (timeval32_t): Remove. 8357 [ALPHA] (print_timeval32_t): Remove static keyword. 8358 * printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead 8359 of local definition of struct timeval32. Use print_timeval32_t. 8360 8361 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8362 8363 Print struct timeval consistently. 8364 Use print_struct_timeval interface to print struct timeval. 8365 8366 * print_timeval.c (print_struct_timeval): New mpers printer. 8367 * print_timex.c (print_timex): Use it. 8368 * printrusage.c (printrusage): Likewise. 8369 * v4l2.c (print_v4l2_buffer): Likewise. 8370 * tests/getrusage.c (main): Print tv_sec and tv_usec fields as signed. 8371 * tests/waitid.c (sprint_rusage): Likewise. 8372 8373 Suggested-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 8374 8375 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8376 8377 Split print_time.c. 8378 After commit v4.14-136-g151d1d1 that removed the last object common 8379 for timespec and timeval parsers there is no need to keep them all 8380 in a single file. 8381 8382 * print_timespec.c: New file. 8383 * print_timeval.c: Likewise. 8384 * Makefile.am (strace_SOURCES): Add them. 8385 * print_time.c: Move all timespec related code to print_timespec.c. 8386 Move all timeval related code to print_timeval.c. 8387 8388 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 8389 8390 tests: check decoding of threads when a non-leader thread invokes execve 8391 * tests/threads-execve.c: New file. 8392 * tests/threads-execve.test: New test. 8393 * tests/.gitignore: Add threads-execve. 8394 * tests/Makefile.am (check_PROGRAMS): Likewise. 8395 (threads_execve_LDADD): New variable. 8396 (MISC_TESTS): Add threads-execve.test. 8397 8398 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 8399 8400 tests: check decoding of fault injected exit_group syscall. 8401 * tests/answer.c: New file. 8402 * tests/fault_injection-exit_group.expected: Likewise. 8403 * tests/fault_injection-exit_group.test: New test. 8404 * tests/.gitignore: Add answer. 8405 * tests/Makefile.am (check_PROGRAMS): Likewise. 8406 (DECODER_TESTS): Add fault_injection-exit_group.test. 8407 (EXTRA_DIST): Add fault_injection-exit_group.expected. 8408 8409 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 8410 8411 Set PTRACE_O_TRACEEXIT option and handle PTRACE_EVENT_EXIT events. 8412 Do not assume that some syscalls do not generate syscall-exit-stops. 8413 When syscalls fail for any reason they may generate syscall-exit-stops. 8414 8415 The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT 8416 and print the end of unfinished exiting syscall properly. 8417 8418 * exit.c: Remove. 8419 * Makefile.am (strace_SOURCES): Remove exit.c. 8420 * linux/dummy.h (sys_exit): Alias to printargs_d. 8421 * strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit. 8422 (print_event_exit): New function. 8423 (trace): Use it in case of PTRACE_EVENT_EXIT. 8424 * syscall.c (trace_syscall_entering): Remove special handling 8425 of SEN_exit. 8426 8427 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 8428 8429 Change printargs to return RVAL_DECODED. 8430 As printargs is invoked as a generic syscall decoder only and 8431 it is not supposed to print anything on exiting, change printargs 8432 to return RVAL_DECODED so it would not be called on exiting at all. 8433 8434 * util.c (printargs): Print args unconditionally, return RVAL_DECODED. 8435 8436 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 8437 8438 Enhance error diagnostics of exit/exit_group decoder. 8439 * exit.c (SYS_FUNC(exit)): Print the name of syscall that has returned. 8440 8441 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 8442 8443 Restrain from fault injection while the trace executes strace code. 8444 There is little use in injections of faults into syscalls made by strace. 8445 8446 * syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from 8447 tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set. 8448 8449 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 8450 8451 Move two global flags to tracee scope. 8452 A simultaneous use of -p option and tracing of a command available 8453 since commit v4.11-183-gfa8c286 introduces a race condition because 8454 the flags whether the first exec has happened are global. 8455 8456 Fix the race by moving hide_log_until_execve and hide_log_until_execve 8457 global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits 8458 in struct tcb.flags, correspondingly. 8459 8460 * defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log): 8461 New macros. 8462 (hide_log_until_execve): Remove prototype. 8463 * strace.c (skip_one_b_execve, hide_log_until_execve): Remove. 8464 (startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits 8465 in the allocated tcb structure. 8466 (init): Remove initialization of hide_log_until_execve and 8467 skip_one_b_execve. 8468 (print_stopped): Use hide_log() instead of hide_log_until_execve. 8469 (trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead 8470 of skip_one_b_execve. 8471 * syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of 8472 hide_log_until_execve. 8473 (trace_syscall_entering, trace_syscall_exiting): Check hide_log() 8474 instead of hide_log_until_execve. 8475 8476 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 8477 8478 Treat execveat as an execve family syscall. 8479 * syscall.c (trace_syscall_entering): Clear hide_log_until_execve flag 8480 also when SEN_execveat is encountered. 8481 8482 2016-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 8483 8484 Change parser of fault expressions to conform the documentation. 8485 Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work 8486 as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM. 8487 8488 * syscall.c (parse_fault_expression): Remove const qualifier from 8489 "name" and "token: variables, as well as from the return value. 8490 (qual_fault): Remove const qualifier from "name" variables. 8491 Split "name" into comma delimited tokens and pass each token 8492 to individual qual_syscall_ex call. 8493 (qualify): For QUAL_FAULT options, pass the whole option value 8494 to their qualify methods without prior splitting into comma 8495 delimited tokens. 8496 * tests/fault_injection.test: Check it. 8497 * tests/fault_syntax.test: Check empty syscall sets. 8498 8499 2016-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 8500 8501 Simplify parse_fault_expression. 8502 * syscall.c (parse_fault_expression): Rewrite iterator over strtok_r 8503 in a more concise way. 8504 8505 2016-11-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8506 8507 Fix omission of field names in printers of timeval structure. 8508 * print_time.c (time_fmt): Remove. 8509 (timeval_fmt): New constant. 8510 (print_timeval_t, sprint_timeval, print_timeval32_t, sprint_timeval32): 8511 Use it instead of time_fmt. 8512 * print_timex.c (print_timex): Print field names of the time field. 8513 * printrusage.c (printrusage, printrusage32): Print field names 8514 of ru_utime and ru_stime fields. 8515 * tests/adjtimex.c (main): Add field names to expected output. 8516 * tests/clock_nanosleep.c (main): Likewise. 8517 * tests/futimesat.c (main): Likewise. 8518 * tests/getrusage.c (main): Likewise. 8519 * tests/nanosleep.c (main): Likewise. 8520 * tests/oldselect.expected: Likewise. 8521 * tests/utimes.c (main): Likewise. 8522 * tests/wait4.c (sprint_rusage): Likewise. 8523 * tests/waitid.c (sprint_rusage): Likewise. 8524 * tests/xetitimer.c (main): Likewise. 8525 * tests/xettimeofday.c (main): Likewise. 8526 * tests/xselect.c (main): Likewise. 8527 8528 Fix omission of field names in printers of timespec structure. 8529 * print_time.c (timespec_fmt): New constant. 8530 (print_timespec_t, sprint_timespec): Use it instead of time_fmt. 8531 * tests/aio.c: Add field names to expected output. 8532 * tests/clock_nanosleep.c (main): Likewise. 8533 * tests/clock_xettime.c (main): Likewise. 8534 * tests/futex.c (main): Likewise. 8535 * tests/mq_sendrecv.c (do_send, do_recv): Likewise. 8536 * tests/nanosleep.c (main): Likewise. 8537 * tests/ppoll-v.expected: Likewise. 8538 * tests/ppoll.expected: Likewise. 8539 * tests/pselect6.c (main): Likewise. 8540 * tests/recvmmsg-timeout.c (main): Likewise. 8541 * tests/restart_syscall.c (main): Likewise. 8542 * tests/rt_sigtimedwait.c (iterate, main): Likewise. 8543 * tests/sched_rr_get_interval.c (main): Likewise. 8544 * tests/semop.c (main): Likewise. 8545 * tests/strace-T.expected: Likewise. 8546 * tests/timer_xettime.c (main): Likewise. 8547 * tests/timerfd_xettime.c (main): Likewise. 8548 * tests/utimensat.c (print_ts): Likewise. 8549 8550 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 8551 8552 tests: robustify prctl-name.test against unrelated prctl invocations. 8553 * tests/prctl-name.test: Filter out unrelated PR_GET_* prctl calls. 8554 8555 2016-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 8556 8557 tests: cleanup prctl-name.c. 8558 * tests/prctl-name.c (main): Remove "len" variable, rename "len1" 8559 to "len". Remove "name1" variable, use "name" instead. 8560 8561 Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h. 8562 * linux/32/ioctls_inc_align32.h: Regenerate. 8563 * linux/32/ioctls_inc_align64.h: Likewise. 8564 * linux/64/ioctls_inc.h: Likewise. 8565 * linux/arm/ioctls_arch0.h: Likewise. 8566 * linux/i386/ioctls_arch0.h: Likewise. 8567 * linux/powerpc/ioctls_arch0.h: Likewise. 8568 * linux/s390/ioctls_arch0.h: Likewise. 8569 * linux/s390x/ioctls_arch0.h: Likewise. 8570 * linux/x32/ioctls_inc0.h: Likewise. 8571 * linux/x86_64/ioctls_arch0.h: Likewise. 8572 8573 maint: add more workarounds for alpha and powerpc. 8574 * maint/ioctls_sym.sh: Skip asm/core_*.h. Filter out from 8575 asm-generic/ioctls.h those macros that are defined using unavailable 8576 struct termios2 on alpha and powerpc. 8577 8578 2016-11-22 Andreas Schwab <schwab (a] linux-m68k.org> 8579 8580 Add ioctl definitions for 16-bit alignment. 8581 * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align16.h. 8582 * linux/32/ioctls_inc_align16.h: New file. 8583 * linux/32/ioctls_inc.h [M68K]: Include it. 8584 8585 2016-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 8586 8587 maint: move KVM_* constants from ioctls_inc.h to ioctls_arch.h. 8588 * maint/ioctls_gen.sh: Place constants defined in linux/kvm.h 8589 into ioctls_arch.h instead of ioctls_inc.h. 8590 8591 2016-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 8592 8593 maint: harmonize use of ioctls_sym.sh. 8594 * maint/ioctls_gen.sh: Consistently specify INCLUDES for all 8595 ioctls_sym.sh invocations. Use $mydir to specify ioctls_sym.sh 8596 location. 8597 8598 maint: rework workarounds for linux/kvm.h. 8599 * maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds. 8600 Skip linux/kvm.h on those architectures that have no asm/kvm.h file. 8601 Introduce post-process workarounds, add post-process workarounds 8602 for linux/kvm.h. 8603 8604 2016-11-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 8605 8606 Restructure strace.1. 8607 * strace.1 (OPTIONS): Add subsections. 8608 (PROBLEMS): Rename to REPORTING BUGS. 8609 (SEE ALSO): Move to the bottom. 8610 8611 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8612 8613 prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options. 8614 * xlat/pr_fp_mode.in: New file. 8615 * prctl.c: Include "xlat/pr_fp_mode.h". 8616 (SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE 8617 options. 8618 8619 prctl: add braces for conditional blocks with else/else-if blocks having braces 8620 8621 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8622 8623 prctl: cast arg2 to int in PR_SET_PTRACER handler. 8624 Kernel code does this when compares it with -1 (apart from comparing it with 8625 PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c. 8626 8627 * prctl.c (SYS_FUNC(prctl)) <PR_SET_PTRACER>: Cast arg2 to int before 8628 comparing it with -1. 8629 8630 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8631 8632 prctl: use getarg_ull for option value retrieval. 8633 The prctl syscall does not use compat on x32/n32, so argument types 8634 are in fact kernel_ulong_t. 8635 8636 * prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead 8637 of "%#lx". 8638 (SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3, 8639 arg4, arg5 variables of type unsigned long long. Use them in printing 8640 routines. 8641 (SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr 8642 variable of type unsigned long long. Print it as "%#llx" instead of 8643 "%#lx". 8644 8645 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8646 8647 block: add some definitions from <linux/blkpg.h> 8648 This is done in order to fix build error on old distributions where 8649 struct blkpg_ioctl_arg declaration is broken: 8650 8651 In file included from block.c:35: 8652 /usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token 8653 block.c: In function 'print_blkpg_req': 8654 block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data' 8655 8656 (from SLE10) 8657 8658 * block.c: Include <linux/ioctl.h> instead of <linux/blkpg.h>. 8659 (BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros. 8660 (struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions, 8661 copied from blkpg_ioctl_arg and blkpg_partition structures defined 8662 in <linux/blkpg.h>. 8663 8664 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8665 8666 xlat: add values to new ARCH_* constants. 8667 Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE 8668 and they would never be defined in user space. 8669 8670 * xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants. 8671 8672 2016-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 8673 8674 prctl: include <linux/prctl.h> instead of <sys/prctl.h> 8675 There are no users of prctl function in prctl.c, and all the rest 8676 is provided by <linux/prctl.h> anyway. 8677 8678 * prctl.c: Include <linux/prctl.h> instead of <sys/prctl.h>. 8679 8680 2016-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 8681 8682 tests: check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. 8683 * tests/prctl-name.c: New file. 8684 * tests/prctl-name.test: New test. 8685 * tests/.gitignore: Add prctl-name. 8686 * tests/Makefile.am (check_PROGRAMS): Likewise. 8687 (DECODER_TESTS): Add prctl-name.test. 8688 8689 prctl: fix printing of PR_SET_NAME's argument. 8690 * prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED 8691 instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME 8692 operations. 8693 8694 printstr_ex: fix handling of last byte when QUOTE_0_TERMINATED bit set. 8695 * util.c (printstr_ex): Simplify handling of size == 0 case. 8696 Do not artificially decrement size when QUOTE_0_TERMINATED bit is set. 8697 Ensure that str[size] byte is non-zero if it hasn't been fetched. 8698 8699 2016-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 8700 8701 printstr_ex: handle QUOTE_0_TERMINATED bit consistently. 8702 When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints 8703 the fetched string as a NUL-terminated. 8704 After this change, the string is being fetched as a NUL-terminated, too. 8705 8706 * util.c (printstr_ex): Use umovestr instead of umoven 8707 if QUOTE_0_TERMINATED bit is set. 8708 8709 2016-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 8710 8711 Cleanup fetch part of printstr_ex. 8712 * util.c (printstr_ex): Initialize "style" early, unify error handling. 8713 8714 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 8715 8716 Update prctl ARCH_* constants. 8717 * xlat/archvals.in: Add ARCH_MAP_VDSO_X32, ARCH_MAP_VDSO_32, and 8718 ARCH_MAP_VDSO_64 introduced by linux kernel commit v4.9-rc1~155^2~6. 8719 8720 Update V4L2_* constants. 8721 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced 8722 by linux kernel commit v4.9-rc4~7^2~422. 8723 * xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced 8724 by linux kernel commit v4.9-rc4~7^2~422. 8725 8726 Update fs *_MAGIC constants. 8727 * xlat/fsmagic.in: Add DAXFS_MAGIC introduced by linux kernel commit 8728 v4.9-rc1~45^2^2~5. 8729 8730 Update MS_* constants. 8731 * xlat/mount_flags.in: Add MS_NOREMOTELOCK introduced 8732 by linux kernel commit v4.9-rc1~57^2~1^2~7. 8733 8734 Update FALLOC_* constants. 8735 * xlat/falloc_flags.in: Add FALLOC_FL_UNSHARE_RANGE introduced 8736 by linux kernel commit v4.9-rc1~31^2~69. 8737 8738 Update BTRFS_* constants. 8739 * xlat/btrfs_features_compat_ro.in: Add 8740 BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID introduced 8741 by linux kernel commit v4.9-rc1~7^2^2~4. 8742 8743 Update BPF_* constants. 8744 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_PERF_EVENT introduced 8745 by linux kernel commit v4.9-rc1~127^2~302^2~4. 8746 8747 2016-11-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8748 8749 make-dist: use HEAD for making distribution package. 8750 * make-dist: Use HEAD commit instead of master branch by default. 8751 8752 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 8753 8754 tests: fix btrfs build error on some old systems. 8755 Fix the following build error on SLE 11 SP4: 8756 8757 btrfs.c: In function 'btrfs_test_dev_replace_ioctl': 8758 btrfs.c:1570: error: unknown field 'start' specified in initializer 8759 8760 * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization 8761 of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the 8762 designated initializer. 8763 8764 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 8765 8766 tests: check decoding of ERESTARTSYS error code. 8767 * tests/erestartsys.c: New file. 8768 * tests/erestartsys.test: New test. 8769 * tests/.gitignore: Add erestartsys. 8770 * tests/Makefile.am (check_PROGRAMS): Likewise. 8771 (DECODER_TESTS): Add erestartsys.test. 8772 8773 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 8774 8775 Fix signame usage in qual_signal. 8776 Do not assume that the string returned by signame starts with "SIG" 8777 prefix, this is not always the case. 8778 8779 * syscall.c (qual_signal): Skip signame return value 8780 when it does not have "SIG" prefix. 8781 8782 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 8783 8784 tests: check -e signal=set syntax. 8785 * tests/qual_signal.c: New file. 8786 * tests/qual_signal.test: New test. 8787 * tests/.gitignore: Add qual_signal. 8788 * tests/Makefile.am (check_PROGRAMS): Likewise. 8789 (MISC_TESTS): Add qual_signal.test. 8790 8791 2016-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 8792 8793 Make -e fault= expressions cumulative. 8794 Change the way how subsequent -e fault= expressions are interpreted 8795 to implement a cumulative behavior. For example, 8796 -e fault=file:when=3+ -e fault=chdir 8797 now specifies that all chdir syscalls and 3+ file related syscalls 8798 except chdir are subject for fault injection. 8799 8800 * syscall.c (qualify): Do not reset qual_vec for QUAL_FAULT. 8801 * tests/fault_injection.test: Check it. 8802 8803 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8804 8805 tests: check syscall fault injection. 8806 * tests/fault_injection.c: New file. 8807 * tests/fault_injection.test: New test. 8808 * tests/fault_syntax.test: Likewise. 8809 * tests/.gitignore: Add fault_injection. 8810 * tests/Makefile.am (check_PROGRAMS): Likewise. 8811 (MISC_TESTS): Add fault_injection.test and fault_syntax.test. 8812 8813 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8814 8815 Implement syscall fault injection. 8816 Introduce new -e fault=EXPR syntax that can be used to specify a subset 8817 of syscalls that are subject of syscall fault injection, an error code 8818 that has to be injected, and a frequency of injection. 8819 8820 The expression specifying syscall fault injection has the following 8821 format: SET[:error=ERRNO][:when=FIRST[+[STEP]]] 8822 where only SET is a required part and all the rest is optional. 8823 8824 The method used to implement syscall fault injection is the following: 8825 on entering syscall the syscall number is substituted by an invalid 8826 syscall number -1, and on exiting syscall the error code returned by 8827 the kernel is substituted with the error code specified in the fault 8828 expression. 8829 8830 This implementaion is based on the prototype developed 8831 by Nahim El Atmani as a part of his GSoC 2016 strace project. 8832 8833 * defs.h (struct fault_opts): New forward declaration. 8834 (struct tcb): Add fault_vec field. 8835 (TCB_FAULT_INJ, QUAL_FAULT): New macros. 8836 * strace.1: Document -e fault expression syntax. 8837 * strace.c (usage): Mention -e fault expression. 8838 (droptcb): Deallocate fault_vec member. 8839 * syscall.c (qual_fault, arch_set_scno, arch_set_error): New prototypes. 8840 (qual_options): Add "fault" option. 8841 (struct fault_opts): New structure. 8842 (num_faults): New variable. 8843 (fault_vec): New array. 8844 (syscall_fault_injected, tcb_fault_opts, reallocate_fault, 8845 find_errno_by_name, qual_syscall_ex, strip_prefix, parse_fault_token, 8846 parse_fault_expression, qual_fault, inject_syscall_fault_entering, 8847 update_syscall_fault_exiting): New functions. 8848 (qual_syscall): Use qual_syscall_ex. 8849 (qualify_one): Add argument: a pointer to struct fault_opts, all callers 8850 changed. Copy struct fault_opts from the pointer to fault_vec. 8851 Use reallocate_fault. 8852 (qualify_scno, qualify_syscall_class, qualify_syscall_name): Add 8853 argument: a pointer to struct fault_opts. 8854 (qualify): Use reallocate_fault. Do not check "all" class for 8855 QUAL_FAULT qualifier. 8856 (lookup_class): Check for "all" class. 8857 (trace_syscall_entering): Use inject_syscall_fault_entering. 8858 (trace_syscall_exiting): Use update_syscall_fault_exiting. Clear 8859 TCB_FAULT_INJ flag along with TCB_INSYSCALL. Print " (INJECTED)" suffix 8860 when the syscall has been injected successfully. 8861 [ARCH_REGS_FOR_GETREGSET && !HAVE_GETREGS_OLD] 8862 (ptrace_setregset): New function. 8863 (ptrace_setregset_or_setregs): Define to ptrace_setregset. 8864 [ARCH_REGS_FOR_GETREGS && !HAVE_GETREGS_OLD] 8865 (ptrace_setregs): New function. 8866 (ptrace_setregset_or_setregs): Define to ptrace_setregs. 8867 [ptrace_setregset_or_setregs] (set_regs): New function. 8868 Include "set_scno.c" and "set_error.c" 8869 * NEWS: Mention this enhancement. 8870 8871 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8872 8873 Implement arch specific methods of changing syscall number and error code 8874 This introduces arch_set_error and arch_set_scno functions for each 8875 supported architecture, needed to implement syscall fault injection. 8876 8877 * linux/aarch64/set_error.c: New file. 8878 * linux/aarch64/set_scno.c: Likewise. 8879 * linux/alpha/set_error.c: Likewise. 8880 * linux/alpha/set_scno.c: Likewise. 8881 * linux/arc/set_error.c: Likewise. 8882 * linux/arc/set_scno.c: Likewise. 8883 * linux/arm/set_error.c: Likewise. 8884 * linux/arm/set_scno.c: Likewise. 8885 * linux/avr32/set_error.c: Likewise. 8886 * linux/avr32/set_scno.c: Likewise. 8887 * linux/bfin/set_error.c: Likewise. 8888 * linux/bfin/set_scno.c: Likewise. 8889 * linux/crisv10/set_error.c: Likewise. 8890 * linux/crisv10/set_scno.c: Likewise. 8891 * linux/crisv32/set_error.c: Likewise. 8892 * linux/crisv32/set_scno.c: Likewise. 8893 * linux/hppa/set_error.c: Likewise. 8894 * linux/hppa/set_scno.c: Likewise. 8895 * linux/i386/set_error.c: Likewise. 8896 * linux/i386/set_scno.c: Likewise. 8897 * linux/ia64/set_error.c: Likewise. 8898 * linux/ia64/set_scno.c: Likewise. 8899 * linux/m68k/set_error.c: Likewise. 8900 * linux/m68k/set_scno.c: Likewise. 8901 * linux/metag/set_error.c: Likewise. 8902 * linux/metag/set_scno.c: Likewise. 8903 * linux/microblaze/set_error.c: Likewise. 8904 * linux/microblaze/set_scno.c: Likewise. 8905 * linux/mips/set_error.c: Likewise. 8906 * linux/mips/set_scno.c: Likewise. 8907 * linux/nios2/set_error.c: Likewise. 8908 * linux/nios2/set_scno.c: Likewise. 8909 * linux/or1k/set_error.c: Likewise. 8910 * linux/or1k/set_scno.c: Likewise. 8911 * linux/powerpc/set_error.c: Likewise. 8912 * linux/powerpc/set_scno.c: Likewise. 8913 * linux/powerpc64/set_error.c: Likewise. 8914 * linux/powerpc64/set_scno.c: Likewise. 8915 * linux/riscv/set_error.c: Likewise. 8916 * linux/riscv/set_scno.c: Likewise. 8917 * linux/s390/set_error.c: Likewise. 8918 * linux/s390/set_scno.c: Likewise. 8919 * linux/s390x/set_error.c: Likewise. 8920 * linux/s390x/set_scno.c: Likewise. 8921 * linux/sh/set_error.c: Likewise. 8922 * linux/sh/set_scno.c: Likewise. 8923 * linux/sh64/set_error.c: Likewise. 8924 * linux/sh64/set_scno.c: Likewise. 8925 * linux/sparc/set_error.c: Likewise. 8926 * linux/sparc/set_scno.c: Likewise. 8927 * linux/sparc64/set_error.c: Likewise. 8928 * linux/sparc64/set_scno.c: Likewise. 8929 * linux/tile/set_error.c: Likewise. 8930 * linux/tile/set_scno.c: Likewise. 8931 * linux/x32/set_error.c: Likewise. 8932 * linux/x32/set_scno.c: Likewise. 8933 * linux/x86_64/set_error.c: Likewise. 8934 * linux/x86_64/set_scno.c: Likewise. 8935 * linux/xtensa/set_error.c: Likewise. 8936 * linux/xtensa/set_scno.c: Likewise. 8937 * Makefile.am (EXTRA_DIST): Add them. 8938 8939 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8940 8941 cris: add syscall tables. 8942 The incomplete CRIS support introduced by commit v4.5.18-77-gea0e6e8 8943 should not have been merged because it lacks essential parts, e.g. 8944 syscall tables. 8945 8946 This change adds missing syscall tables for crisv10 and crisv32. 8947 8948 * linux/crisv10/syscallent.h: New file. 8949 * linux/crisv32/syscallent.h: Likewise. 8950 * Makefile.am (EXTRA_DIST): Add them. 8951 8952 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8953 8954 Introduce string_to_uint_ex and string_to_uint_upto functions. 8955 * defs.h (string_to_uint_ex): New prototype. 8956 (string_to_uint_upto): New function, a thin wrapper around 8957 string_to_uint_ex. 8958 * util.c (string_to_uint_ex): New function. 8959 (string_to_uint): Change into a thin wrapper around string_to_uint_upto. 8960 * strace.c (init): Use string_to_uint_upto. 8961 * syscall.c (qualify_scno, qual_signal, qual_desc): Use 8962 string_to_uint_upto instead of string_to_uint. 8963 8964 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 8965 8966 Split qual_syscall into separate functions. 8967 Split qual_syscall into qualify_scno, qualify_syscall_class, 8968 and qualify_syscall_name. 8969 This might be needed later to implement syscall fault injection. 8970 8971 * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): 8972 New functions. 8973 (qual_syscall): Use them. 8974 8975 2016-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 8976 8977 xtensa: wire up new syscalls. 8978 * linux/xtensa/syscallent.h [342..347]: New entries. 8979 8980 2016-11-14 Dmitry V. Levin <ldv (a] altlinux.org> 8981 8982 arc: wire up new syscalls. 8983 * linux/arc/syscallent.h [247, 248]: New entries. 8984 8985 2016-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 8986 8987 tests: fix potential compilation warning in ioctl_block.c. 8988 ioctl_block.c:48: warning: 'init_magic' defined but not used 8989 8990 * tests/ioctl_block.c (init_magic): Define only for 8991 [BLKTRACESETUP && HAVE_STRUCT_BLK_USER_TRACE_SETUP]. 8992 8993 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8994 8995 Add support for pkey_mprotect, pkey_alloc, pkey_free syscalls. 8996 * linux/32/syscallent.h: Add syscall entries for pkey_* calls. 8997 * linux/64/syscallent.h: Likewise. 8998 * linux/arm/syscallent.h: Likewise. 8999 * linux/i386/syscallent.h: Likewise. 9000 * linux/mips/syscallent-n32.h: Likewise. 9001 * linux/mips/syscallent-n64.h: Likewise. 9002 * linux/mips/syscallent-o32.h: Likewise. 9003 * linux/x32/syscallent.h: Likewise. 9004 * linux/x86_64/syscallent.h: Likewise. 9005 * mem.c (do_mprotect): New function, common handler for mprotect and 9006 pkey_mprotect. 9007 (SYS_FUNC(mprotect)): Convert to wrapper around do_mprotect. 9008 (SYS_FUNC(pkey_mprotect)): New function. 9009 * xlat/pkey_access.in: New file. 9010 * pkeys.c: New file containing implementation of pkey_alloc and 9011 pkey_free. 9012 * Makefile.am: Add it. 9013 * NEWS: Mention this enhancement. 9014 * tests/.gitignore: Add pkey_alloc, pkey_free, and pkey_mprotect. 9015 * tests/Makefile.am (check_PROGRAMS): Likewise. 9016 (DECODER_TESTS): Add pkey_alloc.test, pkey_free.test, and 9017 pkey_mprotect.test. 9018 * tests/pkey_alloc.c: New file. 9019 * tests/pkey_free.c: Likewise. 9020 * tests/pkey_mprotect.c: Likewise. 9021 * tests/pkey_alloc.test: New test. 9022 * tests/pkey_free.test: Likewise. 9023 * tests/pkey_mprotect.test: Likewise. 9024 9025 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9026 9027 tests: fix "constant is too large" compilation warnings. 9028 alarm.c: In function 'main': 9029 alarm.c:41: warning: integer constant is too large for 'long' type 9030 aio.c: In function 'main': 9031 aio.c:162: warning: integer constant is too large for 'long' type 9032 btrfs.c: In function 'btrfs_test_sync_ioctls': 9033 btrfs.c:202: warning: integer constant is too large for 'long' type 9034 btrfs.c: In function 'btrfs_test_subvol_ioctls': 9035 btrfs.c:289: warning: integer constant is too large for 'long' type 9036 btrfs.c:290: warning: integer constant is too large for 'long' type 9037 dup2.c: In function 'main': 9038 dup2.c:12: warning: integer constant is too large for 'long' type 9039 dup2.c:13: warning: integer constant is too large for 'long' type 9040 dup3.c: In function 'main': 9041 dup3.c:13: warning: integer constant is too large for 'long' type 9042 dup3.c:14: warning: integer constant is too large for 'long' type 9043 epoll_create.c: In function 'main': 9044 epoll_create.c:12: warning: integer constant is too large for 'long' type 9045 epoll_ctl.c: In function 'invoke_syscall': 9046 epoll_ctl.c:14: warning: integer constant is too large for 'long' type 9047 faccessat.c: In function 'main': 9048 faccessat.c:13: warning: integer constant is too large for 'long' type 9049 fchdir.c: In function 'main': 9050 fchdir.c:12: warning: integer constant is too large for 'long' type 9051 struct_flock.c: In function 'invoke_test_syscall': 9052 struct_flock.c:48: warning: integer constant is too large for 'long' type 9053 struct_flock.c: In function 'test_flock_einval': 9054 struct_flock.c:58: warning: integer constant is too large for 'long' type 9055 struct_flock.c:59: warning: integer constant is too large for 'long' type 9056 fcntl64.c: In function 'test_flock64_einval': 9057 fcntl64.c:44: warning: integer constant is too large for 'long' type 9058 fcntl64.c:45: warning: integer constant is too large for 'long' type 9059 fcntl.c: In function 'test_flock64_einval': 9060 fcntl.c:44: warning: integer constant is too large for 'long' type 9061 fcntl.c:45: warning: integer constant is too large for 'long' type 9062 fdatasync.c: In function 'main': 9063 fdatasync.c:12: warning: integer constant is too large for 'long' type 9064 flock.c: In function 'main': 9065 flock.c:13: warning: integer constant is too large for 'long' type 9066 xstatx.c: In function 'main': 9067 xstatx.c:255: warning: integer constant is too large for 'long' type 9068 xstatx.c:290: warning: integer constant is too large for 'long' type 9069 xstatx.c:290: warning: integer constant is too large for 'long' type 9070 xstatx.c:290: warning: integer constant is too large for 'long' type 9071 xstatx.c:290: warning: integer constant is too large for 'long' type 9072 xstatx.c:290: warning: integer constant is too large for 'long' type 9073 xstatx.c:290: warning: integer constant is too large for 'long' type 9074 xstatx.c:290: warning: integer constant is too large for 'long' type 9075 xstatx.c:290: warning: integer constant is too large for 'long' type 9076 xstatx.c:290: warning: integer constant is too large for 'long' type 9077 xstatx.c:294: warning: integer constant is too large for 'long' type 9078 xstatx.c:294: warning: integer constant is too large for 'long' type 9079 xstatx.c:294: warning: integer constant is too large for 'long' type 9080 xstatx.c:294: warning: integer constant is too large for 'long' type 9081 xstatx.c:294: warning: integer constant is too large for 'long' type 9082 xstatx.c:294: warning: integer constant is too large for 'long' type 9083 xstatx.c:294: warning: integer constant is too large for 'long' type 9084 xstatx.c:294: warning: integer constant is too large for 'long' type 9085 xstatx.c:294: warning: integer constant is too large for 'long' type 9086 xstatfsx.c: In function 'main': 9087 xstatfsx.c:113: warning: integer constant is too large for 'long' type 9088 fsync.c: In function 'main': 9089 fsync.c:12: warning: integer constant is too large for 'long' type 9090 ftruncate64.c: In function 'main': 9091 ftruncate64.c:39: warning: integer constant is too large for 'long' type 9092 futimesat.c: In function 'main': 9093 futimesat.c:52: warning: integer constant is too large for 'long' type 9094 futimesat.c:59: warning: integer constant is too large for 'long' type 9095 get_mempolicy.c: In function 'main': 9096 get_mempolicy.c:83: warning: integer constant is too large for 'long' type 9097 get_mempolicy.c:84: warning: integer constant is too large for 'long' type 9098 get_mempolicy.c:85: warning: integer constant is too large for 'long' type 9099 get_mempolicy.c:86: warning: integer constant is too large for 'long' type 9100 getdents.c: In function 'main': 9101 getdents.c:109: warning: integer constant is too large for 'long' type 9102 getdents.c:110: warning: integer constant is too large for 'long' type 9103 getdents.c:114: warning: integer constant is too large for 'long' type 9104 getdents64.c: In function 'main': 9105 getdents64.c:114: warning: integer constant is too large for 'long' type 9106 getdents64.c:115: warning: integer constant is too large for 'long' type 9107 getdents64.c:119: warning: integer constant is too large for 'long' type 9108 xgetrlimit.c: In function 'main': 9109 xgetrlimit.c:71: warning: integer constant is too large for 'long' type 9110 ioctl_block.c:44: warning: integer constant is too large for 'long' type 9111 ioctl_block.c: In function 'main': 9112 ioctl_block.c:136: warning: integer constant is too large for 'long' type 9113 ioctl_block.c:137: warning: integer constant is too large for 'long' type 9114 ioctl_block.c:161: warning: integer constant is too large for 'long' type 9115 ioctl_block.c:170: warning: integer constant is too large for 'long' type 9116 ioctl_block.c:171: warning: integer constant is too large for 'long' type 9117 ioctl_evdev.c:42: warning: integer constant is too large for 'long' type 9118 ioctl_mtd.c:46: warning: integer constant is too large for 'long' type 9119 ioctl_rtc.c:40: warning: integer constant is too large for 'long' type 9120 ioperm.c: In function 'main': 9121 ioperm.c:12: warning: integer constant is too large for 'long' type 9122 ioctl_v4l2.c: In function 'main': 9123 ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type 9124 ipc.c: In function 'ipc_call': 9125 ipc.c:52: warning: integer constant is too large for 'long' type 9126 kill.c: In function 'main': 9127 kill.c:59: warning: integer constant is too large for 'long' type 9128 kill.c:62: warning: integer constant is too large for 'long' type 9129 kill.c:63: warning: integer constant is too large for 'long' type 9130 kill.c:68: warning: integer constant is too large for 'long' type 9131 linkat.c: In function 'main': 9132 linkat.c:14: warning: integer constant is too large for 'long' type 9133 linkat.c:15: warning: integer constant is too large for 'long' type 9134 mbind.c: In function 'main': 9135 mbind.c:41: warning: integer constant is too large for 'long' type 9136 mbind.c:43: warning: integer constant is too large for 'long' type 9137 mbind.c:44: warning: integer constant is too large for 'long' type 9138 migrate_pages.c: In function 'main': 9139 migrate_pages.c:41: warning: integer constant is too large for 'long' type 9140 In file included from mkdirat.c:10: 9141 umode_t.c: In function 'test_syscall': 9142 umode_t.c:47: warning: integer constant is too large for 'long' type 9143 mknod.c: In function 'call_mknod': 9144 mknod.c:16: warning: integer constant is too large for 'long' type 9145 mknod.c: In function 'main': 9146 mknod.c:23: warning: integer constant is too large for 'long' type 9147 mknod.c:49: warning: integer constant is too large for 'long' type 9148 mknod.c:56: warning: integer constant is too large for 'long' type 9149 mknodat.c:12: warning: integer constant is too large for 'long' type 9150 mknodat.c: In function 'call_mknodat': 9151 mknodat.c:17: warning: integer constant is too large for 'long' type 9152 mknodat.c: In function 'main': 9153 mknodat.c:24: warning: integer constant is too large for 'long' type 9154 mknodat.c:50: warning: integer constant is too large for 'long' type 9155 mknodat.c:57: warning: integer constant is too large for 'long' type 9156 mmap.c: In function 'main': 9157 mmap.c:51: warning: integer constant is too large for 'long' type 9158 move_pages.c: In function 'print_stat_pages': 9159 move_pages.c:139: warning: integer constant is too large for 'long' type 9160 move_pages.c: In function 'print_move_pages': 9161 move_pages.c:166: warning: integer constant is too large for 'long' type 9162 move_pages.c: In function 'main': 9163 move_pages.c:188: warning: integer constant is too large for 'long' type 9164 mq_sendrecv.c: In function 'main': 9165 mq_sendrecv.c:238: warning: integer constant is too large for 'long' type 9166 mq_sendrecv.c:401: warning: integer constant is too large for 'long' type 9167 mq_sendrecv.c:403: warning: integer constant is too large for 'long' type 9168 nsyscalls.c: In function 'test_syscall': 9169 nsyscalls.c:64: warning: integer constant is too large for 'long' type 9170 nsyscalls.c:65: warning: integer constant is too large for 'long' type 9171 nsyscalls.c:66: warning: integer constant is too large for 'long' type 9172 nsyscalls.c:67: warning: integer constant is too large for 'long' type 9173 nsyscalls.c:68: warning: integer constant is too large for 'long' type 9174 nsyscalls.c:69: warning: integer constant is too large for 'long' type 9175 preadv-pwritev.c: In function 'main': 9176 preadv-pwritev.c:162: warning: comparison between signed and unsigned 9177 prlimit64.c: In function 'main': 9178 prlimit64.c:65: warning: integer constant is too large for 'long' type 9179 prlimit64.c:70: warning: integer constant is too large for 'long' type 9180 remap_file_pages.c: In function 'main': 9181 remap_file_pages.c:42: warning: integer constant is too large for 'long' type 9182 remap_file_pages.c:43: warning: integer constant is too large for 'long' type 9183 remap_file_pages.c:45: warning: integer constant is too large for 'long' type 9184 renameat.c: In function 'main': 9185 renameat.c:15: warning: integer constant is too large for 'long' type 9186 renameat.c:16: warning: integer constant is too large for 'long' type 9187 rt_sigqueueinfo.c: In function 'main': 9188 rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type 9189 rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo': 9190 rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type 9191 rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type 9192 rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type 9193 rt_tgsigqueueinfo.c: In function 'main': 9194 rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type 9195 sendfile.c: In function 'main': 9196 sendfile.c:110: warning: integer constant is too large for 'long' type 9197 sendfile64.c: In function 'main': 9198 sendfile64.c:100: warning: integer constant is too large for 'long' type 9199 set_mempolicy.c: In function 'main': 9200 set_mempolicy.c:129: warning: integer constant is too large for 'long' type 9201 set_mempolicy.c:130: warning: integer constant is too large for 'long' type 9202 setrlimit.c: In function 'main': 9203 setrlimit.c:44: warning: integer constant is too large for 'long' type 9204 socketcall.c: In function 'test_socketcall': 9205 socketcall.c:58: warning: integer constant is too large for 'long' type 9206 splice.c: In function 'main': 9207 splice.c:41: warning: integer constant is too large for 'long' type 9208 splice.c:42: warning: integer constant is too large for 'long' type 9209 splice.c:45: warning: integer constant is too large for 'long' type 9210 splice.c:46: warning: integer constant is too large for 'long' type 9211 symlinkat.c: In function 'main': 9212 symlinkat.c:12: warning: integer constant is too large for 'long' type 9213 sync_file_range.c: In function 'main': 9214 sync_file_range.c:42: warning: integer constant is too large for 'long' type 9215 sync_file_range.c:43: warning: integer constant is too large for 'long' type 9216 syslog.c: In function 'main': 9217 syslog.c:14: warning: integer constant is too large for 'long' type 9218 tee.c: In function 'main': 9219 tee.c:41: warning: integer constant is too large for 'long' type 9220 tee.c:42: warning: integer constant is too large for 'long' type 9221 timer_create.c: In function 'main': 9222 timer_create.c:52: warning: integer constant is too large for 'long' type 9223 timer_create.c:84: warning: integer constant is too large for 'long' type 9224 timer_create.c:85: warning: integer constant is too large for 'long' type 9225 truncate64.c: In function 'main': 9226 truncate64.c:41: warning: integer constant is too large for 'long' type 9227 xgetrlimit.c: In function 'main': 9228 xgetrlimit.c:71: warning: integer constant is too large for 'long' type 9229 umode_t.c: In function 'test_syscall': 9230 umode_t.c:46: warning: integer constant is too large for 'long' type 9231 unlinkat.c: In function 'main': 9232 unlinkat.c:13: warning: integer constant is too large for 'long' type 9233 waitpid.c: In function 'main': 9234 waitpid.c:43: warning: integer constant is too large for 'long' type 9235 waitid.c: In function 'poison': 9236 waitid.c:141: warning: integer constant is too large for 'long' type 9237 xetpriority.c: In function 'main': 9238 xetpriority.c:15: warning: integer constant is too large for 'long' type 9239 xetpriority.c:19: warning: integer constant is too large for 'long' type 9240 xetpriority.c:20: warning: integer constant is too large for 'long' type 9241 xetpgid.c: In function 'main': 9242 xetpgid.c:43: warning: integer constant is too large for 'long' type 9243 xetpgid.c:47: warning: integer constant is too large for 'long' type 9244 xetpgid.c:48: warning: integer constant is too large for 'long' type 9245 9246 (SLES 11SP4, i386) 9247 9248 * tests/alarm.c (main): Add proper suffix to integer constant. 9249 * tests/aio.c (main): Likewise. 9250 * tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise. 9251 * tests/dup2.c (main): Likewise. 9252 * tests/dup3.c (main): Likewise. 9253 * tests/epoll_create.c (main): Likewise. 9254 * tests/epoll_ctl.c (invoke_syscall): Likewise. 9255 * tests/faccessat.c (main): Likewise. 9256 * tests/fchdir.c (main): Likewise. 9257 * tests/fcntl.c (test_flock64_einval): Likewise. 9258 * tests/fcntl64.c (test_flock64_einval): Likewise. 9259 * tests/fdatasync.c (main): Likewise. 9260 * tests/flock.c (main): Likewise. 9261 * tests/fstat64.c (SAMPLE_SIZE): Likewise. 9262 * tests/fstat.c (SAMPLE_SIZE): Likewise. 9263 * tests/fsync.c (main): Likewise. 9264 * tests/ftruncate64.c (main): Likewise. 9265 * tests/futimesat.c (main): Likewise. 9266 * tests/get_mempolicy.c (main): Likewise. 9267 * tests/getdents.c (main): Likewise. 9268 * tests/getdents64.c (main): Likewise. 9269 * tests/ioctl_block.c (lmagic, main): Likewise. 9270 * tests/ioctl_evdev.c (lmagic): Likewise. 9271 * tests/ioctl_mtd.c (lmagic): Likewise. 9272 * tests/ioctl_rtc.c (lmagic): Likewise. 9273 * tests/ioctl_v4l2.c (main): Likewise. 9274 * tests/ioperm.c (main): Likewise. 9275 * tests/ipc.c (ipc_call): Likewise. 9276 * tests/kill.c (main): Likewise. 9277 * tests/linkat.c (main): Likewise. 9278 * tests/lstat64.c (SAMPLE_SIZE): Likewise. 9279 * tests/lstat.c (SAMPLE_SIZE): Likewise. 9280 * tests/mbind.c (main): Likewise. 9281 * tests/migrate_pages.c (main): Likewise. 9282 * tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise. 9283 * tests/mknod.c (call_mknod, main): Likewise. 9284 * tests/mknodat.c (fd, call_mknodat, main): Likewise. 9285 * tests/mmap.c (main): Likewise. 9286 * tests/move_pages.c (print_stat_pages, print_move_pages): Likewise. 9287 * tests/mq_sendrecv.c (main): Likewise. 9288 * tests/nsyscalls.c (test_syscall): Likewise. 9289 * tests/prlimit64.c (main): Likewise. 9290 * tests/remap_file_pages.c (main): Likewise. 9291 * tests/renameat.c (main): Likewise. 9292 * tests/rt_sigqueueinfo.c (main): Likewise. 9293 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise. 9294 * tests/sendfile.c (main): Likewise. 9295 * tests/sendfile64.c (main): Likewise. 9296 * tests/set_mempolicy.c (main): Likewise. 9297 * tests/setrlimit.c (main): Likewise. 9298 * tests/socketcall.c (test_socketcall): Likewise. 9299 * tests/splice.c (main): Likewise. 9300 * tests/stat64.c (SAMPLE_SIZE): Likewise. 9301 * tests/stat.c (SAMPLE_SIZE): Likewise. 9302 * tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise. 9303 * tests/symlinkat.c (main): Likewise. 9304 * tests/sync_file_range.c (main): Likewise. 9305 * tests/syslog.c (main): Likewise. 9306 * tests/tee.c (main): Likewise. 9307 * tests/timer_create.c (main): Likewise. 9308 * tests/truncate64.c (main): Likewise. 9309 * tests/umode_t.c (test_syscall): Likewise. 9310 * tests/unlinkat.c (main): Likewise. 9311 * tests/waitid.c (main): Likewise. 9312 * tests/waitpid.c (main): Likewise. 9313 * tests/xetpgid.c (main): Likewise. 9314 * tests/xetpriority.c (main): Likewise. 9315 * tests/xgetrlimit.c (main): Likewise. 9316 * tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise. 9317 * tests/xstatx.c (main): Likewise. 9318 9319 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9320 9321 tests: fix "comparison between signed and unsigned" compilation warnings 9322 preadv-pwritev.c: In function 'main': 9323 preadv-pwritev.c:162: warning: comparison between signed and unsigned 9324 readv.c: In function 'main': 9325 readv.c:148: warning: comparison between signed and unsigned 9326 recvmsg.c: In function 'main': 9327 recvmsg.c:148: warning: comparison between signed and unsigned 9328 9329 * tests/preadv-pwritev.c (main): Cast r_len to int. 9330 * tests/readv.c (main): Likewise. 9331 * tests/recvmsg.c (main): Likewise. 9332 9333 2016-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 9334 9335 syscall.c: refactor getregs_old fallback in get_regs. 9336 This change moves remaining arch specific getregs_old code into 9337 appropriate arch subdirectories and removes unnecessary code 9338 duplication. 9339 9340 * linux/getregs_old.h: New file. 9341 * linux/powerpc/getregs_old.h: Likewise. 9342 * linux/powerpc64/getregs_old.h: Likewise. 9343 * linux/x86_64/getregs_old.h: Likewise. 9344 * Makefile.am (EXTRA_DIST): Add them. 9345 * syscall.c: Include "getregs_old.h". 9346 [X86_64 || POWERPC]: Remove. 9347 [ARCH_REGS_FOR_GETREGSET] (ptrace_getregset_or_getregs): Define 9348 to ptrace_getregset. 9349 [ARCH_REGS_FOR_GETREGS] (ptrace_getregset_or_getregs): Define 9350 to ptrace_getregs. 9351 (get_regs): Check for ptrace_getregset_or_getregs instead 9352 of ARCH_REGS_FOR_GETREGSET and ARCH_REGS_FOR_GETREGS. Use 9353 ptrace_getregset_or_getregs instead of ptrace_getregset and 9354 ptrace_getregs. Check for HAVE_GETREGS_OLD instead of X86_64 9355 and POWERPC. Use use_getregs_old instead of getregset_support 9356 and old_kernel. 9357 9358 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9359 9360 Rename BUILD_BUG_ON_ZERO macro. 9361 In order to avoid name clash on distributions which decide to include 9362 kernel headers instead of UAPI ones. For example, on SLES 11SP4: 9363 9364 gcc -DHAVE_CONFIG_H -I./linux/x86_64 -I./linux -I. -Wall -O2 -c net.c 9365 In file included from /usr/include/linux/sysctl.h:25:0, 9366 from /usr/include/linux/netfilter.h:6, 9367 from /usr/include/linux/netfilter_arp.h:8, 9368 from /usr/include/linux/netfilter_arp/arp_tables.h:14, 9369 from net.c:60: 9370 net.c: In function 'print_packet_mreq': 9371 gcc_compat.h:59:27: error: negative width in bit-field '<anonymous>' 9372 # define MUST_BE_ARRAY(a) BUILD_BUG_ON_ZERO(!SAME_TYPE((a), &(a)[0])) 9373 ^ 9374 defs.h:76:53: note: in expansion of macro 'MUST_BE_ARRAY' 9375 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a)) 9376 ^ 9377 net.c:747:22: note: in expansion of macro 'ARRAY_SIZE' 9378 if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address)) 9379 ^ 9380 due to the fact BUILD_BUG_ON_ZERO is already defined in <linux/kernel.h>. 9381 9382 * gcc_compat.h (BUILD_BUG_ON_ZERO): Rename to FAIL_BUILD_ON_ZERO. 9383 (MUST_BE_ARRAY): Update usage. 9384 9385 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 9386 9387 syscall.c: factor out ptrace_getregs from get_regs. 9388 Move the code that calls ptrace(PTRACE_GETREGS) to a separate function. 9389 9390 * syscall.c (ptrace_getregs): New function. 9391 (get_regs): Use it. 9392 9393 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 9394 9395 syscall.c: rename get_regset to ptrace_getregset. 9396 * syscall.c (get_regset): Rename to ptrace_getregset. 9397 (get_regs): Rename get_regset to ptrace_getregset. 9398 9399 2016-11-12 Andreas Schwab <schwab (a] linux-m68k.org> 9400 9401 m68k: switch to PTRACE_GETREGS. 9402 * Makefile.am (EXTRA_DIST): Add linux/m68k/arch_regs.h, remove 9403 linux/m68k/get_syscall_result.c. 9404 * linux/m68k/arch_regs.c (m68k_d0, ARCH_PC_PEEK_ADDR): Don't 9405 define. 9406 (m68k_regs, m68k_usp_ptr, ARCH_PC_REG, ARCH_REGS_FOR_GETREGS): 9407 Define. 9408 * linux/m68k/arch_regs.h: New file. 9409 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use m68k_usp_ptr. 9410 * linux/m68k/get_error.c (get_error): Use m68k_regs.d0. 9411 * linux/m68k/get_scno.c (arch_get_scno): Use m68k_regs.orig_d0. 9412 * linux/m68k/get_syscall_args.c (get_syscall_args): Use m68k_regs. 9413 * linux/m68k/get_syscall_result.c: Remove. 9414 9415 tests: do not run old_mmap test on m68k. 9416 * tests/old_mmap.c: Skip test on m68k. 9417 9418 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 9419 9420 syscall.c: introduce reallocate_vec function. 9421 This might be needed later to implement syscall fault injection. 9422 9423 * syscall.c (reallocate_vec): New function. 9424 (reallocate_qual): Use it. 9425 9426 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 9427 9428 Fix prototypes of qual_desc, qual_signal, and qual_syscall functions. 9429 * syscall.c (qual_desc, qual_signal, qual_syscall): Fix prototypes. 9430 (struct qual_options): Fix type of "qualify" member. 9431 9432 2016-11-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9433 9434 linux/x32/syscallent.h: fix syscallent array initialisation on x32. 9435 Why gcc didn't complain about it? It is definitely an index clash. 9436 9437 * linux/x32/syscallent.h: Change initializer indices for empty records from 9438 [327 ... 511] to [329 ... 511]. 9439 9440 2016-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 9441 9442 Introduce upoke function. 9443 This will be needed to implement fault injection on those architectures 9444 that lack PTRACE_SETREGSET/PTRACE_SETREGS support. 9445 9446 * defs.h (upoke): New prototype. 9447 * upoke.c: New file. 9448 * Makefile.am (libstrace_a_SOURCES): Add it. 9449 9450 2016-11-11 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 9451 9452 Update ioctl entries from linux 4.9. 9453 * linux/32/ioctls_inc_align32.h: Update from linux v4.9 using ioctls_gen.sh. 9454 * linux/32/ioctls_inc_align64.h: Likewise. 9455 * linux/64/ioctls_inc.h: Likewise. 9456 * linux/x32/ioctls_inc0.h: Likewise. 9457 * NEWS: Mention this. 9458 9459 2016-11-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9460 9461 Update NEWS. 9462 9463 2016-11-10 Mikulas Patocka <mpatocka (a] redhat.com> 9464 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9465 9466 Add support for decoding of DM_* ioctl commands. 9467 * dm.c: New file. 9468 * xlat/dm_flags.in: Likewise. 9469 * Makefile.am (strace_SOURCES): Add dm.c. 9470 * configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h. 9471 * defs.h (dm_ioctl): New prototype. 9472 * ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl 9473 for 0xfd ioctl type. 9474 * tests/ioctl_dm.c: New file. 9475 * tests/ioctl_dm-v.c: Likewise. 9476 * tests/ioctl_dm.test: New test. 9477 * tests/ioctl_dm-v.test: Likewise. 9478 * tests/.gitignore: Add ioctl_dm and ioctl_dm-v. 9479 * tests/Makefile.am (check_PROGRAMS): Likewise. 9480 (DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test. 9481 9482 2016-11-10 Dmitry V. Levin <ldv (a] altlinux.org> 9483 9484 Introduce ALIGNOF macro. 9485 * gcc_compat.h (ALIGNOF): New macro. 9486 9487 2016-11-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9488 9489 util: add support for QUOTE_0_TERMINATED in user_style to ptrintstr_ex. 9490 This enables printing size-limited (expectedly) ASCIZ strings. 9491 9492 This is done by increasing umoven size limit for sized strings by one 9493 byte above max_strlen (enabling copying possible NUL byte in case len is 9494 greater than max_strlen) and decreasing size after copying by one byte 9495 in case QUOTE_0_TERMINATED is set (due to user_style or usage of len of 9496 -1). As a result, there is one excess byte for string_quote in case 9497 QUOTE_0_TERMINATED is set so string_quote can check for NUL termination 9498 of strings up to size bytes in size (which is len or max_strlen, whatever 9499 is greater). 9500 9501 The catch here is that when string is not properly NUL-terminated and 9502 QUOTE_0_TERMINATED is provided in user_style and len is less than 9503 max_strlen then last non-NUL byte is not printed. But ellipsis is 9504 printed instead, being indication that string is not terminated 9505 properly. QUOTE_OMIT_TRAILING_0 should be used instead in case this 9506 behaviour is not intended. 9507 9508 * util.c (printstr_ex): Copy one excess byte in case of non-negative len 9509 provided and it is more than max_strlen; handle case of max_strlen of 0 9510 in case QUOTE_0_TERMINATED is set separately; check for need of printing 9511 ellipsis by checking resulting style against QUOTE_0_TERMINATED. 9512 9513 2016-11-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9514 9515 tests: check decoding of mq_{notify,open,timedreceive,timedsend,unlink} 9516 * tests/mq_sendrecv.c: New file. 9517 * tests/mq_sendrecv-read.c: Likewise. 9518 * tests/mq_sendrecv-write.c: Likewise. 9519 * tests/mq_sendrecv.test: New test. 9520 * tests/mq_sendrecv-read.test: Likewise. 9521 * tests/mq_sendrecv-write.test: Likewise. 9522 * tests/.gitignore: Add mq_sendrecv, mq_sendrecv-read, 9523 and mq_sendrecv-write. 9524 * tests/Makefile.am (check_PROGRAMS): Likewise. 9525 (mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, mq_sendrecv_write_LDADD): 9526 New variables. 9527 (DECODER_TESTS): Add mq_sendrecv.test, mq_sendrecv-read.test, 9528 and mq_sendrecv-write.test. 9529 9530 2016-11-08 Dmitry V. Levin <ldv (a] altlinux.org> 9531 9532 tests: skip times.test if CLOCK_PROCESS_CPUTIME_ID does not work. 9533 * tests/times.c (main): Skip if clock_gettime consistenly returns zero 9534 for CLOCK_PROCESS_CPUTIME_ID timer. 9535 9536 2016-10-31 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9537 9538 tests: add tests for perf_event_attr structure decoding in perf_event_open 9539 * configure.ac: Add checks for presence of various fields of struct 9540 perf_event_attr defined in kernel headers. 9541 * tests/perf_event_open.c: New file. 9542 * tests/perf_event_open_unabbrev.c: Likewise. 9543 * tests/perf_event_open.test: New test. 9544 * tests/perf_event_open_unabbrev.test: Likewise. 9545 * tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev. 9546 * tests/Makefile.am (check_PROGRAMS): Likewise. 9547 (DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test. 9548 9549 Implement decoding of perf_event_attr structure in perf_event_open syscall 9550 * linux/perf_event_struct.h: New file, definition of struct perf_event_attr 9551 from Linux 4.8 9552 * Makefile.am (strace_SOURCES): Add it. 9553 * xlat/hw_breakpoint_len.in: New file. 9554 * xlat/hw_breakpoint_type.in: Likewise. 9555 * xlat/perf_attr_size.in: Likewise. 9556 * xlat/perf_branch_sample_type.in: Likewise. 9557 * xlat/perf_event_read_format.in: Likewise. 9558 * xlat/perf_event_sample_format.in: Likewise. 9559 * xlat/perf_hw_cache_id.in: Likewise. 9560 * xlat/perf_hw_cache_op_id.in: Likewise. 9561 * xlat/perf_hw_cache_op_result_id.in: Likewise. 9562 * xlat/perf_hw_id.in: Likewise. 9563 * xlat/perf_sw_ids.in: Likewise. 9564 * xlat/perf_type_id.in: Likewise. 9565 * perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of 9566 <linux/perf_event.h>. 9567 (PRINT_XLAT): New macro for simplifying printing values from 9568 sorted xlat. 9569 (printxlat_search): New function, wrapper for xlat_search with behaviour 9570 similar to printval. 9571 (print_perf_event_attr): New print_event_attr structure fetching and 9572 printing function. 9573 (SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying 9574 attr argument contents. 9575 * tests/perf_event_open.c: Renamed to 9576 tests/perf_event_open_nonverbose.c. 9577 * tests/perf_event_open.test: add -e verbose=none in order to preserve 9578 output format being checked (in case verbose output is enabled, 9579 contents of attr arguments are shown now); rename to 9580 tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open. 9581 9582 tests: fix name spelling. 9583 9584 2016-10-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9585 9586 tests: fix name spelling. 9587 9588 Update NEWS. 9589 9590 Fix typo in comment in tests/quotactl.h. 9591 9592 tests: fix invalid pointer checks in quotactl test. 9593 * tests/quotactl.h (bogus_special, bogus_addr): Move it... 9594 * tests/quotactl.c (main): ... here; remove static and const qualifiers, 9595 use memory after tail_alloc instead of magic numbers. 9596 * tests/quotactl-xfs.c (main): Likewise. 9597 9598 tests: fix invalid pointer checks in getcpu test. 9599 * test/getcpu.c (main): Replace magic numbers deemed invalid pointers 9600 with addresses after memory returned by tail_alloc. 9601 9602 tests: fix invalid pointer checks in request_key test. 9603 * test/request_key.c (main): Replace magic numbers deemed invalid pointers 9604 with addresses after memory returned by tail_alloc. 9605 9606 tests: fix invalid pointer checks in add_key test. 9607 * test/add_key.c (main): Replace magic numbers deemed invalid pointers 9608 with addresses after memory returned by tail_alloc. 9609 9610 statfs: use printxval_search. 9611 * print_statfs.c (print_statfs_type): Use printxval_search for printing 9612 FS magic xlat value. 9613 9614 util: add printing helper for sorted xlat arrays. 9615 * util.c (printxval_searchn): New function. 9616 * defs.h (printxval_searchn): New prototype. 9617 (printxval_search): New helper macro useful in conjunction with static 9618 xlat arrays. 9619 9620 defs: add check for argument being array to ARRAY_SIZE macro. 9621 * gcc_compat.h [GNUC_PREREQ(3, 0)] (BUILD_BUG_ON_ZERO): New macro. 9622 (SAME_TYPE, MUST_BE_ARRAY): Likewise. 9623 * defs.h (ARRAY_SIZE): Add MUST_BE_ARRAY for build-time type check. 9624 9625 tests: check decoding of oldfstat, oldlstat, and oldstat syscalls. 9626 * tests/oldfstat.c: New file. 9627 * tests/oldlstat.c: Likewise. 9628 * tests/oldstat.c: Likewise. 9629 * tests/oldfstat.test: New test. 9630 * tests/oldlstat.test: Likewise. 9631 * tests/oldstat.test: Likewise. 9632 * tests/xstatx.c [!OLD_STAT]: define OLD_STAT to 0. 9633 (print_stat) [OLD_STAT]: Print predefined values for 9634 st_blksize/st_blocks. 9635 (print_stat): Check for !OLD_STAT in nanosecond precision checks. 9636 (main) [OLD_STAT]: Ignore EOVERFLOW. 9637 (main): Test for successful rc in returned size value check; 9638 print address only on non-successful rc. 9639 * tests/.gitignore: Add oldfstat, oldlstat, and oldstat. 9640 * tests/Makefile.am (check_PROGRAMS): Likewise. 9641 (DECODER_TESTS): Add oldfstat.test, oldlstat.test, and oldstat.test. 9642 9643 tests: additional tests of stat decoders. 9644 * tests/fstatx.c (IS_FSTAT): Define to 1. 9645 * tests/fstatat64.c [__GLIBC__ && __sparc64__] (TEST_BOGUS_STRUCT_STAT): 9646 Define to 0. 9647 * tests/xstatx.c [!IS_STAT] (IS_STAT): Define to 0. 9648 [!TEST_BOGUS_STRUCT_STAT] (TEST_BOGUS_STRUCT_STAT): Define to 1. 9649 (main): Add a check for non-available pointer and a check 9650 for block device file. 9651 * tests/statx.sh: Add tracing of /dev/full file, specify alignment. 9652 * tests/fstat.test: Specify alignment. 9653 9654 2016-10-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9655 9656 tests: prepare for additional tests of stat decoders. 9657 PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace 9658 pair in order to save errno. PRINT_SYSCALL_FOOTER now uses sprintrc for 9659 printing rc/errno. 9660 9661 * tests/xstatx.c: Include <errno.h>. 9662 (main): Update PRINT_SYSCALL_FOOTER call convention. 9663 * tests/fstatat.c (PRINT_SYSCALL_HEADER): Add errno saving. 9664 (PRINT_SYSCALL_FOOTER): Restore errno. 9665 * tests/fstatx.c: Likewise. 9666 * tests/lstatx.c: Likewise. 9667 9668 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 9669 9670 Provide a safe definition of O_ACCMODE. 9671 Some libcs e.g. musl are guilty of messing up with O_ACCMODE. 9672 9673 * open.c (O_ACCMODE): Redefine to 03. 9674 9675 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9676 9677 Implement dumping of mq_timedsend and mq_timedreceive syscalls. 9678 * syscall.c (dumpio): Add SEN_mq_timedreceive and SEN_mq_timedsend. 9679 9680 mq: print msg_prio as a pointer, not as an immediate value. 9681 * mq.c (SYS_FUNC(mq_timedreceive)): Use printnum_int for printing 9682 msg_prio argument. 9683 9684 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9685 9686 mq: print msg payload only in case of successful mq_timedreceive call. 9687 Also, use u_rval for determining message size. 9688 9689 * mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative 9690 u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise; 9691 provide u_rval as string size. 9692 9693 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9694 9695 mq: Print msg_prio parameter as unsigned int in mq_timedsend. 9696 * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%ld" 9697 to "%u", cast argument value to unsigned int. 9698 9699 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9700 9701 mq: Properly print mq_flags field. 9702 mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other 9703 flags are treated as invalid by mq_getsetattr). Moreover, this field is 9704 ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr 9705 attribute). 9706 9707 * xlat/mq_attr_flags.in: New file. 9708 * print_mq_attr.c: Include xlat/mq_attr_flags.h. 9709 (printmqattr): New parameter, bool decode_flags; cast members of struct 9710 mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags; 9711 print mq_flags as flags only in case decode_flags parameter is set 9712 to true. 9713 * mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags 9714 parameter of printmqattr call. 9715 (SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags 9716 parameter of printmqattr call. 9717 * tests/mq.expected: Update expected output. 9718 9719 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9720 9721 mq: Print msg_len parameter as kernel_ulong_t. 9722 * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%lu" 9723 to "%llu", use getarg_ull for obtaining msg_len parameter. 9724 (SYS_FUNC(mq_timedreceive)): Likewise. 9725 9726 print_mq_attr: fix typo. 9727 * print_mq_attr.c (printmqattr): Print field name "mq_curmsgs" 9728 instead of "mq_curmsg". 9729 * tests/mq.expected: Update expected output. 9730 9731 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9732 9733 mq: print mqdes parameter as int. 9734 It is defined as int in <linux/posix_types.h>. 9735 9736 * mq.c (SYS_FUNC(mq_timedsend)): Use "%d" conversion specifier instead 9737 of "%ld" for printing mqdes (0th parameter), cast parameter value to 9738 int. 9739 (SYS_FUNC(mq_timedreceive)): Likewise. 9740 (SYS_FUNC(mq_notify)): Likewise. 9741 (SYS_FUNC(mq_getsetattr)): Likewise. 9742 9743 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9744 9745 mq: curly brackets usage fix. 9746 Use curly brackets for denoting blocks in both of if branches if they 9747 are already used in at least one branch. 9748 9749 tests: additional name_to_handle_at/open_by_handle_at checks. 9750 * tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at 9751 checks. 9752 9753 tests: require only presence of __NR_* macros for file_handle test. 9754 * tests/file_handle.c: replace fcntl.h include with asm/unistd.h. 9755 [MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at 9756 && defined __NR_open_by_handle_at, add fcntl.h include 9757 [!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct 9758 file_handle. 9759 (main): Change name_to_handle_at and open_by_handle_at calls to syscall. 9760 9761 tests: proper type conversion in keyctl test. 9762 * tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t 9763 since kernel_ulong_t may be of different size. 9764 9765 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9766 9767 file_handle: use separate xlat for name_ta_handle_at flags. 9768 Since the only two flags supported are AT_SYMLINK_FOLLOW and 9769 AT_EMPTY_PATH. 9770 9771 * xlat/name_to_handle_at_flags.in: New file. 9772 * file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags 9773 for printing flags parameter. 9774 9775 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9776 9777 tests: check decoding of kexec_file_load and kexec_load syscalls. 9778 * tests/kexec_file_load.c: New file. 9779 * tests/kexec_load.c: Likewise. 9780 * tests/kexec_file_load.test: New test. 9781 * tests/kexec_load.test: Likewise. 9782 * tests/.gitignore: Add kexec_file_load and kexec_load. 9783 * tests/Makefile.am (check_PROGRAMS): Likewise. 9784 (DECODER_TESTS): Add kexec_file_load.test and kexec_load.test. 9785 9786 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9787 9788 kexec: use widen_to_ulong since kexec_load has compat on x32/n32. 9789 Curiously, kexec_load uses compat on x32/n32, so its parameters should 9790 be 4 bytes in size on these ABIs. 9791 9792 * kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting 9793 parameters to proper size on x32/n32. 9794 9795 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9796 9797 kexec: fix zeroing of higher bits of flags parameter in kexec_load. 9798 * kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before 9799 negation in order to properly negate higher bits of KEXEC_ARCH_MASK. 9800 9801 kexec: add printing of struct kexec_segment field names. 9802 * kexec.c (print_seg): Print field names of the kexec_segment structure. 9803 9804 tests: check decoding of unshare syscall. 9805 * tests/unshare.c: New file. 9806 * tests/unshare.test: New test. 9807 * tests/.gitignore: Add unshare. 9808 * tests/Makefile.am (check_PROGRAMS): Likewise. 9809 (DECODER_TESTS): Add unshare.test. 9810 9811 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9812 9813 clone: use kernel_ulong_t as type of flags parameter of unshare call. 9814 Kernel declares flags parameter as long and looks like x32 and n32 9815 implement no compat for this call. 9816 9817 * clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for 9818 obtaining and parsing flags parameter. 9819 9820 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9821 9822 clone: use separate flag list for unshare. 9823 Not all clone flags could be passed to unshare (see check_unshare_flags 9824 function in kernel/fork.c). 9825 9826 * xlat/unshare_flags.in: New file. 9827 * clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags 9828 parameter. 9829 9830 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9831 9832 tests: check decoding of setns syscall. 9833 * tests/setns.c: New file. 9834 * tests/setns.test: New test. 9835 * tests/.gitignore: Add setns. 9836 * tests/Makefile.am (check_PROGRAMS): Likewise. 9837 (DECODER_TESTS): Add setns.test. 9838 9839 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9840 9841 clone: use separate xlat for nstype parameter of setns syscall. 9842 nstype is not flag set but specific type value against which it is 9843 compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)). 9844 9845 * xlat/setns_types.in: New file. 9846 * clone.c: Use printxval and setns_types for nstype parameter. 9847 9848 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9849 9850 tests: check non-verbose capget/capset output. 9851 * tests/caps-abbrev.awk: New file. 9852 * tests/caps-abbrev.c: Likewise. 9853 * tests/caps-abbrev.test: New test. 9854 * tests/.gitignore: Add caps-abbrev. 9855 * tests/Makefile.am (check_PROGRAMS): Likewise. 9856 (DECODER_TESTS): Add caps-abbrev.test. 9857 (EXTRA_DIST): Add caps-abbrev.awk. 9858 9859 tests: additional capset decoder checks. 9860 * tests/caps.awk: Add patterns for additional checks. 9861 * tests/caps.c: Implement additional checks. 9862 9863 tests: check decoding of fanotify_init syscall. 9864 * tests/fanotify_init.c: New file. 9865 * tests/fanotify_init.test: New test. 9866 * tests/.gitignore: Add fanotify_init. 9867 * tests/Makefile.am (check_PROGRAMS): Likewise. 9868 (DECODER_TESTS): Add fanotify_init.test. 9869 9870 tests: some additional checks for fanotify_mark. 9871 * tests/fanotify_mark.c (do_call): New function. 9872 (main): Use it. 9873 9874 tests: use sprintrc in tests/fanotify_mark.c. 9875 * tests/fanotify.c (main): Use sprintrc. 9876 9877 tests: check decoding of {init,finit,delete}_module syscalls. 9878 * tests/delete_module.c: New file. 9879 * tests/finit_module.c: Likewise. 9880 * tests/init_delete_module.h: Likewise. 9881 * tests/init_module.c: Likewise. 9882 * tests/delete_module.test: New test. 9883 * tests/finit_module.test: Likewise. 9884 * tests/init_module.test: Likewise. 9885 * tests/.gitignore: Add delete_nodule, finit_module, and init_module. 9886 * tests/Makefile.am (check_PROGRAMS): Likewise. 9887 (DECODER_TESTS): Add delete_module.test, finit_module.test, 9888 and init_module.test. 9889 (EXTRA_DIST): Add init_delete_module.h. 9890 9891 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9892 9893 bjm: use getarg_ull for retrieving first two parameters of init_module syscall 9894 As init_module has no compat wrapper, its first parameter is a pointer 9895 and the second is length, they both have the same size as kernel_ulong_t 9896 type. 9897 9898 * bjm.c (SYS_FUNC(init_module)): Obtain first two parameters using 9899 getarg_ull, print address argument using printaddr_ull, print length 9900 argument using "%llu" conversion specifier. 9901 9902 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 9903 9904 Add printaddr_ull, change printaddr into a thin wrapper around it. 9905 * defs.h (printaddr_ull): New prototype. 9906 (printaddr): Change to a static inline wrapper around printaddr_ull. 9907 * util.c (printaddr): Rename to printaddr_ull, change argument type 9908 to unsigned long long, change print format to %#llx. 9909 9910 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9911 9912 xlat: add values for MODULE_INIT_* constants. 9913 * bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC): 9914 Remove. 9915 * xlat/module_init_flags.in: Add values for 9916 MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records. 9917 9918 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9919 9920 Remove parser of create_module syscall. 9921 Since create_module syscall is present only in kernels before Linux 2.6 9922 and strace does not support those kernels, there is no use to keep this 9923 parser any longer. 9924 9925 * bjm.c (SYS_FUNC(create_module)): Remove. 9926 * linux/dummy.h (sys_create_module): Add stub alias. 9927 9928 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9929 9930 tests: check decoding of process_vm_readv and process_vm_writev syscalls 9931 * tests/process_vm_readv.c: New file. 9932 * tests/process_vm_readv_writev.c: Likewise. 9933 * tests/process_vm_writev.c: Likewise. 9934 * tests/process_vm_readv.test: New test. 9935 * tests/process_vm_writev.test: Likewise. 9936 * tests/.gitignore: Add process_vm_readv and process_vm_writev. 9937 * tests/Makefile.am (check_PROGRAMS): Likewise. 9938 (DECODER_TESTS): Add process_vm_readv.test and process_vm_writev.test. 9939 (EXTRA_DIST): Add process_vm_readv_writev.c. 9940 9941 process_vm: use widen_to_ulong for local_iovcnt, renote_iovcnt, and flags 9942 * process_vm.c (SYS_FUNC(process_vm_readv), 9943 SYS_FUNC(process_vm_writev)): Use widen_to_ulong for local_iovcnt, 9944 renote_iovcnt, and flags parameters. 9945 9946 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9947 9948 defs: add widen_to_ulong macro. 9949 This is similar to widen_to_long, but for unsigned values. 9950 9951 * defs.h (widen_to_ulong): New macro. 9952 9953 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9954 9955 process_vm: print pid argument as int. 9956 * process_vm.c (SYS_FUNC(process_vm_readv), 9957 SYS_FUNC(process_vm_writev)): Change conversion specifier for pid 9958 argument from "%ld" to "%d". 9959 9960 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9961 9962 process_vm: remove syserror check for iovec printing. 9963 This check had been done by print_array inside tprint_iov anyway. 9964 9965 * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for 9966 printing local_iov; do not check for syserror, provide decode_iov 9967 parameter to tprint_iov{,_upto} based on its value instead. 9968 9969 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9970 9971 io: use umoven_or_printaddr_ignore_syserror as umove function in tprint_iov_upto 9972 This enables printing of iovec arrays even in case of failed syscall 9973 (failed syscall doesn't mean that iovec itself is inaccessible and 9974 useless). One caveat here is that we should explicitly provide proper 9975 IOV_DECODE_* value based on syserror value in case printing is performed 9976 on exiting; we can't simply override it to IOV_DECODE_ADDR on exiting 9977 when syserror is up, since this may be called by code which tries to 9978 print iovec containing local data, which should be perfectly accessible 9979 (on the other hand, there are no cases of such behaviour at the moment). 9980 9981 Since iovecs themselves are printed even if syscall has failed now, 9982 preadv test is updated to reflect this. It is notable, though, that this 9983 is the only place where this case is checked. 9984 9985 * io.c (tprint_iov_upto): Specify umoven_or_printaddr_ignore_syserror 9986 instead of umoven_or_printaddr as umoven_func parameter. 9987 (SYS_FUNC(readv), do_preadv): Specify decode_iov parameter value 9988 based on syserror(tcp) value. 9989 * scsi.c: (print_sg_io_v3_res, print_sg_io_v4_res): Likewise. 9990 * tests/preadv.c: Update expected output for the case when preadv 9991 with singe-item iovec failed. 9992 9993 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9994 9995 Move umoven_or_printaddr_ignore_syserror to util.c. 9996 * defs.h (umoven_or_printaddr_ignore_syserror): New prototype. 9997 * v4l2.c (umoven_or_printaddr_ignore_syserror): Move ... 9998 * util.c: ... here. 9999 10000 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10001 10002 v4l2: check for verbose flag in umoven_or_printaddr_ignore_syserror. 10003 This change makes behaviour of umoven_or_printaddr_ignore_syserror in 10004 line with umoven_or_printaddr when verbose flag is disabled. 10005 10006 * v4l2.c (umoven_or_printaddr_ignore_syserror): Simply call printaddr 10007 when verbose flag is unset. 10008 10009 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10010 10011 tests: check decoding of kcmp syscall. 10012 * tests/kcmp.c: New file. 10013 * tests/kcmp.test: New test. 10014 * tests/.gitignore: Add kcmp. 10015 * tests/Makefile.am (check_PROGRAMS): Likewise. 10016 (DECODER_TESTS): Add kcmp.test. 10017 10018 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 10019 10020 kcmp: print index parameters of unknown commands as kernel_ulong_t. 10021 * lookup_dcookie.c (SYS_FUNC(kcmp)): Use getarg_ull to retrieve idx1 10022 and idx2, print them using %#llx format in case of unknown command. 10023 10024 2016-10-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10025 10026 tests: check decoding of inotify family syscalls. 10027 * tests/inotify.c: New file. 10028 * tests/inotify_init1.c: Likewise. 10029 * tests/inotify.test: New test. 10030 * tests/inotify_init1.test: Likewise. 10031 * tests/.gitignore: Add inotify and inotify_init1. 10032 * tests/Makefile.am (check_PROGRAMS): Likewise. 10033 (DECODER_TESTS): Add inotify.test and inotify_init1.test. 10034 10035 xlat: use IN_* prefix for inotify_init1 flag constants. 10036 * xlat/inotify_init_flags.in: Replace O_* prefix with IN_* prefix for 10037 O_NONBLOCK and O_CLOEXEC constants, provide fallback definitions. 10038 10039 tests: check decoding of lookup_dcookie syscall. 10040 * tests/lookup_dcookie.c: New file. 10041 * tests/lookup_dcookie.test: New test. 10042 * tests/.gitignore: Add lookup_dcookie. 10043 * tests/Makefile.am (check_PROGRAMS): Likewise. 10044 (DECODER_TESTS): Add lookup_dcookie.test. 10045 10046 2016-10-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10047 10048 lookup_dcookie: print len parameter as kernel_ulong_t. 10049 It is size_t and without compat on x32/n32. 10050 10051 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Change conversion 10052 specifier from "%lu" to "%llu", use getarg_ull for len argument 10053 retrieval. 10054 10055 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10056 10057 defs.h: add offsetofend macro. 10058 Analogous to offsetof but returns structure offset after the specified 10059 field. Useful for checking whether specific field is present in obtained 10060 data or specifying amount of data to copy based on the (last) field needed. 10061 10062 * defs.h (offsetofend): New macro. 10063 10064 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10065 10066 tests: move ARG_STR and similar macros to tests.h. 10067 * tests/add_key.c (_STR, ARG_STR): Move ... 10068 * tests/tests.h: ... here. 10069 (ARG_ULL_STR): New macro. 10070 * tests/keyctl.c (ARG_STR): Remove. 10071 * tests/quotactl.h (ARG_STR): Likewise. 10072 * tests/request_key.c (ARG_STR): Likewise. 10073 10074 tests: move LL_PAIR and LL_VAL_TO_PAIR macros to tests.h. 10075 * tests/fadvise.h (LL_PAIR, LL_VAL_TO_PAIR): Move ... 10076 * tests/tests.h: ... here. 10077 10078 tests: check decoding of ioprio_get and ioprio_set syscalls. 10079 * tests/ioprio.c: New file. 10080 * tests/ioprio.test: New test. 10081 * tests/.gitignore: Add ioprio. 10082 * tests/Makefile.am (check_PROGRAMS): Likewise. 10083 (DECODER_TESTS): Add ioprio.test. 10084 10085 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10086 10087 xlat: provide fallback definitions for CLOCK_* constants. 10088 Since new values have been added gradually over various kernel versions, 10089 it's better to define them explicitly in order to avoid situations when 10090 strace built with older kernel headers cannot decode some recently 10091 defined values. 10092 10093 * xlat/clocknames.in: Add values for constants. 10094 10095 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10096 10097 tests: move fill_memory and fill_memory_ex into a separate file. 10098 * tests/fill_memory.c: New file. 10099 * tests/Makefile.am (libtests_a_SOURCES): Add it. 10100 * tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c. 10101 * tests/tests.h (fill_memory, fill_memory_ex): New prototypes. 10102 10103 tests: add period parameter to fill_memory_ex. 10104 * tests/quotactl.h (fill_memory_ex): Add period parameter, 10105 use it as a divisor in non-constant part of value. 10106 (fill_memory): Specify period of 0x80 to fill_memory_ex call. 10107 * tests/quotactl-xfs.c (main): Likewise. 10108 10109 2016-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 10110 10111 Post-release administrivia. 10112 * NEWS: Add a header line for the next release. 10113 * debian/changelog.in: Add a changelog entry for 4.14-1. 10114 * strace.spec.in: Likewise. 10115 10116 2016-10-04 Dmitry V. Levin <ldv (a] altlinux.org> 10117 10118 Prepare for 4.14 release. 10119 * NEWS: Update for 4.14 release. 10120 10121 Generate SEN numbers in a locale independent order. 10122 * generate_sen.sh: Sort SEN numbers using C collation rules. 10123 10124 2016-10-04 Dmitry V. Levin <ldv (a] altlinux.org> 10125 10126 Assume that offsetof is provided by stddef.h. 10127 According to C89, <stddef.h> shall define offsetof macro. 10128 10129 * defs.h: Include <stddef.h> unconditionally. 10130 [!offsetof]: Remove. 10131 10132 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10133 10134 tests: check decoding of add_key, keyctl, and request_key syscalls. 10135 * tests/add_key.c: New file. 10136 * tests/keyctl.c: Likewise. 10137 * tests/request_key.c: Likewise. 10138 * tests/add_key.test: New test. 10139 * tests/keyctl.test: Likewise. 10140 * tests/request_key.test: Likewise. 10141 * tests/.gitignore: Add add_key, keyctl, and request_key. 10142 * tests/Makefile.am (check_PROGRAMS): Likewise. 10143 (DECODER_TESTS): Add add_key.test, keyctl.test, and request_key.test. 10144 10145 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10146 10147 keyctl: use kernel_ulong_t and getarg_ull instead of long. 10148 This potentially fixes keyctl decoder for x32 personality. 10149 10150 * keyctl.c (keyctl_update_key, keyctl_read_key, keyctl_instantiate_key, 10151 keyctl_instantiate_key_iov, keyctl_dh_compute): Change addr and len 10152 arguments to kernel_ulong_t. Print len using %llu format. 10153 (keyctl_keyring_search): Change addr1 and addr2 arguments 10154 to kernel_ulong_t. 10155 (print_dh_params): Change addr argument to kernel_ulong_t. 10156 (SYS_FUNC(keyctl)): Retrieve arguments via getarg_ull, pass them 10157 to the appropriate handlers. 10158 10159 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10160 10161 keyctl: fix parameter signedness. 10162 * keyctl.c (keyctl_update_key): Change addr and len arguments 10163 to unsigned. 10164 (keyctl_read_key): Likewise. 10165 (keyctl_instantiate_key): Likewise. 10166 (keyctl_instantiate_key_iov): Likewise. 10167 (keyctl_dh_compute): Likewise. 10168 (keyctl_keyring_search): Change addr1 and addr2 arguments to unsigned. 10169 (keyctl_chown_key): Change user and group arguments to unsigned. 10170 (keyctl_get_persistent): Change uid argument to unsigned. 10171 10172 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10173 10174 keyctl: use printstr_ex for printing out buffer. 10175 keyctl_read_key had subtle bug by treating out buffer in KEYCTL_READ 10176 as NUL-terminated, which is not true. We fix it by adding parameter to 10177 keyctl_read_key signalising whether buffer is NUL-terminated and using 10178 printstr_ex for printing (expectedly) NUL-terminated strings. 10179 10180 * keyctl.c (keyctl_read_key): Add has_nul parameter. Do not use -1 as 10181 string len. Use printstr_ex for buffer output with user style depending 10182 on has_nul value. 10183 (SYS_FUNC(keyctl)): Specify has_nul parameter to keyctl_read_key 10184 by comparing cmd value with KEYCTL_READ. 10185 10186 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10187 10188 Add printstr_ex which allows for providing user quotation style. 10189 This is useful for providing QUOTE_OMIT_TRAILING_0 and maybe other 10190 flags. 10191 10192 * defs.h (printstr_ex): New prototype. 10193 (printstr): Change to a wrapper around printstr_ex with zero user style. 10194 * util.c (printstr): Rename to ... 10195 (printstr_ex) ... new function, add user_style argument which is or'ed 10196 with computed style. 10197 10198 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10199 10200 util: add quote_string flag signalising that string is NUL-terminated. 10201 It is useful in cases strings with size provided are expected to be 10202 NUL-terminated but are not trustworthy enough to call just plain 10203 printstr(str, -1). 10204 10205 * defs.h (QUOTE_OMIT_TRAILING_0): New constant definition. 10206 * util.c (string_quote): Swallow terminating NUL if 10207 QUOTE_OMIT_TRAILING_0 is set. 10208 10209 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10210 10211 keyctl: add support for KEYCTL_DH_COMPUTE. 10212 * keyctl.c (struct keyctl_dh_params): New structure. 10213 (print_dh_params, keyctl_dh_compute): New functions. 10214 (SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value. 10215 10216 2016-10-03 Dmitry V. Levin <ldv (a] altlinux.org> 10217 10218 x86_64: fix is_negated_errno for x32 personality. 10219 * syscall.c (is_negated_errno) [X86_64]: Do not truncate kernel_ulong_t 10220 to uint32_t for x32 personality. 10221 10222 tests: fix another regression in qual_syscall.test. 10223 * tests/qual_syscall.test: Fix pattern_nonabbrev_verbose pattern. 10224 (check_output_mismatch): Print the pattern that triggered match failure. 10225 10226 Use err_name, print unrecognized errno values as numbers. 10227 * syscall.c (trace_syscall_exiting): Use err_name() instead 10228 of open-coding it. Print unrecognized errno values using %lu format 10229 instead of ERRNO_%lu as the latter prodices an invalid constant. 10230 10231 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10232 10233 keyctl: print errno name in KEYCTL_REJECT in case it is available. 10234 * keyctl.c (keyctl_reject_key): Get errno string via err_name 10235 and print it if it is not NULL. 10236 10237 Add function for getting errno string. 10238 * defs.h (err_name): New prototype. 10239 * syscall.c (err_name): New function. 10240 10241 2016-10-03 Dmitry V. Levin <ldv (a] altlinux.org> 10242 10243 struct tcb: change the type of u_error field from int to unsigned long. 10244 This is the type actually used for the error code on architectures 10245 that use a dedicated register. 10246 10247 * defs.h (struct tcb): Change the type of u_error to unsigned long. 10248 * syscall.c (trace_syscall_exiting): Change the type of u_error variable 10249 to unsigned long, print it using %lu format, drop no longer needed 10250 explicit cast to unsigned long. 10251 (saved_u_error): Change type to unsigned long. 10252 10253 2016-10-02 Dmitry V. Levin <ldv (a] altlinux.org> 10254 10255 Use tprints instead of tprintf in a few more places. 10256 * btrfs.c (btrfs_print_qgroup_inherit, btrfs_print_tree_search, 10257 btrfs_ioctl): Replace tprintf with tprints for printing strings without 10258 format specifiers. 10259 * net.c (print_group_req): Likewise. 10260 * scsi.c (scsi_ioctl): Likewise. 10261 * term.c (decode_termios, decode_termio): Likewise. 10262 * userfaultfd.c (uffdio_ioctl): Likewise. 10263 10264 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10265 10266 keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command. 10267 Since this command doesn't have any additional arguments, the comma does 10268 not needed. Since this is the only command which lacks additional 10269 arguments, it's better to add special case for it rather than add 10270 printing of comma to all other commands. 10271 10272 * keyctl.c (SYS_FUNC(keyctl)): Add check for command not being 10273 KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument 10274 from the rest. 10275 10276 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10277 10278 keyctl: use getarg_ull for printing generic arguments. 10279 Otherwise it is erroneous on x32, for example. 10280 10281 * keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier 10282 and getarg_ull for fallback argument printing. 10283 10284 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10285 10286 keyctl: use printuid for printing UID/GID. 10287 UID/GID are unsigned except special -1 value (which is also special in 10288 context of specific keyctl commands), so special printing function 10289 should be used. 10290 10291 * keyctl.c (keyctl_chown_key, keyctl_get_persistent): Use printuid 10292 instead of printf with "%d" conversion for printing UID/GID. 10293 10294 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10295 10296 io: handle data_size of -1 as unlimited data in print_iovec. 10297 Otherwise it can be depleted and print_iovec starts printing empty 10298 strings. 10299 10300 * io.c (print_iovec): Interpret c->data_size of -1 as unlimited data 10301 and do not decrease it in this case. 10302 10303 2016-10-01 Dmitry V. Levin <ldv (a] altlinux.org> 10304 10305 tests: fix typo in qual_syscall.test. 10306 Fix test regression introduced by commit v4.13-225-g55334ef. 10307 10308 * tests/qual_syscall.test: Fix typo. 10309 10310 2016-09-30 Dmitry V. Levin <ldv (a] altlinux.org> 10311 10312 Enhance -e abbrev=set, -e raw=set, and -e verbose=set. 10313 Enhance abbrev=, raw=, and verbose= to accept the same syntax as trace=. 10314 For example, this allows such syntax as -e verbose=file. 10315 10316 * syscall.c (lookup_class): Define before qual_syscall. 10317 (qualify): Move the loop based on lookup_class ... 10318 (qual_syscall): ... here. 10319 * tests/qual_syscall.test: Check it. 10320 10321 2016-09-30 Dmitry V. Levin <ldv (a] altlinux.org> 10322 10323 tests/qual_syscall.test: rewrite without ls. 10324 * tests/qual_syscall.test: Invoke ./umovestr instead of ls. 10325 Update expected output. 10326 10327 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10328 10329 tests: check decoding of fadvise64 and fadvise64_64 syscalls. 10330 * tests/fadvise.h: New file. 10331 * tests/fadvise64.c: Likewise. 10332 * tests/fadvise64_64.c: Likewise. 10333 * tests/fadvise64.test: New test. 10334 * tests/fadvise64_64.test: Likewise. 10335 * tests/.gitignore: Add fadvise64 and fadvise64_64. 10336 * tests/Makefile.am (check_PROGRAMS): Likewise. 10337 (DECODER_TESTS): Add fadvise64.test, fadvise64_64.test. 10338 (EXTRA_DIST): Add fadvise.h. 10339 10340 2016-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 10341 10342 mips o32: implement fetching the 7th subcall argument. 10343 * syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last 10344 argument of 7-arg syscalls. 10345 10346 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10347 10348 x32: use proper decoder for fadvise64 syscall. 10349 fadvise_64_64 decoder used before this change prints different sign 10350 of the "len" argument (loff_t vs size_t). 10351 10352 * linux/x32/syscallent.h (fadvise64): Replace SEN(fadvise64_64) 10353 with SEN(fadvise64). 10354 10355 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10356 10357 fadvise: use getarg_ull for obtaining len argument of fadvise64 syscall. 10358 Since its type is size_t, it is 64-bit wide on x32 and special care 10359 should be taken in order to obtain it. 10360 10361 * fadvise.c (SYS_FUNC(fadvise64)): Use getarg_ull for obtaining value 10362 of "len" syscall argument. 10363 10364 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10365 10366 util: add getarg_ll and getarg_ull functions. 10367 These allow retrieving specific argument in full taking into account 10368 peculiarities of runtimes which employ tcp->ext_arg (e.g. x32). 10369 10370 * defs.h (getarg_ll, getarg_ull): New prototypes. 10371 * util.c (getarg_ll, getarg_ull): New functions. 10372 (printargs): Use getarg_ull. 10373 10374 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10375 10376 fadvise: change printing of len argument to unsigned in fadvise64 syscall 10377 The kernel declares fadvise64 as 10378 long sys_fadvise64(int fd, loff_t offset, size_t len, int advice); 10379 10380 * fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from 10381 "%ld" to "%lu" for printing len argument since kernel expects argument 10382 of type size_t. 10383 10384 2016-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 10385 10386 sh64, sparc64: use proper decoder for fadvise64_64 syscall. 10387 This change is no-op yet, but things will change when decoder 10388 of fadvise64 syscall get fixed. 10389 10390 * linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64) 10391 with SEN(fadvise64_64). 10392 * linux/sparc64/syscallent.h (fadvise64_64): Likewise. 10393 10394 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10395 10396 tests: check decoding of fallocate syscall. 10397 * configure.ac (AC_CHECK_FUNCS): Add fallocate. 10398 * tests/fallocate.c: New file. 10399 * tests/fallocate.test: New test. 10400 * tests/.gitignore: Add fallocate. 10401 * tests/Makefile.am (check_PROGRAMS): Likewise. 10402 (DECODER_TESTS): Add fallocate.test. 10403 10404 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10405 10406 fallocate: change print format of offset and len arguments to signed. 10407 Since types of these arguments are off_t and kernel actually expects 10408 signed values in order to fail when negative values are provided, 10409 lets display these values as signed. 10410 10411 * fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for 10412 printing "offset" and "len" syscall arguments from %llu to %lld. 10413 10414 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10415 10416 xlat: add default values for falloc_flags constants. 10417 In order to avoid dependence of declared constants to headers available 10418 on build system. 10419 10420 * xlat/falloc_flags.in: Add default values for constants. 10421 10422 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10423 10424 tests: check decoding of getcpu syscall. 10425 * tests/getcpu.c: New file. 10426 * tests/getcpu.test: New test. 10427 * tests/.gitignore: Add getcpu. 10428 * tests/Makefile.am (check_PROGRAMS): Likewise. 10429 (DECODER_TESTS): Add getcpu.test. 10430 10431 tests: make magic values in ioctl_block test distinctive. 10432 * tests/ioctl.block (init_magic): Add iterator value to magic value 10433 in order to enable detection of potential 4-byte aligned shifts. 10434 10435 tests: additional getcwd decoding checks. 10436 * tests/getcwd.c (main): Add more checks for getcwd arguments decoding. 10437 10438 tests: check decoding of quotactl syscall. 10439 * configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h, 10440 and sys/quota.h. 10441 * tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs, 10442 and quotactl-xfs-v. 10443 * tests/Makefile.am (check_PROGRAMS): Likewise. 10444 (DECODER_TESTS): Add quotactl.test, quotactl-v.test, 10445 quotactl-xfs.test, and quotactl-xfs-v.test. 10446 (EXTRA_DIST): Add quotactl.h 10447 * quotactl.h: New file. 10448 * quotactl.c: Likewise. 10449 * quotactl-v.c: Likewise. 10450 * quotactl-xfs.c: Likewise. 10451 * quotactl-xfs-v.c: Likewise. 10452 * quotactl.test: New test. 10453 * quotactl-v.test: Likewise. 10454 * quotactl-xfs.test: Likewise. 10455 * quotactl-xfs-v.test: Likewise. 10456 10457 2016-09-27 Dmitry V. Levin <ldv (a] altlinux.org> 10458 10459 quota: ensure that names of structure fields are printed properly. 10460 * quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros. 10461 (decode_cmd_data): Use them to print structure fields. 10462 10463 Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros. 10464 * defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): 10465 Add support of char types. 10466 * tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): 10467 Likewise. 10468 10469 quota: move Q_QUOTAON handling to subcommand switch statement. 10470 * quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ... 10471 (decode_cmd_data): ... here. 10472 10473 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10474 10475 quota: remove legacy subcommand decoding support code. 10476 Support for these quota subcommands by linux kernels has been dropped 10477 long time ago (between 2.5.16 and 2.5.17), so lets drop it in order 10478 to minimize amount of code which should be subjected to testing and 10479 structured conversion. 10480 10481 * quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo, 10482 struct v1_dqstats, struct v2_dqstats): Remove. 10483 (decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA, 10484 Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS, 10485 and Q_V2_GETSTATS subcommands. 10486 (SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand. 10487 10488 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10489 10490 quota: add realtime block limits fields to XFS disk quota printing code. 10491 * quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit 10492 and d_rtb_softlimit fields to struct xfs_dqblk printing code. 10493 10494 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10495 10496 quota: add packed attribute to struct if_dqblk definition. 10497 Since the only difference between 32-bit and 64-bit environments 10498 regarding this structure is its padding, lets just add packed attribute 10499 to its definition instead of going full mpers. 10500 10501 * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED. 10502 10503 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10504 10505 quota: Add decoding for Q_XQUOTARM subcommand. 10506 * quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand 10507 switch. 10508 10509 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10510 10511 quota: add dispatch of SYNC subcommands. 10512 Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway. 10513 10514 * quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand 10515 dispatch switch since id/addr arguments for these subcommands are known 10516 to be ignored. 10517 10518 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10519 10520 quota: add missing prefixes to struct field names. 10521 * quota.c (decode_cmd_data): Print field names in accordance with 10522 their definition. 10523 10524 quota: fix indentation inside subcommand dispatching switch statement. 10525 10526 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10527 10528 quota: avoid printing id argument for those commands that ignore it. 10529 As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO, 10530 Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF, 10531 Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and 10532 Q_V2_GETSTATS subcommands, do not print it for these subcommands. 10533 10534 * quota.c (decode_cmd_data): Add id argument parameter, add printing 10535 of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA, 10536 Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA, 10537 Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands. 10538 (SYS_FUNC(quotactl)): Remove printing of id argument, pass it 10539 to decode_cmd_data. 10540 10541 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10542 10543 quota: use printuid for id parameter printing. 10544 * quota.c (SYS_FUNC(quotactl)): Since id call argument is used for 10545 user/group/project ID which all have special semantics for -1, 10546 print it the same way as UIDs are printed. 10547 10548 quota: display quota subcommand as a macro. 10549 * quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values 10550 (which also lacks shift of the left part) with QCMD macro call. 10551 10552 2016-09-26 Dmitry V. Levin <ldv (a] altlinux.org> 10553 10554 tests: use VERBOSE macro in waitid and waitid-v tests. 10555 * tests/waitid-v.c (VERBOSE_RUSAGE): Remove. 10556 (VERBOSE): Define to 1. 10557 * tests/waitid.c (sprint_rusage): Check VERBOSE instead 10558 of VERBOSE_RUSAGE. 10559 10560 tests: use VERBOSE macro in wait4 and wait4-v tests. 10561 * tests/wait4-v.c (VERBOSE_RUSAGE): Remove. 10562 (VERBOSE): Define to 1. 10563 * tests/wait4.c (sprint_rusage): Check VERBOSE instead 10564 of VERBOSE_RUSAGE. 10565 10566 tests: use VERBOSE macro in msg_control and msg_control-v tests. 10567 * tests/msg_control-v.c (VERBOSE_MSGHDR): Remove. 10568 (VERBOSE): Define to 1. 10569 * tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead 10570 of VERBOSE_MSGHDR. 10571 10572 tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests. 10573 * tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove. 10574 (VERBOSE): Define to 1. 10575 * tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead 10576 of VERBOSE_MMSGHDR. 10577 10578 tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests. 10579 * tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove. 10580 (VERBOSE): Define to 1. 10581 * tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead 10582 of VERBOSE_IOCTL. 10583 10584 tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests. 10585 * tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove. 10586 (VERBOSE): Define to 1. 10587 * tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL. 10588 10589 tests: use VERBOSE macro in execveat and execveat-v tests. 10590 * tests/execveat-v.c (VERBOSE_EXECVEAT): Remove. 10591 (VERBOSE): Define to 1. 10592 * tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT. 10593 10594 tests: use VERBOSE macro in execve and execve-v tests. 10595 * tests/execve-v.c (VERBOSE_EXECVE): Remove. 10596 (VERBOSE): Define to 1. 10597 * tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE. 10598 10599 2016-09-26 Dmitry V. Levin <ldv (a] altlinux.org> 10600 10601 tests: add VERBOSE macro. 10602 Introduce VERBOSE macro (defaults to 0) that is expected to be defined 10603 to 1 by code testing "strace -v" output. 10604 10605 * tests/tests.h [!VERBOSE] (VERBOSE): New macro. 10606 10607 2016-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 10608 10609 decode_open: print the mode argument when O_TMPFILE flag is set. 10610 O_TMPFILE reqires the mode argument (just like O_CREAT), so print it. 10611 10612 * open.c (STRACE_O_TMPFILE): New macro. 10613 (decode_open): Print the mode argument when O_TMPFILE flag is set. 10614 * tests/open.c (main): Check it. 10615 Fixes RH#1377846. 10616 10617 2016-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 10618 10619 tests: use sprintrc in tests/ptrace.c. 10620 * tests/ptrace.c (errstr): New static variable. 10621 (do_ptrace): Initialize it using sprintrc. 10622 (test_peeksiginfo, main): Use errstr. 10623 10624 tests: use sprintrc in tests/netlink_protocol.c. 10625 * tests/netlink_protocol.c (main): Use sprintrc. 10626 10627 tests: use sprintrc in tests/fchownat.c. 10628 * tests/fchownat.c (main): Use sprintrc. 10629 10630 tests: use sprintrc in tests/fchmodat.c. 10631 * tests/fchmodat.c (main): Use sprintrc. Add more fchmodat decoding tests. 10632 10633 tests: use sprintrc in tests/fchmod.c. 10634 * tests/fchmod.c (main): Use sprintrc. Add more fchmod decoding tests. 10635 * tests/fchmod.test: Update the value specified for strace -a parameter. 10636 10637 tests: use sprintrc in tests/getgroups.c. 10638 * tests/getgroups.c (main): Use sprintrc. 10639 10640 tests: use sprintrc in tests/setgroups.c. 10641 * tests/setgroups.c (main): Use sprintrc. 10642 10643 2016-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 10644 10645 tests/utime.c: rewrite without assert. 10646 * tests/utime.c: Do not include <assert.h>. 10647 (main): Use sprintrc instead of assert. 10648 10649 tests/xattr.c: rewrite without assert. 10650 * tests/xattr.c: Do not include <assert.h>. 10651 (main): Use sprintrc instead of assert. 10652 10653 tests: use sprintrc in tests/xchownx.c. 10654 * tests/xchownx.c (main): Do not include <errno.h>. Use sprintrc. 10655 10656 tests/xstatfsx.c: fix potential errno clobbering. 10657 * tests/xstatfsx.c (main): Use sprintrc. 10658 10659 2016-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 10660 10661 Add more fs magic constants. 10662 Add *_MAGIC constants defined for some relatively widespread 10663 non-mainline filesystems. 10664 10665 * xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC, 10666 VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants. 10667 10668 2016-09-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10669 10670 tests: fix whitespace for explicit type casts in futex test. 10671 10672 2016-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 10673 10674 Add more fs magic constants. 10675 Add *_MAGIC constants defined inside linux fs but not explicitly 10676 exported via linux uapi. 10677 10678 * xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC, 10679 EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC, 10680 BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC, 10681 FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC, 10682 VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER 10683 constants. 10684 10685 2016-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 10686 10687 Update fs *_MAGIC constants. 10688 Add fs *_MAGIC constants exported by linux uapi. 10689 10690 * xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants 10691 defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h, 10692 respectively. 10693 10694 2016-09-13 Dmitry V. Levin <ldv (a] altlinux.org> 10695 10696 tests: workaround limited semctl implementation in musl. 10697 musl libc forwards semctl command argument for 8 known commands only, 10698 for all the rest it passes 0 instead. 10699 10700 * tests/ipc_sem.c (main): Update semctl expected output. 10701 10702 2016-09-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10703 10704 tests: add more IPC decoding checks. 10705 * tests/ipc_msg.c: Additional msgget (parameter format) and msgctl 10706 (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT 10707 commands) checks. 10708 * tests/ipc_sem.c: Additional semget and semctl checks. 10709 * tests/ipc_shm.c: Additional shmget and shmctl checks. 10710 * tests/semop.c: Additional semop checks. Add checks for semtimedop. 10711 * tests/semop.test: Add explicit -e parameter in order to trace both 10712 semop and semtimedop. 10713 * tests/shmxt.c: Additional shmat and shmdt checks. 10714 10715 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 10716 10717 .mailmap: add addresses of Dr. David Alan Gilbert. 10718 * .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid 10719 duplications in CREDITS file. 10720 10721 2016-09-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10722 10723 .mailmap: add canonical name for Eugene Syromyatnikov. 10724 This is needed due to apparent deviation in spelling of commit author 10725 name in several commits. 10726 10727 * .mailmap: Add canonical name for Eugene Syromyatnikov. 10728 10729 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 10730 10731 Update generic ioctl entries from linux 4.8. 10732 * linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh. 10733 * linux/32/ioctls_inc_align32.h: Likewise. 10734 * linux/32/ioctls_inc_align64.h: Likewise. 10735 10736 2016-09-12 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 10737 10738 x32: update ioctl entries from linux 4.8. 10739 * linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh. 10740 10741 maint: update for linux 4.8. 10742 * maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and 10743 xen/evtchn.h files. 10744 10745 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 10746 10747 tests: use sprintrc_grep in tests/ipc_shm.c. 10748 * tests/ipc_shm.c (main): Use sprintrc_grep. 10749 10750 tests: use sprintrc_grep in tests/ipc_sem.c. 10751 * tests/ipc_sem.c (main): Use sprintrc_grep. 10752 10753 2016-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 10754 10755 tests: use sprintrc_grep in tests/ipc_msg.c. 10756 * tests/ipc_msg.c (main): Use sprintrc_grep. 10757 10758 2016-09-10 Dmitry V. Levin <ldv (a] altlinux.org> 10759 10760 tests: use sprintrc in tests/chmod.c. 10761 * tests/chmod.c (main): Use sprintrc. Add more chmod decoding tests. 10762 10763 2016-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 10764 10765 ipc: fix printing of nsops argument of semop and semtimedop syscalls. 10766 According to POSIX, nsops argument of semop syscall has type size_t, 10767 but the kernel treats nsops argument of semop and semtimedop syscalls 10768 as unsigned int. 10769 10770 * ipc_sem.c (tprint_sembuf_array): Change type of "count" argument 10771 from unsigned long to unsigned int, print it using %u format. 10772 10773 2016-09-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10774 10775 tests/aio.c: bring indentation in conformance with the rest of the file. 10776 10777 2016-09-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10778 10779 tests: use predefined constant in aio_context_t checks in aio test. 10780 Also fix io_cancel and io_destroy checks which did not check correct 10781 printing of context argument properly. 10782 10783 * tests/aio.c (main): Update syscall checks in order to use newly 10784 defined bogus_ctx constant. 10785 10786 2016-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 10787 10788 Mark io_setup and io_destroy as memory mapping related syscalls. 10789 As io_setup syscall allocates some memory using do_mmap_pgoff, and 10790 io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY 10791 flag for all sysentries of io_setup and io_destroy using the following 10792 oneliner: 10793 sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h 10794 10795 * linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM. 10796 10797 2016-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 10798 10799 travis: add x86 musl. 10800 * .travis.yml (matric): Add musl-gcc/x86. 10801 * travis-build.sh [TARGET == x86]: Specify --target along with --build 10802 to configure. 10803 * travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC. 10804 [CC == musl-gcc && TARGET == x86]: Add -m32 to $CC. Specify --build 10805 and --target to musl configure invocation. 10806 10807 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10808 10809 tests: use PRI__*64 macros in aio test. 10810 It was incorrectly assumed that __*64 types are long long on all 10811 platforms, despite strace having specially crafted macros in order 10812 to handle precisely this architecture discrepancy. 10813 The commit fixes this oversight. 10814 10815 * tests/aio.c (main): Use PRI__*64 macros for correct format conversion 10816 specifiers for __*64-typed values. 10817 10818 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10819 10820 ipc: fix printing of integer arguments. 10821 * ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int 10822 by the kernel, cast it to int and print it using %d format. 10823 * ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise, 10824 for semid argument. 10825 (SYS_FUNC(semget)): Likewise, for nsems argument. 10826 (SYS_FUNC(semctl)): Likewise, for semid and semnum arguments. 10827 * ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument. 10828 * ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise. 10829 10830 2016-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 10831 10832 ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls 10833 * ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel 10834 is __kernel_key_t (i.e. int), cast key_t argument to int 10835 and print it using %#x format. 10836 * ipc_sem.c (SYS_FUNC(semget)): Likewise. 10837 * ipc_shm.c (SYS_FUNC(shmget)): Likewise. 10838 * tests/ipc_msg.c (main): Test it. 10839 * tests/ipc_sem.c (main): Likewise. 10840 * tests/ipc_shm.c (main): Likewise. 10841 10842 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10843 10844 tests: add more sched_getattr and sched_setattr decoding checks. 10845 * tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr 10846 decoding checks. 10847 10848 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10849 10850 tests: change type of sched_nice field to signed in sched_xetattr test. 10851 Kernel headers declare this field as s32, and strace prints it with %d 10852 specifier. 10853 10854 * tests/sched_xetattr.c (main): Change type of sched_nice field of struct 10855 sched_attr to int32_t, update format specifiers accordingly. 10856 10857 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10858 10859 tests: add sprintrc_grep function to libtests. 10860 New sprintrc_grep function is sprintrc function equivalent suitable for 10861 tests where grep-base pattern matching is employed. 10862 10863 * tests/tests.h (sprintrc_grep): New prototype. 10864 * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration. 10865 (sprintrc_ex): New function, renamed from sprintrc and updated to 10866 support different formats. 10867 (sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW. 10868 (sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP. 10869 10870 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10871 10872 tests: perform more strict structure allocation in sched_xetattr test. 10873 Use tail_alloc with precise size of the structure. 10874 10875 * tests/sched_xetattr.c (main): Eliminate usage of anonymous union type. 10876 Rename sched to sched_attr. Change type of sched_attr to struct 10877 pointer. Use tail_alloc for sched_attr allocation, update printf 10878 statements accrodingly. 10879 10880 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10881 10882 tests: split long lines in sched_xetattr test. 10883 * tests/sched_xetattr.c (main): Split long lines. 10884 10885 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 10886 10887 tests/aio.c: fix for x32 personality. 10888 * tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit 10889 and io_getevents until strace learns how to print 64-bit pointers on x32 10890 and on x86_64 for x32 personality. 10891 10892 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 10893 10894 aio: print aio_context_t as a pointer type. 10895 As aio_context_t is treated by the kernel as a pointer, 10896 print it using printaddr. 10897 10898 * aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t 10899 argument using printnum_ptr. 10900 (SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel), 10901 SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr. 10902 * tests/aio.c (sprint_aio_context_t): Remove. 10903 (main): Update expected output. 10904 10905 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 10906 10907 tests/aio.c: rewrite without assert. 10908 * tests/aio.c: Do not include <assert.h>. 10909 (main): Use sprintrc instead of assert. 10910 10911 2016-09-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10912 10913 tests: add more aio decoding checks. 10914 * tests/aio.c (sprint_aio_context_t): New function. 10915 (main): Use it; add more checks. 10916 10917 2016-09-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10918 10919 tests: add suffix and cast to 64-bit constants in aio test. 10920 This helps to avoid warnings like 10921 "integer constant is too large for long type" 10922 reported by some versions of gcc on 32-bit platforms. 10923 10924 * tests/aio.c (main): Add ULL suffix to 64-bit constants 10925 and cast them to unsigned long. 10926 10927 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10928 10929 tests: check decoding of perf_event_open syscall. 10930 * tests/perf_event_open.c: New file. 10931 * tests/perf_event_open.test: New test. 10932 * tests/.gitignore: Add perf_event_open. 10933 * tests/Makefile.am (check_PROGRAMS): Likewise. 10934 (DECODER_TESTS): Add perf_event_open.test. 10935 10936 Makefile.am: use pwd instead of realpath. 10937 * Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1) 10938 instead of less widespread realpath(1) utility from GNU coreutils. 10939 10940 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 10941 10942 tests: use sprintrc in tests/xetpriority.c. 10943 * tests/xetpriority.c (main): Use sprintrc. 10944 10945 tests: use sprintrc in vhangup.test. 10946 * tests/vhangup.c (main): Use sprintrc. 10947 10948 tests: use sprintrc in tests/sockname.c. 10949 * tests/sockname.c (test_sockname_syscall): Use sprintrc. 10950 10951 tests: use sprintrc in signalfd4.test. 10952 * tests/signalfd4.c (main): Use sprintrc. 10953 10954 tests: use sprintrc in setrlimit.test. 10955 * tests/setrlimit.c (main): Use sprintrc. 10956 10957 tests: use sprintrc in set_mempolicy.test. 10958 * tests/set_mempolicy.c (main, print_nodes): Use sprintrc. 10959 10960 tests: use sprintrc in openat.test. 10961 * tests/openat.c (main): Use sprintrc. 10962 10963 tests: use sprintrc in open.test. 10964 * tests/open.c (main): Use sprintrc. 10965 10966 tests: use sprintrc in move_pages.test. 10967 * tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc. 10968 10969 tests: use sprintrc in mlockall.test. 10970 * tests/mlockall.c (main): Use sprintrc. 10971 10972 tests: use sprintrc in mlock.test. 10973 * tests/mlock.c (main): Use sprintrc. 10974 10975 tests: use sprintrc in epoll_create1.test. 10976 * tests/epoll_create1.c (main): Use sprintrc. 10977 10978 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10979 10980 tests: fix printing of min_nr and nr arguments of io_getevents syscall. 10981 * tests/aio.c (main): Change output format for min_nr and nr arguments 10982 in io_getevents check to %ld, cast these arguments to long. 10983 10984 tests: use sprintrc for return code output in aio test. 10985 * tests/aio.c (main): Use sprintrc for return code output. 10986 10987 tests: add more tests for ched_rr_get_interval decoding. 10988 * tests/sched_rr_get_interval.c (main): Check decoding of invalid 10989 timespec pointer and successful syscall invocation. 10990 10991 tests: use sprintrc for return code output in sched_rr_get_interval test 10992 * tests/sched_rr_get_interval.c (main): Use sprintrc for return code 10993 output. 10994 10995 tests: add more tests for sched_getscheduler and sched_xetscheduler. 10996 * tests/sched_xetscheduler.c (main): Check for decoding of invalid PID 10997 in sched_getscheduler and sched_setscheduler, invalid address 10998 of sched_param structure, and invalid policy value. 10999 11000 tests: use sprintrc for return code output in sched_xetscheduler test. 11001 * tests/sched_xetscheduler.c (main): Use sprintrc for return code output. 11002 11003 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11004 11005 aio: use printfd for fd printing. 11006 struct iocb contains two fields with fd semantics: aio_fildes and 11007 aio_resfd. It is quite reasonable to use the appropriate function for 11008 printing them (apart from just "%d"). 11009 11010 * aio.c (print_common_flags): Add struct tcb pointer to parameter list; 11011 use printfd for printing aio_resfd field. 11012 (print_iocb_header): Add struct tcb pointer to parameter list; 11013 use printfd for printing aio_fildes field. 11014 (print_iocb): Provide tcp argument to print_iocb_header 11015 and print_common_flags. 11016 (SYS_FUNC(io_cancel)): Likewise. 11017 11018 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 11019 11020 sh64: wire up new syscalls. 11021 * linux/sh64/syscallent.h [380..393]: New entries. 11022 11023 2016-09-02 Dmitry V. Levin <ldv (a] altlinux.org> 11024 11025 sh: wire up new syscalls. 11026 * linux/sh/syscallent.h [369..382]: New entries. 11027 11028 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 11029 11030 avr32: wire up preadv2 and pwritev2 syscalls. 11031 * linux/avr32/syscallent.h [326]: Add preadv2 entry. 11032 [327]: Add pwritev2 entry. 11033 11034 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11035 11036 tests: check decoding of readahead syscall. 11037 * configure.ac (AC_CHECK_FUNCS): Add readahead. 11038 * tests/readahead.c: New file. 11039 * tests/readahead.test: New test. 11040 * tests/.gitignore: Add readahead. 11041 * tests/Makefile.am (check_PROGRAMS): Likewise. 11042 (DECODER_TESTS): Add readahead.test. 11043 11044 2016-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11045 11046 tests: move sprintrc function to libtests. 11047 * tests/tests.h (sprintrc): New prototype. 11048 * tests/futex.c (sprintrc): Move to ... 11049 * tests/sprintrc.c: ... new file. 11050 * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c. 11051 11052 tests/futex: add support to sprintrc for return codes other than 0 and -1 11053 * tests/futex.c (sprintrc): Print the actual return code provided, 11054 not just "0". Check snprintf return code. 11055 11056 tests/futex: increase sprintrc static buffer size. 11057 * tests/futex.c (sprintrc): Increase buffer size from 256 to 4096. 11058 11059 tests/futex: rename retstr to sprintrc. 11060 * tests/futex.c (retstr): Rename to sprintrc. 11061 (main): Convert all retstr calls to sprintrc. 11062 11063 2016-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11064 11065 readahead: fix print format for the "count" argument. 11066 According to documentation and kernel's syscalls.h, its type is size_t, 11067 so "%lu" format should be used instead of "%ld". 11068 11069 * readahead.c (SYS_FUNC(readahead)): Fix conversion specifier 11070 for the "count" argument. 11071 11072 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 11073 11074 tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll 11075 Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros 11076 instead of explicit casts with unpredictable sign extension semantics. 11077 11078 * tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull 11079 instead of explicit cast. 11080 (print_stat): Use zero_extend_signed_to_ull and 11081 sign_extend_unsigned_to_ll instead of explicit casts. 11082 11083 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 11084 11085 tests: add sign_extend_unsigned_to_ll macro. 11086 * tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h. 11087 11088 2016-08-31 Eugene Syromiatnikov <evgsyr (a] gmail.com> 11089 11090 Refactor common sa_handler printing code. 11091 * xlat/sa_handler_values.in: New file. 11092 * signal.c: Include "xlat/sa_handler_values.h". 11093 (get_sa_handler_str, print_sa_handler): New functions. 11094 (SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them. 11095 11096 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 11097 11098 Update TCP* constants. 11099 * xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux 11100 kernel commit v4.8-rc1~140^2~226. 11101 11102 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11103 11104 Update SCTP_* constants. 11105 * xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO, 11106 and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits 11107 v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and 11108 v4.8-rc1~140^2~148^2~3, respectively. 11109 11110 Update fs *_MAGIC constants. 11111 * xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced 11112 by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74, 11113 respectively. 11114 11115 Update KEXEC_ARCH_* constants. 11116 * xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux 11117 kernel commit v4.8-rc1~16^2~41. 11118 11119 Update ETH_P_* constants. 11120 * xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel 11121 commit v4.8-rc1~140^2~65^2~8. 11122 11123 Update BPF_* constants. 11124 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced 11125 by linux kernel commit v4.8-rc1~140^2~212^2~2. 11126 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced 11127 by linux kernel commit v4.8-rc1~140^2~64^2~10. 11128 11129 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11130 11131 Remove HAVE_SIGACTION checks. 11132 The syscall parsers guarded by HAVE_SIGACTION check have to be compiled 11133 regardless of libc sigaction function availability. 11134 11135 * configure.ac (AC_CHECK_FUNCS): Remove sigaction. 11136 * signal.c: Remove HAVE_SIGACTION checks. 11137 11138 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11139 11140 Remove obsolescent autoconf macro AC_TYPE_SIGNAL. 11141 All supported systems are expected to have C89 conforming sematics. 11142 11143 * configure.ac (AC_TYPE_SIGNAL): Remove. 11144 11145 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11146 11147 Remove obsolescent autoconf macro AC_C_CONST. 11148 All supported systems are expected to have the 'const' keyword. 11149 11150 * configure.ac (AC_C_CONST): Remove. 11151 11152 2016-08-30 Eugene Syromiatnikov <evgsyr (a] gmail.com> 11153 11154 tests: check decoding of futex syscall. 11155 * tests/futex.c: New file. 11156 * tests/futex.test: New test. 11157 * tests/.gitignore: Add futex. 11158 * tests/Makefile.am (check_PROGRAMS): Likewise. 11159 (DECODER_TESTS): Add futex.test. 11160 11161 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11162 11163 futex: do not pretend <linux/futex.h> is included. 11164 As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is 11165 never defined and therefore the inclusion of <linux/futex.h> guarded by 11166 HAVE_LINUX_FUTEX_H makes no sense. 11167 11168 Moreover, <linux/futex.h> used to have an incorrect definition 11169 of FUTEX_WAIT_BITSET_PRIVATE and FUTEX_WAKE_BITSET_PRIVATE: 11170 since kernel commit v2.6.24-6320-gcd68998 where these definitions 11171 were initially introduced and up to v2.6.31-7082-gf8d1e54 where they 11172 were finally fixed these macros had been incorrectly defined via 11173 FUTEX_WAIT_BITS and FUTEX_WAKE_BITS instead of FUTEX_WAIT_BITSET 11174 and FUTEX_WAKE_BITSET, and these incorrect definitions made their way 11175 into some distributions still in use. 11176 11177 * futex.c [HAVE_LINUX_FUTEX_H]: Remove. 11178 11179 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11180 11181 futex: avoid printing val when it is not used by the futex command. 11182 This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET 11183 command. 11184 11185 * futex.c (SYS_FUNC(futex)): Remove common printing of val argument. 11186 Add printing of val argument for all futex commands except 11187 FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. 11188 11189 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11190 11191 xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set. 11192 * xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and 11193 FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel 11194 since commit v4.5-rc1~172^2. 11195 11196 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11197 11198 futex: fix formatting of unknown command argument. 11199 Use alternate form for printing hexadecimal numbers to avoid confusion. 11200 Use printaddr to print uaddr as the latter is interpreted as a pointer 11201 in all currently supported futex operations. 11202 11203 * futex.c (SYS_FUNC(futex)): Fix formatting of unknown command 11204 argument. 11205 11206 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11207 11208 futex: add handling of FUTEX_FD command. 11209 Since obsolete FUTEX_FD command is known and used to have some expected 11210 argument format, print FUTEX_FD using that format. 11211 11212 * futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command. 11213 11214 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11215 11216 futex: fix formatting of val3 hexadecimal argument. 11217 * futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET, 11218 print hexadecimal val3 argument in alternate form to avoid confusion. 11219 11220 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11221 11222 futex: fix FUTEX_WAKE_OP compare function mask. 11223 According to the initial and current (v4.7) kernel implementations, 11224 in FUTEX_WAKE_OP case the compare function does not have 11225 FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24. 11226 11227 * futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT 11228 for 27th bit of val3 in FUTEX_WAKE_OP case. 11229 11230 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11231 11232 tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c. 11233 * bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS. 11234 * tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: 11235 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 11236 to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC. 11237 [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: 11238 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 11239 to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC. 11240 [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: 11241 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 11242 to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC. 11243 [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: 11244 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 11245 to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC. 11246 11247 Based on patch by James Clarke <jrtc27 (a] jrtc27.com>. 11248 11249 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11250 11251 Remove redundant check for PTRACE_LISTEN availability. 11252 As ptrace.h already ensures that PTRACE_LISTEN is defined, 11253 there is no need to check this fact in other places. 11254 11255 * strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined. 11256 11257 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11258 11259 Remove unused autoconf macro AC_TYPE_GETGROUPS. 11260 strace code does not use GETGROUPS_T. 11261 11262 * configure.ac (AC_TYPE_GETGROUPS): Remove. 11263 11264 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11265 11266 Remove unused autoconf macro AC_TYPE_MODE_T. 11267 strace code already redefines mode_t. 11268 11269 * configure.ac (AC_TYPE_MODE_T): Remove. 11270 11271 2016-08-30 James Clarke <jrtc27 (a] jrtc27.com> 11272 11273 Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64. 11274 SPARC has a different PTRACE_DETACH value correctly defined in 11275 sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one. 11276 PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h, 11277 so use that instead. 11278 11279 * strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH 11280 to PTRACE_SUNDETACH ... 11281 * ptrace.h [SPARC || SPARC64]: ... here. 11282 11283 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11284 11285 Remove obsolescent autoconf macro AC_HEADER_STDC. 11286 All systems supported by strace are expected to have C89 conforming 11287 header files. 11288 11289 * configure.ac (AC_HEADER_STDC): Remove. 11290 11291 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11292 11293 Remove unneeded autoconf macro AC_HEADER_DIRENT. 11294 strace code already includes <dirent.h> unconditionally. 11295 11296 * configure.ac (AC_HEADER_DIRENT): Remove. 11297 11298 2016-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 11299 11300 Remove unneeded autoconf macro AC_HEADER_STDBOOL. 11301 strace code assumes C99. 11302 11303 * configure.ac (AC_HEADER_STDBOOL): Remove. 11304 * defs.h: Include <stdbool.h> unconditionally. 11305 11306 2016-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 11307 11308 Remove obsolescent autoconf macro AC_HEADER_STAT. 11309 No systems supported by strace are expected to have the bug workarounded 11310 by AC_HEADER_STAT macro. 11311 11312 * configure.ac (AC_HEADER_STAT): Remove. 11313 11314 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11315 11316 Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally. 11317 glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated 11318 inclusion of <sys/sysmacros.h> by <sys/types.h>. The method used 11319 for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer 11320 defines MAJOR_IN_SYSMACROS, which consequently breaks build. 11321 11322 Let's assume that all systems supported by strace provide major, minor, 11323 and makedev macros via <sys/sysmacros.h>. 11324 11325 * configure.ac (AC_HEADER_MAJOR): Remove. 11326 * mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove. 11327 Include <sys/sysmacros.h> unconditionally. 11328 * print_struct_stat.c: Likewise. 11329 * tests/mknod.c: Likewise. 11330 * tests/mknodat.c: Likewise. 11331 * tests/xstatx.c: Likewise. 11332 11333 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11334 11335 btrfs: mpersify struct btrfs_ioctl_vol_args_v2. 11336 This complements commit v4.11-719-gfb0c609. 11337 11338 * btrfs.c (struct_btrfs_ioctl_vol_args_v2): New type. Mpersify it. 11339 (btrfs_print_qgroup_inherit): Change qgi_addr type to unsigned long. 11340 (btrfs_ioctl): Replace struct btrfs_ioctl_vol_args_v2 with 11341 struct_btrfs_ioctl_vol_args_v2. 11342 11343 2016-08-29 Elvira Khabirova <lineprinter0 (a] gmail.com> 11344 11345 mpers.awk: relax union member name absence check. 11346 This fixes mpersing of unions containing nameless members, 11347 e.g. struct btrfs_ioctl_vol_args_v2. 11348 11349 * mpers.awk (what_is): Print names of union_type members as is. 11350 11351 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11352 11353 Revert "tests/xstatx.c: fix stat syscall tests on mips64" 11354 Previous commit effectively changed types of st_atime, st_ctime, and 11355 st_mtime members of struct stat and struct stat64 to signed integers, 11356 making the mips64 workaround obsolete. 11357 11358 This reverts commit 3fb84bfc79949c145197c61fbf04ce18464e9112. 11359 11360 * tests/xstatx.c (create_sample) [__mips64]: Remove. 11361 11362 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11363 11364 Mpersify parsers of struct stat and struct stat64. 11365 On many architectures that support multiple personalities, 11366 struct stat differ between personalities. While old code could handle 11367 these differences, there are some architectures, e.g. sparc64, that also 11368 have different struct stat64. Rewrite parsers using mpers functionality 11369 to fix these issues. 11370 11371 * fetch_struct_stat.c: New file. 11372 * fetch_struct_stat64.c: Likewise. 11373 * print_struct_stat.c: Likewise. 11374 * oldstat.c: Likewise. 11375 * stat.c: Likewise. 11376 * stat.h: Likewise. 11377 * stat64.c: Likewise. 11378 * file.c: Remove. 11379 * printstat.h: Likewise. 11380 * linux/aarch64/stat32.h: Likewise. 11381 * linux/powerpc64/stat32.h: Likewise. 11382 * linux/riscv/stat32.h: Likewise. 11383 * linux/sparc64/stat32.h: Likewise. 11384 * linux/tile/stat32.h: Likewise. 11385 * linux/x32/stat32.h: Likewise. 11386 * linux/x86_64/stat32.h: Likewise. 11387 * Makefile.am (strace_SOURCES): Add fetch_struct_stat.c, 11388 fetch_struct_stat64.c, print_struct_stat.c, oldstat.c, stat.c, stat.h, 11389 and stat64.c. Remove file.c, printstat.h, linux/aarch64/stat32.h, 11390 linux/powerpc64/stat32.h, linux/riscv/stat32.h, linux/sparc64/stat32.h, 11391 linux/tile/stat32.h, linux/x32/stat32.h, and linux/x86_64/stat32.h. 11392 * configure.ac (AC_CHECK_MEMBERS): Add struct stat64.st_mtime_nsec. 11393 * defs.h (struct strace_stat): New declaration. 11394 (print_struct_stat): New prototype. 11395 * linux/dummy.h (sys_fstatat64): Remove. 11396 11397 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11398 11399 mpers.m4: check for struct stat64, struct stat, and their members. 11400 * m4/mpers.m4 (st_MPERS_STRUCT_STAT): New macro. 11401 (st_MPERS): Use it. 11402 11403 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11404 11405 mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh. 11406 This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts 11407 of source code. 11408 11409 * Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS 11410 passed to mpers.sh. 11411 * mpers_test.sh: Likewise. 11412 11413 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11414 11415 Move redefinition of stat types to asm_stat.h. 11416 * file.c: Move redefinition of types that might be used 11417 to define struct stat ... 11418 * linux/asm_stat.h: ... here. 11419 * tests/xstatx.c: Remove redefinition of stat types. 11420 11421 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11422 11423 x86_64: provide a replacement of <asm/stat.h> for x32 personality. 11424 For the reason described in commit v4.10-517-gcfde1e3, a correct 11425 definition of struct stat for x32 personality is necessary to enable 11426 "asm_stat.h" with -mx32 on x86_64. 11427 11428 * linux/x32/asm_stat.h: Rename to ... 11429 * linux/x86_64/asm_stat.h: ... new file. 11430 * Makefile.am (strace_SOURCES): Add it. 11431 * linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h". 11432 11433 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 11434 11435 x32/asm_stat.h: provide definitions for i386 personality. 11436 This enables x32/asm_stat.h with -m32. 11437 11438 * linux/x32/asm_stat.h [__x86_64__ && __ILP32__]: Redirect stat. 11439 Include "linux/asm_stat.h". 11440 (struct stat): Define for [__x86_64__ && __ILP32__] only. 11441 (struct __old_kernel_stat): Remove. 11442 11443 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 11444 11445 Introduce a separate SEN entry for fstatat64 syscall. 11446 * linux/dummy.h (sys_fstatat64): Redirect to sys_newfstatat. 11447 * linux/32/syscallent.h: Replace SEN(newfstatat) with SEN(fstatat64). 11448 * linux/alpha/syscallent.h: Likewise. 11449 * linux/arm/syscallent.h: Likewise. 11450 * linux/avr32/syscallent.h: Likewise. 11451 * linux/bfin/syscallent.h: Likewise. 11452 * linux/hppa/syscallent.h: Likewise. 11453 * linux/i386/syscallent.h: Likewise. 11454 * linux/m68k/syscallent.h: Likewise. 11455 * linux/microblaze/syscallent.h: Likewise. 11456 * linux/mips/syscallent-o32.h: Likewise. 11457 * linux/powerpc/syscallent.h: Likewise. 11458 * linux/s390/syscallent.h: Likewise. 11459 * linux/sh/syscallent.h: Likewise. 11460 * linux/sh64/syscallent.h: Likewise. 11461 * linux/sparc/syscallent.h: Likewise. 11462 * linux/sparc64/syscallent.h: Likewise. 11463 * linux/xtensa/syscallent.h: Likewise. 11464 * pathtrace.c (pathtrace_match): Handle SEN_fstatat64. 11465 11466 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 11467 11468 Do not check for struct stat.st_{a,c}time_nsec. 11469 Assume that the check for struct stat.st_mtime_nsec is enough. 11470 Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec. 11471 11472 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec, 11473 struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec, 11474 and struct stat.st_ctim.tv_nsec. 11475 * file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC, 11476 HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove. 11477 * printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC, 11478 HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with 11479 HAVE_STRUCT_STAT_ST_MTIME_NSEC. 11480 * tests/xstatx.c: Likewise. 11481 11482 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 11483 11484 Add sign_extend_unsigned_to_ll macro. 11485 * defs.h (sign_extend_unsigned_to_ll): New macro, mirrors 11486 zero_extend_signed_to_ull. 11487 11488 zero_extend_signed_to_ull: add short int support. 11489 * defs.h (zero_extend_signed_to_ull): Add short int support. 11490 * tests/tests.h: Likewise. 11491 11492 Rename widen_to_ull to zero_extend_signed_to_ull. 11493 * defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull. 11494 All callers changed. 11495 * tests/tests.h: Likewise. 11496 11497 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 11498 11499 sparc, sparc64: remove obsolete code. 11500 Remove remains of solaris personality support. 11501 This complements commit v4.10-45-gdf4dd8b. 11502 11503 * file.c [SPARC || SPARC64] (SYS_FUNC(xstat), SYS_FUNC(fxstat)): Remove. 11504 11505 2016-08-22 Dmitry V. Levin <ldv (a] altlinux.org> 11506 11507 sparc64: fix decoding of struct stat64 related syscalls. 11508 For some reason, struct stat and struct stat64 are different on sparc64. 11509 This change fixes decoding of struct stat64 related syscalls for sparc64 11510 personality, sparc32 personality on sparc64 needs more work. 11511 11512 * file.c (printstat64) [SPARC64]: Do not use printstat. 11513 (SYS_FUNC(newfstatat)): Likewise. 11514 11515 2016-08-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11516 11517 tests: fill old_value argument in timer{,fd}_xettime tests. 11518 This is needed in order to differentiate it from the value returned 11519 by the call. As a consequence, it enables revealing possible bugs 11520 in syscall parsers, for example, when the value read on syscall 11521 entering and not on syscall exiting, as it was the case with 11522 timerfd_settime parser. 11523 11524 * tests/timer_xettime.c (main): Fill old.its field with value different 11525 from the expected one upon call return. 11526 * tests/timerfd_xettime.c: Likewise. 11527 11528 2016-08-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11529 11530 Fix old_value argument retrieval in timerfd_settime parser. 11531 This is done similar to timer_settime syscall parser. 11532 11533 * time.c (SYS_FUNC(timerfd_settime)): Retrieve old_value argument 11534 on exiting and not on entering. Return 0 instead of RVAL_DECODED 11535 since the call hasn't been decoded in full on entering. 11536 11537 2016-08-21 Richard W.M. Jones <rjones (a] redhat.com> 11538 11539 Add RISC-V architecture support. 11540 The original port of strace was done by Palmer Dabbelt 11541 (eecs.berkeley.edu), based on strace 4.9. 11542 11543 * configure.ac: Define RISCV for riscv*. 11544 * clone.c [RISCV]: Define ARG_* macros as for OR1K. 11545 * defs.h [RISCV] (SUPPORTED_PERSONALITIES): Define to 2. 11546 [RISCV] (NEED_UID16_PARSERS): Define to 1. 11547 * linux/riscv/arch_regs.c: New file. 11548 * linux/riscv/errnoent1.h: Likewise. 11549 * linux/riscv/get_error.c: Likewise. 11550 * linux/riscv/get_scno.c: Likewise. 11551 * linux/riscv/get_syscall_args.c: Likewise. 11552 * linux/riscv/ioctls_arch0.h: Likewise. 11553 * linux/riscv/ioctls_arch1.h: Likewise. 11554 * linux/riscv/ioctls_inc0.h: Likewise. 11555 * linux/riscv/ioctls_inc1.h: Likewise. 11556 * linux/riscv/signalent1.h: Likewise. 11557 * linux/riscv/stat32.h: Likewise. 11558 * linux/riscv/syscallent.h: Likewise. 11559 * linux/riscv/syscallent1.h: Likewise. 11560 * Makefile.am (EXTRA_DIST): Add them. 11561 11562 2016-08-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11563 11564 Move SH-specific argument number calculation to getllval. 11565 This change prevents scattering of ll-related hacks and simplifies 11566 pread/pwrite syscalls parsers' logic a bit. 11567 11568 * util.c (getllval): Add fixup for arg_no for SuperH when argument 11569 number is equal to 3. 11570 * io.c (PREAD_OFFSET_ARG): Remove. 11571 (SYS_FUNC(pread)): Always use argument number 3 for "count" argument 11572 printing. 11573 (SYS_FUNC(pwrite)): Likewise. 11574 11575 2016-08-21 Dmitry V. Levin <ldv (a] altlinux.org> 11576 11577 sparc64: fix sigreturn decoding for sparc personality. 11578 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Parametrize 11579 member types of struct signal_frame. 11580 * linux/sparc64/arch_sigreturn.c (sparc64_arch_sigreturn, 11581 sparc32_arch_sigreturn): New functions. 11582 (arch_sigreturn): Use them. 11583 11584 2016-08-20 Dmitry V. Levin <ldv (a] altlinux.org> 11585 11586 Fix compat decoding of struct sigaction.sa_mask on big endian architectures 11587 * signal.c (decode_new_sigaction) [SUPPORTED_PERSONALITIES > 1 && 11588 SIZEOF_LONG > 4]: Use LONG_LONG to convert sa_mask from 32-bit 11589 struct sigaction to 64-bit struct sigaction. 11590 11591 2016-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 11592 11593 Fix decoding of indirect shmat's return code for non-native personalities 11594 * ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data 11595 to obtain return code of indirect shmat subcall. 11596 11597 2016-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 11598 11599 sparc64: fix sparc personality decoding of mmap64's offset argument. 11600 * linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff. 11601 11602 2016-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 11603 11604 sparc64: fix decoding of the forth argument of semctl syscall. 11605 On sparc64, unlike all other architectures where semctl is an indirect 11606 ipc subcall, the forth argument is passed directly. 11607 11608 * ipc_sem.c (SYS_FUNC(semctl)) [SPARC64]: Print 4th argument without 11609 indirection in case of native personality. 11610 11611 2016-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 11612 11613 Add sparc64 specific ptrace constants. 11614 * xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64, 11615 PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64. 11616 11617 sparc64: fix sign extension bug of syscall args for sparc personality. 11618 * linux/sparc64/get_syscall_args.c (get_syscall_args): Zero-extend 11619 syscall args from 32 bit for sparc personality. 11620 11621 2016-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 11622 11623 sparc64: fix tty ioctl numbers. 11624 The structures defined in asm/termbits.h have the same size 11625 on sparc and sparc64. 11626 11627 * linux/sparc64/ioctls_arch0.h (TCGETS, TCGETS2, TCSETS, TCSETS2, 11628 TCSETSF, TCSETSF2, TCSETSW, TCSETSW2): Sync with 11629 linux/sparc/ioctls_arch0.h 11630 11631 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 11632 11633 evdev.c: fix typo in comment. 11634 11635 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 11636 11637 Drop support of dummy members of struct stat. 11638 As st_flags, st_fstype, and st_gen members of struct stat are not filled 11639 by the kernel, there is no use supporting them. 11640 11641 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_flags, 11642 struct stat.st_fstype, and struct stat.st_gen. 11643 * file.c [STAT32_PERSONALITY, HAVE_STRUCT_STAT64]: Do not undefine 11644 HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, 11645 and HAVE_STRUCT_STAT_ST_GEN. 11646 * printstat.h (DO_PRINTSTAT): Do not check for 11647 HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, 11648 and HAVE_STRUCT_STAT_ST_GEN. 11649 11650 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 11651 11652 Assume that struct stat contains st_blksize, st_blocks, and st_rdev. 11653 Our test suite already assumes that struct stat contains st_blksize, 11654 st_blocks, and st_rdev members, and there haven't been any complaints. 11655 11656 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize, 11657 struct stat.st_blocks, and struct stat.st_rdev. 11658 * printstat.h (DO_PRINTSTAT): Do not check for 11659 HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS, 11660 and HAVE_STRUCT_STAT_ST_RDEV. 11661 11662 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 11663 11664 tests: fix pause.test when pause syscall is not available. 11665 * tests/pause.c (main): Fix expected output when pause syscall 11666 is not available. 11667 11668 2016-08-14 Dmitry V. Levin <ldv (a] altlinux.org> 11669 11670 powerpc64, sparc64: fix redefinitions of ARCH_PC_REG. 11671 This fixes compilation warning that ARCH_PC_REG is redefined. 11672 11673 * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Undefine before 11674 the new definition. 11675 * linux/sparc64/arch_regs.c (ARCH_PC_REG): Likewise. 11676 11677 2016-08-14 Dmitry V. Levin <ldv (a] altlinux.org> 11678 11679 s390x, x32: remove redundant definitions of ARCH_PC_REG. 11680 * linux/s390x/arch_regs.c (ARCH_PC_REG): Remove, it is already defined 11681 in just included linux/s390/arch_regs.c. 11682 * linux/x32/arch_regs.c (ARCH_PC_REG): Remove, it is already defined 11683 in just included linux/x86_64/arch_regs.c. 11684 11685 2016-08-13 Dmitry V. Levin <ldv (a] altlinux.org> 11686 11687 tests: check for leaks of placeholder descriptors. 11688 * tests/redirect-fds.c: New file. 11689 * tests/redirect-fds.test: New test. 11690 * tests/.gitignore: Add redirect-fds. 11691 * tests/Makefile.am (check_PROGRAMS): Likewise. 11692 (MISC_TESTS): Add redirect-fds.test. 11693 11694 tests/init.sh: print exit code of failed commands. 11695 * init.sh (run_prog, run_prog_skip_if_failed): When the program fails, 11696 add its exit code to the diagnostic message. 11697 (run_strace): When strace fails, add its exit code to the diagnostic 11698 message. 11699 (run_strace_merge): When strace-log-merge fails, add its exit code 11700 to the diagnostic message. 11701 11702 2016-08-13 Dmitry V. Levin <ldv (a] altlinux.org> 11703 11704 Fix leakage of placeholder descriptors to tracees. 11705 As a side effect of commit v4.11-211-g0736d4e, strace used to leak 11706 placeholders for standard descriptors to tracees thus affecting their 11707 behaviour. Fix this by setting close-on-exec flag on placeholder 11708 descriptors. 11709 11710 * strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor 11711 that is going to be returned to the caller. 11712 (fd_is_placeholder): New array. 11713 (ensure_standard_fds_opened, redirect_standard_fds): New functions. 11714 (startup_child): Use redirect_standard_fds. 11715 (init): Use ensure_standard_fds_opened. 11716 11717 2016-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 11718 11719 sparc64: fix decoding of uid and gid-related syscalls. 11720 sparc64 has no native 16-bit uid/gid syscalls. 11721 11722 * linux/sparc64/syscallent.h (chown, lchown, setuid, getuid, setgid, 11723 getgid, geteuid, getegid, getgroups, setgroups, fchown, setreuid, 11724 setregid, setfsuid, setfsgid): Change handlers from 16-bit to 32-bit. 11725 11726 2016-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 11727 11728 tests: fix *stat64 tests on alpha. 11729 On some architectures including alpha, <asm/stat.h> provides a 11730 definition of struct stat that has no st_atime_nsec, st_mtime_nsec, and 11731 st_ctime_nsec fields. At the same time, struct stat64 always has these 11732 fields. Fix tests to take this difference into account. 11733 11734 * tests/fstat64.c (STRUCT_STAT_IS_STAT64): New macro, defined to 1. 11735 * tests/lstat64.c (STRUCT_STAT_IS_STAT64): Likewise. 11736 * tests/stat64.c (STRUCT_STAT_IS_STAT64): Likewise. 11737 * tests/xstatx.c [!STRUCT_STAT] (STRUCT_STAT_IS_STAT64): New macro, 11738 defined to 0. 11739 [USE_ASM_STAT && STRUCT_STAT_IS_STAT64]: 11740 (HAVE_STRUCT_STAT_ST_ATIME_NSEC, HAVE_STRUCT_STAT_ST_CTIME_NSEC, 11741 HAVE_STRUCT_STAT_ST_MTIME_NSEC): Redefine to 1. 11742 11743 2016-08-11 Dmitry V. Levin <ldv (a] altlinux.org> 11744 11745 tests: skip rt_tgsigqueueinfo.test when the syscall is not available. 11746 * tests/rt_tgsigqueueinfo.c (main): Skip the test when the syscall 11747 is not available. 11748 11749 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 11750 11751 tests/fcntl.c: fix fcntl test on mips64. 11752 On mips64 the F_GETLK and F_SETLKW64 constants have identical values which 11753 causes the "wrong" constant to be printed by strace. 11754 11755 tests/fcntl.c (test_flock64): Do not test F_SETLKW64 on mips64. 11756 11757 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 11758 11759 tests/nsyscalls.test: only trace the "syscall" syscall on mips o32. 11760 The "syscall" syscall only exists on o32 and causes strace to error out on 11761 64-bit mips ABIs. Pass MIPS_ABI from the configure script through to 11762 nsyscalls.test so the MIPS ABI can be checked. 11763 11764 * configure.ac (MIPS_ABI): Substitute into output files. 11765 * tests/Makefile.am (MIPS_ABI): Export via AM_TEST_LOG_FLAGS. 11766 * tests/nsyscalls.test: Restrict special mips handling to mips o32. 11767 11768 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 11769 11770 tests/xstatx.c: fix stat syscall tests on mips64. 11771 For historical reasons the kernel struct stat represents times as unsigned 11772 32-bit integers on mips64. Therefore, while it's possible to give a file a 11773 timestamp before 1970 with futimens, reading the same timestamp through 11774 struct stat will give a positive time (around 2106). 11775 Workaround by using positive timestamps for testing on mips64. 11776 11777 * tests/xstatx.c (create_sample): Use positive timestamps on mips64. 11778 11779 2016-08-11 Dmitry V. Levin <ldv (a] altlinux.org> 11780 11781 tests/mlock2.c: fix test failure on mips64. 11782 * tests/mlock2.c (main): Pass unsigned long arguments to mlock2 syscall 11783 explicitly, to avoid unwanted sign extension issues. 11784 11785 Based on patch by James Cowgill <james410 (a] cowgill.org.uk> 11786 11787 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 11788 11789 Use <asm/unistd.h> instead of <sys/syscall.h> 11790 There are no users of SYS_* macros provided by <sys/syscall.h>, 11791 and definitions of __NR_* macros could be obtained directly 11792 from <asm/unistd.h>. 11793 11794 * defs.h: Include <asm/unistd.h> instead of <sys/syscall.h>. 11795 * test/seccomp.c: Likewise. 11796 * test/threaded_execve.c: Likewise. 11797 * test/x32_lseek.c: Likewise. 11798 * test/x32_mmap.c: Likewise. 11799 * tests/_newselect.c: Likewise. 11800 * tests/access.c: Likewise. 11801 * tests/acct.c: Likewise. 11802 * tests/aio.c: Likewise. 11803 * tests/alarm.c: Likewise. 11804 * tests/attach-f-p.c: Likewise. 11805 * tests/bpf.c: Likewise. 11806 * tests/brk.c: Likewise. 11807 * tests/chmod.c: Likewise. 11808 * tests/chown.c: Likewise. 11809 * tests/chown32.c: Likewise. 11810 * tests/chroot.c: Likewise. 11811 * tests/clock_adjtime.c: Likewise. 11812 * tests/clock_nanosleep.c: Likewise. 11813 * tests/clock_xettime.c: Likewise. 11814 * tests/copy_file_range.c: Likewise. 11815 * tests/creat.c: Likewise. 11816 * tests/dup2.c: Likewise. 11817 * tests/dup3.c: Likewise. 11818 * tests/epoll_create.c: Likewise. 11819 * tests/epoll_create1.c: Likewise. 11820 * tests/epoll_ctl.c: Likewise. 11821 * tests/epoll_pwait.c: Likewise. 11822 * tests/epoll_wait.c: Likewise. 11823 * tests/eventfd.c: Likewise. 11824 * tests/execveat.c: Likewise. 11825 * tests/faccessat.c: Likewise. 11826 * tests/fchdir.c: Likewise. 11827 * tests/fchmod.c: Likewise. 11828 * tests/fchmodat.c: Likewise. 11829 * tests/fchown.c: Likewise. 11830 * tests/fchown32.c: Likewise. 11831 * tests/fchownat.c: Likewise. 11832 * tests/fcntl.c: Likewise. 11833 * tests/fcntl64.c: Likewise. 11834 * tests/fdatasync.c: Likewise. 11835 * tests/flock.c: Likewise. 11836 * tests/fstat.c: Likewise. 11837 * tests/fstat64.c: Likewise. 11838 * tests/fstatat64.c: Likewise. 11839 * tests/fstatfs.c: Likewise. 11840 * tests/fstatfs64.c: Likewise. 11841 * tests/fsync.c: Likewise. 11842 * tests/ftruncate.c: Likewise. 11843 * tests/ftruncate64.c: Likewise. 11844 * tests/futimesat.c: Likewise. 11845 * tests/get_mempolicy.c: Likewise. 11846 * tests/getcwd.c: Likewise. 11847 * tests/getdents.c: Likewise. 11848 * tests/getdents64.c: Likewise. 11849 * tests/getegid.c: Likewise. 11850 * tests/getegid32.c: Likewise. 11851 * tests/geteuid.c: Likewise. 11852 * tests/geteuid32.c: Likewise. 11853 * tests/getgid.c: Likewise. 11854 * tests/getgid32.c: Likewise. 11855 * tests/getgroups.c: Likewise. 11856 * tests/getgroups32.c: Likewise. 11857 * tests/getpgrp.c: Likewise. 11858 * tests/getrandom.c: Likewise. 11859 * tests/getresgid.c: Likewise. 11860 * tests/getresgid32.c: Likewise. 11861 * tests/getresuid.c: Likewise. 11862 * tests/getresuid32.c: Likewise. 11863 * tests/getrlimit.c: Likewise. 11864 * tests/getrusage.c: Likewise. 11865 * tests/getuid.c: Likewise. 11866 * tests/getuid32.c: Likewise. 11867 * tests/getxxid.c: Likewise. 11868 * tests/ioctl_uffdio.c: Likewise. 11869 * tests/ioperm.c: Likewise. 11870 * tests/iopl.c: Likewise. 11871 * tests/ipc.c: Likewise. 11872 * tests/kill.c: Likewise. 11873 * tests/lchown.c: Likewise. 11874 * tests/lchown32.c: Likewise. 11875 * tests/libmmsg.c: Likewise. 11876 * tests/libsocketcall.c: Likewise. 11877 * tests/link.c: Likewise. 11878 * tests/linkat.c: Likewise. 11879 * tests/llseek.c: Likewise. 11880 * tests/lseek.c: Likewise. 11881 * tests/lstat.c: Likewise. 11882 * tests/lstat64.c: Likewise. 11883 * tests/mbind.c: Likewise. 11884 * tests/membarrier.c: Likewise. 11885 * tests/memfd_create.c: Likewise. 11886 * tests/migrate_pages.c: Likewise. 11887 * tests/mkdir.c: Likewise. 11888 * tests/mkdirat.c: Likewise. 11889 * tests/mknod.c: Likewise. 11890 * tests/mknodat.c: Likewise. 11891 * tests/mlock.c: Likewise. 11892 * tests/mlock2.c: Likewise. 11893 * tests/move_pages.c: Likewise. 11894 * tests/newfstatat.c: Likewise. 11895 * tests/nsyscalls.c: Likewise. 11896 * tests/old_mmap.c: Likewise. 11897 * tests/oldselect.c: Likewise. 11898 * tests/open.c: Likewise. 11899 * tests/openat.c: Likewise. 11900 * tests/pause.c: Likewise. 11901 * tests/poll.c: Likewise. 11902 * tests/prctl-seccomp-filter-v.c: Likewise. 11903 * tests/prctl-seccomp-strict.c: Likewise. 11904 * tests/preadv2-pwritev2.c: Likewise. 11905 * tests/prlimit64.c: Likewise. 11906 * tests/pselect6.c: Likewise. 11907 * tests/ptrace.c: Likewise. 11908 * tests/readdir.c: Likewise. 11909 * tests/readlink.c: Likewise. 11910 * tests/readlinkat.c: Likewise. 11911 * tests/reboot.c: Likewise. 11912 * tests/remap_file_pages.c: Likewise. 11913 * tests/rename.c: Likewise. 11914 * tests/renameat.c: Likewise. 11915 * tests/renameat2.c: Likewise. 11916 * tests/rmdir.c: Likewise. 11917 * tests/rt_sigpending.c: Likewise. 11918 * tests/rt_sigprocmask.c: Likewise. 11919 * tests/rt_sigsuspend.c: Likewise. 11920 * tests/rt_sigtimedwait.c: Likewise. 11921 * tests/rt_tgsigqueueinfo.c: Likewise. 11922 * tests/sched_get_priority_mxx.c: Likewise. 11923 * tests/sched_rr_get_interval.c: Likewise. 11924 * tests/sched_xetaffinity.c: Likewise. 11925 * tests/sched_xetattr.c: Likewise. 11926 * tests/sched_xetparam.c: Likewise. 11927 * tests/sched_xetscheduler.c: Likewise. 11928 * tests/sched_yield.c: Likewise. 11929 * tests/seccomp-filter-v.c: Likewise. 11930 * tests/seccomp-filter.c: Likewise. 11931 * tests/seccomp-strict.c: Likewise. 11932 * tests/select.c: Likewise. 11933 * tests/sendfile.c: Likewise. 11934 * tests/sendfile64.c: Likewise. 11935 * tests/set_mempolicy.c: Likewise. 11936 * tests/setdomainname.c: Likewise. 11937 * tests/setfsgid.c: Likewise. 11938 * tests/setfsgid32.c: Likewise. 11939 * tests/setfsuid.c: Likewise. 11940 * tests/setfsuid32.c: Likewise. 11941 * tests/setgid.c: Likewise. 11942 * tests/setgid32.c: Likewise. 11943 * tests/setgroups.c: Likewise. 11944 * tests/setgroups32.c: Likewise. 11945 * tests/sethostname.c: Likewise. 11946 * tests/setregid.c: Likewise. 11947 * tests/setregid32.c: Likewise. 11948 * tests/setresgid.c: Likewise. 11949 * tests/setresgid32.c: Likewise. 11950 * tests/setresuid.c: Likewise. 11951 * tests/setresuid32.c: Likewise. 11952 * tests/setreuid.c: Likewise. 11953 * tests/setreuid32.c: Likewise. 11954 * tests/setrlimit.c: Likewise. 11955 * tests/setuid.c: Likewise. 11956 * tests/setuid32.c: Likewise. 11957 * tests/signalfd4.c: Likewise. 11958 * tests/socketcall.c: Likewise. 11959 * tests/splice.c: Likewise. 11960 * tests/stat.c: Likewise. 11961 * tests/stat64.c: Likewise. 11962 * tests/statfs.c: Likewise. 11963 * tests/statfs64.c: Likewise. 11964 * tests/swap.c: Likewise. 11965 * tests/symlink.c: Likewise. 11966 * tests/symlinkat.c: Likewise. 11967 * tests/sync.c: Likewise. 11968 * tests/sync_file_range.c: Likewise. 11969 * tests/sync_file_range2.c: Likewise. 11970 * tests/syslog.c: Likewise. 11971 * tests/tee.c: Likewise. 11972 * tests/time.c: Likewise. 11973 * tests/timer_create.c: Likewise. 11974 * tests/timer_xettime.c: Likewise. 11975 * tests/timerfd_xettime.c: Likewise. 11976 * tests/times-fail.c: Likewise. 11977 * tests/times.c: Likewise. 11978 * tests/truncate.c: Likewise. 11979 * tests/truncate64.c: Likewise. 11980 * tests/ugetrlimit.c: Likewise. 11981 * tests/umount.c: Likewise. 11982 * tests/umount2.c: Likewise. 11983 * tests/uname.c: Likewise. 11984 * tests/unix-pair-send-recv.c: Likewise. 11985 * tests/unlink.c: Likewise. 11986 * tests/unlinkat.c: Likewise. 11987 * tests/userfaultfd.c: Likewise. 11988 * tests/utimes.c: Likewise. 11989 * tests/vhangup.c: Likewise. 11990 * tests/vmsplice.c: Likewise. 11991 * tests/waitid.c: Likewise. 11992 * tests/waitpid.c: Likewise. 11993 * tests/xet_robust_list.c: Likewise. 11994 * tests/xetpgid.c: Likewise. 11995 * tests/xetpriority.c: Likewise. 11996 * tests/xettimeofday.c: Likewise. 11997 11998 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 11999 12000 ia64: replace SYS_clone2 with __NR_clone2. 12001 Migrate to __NR_* the last user of SYS_* macros provided 12002 by <sys/syscall.h>. 12003 12004 * clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace 12005 SYS_clone2 with __NR_clone2. 12006 12007 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 12008 12009 Make sure that tcp->s_ent and tcp->s_prev_ent do not point to freed memory 12010 This complements commit v4.13-33-g60d7ec8. 12011 12012 * syscall.c (sysent_buf): New structure. 12013 (free_sysent_buf): New function. 12014 (get_scno): Use them. 12015 12016 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 12017 12018 file.c: move definitions of struct stat32 to separate files. 12019 * linux/aarch64/stat32.h: New file. 12020 * linux/powerpc64/stat32.h: Likewise. 12021 * linux/sparc64/stat32.h: Likewise. 12022 * linux/tile/stat32.h: Likewise. 12023 * linux/x32/stat32.h: Likewise. 12024 * linux/x86_64/stat32.h: Likewise. 12025 * Makefile.am (EXTRA_DIST): Add them. 12026 * file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions 12027 of struct stat32, include "stat32.h" instead. 12028 12029 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 12030 12031 sparc, sparc64: remove obsolete code. 12032 Remove remains of solaris personality support. 12033 This complements commit v4.10-45-gdf4dd8b. 12034 12035 * file.c [SPARC || SPARC64]: Remove the code related to struct solstat. 12036 (printstat, printoldstat) [SPARC || SPARC64]: Remove. 12037 12038 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 12039 12040 sparc64: fix decoding of stat family syscalls. 12041 This complements commit v4.13-28-gaebfe83. 12042 12043 * file.c [SPARC64]: Change STAT32_PERSONALITY to 1. 12044 12045 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 12046 12047 Fix decoding of invalid syscalls mapped to indirect subcalls. 12048 When the syscall number returned by arch_get_scno is a mapped indirect 12049 subcall (i.e. mapped subcall of socketcall or ipc syscall), do not 12050 mistakenly treat it as a valid indirect subcall. 12051 12052 * defs.h (SCNO_IS_VALID): Treat scno with TRACE_INDIRECT_SUBCALL flag 12053 as invalid. 12054 * syscall.c (syscall_name): Do no shuffle scno. 12055 (trace_syscall_entering, trace_syscall_exiting): Use 12056 tcp->s_ent->sys_name instead of syscall_name. 12057 (get_scno): In case of invalid syscall, allocate a dynamic struct sysent 12058 containing an appropriate .sys_name. 12059 * tests/nsyscalls.c (main) [SYS_socket_subcall]: Check decoding 12060 of direct syscall number SYS_socket_subcall+1. 12061 (main) [SYS_ipc_subcall]: Check decoding of direct syscall number 12062 SYS_ipc_subcall+1. 12063 12064 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 12065 12066 linux/subcall.h: remove redundant definitions. 12067 * linux/subcall.h: Remove definitions of non-existent socket 12068 and ipc subcalls. 12069 12070 defs.h: simplify SUPPORTED_PERSONALITIES definition. 12071 * defs.h: Group definition of SUPPORTED_PERSONALITIES by value. 12072 12073 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 12074 12075 defs.h: simplify PERSONALITY1_WORDSIZE definition. 12076 Move definition of PERSONALITY1_WORDSIZE macro outside arch specific 12077 ifdefs. 12078 12079 * defs.h [SPARC64 || X86_64 || X32 || AARCH64 || POWERPC64 || TILE] 12080 (PERSONALITY1_WORDSIZE): Remove. 12081 [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_WORDSIZE): Define to 4 12082 unconditionally. 12083 12084 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 12085 12086 defs.h: simplify PERSONALITY0_WORDSIZE definition. 12087 Move definition of PERSONALITY0_WORDSIZE macro outside arch specific 12088 ifdefs. 12089 12090 * defs.h (PERSONALITY0_WORDSIZE): Define to SIZEOF_LONG unconditionally. 12091 12092 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 12093 12094 sparc64: swap personality numbers. 12095 Fix inconsistency between syscall and ioctl entries on sparc64. 12096 Make layout of personalities on sparc64 the same as on other 12097 architectures that support two personalities. 12098 12099 * defs.h [SPARC64] (PERSONALITY0_WORDSIZE): Change to 8. 12100 [SPARC64] (PERSONALITY1_WORDSIZE): Change to 4. 12101 * linux/sparc64/get_scno.c (arch_get_scno): Swap personality numbers. 12102 * linux/sparc64/ioctls_arch1.h: Rename to ioctls_arch0.h. 12103 * linux/sparc64/ioctls_arch0.h: Rename to ioctls_arch1.h. 12104 * linux/sparc64/ioctls_inc0.h: Rename to ioctls_inc1.h. 12105 * linux/sparc64/ioctls_inc1.h: Rename to ioctls_inc0.h. 12106 12107 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 12108 12109 defs.h: cleanup personality specific macro definitions. 12110 Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS, 12111 PERSONALITY[12]_INCLUDE_PRINTERS_DECLS, 12112 PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS 12113 macros outside arch specific ifdefs. 12114 12115 * defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove. 12116 [SPARC64 && HAVE_M32_MPERS]: Remove. 12117 [X86_64 && HAVE_M32_MPERS]: Remove. 12118 [X86_64 && HAVE_MX32_MPERS]: Remove. 12119 [X32 && HAVE_M32_MPERS]: Remove. 12120 [AARCH64 && HAVE_M32_MPERS]: Remove. 12121 [POWERPC64 && HAVE_M32_MPERS]: Remove. 12122 [TILE && HAVE_M32_MPERS]: Remove. 12123 (PERSONALITY0_INCLUDE_PRINTERS_DECLS, 12124 PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally. 12125 [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] 12126 (PERSONALITY1_INCLUDE_PRINTERS_DECLS, 12127 PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS, 12128 MPERS_m32_IOCTL_MACROS): Define for 12129 [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case. 12130 (PERSONALITY2_INCLUDE_PRINTERS_DECLS, 12131 PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS, 12132 MPERS_mx32_IOCTL_MACROS): Define for 12133 [SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case. 12134 12135 2016-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 12136 12137 Change #include guard trailing part comments. 12138 * defs.h: Change comment of the trailing part of #include guard. 12139 * flock.h: Likewise. 12140 * gcc_compat.h: Likewise. 12141 * ipc_defs.h: Likewise. 12142 * kernel_types.h: Likewise. 12143 * mpers_type.h: Likewise. 12144 * msghdr.h: Likewise. 12145 * printsiginfo.h: Likewise. 12146 * ptrace.h: Likewise. 12147 * regs.h: Likewise. 12148 * seccomp_fprog.h: Likewise. 12149 * sigevent.h: Likewise. 12150 * statfs.h: Likewise. 12151 * xlat.h: Likewise. 12152 12153 2016-08-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12154 12155 Unify usage of #include guards. 12156 This commit is an attempt to unify usage of include guards (in top-level 12157 headers, at least). As a side note, different files with *.h extension 12158 have different semantics: for example, printargs.h is included multiple 12159 times in order to generate slightly varying code depending on values of 12160 macro definitions - maybe it's better to change extension of such files 12161 to something like *.inc. 12162 12163 * defs.h: Add #include guard. 12164 * flock.h: Likewise. 12165 * ipc_defs.h: Likewise. 12166 * mpers_type.h: Likewise. 12167 * printsiginfo.h: Likewise. 12168 * ptrace.h: Likewise. 12169 * regs.h: Likewise. 12170 * seccomp_fprog.h: Likewise. 12171 * gcc_compat.h: Rename the macro used for #include guard. 12172 * msghdr.h: Likewise. 12173 * sigevent.h: Likewise. 12174 * kernel_types.h: Comment the trailing part of #include guard. 12175 * xlat.h: Add missing macro definition for #include guard. 12176 12177 2016-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 12178 12179 tests: add #include guards. 12180 * tests/tests.h: Add #include guard. 12181 12182 2016-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 12183 12184 linux: add #include guards. 12185 * linux/dummy.h: Add #include guard. 12186 * linux/inet_diag.h: Likewise. 12187 * linux/netlink_diag.h: Likewise. 12188 * linux/sock_diag.h: Likewise. 12189 * linux/syscall.h: Likewise. 12190 * linux/unix_diag.h: Likewise. 12191 12192 2016-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 12193 12194 tests/umode_t.c: guard against libc printf format errors. 12195 * tests/umode_t.c (test_syscall): Use different printf format specifiers 12196 to detect libc printf format errors. 12197 12198 2016-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 12199 12200 travis: use a suitable musl revision. 12201 There seems to be no readily available binary packages of musl that are 12202 sufficiently up to date to be used to build and test strace, so prepare 12203 a suitable musl from source. 12204 12205 * travis-install.sh (musl-gcc): Do not add an extra repository, 12206 do not install musl-tools and linux-musl-dev packages. 12207 Download, build, and install a suitable musl revision instead. 12208 12209 2016-08-03 Dmitry V. Levin <ldv (a] altlinux.org> 12210 12211 Fix printing of mode_t, umode_t, and umask types. 12212 Print numeric umode_t type using %#03ho format. 12213 Print return value of umask syscall using %#03lo format. 12214 When printing symbolic mode_t type, always print lower 9 bits, 12215 and print the numeric part using %#03o format. 12216 12217 * defs.h (sprintmode): Remove. 12218 (print_symbolic_mode_t, print_numeric_umode_t, 12219 print_numeric_long_umask): New prototypes. 12220 * printmode.c (sprintmode): Remove. 12221 (print_symbolic_mode_t, print_numeric_umode_t, 12222 print_numeric_long_umask): New functions. 12223 * chmod.c (decode_chmod): Use print_numeric_umode_t. 12224 * ipc_msg.c (SYS_FUNC(msgget)): Likewise. 12225 * ipc_msgctl.c (print_msqid_ds): Likewise. 12226 * ipc_sem.c (SYS_FUNC(semget)): Likewise. 12227 * ipc_shm.c (SYS_FUNC(shmget)): Likewise. 12228 * ipc_shmctl.c (print_shmid_ds): Likewise. 12229 * mq.c (SYS_FUNC(mq_open)): Likewise. 12230 * open.c (decode_open, SYS_FUNC(creat)): Likewise. 12231 * umask.c (SYS_FUNC(umask)): Likewise. 12232 * mknod.c (decode_mknod): Use print_symbolic_mode_t. 12233 * printstat.h (DO_PRINTSTAT): Likewise. 12234 * syscall.c (trace_syscall_exiting): Use print_numeric_long_umask. 12235 * tests/umode_t.c: New file. 12236 * tests/Makefile.am (EXTRA_DIST): Add it. 12237 * tests/creat.c: Rewrite as a thin wrapper around umode_t.c 12238 * tests/mkdir.c: Likewise. 12239 * tests/mkdirat.c: Likewise. 12240 * tests/mknod.c: Extend test coverage of mknod syscall. 12241 * tests/mknodat.c: Extend test coverage of mknodat syscall. 12242 * tests/umask.c: Extend test coverage of umask syscall. 12243 * tests/creat.test: Update the value specified for strace -a parameter. 12244 * tests/mkdir.test: Likewise. 12245 * tests/mkdirat.test: Likewise. 12246 * tests/mknodat.test: Likewise. 12247 12248 2016-08-02 Dmitry V. Levin <ldv (a] altlinux.org> 12249 12250 tests: simplify attach-f-p.test. 12251 * tests/attach-f-p.c Simplify communications between threads 12252 by replacing per-thread timers with pipes. 12253 * tests/attach-f-p.test: Do not ignore signals. 12254 12255 tests: cleanup attach-p-cmd.test. 12256 * tests/attach-p-cmd-cmd.c (main): Cleanup expected output. 12257 * tests/attach-p-cmd-p.c (main): Print expected output. 12258 * tests/attach-p-cmd.test: Do not print expected output. 12259 12260 ip_mreq.test: rewrite from match_grep to match_diff. 12261 * tests/ip_mreq.c (main): Print expected output. 12262 * tests/ip_mreq.test: Use run_strace_match_diff. 12263 * tests/ip_mreq.expected: Remove. 12264 * tests/Makefile.am (EXTRA_DIST): Remove it. 12265 12266 fanotify_mark.test: rewrite from match_grep to match_diff. 12267 * tests/fanotify_mark.c (main): Print expected output. 12268 * tests/fanotify_mark.test: Use run_strace_match_diff. 12269 * tests/fanotify_mark.expected: Remove. 12270 * tests/Makefile.am (EXTRA_DIST): Remove it. 12271 12272 signalfd4.test: rewrite from match_grep to match_diff. 12273 * tests/signalfd4.c (get_sigset_size): New function. 12274 (main): Use it. Print expected output. 12275 * tests/signalfd4.test: Use run_strace_match_diff. 12276 * tests/signalfd4.expected: Remove. 12277 * tests/Makefile.am (EXTRA_DIST): Remove it. 12278 12279 2016-07-31 Dmitry V. Levin <ldv (a] altlinux.org> 12280 12281 tests: rename signalfd.test to signalfd4.test. 12282 * tests/signalfd.c: Rename to signalfd4.c. 12283 * tests/signalfd.test: Rename to signalfd4.test. 12284 * tests/signalfd.expected: Rename to signalfd4.expected. 12285 * tests/.gitignore: Replace signalfd with signalfd4. 12286 * tests/Makefile.am (check_PROGRAMS): Likewise. 12287 (DECODER_TESTS): Replace signalfd.test with signalfd4.test. 12288 (EXTRA_DIST): Replace signalfd.expected with signalfd4.expected. 12289 12290 2016-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 12291 12292 memfd_create.test: rewrite from match_grep to match_diff. 12293 * tests/memfd_create.c (main): Print expected output. 12294 * tests/memfd_create.test: Use run_strace_match_diff. 12295 * tests/memfd_create.expected: Remove. 12296 * tests/Makefile.am (EXTRA_DIST): Remove it. 12297 12298 2016-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 12299 12300 Set exit status to 1 if strace has not traced any processes. 12301 * strace.c (main): Initialize exit_code with 1 when no processes 12302 has been attached. 12303 * strace.1: Document it. 12304 * NEWS: Mention this change. 12305 12306 Attach to the target process before attempting to attach to its siblings 12307 * strace.c (attach_tcb): Attach to tcp->pid first. 12308 12309 Report the name of ptrace command when ptrace_attach_or_seize fails. 12310 * strace.c (ptrace_attach_cmd): New variable. 12311 (ptrace_attach_or_seize): Save last ptrace command's name 12312 to ptrace_attach_cmd. 12313 (attach_tcb, startup_child): Use it in error diagnostics. 12314 12315 strace.c: refactor startup_attach. 12316 * strace.c (startup_attach): Move the inner part of the big loop 12317 over tcbtab elements ... 12318 (attach_tcb): ... to this new function. 12319 12320 startup_attach: do not use atoi. 12321 * strace.c (startup_attach): Replace atoi with string_to_uint. 12322 12323 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12324 12325 Do not enable mpers runtime checks if mpers is not enabled. 12326 * m4/mpers.m4 (HAVE_RUNTIME): Enable iff both mpers and runtime 12327 work properly. 12328 12329 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12330 12331 linux/dummy_check.sh: remove obsolete script. 12332 Starting with commit v4.10-62-ga0bd374, function prototypes 12333 of syscall parsers are generated at build time. 12334 12335 * linux/dummy_check.sh: Remove. 12336 12337 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12338 12339 generate_xlat_in.sh: remove obsolete script. 12340 This script has been created by commit v4.8-180-g0ed617b 12341 for the one-shot job of automatic convertion of xlat structures 12342 from *.c files to xlat/*.in files. 12343 12344 * generate_xlat_in.sh: Remove. 12345 12346 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12347 12348 tests: use terse notation in designated initializers where appropriate. 12349 * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Initialize 12350 struct btrfs_ioctl_dev_replace_args using terse notation. 12351 * tests/clock_nanosleep.c (main): Initialize struct timespec 12352 using terse notation. 12353 * tests/nanosleep.c (main): Likewise. 12354 12355 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12356 12357 Consistently use extended regular expressions where appropriate. 12358 When grep or sed is used with basic regular expressions containing 12359 '(', ')', '{', '}', '|', '?', and '+' special characters, convert them 12360 to extended regular expressions for better portability and readability. 12361 12362 * generate_mpers_am.sh: Convert grep and sed BREs to EREs. 12363 * Makefile.am (ioctl_redefs%.h, m%_type_defs.h, m%_funcs.h, 12364 mpers_printer_decl_pattern, printers.h, %_printer_decls.h, 12365 %_printer_defs.h): Convert sed BREs to EREs. 12366 * generate_sen.sh: Likewise. 12367 * linux/mips/genstub.sh: Likewise. 12368 * make-dsc: Likewise. 12369 * mpers.sh: Likewise. 12370 * xlat/gen.sh: Likewise. 12371 * tests/Makefile.am (ksysent.h): Likewise. 12372 * tests/ksysent.sed: Likewise. 12373 * tests/pc.test: Likewise. 12374 * tests/strace-S.test: Likewise. 12375 * tests/strace-V.test: Likewise. 12376 * tests/strace-k.test: Likewise. 12377 12378 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 12379 12380 tests: fix extended regexps. 12381 * tests/adjtimex.c (main): Consistently quote curly braces 12382 in expected output. 12383 * tests/uio.expected: Likewise. 12384 12385 2016-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 12386 12387 Post-release administrivia. 12388 * NEWS: Add header line for the next release. 12389 * debian/changelog.in: Add a changelog entry for 4.13-1. 12390 * strace.spec.in: Likewise. 12391 12392 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 12393 12394 Prepare for 4.13 release. 12395 * NEWS: Update for 4.13 release. 12396 12397 Fix one more code pattern that might break gcc strict aliasing rules. 12398 * btrfs.c (btrfs_ioctl): Add one more expicit cast to "void *", 12399 to avoid breaking strict-aliasing rules reported by some gcc compilers. 12400 * syscall.c (decode_socket_subcall): Likewise. 12401 * util.c (next_set_bit): Likewise. 12402 * tests/btrfs.c (btrfs_test_send_ioctl): Likewise. 12403 12404 Fix casts of ptrace's third argument. 12405 * strace.c (maybe_allocate_tcb): Replace "(char *) 0" with NULL 12406 as ptrace's third argument. 12407 * linux/sparc64/get_scno.c (arch_get_scno): Cast third argument 12408 of ptrace to "void *'. 12409 * syscall.c (get_regs): Likewise. 12410 * upeek.c (upeek): Likewise. 12411 * util.c (umoven): Likewise. 12412 12413 tests/btrfs.c: do not include the same header file twice. 12414 * tests/btrfs.c: Do not include <sys/fcntl.h>, <fcntl.h> is enough. 12415 12416 tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition. 12417 * tests/accept4.c: Check that O_CLOEXEC is defined. Use O_CLOEXEC 12418 instead of SOCK_CLOEXEC. 12419 12420 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 12421 12422 tests: fix vhangup.test. 12423 * tests/vhangup.c (main): Fix expected output for the case when 12424 the calling process has CAP_SYS_TTY_CONFIG capability. 12425 12426 Reported-by: Yun-Chih Chen <b03902074 (a] ntu.edu.tw> 12427 12428 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 12429 12430 tests: fix chown.test. 12431 * tests/chown.test: Fix the value specified for strace -a parameter. 12432 12433 Reported-by: Yun-Chih Chen <b03902074 (a] ntu.edu.tw> 12434 12435 2016-07-25 Dmitry V. Levin <ldv (a] altlinux.org> 12436 12437 x32: fix syscall entries for x86_64 variants of io_setup and io_submit. 12438 * linux/x32/syscallent.h (64:io_setup, 64:io_submit): Change handler 12439 to printargs. 12440 12441 tests/ipc.c: fix typo. 12442 12443 2016-07-24 Dmitry V. Levin <ldv (a] altlinux.org> 12444 12445 NEWS: Prepare for 4.13 release. 12446 12447 2016-07-23 Dmitry V. Levin <ldv (a] altlinux.org> 12448 12449 debian: add gcc-multilib to Build-Depends for relevant architectures. 12450 * debian/control (Build-Depends) [amd64, ppc64, sparc64, x32]: 12451 Add gcc-multilib to enable multiple personalities support. 12452 12453 2016-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 12454 12455 tests: check decoding of ipc syscall. 12456 * tests/ipc.c: New file. 12457 * tests/ipc.test: New test. 12458 * tests/.gitignore: Add ipc. 12459 * tests/Makefile.am (check_PROGRAMS): Likewise. 12460 (DECODER_TESTS): Add ipc.test. 12461 12462 Fix corner cases of ipc syscall decoding. 12463 * xlat/ipccalls.in: New file. 12464 * ipc.c: New file. 12465 * Makefile.am (libstrace_a_SOURCES): Add it. 12466 * linux/dummy.h (sys_ipc): Remove stub alias. 12467 * syscall.c (decode_ipc_subcall): Treat 1st argument of ipc syscall 12468 as "unsigned int". 12469 [S390 || S390X]: Skip ipc cubcalls that have non-zero version. 12470 [SPARC64]: Likewise, for the native personality. 12471 Save ipc cubcall version for later use by specific ipc parsers. 12472 * ipc_msg.c (SYS_FUNC(msgrcv)): Handle non-zero ipc subcall version. 12473 [SPARC64]: Handle non-ipc_kludge case for the native personality. 12474 * linux/subcall.h (msgrcv): Change nargs from 4 to 5. 12475 * linux/s390/syscallent.h (ipc): Change nargs from 6 to 5. 12476 * linux/s390x/syscallent.h (ipc): Likewise. 12477 12478 2016-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 12479 12480 tests: skip netlink_protocol.test on old systems. 12481 * tests/netlink_protocol.c: Check that HAVE_SYS_XATTR_H is defined. 12482 Include <stdlib.h> and <sys/xattr.h>. 12483 (main): Check that system.sockprotoname attribute is supported. 12484 12485 Do not print too many arguments of socketcall syscall. 12486 * socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args" 12487 syscall arguments. 12488 * tests/socketcall.c (test_socketcall): Update expected output. 12489 * tests/socketcall.test: Likewise. 12490 12491 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 12492 12493 tests/nsyscalls.c: change the type of syscall arguments to kernel_ulong_t 12494 As most syscalls on x32 and mips n32 are actually 64-bit, 12495 check that 64-bit syscall arguments are decoded properly. 12496 12497 This also workarounds x32 gcc sign extension bug 12498 reported by Eugene Syromyatnikov at 12499 https://sourceforge.net/p/strace/mailman/message/35150860/ 12500 12501 * tests/nsyscalls.c: Include "kernel_types.h". 12502 (main): Change the type of syscall arguments to kernel_ulong_t. 12503 12504 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 12505 12506 x32, mips n32: make printargs print full 64-bit syscall arguments. 12507 As most of x32 syscalls are regular x86_64 syscalls, they should be 12508 printed by default as 64-bit syscalls, and syscall parsers at their 12509 discretion might print syscalls differently. This is already 12510 implemented in 64-bit strace tracing x32 personality processes, 12511 and now x32 strace will also behave this way. 12512 12513 Similar reasoning applies to mips n32. 12514 12515 * util.c (printargs) [HAVE_STRUCT_TCB_EXT_ARG]: Print syscall arguments 12516 from ext_arg array using %llx format. 12517 12518 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 12519 12520 tests: check decoding of socketcall syscall. 12521 * tests/socketcall.c: New file. 12522 * tests/socketcall.test: New test. 12523 * tests/.gitignore: Add socketcall. 12524 * tests/Makefile.am (check_PROGRAMS): Likewise. 12525 (DECODER_TESTS): Add socketcall.test. 12526 12527 Fix corner cases of socketcall syscall. 12528 * xlat/socketcalls.in: New file. 12529 * socketcall.c: New file. 12530 * Makefile.am (libstrace_a_SOURCES): Add it. 12531 * linux/dummy.h (sys_socketcall): Remove stub alias. 12532 * syscall.c (decode_socket_subcall): Treat 1st argument of socketcall 12533 as "int". Do not substitute syscall until all socketcall arguments 12534 have been fetched successfully. 12535 12536 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 12537 12538 tests: check decoding and dumping of send and recv syscalls. 12539 * tests/unix-pair-send-recv.c: New file. 12540 * tests/unix-pair-send-recv.expected: Likewise. 12541 * tests/unix-pair-send-recv.test: New test. 12542 * tests/.gitignore: Add unix-pair-send-recv. 12543 * tests/Makefile.am (check_PROGRAMS): Likewise. 12544 (DECODER_TESTS): Add unix-pair-send-recv.test. 12545 (EXTRA_DIST): Add unix-pair-send-recv.expected. 12546 12547 tests: rename unix-pair-send-recv to unix-pair-sendto-recvfrom. 12548 * dumpio.expected: Rename to unix-pair-sendto-recvfrom.expected. 12549 * dumpio.test: Rename to unix-pair-sendto-recvfrom.test. 12550 * unix-pair-send-recv.c: Rename to unix-pair-sendto-recvfrom.c 12551 * .gitignore: Rename unix-pair-send-recv to unix-pair-sendto-recvfrom. 12552 * Makefile.am (check_PROGRAMS): Likewise. 12553 (DECODER_TESTS): Add unix-pair-sendto-recvfrom.test. 12554 (MISC_TESTS): Remove dumpio.test. 12555 (EXTRA_DIST): Rename dumpio.expected 12556 to unix-pair-sendto-recvfrom.expected. 12557 12558 tests: check decoding of shutdown syscall. 12559 * tests/shutdown.c: New file. 12560 * tests/shutdown.test: New test. 12561 * tests/.gitignore: Add shutdown. 12562 * tests/Makefile.am (check_PROGRAMS): Likewise. 12563 (DECODER_TESTS): Add shutdown.test. 12564 12565 xlat/shutdown_modes.in: convert to modern syntax. 12566 * xlat/shutdown_modes.in: Replace open-coded xlat table with a list 12567 of constants. 12568 12569 tests: check silent decoding of sendmmsg and recvmmsg syscalls. 12570 * tests/mmsg-silent.c: New file. 12571 * tests/mmsg-silent.test: New test. 12572 * tests/.gitignore: Add mmsg-silent. 12573 * tests/Makefile.am (check_PROGRAMS): Likewise. 12574 (DECODER_TESTS): Add mmsg-silent.test. 12575 12576 Print unsent messages of failed sendmmsg syscall. 12577 * mmsghdr.c (decode_mmsgvec): Clear syserror for the time of printing 12578 struct mmsghdr array in !use_msg_len case. 12579 (SYS_FUNC(sendmmsg)): As failed sendmmsg syscall does not 12580 set msg_len fields, tell this to decode_mmsgvec. 12581 * tests/mmsg_name.c (test_mmsg_name): Check it. 12582 12583 Print unsent messages of sendmmsg syscall. 12584 * defs.h (decode_mmsgvec): Add int argument. 12585 * mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field. 12586 (print_struct_mmsghdr): Print struct mmsghdr.msg_len only for 12587 msg_len_vlen first elements of struct mmsghdr array. 12588 (decode_mmsgvec): Add msg_len_vlen argument. 12589 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec 12590 the number of elements of struct mmsghdr array that contain meaningful 12591 struct mmsghdr.msg_len. 12592 * tests/mmsg_name.c (test_mmsg_name): Check it. 12593 12594 tests: check verbose decoding of msg_name* fields of struct mmsghdr array 12595 * tests/mmsg_name-v.c: New file. 12596 * tests/mmsg_name-v.test: New test. 12597 * tests/.gitignore: Add mmsg_name-v. 12598 * tests/Makefile.am (check_PROGRAMS): Likewise. 12599 (DECODER_TESTS): Add mmsg_name-v.test. 12600 12601 tests: check decoding of msg_name* fields of struct mmsghdr array. 12602 * tests/mmsg_name.c: New file. 12603 * tests/mmsg_name.test: New test. 12604 * tests/.gitignore: Add mmsg_name. 12605 * tests/Makefile.am (check_PROGRAMS): Likewise. 12606 (DECODER_TESTS): Add mmsg_name.test. 12607 12608 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 12609 12610 Fix decoding of msg_name* fields of recvmmsg syscall's msghdr array argument 12611 As msg_namelen fields of recvmmsg syscall's struct msghdr array have 12612 the same read-write semantics as struct msghdr argument of recvmsg 12613 syscall, parser of recvmmsg syscall needs a similar fix. 12614 12615 * mmsghdr.c (print_struct_mmsghdr): Increment p_user_msg_namelen field. 12616 (mmsgvec_data): New structure. 12617 (free_mmsgvec_data, save_mmsgvec_namelen): New functions. 12618 (decode_mmsgvec): Take into account the data saved 12619 by save_mmsgvec_namelen function. 12620 (SYS_FUNC(recvmmsg)): Use save_mmsgvec_namelen. 12621 12622 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 12623 12624 mmsghdr.c: rewrite decode_mmsgvec using print_array. 12625 * fetch_struct_mmsghdr.c (sizeof_struct_mmsghdr): New mpers printer. 12626 * mmsghdr.c: Include <limits.h>. 12627 (print_struct_mmsghdr_config): New structure. 12628 (fetch_struct_mmsghdr_or_printaddr, print_struct_mmsghdr): New functions. 12629 (decode_mmsgvec): Rewrite using them and print_array. 12630 12631 tests: check decoding of timeout argument of recvmmsg syscall. 12632 * tests/recvmmsg-timeout.c: New file. 12633 * tests/recvmmsg-timeout.test: New test. 12634 * tests/.gitignore: Add recvmmsg-timeout. 12635 * tests/Makefile.am (check_PROGRAMS): Likewise. 12636 (DECODER_TESTS): Add recvmmsg-timeout.test. 12637 12638 Fix printing of remaining timeout of recvmmsg syscall. 12639 * mmsghdr.c (SYS_FUNC(recvmmsg)): Do not print remaining timeout 12640 when the 5th syscall argument is NULL. 12641 * tests/mmsg.c (main): Update expected output. 12642 12643 Remove configure checks for recvmmsg and sendmmsg. 12644 * configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg. 12645 12646 tests: add recv_mmsg and send_mmsg functions to libtests. 12647 * tests/tests.h (recv_mmsg, send_mmsg): New prototype. 12648 * tests/libmmsg.c: New file. 12649 * tests/Makefile.am (libtests_a_SOURCES): Add it. 12650 * tests/mmsg.c Do not check for __NR_sendmmsg, __NR_recvmmsg, 12651 HAVE_SENDMMSG, and HAVE_RECVMMSG. Do not include unused headers. 12652 (recv_mmsg, send_mmsg): Remove. 12653 12654 tests: add socketcall function to libtests. 12655 * tests/tests.h (socketcall): New prototype. 12656 * tests/libsocketcall.c: New file. 12657 * tests/Makefile.am (libtests_a_SOURCES): Add it. 12658 12659 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 12660 12661 Use IOV_MAX instead of UIO_MAXIOV. 12662 IOV_MAX appears to be more portable than UIO_MAXIOV. 12663 12664 * msghdr.c: Include <limits.h>. Remove fallback defintion of UIO_MAXIOV. 12665 (get_optmem_max): Replace UIO_MAXIOV with IOV_MAX. 12666 * tests/msg_control.c: Likewise. 12667 12668 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 12669 12670 Unabuse struct tcb.auxstr. 12671 As we've got a proper mechanism that parsers can use for storing private 12672 data between entering and exiting stages, all cases of struct tcb.auxstr 12673 abuse should go. 12674 12675 * btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong 12676 instead of abusing tcp->auxstr. 12677 * file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise. 12678 * msghdr.c (SYS_FUNC(recvmsg)): Likewise. 12679 * net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise. 12680 * v4l2.c (print_v4l2_queryctrl): Likewise. 12681 12682 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 12683 12684 Fix race condition in decoding timeout argument of recvmmsg syscall. 12685 As the value returned by sprint_timespec points to a static area and may 12686 be overwritten by subsequent calls to sprint_timespec, it is not safe to 12687 save this value on entering syscall and use it later on exiting. 12688 12689 * mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value 12690 returned by sprint_timespec to a dynamically allocated memory, and save 12691 the pointer using set_tcb_priv_data. On exiting, restore it using 12692 get_tcb_priv_data. 12693 12694 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 12695 12696 Fix race condition in decoding rt_sigtimedwait's timeout argument. 12697 As the value returned by sprint_timespec points to a static area and may 12698 be overwritten by subsequent calls to sprint_timespec, it is not safe to 12699 save this value on entering syscall and use it later on exiting. 12700 12701 * signal.c (SYS_FUNC(rt_sigtimedwait)): On entering syscall, copy the 12702 value returned by sprint_timespec to a dynamically allocated memory, 12703 and save the pointer using set_tcb_priv_data. On exiting, restore it 12704 using get_tcb_priv_data. 12705 12706 2016-07-18 Patrik Jakobsson <patrik.jakobsson (a] linux.intel.com> 12707 12708 Add private data field to struct tcb. 12709 We need to be able to store private data in the struct tcb across it's 12710 lifetime. To ensure proper deallocation of this stored data a callback 12711 must be provided along with the data. The callback is executed 12712 automatically on exiting syscall, and when the life of the tcb ends. 12713 12714 * defs.h (struct tcb): Add _priv_data and _free_priv_data fields. 12715 (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): 12716 New prototypes. 12717 (get_tcb_priv_ulong, set_tcb_priv_ulong): New static inline functions. 12718 * strace.c (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): 12719 New functions. 12720 (droptcb): Call free_tcb_priv_data. 12721 * syscall.c (trace_syscall_exiting): Call free_tcb_priv_data 12722 when clearing TCB_INSYSCALL flag. 12723 12724 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 12725 12726 net.c: move parsers of sendmsg and recvmsg syscalls to msghdr.c. 12727 * defs.h (fetch_msghdr_namelen, decode_msghdr): Remove. 12728 * net.c (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Move ... 12729 * msghdr.c: ... here. 12730 (fetch_msghdr_namelen, decode_msghdr): Add static qualifier. 12731 12732 net.c: move parsers of sendmmsg and recvmmsg syscalls to mmsghdr.c. 12733 * defs.h (decode_mmsgvec): Remove. 12734 * net.c: Do not include "msghdr.h". 12735 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Move ... 12736 * mmsghdr.c: ... here. 12737 (decode_mmsgvec): Add static qualifier. 12738 12739 msghdr.c: move all mmsghdr parsers to a separate file. 12740 * msghdr.h (print_struct_msghdr): New prototype. 12741 * msghdr.c (print_msghdr): Rename to print_struct_msghdr, remove 12742 static qualifier, all callers changed. 12743 (decode_mmsghdr, decode_mmsgvec, dumpiov_in_mmsghdr): Move to ... 12744 * mmsghdr.c: ... new file. 12745 * Makefile.am (strace_SOURCES): Add it. 12746 12747 2016-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 12748 12749 tests: disable part of msg_name test on non-glibc systems. 12750 Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, 12751 so limit the affected part of the test to glibc that doesn't. 12752 12753 * tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test 12754 with inaccessible 2nd argument. 12755 12756 2016-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 12757 12758 Print struct iovec as a regular structure. 12759 * io.c (print_iovec): Print names of iov_base and iov_len fields. 12760 * tests/aio.c (main): Update expected output. 12761 * tests/inet-cmsg.c (main): Likewise. 12762 * tests/mmsg.c (main): Likewise. 12763 * tests/msg_name.c (test_msg_name): Likewise. 12764 * tests/preadv-pwritev.c (main): Likewise. 12765 * tests/preadv2-pwritev2.c (main): Likewise. 12766 * tests/preadv.c (main): Likewise. 12767 * tests/pwritev.c (main): Likewise. 12768 * tests/readv.c (main): Likewise. 12769 * tests/recvmsg.c (main): Likewise. 12770 * tests/vmsplice.c (main): Likewise. 12771 * tests/scm_rights-fd.test: Likewise. 12772 * tests/uio.expected: Likewise. 12773 12774 tests: check decoding of msghdr.msg_name* arguments of recvmsg syscall. 12775 * tests/msg_name.c: New file. 12776 * tests/msg_name.test: New test. 12777 * tests/.gitignore: Add msg_name. 12778 * tests/Makefile.am (check_PROGRAMS): Likewise. 12779 (DECODER_TESTS): Add msg_name.test. 12780 12781 2016-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 12782 12783 Fix decoding of struct msghdr.msg_name* arguments of recvmsg syscall. 12784 As the msghdr.msg_namelen argument of recvmsg syscall has the same 12785 read-write semantics as the address length argument of recvfrom syscall, 12786 parser of recvmsg syscall needs a similar fix. 12787 12788 * defs.h (fetch_msghdr_namelen): New prototype. 12789 (decode_msghdr): Add "int *" argument. 12790 * msghdr.c (print_msghdr): Likewise. Treat it as a pointer to struct 12791 msghdr.msg_namelen passed to the kernel. Pass to decode_sockaddr 12792 the size of socket address actually returned by the kernel. 12793 Print both user and kernel address lengths when the value changes. 12794 (decode_msghdr, decode_mmsghdr): Add "int *" argument, 12795 forward it to print_msghdr. 12796 (decode_mmsgvec): Update decode_mmsghdr invocation. 12797 (fetch_msghdr_namelen): New function. 12798 * net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation. 12799 (SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save 12800 struct msghdr.msg_namelen. On exiting, pass the saved value 12801 to decode_msghdr. 12802 12803 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 12804 12805 Update generic ioctl entries from linux 4.7. 12806 * linux/64/ioctls_inc.h: Update from linux v4.7 using ioctls_gen.sh. 12807 * linux/32/ioctls_inc_align32.h: Likewise. 12808 * linux/32/ioctls_inc_align64.h: Likewise. 12809 12810 2016-07-12 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 12811 12812 x32: update ioctl entries from linux 4.7. 12813 * linux/x32/ioctls_inc0.h: Update from linux v4.7 using ioctls_gen.sh. 12814 12815 maint: update for linux 4.7. 12816 * maint/ioctls_sym.sh: Drop obsolete workarounds for linux/btrfs.h. 12817 12818 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 12819 12820 block.c: remove BLKDAXGET support. 12821 BLKDAXGET was removed by linux kernel commit v4.7-rc1~78^2^2~4. 12822 12823 * block.c: Do not define BLKDAXGET. 12824 (block_ioctl): Remove BLKDAXGET support. 12825 * tests/ioctl_block.c (main): Remove BLKDAXGET test. 12826 12827 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 12828 12829 Fix printing of socklen argument of bind and sendto syscalls. 12830 * net.c (SYS_FUNC(bind)): Print 3rd syscall argument using %d format. 12831 (SYS_FUNC(sendto)): Print 6th syscall argument using %d format. 12832 12833 tests: check decoding of sockaddr related arguments of recvfrom syscall. 12834 * configure.ac (AC_CHECK_FUNCS): Add recvfrom. 12835 * tests/recvfrom.c: New file. 12836 * tests/recvfrom.test: New test. 12837 * tests/.gitignore: Add recvfrom. 12838 * tests/Makefile.am (check_PROGRAMS): Likewise. 12839 (DECODER_TESTS): Add recvfrom.test. 12840 12841 Fix decoding of sockaddr related arguments of recvfrom syscall. 12842 * net.c (SYS_FUNC(recvfrom)): Use fetch_socklen. Save the address 12843 length passed to the kernel and print it on error. Do not print more 12844 bytes of the socket address than actually returned by the kernel. 12845 Print both user and kernel address lengths when the returned address 12846 is truncated. 12847 12848 tests: check decoding of accept4 syscall. 12849 * configure.ac (AC_CHECK_FUNCS): Add accept4. 12850 * tests/accept4.c: New file. 12851 * tests/accept4.test: New test. 12852 * tests/.gitignore: Add accept4. 12853 * tests/Makefile.am (check_PROGRAMS): Likewise. 12854 (DECODER_TESTS): Add accept4.test. 12855 12856 tests: check decoding of accept syscall. 12857 * tests/accept.c: New file. 12858 * tests/accept.test: New test. 12859 * tests/.gitignore: Add accept. 12860 * tests/Makefile.am (check_PROGRAMS): Likewise. 12861 (DECODER_TESTS): Add accept.test. 12862 12863 tests: check decoding of getpeername syscall. 12864 * tests/getpeername.c: New file. 12865 * tests/getpeername.test: New test. 12866 * tests/.gitignore: Add getpeername. 12867 * tests/Makefile.am (check_PROGRAMS): Likewise. 12868 (DECODER_TESTS): Add getpeername.test. 12869 12870 tests: check decoding of getsockname syscall. 12871 * tests/getsockname.c: New file. 12872 * tests/getsockname.test: New test. 12873 * tests/sockname.c: New file. 12874 * tests/.gitignore: Add getsockname. 12875 * tests/Makefile.am (check_PROGRAMS): Likewise. 12876 (DECODER_TESTS): Add getsockname.test. 12877 (EXTRA_DIST): Add sockname.c. 12878 12879 Print both values of changing address length in sockname family syscalls 12880 * net.c (decode_sockname): Print both user and kernel address lengths 12881 when the value changes. 12882 * tests/net-y-unix.c (main): Update expected output. 12883 * tests/net-yy-unix.c (main): Likewise. 12884 * tests/net.expected: Likewise. 12885 12886 Enhance diagnostics of address truncation in sockname family syscalls. 12887 * net.c (decode_sockname): Print both user and kernel address lengths 12888 when the returned address is truncated. 12889 * tests/sun_path.expected: Update expected output. 12890 12891 Fix decoding of getsockname, getpeername, accept, and accept4 syscalls. 12892 * net.c (fetch_socklen): New function. 12893 (decode_sockname): Use it. On entering syscall, decode early 12894 and return RVAL_DECODED when possible. On error, print the address 12895 length passed to the kernel. Do not print more bytes of the socket 12896 address than actually returned by the kernel. 12897 12898 2016-07-11 Dmitry V. Levin <ldv (a] altlinux.org> 12899 12900 Prepare parsers of sockname family syscalls for the upcoming fix. 12901 * net.c (do_sockname): Rename to decode_sockname, drop second argument, 12902 do not print sock_type_flags, return RVAL_DECODED on exiting. 12903 (SYS_FUNC(accept), SYS_FUNC(getsockname)): Use decode_sockname instead 12904 of do_sockname, take its return code into account. 12905 (SYS_FUNC(accept4)): Likewise. Print sock_type_flags when 12906 decode_sockname returns RVAL_DECODED. 12907 12908 2016-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 12909 12910 netlink: handle multipart netlink messages. 12911 Handle multipart netlink messages made of multiple struct nlmsghdr 12912 headers with associated payload in one byte stream. 12913 12914 * netlink.c (fetch_nlmsghdr, print_nlmsghdr, 12915 decode_nlmsghdr_with_payload): New functions. 12916 (decode_netlink): Use them. 12917 * tests/netlink_parsing.c (send_query): Check them. 12918 12919 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 12920 12921 tests: extend netlink protocol check. 12922 * tests/netlink_protocol.c (send_query): Check that no part 12923 of netlink message is fetched beyond the end of message. 12924 Check decoding of zero address and zero length messages. 12925 Check decoding of messages with nlmsg_len exceeding message length. 12926 12927 2016-07-07 Fabien Siron <fabien.siron (a] epita.fr> 12928 12929 tests: check decoding of netlink protocol. 12930 * tests/netlink_protocol.test: New test. 12931 * tests/netlink_protocol.c: New file. 12932 * tests/.gitignore: Add netlink_protocol. 12933 * tests/Makefile.am (check_PROGRAMS): Likewise. 12934 (DECODER_TESTS): Add netlink_protocol.test. 12935 12936 2016-07-07 Fabien Siron <fabien.siron (a] epita.fr> 12937 12938 Add a general netlink socket parser. 12939 Introduce a general socket netlink parser which prints the header and 12940 a string for the remaining part of the buffer. It doesn't handle all 12941 the netlink flags and types yet because the parser needs more 12942 information, this will be implemented later. 12943 12944 * net.c (decode_sockbuf): New function. 12945 (SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)): 12946 Use it instead of printstr. 12947 * msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto() 12948 for netlink sockets. 12949 * netlink.c: New file. 12950 * Makefile.am (strace_SOURCES): Add it. 12951 * defs.h (decode_netlink, getfdproto): New prototypes. 12952 (iov_decode): Add IOV_DECODER_NETLINK. 12953 * io.c (print_iovec): Use decode_netlink(). 12954 * util.c (getfdproto): Remove static keyword. 12955 * xlat/netlink_flags.in: New file. 12956 * xlat/netlink_types.in: New file. 12957 12958 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 12959 12960 Update sigaltstack SS_* constants. 12961 * xlat/sigaltstack_flags.in: Add SS_AUTODISARM introduced 12962 by linux kernel commit v4.7-rc1~195^2. 12963 12964 Update fs *_MAGIC constants. 12965 * xlat/fsmagic.in: Add NSFS_MAGIC, TRACEFS_MAGIC, BPF_FS_MAGIC, 12966 and UDF_SUPER_MAGIC introduced by linux kernel commits 12967 v3.19-rc1~53^2~7^2~1, v4.1-rc1~147^2~4, v4.4-rc1~141^2~17^2~1, 12968 and v4.7-rc1~161^2, respectively. 12969 12970 2016-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 12971 12972 Update KEYCTL_* constants. 12973 * xlat/keyctl_commands.in: Add KEYCTL_DH_COMPUTE introduced 12974 by linux kernel commit v4.7-rc1~124^2~2^2~2^2. 12975 12976 Update input event constants. 12977 * xlat/evdev_keycode.in: Add KEY_* constants introduced 12978 by linux kernel commit v4.7-rc6~32^2~6^2. 12979 12980 2016-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 12981 12982 Update RWF_* constants. 12983 * xlat/rwf_flags.in: Add RWF_DSYNC and RWF_SYNC introduced 12984 by linux kernel commit v4.7-rc1~158^2~1. 12985 12986 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 12987 12988 Update BPF_MAP_TYPE_* constants. 12989 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_TRACEPOINT introduced 12990 by linux kernel commit v4.7-rc1~154^2~332^2~6. 12991 12992 2016-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 12993 12994 msghdr.c: limit output when printing excessively large messages. 12995 Limit output of struct msghdr.msg_control when 12996 struct msghdr.msg_controllen is greater than the maximum ancillary 12997 buffer size specified in /proc/sys/net/core/optmem_max file. 12998 12999 * configure.ac (AC_CHECK_FUNCS): Add open64. 13000 * defs.h (read_int_from_file): New prototype. 13001 * util.c (read_int_from_file): New function. 13002 * msghdr.c (get_optmem_max): New function based on read_int_from_file. 13003 (decode_msg_control): Use it to check control_len argument. 13004 * tests/msg_control.c (test_big_len): New function. 13005 (main): Use it to test printing of excessively large messages. 13006 13007 2016-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 13008 13009 tests: add read_int_from_file function to libtests. 13010 * tests/overflowuid.c (read_int_from_file): New function. 13011 (check_overflow_id): Use it. 13012 * tests/tests.h (read_int_from_file): New prototype. 13013 13014 2016-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 13015 13016 msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode. 13017 * msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen 13018 bytes of ip options in abbrev mode. 13019 * tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN. 13020 (test_sol_ip): Test IP_RETOPTS output in abbrev mode. 13021 13022 msghdr.c: limit SCM_RIGHTS output in abbrev mode. 13023 * msghdr.c (print_scm_rights): Do not print more than max_strlen 13024 descriptors in abbrev mode. 13025 * tests/msg_control.c (DEFAULT_STRLEN): New macro. 13026 (print_fds): Use it. 13027 (test_scm_rights3): New function. 13028 (main): Use it to test SCM_RIGHTS output in abbrev mode. 13029 * tests/msg_control-v.c: New file. 13030 * tests/msg_control-v.test: New test. 13031 * tests/.gitignore: Add msg_control-v. 13032 * tests/Makefile.am (check_PROGRAMS): Likewise. 13033 (DECODER_TESTS): Add msg_control-v.test. 13034 13035 2016-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 13036 13037 tests: check decoding of struct msghdr ancillary data. 13038 * tests/msg_control.c: New file. 13039 * tests/msg_control.test: New test. 13040 * tests/.gitignore: Add msg_control. 13041 * tests/Makefile.am (check_PROGRAMS): Likewise. 13042 (DECODER_TESTS): Add msg_control.test. 13043 13044 2016-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 13045 13046 msghdr.c: reorganize struct cmsghdr handler. 13047 * msghdr.c (sock_ee): New structure. 13048 (print_scm_rights, print_scm_creds, print_scm_security, 13049 print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_ip_opts, 13050 print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr): Remove data_len 13051 argument validity check, don't print ", cmsg_data=" prefix here. 13052 (print_cmsg_ip_tos): Likewise. Rename to print_cmsg_uint8_t. 13053 (cmsg_printer): New type. 13054 (cmsg_socket_printers, cmsg_ip_printers): New arrays. 13055 (print_cmsg_type_data): Use them to handle struct cmsghdr 13056 and its cmsg_data. 13057 13058 msghdr.c: merge print_cmsg_ip_ttl and print_cmsg_ip_checksum. 13059 * msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint. 13060 (print_cmsg_ip_checksum): Remove. 13061 (print_cmsg_type_data): Replace print_cmsg_ip_ttl 13062 and print_cmsg_ip_checksum with print_cmsg_uint. 13063 13064 msghdr.c: enhance representation of unprintable part of msg_control array 13065 * msghdr.c (decode_msg_control): When msg_control array has an 13066 unprintable part, print its address. 13067 13068 msghdr.c: apply a sane limit to the length of IP_ORIGDSTADDR address. 13069 * msghdr.c (print_cmsg_ip_origdstaddr): Limit address length to the size 13070 of struct sockaddr_storage. 13071 13072 msghdr.c: fix printing SCM_RIGHTS array. 13073 * msghdr.c (print_scm_rights): Do not print array elements outside 13074 bounds defined by struct cmsghdr.cmsg_len. 13075 13076 msghdr.c: print unrecognized struct cmsghdr.cmsg_type in hex. 13077 * msghdr.c (print_cmsg_type_data): Use %#x format when printing 13078 struct cmsghdr.cmsg_type as an integer. 13079 13080 msghdr.c: fix printing of struct in_pktinfo. 13081 * msghdr.c (print_cmsg_ip_pktinfo): Fix printing 13082 of struct in_pktinfo.ipi_addr. 13083 13084 msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays. 13085 * msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data 13086 as an array of hexadecimal integers. 13087 * tests/inet-cmsg.c (print_opts): Update expected output. 13088 13089 msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values. 13090 * msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos, 13091 print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an 13092 array element. 13093 * tests/inet-cmsg.c (print_ttl, print_tos): Update expected output. 13094 13095 msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name 13096 * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, 13097 print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, 13098 print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr, 13099 print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents. 13100 * tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts, 13101 print_origdstaddr): Update expected output. 13102 * tests/scm_rights-fd.test: Likewise. 13103 13104 2016-06-27 Dmitry V. Levin <ldv (a] altlinux.org> 13105 13106 msghdr.c: print struct mmsghdr as a regular structure. 13107 * msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields. 13108 * tests/mmsg.c (main): Update expected output. 13109 13110 net.c: move all msghdr and mmsghdr parsers to a separate file. 13111 * defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg): 13112 New prototypes. 13113 * msghdr.c: New file. 13114 * Makefile.am (strace_SOURCES): Add it. 13115 * net.c: Move all msghdr and mmsghdr parsers to msghdr.c. 13116 13117 Mpersify fetchers of struct msghdr and struct mmsghdr. 13118 * fetch_struct_msghdr.c: New file. 13119 * fetch_struct_mmsghdr.c: Likewise. 13120 * Makefile.am (strace_SOURCES): Add them. 13121 * net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32, 13122 fetch_msghdr, fetch_mmsghdr): Remove. 13123 (decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead 13124 of fetch_msghdr. 13125 (decode_mmsghdr): Change msg_len argument to use_msg_len. 13126 Use fetch_struct_mmsghdr instead of fetch_mmsghdr. 13127 Return fetch_struct_mmsghdr's return code. 13128 (decode_mmsg): Rename to decode_mmsgvec. Take addr and len arguments. 13129 Do not print vlen and flags. Check decode_mmsghdr's return code. 13130 Print mmsghdr array using square brackets. 13131 (dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr. 13132 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead 13133 of decode_mmsg. Print vlen and flags. 13134 * tests/mmsg.c (main): Update expected output. 13135 13136 net.c: move fallback definition of struct mmsghdr to a separate file. 13137 * msghdr.h: New file. 13138 * Makefile.am (strace_SOURCES): Add it. 13139 * net.c: Include it. Move fallback definition of struct mmsghdr there. 13140 * tests/mmsg.c: Include "msghdr.h". Remove fallback definition 13141 of struct mmsghdr. 13142 13143 2016-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 13144 13145 net.c: print struct msghdr as a regular structure. 13146 * net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov, 13147 and msg_iovlen fields like other regular fields. 13148 * tests/inet-cmsg.c (main): Update expected output. 13149 * tests/mmsg.c (main): Likewise. 13150 * tests/recvmsg.c (main): Likewise. 13151 * tests/scm_rights-fd.test: Likewise. 13152 13153 net.c: rename some internal functions for consistency and readability. 13154 * net.c (printcmsghdr): Rename to decode_msg_control. 13155 (do_msghdr): Rename to print_msghdr. 13156 (extractmsghdr): Rename to fetch_msghdr. 13157 (extractmmsghdr): Rename to fetch_mmsghdr. 13158 (printmsghdr): Rename to decode_msghdr. 13159 (printmmsghdr): Rename to decode_mmsghdr. 13160 All callers updated. 13161 13162 net.c: when printing struct msghdr.msg_control, also print its name. 13163 * net.c (printcmsghdr): Skip control messages of zero length. 13164 Always print "msg_control=" before the control message. 13165 (do_msghdr): Print control message before its length, not after. 13166 * tests/inet-cmsg.c (main): Update expected output. 13167 * tests/scm_rights-fd.test: Likewise. 13168 13169 Assume that libc provides struct msghdr.msg_control. 13170 * configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control. 13171 * net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check. 13172 13173 2016-06-25 Dmitry V. Levin <ldv (a] altlinux.org> 13174 13175 net.c: move all sockaddr parsers to a separate file. 13176 * sockaddr_ll.c: Rename to sockaddr.c 13177 (print_sockaddr_data_ll): Add static keyword. 13178 * Makefile.am (strace_SOURCES): Likewise. 13179 * defs.h (print_sockaddr_data_ll): Remove. 13180 (addrfams): New prototype. 13181 * net.c: Move all sockaddr parsers to sockaddr.c. 13182 13183 net.c: rename printsock to decode_sockaddr. 13184 * defs.h (printsock): Rename to decode_sockaddr. 13185 * net.c (printsock): Likewise. 13186 (do_msghdr, SYS_FUNC(bind), do_sockname, SYS_FUNC(sendto), 13187 SYS_FUNC(recvfrom)): Replace printsock with decode_sockaddr. 13188 13189 defs.h: remove unused prototype. 13190 * defs.h (print_sock_optmgmt): Remove. 13191 13192 tests: check decoding of sockaddr structures. 13193 * tests/net-sockaddr.c: New file. 13194 * tests/net-sockaddr.test: New test. 13195 * tests/.gitignore: Add net-sockaddr. 13196 * tests/Makefile.am (check_PROGRAMS): Likewise. 13197 (DECODER_TESTS): Add net-sockaddr.test. 13198 13199 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 13200 13201 net.c: fix printing AF_PACKET socket addresses. 13202 * defs.h (print_ifindex, print_sockaddr_data_ll): New prototypes. 13203 * net.c: Stop including "xlat/af_packet_types.h". 13204 (print_ifindex): Remove static keyword. 13205 (print_sockaddr_data_l): Remove. 13206 * sockaddr_ll.c: New file. 13207 * Makefile.am (strace_SOURCES): Add it. 13208 * xlat/arp_hardware_types.in: New file. 13209 * xlat/ethernet_protocols.in: Likewise. 13210 13211 net.c: skip details of too short socket addresses, part 2. 13212 * net.c (sa_printers): Add minimal address length for each socket family. 13213 (print_sockaddr): Call socket family specific sockaddr printer 13214 only when socket address length is greater or equal 13215 the minimal address length for the socket family. 13216 13217 net.c: fix printing AF_BLUETOOTH socket addresses. 13218 * xlat/hci_channels.in: New file. 13219 * net.c (print_sockaddr_data_raw): New function. 13220 (print_sockaddr): Use it. 13221 [HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/hci_channels.h". 13222 [HAVE_BLUETOOTH_BLUETOOTH_H] (print_sockaddr_data_bt): Fix printing 13223 sockaddr_hci, sockaddr_sco, sockaddr_rc, and sockaddr_l2 structures. 13224 13225 net.c: fix printing AF_IPX sockets addresses, part 2. 13226 * net.c (print_sockaddr_data_ipx): Print sockaddr_ipx.sipx_network 13227 using %#08x format. Print elements of sockaddr_ipx.sipx_node array 13228 and sockaddr_ipx.sipx_type using %#02x format. 13229 13230 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 13231 13232 net.c: fix printing AF_UNIX abstract socket addresses. 13233 AF_UNIX abstract socket address specified by sockaddr_un.sun_path 13234 is not a NUL-terminated string. 13235 13236 * net.c (SIZEOF_SA_FAMILY): New macro. 13237 (print_sockaddr_data_un): Use it. Specify actual address length 13238 in print_quoted_string calls. Do not set QUOTE_0_TERMINATED flag 13239 when printing an abstract socket address. 13240 13241 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 13242 13243 net.c: fix printing field names of struct sockaddr_nl. 13244 * net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups" 13245 to "nl_groups". Print sockaddr_nl.nl_groups using %#08x format. 13246 * tests/net-yy-netlink.c (main): Update. 13247 13248 net.c: fix printing struct sockaddr_in6.sin6_flowinfo. 13249 * net.c (print_sockaddr_data_in6): Convert sockaddr_in6.sin6_flowinfo 13250 from network order to host order before printing. 13251 13252 2016-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 13253 13254 net.c: do not print sockaddr_in6.sin6_scope_id unnecessarily. 13255 Prior to RFC2553, struct sockaddr_in6 had no sin6_scope_id field. 13256 As the kernel still accepts RFC2133 editions of struct sockaddr_in6, 13257 print sockaddr_in6.sin6_scope_id only when it is specified. 13258 13259 * net.c (SIN6_MIN_LEN): New macro. 13260 (print_sockaddr_data_in6): Print sockaddr_in6.sin6_scope_id only when 13261 socket address length exceeds SIN6_MIN_LEN. 13262 13263 2016-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 13264 13265 net.c: fix printing raw data of socket addresses. 13266 * net.c (print_sockaddr): When printing socket address raw data, read 13267 exactly the number of data bytes specified for the socket addess. 13268 13269 net.c: skip details of too short socket addresses. 13270 * net.c (print_sockaddr): Print socket address details only when 13271 the address size is greater than sizeof(struct sockaddr.sa_family). 13272 (print_sockaddr_data_un): Remove handling of addrlen == 2. 13273 * tests/net-y-unix.c (main): Update expected pattern. 13274 * tests/net-yy-unix.c (main): Likewise. 13275 * tests/net.expected: Likewise. 13276 13277 2016-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 13278 13279 Assume that libc provides struct sockaddr_in6.sin6_scope_id. 13280 * configure.ac (AC_CHECK_MEMBERS): Remove 13281 struct sockaddr_in6.sin6_scope_id. 13282 * net.c (print_sockaddr_data_in6): Remove 13283 HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check. 13284 13285 Split print_sockaddr. 13286 * net.c (sockaddr_buf_t): Remove. 13287 (sockaddr_printer): New type. 13288 (sa_printers): New array of sockaddr_printer. 13289 (print_sockaddr): Use it. Move printers of family specific 13290 sockaddr data to separate funcions. 13291 13292 2016-06-22 Fabien Siron <fabien.siron (a] epita.fr> 13293 13294 Add a enum for decoding to tprint_iov() and tprint_iov_upto() 13295 Introduce a new type iov_decode which will be used instead of the integer 13296 "decode" as a parameter. 13297 13298 * defs.h (iov_decode): New enum. 13299 (tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. 13300 * aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in 13301 tprint_iov() call. 13302 * keyctl.c (keyctl_instantiate_key_iov): Likewise. 13303 * process.c (ptrace): Likewise. 13304 * process_vm.c (process_vm_readv, process_vm_writev): Likewise. 13305 * io.c (writev, do_pwritev, vmsplice): Likewise. 13306 (print_iovec): Replace the condition with a switch. 13307 (tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. 13308 (readv, do_preadv): Change type of "decode_iov" to enum iov_decode in 13309 tprint_iov_upto() call. 13310 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 13311 print_sg_io_v4_res): Likewise. 13312 * net.c (do_msghdr): Adapt call of tprint_iov_upto(). 13313 13314 2016-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 13315 13316 printsock: fix zero padding of sockaddr buffer. 13317 Before this change printsock used to erroneously clear the last byte 13318 of sockaddr buffer. 13319 13320 * net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer. 13321 Reserve additional byte after the sockaddr buffer for zero padding. 13322 Do not clear memory that is going to be overwritten by umoven. 13323 Clear the tail of sockaddr buffer that was not overwritten by umoven. 13324 13325 2016-06-21 Fabien Siron <fabien.siron (a] epita.fr> 13326 13327 Change printsock to return socket family. 13328 * defs.h (printsock): Change return type to int. 13329 * net.c (printsock): Likewise. Return socket family on success 13330 and -1 in case of an error. 13331 13332 2016-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 13333 13334 Unexport addrfams. 13335 * defs.h (addrfams): Remove. 13336 13337 sock.c: use print_sockaddr. 13338 * sock.c (print_ifreq_addr): Remove. 13339 (PRINT_IFREQ_ADDR): New macro. 13340 (print_ifreq, decode_ifconf): Use it instead of print_ifreq_addr. 13341 13342 Export print_sockaddr function. 13343 * defs.h (print_sockaddr): New prototype. 13344 * net.c (print_sockaddr): Remove static keyword. 13345 Change type of address pointer to "const void *". 13346 (print_cmsg_ip_recverr, print_group_req): Remove redundant casts 13347 in print_sockaddr invocations. 13348 13349 xlat/addrfams.in: provide fallback definitions. 13350 * xlat/addrfams.in: add fallback definitions for constants. 13351 13352 Update AF_* constants. 13353 * xlat/addrfams.in: Add AF_QIPCRTR. 13354 13355 Assume that libc provides inet_ntop and inet_pton. 13356 * configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton. 13357 * net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove 13358 HAVE_INET_NTOP checks. 13359 * tests/ip_mreq.c: Remove HAVE_INET_PTON check. 13360 13361 net.c: use SO_LINGER unconditionally. 13362 * net.c (print_linger, print_getsockopt, print_setsockopt): Do not check 13363 for SO_LINGER availability. 13364 13365 net.c: use AF_BLUETOOTH unconditionally. 13366 * net.c (print_sockaddr, SYS_FUNC(socket)): Do not check 13367 for AF_BLUETOOTH availability. 13368 13369 2016-06-20 Dmitry V. Levin <ldv (a] altlinux.org> 13370 13371 Consistently use AF_UNIX over AF_LOCAL. 13372 As these constants have the same value 1, let's use and print only one 13373 of them, e.g. AF_UNIX. 13374 13375 * xlat/addrfams.in (AF_LOCAL): Remove. 13376 * tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX. 13377 * tests/net-y-unix.c: Likewise. 13378 * tests/net-yy-unix.c: Likewise. 13379 * tests/netlink_unix_diag.c: Likewise. 13380 13381 2016-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 13382 13383 net.c: fix printing AF_IPX sockets. 13384 * net.c (print_sockaddr): Print sockaddr_ipx as a regular structure. 13385 (SYS_FUNC(socket)): Remove special handling of AF_IPX. 13386 13387 net.c: use AF_IPX unconditionally. 13388 * net.c (sockaddr_buf_t, print_sockaddr, SYS_FUNC(socket)): Do not check 13389 for AF_IPX availability. 13390 13391 Cleanup netipx/ipx.h availability check. 13392 * configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h. 13393 * net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__. 13394 13395 2016-06-19 Fabien Siron <fabien.siron (a] epita.fr> 13396 13397 Make getfdproto return enum instead of string. 13398 Introduce a new enum type sock_proto and use it instead of strings for socket 13399 protocols identification. 13400 13401 * defs.h (sock_proto): New enum. 13402 (get_proto_by_name): New function. 13403 * socketutils.c (protocols): New static table. 13404 (print_sockaddr_by_inode): Use it. Change type of "proto" argument 13405 to sock_proto. 13406 (get_proto_by_name): New function. 13407 * util.c (getfdproto): Use it. Change return type to sock_proto. 13408 (printfd): Update. 13409 13410 2016-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 13411 13412 Split travis-ci.sh. 13413 * travis-ci.sh: Split into travis-build.sh, travis-install.sh, 13414 and travis-success.sh files. 13415 * .travis.yml (before_install, after_success, git): New mappings. 13416 (script): Change to travis-build.sh. 13417 (addons, install): Remove. 13418 (env): Remove matrix. 13419 (matrix): Replace exclude list with include list. 13420 13421 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 13422 13423 Introduce HAVE_STRUCT_TCB_EXT_ARG macro. 13424 Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of 13425 "if defined LINUX_MIPSN32 || defined X32". 13426 13427 * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32. 13428 (struct tcb): Check it instead of LINUX_MIPSN32 || X32. 13429 (RVAL_LUDECIMAL): Likewise. 13430 * io.c (print_lld_from_low_high_val): Likewise. 13431 * lseek.c (SYS_FUNC(lseek)): Likewise. 13432 * mem.c (SYS_FUNC(mmap)): Likewise. 13433 * syscall.c (trace_syscall_exiting): Likewise. 13434 * util.c (getllval): Likewise. 13435 13436 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 13437 13438 btrfs: fix build with fresh linux/btrfs.h. 13439 Fix build with fresh <linux/btrfs.h> that provides a slightly different 13440 definition of struct btrfs_ioctl_defrag_range_args. 13441 13442 * btrfs.c (btrfs_ioctl): Cast "len" member of 13443 struct btrfs_ioctl_defrag_range_args to uint64_t. 13444 * tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len" 13445 members of struct btrfs_ioctl_defrag_range_args to uint64_t. 13446 13447 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 13448 13449 btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN* 13450 <linux/btrfs.h> was introduced in linux v3.9-rc1 while some 13451 of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN 13452 and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2, 13453 or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1. 13454 13455 * btrfs.c [!BTRFS_IOC_QUOTA_RESCAN] 13456 (struct btrfs_ioctl_quota_rescan_args): New structure. 13457 (BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros. 13458 [!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro. 13459 * tests/btrfs.c: Likewise. 13460 13461 Reported-by: Li Er <phoooyb (a] gmail.com> 13462 13463 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 13464 13465 configure.ac: fix checks for btrfs specific structures. 13466 * configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for 13467 struct btrfs_ioctl_defrag_range_args.start and 13468 struct btrfs_ioctl_search_args_v2.buf_size. 13469 13470 2016-06-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 13471 13472 README: add system requirements and beautify the file. 13473 13474 2016-06-16 Fei Jie <feij.fnst (a] cn.fujitsu.com> 13475 13476 tests: add signal_receive.test. 13477 * tests/signal_receive.c: New file. 13478 * tests/signal_receive.test: New test. 13479 * tests/.gitignore: Add signal_receive. 13480 * tests/Makefile.am (check_PROGRAMS): Likewise. 13481 (MISC_TESTS): Add signal_receive.test. 13482 13483 tests: add signal2name function to libtests. 13484 * tests/tests.h (signal2name): New prototype. 13485 * tests/signal2name.c: New file. 13486 * tests/Makefile.am (libtests_a_SOURCES): Add it. 13487 13488 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 13489 13490 net.c: use AF_INET6 unconditionally. 13491 * net.c (SYS_FUNC(socket)): Do not check for AF_INET6 availability. 13492 13493 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 13494 13495 configure.ac: do not check for linux/in6.h. 13496 The last user of <linux/in6.h> was removed by commit v4.9-252-gf362a33. 13497 13498 * configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h. 13499 13500 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 13501 13502 net.c: use AF_PACKET unconditionally. 13503 * net.c: Do not check for AF_PACKET availability. 13504 13505 net.c: include <linux/if_packet.h> unconditionally. 13506 * configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h. 13507 * net.c: Include <linux/if_packet.h> unconditionally. 13508 13509 net.c: use ICMP_FILTER unconditionally. 13510 * net.c: Do not check for ICMP_FILTER availability. 13511 13512 net.c: include <linux/icmp.h> unconditionally. 13513 * configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h. 13514 * net.c: Follow the example of tests/net-icmp_filter.c and include 13515 <linux/icmp.h> unconditionally. 13516 13517 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 13518 13519 net.c: use AF_NETLINK unconditionally. 13520 * net.c: Do not check for AF_NETLINK availability. 13521 13522 net.c: include <linux/netlink.h> unconditionally. 13523 * configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h. 13524 * net.c: Follow the example of socketutils.c and include 13525 <linux/netlink.h> unconditionally. 13526 13527 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 13528 13529 Remove UNDEFINED_SCNO. 13530 Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID 13531 and since tcp->s_ent can only be set to &sysent[tcp->scno] 13532 (or to &unknown, but only when !SCNO_IS_VALID), there is no need 13533 to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno). 13534 13535 * defs.h (UNDEFINED_SCNO): Remove. 13536 * syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting): 13537 Remove checks for UNDEFINED_SCNO. 13538 13539 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 13540 13541 tests/attach-f-p.c: fix typo in comment. 13542 13543 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 13544 13545 strace.c: fix style in function definition. 13546 * strace.c (kill_save_errno): Move the type of return value 13547 to another line. 13548 13549 Turn on more compiler warnings. 13550 * configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security, 13551 -Wignored-qualifiers, -Winit-self, -Wlogical-op, 13552 -Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration, 13553 -Wold-style-definition, -Wtype-limits. 13554 13555 strace.c: fix a warning reported by -Wold-style-definition. 13556 * strace.c (usage): Add void to the list of function argments. 13557 13558 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 13559 13560 tests/ioctl_evdev.c: fix typo in comment. 13561 13562 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 13563 13564 Move printargs* functions to util.c. 13565 * syscall.c (printargs, printargs_u, printargs_d): Move ... 13566 * util.c: ... here. 13567 13568 tests/xgetrlimit.c: fix a warning reported by -Wtype-limits. 13569 * tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants 13570 to the type of argument. 13571 13572 2016-06-11 Dmitry V. Levin <ldv (a] altlinux.org> 13573 13574 Consistently use printaddr for printing addresses. 13575 * bjm.c (SYS_FUNC(init_module)): Use printaddr. 13576 * clone.c (SYS_FUNC(clone)): Likewise. 13577 * evdev.c (ff_effect_ioctl): Likewise. 13578 * mtd.c (decode_mtd_oob_buf): Likewise. 13579 * net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)): 13580 Likewise. 13581 * print_sigevent.c (print_sigevent): Likewise. 13582 * printsiginfo.c (printsigval, print_si_info): Likewise. 13583 * signal.c (decode_new_sigaction): Likewise. 13584 * sysmips.c (SYS_FUNC(sysmips)): Likewise. 13585 * util.c (printpathn, printstr, umoven_or_printaddr): Likewise. 13586 * v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer, 13587 umoven_or_printaddr_ignore_syserror): Likewise. 13588 * tests/net-icmp_filter.c (main): Update. 13589 13590 Based on patch by Eugene Syromyatnikov <evgsyr (a] gmail.com>. 13591 13592 2016-06-10 Dmitry V. Levin <ldv (a] altlinux.org> 13593 13594 tests/attach-p-cmd-p.c: cleanup. 13595 * attach-p-cmd-p.c (handler): Move code ... 13596 (main): ... here. Unblock SIGALRM only. 13597 Use alarm() instead of setitimer(). 13598 Replace endless loop with a pause() call. 13599 Check that chdir() returns ENOENT. 13600 13601 tests: enhance test coverage of SIGCHLD siginfo_t. 13602 * tests/siginfo.c: New file. 13603 * tests/siginfo.test: New test. 13604 * tests/wait.c: Remove. 13605 * tests/wait.expected: Remove. 13606 * tests/wait.test: Remove. 13607 * tests/.gitignore: Add siginfo, remove wait. 13608 * tests/Makefile.am (check_PROGRAMS): Likewise. 13609 (DECODER_TESTS): Add siginfo.test, remove wait.test. 13610 (EXTRA_DIST): Remove wait.expected. 13611 13612 tests: extend test coverage of waitid syscall. 13613 * tests/waitid.c: New file. 13614 * tests/waitid-v.c: Likewise. 13615 * tests/waitid.test: New test. 13616 * tests/waitid-v.test: Likewise. 13617 * tests/.gitignore: Add waitid and waitid-v. 13618 * tests/Makefile.am (check_PROGRAMS): Likewise. 13619 (DECODER_TESTS): Add waitid.test and waitid-v.test. 13620 13621 tests: extend test coverage of wait4 syscall. 13622 * tests/wait4.c: New file. 13623 * tests/wait4-v.c: Likewise. 13624 * tests/wait4.test: New test. 13625 * tests/wait4-v.test: Likewise. 13626 * tests/.gitignore: Add wait4 and wait4-v. 13627 * tests/Makefile.am (check_PROGRAMS): Likewise. 13628 (DECODER_TESTS): Add wait4.test and wait4-v.test. 13629 13630 tests: add widen_to_ull macro to tests.h. 13631 * tests.h (widen_to_ull): New macro, copied from defs.h 13632 13633 Fix sign extension issues in the parser of struct rusage. 13634 * printrusage.c (printrusage): Do not cast members of struct rusage 13635 to type long, use widen_to_ull instead. 13636 13637 2016-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 13638 13639 tests: check decoding of waitpid syscall. 13640 * tests/waitpid.c: New file. 13641 * tests/waitpid.test: New test. 13642 * tests/.gitignore: Add waitpid. 13643 * tests/Makefile.am (check_PROGRAMS): Likewise. 13644 (DECODER_TESTS): Add waitpid.test. 13645 13646 2016-06-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 13647 13648 tests: add strace-E.test. 13649 * tests/strace-E.expected: New file. 13650 * tests/strace-E.test: New test. 13651 * tests/Makefile.am (MISC_TESTS): Add it. 13652 (EXTRA_DIST): Add strace-E.expected. 13653 13654 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 13655 13656 strace.spec.in: enable libunwind on more platforms. 13657 * strace.spec.in: Add libunwind-devel to BuildRequires for RHEL8 family. 13658 13659 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 13660 13661 make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec. 13662 Change make-dist to generate strace-*.tar.gz, strace.dsc, 13663 and strace.spec in addition to strace-*.tar.xz. 13664 13665 * configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip. 13666 * make-dsc: New file. 13667 * make-dist: Use it. 13668 * .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec. 13669 13670 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 13671 13672 Parametrize debian/changelog. 13673 * configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME. 13674 (DEB_CHANGELOGTIME): New variable. 13675 (AC_CONFIG_FILES): Add debian/changelog. 13676 * strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME. 13677 * debian/changelog: Rename to ... 13678 * debian/changelog.in: ... this file. Add parametrized entry. 13679 * debian/.gitignore: New file. 13680 13681 git-version-gen: replace '-' with '.' in generated version. 13682 * git-version-gen: Replace '-' with '.' so version conforms to policies 13683 * configure.ac (SPEC_VERSION): Remove. 13684 * strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION. 13685 Remove %srcname. 13686 13687 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 13688 13689 Parametrize strace.spec. 13690 * configure.ac (SPEC_VERSION, CHANGELOGTIME): Define. 13691 (AC_CONFIG_FILES): Add strace.spec. 13692 * strace.spec: Rename to ... 13693 * strace.spec.in: ... this file. Parametrize Version, srcname, 13694 and the last %changelog entry. Initialize .tarball-version file. 13695 13696 strace.spec: adopt for OBS. 13697 * strace.spec: Parametrize libunwind-devel BRs, BuildRoot, and %defattr. 13698 13699 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 13700 13701 tests: remove obsolete strace-f.test. 13702 strace-f.test is too inexact while fork-f.test does the right thing. 13703 13704 * tests/strace-f.test: Remove. 13705 * tests/Makefile.am (MISC_TESTS): Remove it. 13706 * strace.spec (BuildRequires): Remove time. 13707 13708 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 13709 13710 tests: always distribute strace-k.test. 13711 Fix distribution of tests/strace-k.test file when configured 13712 without libunwind. 13713 13714 * tests/Makefile.am (EXTRA_DIST): Add strace-k.test. 13715 13716 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 13717 13718 make-dist: skip news-check for non-releases. 13719 * make-dist: Run news-check only when the commit being built 13720 matches a release tag. 13721 13722 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13723 13724 tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls. 13725 * tests/getrlimit.c: New file. 13726 * tests/setrlimit.c: Likewise. 13727 * tests/ugetrlimit.c: Likewise. 13728 * tests/xgetrlimit.c: Likewise. 13729 * tests/getrlimit.test: New test. 13730 * tests/setrlimit.test: Likewise. 13731 * tests/ugetrlimit.test: Likewise. 13732 * tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit. 13733 * tests/Makefile.am (check_PROGRAMS): Likewise. 13734 (DECODER_TESTS): Add getrlimit.test, setrlimit.test, 13735 and ugetrlimit.test. 13736 (EXTRA_DIST): Add xgetrlimit.c. 13737 13738 tests: check decoding of prlimit64 syscall. 13739 * tests/prlimit64.c: New file. 13740 * tests/prlimit64.test: New test. 13741 * tests/.gitignore: Add prlimit64. 13742 * tests/Makefile.am (check_PROGRAMS): Likewise. 13743 (DECODER_TESTS): Add prlimit64.test. 13744 13745 Fix decoding of pid_t argument of prlimit64 syscall. 13746 * resource.c (SYS_FUNC(prlimit64)): Print pid_t syscall 13747 argument using %d format. 13748 13749 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13750 13751 Do not check for old sysctl enums. 13752 Assume that sysctl enums defined since linux v2.6 are always defined, 13753 with a signle exception: check for CTL_PROC which definition was removed 13754 in v2.6.18 and restored later in v2.6.23. 13755 13756 * configure.ac (AC_CHECK_DECLS): Remove old constants. 13757 * xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT 13758 as unconditional. 13759 * xlat/sysctl_net.in: Mark constants older than NET_LLC 13760 as unconditional. 13761 * xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET 13762 as unconditional. 13763 * xlat/sysctl_net_ipv4.in: Mark constants older than 13764 NET_IPV4_IGMP_MAX_MSF as unconditional. 13765 * xlat/sysctl_net_ipv4_conf.in: Mark constants older than 13766 NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional. 13767 * xlat/sysctl_net_ipv4_route.in: Mark constants older than 13768 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional. 13769 * xlat/sysctl_net_ipv6.in: Mark constants older than 13770 NET_IPV6_MLD_MAX_MSF as unconditional. 13771 * xlat/sysctl_net_ipv6_route.in: Mark constants older than 13772 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional. 13773 * xlat/sysctl_net_unix.in: Mark all constants as unconditional. 13774 * xlat/sysctl_root.in: Mark constants older than CTL_ARLAN 13775 as unconditional. 13776 * xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT 13777 as unconditional. 13778 13779 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13780 13781 xlat: extend syntax. 13782 * xlat/gen.sh: Implement #conditional directive that turns on 13783 preprocessor checks turned off earlier by #unconditional directive. 13784 13785 2016-06-06 Elvira Khabirova <lineprinter0 (a] gmail.com> 13786 13787 mpers.awk: remove unnecessary type attribute retrieval. 13788 * mpers.awk (what_is): Do not retrieve "type" attribute 13789 for "enumeration_type". 13790 13791 tests/ptrace.c: fix fork() return value check. 13792 * tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value 13793 to pid_t. 13794 13795 .gitignore: add missing files that should be ignored. 13796 * .gitignore: Add ioctl_redefs[12].h and libstrace.a. 13797 13798 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13799 13800 debian: sync with the package. 13801 * debian/control (Build-Depends) [amd64]: Remove libunwind-dev. 13802 * debian/changelog: Sync with 4.12-3. 13803 * debian/rules: Likewise. 13804 13805 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13806 13807 tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace. 13808 * tests/strace-S.test: Measure wall clock time instead of system time. 13809 Use local "./readv" instead of system "date" as a sample executable. 13810 13811 Reported-by: Steve McIntyre <steve (a] einval.com> 13812 13813 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 13814 13815 tests/strace-S.test: enhance error diagnostics. 13816 * tests/strace-S.test: If strace output does not meet expectations, 13817 print the output. 13818 13819 2016-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 13820 13821 .gitignore: sort the list of ignored patterns. 13822 * .gitignore: Sort. 13823 13824 2016-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 13825 13826 maint: post-release administrivia. 13827 * NEWS: Add header line for the next release. 13828 13829 2016-05-31 Dmitry V. Levin <ldv (a] altlinux.org> 13830 13831 Prepare for 4.12 release. 13832 * NEWS: Update for 4.12 release. 13833 * debian/changelog: 4.12-1. 13834 * strace.spec: 4.12-1. 13835 13836 Sync strace.spec and debian/changelog with packages. 13837 * debian/changelog: Sync with 4.11-1. 13838 * strace.spec: Sync with 4.11.0.163.9720-2. 13839 13840 2016-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 13841 13842 Mpersify hdio.c. 13843 * defs.h (hdio_ioctl): Remove. 13844 * hdio.c: Mpersify struct hd_geometry. 13845 (hdio_ioctl): Mpersify. 13846 13847 2016-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 13848 13849 loop.c: decode LOOP_SET_DIRECT_IO. 13850 * loop.c (loop_ioctl) [LOOP_SET_DIRECT_IO] : Handle LOOP_SET_DIRECT_IO. 13851 13852 loop.c: fix printing of arrays. 13853 * loop.c (decode_loop_info): Use square brackets to print 13854 struct loop_info.lo_init and struct loop_info.reserved arrays. 13855 (decode_loop_info64): Use square brackets to print 13856 struct loop_info64.lo_init array. 13857 13858 loop.c: fix printing of structure members' names. 13859 * loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_" 13860 prefix from printed names. 13861 13862 loop.c: optimize decoding of paired ioctls. 13863 * loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS 13864 and LOOP_[GS]ET_STATUS64 ioctl pairs. 13865 13866 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 13867 13868 tests/ioctl_evdev.c: check EVIOCGUNIQ decoding. 13869 * tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding. 13870 13871 tests/ioctl_mtd.c: fix build with musl. 13872 * tests/ioctl_mtd.c: Include <linux/ioctl.h>. 13873 13874 tests: check decoding of 'M' type ioctls. 13875 * tests/ioctl_mtd.c: New file. 13876 * tests/ioctl_mtd.test: New test. 13877 * tests/.gitignore: Add ioctl_mtd. 13878 * tests/Makefile.am (check_PROGRAMS): Likewise. 13879 (DECODER_TESTS): Add ioctl_mtd.test. 13880 13881 Mpersify mtd.c. 13882 * defs.h (mtd_ioctl): Remove. 13883 * mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers. 13884 (mtd_ioctl): Mpersify. 13885 13886 mtd.c: refactor. 13887 * mtd.c (mtd_ioctl): Move parsers of structures to separate functions. 13888 13889 Move parser of UBI_* ioctls to a separate file. 13890 * mtd.c (ubi_ioctl): Move to ... 13891 * ubi.c: ... new file. 13892 * Makefile.am (strace_SOURCES): Add it. 13893 13894 tests: check decoding of EVIOC* ioctls. 13895 * tests/ioctl_evdev.c: New file. 13896 * tests/ioctl_evdev-v.c: Likewise. 13897 * tests/ioctl_evdev.test: New test. 13898 * tests/ioctl_evdev-v.test: Likewise. 13899 * tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v. 13900 * tests/Makefile.am (check_PROGRAMS): Likewise. 13901 (DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test. 13902 13903 Mpersify EVIOC* ioctl parser. 13904 * defs.h (evdev_abs): New xlat prototype. 13905 (evdev_ioctl): Remove. 13906 * evdev.c: Do not include "xlat/evdev_abs.h". 13907 Mpersify struct ff_effect and ioctl numbers. 13908 (evdev_ioctl): Mpersify. 13909 * NEWS: Mention this enhancement. 13910 13911 evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT. 13912 * evdev.c (bit_ioctl): If event type is not unrecognized, 13913 print the argument as an address. 13914 13915 evdev.c: fix printing of EV_PWR's argument. 13916 * evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument. 13917 13918 evdev.c: fix indentation. 13919 * evdev.c: Fix indentation of print formats. 13920 13921 evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ. 13922 * evdev.c (evdev_read_ioctl): Fix printing of the string returned 13923 in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests. 13924 13925 evdev.c: fix EVIOCGVERSION decoding. 13926 * evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument 13927 using #x format. 13928 13929 evdev.c: fix EVIOCGMTSLOTS decoding. 13930 * evdev.c (mtslots_ioctl): Use umove_or_printaddr. 13931 13932 evdev.c: fix bitset decoding. 13933 * evdev.c (decode_bitset): Use umove_or_printaddr. 13934 13935 evdev.c: fix decoding of struct input_id. 13936 * evdev.c (getid_ioctl): Use umove_or_printaddr. 13937 13938 evdev.c: fix decoding of struct input_keymap_entry. 13939 * evdev.c (keycode_V2_ioctl): Use umove_or_printaddr. 13940 13941 evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE. 13942 * evdev.c (keycode_ioctl): Use umove_or_printaddr. 13943 13944 evdev.c: fix decoding of struct input_absinfo. 13945 * evdev.c (abs_ioctl): Use umove_or_printaddr. 13946 13947 evdev.c: fix decoding of struct ff_effect. 13948 * evdev.c (ff_effect_ioctl): Use umove_or_printaddr. 13949 Fix printing of struct ff_effect.u member names. 13950 13951 evdev.c: fix printing of struct ff_envelope.fade_level. 13952 * evdev.c (decode_envelope): Print struct ff_envelope.fade_level 13953 using #x format. 13954 13955 evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE. 13956 * evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB 13957 and EVIOCREVOKE as unsigned long. 13958 13959 evdev.c: fix EVIOCRMFF decoding. 13960 * evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int. 13961 13962 evdev.c: move handling of EVIOCGBIT to a separate function. 13963 * evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ... 13964 (bit_ioctl): ... new function. 13965 13966 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 13967 13968 evdev.c: reorder ioctl command checks. 13969 Change the order of ioctl command cheks to match the kernel: 13970 1st, check for fixed-number fixed-length commands, 13971 2nd, check for fixed-number variable-length commands, 13972 3rd, check for multi-number fixed-length commands, 13973 4thm check for multi-number variable-length commands. 13974 13975 * evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder 13976 ioctl command checks. 13977 13978 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 13979 13980 evdev.c: decode all directions except _IOC_READ on entering syscall. 13981 * evdev.c (evdev_write_ioctl): Remove exiting check. 13982 (evdev_read_ioctl): Move entering check ... 13983 (evdev_ioctl): ... here. Add RVAL_DECODED to return code in _IOC_WRITE 13984 and default cases. 13985 13986 evdev.c: fix indentation of preprocessor directives. 13987 * evdev.c: Fix indentation of preprocessor directives. 13988 Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H]. 13989 13990 2016-05-28 Jeff Mahoney <jeffm (a] suse.com> 13991 13992 file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode. 13993 * file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first 13994 two elements of info array in abbrev mode. 13995 * tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly 13996 printed elements. 13997 13998 2016-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 13999 14000 ioctl.c: fix typo in decoding of EVIOCSABS's parameter. 14001 * ioctl.c (evdev_decode_number): Fix typo in printxval default value. 14002 14003 2016-05-27 Jeff Mahoney <jeffm (a] suse.com> 14004 14005 tests: check decoding of btrfs RDWR ioctls returned data. 14006 * tests/btrfs-vw.test: New file. 14007 * tests/btrfs-w.test: New file. 14008 * tests/Makefile.am (DECODER_TESTS): Add them. 14009 14010 tests/btrfs.c: fix live btrfs_test_search_ioctls output. 14011 * tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf 14012 for BTRFS_IOC_TREE_SEARCH and fix missing whitespace. 14013 14014 btrfs.c: don't use print_array in btrfs_print_tree_search. 14015 * btrfs.c (btrfs_print_tree_search): Don't use print_array. The buffer 14016 represents a series of variable sized records, not an array. 14017 14018 btrfs.c: fix print_array usage in btrfs_print_logical_ino_container. 14019 * btrfs.c: (btrfs_print_logical_ino_container) Fix the element count 14020 to reflect the number of records rather than the number of items. 14021 14022 2016-05-26 Jeff Mahoney <jeffm (a] suse.com> 14023 14024 tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH. 14025 * tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference 14026 to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests. 14027 14028 2016-05-26 Fabien Siron <fabien.siron (a] epita.fr> 14029 14030 Fix -yy documentation. 14031 * strace.c (usage): Fix description of -yy option. 14032 * strace.1: Likewise. 14033 14034 2016-05-26 Dmitry V. Levin <ldv (a] altlinux.org> 14035 14036 tests/ioctl_block.c: tweak magic constants to make the test more reliable 14037 * tests/ioctl_block.c (main): Change bad pointer to make 14038 its lower 32-bit part closer to -1U. 14039 14040 tests/btrfs.c: check basic decoding of read-only ioctls. 14041 * tests/btrfs.c (btrfs_test_read_ioctls): New function. 14042 (main): Use it. 14043 14044 tests: check decoding of BLK* ioctls. 14045 * configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup. 14046 * tests/ioctl_block.c: New file. 14047 * tests/ioctl_block.test: New test. 14048 * tests/.gitignore: Add ioctl_block. 14049 * tests/Makefile.am (check_PROGRAMS): Likewise. 14050 (DECODER_TESTS): Add ioctl_block.test. 14051 14052 Mpersify BLK* ioctl parser. 14053 * defs.h (block_ioctl): Remove. 14054 * block.c: Mpersify struct blk_user_trace_setup, 14055 struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers. 14056 (block_ioctl): Mpersify. 14057 * NEWS: Mention this enhancement. 14058 14059 block.c: optimize decoding of paired ioctls. 14060 * block.c (block_ioctl): Optimize decoding of commands that return 14061 a signed int. 14062 14063 block.c: fix printing of uint64_t pairs. 14064 * block.c (block_ioctl): Print uint64_t values using PRIu64 format. 14065 14066 block.c: fix printing of struct blk_user_trace_setup. 14067 * block.c (block_ioctl): Fix printing of comma before 14068 struct blk_user_trace_setup.name on exiting syscall. 14069 14070 Move parser of 'X' type ioctls to a separate file. 14071 * fs_x_ioctl.c: New file. 14072 * Makefile.am (strace_SOURCES): Add it. 14073 * block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW 14074 to fs_x_ioctl.c. 14075 * defs.h (fs_x_ioctl): New prototype. 14076 * ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'. 14077 14078 Move parser of HDIO_* ioctls to a separate file. 14079 * hdio.c: New file. 14080 * Makefile.am (strace_SOURCES): Add it. 14081 * block.c: Do not include <linux/hdreg.h>. 14082 (block_ioctl): Move parser of HDIO_GETGEO to hdio.c. 14083 * defs.h (hdio_ioctl): New prototype. 14084 * ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03. 14085 14086 Fix explicit casts of signed integer types to unsigned long long. 14087 * defs.h (widen_to_ull): New macro. 14088 * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place 14089 of explicit casts to unsigned long long. 14090 * io.c (print_lld_from_low_high_val): Likewise. 14091 * lseek.c (SYS_FUNC(llseek)): Likewise. 14092 * printsiginfo.c (print_si_info): Likewise. 14093 * printstat.h (DO_PRINTSTAT): Likewise. 14094 * sysinfo.c (SYS_FUNC(sysinfo)): Likewise. 14095 * times.c (SYS_FUNC(times)): Likewise. 14096 * fetch_struct_statfs.c (ASSIGN_NUMBER): Remove. 14097 (fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER 14098 with widen_to_ull. 14099 14100 scsi.c: print __u64 types using PRI__u64 format. 14101 * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts 14102 to unsigned long long, print fields of type __u64 using PRI__u64 format. 14103 14104 2016-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 14105 14106 tests: check decoding of RTC_* ioctls. 14107 * configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc. 14108 * tests/ioctl_rtc.c: New file. 14109 * tests/ioctl_rtc-v.c: Likewise. 14110 * tests/ioctl_rtc.test: New test. 14111 * tests/ioctl_rtc-v.test: Likewise. 14112 * tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v. 14113 * tests/Makefile.am (check_PROGRAMS): Likewise. 14114 (DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test. 14115 14116 Mpersify RTC_* ioctl parser. 14117 * defs.h (rtc_ioctl): Remove. 14118 * rtc.c: Mpersify struct rtc_pll_info and ioctl numbers. 14119 (rtc_ioctl): Mpersify. 14120 * NEWS: Mention this enhancement. 14121 14122 rtc.c: fix decoding of struct rtc_wkalrm. 14123 * rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time. 14124 14125 file_ioctl.c: print file descriptors using printfd. 14126 * file_ioctl.c (print_file_dedupe_range_info): Print 14127 struct file_dedupe_range_info.dest_fd using printfd. 14128 (file_ioctl): Print struct file_clone_range.src_fd using printfd. 14129 14130 rtc.c: do not print argument of ioctls that have no arguments. 14131 * rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF} 14132 and RTC_VL_CLR ioctls. 14133 14134 rtc.c: decode RTC_PLL_GET and RTC_PLL_SET. 14135 * rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET 14136 14137 rtc.c: optimize decoding of paired ioctls. 14138 * rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET, 14139 RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs. 14140 14141 block.c: handle BLKDAXGET. 14142 * block.c [!BLKDAXGET] (BLKDAXGET): Define. 14143 (block_ioctl): Handle it. 14144 14145 tests: check decoding of mount syscall. 14146 * tests/mount.c: New file. 14147 * tests/mount.test: New test. 14148 * tests/.gitignore: Add mount. 14149 * tests/Makefile.am (check_PROGRAMS): Likewise. 14150 (DECODER_TESTS): Add mount. 14151 14152 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14153 14154 tests/vhangup.c: diassociate from the controlling terminal first. 14155 * tests/vhangup.c (main): Call setsid before vhangup. 14156 14157 2016-05-24 Fei Jie <feij.fnst (a] cn.fujitsu.com> 14158 14159 tests: add vhangup.test. 14160 * tests/vhangup.c: New file. 14161 * tests/vhangup.test: New test. 14162 * tests/.gitignore: Add vhangup. 14163 * tests/Makefile.am (check_PROGRAMS): Likewise. 14164 (DECODER_TESTS): Add vhangup.test. 14165 14166 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14167 14168 NEWS: Prepare for 4.12 release. 14169 14170 2016-05-24 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 14171 14172 tests/btrfs.c: fix build on x32. 14173 * tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino. 14174 14175 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14176 14177 tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL. 14178 * tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL 14179 is defined using unexported type "u64". 14180 14181 btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME. 14182 * btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case 14183 if this constant is not defined. 14184 * tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part 14185 of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined. 14186 14187 tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args. 14188 * tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members 14189 of struct btrfs_ioctl_clone_range_args using PRI__u64 format. 14190 14191 tests/btrfs.c: tweak magic constants to make the test more reliable. 14192 * tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val 14193 to 0xdeadbeefbadc0ded. 14194 (btrfs_test_subvol_ioctls): Likewise. Change bad_pointer 14195 to make their lower 32-bit parts closer to -1U. 14196 14197 btrfs.c: print file descriptors using printfd. 14198 * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd, 14199 struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd 14200 using printfd. 14201 * tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls, 14202 btrfs_test_device_ioctls, btrfs_test_clone_ioctls, 14203 btrfs_test_send_ioctl): Update. 14204 14205 tests/btrfs.c: do not print errno in case of fs type mismatch. 14206 * tests/btrfs.c (main): Use error_msg_and_fail instead of 14207 perror_msg_and_fail when the fs type of the given directory 14208 is not BTRFS_SUPER_MAGIC. 14209 14210 tests/btrfs.c: fix indentation. 14211 * tests/btrfs.c: Fix indentation of preprocessor directives 14212 and function prototypes. 14213 14214 tests/btrfs.c: sort included headers. 14215 * tests/btrfs.c: Sort included headers. 14216 14217 tests/btrfs.c: do not use alloca. 14218 * tests/btrfs.c: Don't include <alloca.h>. 14219 (btrfs_test_subvol_ioctls): Allocate 14220 struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc. 14221 14222 tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h> 14223 * tests/btrfs.c: Include "tests.h" first. 14224 Skip the test if [!HAVE_LINUX_BTRFS_H]. Skip parts of the test 14225 that use struct fiemap if [!HAVE_LINUX_FIEMAP_H]. 14226 14227 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 14228 14229 tests: add testing for btrfs ioctls. 14230 * tests/btrfs.c: New file. 14231 * tests/btrfs.test: New test. 14232 * tests/btrfs-v.test: Likewise. 14233 * tests/.gitignore: Add btrfs. 14234 * tests/Makefile.am (check_PROGRAMS): Likewise. 14235 (DECODER_TESTS): Add btrfs.test and btrfs-v.test. 14236 14237 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14238 14239 tests/file_ioctl.c: use tail_alloc. 14240 * tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc. 14241 14242 tests/file_ioctl.c: fix build on systems without <linux/fiemap.h> 14243 * tests/file_ioctl.c: Include "tests.h" first. 14244 Skip the test if [!HAVE_LINUX_FIEMAP_H]. 14245 14246 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 14247 14248 tests: add testing for FS_IOC_FIEMAP. 14249 This is limited to FIEMAP. FICLONE* and FIDEDUPERANGE originated in 14250 btrfs and will be tested there. 14251 14252 * tests/file_ioctl.c: New file. 14253 * tests/file_ioctl.test: New test. 14254 * tests/.gitignore: Add file_ioctl. 14255 * tests/Makefile.am (check_PROGRAMS): Likewise. 14256 (DECODER_TESTS): Add file_ioctl.test. 14257 14258 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14259 14260 Mpersify btrfs.c. 14261 * btrfs.c: Mpersify 3 arch-specific structures 14262 and corresponding ioctl numbers. 14263 (btrfs_ioctl): Mpersify. 14264 * defs.h (btrfs_ioctl): Remove. 14265 14266 btrfs.c: use print_array. 14267 * btrfs.c (print_btrfs_data_container_logical_ino, 14268 print_btrfs_data_container_ino_path, print_uint64, 14269 print_btrfs_ioctl_search_header, print_objectid_callback, 14270 print_btrfs_ioctl_space_info): New functions. 14271 (btrfs_print_logical_ino_container, btrfs_print_ino_path_container): 14272 Rewrite printers of struct btrfs_data_container.val array 14273 using print_array. 14274 (btrfs_print_qgroup_inherit): Rewrite printer of 14275 struct btrfs_qgroup_inherit.qgroups array using print_array. 14276 (btrfs_print_tree_search): Rewrite printer of 14277 struct btrfs_ioctl_search_header array using print_array. 14278 (btrfs_ioctl): Rewrite printer of 14279 struct btrfs_ioctl_send_args.clone_sources and 14280 struct btrfs_ioctl_space_args.spaces using print_array. 14281 14282 btrfs.c: simplify BTRFS_IOC_GET_FSLABEL parser. 14283 * btrfs.c (btrfs_ioctl): Share code of parser of BTRFS_IOC_SET_FSLABEL 14284 with parser of BTRFS_IOC_GET_FSLABEL only on BTRFS_IOC_GET_FSLABEL's 14285 entering. 14286 14287 btrfs.c: fix BTRFS_IOC_TREE_SEARCH_V2 output. 14288 * btrfs.c (btrfs_ioctl): Fix BTRFS_IOC_TREE_SEARCH_V2 output 14289 in case of EOVERFLOW and failed umove. 14290 14291 btrfs.c: cleanup use of tcp->auxstr. 14292 * btrfs.c (btrfs_ioctl): Reset tcp->auxstr only if it is set. 14293 14294 btrfs.c: cleanup struct btrfs_ioctl_get_dev_stats.nr_items check. 14295 * btrfs.c (btrfs_ioctl): Cleanup check of iterator of 14296 btrfs_ioctl_get_dev_stats.values array. 14297 14298 btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX. 14299 * btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove. 14300 (btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name) 14301 instead of BTRFS_SUBVOL_NAME_MAX + 1. 14302 14303 btrfs.c: mark some function arguments as const. 14304 * btrfs.c (btrfs_print_balance_args, btrfs_print_features, 14305 btrfs_print_qgroup_limit, btrfs_print_data_container_header, 14306 btrfs_print_logical_ino_container, btrfs_print_ino_path_container, 14307 btrfs_print_qgroup_inherit): Mark some function arguments as const. 14308 14309 btrfs.c: use umove instead of umoven. 14310 * btrfs.c: Use umove instead of umoven and umove_or_printaddr 14311 instead of umoven_or_printaddr. 14312 14313 btrfs.c: remove unused variable. 14314 * btrfs.c (btrfs_ioctl): Remove "ret" variable. 14315 14316 btrfs.c: use printxval/printxval64 instead of printxvals. 14317 * btrfs.c (btrfs_ioctl): Do not call printxvals directly, 14318 use printxval/printxval64 wrappers that do the right thing. 14319 14320 btrfs.c: fix indentation. 14321 * btrfs.c: Fix indentation of preprocessor directives and print formats. 14322 14323 xlat/btrfs_dev_stats_values.in: cleanup. 14324 * xlat/btrfs_dev_stats_values.in: Remove HAVE_DECL_* defines, 14325 use #unconditional instead. 14326 14327 file_ioctl.c: use print_array. 14328 * file_ioctl.c (file_ioctl): Rewrite printers of 14329 struct file_dedupe_range_info and struct fiemap_extent arrays 14330 using print_array. 14331 14332 file_ioctl.c: fix indentation. 14333 * file_ioctl.c: Fix indentation of preprocessor directives 14334 and print formats. 14335 14336 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14337 14338 file_ioctl.c: include <linux/ioctl.h> instead of <sys/ioctl.h> 14339 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 14340 no benefits for this parser. 14341 14342 * file_ioctl.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 14343 14344 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14345 14346 file_ioctl.c: fix build on systems without <linux/fiemap.h> 14347 * configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h. 14348 * file_ioctl.c: Do not include <linux/fiemap.h> and xlat/fiemap_*.h 14349 if [!HAVE_LINUX_FIEMAP_H]. 14350 (file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H]. 14351 14352 ioctl.c: fix build. 14353 * ioctl.c (ioctl_decode): Move definition of "ret" variable 14354 to [ALPHA || POWERPC] case. 14355 [ALPHA || POWERPC]: Fix syntax error. 14356 14357 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 14358 14359 ioctl: add decoding for FS_IOC_FIEMAP. 14360 * file_ioctl.c: Include <linux/fiemap.h>, "xlat/fiemap_flags.h", 14361 and "xlat/fiemap_extent_flags.h". 14362 (file_ioctl): Handle FS_IOC_FIEMAP. 14363 * ioctl.c (ioctl_decode): Use file_ioctl for decoding 'f' code ioctls. 14364 14365 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14366 14367 Add xlat/fiemap_flags.in and xlat/fiemap_extent_flags.in. 14368 * xlat/fiemap_flags.in: New file. 14369 * xlat/fiemap_extent_flags.in: Likewise. 14370 14371 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 14372 14373 ioctl: add decoding support for btrfs ioctls. 14374 * btrfs.c: New file. 14375 * file_ioctl.c: Likewise. 14376 * Makefile.am (strace_SOURCES): Add them. 14377 * configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h. 14378 (AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags, 14379 struct btrfs_ioctl_fs_info_args.nodesize, 14380 struct btrfs_ioctl_defrag_range_args.start, 14381 and struct btrfs_ioctl_search_args_v2.buf_size. 14382 (AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums. 14383 * defs.h (btrfs_ioctl, file_ioctl): New prototypes. 14384 * ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl. 14385 * xlat/btrfs_balance_args.in: New file. 14386 * xlat/btrfs_balance_ctl_cmds.in: Likewise. 14387 * xlat/btrfs_balance_flags.in: Likewise. 14388 * xlat/btrfs_balance_state.in: Likewise. 14389 * xlat/btrfs_compress_types.in: Likewise. 14390 * xlat/btrfs_defrag_flags.in: Likewise. 14391 * xlat/btrfs_dev_replace_cmds.in: Likewise. 14392 * xlat/btrfs_dev_replace_results.in: Likewise. 14393 * xlat/btrfs_dev_replace_state.in: Likewise. 14394 * xlat/btrfs_dev_stats_flags.in: Likewise. 14395 * xlat/btrfs_dev_stats_values.in: Likewise. 14396 * xlat/btrfs_features_compat.in: Likewise. 14397 * xlat/btrfs_features_compat_ro.in: Likewise. 14398 * xlat/btrfs_features_incompat.in: Likewise. 14399 * xlat/btrfs_key_types.in: Likewise. 14400 * xlat/btrfs_qgroup_ctl_cmds.in: Likewise. 14401 * xlat/btrfs_qgroup_inherit_flags.in: Likewise. 14402 * xlat/btrfs_qgroup_limit_flags.in: Likewise. 14403 * xlat/btrfs_qgroup_status_flags.in: Likewise. 14404 * xlat/btrfs_scrub_flags.in: Likewise. 14405 * xlat/btrfs_send_flags.in: Likewise. 14406 * xlat/btrfs_snap_flags_v2.in: Likewise. 14407 * xlat/btrfs_space_info_flags.in: Likewise. 14408 * xlat/btrfs_tree_objectids.in: Likewise. 14409 14410 2016-05-24 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 14411 14412 x32: update ioctl entries from linux 4.6. 14413 * linux/x32/ioctls_inc0.h: Update from linux v4.6 using ioctls_gen.sh. 14414 14415 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 14416 14417 tests/attach-f-p.c: sleep a bit more to let the tracer catch up. 14418 On noticeably lagging systems, the parent process may invoke its chdir 14419 call before the tracer gets notified about completion of its last child 14420 process. Add extra sleep in the parent process to win the race. 14421 14422 * tests/attach-f-p.c (main): Change timerid into a static array. 14423 Arm a timer in the parent process and wait for it. 14424 14425 2016-05-23 Dmitry V. Levin <ldv (a] altlinux.org> 14426 14427 tests/attach-p-cmd-cmd.c: fix potential errno clobbering. 14428 * tests/attach-p-cmd-cmd.c (main): Call getpid before chdir. 14429 14430 tests/net-yy-netlink.c: robustify against libc specific issues. 14431 * tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg 14432 as the latter has notible implementation differences that make 14433 the test unreliable. 14434 14435 tests/net-yy-netlink.c: robustify against os specific issues. 14436 * tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr 14437 as NULL doesn't work well on some systems. 14438 14439 tests/net-yy-{inet,netlink}.test: cleanup. 14440 * tests/net-yy-inet.test: Do not pass arguments to net-yy-inet 14441 as the latter does not accept them. 14442 * tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink 14443 as the latter does not accept them. 14444 14445 2016-05-22 Jeff Mahoney <jeffm (a] suse.com> 14446 14447 tests: define PRI__[dux]64 macros to print __s64 and __u64 values. 14448 Rather than cast every __u64 or __s64 before printing, 14449 define printing helpers for those types directly. 14450 14451 This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330. 14452 14453 * tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros. 14454 14455 2016-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 14456 14457 tests: remove manual creation of memory mapping holes. 14458 We used to call tail_alloc(1) to create memory mapping holes around 14459 regular tail_alloc allocations. This is no longer needed since regular 14460 tail_alloc allocations create additional memory mapping holes. 14461 14462 * tests/clock_adjtime.c (main): Remove creation of memory mapping holes 14463 using tail_alloc(1). 14464 * tests/futimesat.c (main): Likewise. 14465 * tests/get_mempolicy.c (print_nodes, main): Likewise. 14466 * tests/getgroups.c (main): Likewise. 14467 * tests/getresugid.c (main): Likewise. 14468 * tests/ioctl_uffdio.c (main): Likewise. 14469 * tests/ioctl_v4l2.c (main): Likewise. 14470 * tests/move_pages.c (main): Likewise. 14471 * tests/net-icmp_filter.c (main): Likewise. 14472 * tests/ptrace.c (test_peeksiginfo, main): Likewise. 14473 * tests/pwritev.c (main): Likewise. 14474 * tests/set_mempolicy.c (print_nodes): Likewise. 14475 * tests/setgroups.c (main): Likewise. 14476 * tests/umovestr3.c (main): Likewise. 14477 * tests/utimes.c (main): Likewise. 14478 * tests/xattr.c (main): Likewise. 14479 14480 2016-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 14481 14482 tests: make tail_alloc create additional memory mapping holes. 14483 * tests/tail_alloc.c (tail_alloc): Create additional memory mapping 14484 holes before and after the allocated memory. 14485 14486 2016-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 14487 14488 mpers: add support of conditionally compiled printers. 14489 We used to declare and define all printers marked with 14490 MPERS_PRINTER_DECL, including ifdef'ed ones. That approach left us 14491 no way to conditionally compile mpersified printers, which was not 14492 a problem until btrfs ioctls appeared on the horizon. 14493 14494 With this change, those mpersified printers that are not going 14495 to be compiled are also won't be declared and won't be added to 14496 struct_printers. 14497 14498 This is implemented by filtering all source files containing 14499 MPERS_PRINTER_DECL markers through CPP. As a nice side effect, this 14500 also lifts an ugly requirement of writing all MPERS_PRINTER_DECL 14501 declarations in a single line. 14502 14503 * README-mpers: Update description of MPERS_PRINTER_DECL syntax. 14504 * defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into 14505 a recursive variadic macro. 14506 [!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro. 14507 All callers changed. 14508 * Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern): 14509 New variables. 14510 (CLEANFILES): Add $(mpers_preproc_files). 14511 (%.c.mpers.i): New rule. 14512 (printers.h, %_printer_decls.h, %_printer_defs.h): Use 14513 mpers_preproc_files instead of srcdir_mpers_source_files, 14514 use mpers_printer_decl_pattern. 14515 * .gitignore: Add /*.mpers.i. 14516 14517 2016-05-20 Dmitry V. Levin <ldv (a] altlinux.org> 14518 14519 Remove redundant declaration of v4l2_ioctl. 14520 There is no need to declare mpers printers in defs.h because 14521 they are already declared in printers.h or native_printer_decls.h. 14522 14523 This complements commit 1e56814f77594a22a74ddee629639eb0bb7edf3a. 14524 14525 * defs.h (v4l2_ioctl): Remove. 14526 14527 2016-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 14528 14529 Fix one more code pattern that might break gcc strict aliasing rules. 14530 * socketutils.c (receive_responses): Turn static buffer into a union 14531 to avoid breaking of gcc strict aliasing rules. 14532 * tests/netlink_inet_diag.c (check_responses): Likewise. 14533 * tests/netlink_netlink_diag.c (check_responses): Likewise. 14534 * tests/netlink_unix_diag.c (check_responses): Likewise. 14535 14536 2016-05-21 Fabien Siron <fabien.siron (a] epita.fr> 14537 14538 tests: add check for netlink protocol decoding with -yy option. 14539 * tests/netlink_netlink_diag.c: New file. 14540 * tests/net-yy-netlink.c: New file. 14541 * tests/net-yy-netlink.test: New test. 14542 * tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag 14543 * tests/Makefile.am (check_PROGRAMS): Likewise. 14544 (TESTS): Add net-yy-netlink.test. 14545 14546 2016-05-18 Fabien Siron <fabien.siron (a] epita.fr> 14547 14548 Add netlink domain sockets support to socketutils. 14549 * linux/netlink_diag.h: New file. 14550 * Makefile.am (EXTRA_DIST): Add it. 14551 * socketutils.c: Include it and "xlat/netlink_protocols.h". 14552 (netlink_send_query, netlink_parse_response, netlink_print): New 14553 functions. 14554 (print_sockaddr_by_inode): Hook up netlink_print. 14555 14556 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 14557 14558 tests/pread64-pwrite64.c: robustify against os specific issues. 14559 Do not assume that pwrite64 syscall fails when only part of the 14560 specified memory buffer is accessible. With some kernels, one 14561 accessible byte at the end of page is enough for pwrite64 syscall 14562 to return 1. 14563 14564 * tests/pread64-pwrite64.c (main): Tweak the test that can lead 14565 to a partial write. 14566 14567 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 14568 14569 tests/read-write.c: robustify against os specific issues. 14570 Do not assume that write syscall fails when only part of the specified 14571 memory buffer is accessible. With some kernels, one accessible byte 14572 at the end of page is enough for write syscall to return 1. 14573 14574 * tests/read-write.c (main): Tweak the test that can lead to a partial 14575 write. 14576 14577 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 14578 14579 umovestr3.test: extend test coverage. 14580 * tests/umovestr3.c: Include <sys/param.h>. 14581 (main): Test with each number between PATH_MAX-1 and 0. 14582 14583 tests/timer_create.c: robustify against os specific issues. 14584 * tests/timer_create.c (main): Do not assume any specific error code 14585 returned by timer_create, print whatever it is. 14586 14587 Fix some compilation warnings on older systems. 14588 * print_statfs.c (print_statfs_flags): Define only 14589 for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS]. 14590 * tests/inet-cmsg.c (print_origdstaddr): Define only 14591 for [IP_ORIGDSTADDR]. 14592 14593 Update generic ioctl entries from linux 4.6. 14594 * linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh. 14595 * linux/32/ioctls_inc_align32.h: Likewise. 14596 * linux/32/ioctls_inc_align64.h: Likewise. 14597 * NEWS: Mention this. 14598 14599 maint: update for linux 4.6. 14600 * maint/ioctls_sym.sh: Update workarounds for linux/kvm.h. 14601 14602 Update SOL_* constants. 14603 * xlat/socketlayers.in: Add SOL_KCM. 14604 14605 Update MSG_* constants. 14606 * xlat/msg_flags.in: Add MSG_BATCH. 14607 14608 Update AF_* constants. 14609 * xlat/addrfams.in: Add AF_KCM. 14610 14611 2016-05-17 Fei Jie <feij.fnst (a] cn.fujitsu.com> 14612 14613 tests: add brk.test. 14614 * tests/brk.c: New file. 14615 * tests/brk.test: New test. 14616 * tests/.gitignore: Add brk. 14617 * tests/Makefile.am (check_PROGRAMS): Likewise. 14618 (DECODER_TESTS): Add brk.test. 14619 14620 2016-05-17 Dmitry V. Levin <ldv (a] altlinux.org> 14621 14622 Fix printing of invalid arguments of term ioctls. 14623 * term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls 14624 using printxval_long. 14625 14626 mips: fix printing of invalid operations argument of sysmips syscall. 14627 * sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using 14628 printxval_long. 14629 14630 bfin: fix printing of invalid flags argument of sram_alloc syscall. 14631 * sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using 14632 printflags_long. 14633 14634 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14635 14636 Fix printing of invalid arguments of prctl syscall. 14637 * prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument 14638 of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL, 14639 and PR_SET_SECCOMP using printxval_long. 14640 Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long. 14641 Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using 14642 printxval_long. 14643 * tests/prctl-seccomp-strict.c (main): Update. 14644 14645 Fix printing of invalid flags argument of perf_event_open syscall. 14646 * numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall 14647 using printflags_long. 14648 14649 or1k: fix printing of invalid 1st argument of or1k_atomic syscall. 14650 * or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using 14651 printxval_long. 14652 14653 Fix printing of invalid flags argument of get_mempolicy syscall. 14654 * numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall 14655 using printxval_long. 14656 14657 Fix printing of invalid mode argument of mbind syscall. 14658 * numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall 14659 using printxval_long. 14660 * tests/mbind.c (main): Update. 14661 14662 Fix printing of invalid argument of MTDFILEMODE ioctl. 14663 * mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl 14664 using printflags_long. 14665 14666 Fix printing of invalid flags argument of mount syscall. 14667 * mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long. 14668 14669 Fix printing of invalid arguments of memory mapping related syscalls. 14670 * mem.c (print_mmap): Print 3rd and 4th arguments of syscall 14671 using printflags_long. 14672 (SYS_FUNC(mprotect)): Print 3rd argument of syscall using 14673 printflags_long. 14674 (SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long. 14675 (SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall 14676 using printflags_long. 14677 * tests/remap_file_pages.c (main): Update. 14678 14679 Fix printing of invalid flags argument of kexec_load and kexec_file_load 14680 * kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print 14681 flags argument using printflags_long. 14682 14683 Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall. 14684 * fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and 14685 F_ADD_SEALS operations using printflags_long. 14686 14687 Fix printing of invalid flags argument of unshare syscall. 14688 * clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long. 14689 14690 Introduce printflags_long and printxval_long. 14691 * defs.h (printflags_long, printxval_long): New static inline functions. 14692 14693 Fix printing of invalid struct xfs_dqblk.d_flags. 14694 * quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags 14695 to uint8_t to avoid potential sign-extension bug when printing 14696 invalid struct xfs_dqblk.d_flags. 14697 14698 Fix printing of invalid struct ubi_mkvol_req.vol_type. 14699 * mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type 14700 to unsigned short to avoid potential sign-extension bug when printing 14701 invalid struct ubi_mkvol_req.vol_type. 14702 14703 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14704 14705 Fix decoding of prctl/arch_prctl operation argument. 14706 Consistently treat operation argument of prctl/arch_prctl syscalls 14707 as int to match the kernel behaviour. 14708 14709 * prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument 14710 of syscalls to a variable of type unsigned int and use it in all 14711 subsequent checks and lookups. 14712 14713 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14714 14715 Fix printing of struct sched_attr.sched_flags. 14716 * sched.c (print_sched_attr): Print sched_flags using printflags64. 14717 14718 Fix printing of struct statfs.f_flags. 14719 * print_statfs.c (print_statfs_flags): Print flags using printflags64. 14720 14721 Fix printing of invalid struct ifreq.ifr_flags. 14722 * sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags 14723 to unsigned short to avoid potential sign-extension bug when printing 14724 invalid struct ifreq.ifr_flags. 14725 14726 Fix printing of invalid struct pollfd.events. 14727 * poll.c (print_pollfd): Explicitly cast struct pollfd.events 14728 to unsigned short to avoid potential sign-extension bug when printing 14729 invalid struct pollfd.events. 14730 14731 Fix printing of invalid struct sembuf.sem_flg. 14732 * ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg 14733 to unsigned short to avoid potential sign-extension bug when printing 14734 invalid struct sembuf.sem_flg. 14735 14736 Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls. 14737 * fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence 14738 fields to unsigned short to avoid potential sign-extension bug when 14739 printing invalid l_type or l_whence fields. 14740 14741 Fix printing of fanotify_mark mask argument. 14742 * fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64. 14743 14744 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14745 14746 Fix decoding of epoll_ctl operation argument. 14747 Consistently treat operation argument of epoll_ctl syscall as int 14748 to match the kernel behaviour. 14749 14750 * epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall 14751 to a variable of type unsigned int and use it in all subsequent 14752 checks and lookups. 14753 * tests/epoll_ctl.c (invoke_syscall): New function. 14754 (main): Use it. 14755 14756 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14757 14758 Fix printing of invalid d_type in getdents syscall. 14759 * dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid 14760 potential sign-extension bug when printing invalid d_type. 14761 14762 bfin: fix decoding of cacheflush syscall. 14763 * cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument 14764 using %lu format. Print 3rd argument as flags. 14765 14766 Fix decoding of BPF_MAP_UPDATE_ELEM flags. 14767 * bpf.c (bpf_map_update_elem): Print attr.flags using printxval64. 14768 14769 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 14770 14771 Fix decoding of fcntl/fcntl64 operation argument. 14772 Consistently treat operation argument of fcntl/fcntl64 syscalls as int 14773 to match the kernel behaviour. 14774 14775 * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign 14776 2nd argument of syscall to a variable of type unsigned int 14777 and use it in all subsequent checks and lookups. 14778 * tests/struct_flock.c (invoke_test_syscall): New function. 14779 (test_flock_einval, test_flock): Use it. 14780 * tests/fcntl.c (test_flock64_einval): Use it. 14781 * tests/fcntl64.c (test_flock64_einval, test_flock64): Use it. 14782 14783 2016-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 14784 14785 Rename sprintflags64 to sprintflags. 14786 * defs.h (sprintflags): Remove. 14787 (sprintflags64): Rename to sprintflags. 14788 * util.c (sprintflags64): Rename to sprintflags. 14789 14790 Prepare for transition from sprintflags64 to sprintflags. 14791 * fcntl.c (print_fcntl): Cast 3rd argument of sprintflags 14792 to unsigned long. 14793 * membarrier.c (SYS_FUNC(membarrier)): Likewise. 14794 * prctl.c (SYS_FUNC(prctl)): Likewise. 14795 * poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags 14796 to unsigned short. 14797 14798 2016-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 14799 14800 Rename xlookup64 to xlookup. 14801 * defs.h (xlookup): Remove. 14802 (xlookup64): Rename to xlookup. 14803 * util.c (xlookup64): Rename to xlookup. 14804 14805 Prepare for transition from xlookup64 to xlookup. 14806 * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): 14807 Cast 2nd argument of xlookup to unsigned long. 14808 * prctl.c (SYS_FUNC(prctl)): Likewise. 14809 * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. 14810 * time.c (do_adjtimex): Likewise. 14811 * ioprio.c (sprint_ioprio): Change type of the argument 14812 and local variables from int to unsigned int. 14813 * keyctl.c (print_keyring_serial_number): Cast 2nd argument 14814 of xlookup to unsigned int. 14815 * net.c (tprint_sock_type): Change type of the argument to unsigned int. 14816 * printmode.c (sprintmode): Likewise. 14817 * printsiginfo.c (printsigval): Change type of si_code argument 14818 to unsigned int. 14819 14820 2016-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 14821 14822 v4l2: fix build with old kernel headers. 14823 Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all 14824 required headers, resulting to omission of V4L2_* constants. 14825 14826 This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files 14827 because they already include all necessary headers themselves. 14828 14829 * configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>, 14830 and <linux/types.h> before <linux/videodev2.h>. 14831 14832 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14833 14834 configure.ac: do not check for sys/ioctl.h and ioctls.h. 14835 Since sys/ioctl.h is included unconditionally when needed 14836 and ioctls.h doesn't exist, these checks are redundant. 14837 14838 * configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h. 14839 14840 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14841 14842 sock.c: include <linux/ioctl.h> instead of <sys/ioctl.h> or <ioctls.h> 14843 Include <linux/ioctl.h> for <linux/sockios.h> on alpha, sh, and sh64 14844 architectures because their <asm/sockios.h> use _IOR and _IOW macros 14845 but don't include anything that would define these macros. 14846 14847 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 14848 no benefits in this case. <ioctls.h> simply doesn't exist. 14849 14850 * sock.c [ALPHA || SH || SH64]: Include <linux/ioctl.h> 14851 instead of <sys/ioctl.h> or <ioctls.h>. 14852 14853 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14854 14855 v4l2: include <linux/ioctl.h> instead of <sys/ioctl.h> 14856 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 14857 no benefits for parser of VIDIOC_* ioctls. 14858 14859 * v4l2.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 14860 14861 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14862 14863 printsiginfo: remove "verbose" argument. 14864 Remove erroneous use of verbose(tcp) as a printing limit 14865 for already fetched members of siginfo_t structure. 14866 14867 * printsiginfo.h (printsiginfo): Remove boolean argument. 14868 * printsiginfo.c (printsigval): Remove boolean argument, print 14869 si_int and si_ptr members unconditionally. All callers changed. 14870 (print_si_info): Remove boolean argument, print si_utime and si_stime 14871 members unconditionally. All callers changed. 14872 (printsiginfo): Remove boolean argument. All callers changed. 14873 14874 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14875 14876 tests/ptrace.c: tweak magic constants to make the test more reliable. 14877 * tests/ptrace.c (main): Change bad_request and bad_data to make they 14878 lower 32-bit parts closer to -1U. 14879 14880 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14881 14882 tests/ioctl_v4l2.c: fix build on older systems. 14883 Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or 14884 V4L2_CTRL_CLASS_CAMERA. 14885 14886 * tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the 14887 test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING]. 14888 Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER. 14889 14890 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14891 14892 Do not use htole32 function. 14893 htole32 function is not portable enough. 14894 14895 * v4l2.c (print_pixelformat): Rewrite initialization of pixel format 14896 union without using of htole32. 14897 * tests/ioctl_v4l2.c (main): Likewise. 14898 14899 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14900 14901 tests/ioctl_v4l2.c: fix typo. 14902 * tests/ioctl_v4l2.c (main) 14903 [!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected 14904 output string. 14905 14906 tests: check decoding of ptrace syscall. 14907 * tests/ptrace.c: New file. 14908 * tests/ptrace.test: New test. 14909 * tests/.gitignore: Add ptrace. 14910 * tests/Makefile.am (check_PROGRAMS): Likewise. 14911 (DECODER_TESTS): Add ptrace. 14912 14913 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14914 14915 ptrace: decode data argument of PTRACE_PEEKSIGINFO request. 14916 The data argument of PTRACE_PEEKSIGINFO request is a pointer 14917 to siginfo_t array. 14918 14919 * printsiginfo.c (print_siginfo_t): New function. 14920 (print_siginfo_array): New mpers printer. 14921 * process.c (SYS_FUNC(ptrace)): Print data argument of 14922 PTRACE_PEEKSIGINFO request using print_siginfo_array. 14923 14924 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 14925 14926 ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request. 14927 * process.c (SYS_FUNC(ptrace)): Print data argument of 14928 PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog. 14929 14930 ptrace: decode argument of PTRACE_GETEVENTMSG request. 14931 * process.c (SYS_FUNC(ptrace)): Print data argument of 14932 PTRACE_GETEVENTMSG request on exiting using printnum_ulong. 14933 14934 ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests. 14935 * process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK 14936 and PTRACE_SETSIGMASK requests using print_sigset_addr_len. 14937 14938 ptrace: return RVAL_DECODED for requests decoded on entering. 14939 * process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all 14940 ptrace requests except those that are partially decoded in exiting, 14941 14942 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14943 14944 ptrace: print PTRACE_O_* flags using printflags64. 14945 As flags argument has a long integer type, print it using printflags64 14946 because printflags takes unsigned int argument. 14947 14948 * process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags 14949 using printflags64. 14950 14951 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14952 14953 ptrace: print data argument of PTRACE_SEIZE et al requests as flags. 14954 * process.c (SYS_FUNC(ptrace)): Print data argument of 14955 PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags. 14956 14957 ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo 14958 * process.c (SYS_FUNC(ptrace)): Print data argument of 14959 PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests 14960 as a signal number. 14961 14962 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14963 14964 ptrace: decode addr argument of PTRACE_PEEKSIGINFO request. 14965 The addr argument of PTRACE_PEEKSIGINFO request is a pointer to 14966 a struct ptrace_peeksiginfo_args. 14967 14968 * process.c: Include "xlat/ptrace_peeksiginfo_flags.h". 14969 (SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request 14970 as a struct ptrace_peeksiginfo_args. 14971 * xlat/ptrace_peeksiginfo_flags.in: New file. 14972 14973 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14974 14975 ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests. 14976 For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument 14977 contains the size of the buffer pointed to by data argument. 14978 For PTRACE_SECCOMP_GET_FILTER request, addr argument contains 14979 an offset counter. 14980 14981 * process.c (SYS_FUNC(ptrace)): Print addr argument of 14982 PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER 14983 requests using %lu format. 14984 14985 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14986 14987 ptrace: do not print data argument of some requests on sparc. 14988 On sparc, kernel ignores data argument of PTRACE_GETREGS, 14989 PTRACE_SETREGS, PTRACE_GETFPREGS, and PTRACE_SETFPREGS requests. 14990 14991 * process.c (SYS_FUNC(ptrace)) [SPARC || SPARC64]: Return RVAL_DECODED 14992 right after printing addr argument if request is one of PTRACE_GETREGS, 14993 PTRACE_SETREGS, PTRACE_GETFPREGS, or PTRACE_SETFPREGS. 14994 14995 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 14996 14997 ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests 14998 As kernel ignores addr and data arguments of PTRACE_ATTACH, 14999 PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request, 15000 we do not print them either. 15001 15002 * process.c (SYS_FUNC(ptrace)): After printing pid argument, return 15003 RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT, 15004 PTRACE_KILL, or PTRACE_LISTEN. 15005 15006 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 15007 15008 ptrace: do not print arguments of PTRACE_TRACEME request. 15009 As kernel ignores arguments of PTRACE_TRACEME request, 15010 we do not print them either. 15011 15012 * process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME, 15013 return early with RVAL_DECODED. 15014 15015 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 15016 15017 ptrace: print request using printxval64. 15018 As first argument of ptrace syscall has a long integer type, print 15019 it using printxval64 because printxval takes unsigned int argument. 15020 15021 * process.c (SYS_FUNC(ptrace)): Change type of "request" variable 15022 from "long" to "unsigned long", print it using printxval64 instead 15023 of printxval. 15024 15025 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 15026 15027 Do not sign-extend siginfo_t.si_syscall. 15028 * printsiginfo.c (print_si_info): Explicitly cast si_syscall member 15029 of siginfo_t that has type "int" to "unsigned int", to avoid sign 15030 extension when passed to syscall_name function. 15031 15032 Export print_seccomp_fprog for further use in parser of ptrace syscall. 15033 * defs.h (print_seccomp_fprog): New prototype. 15034 * seccomp.c (print_seccomp_fprog): Remove "static" keyword. 15035 Move printing of struct seccomp_fprog fields ... 15036 (print_seccomp_filter): ... here. 15037 15038 2016-05-11 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15039 15040 tests: add munlockall.test. 15041 * tests/munlockall.c: New file. 15042 * tests/munlockall.test: New test. 15043 * tests/.gitignore: Add munlockall. 15044 * tests/Makefile.am (check_PROGRAMS): Likewise. 15045 (DECODER_TESTS): Add munlockall.test. 15046 15047 tests: add link.test. 15048 * tests/link.c: New file. 15049 * tests/link.test: New test. 15050 * tests/.gitignore: Add link. 15051 * tests/Makefile.am (check_PROGRAMS): Likewise. 15052 (DECODER_TESTS): Add link.test. 15053 15054 2016-05-11 Dmitry V. Levin <ldv (a] altlinux.org> 15055 15056 tests: check decoding and dumping of preadv2 and pwritev2 syscalls. 15057 * tests/preadv2-pwritev2.c: New file. 15058 * tests/preadv2-pwritev2.test: New test. 15059 * tests/.gitignore: Add preadv2-pwritev2. 15060 * tests/Makefile.am (check_PROGRAMS): Likewise. 15061 (DECODER_TESTS): Add preadv2-pwritev2. 15062 15063 Implement decoding of preadv2 and pwritev2 syscalls. 15064 * io.c: Include "xlat/rwf_flags.h". 15065 (do_preadv, do_pwritev, SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): 15066 New functions. 15067 (SYS_FUNC(preadv)): Use do_preadv. 15068 (SYS_FUNC(pwritev)): Use do_pwritev. 15069 * linux/32/syscallent.h (preadv2, pwritev2): New entries. 15070 * linux/64/syscallent.h: Likewise. 15071 * linux/arm/syscallent.h: Likewise. 15072 * linux/hppa/syscallent.h: Likewise. 15073 * linux/i386/syscallent.h: Likewise. 15074 * linux/ia64/syscallent.h: Likewise. 15075 * linux/m68k/syscallent.h: Likewise. 15076 * linux/mips/syscallent-n32.h: Likewise. 15077 * linux/mips/syscallent-n64.h: Likewise. 15078 * linux/mips/syscallent-o32.h: Likewise. 15079 * linux/powerpc/syscallent.h: Likewise. 15080 * linux/powerpc64/syscallent.h: Likewise. 15081 * linux/s390/syscallent.h: Likewise. 15082 * linux/s390x/syscallent.h: Likewise. 15083 * linux/sparc/syscallent.h: Likewise. 15084 * linux/sparc64/syscallent.h: Likewise. 15085 * linux/x32/syscallent.h: Likewise. 15086 * linux/x86_64/syscallent.h: Likewise. 15087 * syscall.c (dumpio): Handle SEN_preadv2 and SEN_pwritev2. 15088 * xlat/rwf_flags.in: New file. 15089 * NEWS: Mention parsers of new syscalls. 15090 15091 2016-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 15092 15093 tests: extend test coverage of xattr family syscalls. 15094 * tests/xattr.c: Check decoding of all xattr family syscalls. 15095 * tests/xattr.test: Use run_strace_match_diff. 15096 * tests/xattr.expected: Remove. 15097 * tests/Makefile.am (EXTRA_DIST): Remove it. 15098 15099 tests: add print_quoted_memory function to libtests. 15100 * tests/print_quoted_string.c (print_quoted_memory): New function. 15101 (print_quoted_string): Use it. 15102 * tests/tests.h (print_quoted_memory): New prototype. 15103 15104 Fix corner cases of xattr family syscalls decoding. 15105 * xattr.c (print_xattr_val): Do not take insize into account, print it 15106 as unsigned long. 15107 Do not decode xattr values of size larger than XATTR_SIZE_MAX. 15108 Use static buffer for fetching xattr values. 15109 (print_xattr_list): Do not decode string when size is zero. 15110 15111 2016-05-10 Dr. David Alan Gilbert <dgilbert (a] redhat.com> 15112 15113 userfaultfd: Add ioctl tests. 15114 * tests/ioctl_uffdio.c: New file. 15115 * tests/ioctl_uffdio.test: New test. 15116 * tests/.gitignore: Add ioctl_uffdio. 15117 * tests/Makefile.am (check_PROGRAMS): Likewise. 15118 (DECODER_TESTS): Add ioctl_uffdio.test. 15119 15120 2016-05-10 Dr. David Alan Gilbert <dgilbert (a] redhat.com> 15121 15122 Decode UFFDIO_* ioctls. 15123 Decode the ioctls associated with the userfaultfd fd. 15124 Note that they tend to read from and also return result in it's data 15125 structure. 15126 15127 * configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h. 15128 * userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder. 15129 * defs.h (uffdio_ioctl): New prototype. 15130 * ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in 15131 uffdio_ioctl. 15132 * xlat/uffd_*.in: Create flag xlat for all the IOCTLs. 15133 15134 2016-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 15135 15136 Update AX_CODE_COVERAGE. 15137 * m4/ax_code_coverage.m4: Update to serial 16. 15138 * Makefile.am (CODE_COVERAGE_LCOV_OPTIONS): Remove. 15139 (CODE_COVERAGE_GENHTML_OPTIONS): Update, add prefix. 15140 (CODE_COVERAGE_BRANCH_COVERAGE): Set to 1. 15141 15142 strace-ff.test: fix race condition. 15143 * tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command. 15144 15145 tests/epoll_pwait.c: fix for x32. 15146 * tests/epoll_pwait.c (main): Explicitly cast last syscall argument 15147 to kernel_ulong_t. 15148 15149 strace-S.test: check "-S name" 15150 * tests/strace-S.test: Add a check for "-c -S name" output. 15151 15152 Fix NULL dereference in "-S name" when syscall table has holes. 15153 * count.c (syscall_cmp): Do not pass NULL to strcmp. 15154 15155 strace-S.test: cleanup. 15156 * tests/strace-S.test: Rewrite using sed. 15157 15158 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15159 15160 tests: add strace-S.test. 15161 * tests/strace-S.test: New test. 15162 * tests/Makefile.am (MISC_TESTS): Add it. 15163 15164 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 15165 15166 strace-ff.test: check that -ff does not create unexpected output files. 15167 * tests/strace-ff.expected: New file. 15168 * tests/Makefile.am (EXTRA_DIST): Add it. 15169 * tests/strace-ff.test: Use it. Check that no other output files 15170 have been created. 15171 15172 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15173 15174 tests: add strace-ff.test. 15175 * tests/strace-ff.test: New test. 15176 * tests/Makefile.am (MISC_TESTS): Add it. 15177 15178 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 15179 15180 strace-V.test: cleanup. 15181 * tests/strace-V.test: Move config.h parser to a function. 15182 Rename $OUT to $EXP, swap arguments passed to match_diff. 15183 15184 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15185 15186 tests: add strace-V.test. 15187 * tests/strace-V.test: New test. 15188 * tests/Makefile.am (MISC_TESTS): Add it. 15189 15190 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 15191 15192 tests: check decoding of epoll_pwait syscall. 15193 * tests/epoll_pwait.c: New file. 15194 * tests/epoll_pwait.test: New test. 15195 * tests/.gitignore: Add epoll_pwait. 15196 * tests/Makefile.am (check_PROGRAMS): Likewise. 15197 (DECODER_TESTS): Add epoll_pwait.test. 15198 15199 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 15200 15201 Assume that sys/epoll.h exists. 15202 This header file was added in glibc-2.3.2, 15203 so it's safe to assume its availability. 15204 15205 * configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h. 15206 * epoll.c: Include <sys/epoll.h> unconditionally. 15207 Compile [HAVE_SYS_EPOLL_H] code unconditionally. 15208 * tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H. 15209 * tests/epoll_wait.c: Likewise. 15210 15211 2016-05-08 Fabien Siron <fabien.siron (a] epita.fr> 15212 15213 Factorize send_query functions. 15214 * socketutils.c (send_query): New function. 15215 (inet_send_query, unix_send_query): Use it. 15216 15217 2016-05-08 Dmitry V. Levin <ldv (a] altlinux.org> 15218 15219 tests: relax timings. 15220 Allow nanosleep(2) to spend 10% more time to make the test suite 15221 more reliable on slow systems. 15222 15223 * tests/count.test: Treat 1.1 seconds as valid output. 15224 * tests/strace-T.expected: Likewise. 15225 * tests/strace-r.expected: Likewise. 15226 15227 2016-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 15228 15229 tests/attach-f-p.c: increase timeouts. 15230 Increase timeouts to make the test more reliable on slow systems. 15231 15232 * tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds, 15233 respectively. 15234 15235 2016-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 15236 15237 Remove unused functions. 15238 * defs.h (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): 15239 Remove. 15240 * util.c (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): 15241 Likewise. 15242 15243 v4l2.c: use print_array function. 15244 * v4l2.c (print_v4l2_ext_control, umoven_or_printaddr_ignore_syserror): 15245 New functions. 15246 (print_v4l2_ext_controls): Use them via print_array. 15247 15248 uid.c: use print_array function. 15249 * uid.c (print_gid): New function. 15250 (print_groups): Use it via print_array. 15251 15252 seccomp.c: use print_array function. 15253 * seccomp.c (decode_filter, decode_seccomp_fprog): Remove. 15254 (print_bpf_filter): New function. 15255 (print_seccomp_fprog): Use it via print_array. 15256 * tests/seccomp-filter-v.c (main): Update. 15257 15258 scsi.c: use print_array function. 15259 * scsi.c (print_uchar): New function. 15260 (print_sg_io_buffer): Use it via print_array. 15261 15262 poll.c: use print_array function. 15263 * poll.c (print_pollfd): Change for use as print_array callback. 15264 (decode_poll_entering): Use print_array. 15265 * tests/poll.c: Update. 15266 * tests/poll.test: Update. 15267 15268 numa.c: use print_array function. 15269 * numa.c (print_node): New function. 15270 (print_nodemask): Use it via print_array. 15271 (print_page_array, print_int_array): Remove. 15272 (print_addr): New function. 15273 (print_status, print_int): Change for use as print_array callback. 15274 (SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status 15275 via print_array. 15276 * tests/move_pages.c: Update. 15277 * tests/set_mempolicy.c: Likewise. 15278 * tests/set_mempolicy.test: Likewise. 15279 15280 mem.c: use print_array function. 15281 * mem.c [POWERPC] (print_protmap_entry): New function. 15282 [POWERPC] (SYS_FUNC(subpage_prot)): Use it via print_array. 15283 15284 kexec.c: use print_array function. 15285 * kexec.c (print_seg): Change for use as print_array callback. 15286 (print_kexec_segments): Use print_array. 15287 15288 ipc_sem.c: use print_array function. 15289 * ipc_sem.c (tprint_sembuf): Rename to print_sembuf, change signature 15290 for use as print_array callback. 15291 (tprint_sembuf_array): Use print_array. 15292 15293 io.c: use print_array function. 15294 * io.c (print_iovec_config): New structure. 15295 (print_iovec): New function. 15296 (tprint_iov_upto): Use print_array. 15297 * tests/preadv.c (main): Update. 15298 * tests/pwritev.c (print_iovec, main): Likewise. 15299 15300 epoll.c: use print_array function. 15301 * epoll.c (print_epoll_event): Change signature for use as print_array 15302 callback, all users updated. 15303 (print_epoll_event_array): Remove. 15304 (epoll_wait_common): Change to use print_array instead 15305 of print_epoll_event_array. 15306 15307 aio.c: use print_array function. 15308 * aio.c (print_iocbp): New function. 15309 (SYS_FUNC(io_submit)): Use it via print_array. Use widen_to_long 15310 to process long int argument. 15311 (print_io_event): Change to print struct io_event fetched elsewhere. 15312 (SYS_FUNC(io_cancel)): Update use of print_io_event. 15313 (SYS_FUNC(io_getevents)): Use print_io_event via print_array. 15314 Use widen_to_long to print long int arguments. 15315 * tests/aio.c (main): Check decoding of io_submit with negative "nr". 15316 15317 Introduce print_array function for consistent decoding of arrays. 15318 * defs.h (print_array): New prototype. 15319 * util.c (print_array): New function. 15320 15321 2016-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 15322 15323 Fix corner cases of ICMP_FILTER decoding. 15324 * net.c (print_icmp_filter): Print icmp_filter for any positive length. 15325 * tests/net-icmp_filter.c: New file. 15326 * tests/net-icmp_filter.test: New test. 15327 * tests/.gitignore: Add net-icmp_filter. 15328 * tests/Makefile.am (check_PROGRAMS): Likewise. 15329 (DECODER_TESTS): Add net-icmp_filter.test. 15330 15331 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15332 15333 xlat: do not strip "1<<" prefix from xlat strings. 15334 * xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix 15335 from xlat strings to fix incorrect output. 15336 * tests/caps.awk: Update. 15337 15338 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 15339 15340 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15341 15342 tests/xstatfsx.c: fix mips o32 support. 15343 mips o32 differs from all other 32-bit architectures by defining 15344 __kernel_fsid_t structure as an array of long ints. 15345 15346 * tests/xstatfsx.c (print_statfs): Explicitly cast elements 15347 of PRINT_F_FSID array to unsigned int. 15348 15349 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15350 15351 Mpersify VIDIOC_* ioctl parser. 15352 * v4l2.c: Mpersify arch-specific structures. 15353 (v4l2_ioctl): Mpersify. 15354 * tests/ioctl_v4l2.c: New file. 15355 * tests/ioctl_v4l2.test: New test. 15356 * tests/.gitignore: Add ioctl_v4l2. 15357 * tests/Makefile.am (check_PROGRAMS): Likewise. 15358 (DECODER_TESTS): Add ioctl_v4l2.test. 15359 15360 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15361 15362 Mpersify ioctl macros. 15363 As values of some ioctl macros differ between personalities, these 15364 personality specific ioctl macros should be properly defined for 15365 mpersified code. Implement this by redefining personality specific 15366 ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS. 15367 15368 * Makefile.am (ioctl_macros_h): New variable. 15369 (ioctl_macros%.h): New rule. 15370 (BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h). 15371 (m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS. 15372 * defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro. 15373 [HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise. 15374 15375 Acked-by: Elvira Khabirova <lineprinter0 (a] gmail.com> 15376 15377 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15378 15379 Fix decoding of VIDIOC_* ioctls. 15380 * v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls. 15381 * tests/ioctl.c (main): Update. 15382 15383 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 15384 15385 nsyscalls.test: add mips o32 support. 15386 Out-of-range syscalls looks differently on mips o32. 15387 15388 * tests/nsyscalls.c (main): Handle LINUX_MIPSO32. 15389 * tests/nsyscalls.test: Trace syscall called "syscall" on mips. 15390 15391 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15392 15393 Remove initialization of big holes in syscallent.h files. 15394 There is no need to explicitly initialize big holes after conversion 15395 of syscallent.h files to use designated initializers. For architectures 15396 that have some data at the end of syscallent.h this initialization of 15397 big holes is no-op, for others it just inflates the table unnecessarily. 15398 15399 * linux/arc/syscallent.h: Remove initialization of arch specific block 15400 at the end of table. 15401 * linux/metag/syscallent.h: Likewise. 15402 * linux/nios2/syscallent.h: Likewise. 15403 * linux/or1k/syscallent.h: Likewise. 15404 * linux/tile/syscallent.h: Likewise. 15405 * linux/tile/syscallent1.h: Likewise. 15406 * linux/arm/syscallent.h: Remove explicit initialization of a big hole 15407 before socket subcalls. 15408 * linux/i386/syscallent.h: Likewise. 15409 * linux/m68k/syscallent.h: Likewise. 15410 * linux/mips/syscallent-n32.h: Likewise. 15411 * linux/powerpc/syscallent.h: Likewise. 15412 * linux/powerpc64/syscallent.h: Likewise. 15413 * linux/s390/syscallent.h: Likewise. 15414 * linux/s390x/syscallent.h: Likewise. 15415 * linux/sh/syscallent.h: Likewise. 15416 * linux/sh64/syscallent.h: Likewise. 15417 * linux/sparc/syscallent.h: Likewise. 15418 * linux/sparc64/syscallent.h: Likewise. 15419 * linux/mips/syscallent-compat.h: Remove explicit initialization 15420 of big holes between different mips ABIs. 15421 * linux/mips/syscallent-n64.h: Remove explicit initialization 15422 of big holes before socket subcalls and between different mips ABIs. 15423 * linux/mips/syscallent-o32.h: Likewise. 15424 15425 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15426 15427 xlat: make "1<<val" syntax work with 64-bit values. 15428 * xlat/gen.sh(cond_xlat, gen_header): Generate 1UUL<<val 15429 for 1<<val syntax. 15430 15431 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 15432 15433 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15434 15435 Fix typo in XLAT_TYPE_PAIR. 15436 * xlat.h (XLAT_TYPE_PAIR): Take "type" parameter. 15437 15438 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 15439 15440 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15441 15442 Fix decoding of move_pages syscall. 15443 * numa.c (print_page_array, print_status, print_int, print_int_array): 15444 New functions. 15445 (SYS_FUNC(move_pages)): Rewrite using these functions. 15446 * tests/move_pages.c: New file. 15447 * tests/move_pages.test: New test. 15448 * tests/.gitignore: Add move_pages. 15449 * tests/Makefile.am (check_PROGRAMS): Likewise. 15450 (DECODER_TESTS): Add move_pages.test. 15451 15452 tests: check decoding of mbind syscall. 15453 * tests/mbind.c: New file. 15454 * tests/mbind.test: New test. 15455 * tests/.gitignore: Add mbind. 15456 * tests/Makefile.am (check_PROGRAMS): Likewise. 15457 (DECODER_TESTS): Add mbind.test. 15458 15459 2016-04-29 Jeff Mahoney <jeffm (a] suse.com> 15460 15461 Change type of struct xlat.val to uint64_t. 15462 Some ioctls have flags fields that are 64-bit. A 32-bit val means 15463 these flags will never be matched or printed. 15464 15465 * xlat.h: Include <stdint.h>. 15466 (struct xlat): Change type of val to uint64_t. 15467 15468 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15469 15470 xlat: extend syntax with #val_type directive. 15471 When #val_type directive is encountered, gen.sh starts using 15472 XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR, 15473 with #val_type's argument as a type. 15474 15475 For example, "#val_type uint64_t" means values of type uint64_t. 15476 15477 * xlat/gen.sh (gen_header, print_xlat, print_xlat_pair): 15478 Add val_type support. 15479 15480 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15481 15482 xlat/gen.sh: prepare for adding #val_type directive support. 15483 This is essentially a no-op change that makes the following change 15484 easier to read. 15485 15486 * xlat/gen.sh (print_xlat, print_xlat_pair): New functions. 15487 (cond_xlat, gen_header): Use them. 15488 15489 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15490 15491 Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros. 15492 * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts 15493 to the specified type instead of unsigned int. 15494 (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts 15495 to the specified type instead of unsigned int. 15496 15497 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15498 15499 xlat: generate xlat pairs using new XLAT_PAIR macro. 15500 Before this change there were two forms of xlat entries: those that use XLAT 15501 or XLAT_END macros, and others verbatim entries. This change converts 15502 the latter to use new XLAT_PAIR macro. 15503 15504 This is necessary for the upcoming change of xlat.val type. 15505 15506 * xlat.h (XLAT_PAIR): New macro. 15507 * xlat/gen.sh (cond_xlat, gen_header): Use it. 15508 15509 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15510 15511 Explicitly cast argument of XLAT macro to unsigned int. 15512 This is necessary for the upcoming change of xlat.val type. 15513 15514 * xlat.h (XLAT): Cast the argument to unsigned int. 15515 15516 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 15517 15518 Change type of {s,t}print_open_modes's argument to unsigned. 15519 As "flags" argument of sprint_open_modes and tprint_open_modes is 15520 involved only in bit operations, change its type to unsigned. 15521 15522 * defs.h.c (sprint_open_modes, tprint_open_modes): Change type 15523 to unsigned int. 15524 * open.c (sprint_open_modes, tprint_open_modes): Likewise. 15525 15526 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15527 15528 tests/remap_file_pages.c: fix for the upcoming change of xlat.val type. 15529 The "flags" argument of remap_file_page syscall has type "unsigned 15530 long", so it is not correct to load most significant bits with garbage 15531 ans assume they are going to be ignored. 15532 15533 * tests/remap_file_pages.c (main): Remove artificial garbage from flags. 15534 15535 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15536 15537 Introduce printflags64 function. 15538 This is necessary for the upcoming change of xlat.val type. 15539 15540 * defs.h (printflags): Rename to printflags64, change type of integer 15541 argument to uint64_t. 15542 (printflags): New static inline function. 15543 * util.c (printflags): Rename to printflags64, change type of integer 15544 argument to uint64_t. Print it using PRIx64 format. 15545 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 15546 15547 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15548 15549 Introduce sprintflags64 function. 15550 This is necessary for the upcoming change of xlat.val type. 15551 15552 * defs.h (sprintflags): Rename to sprintflags64, change type of integer 15553 argument to uint64_t. 15554 (sprintflags): New static inline function. 15555 * util.c (sprintflags): Rename to sprintflags64, change type of integer 15556 argument to uint64_t. Print it using PRIx64 format. 15557 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 15558 15559 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15560 15561 printxvals: change type of integer argument to uint64_t. 15562 This is necessary for the upcoming change of xlat.val type. 15563 All users of printxvals are already prepared for this change. 15564 15565 * defs.h (printxvals): Change type of integer argument to uint64_t. 15566 * util.c (printxvals): Likewise. Print it using PRIx64 format. 15567 Patch by Jeff Mahoney <jeffm (a] suse.com>. 15568 15569 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15570 15571 xlat_search: change type of integer argument to uint64_t. 15572 This is necessary for the upcoming change of xlat.val type. 15573 All users of addflags are already prepared for this change. 15574 15575 * defs.h (xlat_search): Change type of integer argument to uint64_t. 15576 * util.c (xlat_search): Likewise. Pass it by pointer. 15577 (xlat_bsearch_compare): Treat first argument as a pointer. 15578 Patch by Jeff Mahoney <jeffm (a] suse.com>. 15579 15580 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15581 15582 Introduce xlookup64 function. 15583 This is necessary for the upcoming change of xlat.val type. 15584 15585 * defs.h (xlookup): Rename to xlookup64, change type of integer argument 15586 to uint64_t. 15587 (xlookup): New static inline function. 15588 * util.c (xlookup): Rename to xlookup64, change type of integer 15589 argument to uint64_t. 15590 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 15591 15592 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15593 15594 addflags: change type of integer argument to uint64_t. 15595 This is necessary for the upcoming change of xlat.val type. 15596 All users of addflags are already prepared for this change. 15597 15598 * defs.h (addflags): Change type of integer argument to uint64_t. 15599 * util.c (addflags): Likewise. Print it using PRIx64 format. 15600 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 15601 15602 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15603 15604 Introduce printxval64 wrapper. 15605 This is necessary for the upcoming change of xlat.val type. 15606 15607 * defs.h (printxval64): New static inline function. 15608 15609 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15610 15611 Turn printxval macro into a static inline function. 15612 This is necessary for the upcoming change of xlat.val type. 15613 15614 * defs.h (printxval): Change to static inline function. 15615 15616 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 15617 15618 tests: check decoding of migrate_pages syscall. 15619 * tests/migrate_pages.c: New file. 15620 * tests/migrate_pages.test: New test. 15621 * tests/.gitignore: Add migrate_pages. 15622 * tests/Makefile.am (check_PROGRAMS): Likewise. 15623 (DECODER_TESTS): Add migrate_pages.test. 15624 15625 Fix decoding of migrate_pages syscall. 15626 * numa.c (SYS_FUNC(migrate_pages)): Print syscall arguments 15627 in the right order. 15628 15629 tests: check decoding of set_mempolicy syscall. 15630 * tests/set_mempolicy.c: New file. 15631 * tests/set_mempolicy.test: New test. 15632 * tests/.gitignore: Add set_mempolicy. 15633 * tests/Makefile.am (check_PROGRAMS): Likewise. 15634 (DECODER_TESTS): Add set_mempolicy.test. 15635 15636 tests: check decoding of get_mempolicy syscall. 15637 * tests/get_mempolicy.c: New file. 15638 * tests/get_mempolicy.test: New test. 15639 * tests/.gitignore: Add get_mempolicy. 15640 * tests/Makefile.am (check_PROGRAMS): Likewise. 15641 (DECODER_TESTS): Add get_mempolicy.test. 15642 15643 numa: fix decoding of nodemask arrays. 15644 * numa.c (get_nodes): Rewrite an rename to print_nodemask. 15645 All callers updated. 15646 (SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)): 15647 Print a delimiter before nodemask argument. 15648 15649 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 15650 15651 Fix decoding of policy argument of get_mempolicy syscall. 15652 * numa.c (SYS_FUNC(get_mempolicy)): Print policy argument in square 15653 brackets to indicate indirect access. 15654 15655 Fix decoding of pid_t argument of migrate_pages syscall. 15656 * numa.c (SYS_FUNC(migrate_pages)): Print pid_t syscall 15657 argument using %d format. 15658 15659 tests: add printxval function to libtests. 15660 * tests/tests.h (printxval): New prototype. 15661 * tests/printxval.c: New file. 15662 * tests/Makefile.am (libtests_a_SOURCES): Add it. 15663 15664 tests: check decoding of remap_file_pages syscall. 15665 * tests/remap_file_pages.c: New file. 15666 * tests/remap_file_pages.test: New test. 15667 * tests/.gitignore: Add remap_file_pages. 15668 * tests/Makefile.am (check_PROGRAMS): Likewise. 15669 (DECODER_TESTS): Add remap_file_pages.test. 15670 15671 2016-04-27 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15672 15673 tests: add pause.test. 15674 * tests/pause.c: New file. 15675 * tests/pause.test: New test. 15676 * tests/.gitignore: Add pause. 15677 * tests/Makefile.am (check_PROGRAMS): Likewise. 15678 (DECODER_TESTS): Add pause.test. 15679 15680 tests: add kill.test. 15681 * tests/kill.c: New file. 15682 * tests/kill.test: New test. 15683 * tests/.gitignore: Add kill. 15684 * tests/Makefile.am (check_PROGRAMS): Likewise. 15685 (DECODER_TESTS): Add kill.test. 15686 15687 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 15688 15689 Fix decoding of pid_t arguments of kill and tgkill syscalls. 15690 * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Print pid_t syscall 15691 arguments using %d format. 15692 15693 2016-04-27 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15694 15695 tests: add mlock.test. 15696 * tests/mlock.c: New file. 15697 * tests/mlock.test: New test. 15698 * tests/.gitignore: Add mlock. 15699 * tests/Makefile.am (check_PROGRAMS): Likewise. 15700 (DECODER_TESTS): Add mlock.test. 15701 15702 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 15703 15704 Move parsers of NUMA related syscalls to numa.c. 15705 * mem.c (get_nodes, SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), 15706 SYS_FUNC(get_mempolicy), SYS_FUNC(migrate_pages), SYS_FUNC(move_pages)): 15707 Move ... 15708 * numa.c: ... here. 15709 * Makefile.am (strace_SOURCES): Add numa.c 15710 15711 tests/umovestr3.c: robustify against os specific issues. 15712 * tests/umovestr3.c (main): Create extra gap before unreadable page. 15713 15714 tests: extend test coverage of umovestr short read condition. 15715 * tests/umovestr3.c: New file. 15716 * tests/umovestr3.test: New test. 15717 * tests/.gitignore: Add umovestr3. 15718 * tests/Makefile.am (check_PROGRAMS): Likewise. 15719 (DECODER_TESTS): Add umovestr3.test. 15720 15721 tests: check decoding of out-of-range syscalls. 15722 * tests/nsyscalls.c: New file. 15723 * tests/nsyscalls.test: New test. 15724 * tests/.gitignore: Add nsyscalls. 15725 * tests/Makefile.am (check_PROGRAMS): Likewise. 15726 (DECODER_TESTS): Add nsyscalls.test. 15727 15728 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15729 15730 Fix decoding of 3rd argument of getdents/getdents64 syscalls. 15731 * dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument 15732 as unsigned int. 15733 * dirent64.c (SYS_FUNC(getdents64)): Likewise. 15734 * tests/getdents.c (main): Check it. 15735 * tests/getdents64.c (main): Likewise. 15736 15737 Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument. 15738 * reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int. 15739 15740 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15741 15742 .travis.yml: raise sleep delay. 15743 Previous sleep delay value seems to be not enough nowadays. 15744 15745 .travis.yml (SLEEP_A_BIT): Raise sleep delay. 15746 15747 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15748 15749 Move definitions of MPOL_* constants to xlat files. 15750 * mem.c (MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND, MPOL_INTERLEAVE): 15751 Move to xlat/policies.in. 15752 (MPOL_F_NODE, MPOL_F_ADDR): Move to xlat/mempolicyflags.in. 15753 (MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL): Move 15754 to xlat/mbindflags.in. 15755 15756 tests: check decoding of renameat2 syscall. 15757 * tests/renameat2.c: New file. 15758 * tests/renameat2.test: New test. 15759 * tests/.gitignore: Add renameat2. 15760 * tests/Makefile.am (check_PROGRAMS): Likewise. 15761 (DECODER_TESTS): Add renameat2.test. 15762 15763 Add default values for RENAME_* constants. 15764 * xlat/rename_flags.in: Add default values. 15765 15766 tests: check decoding of utimes syscall. 15767 * tests/utimes.c: New file. 15768 * tests/utimes.test: New test. 15769 * tests/.gitignore: Add utimes. 15770 * tests/Makefile.am (check_PROGRAMS): Likewise. 15771 (DECODER_TESTS): Add utimes.test. 15772 15773 tests: check decoding of futimesat syscall. 15774 * tests/futimesat.c: New file. 15775 * tests/futimesat.test: New test. 15776 * tests/.gitignore: Add futimesat. 15777 * tests/Makefile.am (check_PROGRAMS): Likewise. 15778 (DECODER_TESTS): Add futimesat.test. 15779 15780 tests: extend test coverage of mknod syscall. 15781 * mknod.c (main): Check more corner cases of mode_t parser. 15782 * mknod.test: Update. 15783 15784 2016-04-26 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15785 15786 tests: add sched_yield.test. 15787 * tests/sched_yield.c: New file. 15788 * tests/sched_yield.test: New test. 15789 * tests/.gitignore: Add sched_yield. 15790 * tests/Makefile.am (check_PROGRAMS): Likewise. 15791 (DECODER_TESTS): Add sched_yield.test. 15792 15793 tests: add sync.test. 15794 * tests/sync.c: New file. 15795 * tests/sync.test: New test. 15796 * tests/.gitignore: Add sync. 15797 * tests/Makefile.am (check_PROGRAMS): Likewise. 15798 (DECODER_TESTS): Add sync.test. 15799 15800 tests: add mknodat.test. 15801 * tests/mknodat.c: New file. 15802 * tests/mknodat.test: New test. 15803 * tests/.gitignore: Add mknodat. 15804 * tests/Makefile.am (check_PROGRAMS): Likewise. 15805 (DECODER_TESTS): Add mknodat.test. 15806 15807 tests: add unlink.test. 15808 * tests/unlink.c: New file. 15809 * tests/unlink.test: New test. 15810 * tests/.gitignore: Add unlink. 15811 * tests/Makefile.am (check_PROGRAMS): Likewise. 15812 (DECODER_TESTS): Add unlink.test. 15813 15814 tests: add reboot.test. 15815 * tests/reboot.c: New file. 15816 * tests/reboot.test: New test. 15817 * tests/.gitignore: Add reboot. 15818 * tests/Makefile.am (check_PROGRAMS): Likewise. 15819 (DECODER_TESTS): Add reboot.test. 15820 15821 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15822 15823 Fix decoding of statfs family syscalls. 15824 Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls 15825 by rewriting them using mpers infrastructure. 15826 15827 * fetch_struct_statfs.c: New file. 15828 * fstatfs.c: Likewise. 15829 * fstatfs64.c: Likewise. 15830 * print_statfs.c: Likewise. 15831 * statfs.h: Likewise. 15832 * statfs64.c: Likewise. 15833 * statfs.c: Remove everything except SYS_FUNC(statfs). 15834 * configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>. 15835 Add checks for struct statfs and struct statfs64 in <asm/statfs.h>. 15836 Add checks for f_frsize and f_flags members of these structures. 15837 * defs.h (struct strace_statfs): New forward declaration. 15838 (print_struct_statfs, print_struct_statfs64): New prototypes. 15839 * Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c, 15840 statfs.c, and statfs64.c. 15841 (strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c, 15842 and statfs.h. 15843 * NEWS: Mention this fix. 15844 * tests/fstatfs.c: New file. 15845 * tests/fstatfs64.c: Likewise. 15846 * tests/statfs64.c: Likewise. 15847 * tests/xstatfs.c: Likewise. 15848 * tests/xstatfs64.c: Likewise. 15849 * tests/xstatfsx.c: Likewise. 15850 * tests/fstatfs.test: New test. 15851 * tests/fstatfs64.test: Likewise. 15852 * tests/statfs64.test: Likewise. 15853 * tests/statfs.c: Rewrite using xstatfs.c. 15854 * tests/statfs.test: Update. 15855 * tests/.gitignore: Add fstatfs, fstatfs64, and statfs64. 15856 * tests/Makefile.am (check_PROGRAMS): Likewise. 15857 (DECODER_TESTS): Add fstatfs.test, fstatfs64.test, and statfs64.test. 15858 (EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c. 15859 15860 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15861 15862 tests: add printflags function to libtests. 15863 * tests/printflags.c: New file. 15864 * tests/tests.h (printflags): New prototype. 15865 * tests/Makefile.am (libtests_a_SOURCES): Add it. 15866 15867 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 15868 15869 Move definition of struct xlat to a separate header file. 15870 Define struct xlat in a separate file so that it could be used later by 15871 tests without inclusion of defs.h header file. 15872 15873 * defs.h (struct xlat, XLAT, XLAT_END): Move ... 15874 * xlat.h: ... here. 15875 * Makefile.am (strace_SOURCES): Add xlat.h. 15876 15877 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 15878 15879 alpha: decode osf_statfs64 and osf_fstatfs64 syscalls. 15880 * linux/alpha/syscallent.h (osf_statfs64, osf_fstatfs64): Set nargs 15881 and handler. 15882 15883 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 15884 15885 alpha: fix decoding of osf_statfs and osf_fstatfs syscalls. 15886 Do not attempt to print struct osf_statfs as if it was the same as 15887 struct statfs. Since struct osf_statfs has never been decoded properly, 15888 it is probably too late to implement a decoder, so let's just print the 15889 pointer. 15890 15891 * statfs.c [ALPHA] (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Move ... 15892 * alpha.c: ... here. Replace printstatfs with printaddr. 15893 15894 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 15895 15896 statfs: print f_flags field only when ST_VALID flag is set. 15897 * statfs.c (print_statfs_flags): New function. 15898 (printstatfs, printstatfs64, printcompat_statfs64): Use it. 15899 * xlat/statfs_flags.in (ST_VALID): Move to the head of the list. 15900 * tests/statfs.expected: Update. 15901 15902 2016-04-25 Fei Jie <feij.fnst (a] cn.fujitsu.com> 15903 15904 tests: add symlink.test. 15905 * tests/symlink.c: New file. 15906 * tests/symlink.test: New test. 15907 * tests/.gitignore: Add symlink. 15908 * tests/Makefile.am (check_PROGRAMS): Likewise. 15909 (DECODER_TESTS): Add symlink.test. 15910 15911 tests: add rmdir.test. 15912 * tests/rmdir.c: New file. 15913 * tests/rmdir.test: New test. 15914 * tests/.gitignore: Add rmdir. 15915 * tests/Makefile.am (check_PROGRAMS): Likewise. 15916 (DECODER_TESTS): Add rmdir.test. 15917 15918 tests: add setdomainname.test. 15919 * tests/setdomainname.c: New file. 15920 * tests/setdomainname.test: New test. 15921 * tests/.gitignore: Add setdomainname. 15922 * tests/Makefile.am (check_PROGRAMS): Likewise. 15923 (DECODER_TESTS): Add setdomainname.test. 15924 15925 tests: add sched_rr_get_interval.test. 15926 * tests/sched_rr_get_interval.c: New file. 15927 * tests/sched_rr_get_interval.test: New test. 15928 * tests/.gitignore: Add sched_rr_get_interval. 15929 * tests/Makefile.am (check_PROGRAMS): Likewise. 15930 (DECODER_TESTS): Add sched_rr_get_interval.test. 15931 15932 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 15933 15934 statfs: decode f_flags field of struct statfs. 15935 * xlat/statfs_flags.in: New file. 15936 * statfs.c: Include "xlat/statfs_flags.h". 15937 (printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags. 15938 (printstatfs64) [_STATFS_F_FLAGS]: Likewise. 15939 (printcompat_statfs64): Likewise. 15940 * tests/statfs.expected: Update. 15941 15942 2016-04-25 Zev Weiss <zev (a] bewilderbeest.net> 15943 15944 statfs: don't quote f_type macro names. 15945 * statfs.c (sprintfstype): Don't add double-quotes to fs magic macros. 15946 * tests/statfs.expected: Remove double-quotes. 15947 15948 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 15949 15950 tests/shmxt.c: robustify against arch specific issues. 15951 Do not treat failed shmat(SHM_RND) as a test failure. 15952 This change partially reverts commit 15953 bea707377d2ee3e1950bfa43537ef928163a5fa6. 15954 15955 * tests/shmxt.c (main): Use SHM_RND in the second shmat call, 15956 do not treat its potential error as a test failure. 15957 15958 2016-04-23 Dmitry V. Levin <ldv (a] altlinux.org> 15959 15960 Rename PRI__s64 to PRI__d64. 15961 As PRI__*64 macros mirror PRI*64 macros from inttypes.h, follow the 15962 principle of least astonishment and name these macros the same way. 15963 15964 * defs.h (PRI__s64): Rename to PRI__d64. 15965 15966 2016-04-23 Dmitry V. Levin <ldv (a] altlinux.org> 15967 15968 Fix old_mmap output when mmap arguments are unfetchable. 15969 * mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven 15970 to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr 15971 fails. 15972 * tests/old_mmap.c (main): Check it. 15973 15974 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 15975 15976 aarch64: fix old_mmap output for arm personality. 15977 * mem.c (SYS_FUNC(old_mmap)) [AARCH64]: Fetch mmap arguments 15978 as 32-bit integers. 15979 15980 Define old_mmap parser only on architectures that use it. 15981 * mem.c (SYS_FUNC(old_mmap)): Define only on AARCH64, ARM, I386, X86_64, 15982 X32, M68K, S390, and S390X. 15983 15984 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 15985 15986 tests: extend test coverage of mmap syscall. 15987 Check decoding of "old mmap" edition of mmap syscall 15988 on those architectures that define it. 15989 15990 * tests/old_mmap.c: New file. 15991 * tests/old_mmap.test: New test. 15992 * tests/.gitignore: Add old_mmap. 15993 * tests/Makefile.am (check_PROGRAMS): Likewise. 15994 (DECODER_TESTS): Add old_mmap.test. 15995 15996 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 15997 15998 tests: extend test coverage of mincore syscall. 15999 * tests/mincore.c (print_mincore): New function. 16000 (test_mincore): Use it. Check mincore with invalid vec address. 16001 Check mincore with length argument not a multiple of the page size. 16002 (main): Check with DEFAULT_STRLEN pages. 16003 16004 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 16005 16006 Move parsers of sync_file_range and sync_file_range2 syscalls to libstrace 16007 For each given architecture only one of these two syscalls has a 16008 syscallent entry. When each parser is placed into a separate file, 16009 moving to libstrace ensures that only one of them that is need 16010 is linked into strace executable. 16011 16012 * sync_file_range.c (SYS_FUNC(sync_file_range2)): Move ... 16013 * sync_file_range2.c: ... here. 16014 * Makefile.am (strace_SOURCES): Move sync_file_range.c ... 16015 (libstrace_a_SOURCES): ... here. Add sync_file_range2.c. 16016 (strace_SOURCES_c): Add filtered libstrace_a_SOURCES. 16017 16018 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 16019 16020 tests: check decoding of clock_adjtime syscall. 16021 * tests/clock_adjtime.c: New file. 16022 * tests/clock_adjtime.test: New test. 16023 * tests/.gitignore: Add clock_adjtime. 16024 * tests/Makefile.am (check_PROGRAMS): Likewise. 16025 (DECODER_TESTS): Add clock_adjtime.test. 16026 16027 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16028 16029 tests: do not include <assert.h> unnecessarily. 16030 Automatically change tests/*.c files using the following script: 16031 16032 for f in tests/*.c; do 16033 grep -q '\<assert(' "$f" || 16034 sed -i '/# *include *<assert\.h>/d' "$f" 16035 done 16036 16037 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16038 16039 tests: do not include <errno.h> unnecessarily. 16040 Automatically change tests/*.c files using the following script: 16041 16042 for f in tests/*.c; do 16043 grep -Fv errno.h "$f" | 16044 grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' || 16045 sed -i '/# *include *<errno\.h>/d' "$f" 16046 done 16047 16048 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16049 16050 tests/xetpriority.c: print syscall() result using %ld format. 16051 16052 tests/xetpgid.c: print syscall() result using %ld format. 16053 16054 tests/xchownx.c: use errno2name. 16055 16056 tests/userfaultfd.c: stop using assert. 16057 16058 tests/unlinkat.c: print syscall() result using %ld format. 16059 16060 tests/umount.c: use errno2name. 16061 16062 tests/truncate64.c: cleanup. 16063 * tests/truncate64.c (main): Use errno2name, stop using assert. 16064 16065 tests/truncate.c: cleanup. 16066 * tests/truncate.c (main): Use errno2name, stop using assert. 16067 16068 tests/tee.c: stop using assert. 16069 16070 tests/syslog.c: use errno2name. 16071 16072 tests/sync_file_range2.c: stop using assert. 16073 16074 tests/sync_file_range.c: stop using assert. 16075 16076 tests/symlinkat.c: cleanup. 16077 16078 tests/swap.c: cleanup. 16079 * tests/swap.c (error_msg): Remove. 16080 (main): Use errno2name. 16081 16082 tests/splice.c: stop using assert. 16083 16084 tests/setugid.c: cleanup. 16085 16086 tests/sethostname.c: use errno2name. 16087 16088 tests/setgroups.c: use errno2name. 16089 * tests/setgroups.c (errno2str): Remove. 16090 (main): Use errno2name. 16091 16092 tests/seccomp-strict.c: cleanup. 16093 * tests/seccomp-strict.c (main): Use errno2name, stop using assert. 16094 16095 tests/seccomp-filter.c: cleanup. 16096 * tests/seccomp-filter.c (main): Use errno2name, stop using assert. 16097 16098 tests/sched_xetscheduler.c: print syscall() result using %ld format. 16099 16100 tests/sched_xetparam.c: print syscall() result using %ld format. 16101 16102 tests/renameat.c: print syscall() result using %ld format. 16103 16104 tests/rename.c: print syscall() result using %ld format. 16105 16106 tests/readv.c: cleanup. 16107 16108 tests/pwritev.c: use errno2name. 16109 16110 tests/preadv-pwritev.c: cleanup. 16111 16112 tests/prctl-seccomp-strict.c: cleanup. 16113 * tests/prctl-seccomp-strict.c (main): Use errno2name, 16114 stop using assert. 16115 16116 tests/openat.c: use errno2name. 16117 16118 tests/open.c: use errno2name. 16119 16120 tests/mlockall.c: cleanup. 16121 16122 tests/mlock2.c: stop using assert. 16123 16124 tests/mknod.c: print syscall() result using %ld format. 16125 16126 tests/mkdirat.c: print syscall() result using %ld format. 16127 16128 tests/lseek.c: cleanup. 16129 * tests/lseek.c (main): Use errno2name, stop using assert. 16130 16131 tests/llseek.c: cleanup. 16132 * tests/llseek.c (main): Use errno2name, stop using assert. 16133 16134 tests/linkat.c: print syscall() result using %ld format. 16135 16136 tests/iopl.c: use errno2name. 16137 16138 tests/ioperm.c: use errno2name. 16139 16140 tests/getgroups.c: use errno2name. 16141 * tests/getgroups.c (errno2str): Remove. 16142 (main): Use errno2name. 16143 16144 tests/ftruncate64.c: cleanup. 16145 * tests/ftruncate64.c (main): Use errno2name, stop using assert. 16146 16147 tests/ftruncate.c: cleanup. 16148 * tests/ftruncate.c (main): Use errno2name, stop using assert. 16149 16150 tests/fsync.c: print syscall() result using %ld format. 16151 16152 tests/flock.c: print syscall() result using %ld format. 16153 16154 tests/file_handle.c: use errno2name. 16155 16156 tests/fdatasync.c: print syscall() result using %ld format. 16157 16158 tests/fchownat.c: use errno2name. 16159 16160 tests/fchmodat.c: use errno2name. 16161 16162 tests/fchmod.c: use errno2name. 16163 16164 tests/faccessat.c: print syscall() result using %ld format. 16165 16166 tests/epoll_wait.c: print syscall() result using %ld format. 16167 16168 tests/epoll_ctl.c: print syscall() result using %ld format. 16169 16170 tests/epoll_create1.c: cleanup. 16171 * tests/epoll_create1.c (main): Use errno2name, stop using assert. 16172 16173 tests/epoll_create.c: print syscall() result using %ld format. 16174 16175 tests/dup3.c: print syscall() result using %ld format. 16176 16177 tests/dup2.c: print syscall() result using %ld format. 16178 16179 tests/dup.c: cleanup. 16180 16181 tests/creat.c: stop using sys/stat.h. 16182 16183 tests/copy_file_range.c: stop using assert. 16184 16185 tests/chroot.c: use errno2name. 16186 16187 tests/aio.c: use errno2name. 16188 16189 tests: cleanup acct.test. 16190 * tests/acct.c (main): Use errno2name, stop using assert, 16191 change sample file name. 16192 * tests/acct.test: Update. 16193 16194 tests: use errno2name() 16195 Automatically change tests/*.c files using the following sed regexp: 16196 sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g' 16197 16198 tests/dup.c: include "tests.h" 16199 This is going to be necessary for the following commit. 16200 16201 2016-04-21 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16202 16203 tests: add getpgrp.test. 16204 * tests/getpgrp.c: New file. 16205 * tests/getpgrp.test: New test. 16206 * tests/.gitignore: Add getpgrp. 16207 * tests/Makefile.am (check_PROGRAMS): Likewise. 16208 (DECODER_TESTS): Add getpgrp.test. 16209 16210 tests: add access.test. 16211 * tests/access.c: New file. 16212 * tests/access.test: New test. 16213 * tests/.gitignore: Add access. 16214 * tests/Makefile.am (check_PROGRAMS): Likewise. 16215 (DECODER_TESTS): Add access.test. 16216 16217 tests: add fchdir.test. 16218 * tests/fchdir.c: New file. 16219 * tests/fchdir.test: New test. 16220 * tests/.gitignore: Add fchdir. 16221 * tests/Makefile.am (check_PROGRAMS): Likewise. 16222 (DECODER_TESTS): Add fchdir.test. 16223 16224 tests: add mkdir.test. 16225 * tests/mkdir.c: New file. 16226 * tests/mkdir.test: New test. 16227 * tests/.gitignore: Add mkdir. 16228 * tests/Makefile.am (check_PROGRAMS): Likewise. 16229 (DECODER_TESTS): Add mkdir.test. 16230 16231 tests: add getsid.test. 16232 * tests/getsid.c: New file. 16233 * tests/getsid.test: New test. 16234 * tests/.gitignore: Add getsid. 16235 * tests/Makefile.am (check_PROGRAMS): Likewise. 16236 (DECODER_TESTS): Add getsid.test. 16237 16238 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16239 16240 tests: add errno2name function to libtests. 16241 Add a simple translator of errno to its name, so one could 16242 simply use errno2name() instead of complex expressions like 16243 errno == EINVAL ? "EINVAL" : "EFAULT". 16244 16245 * tests.h (errno2name): New prototype. 16246 * errno2name.c: New file. 16247 * Makefile.am (libtests_a_SOURCES): Add it. 16248 16249 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16250 16251 hppa: rename ECANCELLED to ECANCELED. 16252 hppa seems to be the only architecture that defines ECANCELLED synonym 16253 for ECANCELED constant, other architectures just define ECANCELED. 16254 Change the way how this constant is printed on hppa to be in line 16255 with other architectures. 16256 16257 * linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED. 16258 16259 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16260 16261 Remove parser of unimplemented timerfd syscall. 16262 timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1 16263 it was replaced by timerfd_* syscall family. 16264 16265 * linux/avr32/syscallent.h (timerfd): Fix nargs. 16266 * linux/dummy.h (sys_timerfd): Add stub alias. 16267 * time.c (SYS_FUNC(timerfd)): Remove. 16268 16269 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16270 16271 tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test 16272 If kernel implementation of strict seccomp mode is buggy, test programs 16273 will be killed by SIGKILL. This is a known problem at least on 16274 x32 and mips. Skip affected tests if this is the case. 16275 16276 This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b. 16277 16278 * tests/seccomp-strict.c (main): Remove workaround for x32. 16279 * tests/prctl-seccomp-strict.c: Likewise. 16280 * tests/seccomp-strict.test: Skip the test if the test program 16281 has been killed by SIGKILL. 16282 * tests/prctl-seccomp-strict.test: Likewise. 16283 16284 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16285 16286 tests/shmxt.c: do not use SHM_RND, it is unreliable. 16287 * tests/shmxt.c (main): Do not set SHM_RND flag. 16288 16289 tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long) 16290 * tests/rt_sigsuspend.c (iterate): Do not assume that size will be less 16291 than sizeof(long) on the second iteration. 16292 16293 prctl-seccomp-strict.test: robustify against unrelated prctl invocations 16294 * tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls. 16295 16296 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16297 16298 tests: adjust rt_sigpending to older kernels. 16299 With linux kernels older than v3.9-rc1, compat rt_sigpending syscall 16300 could fail with EFAULT in cases where on later kernels it succeeds. 16301 Adjust the test to handle both cases properly. 16302 16303 * tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending 16304 failed with EFAULT. 16305 16306 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16307 16308 tests: adjust readv/writev and preadv/pwritev tests to older kernels. 16309 With linux kernels older than v3.16-rc1, iovec based compat syscalls may 16310 return EINVAL in some cases where on later kernels they return EFAULT. 16311 Adjust tests to handle both cases properly. 16312 16313 * tests/preadv-pwritev.c: Include <errno.h>. 16314 (main): Print either "EINVAL" or "EFAULT" depending on errno. 16315 * tests/pwritev.c: Likewise. 16316 * tests/readv.c: Likewise. 16317 16318 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16319 16320 tests: remove obsolete non-strict uid tests. 16321 Recently added strict tests for uid/gid related syscalls 16322 made old uid tests obsolete. 16323 16324 * tests/uid.awk: Remove. 16325 * tests/uid.c: Remove. 16326 * tests/uid.test: Remove. 16327 * tests/uid16.c: Remove. 16328 * tests/uid16.test: Remove. 16329 * tests/uid32.c: Remove. 16330 * tests/uid32.test: Remove. 16331 * tests/.gitignore: Remove uid, uid16, and uid32. 16332 * tests/Makefile.am (check_PROGRAMS): Likewise. 16333 (DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test. 16334 (EXTRA_DIST): Remove uid.awk. 16335 16336 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16337 16338 tests: extend test coverage of getuid/getgid family syscalls. 16339 Add strict tests for getuid, getuid32, getgid, getgid32, geteuid, 16340 geteuid32, getegid, and getegid32 syscalls. 16341 16342 * tests/getegid.c: New file. 16343 * tests/getegid.test: New test. 16344 * tests/getegid32.c: New file. 16345 * tests/getegid32.test: New test. 16346 * tests/geteuid.c: New file. 16347 * tests/geteuid.test: New test. 16348 * tests/geteuid32.c: New file. 16349 * tests/geteuid32.test: New test. 16350 * tests/getgid.c: New file. 16351 * tests/getgid.test: New test. 16352 * tests/getgid32.c: New file. 16353 * tests/getgid32.test: New test. 16354 * tests/getuid.c: New file. 16355 * tests/getuid.test: New test. 16356 * tests/getuid32.c: New file. 16357 * tests/getuid32.test: New test. 16358 * tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid, 16359 * geteuid32, getegid, and getegid32. 16360 * tests/Makefile.am (check_PROGRAMS): Likewise. 16361 (DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test, 16362 geteuid32.test, getgid.test, getgid32.test, getuid.test, 16363 and getuid32.test. 16364 16365 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16366 16367 tests: extend test coverage of getresgid32 syscall. 16368 * tests/getresgid32.c: New file. 16369 * tests/getresgid32.test: New test. 16370 * tests/.gitignore: Add getresgid32. 16371 * tests/Makefile.am (check_PROGRAMS): Likewise. 16372 (DECODER_TESTS): Add getresgid32.test. 16373 16374 tests: extend test coverage of getresgid syscall. 16375 * tests/getresgid.c: New file. 16376 * tests/getresgid.test: New test. 16377 * tests/.gitignore: Add getresgid. 16378 * tests/Makefile.am (check_PROGRAMS): Likewise. 16379 (DECODER_TESTS): Add getresgid.test. 16380 16381 tests: extend test coverage of getresuid32 syscall. 16382 * tests/getresuid32.c: New file. 16383 * tests/getresuid32.test: New test. 16384 * tests/.gitignore: Add getresuid32. 16385 * tests/Makefile.am (check_PROGRAMS): Likewise. 16386 (DECODER_TESTS): Add getresuid32.test. 16387 16388 tests: extend test coverage of getresuid syscall. 16389 * tests/getresugid.c: New file. 16390 * tests/getresuid.c: New file. 16391 * tests/getresuid.test: New test. 16392 * tests/.gitignore: Add getresuid. 16393 * tests/Makefile.am (check_PROGRAMS): Likewise. 16394 (DECODER_TESTS): Add getresuid.test. 16395 (EXTRA_DIST): Add getresugid.c. 16396 16397 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16398 16399 tests: add symlinkat.test. 16400 * tests/symlinkat.c: New file. 16401 * tests/symlinkat.test: New test. 16402 * tests/.gitignore: Add symlinkat. 16403 * tests/Makefile.am (check_PROGRAMS): Likewise. 16404 (DECODER_TESTS): Add symlinkat.test. 16405 16406 tests: add iopl.test. 16407 * tests/iopl.c: New file. 16408 * tests/iopl.test: New test. 16409 * tests/.gitignore: Add iopl. 16410 * tests/Makefile.am (check_PROGRAMS): Likewise. 16411 (DECODER_TESTS): Add iopl.test. 16412 16413 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16414 16415 mips o32, powerpc, powerpc64: fix decoding of iopl syscall. 16416 * linux/mips/syscallent-o32.h (iopl): Fix nargs. 16417 * linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func. 16418 * linux/powerpc64/syscallent.h (iopl): Likewise. 16419 16420 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16421 16422 tests: add ioperm.test. 16423 * tests/ioperm.c: New file. 16424 * tests/ioperm.test: New test. 16425 * tests/.gitignore: Add ioperm. 16426 * tests/Makefile.am (check_PROGRAMS): Likewise. 16427 (DECODER_TESTS): Add ioperm.test. 16428 16429 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16430 16431 Fix corner cases of getgroups and setgroups syscall decoders. 16432 * uid.c (print_groups): New function. 16433 (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it. 16434 Print first syscall argument using %u format. 16435 * tests/getgroups.c: New file. 16436 * tests/getgroups.test: New test. 16437 * tests/getgroups32.c: New file. 16438 * tests/getgroups32.test: New test. 16439 * tests/setgroups.c: New file. 16440 * tests/setgroups.test: New test. 16441 * tests/setgroups32.c: New file. 16442 * tests/setgroups32.test: New test. 16443 * tests/.gitignore: Add getgroups, getgroups32, setgroups, 16444 and setgroups32. 16445 * tests/Makefile.am (check_PROGRAMS): Likewise. 16446 (DECODER_TESTS): Add getgroups.test, getgroups32.test, 16447 setgroups.test, and setgroups32.test. 16448 16449 Cleanup setfsuid syscall decoder. 16450 * uid.c (SYS_FUNC(setfsuid)): Remove redundant check. 16451 16452 tests: check decoding of setfsgid32 syscall. 16453 * tests/setfsgid32.c: New file. 16454 * tests/setfsgid32.test: New test. 16455 * tests/.gitignore: Add setfsgid32. 16456 * tests/Makefile.am (check_PROGRAMS): Likewise. 16457 (DECODER_TESTS): Add setfsgid32.test. 16458 16459 tests: check decoding of setfsgid syscall. 16460 * tests/setfsugid.c: New file. 16461 * tests/setfsgid.c: New file. 16462 * tests/setfsgid.test: New test. 16463 * tests/.gitignore: Add setfsgid. 16464 * tests/Makefile.am (check_PROGRAMS): Likewise. 16465 (DECODER_TESTS): Add setfsgid.test. 16466 (EXTRA_DIST): Add setfsugid.c. 16467 16468 tests: check decoding of setfsuid32 syscall. 16469 * tests/setfsuid32.c: New file. 16470 * tests/setfsuid32.test: New test. 16471 * tests/.gitignore: Add setfsuid32. 16472 * tests/Makefile.am (check_PROGRAMS): Likewise. 16473 (DECODER_TESTS): Add setfsuid32.test. 16474 16475 tests: check decoding of setfsuid syscall. 16476 * tests/setfsugid.c: New file. 16477 * tests/setfsuid.c: New file. 16478 * tests/setfsuid.test: New test. 16479 * tests/.gitignore: Add setfsuid. 16480 * tests/Makefile.am (check_PROGRAMS): Likewise. 16481 (DECODER_TESTS): Add setfsuid.test. 16482 (EXTRA_DIST): Add setfsugid.c. 16483 16484 tests: extend test coverage of setresgid32 syscall. 16485 * tests/setresgid32.c: New file. 16486 * tests/setresgid32.test: New test. 16487 * tests/.gitignore: Add setresgid32. 16488 * tests/Makefile.am (check_PROGRAMS): Likewise. 16489 (DECODER_TESTS): Add setresgid32.test. 16490 16491 tests: extend test coverage of setresgid syscall. 16492 * tests/setresgid.c: New file. 16493 * tests/setresgid.test: New test. 16494 * tests/.gitignore: Add setresgid. 16495 * tests/Makefile.am (check_PROGRAMS): Likewise. 16496 (DECODER_TESTS): Add setresgid.test. 16497 16498 tests: extend test coverage of setresuid32 syscall. 16499 * tests/setresuid32.c: New file. 16500 * tests/setresuid32.test: New test. 16501 * tests/.gitignore: Add setresuid32. 16502 * tests/Makefile.am (check_PROGRAMS): Likewise. 16503 (DECODER_TESTS): Add setresuid32.test. 16504 16505 tests: extend test coverage of setresuid syscall. 16506 * tests/setresugid.c: New file. 16507 * tests/setresuid.c: New file. 16508 * tests/setresuid.test: New test. 16509 * tests/.gitignore: Add setresuid. 16510 * tests/Makefile.am (check_PROGRAMS): Likewise. 16511 (DECODER_TESTS): Add setresuid.test. 16512 (EXTRA_DIST): Add setresugid.c. 16513 16514 tests: extend test coverage of setregid32 syscall. 16515 * tests/setregid32.c: New file. 16516 * tests/setregid32.test: New test. 16517 * tests/.gitignore: Add setregid32. 16518 * tests/Makefile.am (check_PROGRAMS): Likewise. 16519 (DECODER_TESTS): Add setregid32.test. 16520 16521 tests: extend test coverage of setregid syscall. 16522 * tests/setregid.c: New file. 16523 * tests/setregid.test: New test. 16524 * tests/.gitignore: Add setregid. 16525 * tests/Makefile.am (check_PROGRAMS): Likewise. 16526 (DECODER_TESTS): Add setregid.test. 16527 16528 tests: extend test coverage of setreuid32 syscall. 16529 * tests/setreuid32.c: New file. 16530 * tests/setreuid32.test: New test. 16531 * tests/.gitignore: Add setreuid32. 16532 * tests/Makefile.am (check_PROGRAMS): Likewise. 16533 (DECODER_TESTS): Add setreuid32.test. 16534 16535 tests: extend test coverage of setreuid syscall. 16536 * tests/setreugid.c: New file. 16537 * tests/setreuid.c: New file. 16538 * tests/setreuid.test: New test. 16539 * tests/.gitignore: Add setreuid. 16540 * tests/Makefile.am (check_PROGRAMS): Likewise. 16541 (DECODER_TESTS): Add setreuid.test. 16542 (EXTRA_DIST): Add setreugid.c. 16543 16544 tests: extend test coverage of setgid32 syscall. 16545 * tests/setgid32.c: New file. 16546 * tests/setgid32.test: New test. 16547 * tests/.gitignore: Add setgid32. 16548 * tests/Makefile.am (check_PROGRAMS): Likewise. 16549 (DECODER_TESTS): Add setgid32.test. 16550 16551 tests: extend test coverage of setgid syscall. 16552 * tests/setgid.c: New file. 16553 * tests/setgid.test: New test. 16554 * tests/.gitignore: Add setgid. 16555 * tests/Makefile.am (check_PROGRAMS): Likewise. 16556 (DECODER_TESTS): Add setgid.test. 16557 16558 tests: extend test coverage of setuid32 syscall. 16559 * tests/setuid32.c: New file. 16560 * tests/setuid32.test: New test. 16561 * tests/.gitignore: Add setuid32. 16562 * tests/Makefile.am (check_PROGRAMS): Likewise. 16563 (DECODER_TESTS): Add setuid32.test. 16564 16565 tests: extend test coverage of setuid syscall. 16566 * tests/setugid.c: New file. 16567 * tests/setuid.c: New file. 16568 * tests/setuid.test: New test. 16569 * tests/.gitignore: Add setuid. 16570 * tests/Makefile.am (check_PROGRAMS): Likewise. 16571 (DECODER_TESTS): Add setuid.test. 16572 (EXTRA_DIST): Add setugid.c. 16573 16574 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16575 16576 tests: add shmxt.test. 16577 * tests/shmxt.c: New file. 16578 * tests/shmxt.test: New test. 16579 * tests/.gitignore: Add shmxt. 16580 * tests/Makefile.am (check_PROGRAMS): Likewise. 16581 (DECODER_TESTS): Add shmxt.test. 16582 16583 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 16584 16585 alpha: fix decoding of shmat syscall. 16586 On alpha, shmat syscall is known as osf_shmat. 16587 16588 * linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func. 16589 16590 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16591 16592 tests: add semop.test. 16593 * tests/semop.c: New file. 16594 * tests/semop.test: New test. 16595 * tests/.gitignore: Add semop. 16596 * tests/Makefile.am (check_PROGRAMS): Likewise. 16597 (DECODER_TESTS): Add semop.test. 16598 16599 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 16600 16601 prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations 16602 * tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls. 16603 16604 Reported-by: Steve McIntyre <steve (a] einval.com> 16605 16606 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 16607 16608 tests/pselect6.c: fix potential output mismatch. 16609 * tests/pselect6.c (main): In the last case of printing pselect6 16610 syscall, print the last argument the same way as in other cases. 16611 16612 Reported-by: Steve McIntyre <steve (a] einval.com> 16613 16614 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 16615 16616 tests: check decoding of fchown32 syscall. 16617 * tests/fchown32.c: New file. 16618 * tests/fchown32.test: New test. 16619 * tests/.gitignore: Add fchown32. 16620 * tests/Makefile.am (check_PROGRAMS): Likewise. 16621 (DECODER_TESTS): Add fchown32.test. 16622 16623 tests: check decoding of fchown syscall. 16624 * tests/fchown.c: New file. 16625 * tests/fchown.test: New test. 16626 * tests/.gitignore: Add fchown. 16627 * tests/Makefile.am (check_PROGRAMS): Likewise. 16628 (DECODER_TESTS): Add fchown.test. 16629 16630 tests: check decoding of lchown32 syscall. 16631 * tests/lchown32.c: New file. 16632 * tests/lchown32.test: New test. 16633 * tests/.gitignore: Add lchown32. 16634 * tests/Makefile.am (check_PROGRAMS): Likewise. 16635 (DECODER_TESTS): Add lchown32.test. 16636 16637 tests: check decoding of lchown syscall. 16638 * tests/lchown.c: New file. 16639 * tests/lchown.test: New test. 16640 * tests/.gitignore: Add lchown. 16641 * tests/Makefile.am (check_PROGRAMS): Likewise. 16642 (DECODER_TESTS): Add lchown.test. 16643 16644 tests: check decoding of chown32 syscall. 16645 * tests/chown32.c: New file. 16646 * tests/chown32.test: New test. 16647 * tests/.gitignore: Add chown32. 16648 * tests/Makefile.am (check_PROGRAMS): Likewise. 16649 (DECODER_TESTS): Add chown32.test. 16650 16651 tests: check decoding of chown syscall. 16652 * tests/chown.c: New file. 16653 * tests/chown.test: New test. 16654 * tests/xchownx.c: New file. 16655 * tests/.gitignore: Add chown. 16656 * tests/Makefile.am (check_PROGRAMS): Likewise. 16657 (DECODER_TESTS): Add chown.test. 16658 (EXTRA_DIST): Add xchownx.c. 16659 16660 Fix decoding of 16-bit uid_t/git_t. 16661 * uid.c (printuid): Always cast value to uid_t. 16662 16663 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 16664 16665 tests: move kernel uid overflow check to libtests. 16666 This code used in two different places, so move it to the library. 16667 16668 * tests/overflowuid.c: New file. 16669 * tests/Makefile.am (libtests_a_SOURCES): Add it. 16670 * tests/tests.h (check_overflowuid, check_overflowgid): New prototypes. 16671 * tests/uid.c (main): Use check_overflowuid. 16672 * tests/uid16.c (main): Likewise. 16673 16674 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 16675 16676 tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32. 16677 As x86_64 kernel does not support x32 syscall numbers in 16678 SECCOMP_MODE_STRICT, skip affected tests on x32. 16679 16680 * tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out 16681 using error_msg_and_skip. 16682 * tests/prctl-seccomp-strict.c: Likewise. 16683 16684 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 16685 16686 tests: add seccomp-filter.test. 16687 * tests/seccomp-filter.c: New file. 16688 * tests/seccomp-filter.test: New test. 16689 * tests/.gitignore: Add seccomp-filter. 16690 * tests/Makefile.am (check_PROGRAMS): Likewise. 16691 (DECODER_TESTS): Add seccomp-filter.test. 16692 16693 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 16694 16695 seccomp: fix decoding of sock_fprog and sock_filter structures. 16696 Always print struct sock_fprog.len. 16697 Fix printing of unfetchable elements in sock_filter array. 16698 Fix printing of large sock_filter arrays. 16699 16700 * seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and 16701 print_seccomp_fprog. 16702 (print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog. 16703 * tests/prctl-seccomp-filter-v.c (main): Update. 16704 * tests/seccomp-filter-v.c: New file. 16705 * tests/seccomp-filter-v.test: New test. 16706 * tests/.gitignore: Add seccomp-filter-v. 16707 * tests/Makefile.am (check_PROGRAMS): Likewise. 16708 (DECODER_TESTS): Add seccomp-filter-v.test. 16709 16710 2016-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 16711 16712 seccomp: print SECCOMP_* and BPF_* constants in a more compact way. 16713 * seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|". 16714 * tests/prctl-seccomp-filter-v.c: Update. 16715 16716 tests: rename seccomp.test to prctl-seccomp-filter-v.test. 16717 * tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v. 16718 * tests/Makefile.am (check_PROGRAMS): Likewise. 16719 (DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test. 16720 * tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c. 16721 * tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test. 16722 16723 tests: add seccomp-strict.test. 16724 * tests/seccomp-strict.c: New file. 16725 * tests/seccomp-strict.test: New test. 16726 * tests/.gitignore: Add seccomp-strict. 16727 * tests/Makefile.am (check_PROGRAMS): Likewise. 16728 (DECODER_TESTS): Add seccomp-strict.test. 16729 16730 tests: add prctl-seccomp-strict.test. 16731 * tests/prctl-seccomp-strict.c: New file. 16732 * tests/prctl-seccomp-strict.test: New test. 16733 * tests/.gitignore: Add prctl-seccomp-strict. 16734 * tests/Makefile.am (check_PROGRAMS): Likewise. 16735 (DECODER_TESTS): Add prctl-seccomp-strict.test. 16736 16737 tests: bring lists back to the sorted order. 16738 16739 2016-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 16740 16741 tests/epoll_create1.c: extend for the case of ENOSYS. 16742 * epoll_create1.c: Make the test work in case of epoll_create1 16743 returning ENOSYS. 16744 16745 tests/epoll_ctl.c: extend epoll_ctl coverage. 16746 * tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding. Check 16747 decoding of long int descriptors and NULL struct epoll_event pointer. 16748 16749 2016-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 16750 16751 tests: add mlockall.test. 16752 * tests/mlockall.c: New file. 16753 * tests/mlockall.test: New test. 16754 * tests/.gitignore: Add mlockall. 16755 * tests/Makefile.am (check_PROGRAMS): Likewise. 16756 (DECODER_TESTS): Add mlockall.test. 16757 16758 2016-04-08 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16759 16760 tests: add epoll_wait.test. 16761 * tests/epoll_wait.c: New file. 16762 * tests/epoll_wait.test: New test. 16763 * tests/.gitignore: Add epoll_wait. 16764 * tests/Makefile.am (check_PROGRAMS): Likewise. 16765 (DECODER_TESTS): Add epoll_wait.test. 16766 16767 tests: add epoll_ctl.test. 16768 * tests/epoll_ctl.c: New file. 16769 * tests/epoll_ctl.test: New test. 16770 * tests/.gitignore: Add epoll_ctl. 16771 * tests/Makefile.am (check_PROGRAMS): Likewise. 16772 (DECODER_TESTS): Add epoll_ctl.test. 16773 16774 tests: add epoll_create.test. 16775 * tests/epoll_create.c: New file. 16776 * tests/epoll_create.test: New test. 16777 * tests/.gitignore: Add epoll_create. 16778 * tests/Makefile.am (check_PROGRAMS): Likewise. 16779 (DECODER_TESTS): Add epoll_create.test. 16780 16781 2016-04-08 Dmitry V. Levin <ldv (a] altlinux.org> 16782 16783 tests/pread64-pwrite64.c: minor cleanup. 16784 * tests/pread64-pwrite64.c: Do not include <sys/uio.h>. 16785 16786 2016-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 16787 16788 Fix decoding of swapon flags. 16789 * swapon.c (SYS_FUNC(swapon)): Print priority regardless 16790 of SWAP_FLAG_PREFER flag being set. 16791 * tests/swap.c (error_msg): Handle EINVAL. 16792 (main): Check decoding of swapon flags. 16793 16794 tests/unlinkat.c: check AT_* decoding. 16795 * tests/unlinkat.c (main): Check decoding of AT_* constants. 16796 16797 tests/linkat.c: check AT_* decoding. 16798 * tests/linkat.c (main): Check decoding of AT_* constants. 16799 16800 2016-04-06 Elliott Hughes <enh (a] google.com> 16801 16802 Improve decoding of Android's PR_SET_VMA prctl. 16803 Before: 16804 16805 prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096, 16806 "atexit handlers") = 0 16807 16808 After: 16809 16810 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096, 16811 "atexit handlers") = 0 16812 16813 * prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA. 16814 * Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option. 16815 * xlat/prctl_options.in: Add PR_SET_VMA. 16816 16817 2016-04-06 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16818 16819 tests: add mkdirat.test. 16820 * tests/mkdirat.c: New file. 16821 * tests/mkdirat.test: New test. 16822 * tests/.gitignore: Add mkdirat. 16823 * tests/Makefile.am (check_PROGRAMS): Likewise. 16824 (DECODER_TESTS): Add mkdirat.test. 16825 16826 tests: add swap.test. 16827 * tests/swap.c: New file. 16828 * tests/swap.test: New test. 16829 * tests/.gitignore: Add swap. 16830 * tests/Makefile.am (check_PROGRAMS): Likewise. 16831 (DECODER_TESTS): Add swap.test. 16832 16833 tests: add unlinkat.test. 16834 * tests/unlinkat.c: New file. 16835 * tests/unlinkat.test: New test. 16836 * tests/.gitignore: Add unlinkat. 16837 * tests/Makefile.am (check_PROGRAMS): Likewise. 16838 (DECODER_TESTS): Add unlinkat.test. 16839 16840 tests: add linkat.test. 16841 * tests/linkat.c: New file. 16842 * tests/linkat.test: New test. 16843 * tests/.gitignore: Add linkat. 16844 * tests/Makefile.am (check_PROGRAMS): Likewise. 16845 (DECODER_TESTS): Add linkat.test. 16846 16847 2016-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 16848 16849 tests: add sync_file_range.test and sync_file_range2.test. 16850 * configure.ac (AC_CHECK_FUNCS): Add sync_file_range. 16851 * tests/sync_file_range.c: New file. 16852 * tests/sync_file_range2.c: Likewise. 16853 * tests/sync_file_range.test: New test. 16854 * tests/sync_file_range2.test: Likewise. 16855 * tests/.gitignore: Add sync_file_range and sync_file_range2. 16856 * tests/Makefile.am (check_PROGRAMS): Likewise. 16857 (DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test. 16858 16859 2016-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 16860 16861 Add default values for SYNC_FILE_RANGE_* constants. 16862 * xlat/sync_file_range_flags.in: Add default values. 16863 16864 2016-04-05 Elliott Hughes <enh (a] google.com> 16865 16866 Fix sync_file_range2 output. 16867 Before: 16868 16869 sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| 16870 SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, ) 16871 16872 After: 16873 16874 sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| 16875 SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0) 16876 16877 * sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", " 16878 in the right place. 16879 16880 2016-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 16881 16882 Replace PF_* constants with AF_* 16883 AF_* constants appear to be more standardized, and in practice there's 16884 always a one to one relationship between AF_* and PF_*, so let's 16885 use AF_* instead of PF_*. 16886 16887 * xlat/domains.in: Remove. 16888 * net.c: Do not define PF_UNSPEC. Stop including "xlat/domains.h". 16889 Replace PF_* with AF_*. Replace domains with addrfams. 16890 * tests/inet-cmsg.c: Replace PF_INET with AF_INET. 16891 * tests/net-yy-inet.c: Likewise. 16892 * tests/netlink_inet_diag.c: Likewise. 16893 * tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL. 16894 * tests/net-y-unix.c: Likewise. 16895 * tests/net-yy-unix.c: Likewise. 16896 * tests/netlink_unix_diag.c: Likewise. 16897 * tests/net.expected: Replace PF_ with AF_. 16898 16899 2016-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 16900 16901 tests: add read-write.test. 16902 * tests/read-write.c: New file. 16903 * tests/read-write.test: New test. 16904 * tests/.gitignore: Add read-write. 16905 * tests/Makefile.am (check_PROGRAMS): Likewise. 16906 (DECODER_TESTS): Add read-write.test. 16907 16908 2016-04-02 Dmitry V. Levin <ldv (a] altlinux.org> 16909 16910 tests/pread64-pwrite64.test: extend dumpio coverage. 16911 * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump): 16912 New functions. 16913 (main): Use them to test dumping of various data. 16914 * tests/pread64-pwrite64.test: Update. 16915 16916 tests: add hexdump_memdup function to libtests. 16917 * tests/hexdump_strdup.c (hexdump_memdup): New function. 16918 (hexdump_strdup): Use it. 16919 * tests/tests.h (hexdump_memdup): New prototype. 16920 16921 tests: add fchownat.test. 16922 * tests/fchownat.c: New file. 16923 * tests/fchownat.test: New test. 16924 * tests/.gitignore: Add fchownat. 16925 * tests/Makefile.am (check_PROGRAMS): Likewise. 16926 (DECODER_TESTS): Add fchownat.test. 16927 16928 tests: add fchmodat.test. 16929 * tests/fchmodat.c: New file. 16930 * tests/fchmodat.test: New test. 16931 * tests/.gitignore: Add fchmodat. 16932 * tests/Makefile.am (check_PROGRAMS): Likewise. 16933 (DECODER_TESTS): Add fchmodat.test. 16934 16935 Fix printing of negative offsets in pread64 and pwrite64 syscalls. 16936 * io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset 16937 using %lld format string. 16938 * tests/pread64-pwrite64.c: New file. 16939 * tests/pread64-pwrite64.test: New test. 16940 * tests/.gitignore: Add pread64-pwrite64. 16941 * tests/Makefile.am (check_PROGRAMS): Likewise. 16942 (pread64_pwrite64_CPPFLAGS): New variable. 16943 (DECODER_TESTS): Add pread64-pwrite64. 16944 16945 tests/hexdump_strdup.c: add support for longer strings. 16946 * tests/hexdump_strdup.c (hexdump_strdup): Output extra space character 16947 before hexdumping of the 9th symbol. 16948 16949 tests/preadv-pwritev.c: fix typo in error diagnostics. 16950 * tests/preadv-pwritev.c (main): Fix typo in error message. 16951 16952 2016-04-01 Fei Jie <feij.fnst (a] cn.fujitsu.com> 16953 16954 tests: add chroot.test. 16955 * tests/chroot.c: New file. 16956 * tests/chroot.test: New test. 16957 * tests/.gitignore: Add chroot. 16958 * tests/Makefile.am (check_PROGRAMS): Likewise. 16959 (DECODER_TESTS): Add chroot.test. 16960 16961 tests: add fdatasync.test. 16962 * tests/fdatasync.c: New file. 16963 * tests/fdatasync.test: New test. 16964 * tests/.gitignore: Add fdatasync. 16965 * tests/Makefile.am (check_PROGRAMS): Likewise. 16966 (DECODER_TESTS): Add fdatasync.test. 16967 16968 tests: add fsync.test. 16969 * tests/fsync.c: New file. 16970 * tests/fsync.test: New test. 16971 * tests/.gitignore: Add fsync. 16972 * tests/Makefile.am (check_PROGRAMS): Likewise. 16973 (DECODER_TESTS): Add fsync.test. 16974 16975 tests: add sethostname.test. 16976 * tests/sethostname.c: New file. 16977 * tests/sethostname.test: New test. 16978 * tests/.gitignore: Add sethostname. 16979 * tests/Makefile.am (check_PROGRAMS): Likewise. 16980 (DECODER_TESTS): Add sethostname.test. 16981 16982 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 16983 16984 Consistently handle unsigned arguments of mmap* and remap_file_pages. 16985 Explicitly declare first 4 arguments of mmap* and all remap_file_pages 16986 arguments as unsigned to avoid potential sign extension issues. 16987 16988 * mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall 16989 arguments to local variables of appropriate types. 16990 16991 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 16992 16993 Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned. 16994 The second (level) and third (optname) arguments of getsockopt and 16995 setsockopt syscalls are enums, so treat them consistently as enums: 16996 use "unsigned int" type to avoid potential sign extension issues. 16997 16998 * net.c (print_sockopt_fd_level_name, print_getsockopt, 16999 print_setsockopt): Change type of "level" and "name" arguments 17000 from "int" to "unsigned int". 17001 17002 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 17003 17004 Add sentinel attribute to printxvals. 17005 * gcc_compat.h (ATTRIBUTE_SENTINEL): New macro. 17006 * defs.h (printxvals): Add ATTRIBUTE_SENTINEL. 17007 17008 Cleanup parser of ptrace syscall. 17009 * process.c (print_user_offset_addr): New function for printing offset 17010 address in the tracee's USER area. 17011 (SYS_FUNC(ptrace)): Assign syscall arguments to local variables with 17012 appropriate types. Print pid argument as int. Use switch statement 17013 in the code that handles address argument. Use print_user_offset_addr 17014 to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests. 17015 17016 2016-03-31 Jeff Mahoney <jeffm (a] suse.com> 17017 17018 Define PRI__[uxs]64 macros to print __s64 and __u64 values. 17019 Rather than cast every __u64 or __s64 before printing, 17020 define printing helpers for those types directly. 17021 17022 * defs.h (PRI__s64, PRI__u64, PRI__x64): New macros. 17023 17024 2016-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 17025 17026 Implement dumping of preadv and pwritev syscalls. 17027 * syscall.c (dumpio): Add SEN_preadv and SEN_pwritev. 17028 * NEWS: Mention this. 17029 * tests/preadv-pwritev.c: New file. 17030 * tests/preadv-pwritev.test: New test. 17031 * tests/.gitignore: Add preadv-pwritev. 17032 * tests/Makefile.am (check_PROGRAMS): Likewise. 17033 (preadv_pwritev_CPPFLAGS): New variable. 17034 (DECODER_TESTS): Add preadv-pwritev. 17035 17036 2016-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 17037 17038 Fix decoding of preadv syscall in case of short read. 17039 * io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead 17040 of tprint_iov and specify syscall return value as a data size limit. 17041 * NEWS: Mention it. 17042 * tests/preadv.c (main): Add a test case for preadv short read. 17043 17044 Fix printing of negative offsets in preadv and pwritev syscalls. 17045 * io.c (print_llu_from_low_high_val): Rename to 17046 print_lld_from_low_high_val, all callers changed. 17047 Print value as a signed integer. 17048 * tests/preadv.c: New file. 17049 * tests/preadv.test: New test. 17050 * tests/pwritev.c: New file. 17051 * tests/pwritev.test: New test. 17052 * tests/.gitignore: Add preadv and pwritev. 17053 * tests/Makefile.am (check_PROGRAMS): Likewise. 17054 (preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables. 17055 (DECODER_TESTS): Add preadv.test and pwritev.test. 17056 17057 Fix printing of unreadable struct iovec. 17058 * io.c (tprint_iov_upto): If the first element of iovec array is 17059 unreadable, print its address without array markup. 17060 * tests/readv.c (main): Check it. 17061 17062 tests: factor out a part common to many simply organized test scripts. 17063 * tests/init.sh (run_strace_match_diff): New function. 17064 * tests/acct.test: Rewrite using run_strace_match_diff. 17065 * tests/aio.test: Likewise. 17066 * tests/alarm.test: Likewise. 17067 * tests/chmod.test: Likewise. 17068 * tests/clock_nanosleep.test: Likewise. 17069 * tests/clock_xettime.test: Likewise. 17070 * tests/copy_file_range.test: Likewise. 17071 * tests/creat.test: Likewise. 17072 * tests/dup.test: Likewise. 17073 * tests/dup2.test: Likewise. 17074 * tests/dup3.test: Likewise. 17075 * tests/epoll_create1.test: Likewise. 17076 * tests/execveat-v.test: Likewise. 17077 * tests/execveat.test: Likewise. 17078 * tests/fchmod.test: Likewise. 17079 * tests/fcntl.test: Likewise. 17080 * tests/file_handle.test: Likewise. 17081 * tests/flock.test: Likewise. 17082 * tests/fork-f.test: Likewise. 17083 * tests/ftruncate.test: Likewise. 17084 * tests/ftruncate64.test: Likewise. 17085 * tests/getcwd.test: Likewise. 17086 * tests/getdents.test: Likewise. 17087 * tests/getdents64.test: Likewise. 17088 * tests/getrandom.test: Likewise. 17089 * tests/getrusage.test: Likewise. 17090 * tests/getxxid.test: Likewise. 17091 * tests/inet-cmsg.test: Likewise. 17092 * tests/init.sh: Likewise. 17093 * tests/membarrier.test: Likewise. 17094 * tests/mincore.test: Likewise. 17095 * tests/mknod.test: Likewise. 17096 * tests/mlock2.test: Likewise. 17097 * tests/mmsg.test: Likewise. 17098 * tests/nanosleep.test: Likewise. 17099 * tests/open.test: Likewise. 17100 * tests/openat.test: Likewise. 17101 * tests/pselect6.test: Likewise. 17102 * tests/readdir.test: Likewise. 17103 * tests/readlink.test: Likewise. 17104 * tests/readv.test: Likewise. 17105 * tests/recvmsg.test: Likewise. 17106 * tests/rename.test: Likewise. 17107 * tests/renameat.test: Likewise. 17108 * tests/rt_sigpending.test: Likewise. 17109 * tests/rt_sigprocmask.test: Likewise. 17110 * tests/rt_sigqueueinfo.test: Likewise. 17111 * tests/rt_sigsuspend.test: Likewise. 17112 * tests/rt_sigtimedwait.test: Likewise. 17113 * tests/rt_tgsigqueueinfo.test: Likewise. 17114 * tests/sched_get_priority_mxx.test: Likewise. 17115 * tests/sched_xetaffinity.test: Likewise. 17116 * tests/sched_xetparam.test: Likewise. 17117 * tests/sched_xetscheduler.test: Likewise. 17118 * tests/seccomp.test: Likewise. 17119 * tests/select.test: Likewise. 17120 * tests/sendfile.test: Likewise. 17121 * tests/sendfile64.test: Likewise. 17122 * tests/splice.test: Likewise. 17123 * tests/statx.sh: Likewise. 17124 * tests/sysinfo.test: Likewise. 17125 * tests/syslog.test: Likewise. 17126 * tests/tee.test: Likewise. 17127 * tests/time.test: Likewise. 17128 * tests/timer_create.test: Likewise. 17129 * tests/timer_xettime.test: Likewise. 17130 * tests/timerfd_xettime.test: Likewise. 17131 * tests/times-fail.test: Likewise. 17132 * tests/times.test: Likewise. 17133 * tests/truncate.test: Likewise. 17134 * tests/truncate64.test: Likewise. 17135 * tests/umask.test: Likewise. 17136 * tests/umount.test: Likewise. 17137 * tests/umount2.test: Likewise. 17138 * tests/userfaultfd.test: Likewise. 17139 * tests/vmsplice.test: Likewise. 17140 * tests/xet_robust_list.test: Likewise. 17141 * tests/xetitimer.test: Likewise. 17142 * tests/xetpgid.test: Likewise. 17143 * tests/xetpriority.test: Likewise. 17144 * tests/xettimeofday.test: Likewise. 17145 17146 tests: introduce $NAME. 17147 * tests/init.sh (NAME): New variable, defined to ${ME_%.test}. 17148 (run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test} 17149 with $NAME. 17150 * tests/fcntl.test: Likewise. 17151 * tests/fstat.test: Likewise. 17152 * tests/mmap.test: Likewise. 17153 * tests/net-y-unix.test: Likewise. 17154 * tests/net-yy-inet.test: Likewise. 17155 * tests/net-yy-unix.test: Likewise. 17156 * tests/open.test: Likewise. 17157 * tests/openat.test: Likewise. 17158 * tests/poll.test: Likewise. 17159 * tests/ppoll.test: Likewise. 17160 * tests/readlink.test: Likewise. 17161 * tests/select.test: Likewise. 17162 * tests/statx.sh: Likewise. 17163 * tests/uname.test: Likewise. 17164 17165 2016-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 17166 17167 tests: move definitions of $OUT and $ERR to init.sh. 17168 As virtually every test defines either one or both of OUT and ERR 17169 variables and these definitions are exactly the same, move definitions 17170 of these variables from individual tests to init.sh. 17171 17172 * tests/init.sh (OUT, ERR): New variables. 17173 * tests/ipc.sh: Remove initialization of OUT variable. 17174 * tests/statx.sh: Likewise. 17175 * tests/*.test: Remove initialization of OUT and ERR variables. 17176 17177 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 17178 17179 tests: simplify sendfile.test and sendfile64.test. 17180 Use the executable itself for input by default. 17181 17182 * tests/sendfile.c (main): Use av[0] instead of av[1] for input. 17183 * tests/sendfile64.c (main): Likewise. 17184 * tests/sendfile.test: Invoke run_prog without arguments. 17185 * tests/sendfile64.test: Likewise. 17186 17187 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 17188 17189 open.test, openat.test: lift /proc requirement. 17190 While -P option needs /proc to match descriptors, it does not use 17191 /proc to match pathnames. As these tests do not need descriptor 17192 match, the /proc requirement can be safely lifted. 17193 17194 * tests/open.test: Lift /proc/self/fd/ requirement. 17195 * tests/openat.test: Likewise. 17196 17197 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 17198 17199 quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. 17200 * quota.c (if_nextdqblk): New structure. 17201 (decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. 17202 17203 Update Q_* constants. 17204 * xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced 17205 by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6. 17206 17207 Update CLONE_* constants. 17208 * xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP. 17209 The former was removed by linux kernel commit v2.6.38-rc1~217. 17210 The latter was introduced by linux kernel commit v4.6-rc1~67^2~8. 17211 17212 Update BPF_MAP_TYPE_* constants. 17213 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH, 17214 BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by 17215 linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and 17216 v4.6-rc1~91^2~212^2~1, respectively. 17217 17218 Update SO_* constants. 17219 * xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel 17220 commit v4.6-rc1~91^2~176. 17221 17222 Update SEGV_* constants. 17223 * xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel 17224 commit v4.6-rc1~68^2~23. 17225 17226 avr32: wire up copy_file_range syscall. 17227 * linux/avr32/syscallent.h [325]: Add copy_file_range entry. 17228 17229 2016-03-28 JayRJoshi <jay.r.joshi100 (a] gmail.com> 17230 17231 tests/uname.test: check abbreviated output, use print_quoted_string. 17232 * tests/uname.c (main): Use print_quoted_string to print 17233 utsname members. Add abbrev check. 17234 * tests/uname.test: Add abbrev check. 17235 17236 2016-03-28 Dmitry V. Levin <ldv (a] altlinux.org> 17237 17238 faccessat.test: robustify against libcs invoking faccessat syscall on their own 17239 * tests/faccessat.c (TMP_FILE): Rename to sample, change its value 17240 to "faccessat.sample". 17241 * tests/faccessat.test: Rewrite using openat.test. 17242 17243 openat.test: robustify against libcs invoking openat syscall on their own 17244 * tests/openat.c (main): Rename fname to sample, change its value 17245 to "openat.sample". 17246 * tests/openat.test: Use -P option to filter out openat syscalls 17247 made by libc and dynamic linker. 17248 17249 tests: add open.test. 17250 * tests/open.c: New file. 17251 * tests/open.test: New test. 17252 * tests/.gitignore: Add open. 17253 * tests/Makefile.am (check_PROGRAMS): Likewise. 17254 (DECODER_TESTS): Add open.test. 17255 17256 2016-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 17257 17258 Update generic ioctl entries from linux 4.5. 17259 * linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh. 17260 * linux/32/ioctls_inc_align32.h: Likewise. 17261 * linux/32/ioctls_inc_align64.h: Likewise. 17262 * NEWS: Mention this. 17263 17264 2016-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 17265 17266 maint: update for linux 4.5. 17267 * maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files. 17268 Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files. 17269 Update path of saa6588.h and exynos-fimc.h files. 17270 17271 2016-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 17272 17273 Fix decoding of device numbers in mknod and mknodat syscalls. 17274 * mknod.c (decode_mknod): Treat device number argument as unsigned int. 17275 * tests/mknod.c: Include <sys/sysmacros.h> or <sys/mkdev.h> 17276 for definition of makedev macro. 17277 (main): Add a check for a character special file. 17278 17279 2016-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 17280 17281 sparc64: fix decoding of mknod and mknodat syscalls for sparc personality 17282 Remove remnants of solaris personality support in mknod parser 17283 that resulted to sparc personality being decoded as old solaris 17284 personality. This complements commit v4.10-45-gdf4dd8b and fixes 17285 commit v4.10-46-g588a90f. 17286 17287 * mknod.c (decode_mknod) [SPARC || SPARC64]: Remove. 17288 17289 2016-03-25 Katerina Koukiou <k.koukiou (a] googlemail.com> 17290 17291 tests: add openat.test. 17292 * tests/openat.c: New file. 17293 * tests/openat.test: New test. 17294 * tests/.gitignore: Add openat. 17295 * tests/Makefile.am (check_PROGRAMS): Likewise. 17296 (DECODER_TESTS): Add openat.test. 17297 17298 2016-03-25 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17299 17300 tests: add renameat.test. 17301 * tests/renameat.c: New file. 17302 * tests/renameat.test: New test. 17303 * tests/.gitignore: Add renameat. 17304 * tests/Makefile.am (check_PROGRAMS): Likewise. 17305 (DECODER_TESTS): Add renameat.test. 17306 17307 tests: add faccessat.test. 17308 * tests/faccessat.c: New file. 17309 * tests/faccessat.test: New test. 17310 * tests/.gitignore: Add faccessat. 17311 * tests/Makefile.am (check_PROGRAMS): Likewise. 17312 (DECODER_TESTS): Add faccessat.test. 17313 17314 tests: add creat.test. 17315 * tests/creat.c: New file. 17316 * tests/creat.test: New test. 17317 * tests/.gitignore: Add creat. 17318 * tests/Makefile.am (check_PROGRAMS): Likewise. 17319 (DECODER_TESTS): Add creat.test. 17320 17321 tests: add mknod.test. 17322 * tests/mknod.c: New file. 17323 * tests/mknod.test: New test. 17324 * tests/.gitignore: Add mknod. 17325 * tests/Makefile.am (check_PROGRAMS): Likewise. 17326 (DECODER_TESTS): Add mknod.test. 17327 17328 tests: add syslog.test. 17329 * tests/syslog.c: New file. 17330 * tests/syslog.test: New test. 17331 * tests/.gitignore: Add syslog. 17332 * tests/Makefile.am (check_PROGRAMS): Likewise. 17333 (DECODER_TESTS): Add syslog.test. 17334 17335 2016-03-23 JayRJoshi <jay.r.joshi100 (a] gmail.com> 17336 17337 tests/scm_rights-fd.test: fix pathname regex. 17338 Pathname containing >, }, or non-printable characters was resulting 17339 in failing of the test. 17340 17341 * tests/scm_rights-fd.test: Fix pathname regex and simplify things. 17342 17343 2016-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 17344 17345 tests: add strace-r.test. 17346 * tests/strace-r.expected: New file. 17347 * tests/strace-r.test: New test. 17348 * tests/Makefile.am (MISC_TESTS): Add it. 17349 (EXTRA_DIST): Add strace-r.expected. 17350 17351 tests: add strace-ttt.test. 17352 * tests/strace-ttt.test: New test. 17353 * tests/Makefile.am (MISC_TESTS): Add it. 17354 17355 tests: add strace-tt.test. 17356 * tests/strace-tt.test: New test. 17357 * tests/Makefile.am (MISC_TESTS): Add it. 17358 17359 tests: add strace-t.test. 17360 * tests/strace-t.test: New test. 17361 * tests/Makefile.am (MISC_TESTS): Add it. 17362 17363 tests: add strace-T.test. 17364 * tests/strace-T.expected: New file. 17365 * tests/strace-T.test: New test. 17366 * tests/Makefile.am (MISC_TESTS): Add it. 17367 (EXTRA_DIST): Add strace-T.expected. 17368 17369 2016-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 17370 17371 tests: split out tests of specific decoders. 17372 Split TESTS into three groups: tests of specific decoders, libunwind 17373 tests, and all other tests. 17374 17375 * tests/Makefile.am (TESTS): Move attach-f-p.test, attach-p-cmd.test, 17376 bexecve.test, count-f.test, count.test, detach-running.test, 17377 detach-sleeping.test, detach-stopped.test, dumpio.test, 17378 filter-unavailable.test, fork-f.test, ksysent.test, opipe.test, 17379 pc.test, qual_syscall.test, redirect.test, restart_syscall.test, 17380 strace-f.test, and vfork-f.test to MISC_TESTS. 17381 Move remaining tests except $(LIBUNWIND_TESTS) to DECODER_TESTS. 17382 Add $(DECODER_TESTS) and $(MISC_TESTS). 17383 17384 2016-03-23 JayRJoshi <jay.r.joshi100 (a] gmail.com> 17385 17386 tests: add getcwd.test. 17387 * tests/getcwd.c: New file. 17388 * tests/getcwd.test: New test. 17389 * tests/.gitignore: Add getcwd. 17390 * tests/Makefile.am (check_PROGRAMS): Likewise. 17391 (TESTS): Add getcwd.test. 17392 17393 tests: add print_quoted_string function to libtests. 17394 * tests/tests.h (print_quoted_string): New prototype. 17395 * tests/print_quoted_string.c: New file. 17396 * tests/Makefile.am (libtests_a_SOURCES): Add it. 17397 17398 2016-03-17 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17399 17400 tests: add xetpriority.test. 17401 * resource.c (SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Print 17402 the second syscall argument using %d format. 17403 * tests/xetpriority.c: New file. 17404 * tests/xetpriority.test: New test. 17405 * tests/.gitignore: Add xetpriority. 17406 * tests/Makefile.am (check_PROGRAMS): Likewise. 17407 (TESTS): Add xetpriority.test. 17408 17409 2016-03-15 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17410 17411 tests: add flock.test. 17412 * tests/flock.c: New file. 17413 * tests/flock.test: New test. 17414 * tests/.gitignore: Add flock. 17415 * tests/Makefile.am (check_PROGRAMS): Likewise. 17416 (TESTS): Add flock.test. 17417 17418 tests: add sched_xetscheduler.test. 17419 * tests/sched_xetscheduler.c: New file. 17420 * tests/sched_xetscheduler.test: New test. 17421 * tests/.gitignore: Add sched_xetscheduler. 17422 * tests/Makefile.am (check_PROGRAMS): Likewise. 17423 (TESTS): Add sched_xetscheduler.test. 17424 17425 2016-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 17426 17427 alpha: fix SOCK_DIAG_BY_FAMILY tests. 17428 This complements commit v4.9-368-g301c65c. 17429 17430 * tests/netlink_inet_diag.c (check_responses): Align "buf" 17431 on sizeof(long) boundary. 17432 * tests/netlink_unix_diag.c (check_responses): Likewise. 17433 17434 2016-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 17435 17436 Update EPOLL* constants. 17437 * xlat/epollevents.in: Add EPOLLWAKEUP and EPOLLEXCLUSIVE. 17438 17439 2016-03-12 Dmitry V. Levin <ldv (a] altlinux.org> 17440 17441 tests: add count-f.test. 17442 * tests/count-f.c: New file. 17443 * tests/count-f.expected: Likewise. 17444 * tests/count-f.test: New test. 17445 * tests/.gitignore: Add count-f. 17446 * tests/Makefile.am (check_PROGRAMS): Likewise. 17447 (count_f_LDADD): New variable. 17448 (EXTRA_DIST): Add count-f.expected. 17449 (TESTS): Add count-f.test. 17450 17451 2016-02-21 Dmitry V. Levin <ldv (a] altlinux.org> 17452 17453 hppa: wire up copy_file_range syscall. 17454 * linux/hppa/syscallent.h [346]: Add copy_file_range entry. 17455 17456 2016-03-11 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17457 17458 tests: filter strace output in uname test. 17459 * tests/uname.test: Use uniq to filter strace output. 17460 17461 2016-03-10 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17462 17463 tests: add sched_xetparam.test. 17464 * tests/sched_xetparam.c: New file. 17465 * tests/sched_xetparam.test: New test. 17466 * tests/.gitignore: Add sched_xetparam. 17467 * tests/Makefile.am (check_PROGRAMS): Likewise. 17468 (TESTS): Add sched_xetparam.test. 17469 17470 tests: add sched_get_priority_mxx.test. 17471 * tests/sched_get_priority_mxx.c: New file. 17472 * tests/sched_get_priority_mxx.test: New test. 17473 * tests/.gitignore: Add sched_get_priority_mxx. 17474 * tests/Makefile.am (check_PROGRAMS): Likewise. 17475 (TESTS): Add sched_get_priority_mxx.test. 17476 17477 tests: add dup.test, dup2.test, and dup3.test. 17478 * tests/dup.c: New file. 17479 * tests/dup.test: New test. 17480 * tests/dup2.c: New file. 17481 * tests/dup2.test: New test. 17482 * tests/dup3.c: New file. 17483 * tests/dup3.test: New test. 17484 * tests/.gitignore: Add dup, dup2, and dup3. 17485 * tests/Makefile.am (check_PROGRAMS): Likewise. 17486 (TESTS): Add dup.test, dup2.test, and dup3.test. 17487 17488 2016-03-10 Fabien Siron <fabien.siron (a] epita.fr> 17489 17490 tests: add fchmod.test. 17491 * tests/fchmod.c: New file. 17492 * tests/fchmod.test: New test. 17493 * tests/.gitignore: Add fchmod. 17494 * tests/Makefile.am (check_PROGRAMS): Likewise. 17495 (TESTS): Add fchmod.test. 17496 17497 2016-03-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17498 17499 tests: add acct.test. 17500 * tests/acct.c: New file. 17501 * tests/acct.test: New test. 17502 * tests/.gitignore: Add acct. 17503 * tests/Makefile.am (check_PROGRAMS): Likewise. 17504 (TESTS): Add acct.test. 17505 17506 2016-03-07 Anchit Jain <anchitjain1234 (a] gmail.com> 17507 17508 tests: add chmod.test. 17509 * tests/chmod.c: New file. 17510 * tests/chmod.test: New test. 17511 * tests/.gitignore: Add chmod. 17512 * tests/Makefile.am (check_PROGRAMS): Likewise. 17513 (TESTS): Add chmod.test. 17514 17515 2016-03-05 Nahim El Atmani <naam (a] lse.epita.fr> 17516 17517 Reduce memory usage while managing tcbs allocation. 17518 * strace.c (init): Remove initial memory allocation for tcbtab. 17519 (expand_tcbtab): Do initial memory allocation when tcbtabsize == 0. 17520 17521 Reviewed-By: Gabriel Laskar <gabriel (a] lse.epita.fr> 17522 Reported-by: haris iqbal <haris.phnx (a] gmail.com> 17523 17524 2016-03-01 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17525 17526 tests: add umask.test. 17527 * tests/umask.c: New file. 17528 * tests/umask.test: New test. 17529 * tests/.gitignore: Add umask. 17530 * tests/Makefile.am (check_PROGRAMS): Likewise. 17531 (TESTS): Add umask.test. 17532 17533 tests: add rename.test. 17534 * tests/rename.c: New file. 17535 * tests/rename.test: New test. 17536 * tests/.gitignore: Add rename. 17537 * tests/Makefile.am (check_PROGRAMS): Likewise. 17538 (TESTS): Add rename.test. 17539 17540 tests: add uname.test. 17541 * tests/uname.c: New file. 17542 * tests/uname.test: New test. 17543 * tests/.gitignore: Add uname. 17544 * tests/Makefile.am (check_PROGRAMS): Likewise. 17545 (TESTS): Add uname.test. 17546 17547 2016-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 17548 17549 mips: wire up copy_file_range syscall. 17550 * linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry. 17551 * linux/mips/syscallent-n64.h [5320]: Likewise. 17552 * linux/mips/syscallent-o32.h [4360]: Likewise. 17553 17554 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 17555 17556 tests: add rt_sigsuspend.test. 17557 * tests/rt_sigsuspend.c: New file. 17558 * tests/rt_sigsuspend.test: New test. 17559 * tests/.gitignore: Add rt_sigsuspend. 17560 * tests/Makefile.am (check_PROGRAMS): Likewise. 17561 (TESTS): Add rt_sigsuspend.test. 17562 17563 Print pid_t arguments of rt_sigqueueinfo and rt_tgsigqueueinfo as int. 17564 * signal.c (SYS_FUNC(rt_sigqueueinfo)): Print first syscall argument 17565 using %d format. 17566 (SYS_FUNC(rt_tgsigqueueinfo)): Print first and second syscall arguments 17567 using %d format. 17568 * tests/rt_tgsigqueueinfo.c: New file. 17569 * tests/rt_tgsigqueueinfo.test: New test. 17570 * tests/.gitignore: Add rt_tgsigqueueinfo. 17571 * tests/Makefile.am (check_PROGRAMS): Likewise. 17572 (TESTS): Add rt_tgsigqueueinfo.test. 17573 17574 getrusage.test: fix build on x32. 17575 * tests/getrusage.c: Include <stdint.h> 17576 (main): Print members of struct timeval using %ju format. 17577 17578 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 17579 17580 getrusage.test: check that getrusage parser does not access extra memory 17581 Place struct rusage at the end of an allocated memory page followed by 17582 an inaccessible page. 17583 17584 * tests/getrusage.c (main): Use tail_alloc. 17585 17586 2016-02-19 Fei Jie <feij.fnst (a] cn.fujitsu.com> 17587 17588 tests: add getrusage.test. 17589 * tests/getrusage.c: New file. 17590 * tests/getrusage.test: New test. 17591 * tests/.gitignore: Add getrusage. 17592 * tests/Makefile.am (check_PROGRAMS): Likewise. 17593 (TESTS): Add getrusage.test. 17594 17595 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 17596 17597 Print rt_sigtimedwait return value as a signal name. 17598 * signal.c (SYS_FUNC(rt_sigtimedwait)): Decode return value. 17599 * tests/rt_sigtimedwait.c: New file. 17600 * tests/rt_sigtimedwait.test: New test. 17601 * tests/.gitignore: Add rt_sigtimedwait. 17602 * tests/Makefile.am (check_PROGRAMS): Likewise. 17603 (TESTS): Add rt_sigtimedwait.test. 17604 17605 tests: add rt_sigprocmask.test. 17606 * tests/rt_sigprocmask.c: New file. 17607 * tests/rt_sigprocmask.test: New test. 17608 * tests/.gitignore: Add rt_sigprocmask. 17609 * tests/Makefile.am (check_PROGRAMS): Likewise. 17610 (TESTS): Add rt_sigprocmask.test. 17611 17612 Fix corner cases of rt_sigpending syscall decoder. 17613 * signal (print_sigset_addr_len_limit): New function, cloned from 17614 print_sigset_addr_len with added minimal length argument. 17615 Treat length less than minimal length or greater than NSIG/8 as invalid. 17616 Do not align length to 4-byte boundary. Align destination buffer 17617 to 4-byte boundary and initialize it with zeroes so that subsequent 17618 call to sprintsigmask_n will not access uninitialized data. 17619 (print_sigset_addr_len): Turn into a wrapper around 17620 print_sigset_addr_len_limit with current_wordsize 17621 as a minimal length argument. 17622 (SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit 17623 instead of print_sigset_addr_len with 1 as a minimal length argument. 17624 * tests/rt_sigpending.c: New file. 17625 * tests/rt_sigpending.test: New test. 17626 * tests/.gitignore: Add rt_sigpending. 17627 * tests/Makefile.am (check_PROGRAMS): Likewise. 17628 (TESTS): Add rt_sigpending.test. 17629 17630 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 17631 17632 Change unix_diag requests back to use full dump instead of exact match. 17633 Unfortunately, 64-bit linux kernel has a bug in matching inode numbers 17634 greater than INT_MAX, so unix_diag exact match is not reliable. 17635 17636 This partially reverts commit 69bfc89770152033d4aa0bc5673fc46e65d89838. 17637 17638 * socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags, 17639 remove initialization of udiag_cookie. 17640 * tests/netlink_unix_diag.c (send_query): Remove "inode" argument, 17641 add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino 17642 and udiag_cookie. 17643 (check_responses): Remove "inode" argument and its use. 17644 (main): Remove invocation of inode_of_sockfd and passing of listening 17645 socket inode to send_query and check_responses. 17646 17647 2016-02-19 Michael Shigorin <mike (a] altlinux.org> 17648 17649 tests: avoid using cpp -dD. 17650 -dD is less portable across some peculiar preprocessors. 17651 17652 tests/Makefile.am (ksysent.h): Use cpp -dM instead of cpp -dD. 17653 17654 2016-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 17655 17656 tests: add poll.test. 17657 * tests/poll.c: New file. 17658 * tests/poll.test: New test. 17659 * tests/.gitignore: Add poll. 17660 * tests/Makefile.am (check_PROGRAMS): Likewise. 17661 (TESTS): Add poll.test. 17662 17663 Fix abbreviated output of poll and ppoll decoders. 17664 * poll.c (decode_poll_entering, decode_poll_exiting): Fix corner cases 17665 of abbreviated output. 17666 * tests/ppoll-v.expected: Update. 17667 * tests/ppoll.expected: Update. 17668 * tests/ppoll.test: Update. 17669 17670 Print unfetchable address in poll and ppoll decoders. 17671 * poll.c (decode_poll_entering): Replace umove call with 17672 umove_or_printaddr. 17673 (decode_poll_exiting): Print unfetchable address when umove call fails. 17674 17675 Print offsets in lseek and _llseek syscalls as signed integers. 17676 * lseek.c (SYS_FUNC(lseek)): Print offset using %lld format. 17677 (SYS_FUNC(llseek)): Likewise. Treat high and low components of offset 17678 as unsigned long integers. 17679 * tests/llseek.c (main): Check that negative offset is printed properly. 17680 * tests/lseek.c (main): Likewise. 17681 17682 2016-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 17683 17684 tests: add xetpgid.test. 17685 * tests/xetpgid.c: New file. 17686 * tests/xetpgid.test: New test. 17687 * tests/.gitignore: Add xetpgid. 17688 * tests/Makefile.am (check_PROGRAMS): Likewise. 17689 (TESTS): Add xetpgid.test. 17690 17691 tests: add alarm.test. 17692 * tests/alarm.c: New file. 17693 * tests/alarm.test: New test. 17694 * tests/.gitignore: Add alarm. 17695 * tests/Makefile.am (check_PROGRAMS): Likewise. 17696 (TESTS): Add alarm.test. 17697 17698 Replace printargs_lu and printargs_ld with printargs_u and printargs_d. 17699 * defs.h (printargs_lu): Rename to printargs_u. 17700 (printargs_ld): Rename to printargs_d. 17701 * syscall.c (printargs_lu): Rename to printargs_u. Replace %lu with %u. 17702 (printargs_ld): Rename to printargs_d. Replace %ld with %d. 17703 * linux/dummy.h (sys_getpgrp): Change to printargs. 17704 (sys_alarm): Change to printargs_u. 17705 (sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp, 17706 sys_timer_delete, sys_timer_getoverrun): Change to printargs_d. 17707 17708 Change printargs_lu and printargs_ld to return RVAL_DECODED. 17709 * syscall.c (printargs_lu, printargs_ld): Return RVAL_DECODED. 17710 17711 redirect.test: fix the way how strace output is discarded. 17712 * tests/redirect.test: Disable tracing of syscalls, signals, 17713 and exit status instead of redirecting strace output to /dev/null. 17714 17715 tests: extend coverage of struct iovec arrays. 17716 * tests/readv.c (main): Check decoding of empty, inaccessible, 17717 and partially inaccessible iovec arrays. 17718 * tests/readv.test: Update. 17719 17720 Implement dumping of vmsplice syscall. 17721 * syscall.c (dumpio): Add SEN_vmsplice. 17722 * NEWS: Mention this. 17723 * tests/vmsplice.c: New file. 17724 * tests/vmsplice.test: New test. 17725 * tests/.gitignore: Add vmsplice. 17726 * tests/Makefile.am (check_PROGRAMS): Likewise. 17727 (TESTS): Add vmsplice.test. 17728 17729 tests: add tee.test. 17730 * tests/tee.c: New file. 17731 * tests/tee.test: New test. 17732 * tests/.gitignore: Add tee. 17733 * tests/Makefile.am (check_PROGRAMS): Likewise. 17734 (TESTS): Add tee.test. 17735 17736 Fix printing of negative offsets in splice syscall. 17737 * io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing 17738 offsets. 17739 * tests/splice.c: New file. 17740 * tests/splice.test: New test. 17741 * tests/.gitignore: Add splice. 17742 * tests/Makefile.am (check_PROGRAMS): Likewise. 17743 (TESTS): Add splice.test. 17744 17745 Implement copy_file_range syscall decoding. 17746 * copy_file_range.c: New file. 17747 * Makefile.am (strace_SOURCES): Add it. 17748 * linux/32/syscallent.h (copy_file_range): New entry. 17749 * linux/64/syscallent.h: Likewise. 17750 * linux/arm/syscallent.h: Likewise. 17751 * linux/i386/syscallent.h: Likewise. 17752 * linux/ia64/syscallent.h: Likewise. 17753 * linux/m68k/syscallent.h: Likewise. 17754 * linux/powerpc/syscallent.h: Likewise. 17755 * linux/powerpc64/syscallent.h: Likewise. 17756 * linux/s390/syscallent.h: Likewise. 17757 * linux/s390x/syscallent.h: Likewise. 17758 * linux/sparc/syscallent.h: Likewise. 17759 * linux/sparc64/syscallent.h: Likewise. 17760 * linux/x32/syscallent.h: Likewise. 17761 * linux/x86_64/syscallent.h: Likewise. 17762 * pathtrace.c (pathtrace_match): Add SEN_copy_file_range. 17763 * NEWS: Mention new syscall parser. 17764 * tests/copy_file_range.c: New file. 17765 * tests/copy_file_range.test: New test. 17766 * tests/.gitignore: Add copy_file_range. 17767 * tests/Makefile.am (check_PROGRAMS): Likewise. 17768 (TESTS): Add copy_file_range.test. 17769 17770 Update fs *_MAGIC constants. 17771 * xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC. 17772 17773 Update IPV6_* constants. 17774 * xlat/sockipv6options.in: Add IPV6_HDRINCL. 17775 17776 Update SO_* constants. 17777 * xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF 17778 and SO_ATTACH_REUSEPORT_EBPF. 17779 17780 Update MADV_* constants. 17781 * xlat/madvise_cmds.in: Add MAD_FREE. 17782 17783 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 17784 17785 tests: robustify execve and execveat tests. 17786 * tests/execve.c (main): Use one page gap between two mapped regions 17787 for an address that is more likely to be not yet mapped. 17788 * tests/execveat.c (main): Likewise. 17789 17790 tests: simplify execve test. 17791 * tests/execve.c (main): Simplify the test assuming that execve syscall 17792 never returns ENOSYS. 17793 17794 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 17795 17796 Fix numbers of syscall arguments in syscall tables. 17797 This semi-automatic change brings syscall tables in sync with kernel's 17798 include/linux/syscalls.h file. 17799 17800 * linux/aarch64/syscallent.h (recv): Fix nargs. 17801 * linux/alpha/syscallent.h (sigaltstack, init_module, 17802 sched_getscheduler, settimeofday): Likewise. 17803 * linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl, 17804 shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy, 17805 timerfd_create): Likewise. 17806 * linux/bfin/syscallent.h (signal, delete_module): Likewise. 17807 * linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler, 17808 io_cancel, set_tid_address, listxattr, llistxattr, flistxattr, 17809 removexattr, lremovexattr, fremovexattr): Likewise. 17810 * linux/i386/syscallent.h (signal, mmap): Likewise. 17811 * linux/ia64/syscallent.h (init_module, readv, writev, 17812 sched_getscheduler): Likewise. 17813 * linux/m68k/syscallent.h (signal, request_key): Likewise. 17814 * linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice): 17815 Likewise. 17816 * linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module, 17817 delete_module): Likewise. 17818 * linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module, 17819 delete_module): Likewise. 17820 * linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm, 17821 fstatfs64): Likewise. 17822 * linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise. 17823 * linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead, 17824 fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2, 17825 fallocate, preadv, pwritev, fanotify_mark): Likewise. 17826 * linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise. 17827 * linux/s390x/syscallent.h (signal, ipc): Likewise. 17828 * linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice): 17829 Likewise. 17830 * linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt, 17831 shmctl, fstatfs64, vmsplice): Likewise. 17832 * linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise. 17833 * linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64, 17834 readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc, 17835 sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise. 17836 * linux/x32/syscallent.h (64:recvmsg): Likewise. 17837 * linux/xtensa/syscallent.h (mremap, futex, reboot, init_module, 17838 delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat, 17839 futimesat, fchmodat, faccessat): Likewise. 17840 * NEWS: Mention this fix. 17841 17842 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 17843 17844 s390: decode fadvise64 and fadvise64_64. 17845 * linux/s390/syscallent.h (fadvise64): Set sys_func. 17846 (fadvise64_64): Set nargs and sys_func. 17847 17848 mips n64: use the most optimal parser for fadvise64 syscall. 17849 * linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64) 17850 with SEN(fadvise64). 17851 17852 ia64: decode fstatfs64 and statfs64. 17853 * linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func. 17854 17855 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 17856 17857 alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments. 17858 On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures 17859 pipe syscall does not take arguments. 17860 17861 * linux/alpha/syscallent.h (pipe): Change nargs to 0. 17862 * linux/ia64/syscallent.h (pipe): Likewise. 17863 * linux/mips/syscallent-n32.h (pipe): Likewise. 17864 * linux/mips/syscallent-n64.h (pipe): Likewise. 17865 * linux/mips/syscallent-o32.h (pipe): Likewise. 17866 * linux/sh/syscallent.h (pipe): Likewise. 17867 * linux/sh64/syscallent.h (pipe): Likewise. 17868 17869 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 17870 17871 alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall. 17872 * net.c (do_pipe) [HAVE_GETRVAL2]: Remove. 17873 Always call decode_pair_fd on exiting. 17874 (SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe. 17875 17876 Fix pathtrace match for pipe2 syscall. 17877 * pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors 17878 or paths to test, move SEN_pipe2 to the appropriate category. 17879 17880 avr32: wire up missing syscalls. 17881 * linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier, 17882 and mlock2 entries. 17883 17884 2016-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 17885 17886 tests: check decoding of madvise, mlockall, mremap, and msync syscalls. 17887 * tests/mmap.c (main): Change output format from regexp to verbatim. 17888 Add tests for madvise, mlockall, mremap, and msync syscalls. 17889 * tests/mmap.test: Convert from match_grep to match_diff. 17890 Add madvise, mlockall, mremap, and msync syscalls to syscall filter. 17891 17892 2016-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 17893 17894 Simplify decoding of waitpid and wait4 syscalls. 17895 * wait.c (printwaitn): Replace "n" and "bitness" integer arguments 17896 with a single print_rusage function pointer. All callers updated. 17897 17898 waitid: print pid argument as int. 17899 * wait.c (SYS_FUNC(waitid)): As the type of second syscall argument 17900 in the kernel is pid_t, print it as int. 17901 17902 waitid: always print 5th argument. 17903 * wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs 17904 as waitid syscall has 5 arguments. 17905 17906 socketutils: add const qualifier to variables. 17907 * socketutils.c (cache_and_print_inode_details): Make "details" 17908 parameter const. 17909 (print_sockaddr_by_inode_cached): Make "e" variable const. 17910 (inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2 17911 members const. Make "msg" variable const. 17912 (inet_parse_response): Make "data" parameter and diag_msg variable const. 17913 (receive_responses): Make "h" and "rc" variables const. 17914 (unix_send_query): Make struct nlmsghdr and struct unix_diag_req 17915 members const. Make "msg" variable const. 17916 (unix_print): Make all parameters const. 17917 (print_sockaddr_by_inode): Make proto_name parameter const. 17918 17919 print_sockaddr_by_inode: cleanup protocol lookup. 17920 * socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print, 17921 udp_v6_print): New functions. 17922 (print_sockaddr_by_inode): Make "protocols" array static, replace 17923 "family" and "protocol" members with "print" in its underlying 17924 structure. Iterate through protocols array when the protocol name 17925 is specified. 17926 17927 2016-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 17928 17929 tests: check that -f -p attaches to threads properly. 17930 Check that -f -p attaches and follows all threads of the given pid. 17931 17932 * tests/attach-f-p.c: New file. 17933 * tests/attach-f-p.test: New test. 17934 * tests/.gitignore: Add attach-f-p. 17935 * tests/Makefile.am (check_PROGRAMS): Likewise. 17936 (attach_f_p_LDADD): New variable. 17937 (TESTS): Add attach-f-p.test. 17938 17939 2016-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 17940 17941 Introduce libstrace.a for potentially conditional compilation units. 17942 Some files are used conditionally depending on architecture and 17943 configuration. Create a library for the purpose of keeping such 17944 compilation units. 17945 17946 * Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a. 17947 (libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS). 17948 (libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS). 17949 (libstrace_a_SOURCES): New variable, set to upeek.c. 17950 * util.c (upeek): Move ... 17951 * upeek.c: ... here. 17952 17953 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 17954 17955 travis-ci: pass more gcov arguments to codecov. 17956 17957 tests: extend coverage of struct itimerspec. 17958 * tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec 17959 pointer. 17960 17961 tests: extend coverage of utimensat syscall. 17962 * tests/utimensat.c (main): Check decoding of NULL struct timespec 17963 pointer. 17964 17965 tests: extend coverage of time syscall. 17966 * tests/time.c (main): Check decoding of NULL time_t pointer. 17967 17968 tests: extend coverage of struct sigevent. 17969 * tests/timer_create.c (main): Check decoding of NULL struct sigevent 17970 pointer. Check decoding of invalid sigev_notify value. 17971 17972 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 17973 17974 tests: extend coverage of execve and execveat syscalls. 17975 Check decoding of inaccessible or partially inaccessible arrays. 17976 17977 * tests/execve-v.c: New file. 17978 * tests/execveat-v.c: Likewise. 17979 * tests/execve-v.test: New test. 17980 * tests/execveat-v.test: Likewise. 17981 * tests/execve.c: Rewrite. 17982 * tests/execveat.c: Likewise. 17983 * tests/execve.test: Likewise. 17984 * tests/execveat.test: Likewise. 17985 * tests/execve.expected: Remove. 17986 * tests/execve-v.expected: Likewise. 17987 * tests/execveat.expected: Likewise. 17988 * tests/execveat-v.expected: Likewise. 17989 * tests/.gitignore: Add execve-v and execveat-v. 17990 * tests/Makefile.am (check_PROGRAMS): Likewise. 17991 (TESTS): Add execve-v.test and execveat-v.test. 17992 (EXTRA_DIST): Remove execve.expected, execve-v.expected, 17993 execveat.expected, and execveat-v.expected. 17994 17995 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 17996 17997 Fix decoding of execve and execveat syscalls with invalid input. 17998 * execve.c (printargv): Fix decoding of inaccessible or partially 17999 inaccessible array. 18000 (printargc): Diagnose inaccessible or partially inaccessible array. 18001 (decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers. 18002 18003 tests: extend coverage of capget syscall. 18004 * tests/caps.c (main): Check decoding of inaccessible cap_user_header_t 18005 and/or cap_user_data_t. 18006 * tests/caps.awk: Update match patterns. 18007 * tests/caps.test: Update. 18008 18009 tests: extend coverage of sched_getaffinity syscall. 18010 * tests/sched_xetaffinity.c (main): Check decoding of pointer 18011 to inaccessible cpu_set_t. 18012 18013 tests: extend coverage of utime syscall. 18014 * tests/utime.c (main): Check decoding of NULL struct utimbuf pointer. 18015 Check decoding of struct utimbuf located at the end of page boundary. 18016 * tests/utime.test: Update. 18017 18018 tests: extend coverage of sysinfo syscall. 18019 * tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer. 18020 Check decoding of struct sysinfo located at the end of page boundary. 18021 * tests/sysinfo.test: Update. 18022 18023 tests: extend coverage of adjtimex syscall. 18024 * tests/adjtimex.c (main): Check decoding of NULL struct timex pointer. 18025 Check decoding of struct timex located at the end of page boundary. 18026 * tests/adjtimex.test: Update. 18027 18028 tests: check that strace does not retain stdin and stdout descriptors. 18029 * tests/redirect.test: New test. 18030 * tests/Makefile.am (TESTS): Add it. 18031 18032 Create a dummy pipe descriptor instead of opening /dev/null. 18033 * strace.c (open_dev_null): Rename to open_dummy_desc. All callers 18034 changed. Create a pipe and return its first descriptor instead of 18035 opening /dev/null. 18036 18037 2016-02-08 Denys Vlasenko <dvlasenk (a] redhat.com> 18038 18039 If stdin/stdout aren't open on startup, open them to /dev/null. 18040 Otherwise, -oLOGFILE may end up using one of them. This conflicts 18041 with the previous change, which closes stdin/out in strace. 18042 18043 * strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout, 18044 sanitize them: open /dev/null and dup it until fds 0,1,2 18045 are all used up. 18046 18047 2016-02-08 Denys Vlasenko <dvlasenk (a] redhat.com> 18048 18049 Close stdin/out after child is forked. 18050 Testcase: 18051 18052 { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9' 18053 18054 The writer (head) will be able to perform writes to write end of the pipe. 18055 With strace call removed, head will immediately get SIGPIPE. 18056 18057 This change fixes this: now writer immediately gets SIGPIPE with strace too. 18058 18059 * strace.c (startup_child): Close stdin/out and reopen them to /dev/null. 18060 18061 2016-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 18062 18063 tests: add opipe.test. 18064 Check that -o |pipe_command works. In particular, check that 18065 strace waits for completion of piped command. 18066 18067 * tests/opipe.test: New test. 18068 * tests/Makefile.am (TESTS): Add it. 18069 18070 2016-02-05 Keith Owens <kaos.ocs (a] gmail.com> 18071 18072 strace-graph: print the pid in the graph. 18073 * strace-graph: Prefix each command with its pid. 18074 18075 strace-graph: cope with clone immediately followed by exit. 18076 * strace-graph: A clone() followed by exit() with no intervening fork 18077 or execve resulted in the new pid having no seq key. That breaks when 18078 trying to use seq as an array reference. Ensure that clone populates 18079 the new pid with an empty seq entry. 18080 18081 strace-graph: handle recent strace output. 18082 * strace-graph: Fix regex for --SIG. Ignore '+++ exited with <n> +++' 18083 lines. Handle exit_group syscall as well as _exit. 18084 18085 strace-graph: handle strace -T. 18086 * strace-graph: Ignore extra ' <time.spent>' field added by strace -T. 18087 18088 strace-graph: use "strict" and "warnings" pragmas. 18089 * strace-graph: Set "use strict" and "use warnings" options. Fix errors 18090 detected by strict/warnings. $result is really a string, it can be "-1" 18091 followed by an error text. 18092 18093 2016-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 18094 18095 Add README.md file with links to build status and test coverage. 18096 18097 travis-ci: prepare and submit test coverage report. 18098 18099 tests: extend readlink and readlinkat coverage. 18100 * tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros. 18101 (main): Allocate memory for string and buffer passed to the syscall 18102 being tested using tail_alloc mechanism. Create and cleanup test 18103 symlink. Test syscall error path output. Print hexquoted strings 18104 using hexquote_strndup. 18105 * tests/readlinkat.c: Likewise. 18106 * tests/readlink.test: Remove creation and cleanup of test symlinks. 18107 18108 tests: add hexquote_strndup function to libtests. 18109 * tests/tests.h (hexquote_strndup): New prototype. 18110 * tests/hexquote_strndup.c: New file. 18111 * tests/Makefile.am (libtests_a_SOURCES): Add it. 18112 18113 readlinkat.test: use readlink.test. 18114 * tests/readlink.test (syscall): Initialize from $0. 18115 * tests/readlinkat.test: Source readlink.test. 18116 18117 2016-02-04 Gabriel Laskar <gabriel (a] lse.epita.fr> 18118 18119 Add configure --enable-code-coverage option. 18120 * m4/ax_code_coverage.m4: New file. 18121 * configure.ac: Use AX_CODE_COVERAGE. 18122 * Makefile.am: Add @CODE_COVERAGE_RULES@. 18123 (CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS, 18124 CODE_COVERAGE_IGNORE_PATTERN): New variables. 18125 (strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS). 18126 (strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS). 18127 (strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS). 18128 * .gitignore: Add *.gcda and *.gcno. 18129 18130 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18131 18132 Makefile.am: introduce strace_CFLAGS and derivatives. 18133 * Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS). 18134 (libmpers_CFLAGS): New variable, set to $(strace_CFLAGS). 18135 (libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables, 18136 set to $(libmpers_CFLAGS). 18137 18138 Makefile.am: use strace_CPPFLAGS consistently. 18139 * Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS) 18140 with $(strace_CPPFLAGS). 18141 18142 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18143 18144 tests: replace net-fd.test with net-y-unix.test. 18145 Unlike the former test that was based on match_grep, 18146 the new one uses match_diff and does more rigorous testing. 18147 18148 * tests/net-y-unix.c: New file. 18149 * tests/net-y-unix.test: New test. 18150 * tests/net-fd.test: Remove. 18151 * tests/net-fd.expected: Remove. 18152 * tests/.gitignore: Add net-y-unix. 18153 * tests/Makefile.am (check_PROGRAMS): Likewise. 18154 (TESTS): Replace net-fd.test with net-y-unix.test. 18155 (net-fd.log): Remove. 18156 (EXTRA_DIST): Remove net-fd.expected. 18157 18158 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18159 18160 Implement caching of print_sockaddr_by_inode. 18161 As -yy parser, compared to -y, needs to do at least 5 extra syscalls 18162 (getxattr, socket, sendmsg, recvmsg, close) to print socket details, 18163 caching results of netlink conversations between strace and kernel 18164 noticeably reduces amount of system time spent by strace. 18165 18166 The caching is safe since sockets do not change their addresses after 18167 successful bind or connect syscall. 18168 18169 * defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes. 18170 * socketutils.c (cache_entry): New type. 18171 (CACHE_SIZE, CACHE_MASK): New macros. 18172 (cache): New static array. 18173 (cache_and_print_inode_details): New static function. 18174 (print_sockaddr_by_inode_cached): New function. 18175 (inet_parse_response, unix_parse_response): Use 18176 cache_and_print_inode_details. 18177 * util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached. 18178 (string_quote): Remove static qualifier. 18179 * NEWS: Mention this improvement. 18180 * tests/unix-yy.c (main): Update. 18181 18182 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18183 18184 Change unix_diag requests to use exact match instead of full dump. 18185 * socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags, 18186 initialize udiag_cookie. 18187 * tests/netlink_unix_diag.c (send_query): Remove "family" and "proto" 18188 arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags, 18189 initialize udiag_ino and udiag_cookie. 18190 (check_responses): Add "inode" argument, check inode match. 18191 (main): Pass listening socket inode to send_query and check_responses. 18192 18193 Robustify netlink response parsers. 18194 * socketutils.c (inet_parse_response, unix_parse_response): Change 18195 return type from bool to int, return -1 on all parse errors except 18196 inode mismatch. 18197 (receive_responses): Stop on the first nlmsg_type that is not 18198 SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1. 18199 * tests/netlink_inet_diag.c (check_responses): Stop on short messages, 18200 on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose 18201 diagnostics for NLMSG_ERROR. 18202 * tests/netlink_unix_diag.c (check_responses): Likewise. 18203 18204 inet_parse_response: add a safety check. 18205 * socketutils.c (inet_parse_response): Check that netlink message 18206 is large enough to contain a inet_diag_msg structure. 18207 18208 receive_responses: avoid potential hangup. 18209 * socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after 18210 the first recvmsg call to avoid potential hangup. 18211 18212 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18213 18214 tests: replace net-yy.test with net-yy-inet.test. 18215 Unlike the former test that was based on match_awk, 18216 the new one uses match_diff and does more rigorous testing. 18217 18218 * tests/net-yy-inet.c: New file. 18219 * tests/net-yy-inet.test: New test. 18220 * tests/net-yy.test: Remove. 18221 * tests/net-yy-accept.awk: Remove. 18222 * tests/net-yy-connect.awk: Remove. 18223 * tests/inet-accept-connect-send-recv.c: Remove. 18224 * tests/.gitignore: Replace inet-accept-connect-send-recv 18225 with net-yy-inet. 18226 * tests/Makefile.am (check_PROGRAMS): Likewise. 18227 (TESTS): Replace net-yy.test with net-yy-inet.test. 18228 (EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk. 18229 18230 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 18231 18232 tests: replace unix-yy.test with net-yy-unix.test. 18233 Unlike the former test that was based on match_awk, 18234 the new one uses match_diff and does more rigorous testing. 18235 18236 * tests/net-yy-unix.c: New file. 18237 * tests/net-yy-unix.test: New test. 18238 * tests/unix-yy.test: Remove. 18239 * tests/unix-yy-accept.awk: Remove. 18240 * tests/unix-yy-connect.awk: Remove. 18241 * tests/.gitignore: Add net-yy-unix. 18242 * tests/Makefile.am (check_PROGRAMS): Likewise. 18243 (TESTS): Replace unix-yy.test with net-yy-unix.test. 18244 (EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk. 18245 18246 2016-02-02 Dmitry V. Levin <ldv (a] altlinux.org> 18247 18248 tests: add inode_of_sockfd function to libtests. 18249 * tests/tests.h (inode_of_sockfd): New prototype. 18250 * tests/inode_of_sockfd.c: New file. 18251 * tests/Makefile.am (libtests_a_SOURCES): Add it. 18252 18253 unix_parse_response: add a safety check. 18254 * socketutils.c (unix_parse_response): Check that netlink message 18255 is large enough to contain a unix_diag_msg structure. 18256 18257 2016-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 18258 18259 Fixed decoding of mincore syscall's last argument. 18260 * mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector 18261 that were written by the kernel. 18262 * NEWS: Mention this fix. 18263 * tests/mincore.c: New file. 18264 * tests/mincore.test: New test. 18265 * tests/Makefile.am (check_PROGRAMS): Add mincore. 18266 (TESTS): Add mincore.test. 18267 * tests/.gitignore: Add mincore. 18268 18269 2016-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 18270 18271 Move fallback -yy socket print from printfd to print_sockaddr_by_inode. 18272 * util.c (printfd): In -yy mode, move fallback print of proto:[inode] ... 18273 * socketutils.c (to print_sockaddr_by_inode): ... here. 18274 18275 2016-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 18276 18277 Implement simultaneous use of -p option and tracing of a command. 18278 * strace.c (init): Allow -p option along with a command. 18279 (startup_child): In -D mode, record the parent of the tracer process 18280 as strace_child. 18281 (startup_attach): Save trace_tracer_pid before -D mode fork. 18282 When tracing a command in -f mode, do not check for the command's 18283 threads as it has no threads at this moment. 18284 Never attach to the tracer process. 18285 In -D mode, never attach to the parent of the tracer process, 18286 terminate that process only once at the end of startup_attach, 18287 and reset strace_child. 18288 * strace.1: Document that -p option can be used along with tracing 18289 of a command. 18290 * NEWS: Mention it. 18291 * tests/attach-p-cmd-cmd.c: New file. 18292 * tests/attach-p-cmd-p.c: Likewise. 18293 * tests/attach-p-cmd.test: New test. 18294 * tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p. 18295 * tests/Makefile.am (check_PROGRAMS): Likewise. 18296 (TESTS): Add attach-p-cmd.test. 18297 18298 This fixes Debian bug #549942. 18299 18300 2016-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 18301 18302 strace.1: fix format of -P description. 18303 * strace.1 (-P): Write trailing using regular font. 18304 18305 2016-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 18306 18307 tests: use local nanosleep based sleep utility replacement. 18308 * tests/sleep.c: New file. 18309 * tests/.gitignore: Add sleep. 18310 * tests/Makefile.am (check_PROGRAMS): Likewise. 18311 * tests/count.test: Use it instead of system sleep utility. 18312 18313 tests: add error_msg_and_fail function to libtests. 18314 * tests/tests.h (error_msg_and_fail): New prototype. 18315 * tests/error_msg.c (error_msg_and_fail): New function. 18316 18317 2016-01-20 Dmitry V. Levin <ldv (a] altlinux.org> 18318 18319 Fix dumping of recvmmsg syscall in case of short read. 18320 * net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov, 18321 pass data size limit to dumpiov_upto. 18322 * NEWS: Mention this fix. 18323 * tests/mmsg.c (main): Update. 18324 18325 Fix dumping of recvmsg syscall in case of short read. 18326 * defs.h (dumpiov_in_msghdr): Add unsigned long argument. 18327 * net.c (dumpiov_in_msghdr): Add data_size argument. Call dumpiov_upto 18328 instead of dumpiov, pass data_size to dumpiov_upto. 18329 * syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr. 18330 * NEWS: Mention this fix. 18331 * tests/recvmsg.c: New file. 18332 * tests/recvmsg.test: New test. 18333 * tests/Makefile.am (check_PROGRAMS): Add recvmsg. 18334 (TESTS): Add recvmsg.test. 18335 * tests/.gitignore: Add recvmsg. 18336 18337 Fix decoding and dumping of readv syscall in case of short read. 18338 * defs.h (dumpiov_upto): New prototype. 18339 (dumpiov): Change to a wrapper around dumpiov_upto. 18340 * util.c (dumpiov): Rename to dumpiov_upto, add and check data_size 18341 argument. 18342 * io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead 18343 of tprint_iov and specify syscall return value as a data size limit. 18344 * syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead 18345 of dumpiov and specify syscall return value as a data size limit. 18346 * NEWS: Mention this fix. 18347 * tests/readv.c: New file. 18348 * tests/readv.test: New test. 18349 * tests/Makefile.am (check_PROGRAMS): Add readv. 18350 (TESTS): Add readv.test. 18351 * tests/.gitignore: Add readv. 18352 18353 tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros. 18354 * tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros. 18355 * tests/aio.c (ARRAY_SIZE): Remove. 18356 * tests/mmsg.c (LENGTH_OF): Remove. 18357 18358 tests: add hexdump_strdup function to libtests. 18359 * tests/tests.h (hexdump_strdup): New prototype. 18360 * tests/hexdump_strdup.c: New file. 18361 * tests/Makefile.am (libtests_a_SOURCES): Add it. 18362 18363 tests: add tprintf function to libtests. 18364 * tests/tests.h (tprintf): New prototype. 18365 * tests/tprintf.c: New file. 18366 * tests/Makefile.am (libtests_a_SOURCES): Add it. 18367 * tests/mmsg.c: Use tprintf. 18368 18369 2016-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 18370 18371 quotactl: add Q_XGETQSTATV command decoding. 18372 * quota.c (fs_qfilestatv, fs_quota_statv): New structures. 18373 (decode_cmd_data): Handle Q_XGETQSTATV case. 18374 18375 quotactl: add decoding of if_dqinfo.dqi_flags constants. 18376 * xlat/if_dqinfo_flags.in: New file. 18377 * quota.c: Include "xlat/if_dqinfo_flags.h". 18378 (decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags. 18379 18380 quotactl: consistenly decode all write and unknown commands on entering. 18381 * quota.c (decode_cmd_data): Change return type to int. 18382 Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA, 18383 Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS, 18384 Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED 18385 for any other command. 18386 (SYS_FUNC(quotactl)): On entering, print third argument of any command. 18387 For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data 18388 and forward its return value. 18389 18390 quotactl: fix Q_QUOTAON command decoding. 18391 * quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path. 18392 18393 quotactl: print third argument as unsigned int. 18394 * quota.c (SYS_FUNC(quotactl)): Consistently print the third 18395 argument using "%u" format. 18396 18397 quotactl: fix Q_XQUOTAOFF command decoding. 18398 * quota.c (decode_cmd_data): Print xfs quota flags argument. 18399 18400 quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding. 18401 * quota.c (decode_cmd_data): As quota format value and xfs quota flags 18402 are in-memory constants, print it like an array of one element instead 18403 of a structure. 18404 18405 2016-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 18406 18407 Update quotactl constants. 18408 * xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1. 18409 * xlat/quotacmds.in: Add Q_XGETQSTATV. 18410 * xlat/quotatypes.in: Add PRJQUOTA. 18411 * xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD. 18412 18413 2016-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 18414 18415 Replace u_int{8,16,32,64} with uint{8,16,32,64} 18416 * util.c: Replace u_int{32,64} with uint{32,64}. 18417 * quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}. 18418 18419 Move definitions of quotactl constants to xlat files. 18420 * quota.c (Q_*): Move to xlat/quotacmds.in. 18421 (USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in. 18422 (QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in. 18423 (XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in. 18424 (XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in. 18425 (QIF_*): Move to xlat/if_dqblk_valid.in. 18426 (IIF_*): Move to xlat/if_dqinfo_valid.in. 18427 18428 2016-01-15 Dmitry V. Levin <ldv (a] altlinux.org> 18429 18430 llseek.test: robustify against libcs invoking _llseek syscall on their own 18431 * tests/llseek.test: Filter out _llseek calls made with non-negative 18432 descriptor arguments. 18433 18434 lseek.test: robustify against libcs invoking lseek syscall on their own. 18435 * tests/lseek.test: Filter out lseek calls made with non-negative 18436 descriptor arguments. 18437 18438 2016-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 18439 18440 mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce. 18441 This fixes the test on platforms where both __NR_sendmmsg and 18442 HAVE_SENDMMSG are defined but the former is not implemented by the 18443 kernel and the second is implemented as an indirect syscall. 18444 18445 * tests/mmsg.c (LENGTH_OF): New macro. 18446 (send_mmsg, recv_mmsg): Print expected output in case of ENOSYS. 18447 (main): Redirect stdout to a new descriptor. Use LENGTH_OF. 18448 Print expected output. 18449 * tests/mmsg.test: Update. 18450 * tests/mmsg.expected: Remove. 18451 * tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected. 18452 18453 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 18454 18455 aio.test: check memory access by aio decoders. 18456 * tests/aio.c (main): Place all objects passed to io_* syscalls 18457 at the end of memory pages followed by inaccessible pages. 18458 18459 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 18460 18461 s390, s390x: fix printing of syscalls unknown to the kernel. 18462 On s390/s390x, syscalls with NR up to 255 can be implemented 18463 directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used. 18464 The latter method is allowed for NR < 256, too. 18465 18466 When the syscall number specified directly or indirectly is recognized 18467 by the kernel, i.e. it is less than its NR_syscalls value, it is stored 18468 in %r2 and is available to arch_get_scno via s390_regset.gprs[2]. 18469 For syscall numbers >= NR_syscalls this register is set to 0, 18470 but %r1 remains unchanged and could be used by arch_get_scno 18471 via s390_regset.gprs[1] to decide what the syscall number is. 18472 18473 * linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero, 18474 take syscall number from s390_regset.gprs[1]. 18475 * NEWS: Mention this fix. 18476 18477 This fixes Debian bug #485979 and Fedora bug #1298294. 18478 18479 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 18480 18481 s390, s390x: print all syscall arguments for syscall number 0. 18482 * linux/s390/syscallent.h [0]: Set nargs to MA. 18483 * linux/s390x/syscallent.h: Likewise. 18484 18485 mips o32: alias sys_syscall to printargs. 18486 * linux/dummy.h (sys_syscall): Alias to printargs. 18487 * syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove. 18488 18489 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 18490 18491 travis-ci: update build matrix. 18492 Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix. 18493 18494 * .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc. 18495 (env): Add matrix, remove global ENABLE_GCC_WERROR. 18496 (matrix): Add exclude, remove include. 18497 * travis-ci.sh: Add support for clang and musl-gcc. 18498 Use --enable-gcc-Werror for gcc build unconditionally. 18499 18500 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 18501 18502 mpers.awk: add support for DWARF files generated by clang. 18503 * mpers.awk: Define default_pointer_size. Initialize byte_size 18504 for DW_TAG_pointer_type to default_pointer_size. Set parent 18505 for DW_TAG_member only. Handle DW_AT_count as an alternative 18506 to DW_AT_upper_bound. 18507 18508 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18509 18510 configure.ac: reorder some statements for better readability. 18511 * configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*, 18512 AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS, 18513 and AC_CHECK_HEADERS. 18514 18515 scm_rights-fd.test: rewrite without fork. 18516 * tests/scm_rights.c (main): Rewrite without fork. 18517 Place all objects passed to sendmsg and recvmsg at the end 18518 of memory pages followed by inaccessible pages. 18519 * tests/scm_rights-fd.test: Update. 18520 18521 tests: fix clang "duplicate 'const' declaration specifier" warnings. 18522 * tests/ksysent.c (pstr_t): Remove second const specifier. 18523 * tests/mmsg.c (main): Remove second const specifier from one[], two[], 18524 and three[]. 18525 18526 tests/times.c: fix clang compilation warning. 18527 * tests/times.c (main): Initialize dummy variable. 18528 18529 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18530 18531 tests/mmsg.c: fix build on rhel6/ppc. 18532 There are weird platforms that define __NR_sendmmsg but at the same time 18533 do not define __NR_recvmmsg. Add a workaround for them. 18534 18535 * configure.ac (AC_CHECK_FUNCS): Add recvmmsg. 18536 * tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG. 18537 18538 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18539 18540 s390: fix sigreturn decoding on recent kernels. 18541 Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask 18542 of the compat signal frame, so remove the old workaround. 18543 18544 * linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove. 18545 18546 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18547 18548 Update PTRACE_* constants. 18549 * ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define. 18550 * xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER. 18551 18552 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18553 18554 Fix struct sigevent decoding for musl. 18555 Do not rely on "struct sigevent.__pad" being located at the same address 18556 as "struct sigevent.sigev_notify_thread_id", it's not the case with musl 18557 libc. Do not rely on struct sigevent definition at all to access 18558 sigev_notify_thread_id. 18559 18560 * configure.ac (AC_CHECK_MEMBERS): Remove struct sigevent._sigev_un._pad 18561 and struct sigevent.__pad. 18562 * sigevent.h: New file. 18563 * Makefile.am (strace_SOURCES): Add it. 18564 * print_sigevent.c: Include it. 18565 * print_sigevent.c (struct_sigevent): Remove. 18566 (print_sigevent): Update all struct_sigevent users. 18567 * tests/timer_create.c: Include "sigevent.h". 18568 (main): Use struct_sigevent instead of struct sigevent, 18569 all struct sigevent clients changed. 18570 18571 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18572 18573 syscall.c: include <signal.h> 18574 All users of NSIG macro must include <signal.h>. 18575 This complements commit v4.10-184-g0e946ab. 18576 18577 * syscall.c: Include <signal.h>. 18578 18579 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18580 18581 signal.c: fix musl libc compilation warning. 18582 musl libc defines SIGRTMAX to a function that returns signed int, 18583 which obviously makes gcc -Wsign-compare unhappy. 18584 18585 * signal.c (signame): Cast ASM_SIGRTMAX to unsigned int. 18586 18587 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18588 18589 tests: fix TEST_SYSCALL_{NR,STR} and STRUCT_STAT_STR macros for musl. 18590 The contents of TEST_SYSCALL_NAME and STRUCT_STAT macros was subject 18591 to macro expansion when used in definitions of TEST_SYSCALL_NR, 18592 TEST_SYSCALL_STR, and STRUCT_STAT_STR macros. 18593 18594 As some libcs, e.g. musl libc, define lfs64 names as macros 18595 (stat64 as stat, lstat64 as lstat, etc.), this might result to incorrect 18596 expansion of TEST_SYSCALL_NR, TEST_SYSCALL_STR, and STRUCT_STAT_STR 18597 macros. To avoid this problem, define these macros directly and remove 18598 TEST_SYSCALL_NAME macro. 18599 18600 * tests/_newselect.c (TEST_SYSCALL_NAME): Remove. 18601 (TEST_SYSCALL_NR, TEST_SYSCALL_STR): New macros. 18602 * tests/fcntl.c: Likewise. 18603 * tests/fcntl64.c: Likewise. 18604 * tests/fstat.c: Likewise. 18605 * tests/fstatat64.c: Likewise. 18606 * tests/lstat.c: Likewise. 18607 * tests/newfstatat.c: Likewise. 18608 * tests/select.c: Likewise. 18609 * tests/stat.c: Likewise. 18610 * tests/fstat64.c (TEST_SYSCALL_NAME): Remove. 18611 (TEST_SYSCALL_NR, TEST_SYSCALL_STR, STRUCT_STAT_STR): New macros. 18612 * tests/lstat64.c: Likewise. 18613 * tests/stat64.c: Likewise. 18614 * tests/fstatx.c (TEST_SYSCALL_NR, nrify, nrify_): Remove. 18615 * tests/lstatx.c: Likewise. 18616 * tests/struct_flock.c (TEST_SYSCALL_NR, TEST_SYSCALL_STR, nrify, 18617 nrify_, stringify, stringify_): Remove. 18618 * tests/xselect.c: Likewise. 18619 * tests/xstatx.c: Check TEST_SYSCALL_STR instead of TEST_SYSCALL_NAME. 18620 (STRUCT_STAT_STR, TEST_SYSCALL_STR, stringify, stringify_): Remove. 18621 [!STRUCT_STAT] (STRUCT_STAT_STR): New macro. 18622 18623 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18624 18625 tests/struct_flock.c: fix musl libc compilation warnings. 18626 The size of off_t is not something one can rely upon. For example, 18627 musl libc unconditionally defines it as an int64_t type on x86. 18628 A cast to the target type helps to avoid these libc differences. 18629 18630 * configure.ac: Call AC_C_TYPEOF. 18631 * tests/struct_flock.c (TYPEOF_FLOCK_OFF_T): New macro. 18632 (test_flock_einval): Use it instead of off_t. 18633 18634 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 18635 18636 tests/inet-cmsg.c: fix musl libc compilation warnings. 18637 The types that are used to define msg_namelen member of struct msghdr 18638 and cmsg_len member of struct cmsghdr differ between libcs. 18639 For example, glibc defines them as size_t, while musl libc - as type 18640 socklen_t. Print these fields using %lu format to avoid issues caused 18641 by libc differences. 18642 18643 * tests/inet-cmsg.c (main): Cast mh.msg_controllen and c->cmsg_len 18644 to unsigned long and print them using %lu format. 18645 18646 2016-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 18647 18648 aio.test: include <fcntl.h> instead of <sys/fcntl.h> 18649 * tests/aio.c: Include <fcntl.h> instead of <sys/fcntl.h>. 18650 18651 mmsg.test: check memory access by sendmmsg and recvmmsg decoders. 18652 * tests/tests.h (tail_memdup): New prototype. 18653 * tests/tail_alloc.c (tail_memdup): New function. 18654 * tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg 18655 at the end of memory pages followed by inaccessible pages. 18656 18657 mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg. 18658 * tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg. 18659 Pass MSG_DONTWAIT to recvmmsg. 18660 * tests/mmsg.expected: Update. 18661 18662 2016-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 18663 18664 mmsg.test: prefer direct sendmmsg/recvmmsg syscalls to libc wrappers. 18665 * tests/mmsg.c: Include <sys/syscall.h>. 18666 Check for __NR_sendmmsg as an alternative to HAVE_SENDMMSG. 18667 [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. 18668 (send_mmsg, recv_mmsg): New functions. 18669 (main): Use them instead of sendmmsg and recvmmsg. 18670 18671 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 18672 18673 2016-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 18674 18675 sigreturn.test: use RT_5 signal number instead of RT_2. 18676 Make the test compatible with musl libc that uses RT_2 internally. 18677 18678 * tests/sigreturn.c (main): Replace RT_2 with RT_5. 18679 * tests/sigreturn.test: Likewise. 18680 18681 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 18682 18683 2016-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 18684 18685 avr32: wire up accept4 syscall. 18686 * linux/avr32/syscallent.h [321]: Add accept4 entry. 18687 18688 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 18689 18690 sparc64: fix names of {s,g}etres{u,g}id syscalls. 18691 * linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names. 18692 18693 sparc64: remove sparc32 syscall entries. 18694 * linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77, 18695 82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign. 18696 18697 sparc: remove sparc64 syscall entries. 18698 * linux/sparc/syscallent.h [52, 163]: Unassign. 18699 18700 sparc64: clone syscallent.h from sparc. 18701 * linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h. 18702 18703 sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls 18704 * linux/sparc/syscallent.h [353]: Move mlock2 entry to 356. 18705 [353, 354, 355]: Add bind, listen, and setsockopt entries. 18706 * NEWS: Mention this. 18707 18708 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 18709 18710 tests: do not use settimeofday wrapper provided by libc. 18711 Workaround limitations of settimeofday wrapper provided by musl libc. 18712 18713 * tests/xettimeofday.c (main): Call settimeofday using syscall(). 18714 18715 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 18716 18717 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 18718 18719 ioctl.test: robustify against libcs invoking ioctl syscall on their own. 18720 * tests/ioctl.test: Filter out from the log ioctl calls with standard 18721 descriptor arguments. 18722 18723 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 18724 18725 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 18726 18727 alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls. 18728 Print the second return value of getxpid, getxuid, and getxgid syscalls 18729 that return a pair of values using the same mechanism as pipe syscall. 18730 18731 * alpha.c: New file. 18732 * Makefile.am (strace_SOURCES): Add it. 18733 * linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid). 18734 [24]: Change SEN(getuid) to SEN(getxuid). 18735 [47]: Change SEN(getgid) to SEN(getxgid). 18736 * NEWS: Mention this enhancement. 18737 * tests/uid.awk: Update for getxgid output change. 18738 * tests/uid.test: Cleanup. 18739 * tests/getxxid.c: New file. 18740 * tests/getxxid.test: New test. 18741 * tests/Makefile.am (check_PROGRAMS): Add getxxid. 18742 (TESTS): Add getxxid.test. 18743 * tests/.gitignore: Add getxxid. 18744 18745 2016-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 18746 18747 Cleanup parser of getpagesize syscall. 18748 * mem.c (SYS_FUNC(getpagesize)): Decode on entering syscall. 18749 18750 alpha: alias getdtablesize to printargs. 18751 * linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs. 18752 * desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove. 18753 18754 2016-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 18755 18756 tests: change text marker in fork-f and vfork-f tests. 18757 Use chdir syscalls instead of pwrite64 syscalls as a method of inserting 18758 text markers into strace output because the former are more portable. 18759 18760 * tests/fork-f.c (logit): Rename to logit_. Use chdir instead of pwrite. 18761 (logit): New macro wrapper around logit_. 18762 (main): Update expected output. 18763 * tests/vfork-f.c: Likewise. 18764 * tests/fork-f.test: Update. 18765 18766 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 18767 18768 Fix printing of 32-bit times syscall return value on 64-bit architectures 18769 This change complements commit v4.9-359-gd93d9f8 by fixing 18770 RVAL_UDECIMAL case. 18771 The only syscall that appears to be affected is the times syscall. 18772 18773 * syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL, 18774 when current personality is 32-bit, print 32-bit return code. 18775 * NEWS: Mention this fix. 18776 18777 Reported-by: Steve McIntyre <steve (a] einval.com> 18778 18779 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 18780 18781 tests/vfork-f.c: support platforms without vfork. 18782 On some platforms, e.g. hppa glibc, vfork() is implemented using fork 18783 syscall, so the test cannot rely on the parent process remaining blocked 18784 until the child process either terminates or calls execve. 18785 18786 * tests/vfork-f.c (main): Explicitly block the parent until the child 18787 either terminates or calls execve. 18788 18789 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 18790 18791 Fix and enhance decoding of sched_[gs]etaffinity syscalls. 18792 Print cpu_set_t as a set of integers, similar to the way 18793 fd_set is printed as a set of descriptors. 18794 18795 * affinity.c: Include <sched.h>. 18796 (get_cpuset_size): New function. 18797 (print_affinitylist): Rewrite using get_cpuset_size and next_set_bit. 18798 (sched_getaffinity, sched_setaffinity): Print first two args as ints. 18799 * NEWS: Mention this enhancement. 18800 * tests/sched_xetaffinity.c: New file. 18801 * tests/sched_xetaffinity.test: New test. 18802 * tests/Makefile.am (check_PROGRAMS): Add sched_xetaffinity. 18803 (TESTS): Add sched_xetaffinity.test. 18804 * tests/.gitignore: Add sched_xetaffinity. 18805 18806 Reported-by: Joe Korty <joe.korty (a] ccur.com> 18807 18808 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 18809 18810 tests: convert epoll_create1.test from match_grep to match_diff. 18811 * tests/epoll_create1.c (main): Print expected output. 18812 * tests/epoll_create1.test: Use match_diff instead of match_grep. 18813 * tests/epoll_create1.expected: Remove. 18814 * tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected. 18815 18816 tests/struct_flock.c: use libtests. 18817 * tests/struct_flock.c (create_sample): Return void, 18818 all callers changed. Use perror_msg_and_fail. 18819 * tests/fcntl.c: Use SKIP_MAIN_UNDEFINED. 18820 * tests/fcntl64.c: Likewise. 18821 18822 tests/file_handle.c: use libtests. 18823 * tests/file_handle.c: Use SKIP_MAIN_UNDEFINED. 18824 (main): Use assert and perror_msg_and_skip. 18825 18826 tests/uid32.c: use libtests. 18827 * tests/uid32.c: Use SKIP_MAIN_UNDEFINED. 18828 18829 tests/uid16.c: use libtests. 18830 * tests/uid16.c: Use SKIP_MAIN_UNDEFINED. 18831 (main): Use perror_msg_and_skip. 18832 18833 tests/uid.c: use libtests. 18834 * tests/uid.c: Use SKIP_MAIN_UNDEFINED. 18835 (main): Use perror_msg_and_skip. 18836 18837 tests/netlink_unix_diag.c: use libtests. 18838 * tests/netlink_unix_diag.c (send_query, check_responses, main): 18839 Use perror_msg_and_skip. 18840 18841 tests/netlink_inet_diag.c: use libtests. 18842 * tests/netlink_inet_diag.c (send_query, check_responses, main): 18843 Use perror_msg_and_skip. 18844 18845 tests/readdir.c: use libtests. 18846 * tests/readdir.c: Use SKIP_MAIN_UNDEFINED. 18847 (main): Use perror_msg_and_skip. 18848 18849 tests/getdents64.c: use libtests. 18850 * tests/getdents64.c: Use SKIP_MAIN_UNDEFINED. 18851 (main): Use perror_msg_and_skip. 18852 18853 tests/getdents.c: use libtests. 18854 * tests/getdents.c: Use SKIP_MAIN_UNDEFINED. 18855 (main): Use perror_msg_and_skip. 18856 18857 tests/ipc_shm.c: use libtests. 18858 * tests/ipc_shm.c (cleanup): New function. 18859 (main): Use it and perror_msg_and_skip. 18860 18861 tests/ipc_sem.c: use libtests. 18862 * tests/ipc_sem.c (cleanup): New function. 18863 (main): Use it and perror_msg_and_skip. 18864 18865 tests/ipc_msg.c: use libtests. 18866 * tests/ipc_msg.c (cleanup): New function. 18867 (main): Use it and perror_msg_and_skip. 18868 18869 tests/ipc_msgbuf.c: use libtests. 18870 * tests/ipc_msgbuf.c (cleanup): New function. 18871 (main): Use it and perror_msg_and_skip. 18872 18873 tests/mq.c: use libtests. 18874 * tests/mq.c: Use SKIP_MAIN_UNDEFINED. 18875 (main): Use perror_msg_and_skip. 18876 18877 tests/utimensat.c: use libtests. 18878 * tests/utimensat.c: Use SKIP_MAIN_UNDEFINED. 18879 (main): Use assert and perror_msg_and_skip. 18880 18881 tests/ppoll.c: use libtests. 18882 * tests/ppoll.c (main): Use assert, perror_msg_and_skip, 18883 and perror_msg_and_fail. 18884 18885 tests/mmsg.c: use libtests. 18886 * tests/mmsg.c: Use SKIP_MAIN_UNDEFINED. 18887 (main): Use perror_msg_and_skip. 18888 18889 tests/ip_mreq.c: use libtests. 18890 * tests/ip_mreq.c: Use SKIP_MAIN_UNDEFINED. 18891 (main): Use perror_msg_and_skip. 18892 18893 tests/ioctl.c: use libtests. 18894 * tests/ioctl.c: Use SKIP_MAIN_UNDEFINED. 18895 (main): Use %m printf format specifier. 18896 18897 tests/pipe.c: use libtests. 18898 * tests/pipe.c: Use SKIP_MAIN_UNDEFINED. 18899 (main): Use perror_msg_and_fail and perror_msg_and_skip. 18900 18901 tests/getrandom.c: use libtests. 18902 * tests/getrandom.c: Use SKIP_MAIN_UNDEFINED. 18903 (main): Use perror_msg_and_skip. 18904 18905 tests/signalfd.c: use libtests. 18906 * tests/signalfd.c: Use SKIP_MAIN_UNDEFINED. 18907 (main): Use perror_msg_and_skip. 18908 18909 tests/pc.c: use libtests. 18910 * tests/pc.c (main): Use assert, get_page_size, perror_msg_and_fail, 18911 and perror_msg_and_skip. 18912 18913 tests/uio.c: use libtests. 18914 * tests/uio.c: Use SKIP_MAIN_UNDEFINED. 18915 18916 tests/bpf.c: use libtests. 18917 * tests/bpf.c: Use SKIP_MAIN_UNDEFINED. 18918 (main) Use perror_msg_and_skip. 18919 18920 tests/aio.c: use libtests. 18921 * tests/aio.c: Use SKIP_MAIN_UNDEFINED. 18922 (main) Use perror_msg_and_skip. 18923 18924 tests/sched_xetattr.c: use libtests. 18925 * tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED. 18926 (main) Use perror_msg_and_skip. 18927 18928 tests/wait.c: use libtests. 18929 * tests/wait.c (main): Use perror_msg_and_fail. 18930 18931 tests/vfork-f.c: use libtests. 18932 * tests/vfork-f.c (main): Use assert and perror_msg_and_fail. 18933 18934 tests/fork-f.c: use libtests. 18935 * tests/fork-f.c (main): Use assert and perror_msg_and_fail. 18936 18937 tests/userfaultfd.c: use libtests. 18938 * tests/userfaultfd.c: Use SKIP_MAIN_UNDEFINED. 18939 (main): Use assert. 18940 18941 tests/mlock2.c: use libtests. 18942 * tests/mlock2.c: Use SKIP_MAIN_UNDEFINED. 18943 (main): Use assert. 18944 18945 tests/membarrier.c: use libtests. 18946 * tests/membarrier.c: Use SKIP_MAIN_UNDEFINED. 18947 (main): Use assert. 18948 18949 tests/nanosleep.c: use libtests. 18950 * tests/nanosleep.c (main): Use assert, perror_msg_and_fail, 18951 and perror_msg_and_skip. 18952 18953 tests/timerfd_xettime.c: use libtests. 18954 * tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED. 18955 (main): Use perror_msg_and_skip. 18956 18957 tests/timer_xettime.c: use libtests. 18958 * tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED. 18959 (main): Use perror_msg_and_skip. 18960 18961 tests/timer_create.c: use libtests. 18962 * tests/timer_create.c: Use SKIP_MAIN_UNDEFINED. 18963 (main): Use perror_msg_and_skip. 18964 18965 tests/clock_xettime.c: use libtests. 18966 * tests/clock_xettime.c: Use SKIP_MAIN_UNDEFINED. 18967 (main): Use perror_msg_and_skip. 18968 18969 tests/clock_nanosleep.c: use libtests. 18970 * tests/clock_nanosleep.c (main): Use assert and perror_msg_and_skip. 18971 18972 tests/truncate64.c: use libtests. 18973 * tests/truncate64.c: Use SKIP_MAIN_UNDEFINED. 18974 (main): Use assert and perror_msg_and_skip. 18975 18976 tests/truncate.c: use libtests. 18977 * tests/truncate.c: Use SKIP_MAIN_UNDEFINED. 18978 (main): Use assert and perror_msg_and_skip. 18979 18980 tests/ftruncate64.c: use libtests. 18981 * tests/ftruncate64.c: Use SKIP_MAIN_UNDEFINED. 18982 (main): Use assert and perror_msg_and_skip. 18983 18984 tests/ftruncate.c: use libtests. 18985 * tests/ftruncate.c: Use SKIP_MAIN_UNDEFINED. 18986 (main): Use assert and perror_msg_and_skip. 18987 18988 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 18989 18990 tests/llseek.c: use libtests. 18991 * tests/llseek.c: Use SKIP_MAIN_UNDEFINED. 18992 (main): Use assert and perror_msg_and_skip. 18993 18994 tests/lseek.c: use libtests. 18995 * tests/lseek.c: Use SKIP_MAIN_UNDEFINED. 18996 (main): Use assert and perror_msg_and_skip. 18997 18998 tests/readlinkat.c: use libtests. 18999 * tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED. 19000 (main): Use perror_msg_and_skip. 19001 19002 tests/readlink.c: use libtests. 19003 * tests/readlink.c: Use SKIP_MAIN_UNDEFINED. 19004 (main): Use perror_msg_and_skip. 19005 19006 tests/xattr.c: use libtests. 19007 * tests/xattr.c: Use SKIP_MAIN_UNDEFINED. 19008 (main): Use perror_msg_and_skip. 19009 19010 tests/seccomp.c: use libtests. 19011 * tests/seccomp.c: Use SKIP_MAIN_UNDEFINED. 19012 (main): Use perror_msg_and_fail and perror_msg_and_skip. 19013 19014 tests/restart_syscall.c: use libtests. 19015 * tests/restart_syscall.c (main): Use assert, perror_msg_and_fail, 19016 and perror_msg_and_skip. 19017 19018 tests/inet-cmsg.c: use libtests. 19019 * tests/inet-cmsg.c (main): Use perror_msg_and_skip. 19020 19021 tests/eventfd.c: use libtests. 19022 * tests/eventfd.c: Use SKIP_MAIN_UNDEFINED. 19023 (main): Use perror_msg_and_skip. 19024 19025 tests/epoll_create1.c: use libtests. 19026 * tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED. 19027 (main): Use assert and perror_msg_and_skip. 19028 19029 tests/mmap.c: use libtests. 19030 * tests/mmap.c (main): Use get_page_size and perror_msg_and_fail. 19031 19032 tests/fanotify_mark.c: use libtests. 19033 * tests/fanotify_mark.c: Use SKIP_MAIN_UNDEFINED. 19034 19035 tests/inet-accept-connect-send-recv.c: use libtests. 19036 * tests/inet-accept-connect-send-recv.c (main): Use perror_msg_and_skip 19037 and perror_msg_and_fail. 19038 19039 tests/net-accept-connect.c: use libtests. 19040 * tests/net-accept-connect.c (main): Use perror_msg_and_skip 19041 and perror_msg_and_fail. 19042 19043 tests/unix-pair-send-recv.c: use libtests. 19044 * tests/unix-pair-send-recv.c (main): Use perror_msg_and_skip 19045 and perror_msg_and_fail. 19046 19047 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 19048 19049 tests/xselect.c: use libtests. 19050 * tests/xselect.c (main): Use assert, perror_msg_and_fail, 19051 and perror_msg_and_skip. 19052 19053 tests/pselect6.c: use libtests. 19054 * tests/pselect6.c: Use SKIP_MAIN_UNDEFINED. 19055 (main): Use assert, perror_msg_and_fail, and perror_msg_and_skip. 19056 19057 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 19058 19059 tests/oldselect.c: use libtests. 19060 * tests/oldselect.c: Use SKIP_MAIN_UNDEFINED. 19061 (main): Use perror_msg_and_fail and perror_msg_and_skip. 19062 19063 tests/select.c: use libtests. 19064 * tests/select.c: Use SKIP_MAIN_UNDEFINED. 19065 19066 tests/_newselect.c: use libtests. 19067 * tests/_newselect.c: Use SKIP_MAIN_UNDEFINED. 19068 19069 tests/fstatat.c: use libtests. 19070 * tests/fstatat.c: Use SKIP_MAIN_UNDEFINED. 19071 19072 tests/newfstatat.c: use libtests. 19073 * tests/newfstatat.c: Use SKIP_MAIN_UNDEFINED. 19074 19075 tests/fstatat64.c: use libtests. 19076 * tests/fstatat64.c: Use SKIP_MAIN_UNDEFINED. 19077 19078 tests/xstatx.c: use libtests. 19079 * tests/xstatx.c: Use SKIP_MAIN_UNDEFINED. 19080 19081 tests/stat64.c: use libtests. 19082 * tests/stat64.c: Use SKIP_MAIN_UNDEFINED. 19083 19084 tests/stat.c: use libtests. 19085 * tests/stat.c: Use SKIP_MAIN_UNDEFINED. 19086 19087 tests/lstat64.c: use libtests. 19088 * tests/lstat64.c: Use SKIP_MAIN_UNDEFINED. 19089 19090 tests/lstat.c: use libtests. 19091 * tests/lstat.c: Use SKIP_MAIN_UNDEFINED. 19092 19093 tests/fstat64.c: use libtests. 19094 * tests/fstat64.c: Use SKIP_MAIN_UNDEFINED. 19095 19096 tests/fstat.c: use libtests. 19097 * tests/fstat.c: Use SKIP_MAIN_UNDEFINED. 19098 19099 tests/statfs.c: use libtests. 19100 * tests/statfs.c (main): Use perror_msg_and_fail. 19101 19102 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 19103 19104 tests/xettimeofday.c: use libtests. 19105 * tests/xettimeofday.c (main): Use assert and perror_msg_and_skip. 19106 19107 tests/utime.c: use libtests. 19108 * tests/utime.c (main): Use assert and perror_msg_and_skip. 19109 19110 tests/filter-unavailable.c: use libtests. 19111 * tests/filter-unavailable.c (main): Use perror_msg_and_fail. 19112 19113 tests/scm_rights.c: use libtests. 19114 * tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip. 19115 19116 tests/caps.c: use libtests. 19117 * tests/caps.c (main): Use perror_msg_and_skip. 19118 19119 tests/rt_sigqueueinfo.c: use libtests. 19120 * tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip. 19121 19122 tests/umount.c: use libtests. 19123 * tests/umount.c: Use SKIP_MAIN_UNDEFINED. 19124 (main): Use perror_msg_and_fail. 19125 19126 tests/umount2.c: use libtests. 19127 * tests/umount2.c (main): Use perror_msg_and_fail. 19128 19129 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 19130 19131 tests/times.c: use libtests. 19132 * tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip. 19133 19134 2016-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 19135 19136 tests/times-fail.c: use assert. 19137 * tests/times-fail.c (main): Use assert. 19138 19139 tests/memfd_create.c: use libtests. 19140 * tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED. 19141 19142 tests/execveat.c: use libtests. 19143 * tests/execveat.c: Use SKIP_MAIN_UNDEFINED. 19144 19145 tests/xetitimer.c: use libtests. 19146 * tests/xetitimer.c (main): Use perror_msg_and_skip. 19147 19148 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 19149 19150 tests/sysinfo.c: use libtests. 19151 * tests/sysinfo.c (main): Use perror_msg_and_skip. 19152 19153 tests/sigaltstack.c: use libtests. 19154 * tests/sigaltstack.c (main): Use perror_msg_and_skip. 19155 19156 tests/adjtimex.c: use libtests. 19157 * tests/adjtimex.c (main): Use perror_msg_and_skip. 19158 19159 tests/xet_robust_list.c: use libtests. 19160 * tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED. 19161 (main): Use perror_msg_and_skip and tail_alloc. 19162 19163 tests/umovestr2.c: use libtests. 19164 * tests/umovestr2.c (main): Use get_page_size and tail_alloc. 19165 19166 tests/umovestr.c: use libtests. 19167 * tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc. 19168 19169 tests/time.c: use libtests. 19170 * tests/time.c: Use SKIP_MAIN_UNDEFINED. 19171 (main): Use perror_msg_and_skip and tail_alloc. 19172 19173 tests/sendfile64.c: use libtests. 19174 * tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED. 19175 (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, 19176 and tail_alloc. 19177 19178 tests/sendfile.c: use libtests. 19179 * tests/sendfile.c: Use SKIP_MAIN_UNDEFINED. 19180 (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, 19181 and tail_alloc. 19182 19183 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 19184 19185 tests: include tests.h instead of config.h. 19186 Automatically edit tests/*.c files using the following perl one-liner: 19187 19188 perl -0777 -pi -e \ 19189 's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \ 19190 tests/*.c 19191 19192 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 19193 19194 tests: introduce libtests. 19195 Introduce tests/libtests.a with common functions for use in tests. 19196 19197 * tests/tests.h: New file. 19198 * tests/error_msg.c: Likewise. 19199 * tests/tail_alloc.c: Likewise. 19200 * tests/get_page_size.c: Likewise. 19201 * tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS, 19202 check_LIBRARIES, LDADD): New variables. 19203 (clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD, 19204 pc_LDADD, times_LDADD): Add $(LDADD). 19205 * tests/.gitignore: Add libtests.a. 19206 19207 2016-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 19208 19209 tests: enable strace-k.test only for --with-libunwind configurations. 19210 Also, since -k option does not support multiple personalities, 19211 add strace-k.test to XFAIL_TESTS when running mpers tests. 19212 19213 * tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_, 19214 XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables. 19215 [USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test. 19216 (TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS). 19217 * bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am. 19218 * tests/strace-k.test: Do not check for -k option availability. 19219 19220 2016-01-02 Dmitry V. Levin <ldv (a] altlinux.org> 19221 19222 Move gcc compat macros to gcc_compat.h. 19223 * defs.h: Include "gcc_compat.h". 19224 (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, 19225 ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, 19226 ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ... 19227 * gcc_compat.h: ... here. 19228 * Makefile.am (strace_SOURCES): Add gcc_compat.h. 19229 19230 2015-12-31 Dmitry V. Levin <ldv (a] altlinux.org> 19231 19232 Move defs.h from noinst_HEADERS to strace_SOURCES. 19233 * Makefile.am (noinst_HEADERS): Move defs.h ... 19234 (strace_SOURCES): ... here. 19235 19236 2015-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 19237 19238 test: remove fork.c and vfork.c. 19239 These manual tests are obsoleted by fork-f.test and vfork-f.test. 19240 19241 * test/fork.c: Remove. 19242 * test/vfork.c: Remove. 19243 * test/Makefile (PROGS): Remove fork and vfork. 19244 * test/.gitignore: Remove fork and vfork. 19245 19246 2015-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 19247 19248 tests: add fork-f.test and vfork-f.test. 19249 Check how strace -f follows fork and vfork syscalls. 19250 19251 * tests/fork-f.c: New file. 19252 * tests/fork-f.test: New test. 19253 * tests/vfork-f.c: New file. 19254 * tests/vfork-f.test: New test. 19255 * tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f. 19256 (TESTS): Add fork-f.test and vfork-f.test. 19257 * tests/.gitignore: Add fork-f and vfork-f. 19258 19259 2015-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 19260 19261 Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall. 19262 * linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag. 19263 19264 2015-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 19265 19266 Set SYSCALL_NEVER_FAILS flag for umask syscall. 19267 Linux kernel always ANDs umask argument with 0700 and therefore 19268 this syscall never fails. 19269 19270 * linux/*/syscallent*.h (umask): Set NF flag. 19271 19272 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 19273 19274 alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error 19275 On architectures that use dedicated registers to report syscall errors, 19276 check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag 19277 in the syscall entry. On architectures that use negated errno 19278 semantics, there is no way to distinguish a syscall error from a valid 19279 return code that looks like a syscall error, and the check for 19280 SYSCALL_NEVER_FAILS flag remains the only way to tell one case 19281 from another. 19282 19283 * linux/alpha/get_error.c (get_error): Ignore check_errno. 19284 * linux/ia64/get_error.c: Likewise. 19285 * linux/mips/get_error.c: Likewise. 19286 * linux/nios2/get_error.c: Likewise. 19287 * linux/powerpc/get_error.c: Likewise. 19288 * linux/sparc/get_error.c: Likewise. 19289 * linux/sparc64/get_error.c: Likewise. 19290 19291 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 19292 19293 Handle unlikely errors from personality syscall. 19294 Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still 19295 might report a failure on some architectures due to obscure kernel 19296 bugs. Check for this unlikely case and let users know that their 19297 kernel has gone bananas. 19298 19299 * personality.c (SYS_FUNC(personality)): Do not parse syscall return 19300 value in case of syserror. 19301 19302 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 19303 19304 Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls. 19305 This should not be a user visible change unless the kernel does 19306 something completely unexpected. In the latter case, let user see 19307 what is going on. 19308 19309 * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate 19310 tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED. 19311 19312 2015-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 19313 19314 Enhance personality syscall decoding. 19315 * xlat/personality_options.in: Split into ... 19316 * xlat/personality_types.in: ... personality types and ... 19317 * xlat/personality_flags.in: ... personality flags. 19318 * personality.c: Include "xlat/personality_types.h" 19319 and "xlat/personality_flags.h" instead of "xlat/personality_options.h". 19320 (SYS_FUNC(personality)): Print PER_MASK part of personality as 19321 a symbolic value, and the rest of personality as a set of flags. 19322 * tests/personality.c (main): Add more test cases. 19323 * tests/personality.test: Update. 19324 19325 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 19326 19327 sh, sh64: fix syscall flags in several syscall entries. 19328 * linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32): 19329 Set SYSCALL_NEVER_FAILS flag. 19330 (fchown32): Set TRACE_DESC flag. 19331 * linux/sh64/syscallent.h: Likewise. 19332 19333 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 19334 19335 Print personality value 0xffffffff properly. 19336 Value 0xffffffff of personality syscall first argument has a special 19337 meaning, it is not a set of personality flags. 19338 19339 * personality.c (SYS_FUNC(personality)): If personality equals 19340 to 0xffffffff, print it verbatim. 19341 * tests/personality.c (main): Test it. 19342 19343 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 19344 19345 tests: add personality.test. 19346 * tests/personality.c: New file. 19347 * tests/personality.test: New test. 19348 * tests/Makefile.am (check_PROGRAMS): Add personality. 19349 (TESTS): Add personality.test. 19350 * tests/.gitignore: Add personality. 19351 19352 Enhance personality syscall decoding. 19353 * personality.c (SYS_FUNC(personality)): On entering syscall, 19354 print first argument not as a hex value but as a set of flags. 19355 On exiting syscall, print return code as a set of flags. 19356 * NEWS: Mention this enhancement. 19357 19358 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 19359 19360 Set SYSCALL_NEVER_FAILS flag for personality syscall. 19361 Starting with commit 19362 v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality 19363 syscall never fails to set the personality, but before commit 19364 v2.6.35-rc1-372-g485d527 it still could return an error. 19365 Starting with that commit, personality syscall never returns an error. 19366 19367 * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality 19368 syscall entries. 19369 19370 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 19371 19372 Add personality emulation flags. 19373 * xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE, 19374 FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC, 19375 ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS, 19376 and ADDR_LIMIT_3GB. 19377 19378 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 19379 19380 arc, metag, nios2, or1k, tile: fix build. 19381 Fix build regression introduced by commit 19382 34683e3926d8c2daa368afb805da422ee7043396. 19383 19384 * linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap. 19385 * linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff. 19386 * linux/nios2/syscallent.h: Likewise. 19387 * linux/or1k/syscallent.h: Likewise. 19388 * linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff. 19389 * pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap. 19390 * NEWS: Mention this build fix. 19391 19392 Reported-by: Alexey Brodkin <Alexey.Brodkin (a] synopsys.com> 19393 19394 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 19395 19396 packages: remove acl development library from build dependencies. 19397 Starting with commit v4.9-46-g681452b that removed all references 19398 to acl.h, we no longer use acl development library. 19399 19400 * .travis.yml (addons.apt.packages): Remove libacl1-dev. 19401 * strace.spec (BuildRequires): Remove libacl-devel. 19402 19403 2015-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 19404 19405 packages/x86_64: enable experimental -k option. 19406 * debian/control (Build-Depends) [amd64]: Add libunwind-dev. 19407 * strace.spec (BuildRequires) [x86_64]: Add libunwind-devel. 19408 19409 maint: post-release administrivia. 19410 * NEWS: Add header line for the next release. 19411 19412 2015-12-21 Dmitry V. Levin <ldv (a] altlinux.org> 19413 19414 Prepare for 4.11 release. 19415 * NEWS: Update for 4.11 release. 19416 * debian/changelog: 4.11-1. 19417 * strace.spec: 4.11-1. 19418 19419 2015-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 19420 19421 Sync strace.spec and debian/ with packages. 19422 * debian/changelog: Sync with 4.10-3. 19423 * debian/control: Likewise. 19424 * debian/rules: Likewise. 19425 * strace.spec: Sync with 4.10-3. 19426 19427 .mailmap: add addresses of Kirill A. Shutemov. 19428 * .mailmap: Add both addresses of Kirill A. Shutemov here 19429 to avoid duplications in CREDITS file. 19430 19431 2015-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 19432 19433 NEWS: Prepare for 4.11 release. 19434 19435 2015-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 19436 19437 ia64: wire up mlock2 syscall. 19438 * linux/ia64/syscallent.h [1346]: Add mlock2 entry. 19439 19440 2015-12-17 Dmitry V. Levin <ldv (a] altlinux.org> 19441 19442 Add copyright headers to some files which lack them. 19443 Before this change, all files that exist since 20th century had 19444 copyright headers, while most files that appeared later didn't. This 19445 change fixes the inconsistency by adding missing copyright headers. 19446 19447 It doesn't mean that copyright headers became maintained. In my view, 19448 git history provides much better information on this subject and is much 19449 more accurate than copyright headers. 19450 19451 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 19452 19453 tests/aio.c: include <time.h> 19454 * tests/aio.c: Include <time.h> for struct timespec. 19455 19456 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 19457 19458 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 19459 19460 mpers.sh: switch to DWARF version 2 format for better portability. 19461 * mpers.sh (CFLAGS): Replace -gdwarf-4 with -gdwarf-2. 19462 19463 mpers.awk: add support for DWARF version 2 format. 19464 * mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format. 19465 19466 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 19467 19468 Replace %Ld/%Lu printf format specifiers with %lld/%llu. 19469 As %Ld and %Lu printf format specifiers are not quite portable, 19470 replace them with %lld and %llu, respectively. 19471 19472 * desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu. 19473 * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise. 19474 * times.c (SYS_FUNC(times)): Likewise. 19475 * fcntl.c (print_struct_flock64): Replace %Ld with %lld. 19476 * tests/ftruncate.c (main): Replace %Lu with %llu. 19477 * tests/ftruncate64.c (main): Likewise. 19478 * tests/getdents.c (print_dirent): Likewise. 19479 * tests/llseek.c (main): Likewise. 19480 * tests/lseek.c (main): Likewise. 19481 * tests/truncate.c (main): Likewise. 19482 * tests/truncate64.c (main): Likewise. 19483 * tests/xstatx.c (main): Likewise. 19484 * tests/pselect6.c (main): Replace %Ld with %lld. 19485 * tests/xselect.c(main): Likewise. 19486 19487 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 19488 19489 2015-12-16 Szabolcs Nagy <nsz (a] port70.net> 19490 19491 Fix SYS_FUNC and SEN macros for musl. 19492 The syscall_name argument was subject to macro expansion because 19493 it was passed down to other macros before it was prefixed. 19494 19495 musl libc defines lfs64 names as macros (e.g. fstat64 as fstat) 19496 so SYS_FUNC(fstat64) was expanded to sys_fstat. 19497 19498 This change adds the prefix before the name is passed to other macros, 19499 i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_. 19500 19501 * defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument. 19502 (SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument. 19503 * linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix 19504 to MPERS_FUNC_NAME's argument. 19505 * syscall.c (SEN_NAME): Remove. 19506 (SEN): Replace SEN_NAME call with its definition. Add sys_ prefix 19507 to SYS_FUNC_NAME's argument. 19508 19509 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 19510 19511 tests/times.test: workaround libc bug on x32. 19512 As glibc times wrapper on x32 is known to wrongly truncate and then sign 19513 extend the syscall return value, invoke the syscall directly on x32. 19514 19515 * tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]: 19516 Invoke times syscall using inline asm. 19517 19518 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 19519 19520 mpers.awk: make fillers added to the output structure more predictable. 19521 * mpers.awk (array_seq): New function. 19522 (what_is): Use it for printing filler names. Tweak return types. 19523 * mpers_test.sh: Use a more complicated sample type to test mpers 19524 machinery. 19525 19526 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 19527 19528 Robustify mpers.awk against input containing index loops. 19529 Make mpers.awk check for potential index loops. Such loops should not 19530 normally happen, but mpers.awk will not go into infinite recursion if 19531 they do. 19532 19533 * mpers.awk (enter, leave): New functions. 19534 (what_is): Use them. 19535 19536 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 19537 19538 Robustify mpers.awk against invalid input. 19539 Make mpers.awk check that accessed elements of the main array that 19540 are expected to have non-empty values really meet this requirement. 19541 19542 * mpers.awk (array_get): New function. 19543 (what_is, END): Use it. 19544 * mpers_test.sh: Use a more complicated type to test mpers machinery. 19545 19546 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 19547 19548 2015-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 19549 19550 Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN. 19551 * defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG. 19552 * configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove. 19553 * m4/long_long.m4: Remove. 19554 19555 2015-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 19556 19557 Remove unused parser of xmknod syscall. 19558 The last reference to this parser was removed by commit 19559 v4.10-45-gdf4dd8b. 19560 19561 * mknod.c [SPARC || SPARC64] (SYS_FUNC(xmknod)): Remove. 19562 19563 2015-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 19564 19565 tests/restart_syscall: add a workaround for old arm kernels. 19566 As arm kernels used to overwrite ARM_r0 with -EINTR after 19567 ERESTART_RESTARTBLOCK, update regexp to workaround this. 19568 19569 * tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid 19570 alternative value for the first argument of restarted nanosleep syscall. 19571 19572 2015-12-12 Dmitry V. Levin <ldv (a] altlinux.org> 19573 19574 tests/.gitignore: add ksysent.h. 19575 tests/ksysent.h is a generated file listed in CLEANFILES. 19576 This change complements commit v4.10-566-gbab4ef4. 19577 19578 * tests/.gitignore: Add ksysent.h. 19579 19580 2015-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 19581 19582 aarch64: make arm registers unsigned. 19583 Follow the x86_64 example and define registers in arm_pt_regs 19584 as unsigned, to avoid potential sign extension bugs. 19585 19586 This also fixes --enable-gcc-Werror build. 19587 19588 * linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type 19589 from int to uint32_t. 19590 19591 Reported-by: Sergey Bolshakov <sbolshakov (a] altlinux.org> 19592 19593 2015-12-10 Dmitry V. Levin <ldv (a] altlinux.org> 19594 19595 tests: add ksysent.test. 19596 Check that syscall names and numbers defined in syscallent files 19597 match kernel __NR_* constants defined by <asm/unistd.h>. 19598 19599 Tested on various platforms, including the following combinations 19600 of architectures and kernel headers: 19601 19602 x86_64: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.12, 3.11, 19603 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel 19604 i386: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.11, 19605 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel 19606 aarch64: 4.4-rc 19607 alpha: 4.3 19608 arm eabi: 4.4-rc, 4.2, 4.1 19609 hppa: 3.18 19610 ia64: 3.18 19611 mips o32: 4.1 19612 ppc: 3.18 19613 ppc64: 3.10-rhel, 2.6.32-rhel 19614 s390: 3.18 19615 s390x: 3.18 19616 sparc: 4.1 19617 sparc: 3.18 19618 x32: 3.19 19619 19620 The only platform which is known at this moment to fail the test 19621 is CentOS-5 provided by OBS. On x86_64 instance it fails with 19622 error: "prlimit64" syscall #300 is "fanotify_init" in syscallent.h 19623 and on i586 it similarly fails with 19624 error: "prlimit64" syscall #338 is "fanotify_init" in syscallent.h 19625 So this is a real platform bug that is not likely to be worked around 19626 on the strace side. 19627 19628 * tests/ksysent.c: New file. 19629 * tests/ksysent.sed: Likewise. 19630 * tests/ksysent.test: New test. 19631 * tests/Makefile.am (AM_CPPFLAGS): Add -I$(builddir). 19632 (check_PROGRAMS): Add ksysent. 19633 (TESTS): Add ksysent.test. 19634 (EXTRA_DIST): Add ksysent.sed. 19635 (ksysent.h): New rule. 19636 (BUILT_SOURCES, CLEANFILES): Add ksysent.h. 19637 * tests/.gitignore: Add ksysent. 19638 19639 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 19640 19641 Document that syscall names match kernel __NR_* constants. 19642 * strace.1: Note syscall naming difference between architectures 19643 and the rule of choosing the right syscall name in each case. 19644 19645 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 19646 19647 ia64: print all ia32 syscalls using printargs. 19648 Printing of ia32 syscalls on ia64 must have been broken for a long time. 19649 Do not pretend that it works, print ia32 syscalls using printargs 19650 instead. 19651 19652 * linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros. 19653 Stop including"../dummy.h". Include "../i386/syscallent.h" with 19654 SYS_FUNC_NAME macro temporarily redirected to printargs. 19655 19656 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 19657 19658 Fix build on architectures for which arch_sigreturn is not implemented. 19659 This complements commit 527b42ff8da3f52fa7c48eb766b2b57fb0f0b977. 19660 19661 * linux/arch_sigreturn.c (arch_sigreturn): Define. 19662 19663 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 19664 19665 aarch64: swap 64-bit and 32-bit personalities. 19666 Let native 64-bit personality be personality 0, and 32-bit personality 19667 be personality 1, to follow the traditional layout used for other 19668 architectures. 19669 19670 * defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and 19671 PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY. 19672 [AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*. 19673 * file.c [AARCH64 || defined X86_64 || defined X32]: Define 19674 STAT32_PERSONALITY for AARCH64 as well. 19675 * syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES. 19676 * linux/aarch64/errnoent1.h: Adjust comment. 19677 * linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check. 19678 * linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise. 19679 * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise. 19680 * linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality 19681 invocations. 19682 * linux/aarch64/ioctls_arch0.h: Swap with ... 19683 * linux/aarch64/ioctls_arch1.h: ... this file. 19684 * linux/aarch64/ioctls_inc0.h: Swap with ... 19685 * linux/aarch64/ioctls_inc1.h: ... this file. 19686 * linux/aarch64/syscallent.h: Swap with ... 19687 * linux/aarch64/syscallent1.h: ... this file. 19688 19689 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19690 19691 mips: fix fadvise64 syscall entries. 19692 * linux/mips/syscallent-n32.h [6216]: Change syscall handler 19693 from fadvise64 to fadvise64_64. 19694 * linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64" 19695 to "fadvise64" 19696 * linux/mips/syscallent-o32.h [4254]: Likewise. 19697 19698 xtensa: wire up syncfs syscall. 19699 * linux/xtensa/syscallent.h [179]: Add syncfs entry. 19700 19701 sh, sh64: fix syscall entries. 19702 * linux/sh/syscallent.h [322]: Fix timerfd_create entry. 19703 * linux/sh64/syscallent.h [350]: Likewise. 19704 [0]: Fix restart_syscall entry. 19705 19706 powerpc, powerpc64: wire up mlock2 syscall. 19707 * linux/powerpc/syscallent.h [378]: Add mlock2 entry. 19708 * linux/powerpc64/syscallent.h: Likewise. 19709 19710 hppa: fix syscall entries. 19711 * linux/hppa/syscallent.h: Swap [343] and [344] entries. 19712 19713 avr32: update syscall entries. 19714 * linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall. 19715 [284 ... 320]: New entries. 19716 19717 m68k: fix syscall names. 19718 * linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32" 19719 to "atomic_cmpxchg_32". 19720 19721 sparc: update syscall names. 19722 * linux/sparc/syscallent.h [160]: Rename "sched_setaffinity" 19723 to "sched_set_affinity". 19724 [161]: Rename "sched_getaffinity" to "sched_get_affinity". 19725 19726 powerpc, powerpc64: update syscall names. 19727 * linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer". 19728 [225]: Rename "tux" to "tuxcall". 19729 [256]: Rename "debug_setcontext" to "sys_debug_setcontext". 19730 * linux/powerpc64/syscallent.h: Likewise. 19731 19732 alpha: update syscall entries. 19733 * linux/alpha/syscallent.h [224 ... 228]: Add stub entries. 19734 [100]: Rename "osf_getpriority" to "getpriority". 19735 [255]: Rename "osf_subsysinfo" to "osf_subsys_info". 19736 [303]: Rename "adjtimex32" to "old_adjtimex". 19737 [319]: Rename "sysctl" to "_sysctl". 19738 [320]: Remove. 19739 19740 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19741 19742 Fix mmap syscall entries. 19743 Change syscall names to match kernel __NR_* constants. 19744 19745 * linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2". 19746 * linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap". 19747 * linux/i386/syscallent.h: Likewise. 19748 * linux/m68k/syscallent.h: Likewise. 19749 * linux/microblaze/syscallent.h: Likewise. 19750 * linux/sh/syscallent.h: Likewise. 19751 * linux/sh64/syscallent.h: Likewise. 19752 * tests/mmap.c (main): Remove old_mmap from expected output. 19753 * tests/mmap.test: Remove old_mmap from the list of mmap syscalls. 19754 19755 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19756 19757 Fix select and _newselect syscall entries. 19758 Change syscall names to match kernel __NR_* constants. 19759 This reverts commit ddcf54969d253582ab2cfdcab8ede9cdae3fb171. 19760 19761 * linux/arm/syscallent.h [82]: Rename "oldselect" to "select". 19762 [142]: Rename "select" to "_newselect". 19763 * linux/bfin/syscallent.h: Likewise. 19764 * linux/i386/syscallent.h: Likewise. 19765 * linux/m68k/syscallent.h: Likewise. 19766 * linux/microblaze/syscallent.h: Likewise. 19767 * linux/powerpc/syscallent.h [82]: Likewise. 19768 * linux/powerpc64/syscallent.h: Likewise. 19769 * linux/sh/syscallent.h: Likewise. 19770 * linux/sh64/syscallent.h: Likewise. 19771 * linux/hppa/syscallent.h [142]: Rename "select" to "_newselect". 19772 * linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect". 19773 * linux/mips/syscallent-n64.h [5022]: Likewise. 19774 * linux/mips/syscallent-o32.h [4142]: Likewise. 19775 * linux/s390/syscallent.h [142]: Rename "select" to "_newselect". 19776 * linux/sparc/syscallent.h [230]: Rename "select" to "_newselect". 19777 * tests/oldselect.test: Rename oldselect to select. Convert 19778 from match_grep to match_diff. 19779 * tests/oldselect.expected: Likewise. 19780 * xselect.c: New file, based on select.c. 19781 * tests/_newselect.c: New file. 19782 * tests/select.c: Replace with a wrapper around xselect.c. 19783 * tests/select.test: Parametrize. 19784 * tests/_newselect.test: New test. 19785 * tests/Makefile.am (check_PROGRAMS): Add _newselect. 19786 (TESTS): Add _newselect.test. 19787 (EXTRA_DIST): Add xselect.c. 19788 * tests/.gitignore: Add _newselect. 19789 19790 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19791 19792 Fix exit syscall entries. 19793 Change syscall names to match kernel __NR_* constants. 19794 19795 * linux/avr32/syscallent.h [1]: Rename "_exit" to "exit". 19796 * linux/bfin/syscallent.h: Likewise. 19797 * linux/i386/syscallent.h: Likewise. 19798 * linux/m68k/syscallent.h: Likewise. 19799 * linux/microblaze/syscallent.h: Likewise. 19800 * linux/sh/syscallent.h: Likewise. 19801 * linux/sh64/syscallent.h: Likewise. 19802 * linux/x32/syscallent.h [60]: Rename "_exit" to "exit". 19803 * linux/x86_64/syscallent.h: Likewise. 19804 19805 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19806 19807 Fix pread64 and pwrite64 syscall entries. 19808 Change syscall names to match kernel __NR_* constants. 19809 19810 * linux/alpha/syscallent.h [349]: Rename "pread" to "pread64". 19811 [350]: Rename "pwrite" to "pwrite64". 19812 * linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64". 19813 [1149]: Rename "pwrite" to "pwrite64". 19814 * linux/sh/syscallent.h [180]: Rename "pread" to "pread64". 19815 [181]: Rename "pwrite" to "pwrite64". 19816 * linux/sh64/syscallent.h: Likewise. 19817 * linux/x32/syscallent.h [17]: Rename "pread" to "pread64". 19818 [18]: Rename "pwrite" to "pwrite64". 19819 * linux/x86_64/syscallent.h: Likewise. 19820 19821 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19822 19823 tests: sort the list of tests. 19824 * tests/Makefile.am (TESTS): Sort the list of regular tests. 19825 * tests/.gitignore: Sort. 19826 19827 ia64: fix remap_file_pages syscall entry. 19828 * linux/ia64/syscallent.h (1125): Set to remap_file_pages. 19829 19830 bfin, i386: remove sysentry for nonexistent security syscall. 19831 * linux/bfin/syscallent.h (223): Remove. 19832 * linux/i386/syscallent.h: Likewise. 19833 19834 build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS. 19835 * tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS, 19836 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19837 (fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS, 19838 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19839 (ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS, 19840 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19841 (lstat64_CFLAGS): Rename to lstat64_CPPFLAGS, 19842 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19843 (mmap64_CFLAGS): Rename to mmap64_CPPFLAGS, 19844 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19845 (newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS, 19846 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19847 (stat64_CFLAGS): Rename to stat64_CPPFLAGS, 19848 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19849 (statfs_CFLAGS): Rename to statfs_CPPFLAGS, 19850 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19851 (truncate64_CFLAGS): Rename to truncate64_CPPFLAGS, 19852 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19853 (uio_CFLAGS): Rename to uio_CPPFLAGS, 19854 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 19855 19856 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19857 19858 Move x32 <asm/stat.h> replacement to x32 specific directory. 19859 As tests-m*32/Makefile.am files now refer to proper arch specific 19860 directories, it's possible to relocate x32 <asm/stat.h> replacement 19861 to its arch specific directory. 19862 19863 * linux/x86_64/asm_stat.h: Move ... 19864 * linux/x32/asm_stat.h: ... here, remove x32 guard. 19865 * Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h. 19866 19867 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 19868 19869 build: set arch specific -m switches in tests-m*32/Makefile.am files properly 19870 * tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables. 19871 (AM_CPPFLAGS): Use ARCH_MFLAGS. 19872 * bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am, 19873 add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS. 19874 19875 build: initialize ARCH variable in tests-m*32/Makefile.am files properly 19876 * configure.ac (arch_m32): Set to sparc on sparc64, powerpc on 19877 powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases. 19878 (arch_mx32): Set to x32 on x86_64, $arch in other cases. 19879 (AC_SUBST): Add arch_m32 and arch_mx32. 19880 * bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am. 19881 Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am. 19882 19883 2015-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 19884 19885 tests: add umount.test and umount2.test. 19886 * tests/umount.c: New file. 19887 * tests/umount2.c: Likewise. 19888 * tests/umount.test: New test. 19889 * tests/umount2.test: Likewise. 19890 * tests/Makefile.am (check_PROGRAMS): Add umount and umount2. 19891 (TESTS): Add umount.test and umount2.test. 19892 * tests/.gitignore: Add umount and umount2. 19893 19894 avr32: fix umount2 syscall entry. 19895 * linux/avr32/syscallent.h: Rename umount to umount2. 19896 19897 Update umount2 flags. 19898 * umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ... 19899 * xlat/umount_flags.in: ... here. Add UMOUNT_NOFOLLOW. 19900 19901 2015-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 19902 19903 Print the first argument of umount2 syscall as a path. 19904 * umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr. 19905 19906 This fixes Debian bug #785050. 19907 19908 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 19909 19910 prctl: add PR_CAP_AMBIENT parser. 19911 * xlat/pr_cap_ambient.in: New file. 19912 * prctl.c: Include "xlat/pr_cap_ambient.h". 19913 (SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT. 19914 19915 prctl: finish decoding of several commands on entering syscall. 19916 * prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of 19917 PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, 19918 PR_GET_TIMING, and PR_CAPBSET_READ commands. 19919 19920 Fix build on systems that lack EM_FRV definition. 19921 * xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check. 19922 19923 times.test: workaround buggy libc. 19924 * tests/times.c: Include <sys/syscall.h>. 19925 (main): On systems where user's and kernel's long types are the same, 19926 prefer direct times syscall over libc's times function because 19927 the latter is more prone to return value truncation. 19928 19929 times.test: reduce cpu time consumption, increase struct tms diversity. 19930 * tests/times.c (main): Reduce cpu time consumption fourfold, 19931 make the parent process consume less cpu time than the child process 19932 so that members of the structure returned by times syscall would be 19933 more likely to contain different values. 19934 19935 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 19936 19937 mips n32, x32: fix printing of times syscall return value. 19938 As times syscall returns kernel's long value, it has to be printed as 19939 RVAL_LUDECIMAL on systems where long type is less than kernel's long. 19940 19941 * times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]: 19942 Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL. 19943 19944 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 19945 19946 unix-yy.test: fix portability issue. 19947 * tests/unix-yy-connect.awk (r_close_listen): Quote square brackets 19948 that are not part of a bracket expression. 19949 19950 inet-cmsg.test: skip the test when the network is not functional. 19951 * tests/inet-cmsg.c (main): Return 77 if inet datagram socket 19952 cannot be bound to INADDR_LOOPBACK. 19953 19954 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 19955 19956 fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser 19957 As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands 19958 in fcntl64 syscall only, do not parse their structures in fcntl parser. 19959 19960 * xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ... 19961 * xlat/fcntl64cmds.in: ... here. 19962 * fcntl.c: Include "xlat/fcntl64cmds.h". 19963 (print_fcntl): Move printing of first two syscall arguments 19964 and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ... 19965 (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here. 19966 * tests/fcntl.c: New file, based on struct_flock.c. 19967 * tests/fcntl64.c: Likewise. 19968 * tests/struct_flock.c (test_flock_einval, create_sample): New functions. 19969 (test_flock): Use test_flock_einval. 19970 (test_flock64, main): Remove. 19971 * tests/fcntl.test: New test. 19972 * tests/fcntl64.test: Likewise. 19973 * tests/struct_flock.test: Remove. 19974 * tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64, 19975 remove struct_flock. 19976 (TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test. 19977 (EXTRA_DIST) Add struct_flock.c. 19978 * tests/.gitignore: Add fcntl and fcntl64, remove struct_flock. 19979 19980 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 19981 19982 print_fcntl: finish with unrecognized commands on entering syscall. 19983 * fcntl.c (print_fcntl): Merge two switch statements. 19984 19985 2015-12-04 Elvira Khabirova <lineprinter0 (a] gmail.com> 19986 19987 fcntl: create a separate parser for fcntl64 syscall. 19988 * fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl). 19989 (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it. 19990 * linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64). 19991 * linux/arm/syscallent.h: Likewise. 19992 * linux/avr32/syscallent.h: Likewise. 19993 * linux/bfin/syscallent.h: Likewise. 19994 * linux/hppa/syscallent.h: Likewise. 19995 * linux/i386/syscallent.h: Likewise. 19996 * linux/m68k/syscallent.h: Likewise. 19997 * linux/microblaze/syscallent.h: Likewise. 19998 * linux/mips/syscallent-n32.h: Likewise. 19999 * linux/mips/syscallent-o32.h: Likewise. 20000 * linux/powerpc/syscallent.h: Likewise. 20001 * linux/s390/syscallent.h: Likewise. 20002 * linux/sh/syscallent.h: Likewise. 20003 * linux/sh64/syscallent.h: Likewise. 20004 * linux/sparc/syscallent.h: Likewise. 20005 * linux/xtensa/syscallent.h: Likewise. 20006 20007 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 20008 20009 travis-ci: add build matrix. 20010 20011 tests: replace old stat tests with stat.test and stat64.test. 20012 * tests/stat.c: Replace with a wrapper around lstatx.c 20013 * tests/stat.test: Replace with a wrapper around statx.sh. 20014 * tests/stat32-v.test: Remove. 20015 * tests/stat32.c: Remove. 20016 * tests/stat64-v.test: Remove. 20017 * tests/stat64.c: New file. 20018 * tests/stat64.test: New test. 20019 * tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64. 20020 (stat_CFLAGS): Rename to stat64_CFLAGS. 20021 (TESTS): Replace stat32-v.test and stat64-v.test with stat64.test. 20022 * tests/.gitignore: Replace stat32 with stat64. 20023 20024 tests: add lstat.test and lstat64.test. 20025 * tests/lstat.c: New file. 20026 * tests/lstat64.c: Likewise. 20027 * tests/lstatx.c: Likewise. 20028 * tests/lstat.test: New test. 20029 * tests/lstat64.test: Likewise. 20030 * tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64. 20031 (lstat64_CFLAGS): Define. 20032 (TESTS): Add lstat.test and lstat64.test. 20033 (EXTRA_DIST): Add lstatx.c. 20034 * tests/.gitignore: Add lstat and lstat64. 20035 20036 tests: add fstat.test and fstat64.test. 20037 * tests/fstat.c: New file. 20038 * tests/fstat64.c: Likewise. 20039 * tests/fstatx.c: Likewise. 20040 * tests/fstat.test: New test. 20041 * tests/fstat64.test: Likewise. 20042 * tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64. 20043 (fstat64_CFLAGS): Define. 20044 (TESTS): Add fstat.test and fstat64.test. 20045 (EXTRA_DIST): Add fstatx.c. 20046 * tests/.gitignore: Add fstat and fstat64. 20047 20048 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 20049 20050 tests: prepare for detailed testing of stat family syscalls. 20051 Parametrize code from fstatat.c to support <asm/stat.h> 20052 as an alternative to <sys/stat.h> and move it to a separate file. 20053 20054 * tests/statx.sh: New file, based on fstatat64.test. 20055 * tests/fstatat64.test: Use it. 20056 * tests/newfstatat.test: Likewise. 20057 * tests/xstatx.c: New file, based on fstatat.c. 20058 * tests/fstatat.c: Use it. 20059 * tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c. 20060 * tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME. 20061 * tests/newfstatat.c: Likewise. 20062 20063 2015-12-04 Gabriel Laskar <gabriel (a] lse.epita.fr> 20064 20065 ioctl: allow to stop decoding number. 20066 For some ioctls, like from drm, the identification of the correct ioctl 20067 is done by custom code. Specifying IOCTL_NUMBER_STOP_LOOKUP on 20068 return of ioctl_decode_command_number() disables further calls to 20069 ioctl_lookup(). 20070 20071 * defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED, 20072 IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state 20073 decoding. 20074 * ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when 20075 ioctl_decode_command_number() returns a value with 20076 IOCTL_NUMBER_STOP_LOOKUP flag is set. 20077 20078 Suggested-by: Patrik Jakobsson <patrik.r.jakobsson (a] gmail.com> 20079 20080 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 20081 20082 tests: skip restart_syscall.test on x32. 20083 The syscall number of restart_syscall returned by the kernel in case 20084 of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see 20085 https://lkml.org/lkml/2015/11/30/790 20086 20087 Until that improves, skip the test on x32. 20088 20089 * tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77. 20090 20091 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 20092 20093 x32: fix decoding of i386 personality lseek syscall. 20094 On x32, tcp->ext_arg is not initialized for i386 personality, 20095 so tcp->u_arg has to be used instead. 20096 20097 * lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case. 20098 20099 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 20100 20101 x86_64, x32: add a replacement for <asm/stat.h> 20102 Some old kernel headers, Ubuntu 14.04 in particular, provide 20103 <asm/stat.h> editions that are completely wrong for x32. 20104 Workaround this issue by providing a replacement. 20105 20106 * linux/x86_64/asm_stat.h: New file. 20107 * linux/x32/asm_stat.h: Likewise. 20108 * Makefile.am (strace_SOURCES): Add them. 20109 20110 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 20111 20112 Add a wrapper around <asm/stat.h> 20113 * linux/asm_stat.h: New file. 20114 * Makefile.am (strace_SOURCES): Add it. 20115 * file.c: Use it. 20116 20117 kernel_types.h: protect from double inclusion. 20118 * kernel_types.h: Add #include guard. 20119 20120 2015-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 20121 20122 fstatat64.test: lift /proc requirement. 20123 While -P option needs /proc to match descriptors, it does not use 20124 /proc to match pathnames. As this test does not need descriptor 20125 match, the /proc requirement can be safely lifted. 20126 20127 * tests/fstatat64.test: Lift /proc/self/fd/ requirement. 20128 20129 2015-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 20130 20131 tests: add fstatat64.test and newfstatat.test. 20132 * configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens. 20133 * tests/fstatat.c: New file. 20134 * tests/fstatat64.c: Likewise. 20135 * tests/newfstatat.c: Likewise. 20136 * tests/fstatat64.test: New test. 20137 * tests/newfstatat.test: Likewise. 20138 * tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat. 20139 (fstatat64_CFLAGS, newstatat_CFLAGS): Define. 20140 (TESTS): Add fstatat64.test and newfstatat.test. 20141 (EXTRA_DIST): Add fstatat.c. 20142 * tests/.gitignore: Add fstatat64 and newfstatat. 20143 20144 2015-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 20145 20146 alpha, ppc, sh, sh64: fix fstatat64 syscall entries. 20147 * linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64. 20148 * linux/powerpc/syscallent.h: Likewise. 20149 * linux/sh/syscallent.h: Likewise. 20150 * linux/sh64/syscallent.h: Likewise. 20151 20152 ppc64: clone syscallent.h from ppc. 20153 * linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h 20154 with entries for numbers 192..197, 204, 226, and 254 unassigned. 20155 20156 tests: add lseek.test and llseek.test. 20157 * tests/llseek.c: New file. 20158 * tests/lseek.c: Likewise. 20159 * tests/llseek.test: New test. 20160 * tests/lseek.test: Likewise. 20161 * tests/Makefile.am (check_PROGRAMS): Add llseek and lseek. 20162 (TESTS): Add llseek.test and lseek.test. 20163 * tests/.gitignore: Add llseek and lseek. 20164 20165 tests: add ftruncate64.test and truncate64.test. 20166 * tests/ftruncate64.c: New file. 20167 * tests/truncate64.c: Likewise. 20168 * tests/ftruncate64.test: New test. 20169 * tests/truncate64.test: Likewise. 20170 * tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64. 20171 (ftruncate64_CFLAGS, truncate64_CFLAGS): Define. 20172 (TESTS): Add ftruncate64.test and truncate64.test. 20173 * tests/.gitignore: Add ftruncate64 and truncate64. 20174 20175 tests: add ftruncate.test and truncate.test. 20176 * tests/ftruncate.c: New file. 20177 * tests/truncate.c: Likewise. 20178 * tests/ftruncate.test: New test. 20179 * tests/truncate.test: Likewise. 20180 * tests/Makefile.am (check_PROGRAMS): Add ftruncate and truncate. 20181 (TESTS): Add ftruncate.test and truncate.test. 20182 * tests/.gitignore: Add ftruncate and truncate. 20183 20184 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20185 20186 build: robustify linux/fcntl.h check. 20187 * configure.ac (AC_CHECK_TYPES): Support older linux kernel headers 20188 by including <sys/types.h> before <linux/fcntl.h>. 20189 20190 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20191 20192 syscall.c: move inclusion of arch specific files to the end of file. 20193 Move inclusion of arch specific files that define static functions to 20194 the end of syscall.c. 20195 20196 * syscall.c (get_syscall_result_regs, get_error, getregs_old): 20197 New forward declarations. 20198 (arch_get_scno): Move forward. 20199 Move inclusion of "get_scno.c", "get_syscall_args.c", 20200 "get_syscall_result.c", "get_error.c", and "getregs_old.c" 20201 to the end of file. 20202 20203 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20204 20205 x86_64: change getregs_old to forward ptrace return code. 20206 * linux/x86_64/getregs_old.c (getregs_old): Change to return ptrace 20207 return code. 20208 * syscall.c (get_regs) [ARCH_REGS_FOR_GETREGSET && X86_64]: Use 20209 getregs_old return code. 20210 20211 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20212 20213 Cleanup print_pc. 20214 Apparently, there are only two types of instruction pointer printers 20215 depending on the architecture: those that print a register that was 20216 fetched earlier, and those that fetch a register themselves using upeek. 20217 With this change, architectures of the first type have ARCH_PC_REG 20218 defined in their arch_regs.c file, architectures of the first type 20219 have ARCH_PC_PEEK_ADDR defined there, and the common code in syscall.c 20220 uses these macros to print the instruction pointer. 20221 20222 * Makefile.am (EXTRA_DIST): Remove linux/*/print_pc.c. 20223 * linux/*/print_pc.c: Remove. 20224 * linux/aarch64/arch_regs.c(ARCH_PC_REG): Define macro. 20225 * linux/arc/arch_regs.c(ARCH_PC_REG): Likewise. 20226 * linux/arm/arch_regs.c(ARCH_PC_REG): Likewise. 20227 * linux/avr32/arch_regs.c(ARCH_PC_REG): Likewise. 20228 * linux/i386/arch_regs.c(ARCH_PC_REG): Likewise. 20229 * linux/ia64/arch_regs.c(ARCH_PC_REG): Likewise. 20230 * linux/metag/arch_regs.c(ARCH_PC_REG): Likewise. 20231 * linux/mips/arch_regs.c(ARCH_PC_REG): Likewise. 20232 * linux/nios2/arch_regs.c(ARCH_PC_REG): Likewise. 20233 * linux/or1k/arch_regs.c(ARCH_PC_REG): Likewise. 20234 * linux/powerpc64/arch_regs.c(ARCH_PC_REG): Likewise. 20235 * linux/powerpc/arch_regs.c(ARCH_PC_REG): Likewise. 20236 * linux/s390/arch_regs.c(ARCH_PC_REG): Likewise. 20237 * linux/s390x/arch_regs.c(ARCH_PC_REG): Likewise. 20238 * linux/sparc64/arch_regs.c(ARCH_PC_REG): Likewise. 20239 * linux/sparc/arch_regs.c(ARCH_PC_REG): Likewise. 20240 * linux/tile/arch_regs.c(ARCH_PC_REG): Likewise. 20241 * linux/x32/arch_regs.c(ARCH_PC_REG): Likewise. 20242 * linux/x86_64/arch_regs.c(ARCH_PC_REG): Likewise. 20243 * linux/alpha/arch_regs.c(ARCH_PC_PEEK_ADDR): Define macro. 20244 * linux/bfin/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20245 * linux/crisv10/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20246 * linux/crisv32/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20247 * linux/hppa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20248 * linux/m68k/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20249 * linux/microblaze/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20250 * linux/sh64/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20251 * linux/sh/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20252 * linux/xtensa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 20253 * syscall.c (print_pc): Stop including "print_pc.c". 20254 Use ARCH_PC_REG or ARCH_PC_PEEK_ADDR. 20255 20256 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20257 20258 cleanup: make get_scno.c files more readable. 20259 Make get_scno.c files more self-contained. While they are still 20260 being included by syscall.c, the latter no longer provides 20261 a function framework for them. 20262 20263 * linux/aarch64/get_scno.c (arch_get_scno): Define. 20264 * linux/alpha/get_scno.c: Likewise. 20265 * linux/arc/get_scno.c: Likewise. 20266 * linux/arm/get_scno.c: Likewise. 20267 * linux/avr32/get_scno.c: Likewise. 20268 * linux/bfin/get_scno.c: Likewise. 20269 * linux/crisv10/get_scno.c: Likewise. 20270 * linux/hppa/get_scno.c: Likewise. 20271 * linux/i386/get_scno.c: Likewise. 20272 * linux/ia64/get_scno.c: Likewise. 20273 * linux/m68k/get_scno.c: Likewise. 20274 * linux/metag/get_scno.c: Likewise. 20275 * linux/microblaze/get_scno.c: Likewise. 20276 * linux/mips/get_scno.c: Likewise. 20277 * linux/nios2/get_scno.c: Likewise. 20278 * linux/or1k/get_scno.c: Likewise. 20279 * linux/powerpc/get_scno.c: Likewise. 20280 * linux/powerpc64/get_scno.c: Likewise. 20281 * linux/s390/get_scno.c: Likewise. 20282 * linux/sh/get_scno.c: Likewise. 20283 * linux/sh64/get_scno.c: Likewise. 20284 * linux/sparc/get_scno.c: Likewise. 20285 * linux/sparc64/get_scno.c: Likewise. 20286 * linux/tile/get_scno.c: Likewise. 20287 * linux/x86_64/get_scno.c: Likewise. 20288 * linux/xtensa/get_scno.c: Likewise. 20289 * syscall.c (arch_get_scno): New declaration. 20290 Include "get_scno.c" in file scope. 20291 (get_scno): Use arch_get_scno. 20292 20293 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 20294 20295 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20296 20297 cleanup: make get_syscall_args.c files more readable. 20298 Make get_syscall_args.c files more self-contained. While they are 20299 still being included by syscall.c, the latter no longer defines 20300 get_syscall_args function. 20301 20302 * linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c" 20303 with get_syscall_args temporarily defined to arm_get_syscall_args. 20304 (get_syscall_args): Define. 20305 * linux/alpha/get_syscall_args.c (get_syscall_args): Define. 20306 * linux/arc/get_syscall_args.c: Likewise. 20307 * linux/arm/get_syscall_args.c: Likewise. 20308 * linux/avr32/get_syscall_args.c: Likewise. 20309 * linux/bfin/get_syscall_args.c: Likewise. 20310 * linux/crisv10/get_syscall_args.c: Likewise. 20311 * linux/hppa/get_syscall_args.c: Likewise. 20312 * linux/i386/get_syscall_args.c: Likewise. 20313 * linux/ia64/get_syscall_args.c: Likewise. 20314 * linux/m68k/get_syscall_args.c: Likewise. 20315 * linux/metag/get_syscall_args.c: Likewise. 20316 * linux/microblaze/get_syscall_args.c: Likewise. 20317 * linux/mips/get_syscall_args.c: Likewise. 20318 * linux/nios2/get_syscall_args.c: Likewise. 20319 * linux/or1k/get_syscall_args.c: Likewise. 20320 * linux/powerpc/get_syscall_args.c: Likewise. 20321 * linux/s390/get_syscall_args.c: Likewise. 20322 * linux/sh/get_syscall_args.c: Likewise. 20323 * linux/sh64/get_syscall_args.c: Likewise. 20324 * linux/sparc/get_syscall_args.c: Likewise. 20325 * linux/tile/get_syscall_args.c: Likewise. 20326 * linux/x86_64/get_syscall_args.c: Likewise. 20327 * linux/xtensa/get_syscall_args.c: Likewise. 20328 * syscall.c (get_syscall_args): Remove. 20329 Include "get_syscall_args.c" in file scope. 20330 20331 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 20332 20333 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 20334 20335 cleanup: make get_syscall_result.c files more readable. 20336 Make get_syscall_result.c files more self-contained. While they are 20337 still being included by syscall.c, the latter no longer provides 20338 a function framework for them. 20339 20340 * linux/alpha/get_syscall_result.c (get_syscall_result_regs): Define. 20341 * linux/bfin/get_syscall_result.c: Likewise. 20342 * linux/crisv10/get_syscall_result.c: Likewise. 20343 * linux/hppa/get_syscall_result.c: Likewise. 20344 * linux/m68k/get_syscall_result.c: Likewise. 20345 * linux/microblaze/get_syscall_result.c: Likewise. 20346 * linux/sh/get_syscall_result.c: Likewise. 20347 * linux/sh64/get_syscall_result.c: Likewise. 20348 * linux/xtensa/get_syscall_result.c: Likewise. 20349 * syscall.c [!ARCH_REGS_FOR_GETREGSET && !ARCH_REGS_FOR_GETREGS]: 20350 Define USE_GET_SYSCALL_RESULT_REGS macro. 20351 [USE_GET_SYSCALL_RESULT_REGS]: Include "get_syscall_result.c". 20352 (get_syscall_result) [USE_GET_SYSCALL_RESULT_REGS]: Stop including 20353 "get_syscall_result.c". Call get_syscall_result_regs. 20354 20355 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 20356 20357 2015-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 20358 20359 cleanup: make get_error.c files more readable. 20360 Make get_error.c files more self-sustained. While they are still being 20361 included by syscall.c, the latter no longer defines get_error function. 20362 20363 * linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error 20364 temporarily defined to arm_get_error. 20365 (get_error): Define. 20366 * linux/alpha/get_error.c (get_error): Define. 20367 * linux/arc/get_error.c: Likewise. 20368 * linux/arm/get_error.c: Likewise. 20369 * linux/avr32/get_error.c: Likewise. 20370 * linux/bfin/get_error.c: Likewise. 20371 * linux/crisv10/get_error.c: Likewise. 20372 * linux/hppa/get_error.c: Likewise. 20373 * linux/i386/get_error.c: Likewise. 20374 * linux/ia64/get_error.c: Likewise. 20375 * linux/m68k/get_error.c: Likewise. 20376 * linux/metag/get_error.c: Likewise. 20377 * linux/microblaze/get_error.c: Likewise. 20378 * linux/mips/get_error.c: Likewise. 20379 * linux/nios2/get_error.c: Likewise. 20380 * linux/or1k/get_error.c: Likewise. 20381 * linux/powerpc/get_error.c: Likewise. 20382 * linux/s390/get_error.c: Likewise. 20383 * linux/sh/get_error.c: Likewise. 20384 * linux/sh64/get_error.c: Likewise. 20385 * linux/sparc/get_error.c: Likewise. 20386 * linux/sparc64/get_error.c: Likewise. 20387 * linux/tile/get_error.c: Likewise. 20388 * linux/x86_64/get_error.c: Likewise. 20389 * linux/xtensa/get_error.c: Likewise. 20390 * syscall.c: Include "get_error.c" in file scope. 20391 (get_error): Remove. Move arch independent code ... 20392 (get_syscall_result): ... here. Update get_error invocation. 20393 20394 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 20395 20396 2015-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 20397 20398 cleanup: make arch_sigreturn.c files more readable. 20399 Make arch_sigreturn.c files more self-sustained. While they are 20400 still being included by sigreturn.c, the latter no longer defines 20401 arch_sigreturn function. 20402 20403 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Define. 20404 * linux/arm/arch_sigreturn.c: Likewise. 20405 * linux/crisv10/arch_sigreturn.c: Likewise. 20406 * linux/i386/arch_sigreturn.c: Likewise. 20407 * linux/ia64/arch_sigreturn.c: Likewise. 20408 * linux/m68k/arch_sigreturn.c: Likewise. 20409 * linux/microblaze/arch_sigreturn.c: Likewise. 20410 * linux/mips/arch_sigreturn.c: Likewise. 20411 * linux/powerpc/arch_sigreturn.c: Likewise. 20412 * linux/s390/arch_sigreturn.c: Likewise. 20413 * linux/sparc/arch_sigreturn.c: Likewise. 20414 * linux/tile/arch_sigreturn.c: Likewise. 20415 * linux/x32/arch_sigreturn.c: Remove code. 20416 Include "x86_64/arch_sigreturn.c". 20417 * linux/x86_64/arch_sigreturn.c: Stop including "x32/arch_sigreturn.c". 20418 Include "i386/arch_sigreturn.c" with arch_sigreturn temporarily defined 20419 to i386_arch_sigreturn. 20420 (arch_sigreturn): Define. Add x32 personality support there. 20421 * sigreturn.c: Remove arch_sigreturn header and footer. 20422 20423 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 20424 20425 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20426 20427 Add initial Travis CI support. 20428 * .travis.yml: New file. 20429 * travis-ci.sh: Likewise. 20430 20431 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 20432 20433 tests: remove temporary files left after two tests. 20434 * tests/net-yy.test: Remove "$LOG"-connect and "$LOG"-accept. 20435 * tests/unix-yy.test: Likewise. 20436 20437 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 20438 20439 tests: skip stat32-v.test on x32. 20440 Explicitly skip 32-bit stat test on x32 even if libc pretends 20441 to support it. 20442 20443 * tests/stat.c (main) [__x86_64__ && __ILP32__]: Skip. 20444 20445 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 20446 20447 tests: fix ipc_msgbuf.test on x32. 20448 * tests/ipc_msgbuf.c: Include "config.h" and "kernel_types.h". 20449 (main): Replace "long" with "kernel_long_t" in struct msgbuf. 20450 20451 x32: fix pselect6 decoding. 20452 * desc.c: Include "kernel_types.h". 20453 (umove_kulong_array_or_printaddr): New function. 20454 (SYS_FUNC(pselect6)): Use it. 20455 20456 x32: fix sigreturn decoding. 20457 * linux/x32/arch_sigreturn.c: Implement x32_rt_sigreturn decoding. 20458 * linux/x86_64/arch_sigreturn.c: Handle (current_personality == 0) 20459 case only. 20460 Include "x32/arch_sigreturn.c" instead of "i386/arch_sigreturn.c". 20461 20462 x32: fix struct dirent decoding. 20463 * kernel_types.h: New file. 20464 * Makefile.am (strace_SOURCES): Add it. 20465 * configure.ac (AC_CHECK_TYPES): Check for __kernel_long_t 20466 and __kernel_ulong_t in <asm/posix_types.h>. 20467 * dirent.c: Stop including <dirent.h>. 20468 (kernel_dirent): Remove. 20469 Include "kernel_types.h". 20470 (print_old_dirent, SYS_FUNC(getdents)): Print variables 20471 of kernel_ulong_t type using %Lu format. 20472 * syscall.c (kernel_long_t, kernel_ulong_t): Remove. 20473 Include "kernel_types.h". 20474 * tests/getdents.c (kernel_dirent): Remove. 20475 Include "kernel_types.h". 20476 (print_dirent): Print variables of kernel_ulong_t type using %Lu format. 20477 20478 2015-11-26 Elvira Khabirova <lineprinter0 (a] gmail.com> 20479 20480 Refer to -h on incorrect usage. 20481 * defs.h (error_msg_and_help): New prototype. 20482 * strace.c (error_msg_and_help): New function. 20483 (error_opt_arg, init): Use it. 20484 (usage): Remove unnecessary arguments. 20485 * count.c: Use the new function. 20486 20487 Rearrange flags descriptions in the usage text. 20488 * strace.c (usage): Rearrange descriptions. 20489 * tests/strace-k.test: Change the option detecting regexp accordingly. 20490 20491 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20492 20493 tests: run in "set -x" mode if VERBOSE variable is non-null. 20494 * tests/init.sh: Enter "set -x" mode if $VERBOSE is non-null. 20495 20496 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20497 20498 tests: fix match_diff usage. 20499 Fix argument order in match_diff invocations: 20500 the first argument has to be actual output, 20501 the second argument has to be expected output. 20502 20503 * tests/aio.test: Swap match_diff arguments. 20504 * tests/clock_nanosleep.test: Likewise. 20505 * tests/clock_xettime.test: Likewise. 20506 * tests/file_handle.test: Likewise. 20507 * tests/getdents.test: Likewise. 20508 * tests/getdents64.test: Likewise. 20509 * tests/getrandom.test: Likewise. 20510 * tests/inet-cmsg.test: Likewise. 20511 * tests/ioctl.test: Likewise. 20512 * tests/membarrier.test: Likewise. 20513 * tests/mlock2.test: Likewise. 20514 * tests/nanosleep.test: Likewise. 20515 * tests/pselect6.test: Likewise. 20516 * tests/readdir.test: Likewise. 20517 * tests/readlink.test: Likewise. 20518 * tests/readlinkat.test: Likewise. 20519 * tests/rt_sigqueueinfo.test: Likewise. 20520 * tests/seccomp.test: Likewise. 20521 * tests/select.test: Likewise. 20522 * tests/sendfile.test: Likewise. 20523 * tests/sendfile64.test: Likewise. 20524 * tests/struct_flock.test: Likewise. 20525 * tests/sysinfo.test: Likewise. 20526 * tests/time.test: Likewise. 20527 * tests/timer_create.test: Likewise. 20528 * tests/timer_xettime.test: Likewise. 20529 * tests/timerfd_xettime.test: Likewise. 20530 * tests/times-fail.test: Likewise. 20531 * tests/times.test: Likewise. 20532 * tests/umovestr2.test: Likewise. 20533 * tests/userfaultfd.test: Likewise. 20534 * tests/utime.test: Likewise. 20535 * tests/utimensat.test: Likewise. 20536 * tests/xet_robust_list.test: Likewise. 20537 * tests/xetitimer.test: Likewise. 20538 * tests/xettimeofday.test: Likewise. 20539 20540 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20541 20542 x86_64: fix x32 personality support in print_llu_from_low_high_val. 20543 x86 is the only personality supported on x86_64 20544 that has 32-bit syscall arguments. 20545 20546 * io.c (print_llu_from_low_high_val) [X86_64]: Fix 20547 current_personality == 2 case. 20548 20549 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20550 20551 x86_64: fix x32 personality support in getllval. 20552 x86 is the only personality supported on x86_64 20553 that has 32-bit syscall arguments. 20554 20555 * util.c (getllval) [X86_64]: Fix current_personality == 2 case. 20556 20557 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20558 20559 tests/file_handle: fix expected output. 20560 * tests/file_handle.c (main): Parametrize handle_type 20561 in open_by_handle_at parser output. 20562 20563 startup_attach: fix compilation warning. 20564 * strace.c (startup_attach): Split single error_msg statement with 20565 variable number of arguments to silence a compilation warning. 20566 20567 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20568 20569 .gitignore: add mpers_xlat.h. 20570 Ignore mpers_xlat.h generated since commit v4.10-454-g5cb45b2. 20571 20572 * .gitignore: Add /mpers_xlat.h. 20573 20574 Reported-by: Elvira Khabirova <lineprinter0 (a] gmail.com> 20575 20576 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20577 20578 tests: add struct_flock.test. 20579 * tests/struct_flock.c: New file. 20580 * tests/struct_flock.test: New test. 20581 * tests/Makefile.am (check_PROGRAMS): Add struct_flock. 20582 (TESTS): Add struct_flock.test. 20583 * tests/.gitignore: Add struct_flock. 20584 20585 Convert parsers of flock structures to new mpers infrastructure. 20586 * fetch_struct_flock.c: New file. 20587 * Makefile.am (strace_SOURCES): Add it. 20588 * fcntl.c (print_struct_flock64): New function. 20589 (printflock64): Use fetch_struct_flock64 and print_struct_flock64. 20590 (printflock): Use fetch_struct_flock and print_struct_flock64. 20591 20592 fcntl.c: implement decoding for all known operations. 20593 * xlat/f_owner_types.in: New file. 20594 * xlat/f_seals.in: Likewise. 20595 * fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h". 20596 (print_f_owner_ex): New function. 20597 (SYS_FUNC(fcntl)): Use it. 20598 Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW, 20599 F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG, 20600 F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG. 20601 20602 fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag. 20603 * fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code 20604 for F_DUPFD and F_DUPFD_CLOEXEC operations. 20605 20606 fcntl.c: remove redundant ifdefs. 20607 * fcntl.c (USE_PRINTFLOCK64): Remove macro. 20608 (printflock64): Define unconditionally. 20609 (SYS_FUNC(fcntl)): Do not check for USE_PRINTFLOCK64, 20610 F_DUPFD_CLOEXEC, F_NOTIFY, F_SETLEASE, and F_GETLEASE macros. 20611 20612 Update F_* constants. 20613 * xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS, 20614 F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK. 20615 Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD, 20616 F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK, 20617 F_RSETLKW, F_SHARE, and F_UNSHARE. 20618 Add default values. 20619 20620 Update LOCK_* constants. 20621 * xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW. 20622 Add default values. 20623 20624 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 20625 20626 fcntl.c: use <linux/fcntl.h> instead of <fcntl.h> 20627 Include <linux/fcntl.h> for proper definitions of F_* constants 20628 and flock structures. 20629 20630 * configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64, 20631 struct __kernel_flock, and struct __kernel_flock64 in <linux/fcntl.h>. 20632 * flock.h: New file. 20633 * Makefile.am (strace_SOURCES): Add it. 20634 * fcntl.c: Include it instead of <fcntl.h>. 20635 (struct flock64): Remove. 20636 (printflock): Use struct_kernel_flock instead of struct flock. 20637 (printflock64): Use struct_kernel_flock64 instead of struct flock64. 20638 20639 2015-11-26 Elvira Khabirova <lineprinter0 (a] gmail.com> 20640 20641 mpers: fix compound types with arbitrary member alignments. 20642 * mpers.sh: Compound types are now represented as packed 20643 with character arrays as explicit fillers inbetween members 20644 and at the end. 20645 20646 2015-11-26 Mike Frysinger <vapier (a] gentoo.org> 20647 20648 Support C libraries without System V shared memory/ipc. 20649 Some systems (like Bionic) omit support for SysV related code. That 20650 means no C library headers for strace to include. Add configure tests 20651 to probe the headers from the kernel and use them when they are 20652 available. 20653 20654 It might make more sense to never rely on the C library's headers as 20655 there is no guarantee or requirement that the structure layout between 20656 apps and the C library match that what is passed to the kernel. 20657 20658 * configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h, 20659 linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h, 20660 sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h. 20661 * ipc_defs.h: Include <sys/ipc.h> or <linux/ipc.h> depending 20662 on what is available. 20663 * ipc_msg.c: Replace <sys/ipc.h> with "ipc_defs.h". 20664 Fallback to <linux/msg.h> when available. 20665 * ipc_msgctl.c: Include <sys/msg.h>, <asm/msgbuf.h>, or <linux/msg.h> 20666 based on what is available. Note missing support for old ipc structs. 20667 * ipc_sem.c: Include <sys/sem.h> or <linux/sem.h> depending 20668 on what is available. Only decode sembuf when available. 20669 * ipc_shm.c: Fallback to <linux/shm.h> when available. 20670 * ipc_shmctl.c: Include <sys/shm.h>, <asm/shmbuf.h>, or <linux/shm.h> 20671 based on what is available. Note missing support for old ipc structs. 20672 * print_mq_attr.c: Fallback to <linux/mqueue.h> when available. 20673 20674 2015-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 20675 20676 CREDITS.in: add Jian Zhen. 20677 Thanks to Jian Zhen for donation of https://github.com/strace/ and 20678 strace.io. 20679 20680 * CREDITS.in: Add Jian Zhen. 20681 20682 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 20683 20684 Fix syscall entries of unimplemented getpmsg and putpmsg syscalls. 20685 * linux/ia64/syscallent.h (getpmsg): Change SEN(printargs) 20686 to SEN(getpmsg). 20687 (putpmsg): Change SEN(printargs) to SEN(putpmsg). 20688 * linux/mips/syscallent-n32.h: Likewise. 20689 * linux/mips/syscallent-n64.h: Likewise. 20690 * linux/mips/syscallent-o32.h: Likewise. 20691 * linux/arm/syscallent.h (getpmsg, putpmsg): Set sys_flags to TN. 20692 * linux/bfin/syscallent.h (getpmsg, putpmsg): Likewise. 20693 * linux/hppa/syscallent.h (getpmsg, putpmsg): Likewise. 20694 * linux/i386/syscallent.h (getpmsg, putpmsg): Likewise. 20695 * linux/m68k/syscallent.h (getpmsg, putpmsg): Likewise. 20696 * linux/microblaze/syscallent.h (getpmsg, putpmsg): Likewise. 20697 * linux/powerpc/syscallent.h (getpmsg, putpmsg): Likewise. 20698 * linux/s390/syscallent.h (getpmsg, putpmsg): Likewise. 20699 * linux/s390x/syscallent.h (getpmsg, putpmsg): Likewise. 20700 * linux/x32/syscallent.h (getpmsg, putpmsg): Likewise. 20701 * linux/x86_64/syscallent.h (getpmsg, putpmsg): Likewise. 20702 20703 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 20704 20705 Remove parsers of getpmsg and putpmsg syscalls. 20706 These system calls are not implemented in the Linux kernel. 20707 20708 * linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated 20709 syscalls. 20710 * Makefile.am (strace_SOURCES): Remove stream.c. 20711 * stream.c: Remove. 20712 * xlat/pmsgflags.in: Remove. 20713 20714 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 20715 20716 Remove parser of query_module syscall. 20717 Since query_module syscall is present only in kernels before Linux 2.6 20718 and strace does not support those kernels, there is no use to keep this 20719 parser any longer. 20720 20721 * bjm.c: Do not include <sys/*>, "xlat/qm_which.h", 20722 and "xlat/modflags.h". 20723 (MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)): 20724 Remove. 20725 * linux/dummy.h (sys_query_module): Add stub alias. 20726 * xlat/modflags.in: Remove. 20727 * xlat/qm_which.in: Remove. 20728 20729 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 20730 20731 Fix syscall entries of deprecated sysfs syscall. 20732 * linux/alpha/syscallent.h (sysfs): Change nargs from 5 to 3. 20733 * linux/hppa/syscallent.h (sysfs): Likewise. 20734 * linux/mips/syscallent-n32.h (sysfs): Likewise. 20735 * linux/mips/syscallent-n64.h (sysfs): Likewise. 20736 20737 Move sysfs syscall to deprecated category. 20738 * linux/dummy.h (sys_sysfs): Move to the list of deprecated syscalls. 20739 20740 Fix syscall entries of deprecated bdflush syscall. 20741 * linux/alpha/syscallent.h (bdflush): Change nargs from 0 to 2. 20742 * linux/arm/syscallent.h (bdflush): Likewise. 20743 * linux/avr32/syscallent.h (bdflush): Likewise. 20744 * linux/bfin/syscallent.h (bdflush): Likewise. 20745 * linux/hppa/syscallent.h (bdflush): Likewise. 20746 * linux/i386/syscallent.h (bdflush): Likewise. 20747 * linux/ia64/syscallent.h (bdflush): Likewise. 20748 * linux/m68k/syscallent.h (bdflush): Likewise. 20749 * linux/microblaze/syscallent.h (bdflush): Likewise. 20750 * linux/powerpc/syscallent.h (bdflush): Likewise. 20751 * linux/s390/syscallent.h (bdflush): Likewise. 20752 * linux/s390x/syscallent.h (bdflush): Likewise. 20753 * linux/sh/syscallent.h (bdflush): Likewise. 20754 * linux/sh64/syscallent.h (bdflush): Likewise. 20755 * linux/sparc/syscallent.h (bdflush): Likewise. 20756 20757 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 20758 20759 Implement name_to_handle_at and open_by_handle_at syscalls decoding. 20760 * file_handle.c: New file. 20761 * Makefile.am (strace_SOURCES): Add it. 20762 * linux/dummy.h (sys_name_to_handle_at, sys_open_by_handle_at): 20763 Remove stub aliases. 20764 * pathtrace.c (pathtrace_match): Add SEN_name_to_handle_at. 20765 * tests/file_handle.c: New file. 20766 * tests/file_handle.test: New test. 20767 * tests/Makefile.am (check_PROGRAMS): Add file_handle. 20768 (TESTS): Add file_handle.test. 20769 * tests/.gitignore: Add file_handle. 20770 20771 Implement lookup_dcookie syscall decoding. 20772 * lookup_dcookie.c: New file. 20773 * Makefile.am (strace_SOURCES): Add it. 20774 * linux/dummy.h (sys_lookup_dcookie): Remove stub alias. 20775 20776 Implement kexec_file_load syscall decoding. 20777 * xlat/kexec_file_load_flags.in: New file. 20778 * kexec.c: Include "xlat/kexec_file_load_flags.h". 20779 (SYS_FUNC(kexec_file_load)): New function. 20780 * linux/dummy.h (sys_kexec_file_load): Remove stub alias. 20781 * pathtrace.c (pathtrace_match): Add SEN_kexec_file_load. 20782 20783 Implement kcmp syscall decoding. 20784 * kcmp.c: New file. 20785 * Makefile.am (strace_SOURCES): Add it. 20786 * linux/dummy.h (sys_kcmp): Remove stub alias. 20787 * xlat/kcmp_types.in: New file. 20788 20789 Implement iopl syscall decoding. 20790 * iopl.c: New file. 20791 * Makefile.am (strace_SOURCES): Add it. 20792 * linux/dummy.h (sys_iopl): Remove stub alias. 20793 20794 Implement ioperm syscall decoding. 20795 * ioperm.c: New file. 20796 * Makefile.am (strace_SOURCES): Add it. 20797 * linux/dummy.h (sys_ioperm): Remove stub alias. 20798 20799 net: fix printing of IP_RECVOPTS/IP_RETOPTS cmsg options. 20800 * net.c (print_cmsg_ip_opts): Print each byte as unsigned char. 20801 20802 userfaultfd: fix pathtrace support. 20803 * pathtrace.c (pathtrace_match): Add SEN_userfaultfd. 20804 20805 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 20806 20807 Implement IPPROTO_IP control messages decoding. 20808 * net.c: Include "xlat/ip_cmsg_types.h". 20809 (print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, 20810 print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum, 20811 print_cmsg_ip_origdstaddr): New functions. 20812 (print_cmsg_type_data): Add generic SOL_IP level decoding. 20813 Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS, 20814 IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM, 20815 and SCM_SECURITY type messages. 20816 * xlat/ip_cmsg_types.in: New file. 20817 * xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS. 20818 * tests/inet-cmsg.c: New file. 20819 * tests/inet-cmsg.test: New test. 20820 * tests/Makefile.am (check_PROGRAMS): Add inet-cmsg. 20821 (TESTS): Add inet-cmsg.test. 20822 * tests/.gitignore: Add inet-cmsg. 20823 20824 Suggested-by: Orion Poplawski <orion (a] cora.nwra.com> 20825 20826 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 20827 20828 Simplify control messages printers. 20829 Do not pass sizeof(struct cmsghdr) to every cmsg printer. 20830 20831 * net.c (printcmsghdr): Pass pointer to cmsg_data and length 20832 of cmsg_data to print_cmsg_type_data. 20833 (print_cmsg_type_data): Update prototype. Pass pointer to cmsg_data 20834 and length of cmsg_data to cmsg printers. 20835 (print_scm_rights, print_scm_creds, print_scm_security): Update. 20836 20837 2015-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 20838 20839 net: factor out address printing code to a separate function. 20840 * net.c (sockaddr_buf_t): New type. 20841 (print_sockaddr): New function. 20842 (printsock, print_group_req): Use it. 20843 20844 2015-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 20845 20846 mpers: skip xlat struct definitions in mpers mode. 20847 Avoid duplicate definitions of xlat structures in files 20848 compiled in mpers mode. 20849 20850 Each xlat file defines the corresponding xlat struct with 20851 either global or local visibility using the following rules: 20852 20853 - if xlat struct declaration is available in defs.h, 20854 a global definition is provided in regular mode, 20855 and nothing is provided in mpers mode; 20856 - otherwise, if xlat file is included by a mpers source file, 20857 a global definition is provided in regular mode 20858 (unless no mpers mode is supported on this architecture, 20859 in that case, a local definition is provided instead), 20860 and a declaration is provided in mpers mode; 20861 - otherwise, a local definition is provided in regular mode, 20862 and an error message is printed in mpers mode. 20863 20864 Fallback definitions of constants provided by xlat files 20865 remain available in all modes. 20866 20867 * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh. 20868 * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove. 20869 * generate_mpers_am.sh: Generate mpers_xlat.h. 20870 * Makefile.am (EXTRA_DIST): Add mpers_xlat.h. 20871 * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally. 20872 * print_timex.c: Include "xlat/adjtimex_modes.h" and 20873 "xlat/adjtimex_status.h" unconditionally. 20874 * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ... 20875 (cond_def): ... here. 20876 (gen_header): Check also mpers_xlat.h for global declarations 20877 of xlat structures. 20878 Process input file twice, first time print directives 20879 only, second time print everything. 20880 Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif. 20881 * xlat/getrandom_flags.in: Cleanup. 20882 20883 2015-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 20884 20885 tests: rewrite getdents test in C for better coverage. 20886 * tests/getdents.awk: Remove. 20887 * tests/getdents.out: Remove. 20888 * tests/getdents.c: New file. 20889 * tests/getdents.test: Rewrite. 20890 * tests/getdents64.c: New file. 20891 * tests/getdents64.test: New test. 20892 * tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64. 20893 (TESTS): Add getdents64.test. 20894 (EXTRA_DIST): Remove getdents.awk and getdents.out. 20895 * tests/.gitignore: Add getdents and getdents64. 20896 20897 2015-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 20898 20899 tests: add readdir.test. 20900 * tests/readdir.c: New file. 20901 * tests/readdir.test: New test. 20902 * tests/Makefile.am (check_PROGRAMS): Add readdir. 20903 (TESTS): Add readdir.test. 20904 * tests/.gitignore: Add readdir. 20905 20906 Mpersify parsers of readdir and getdents syscalls. 20907 * defs.h (dirent_types): New xlat prototype. 20908 * dirent.c: Stop including "xlat/direnttypes.h". 20909 (kernel_dirent): New typedef. Mpersify it. 20910 (print_old_dirent): Use it instead of old_dirent_t. 20911 (SYS_FUNC(getdents)): Use it instead of struct kernel_dirent. 20912 Rename direnttypes to dirent_types. 20913 (SYS_FUNC(getdents64)): Move ... 20914 * dirent64.c: ... here. Rename direnttypes to dirent_types. 20915 Include "xlat/dirent_types.h". 20916 * Makefile.am (strace_SOURCES): Add dirent64.c. 20917 * xlat/direnttypes.in: Rename to xlat/dirent_types.in. 20918 20919 2015-11-19 Gabriel Laskar <gabriel (a] lse.epita.fr> 20920 20921 getdents: fix typos in array output. 20922 Array should be enclosed by square brakets, and elements should be 20923 separated by commas. 20924 20925 * dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos 20926 in array output. 20927 * tests/getdents.awk: Update regexps to match fixed output. 20928 * tests/getdents.out: Update output. 20929 20930 2015-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 20931 20932 printcmsghdr: move type and data decoders to a separate function. 20933 * net.c (print_scm_rights, print_scm_creds, print_scm_security): Change 20934 to return void. Move printing of struct cmsghdr closing '}' ... 20935 (printcmsghdr): ... here. Move type and data decoders to ... 20936 (print_cmsg_type_data): ... new function. 20937 20938 2015-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 20939 20940 Assume that libc provides sendmsg. 20941 Starting with commit v4.6-281-g7af9f35, we implicitly assume that 20942 HAVE_SENDMSG is always defined. Therefore, the check for sendmsg 20943 availability is redundant and could be safely removed. 20944 20945 * configure.ac (AC_CHECK_FUNCS): Remove sendmsg. 20946 * linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove 20947 stub aliases. 20948 * net.c [HAVE_SENDMSG]: Define unconditionally. 20949 * syscall.c (dumpio) [HAVE_SENDMSG]: Likewise. 20950 20951 2015-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 20952 20953 net.c: move fallback definition of SCM_SECURITY to xlat/ 20954 * net.c: Move fallback definition of SCM_SECURITY ... 20955 * xlat/scmvals.in: ... here. 20956 20957 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 20958 20959 Implement mlock2 syscall decoding. 20960 * mem.c: Include "xlat/mlock_flags.h". 20961 (SYS_FUNC(mlock2)): New function. 20962 * xlat/mlock_flags.in: New file. 20963 * xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values. 20964 * linux/dummy.h (mlock2): Remove. 20965 * tests/mlock2.c: New file. 20966 * tests/mlock2.test: New test. 20967 * tests/Makefile.am (check_PROGRAMS): Add mlock2. 20968 (TESTS): Add mlock2.test. 20969 * tests/.gitignore Add mlock2. 20970 20971 Implement membarrier syscall decoding. 20972 * membarrier.c: New file. 20973 * Makefile.am (strace_SOURCES): Add it. 20974 * xlat/membarrier_cmds.in: New file. 20975 * linux/dummy.h (membarrier): Remove. 20976 * tests/membarrier.c: New file. 20977 * tests/membarrier.test: New test. 20978 * tests/Makefile.am (check_PROGRAMS): Add membarrier. 20979 (TESTS): Add membarrier.test. 20980 * tests/.gitignore: Add membarrier. 20981 20982 Implement userfaultfd syscall decoding. 20983 * userfaultfd.c: New file. 20984 * Makefile.am (strace_SOURCES): Add it. 20985 * xlat/uffd_flags.in: New file. 20986 * linux/dummy.h (userfaultfd): Remove. 20987 * tests/userfaultfd.c: New file. 20988 * tests/userfaultfd.test: New test. 20989 * tests/Makefile.am (check_PROGRAMS): Add userfaultfd. 20990 (TESTS): Add userfaultfd.test. 20991 * tests/.gitignore: Add userfaultfd. 20992 20993 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 20994 20995 ia64: wire up kcmp syscall. 20996 ia64 has kcmp syscall starting with linux kernel commit 20997 v4.3-rc7-1-gd305c47. 20998 20999 * linux/ia64/syscallent.h (kcmp): New entry. 21000 21001 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 21002 21003 powerpc: wire up direct sysv ipc syscalls. 21004 Starting with linux commit v4.3-rc3-33-ga342361, powerpc has 21005 direct sysv ipc syscalls in addition to traditional ipc syscall. 21006 21007 * linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd, 21008 msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries. 21009 21010 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 21011 21012 Wire up userfaultfd, membarrier, and mlock2 syscalls. 21013 * linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases. 21014 * linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries. 21015 * linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21016 * linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21017 * linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21018 * linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21019 * linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise. 21020 * linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21021 * linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21022 * linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise. 21023 * linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise. 21024 * linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise. 21025 * linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise. 21026 * linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21027 * linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21028 * linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise. 21029 * linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21030 * linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 21031 21032 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 21033 21034 sprintflags: skip zero flags. 21035 Tweak sprintflags behaviour to match printflags. 21036 21037 * util.c (sprintflags): Skip zero flags unless the value passed 21038 to sprintflags is also zero. 21039 21040 2015-11-16 Mike Frysinger <vapier (a] gentoo.org> 21041 21042 printflags: handle empty xlats. 21043 If the set of headers are unable to produce a valid list, printflags 21044 will try to pass NULL to tprints which crashes. Add a sanity check 21045 for this edge case. 21046 21047 * util.c (printflags): Check xlat->str is not NULL. 21048 21049 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 21050 21051 mpers: forward mpers_DEFS to mpers.sh. 21052 mpers_DEFS has to be forwarded to mpers.sh so that config.h would be 21053 properly included by defs.h at preprocessor stage. 21054 21055 * Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of 21056 options to mpers.sh's CPPFLAGS. 21057 21058 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 21059 21060 tests/ioctl: workaround glibc ioctl wrapper on powerpc. 21061 * tests/ioctl.c (main) [POWERPC] Disable TCGETS test. 21062 21063 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 21064 21065 powerpc: wire up switch_endian syscall. 21066 powerpc has switch_endian syscall starting with linux commit 21067 v4.0-rc4-67-g529d235. 21068 21069 * linux/powerpc/syscallent.h (switch_endian): New entry. 21070 21071 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 21072 21073 sparc: reserve more space for new syscalls. 21074 Move socket subcalls further down the table to make room 21075 for new syscalls. 21076 21077 * linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400. 21078 21079 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 21080 21081 m68k: wire up direct socket syscalls. 21082 Starting with linux commit v4.3-rc3-1-g5b3f33e, m68k has direct 21083 socket syscalls in addition to traditional socketcall syscall. 21084 21085 * linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen, 21086 accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, 21087 sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries. 21088 21089 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 21090 21091 i386: wire up direct socket syscalls. 21092 Starting with linux commit v4.2-rc1-64-g9dea5dc, x86 has direct 21093 socket syscalls in addition to traditional socketcall syscall. 21094 21095 * linux/i386/syscallent.h (socket, socketpair, bind, connect, listen, 21096 accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, 21097 sendmsg, recvfrom, recvmsg, shutdown): New entries. 21098 21099 2015-11-11 Heiko Carstens <heiko.carstens (a] de.ibm.com> 21100 21101 s390, s390x: update syscall tables. 21102 * linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0. 21103 * linux/s390x/syscallent.h: Likewise. 21104 21105 2015-11-07 Dmitry V. Levin <ldv (a] altlinux.org> 21106 21107 Fix *_printer_defs.h rules ambiguousness. 21108 There is an ambiguousness in *_printer_defs.h rules definition: 21109 21110 $ grep '^[^ ]*_defs\.h: ' Makefile.am 21111 m%_defs.h: $(srcdir_mpers_source_files) 21112 %_printer_defs.h: $(srcdir_mpers_source_files) 21113 21114 While it appears to work with GNU make, it has to be fixed nevertheless. 21115 21116 * Makefile.am (m%_defs.h): Rename to m%_type_defs.h. 21117 (mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h. 21118 (mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h. 21119 * mpers_type.h: Rename m32_defs.h to m32_type_defs.h, 21120 mx32_defs.h to mx32_type_defs.h. 21121 * .gitignore: Likewise. 21122 21123 Reported-by: Elliott Hughes <enh (a] google.com> 21124 21125 2015-10-09 Dmitry V. Levin <ldv (a] altlinux.org> 21126 21127 fcntl.c: make use of RVAL_DECODED. 21128 * fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations. 21129 21130 2015-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 21131 21132 desc.c: move parser of fcntl syscall to a separate file. 21133 * fcntl.c: New file. 21134 * Makefile.am (strace_SOURCES): Add it. 21135 * desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c. 21136 21137 desc.c: move parser of flock syscall to a separate file. 21138 * flock.c: New file. 21139 * Makefile.am (strace_SOURCES): Add it. 21140 * desc.c (SYS_FUNC(flock)): Move to flock.c. 21141 21142 2015-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 21143 21144 tests: fix false uio.test failures. 21145 * tests/uio.c (main): Use descriptor number 0 in pread/pwrite 21146 and preadv/pwritev syscalls. 21147 * tests/uio.expected: Update regexps. 21148 21149 Reported-by: Lennart Sorensen <lsorense (a] csclub.uwaterloo.ca> 21150 21151 2015-10-01 Gabriel Laskar <gabriel (a] lse.epita.fr> 21152 21153 Fix make -j builds. 21154 In files generated by mpers scripts, includes directives are taken from 21155 original files where the type definition was done. This causes to 21156 include defs.h in multiple files. defs.h includes printers.h header, 21157 which is a generated header. 21158 21159 This patch add an explicit dependency to printers.h for the mpers 21160 scripts. 21161 21162 * Makefile.am (mpers-m%.stamp): Add printers.h to order-only 21163 prerequisites. 21164 21165 2015-09-29 Mike Frysinger <vapier (a] gentoo.org> 21166 21167 mpers: fix shell code to conform better to POSIX. 21168 The `echo -n` behavior is non-portable, so use printf instead. 21169 21170 * generate_mpers_am.sh: Change `echo -n` to `printf`. 21171 21172 2015-09-23 Gabriel Laskar <gabriel (a] lse.epita.fr> 21173 21174 ioctl: fix ioctl command number decoding in case of conflicts. 21175 When a command number was decoded through ioctl_decode_command_number(), 21176 there was no check for conflicts with other potential ioctls numbers. 21177 21178 For example: 21179 ioctl(fd, MCE_GET_RECORD_LEN, &i); 21180 output: 21181 ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0 21182 instead of: 21183 ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0 21184 21185 * ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding 21186 in case of conflicts. 21187 * tests/ioctl.c (main): Add a case for command number conflicts. 21188 21189 2015-09-23 Dmitry V. Levin <ldv (a] altlinux.org> 21190 21191 tests: convert ioctl.test from match_grep to match_diff. 21192 * tests/ioctl.c (main): Print expected output. 21193 * tests/ioctl.test: Use match_diff instead of match_grep. 21194 * tests/ioctl.expected: Remove. 21195 * tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected. 21196 21197 2015-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 21198 21199 Convert parser of seccomp filter program to new mpers infrastructure. 21200 * seccomp_fprog.h: New file. 21201 * fetch_seccomp_fprog.c: New file. 21202 * Makefile.am (strace_SOURCES): Add them. 21203 * seccomp.c: Include "seccomp_fprog.h". 21204 (print_seccomp_filter): Use fetch_seccomp_fprog. 21205 21206 2015-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 21207 21208 tests/init.sh: enhance match_grep error diagnostics. 21209 * tests/init.sh (match_grep): Check patterns one by one, 21210 output only those patterns that didn't match. 21211 21212 tests/init.sh: fix comment. 21213 * tests/init.sh (match_awk): Fix usage description. 21214 21215 tests: add one more case to select.test. 21216 * tests/select.c (main): Check how timeout is printed 21217 on exiting syscall. 21218 21219 tests: uncouple pselect6 from select.test. 21220 * tests/select.c Do not include <string.h>. 21221 Include <sys/syscall.h>. 21222 [!__NR_select]: Skip the test. 21223 (main): Remove pselect6 support, test just select syscall. 21224 * tests/select.test: Remove all pselect6 checks, test just 21225 select syscall. 21226 21227 tests: robustify select test. 21228 * tests/select.c: Do not include <assert.h>. 21229 (main): Skip the test instead of assertions. 21230 Add some padding to the timeval structure. 21231 21232 tests: add one more case to pselect6.test. 21233 * tests/pselect6.c (main): Check how timeout is printed 21234 on exiting syscall. 21235 21236 tests: robustify pselect6 test. 21237 * tests/pselect6.c: Do not include <assert.h> and <string.h>. 21238 Include <sys/syscall.h>. 21239 [!__NR_pselect6]: Skip the test. 21240 (main): Skip the test instead of assertions. 21241 Add some padding to the timespec structure. 21242 21243 Convert another parser of struct timeval to new mpers infrastructure. 21244 * print_time.c (sprint_timeval): New mpers printer. 21245 [ALPHA] (sprint_timeval32): New function. 21246 * defs.h [ALPHA] (sprint_timeval32): New prototype. 21247 (bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove. 21248 * desc.c (decode_select): Replace bitness parameter with two printers. 21249 Use them instead of printtv_bitness and sprinttv. 21250 (sys_oldselect, sys_select): Pass print_timeval and sprint_timeval 21251 to decode_select. 21252 [ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32 21253 to decode_select. 21254 (pselect6): Pass print_timespec and sprint_timespec to decode_select. 21255 * time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat, 21256 struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove. 21257 21258 Convert another parser of struct timespec to new mpers infrastructure. 21259 * print_time.c (sprint_timespec): New mpers printer. 21260 * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. 21261 (sprint_timespec): Remove. 21262 * time.c (sprint_timespec): Remove. 21263 * net.c (sys_recvmmsg): Update callers. 21264 * poll.c (decode_poll_exiting): Likewise. 21265 21266 tests: add another case to pselect6 test. 21267 * tests/pselect6.c: Include <sys/time.h>. 21268 (handler): New function. 21269 (main): Install an interval timer. 21270 Use it to check how ERESTARTNOHAND is printed. 21271 21272 Fix decoding of gettimeofday and settimeofday. 21273 * time.c (print_timezone): new function. 21274 (sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval 21275 to print struct timezone. 21276 [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it 21277 instead of print_timeval32 to print struct timezone. 21278 * tests/xettimeofday.c: New file. 21279 * tests/xettimeofday.test: New test. 21280 * tests/Makefile.am (check_PROGRAMS): Add xettimeofday. 21281 (TESTS): Add xettimeofday. 21282 * tests/.gitignore: Add xettimeofday. 21283 21284 Convert parser of struct timeval to new mpers infrastructure. 21285 * defs.h (printtv, printtv_special): Remove. 21286 [ALPHA] (print_timeval32, print_timeval32_pair): New prototypes. 21287 * print_time.c (print_timeval): New mpers printer. 21288 [ALPHA] (print_timeval32, print_timeval32_pair): New functions. 21289 * time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval 21290 instead of printtv. 21291 [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): 21292 Use print_timeval32 instead of printtv_bitness. 21293 * utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair 21294 instead of printtv_bitness. 21295 21296 Convert parser of struct timespec to new mpers infrastructure. 21297 * defs.h (print_timespec): Remove. 21298 * print_time.c (print_timespec): New mpers printer. 21299 * futex.c (sys_futex): Use print_timespec instead of printtv. 21300 * ipc_sem.c (sys_semtimedop): Likewise. 21301 * mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise. 21302 * time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise. 21303 (print_timespec): Remove. 21304 21305 Remove unused parser of adjtime syscall. 21306 * time.c (sys_adjtime): Remove. 21307 21308 Fix decoding of clock_nanosleep. 21309 * time.c (sys_clock_nanosleep): Use is_erestart, 21310 temporarily_clear_syserror, and restore_cleared_syserror. 21311 * tests/clock_nanosleep.c: New file. 21312 * tests/clock_nanosleep.test: New test. 21313 * tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep. 21314 (TESTS): Add clock_nanosleep.test. 21315 * tests/.gitignore: Add clock_nanosleep. 21316 21317 Add is_erestart helper function. 21318 * defs.h (is_erestart): New prototype. 21319 * syscall.c (is_erestart): New function. 21320 * time.c (sys_nanosleep): Use is_erestart, 21321 temporarily_clear_syserror, and restore_cleared_syserror. 21322 21323 Add helper functions to clear/restore syserror. 21324 * defs.h (temporarily_clear_syserror, restore_cleared_syserror): 21325 New prototypes. 21326 * syscall.c (saved_u_error): New variable. 21327 (temporarily_clear_syserror, restore_cleared_syserror): New functions. 21328 * aio.c (sys_io_getevents): Use temporarily_clear_syserror 21329 and restore_cleared_syserror. 21330 * mq.c (sys_mq_timedreceive): Likewise. 21331 * signal.c (sys_rt_sigtimedwait): Likewise. 21332 21333 tests: add nanosleep.test. 21334 * tests/nanosleep.c: New file. 21335 * tests/nanosleep.test: New test. 21336 * tests/Makefile.am (check_PROGRAMS): Add nanosleep. 21337 (TESTS): Add nanosleep.test. 21338 * tests/.gitignore: Add nanosleep. 21339 21340 tests: rewrite restart_syscall in C. 21341 * tests/restart_syscall.c: New file. 21342 * tests/restart_syscall.expected: Remove. 21343 * tests/restart_syscall_unknown.expected: Remove. 21344 * tests/restart_syscall.test: Update to use restart_syscall. 21345 * tests/Makefile.am (check_PROGRAMS): Add restart_syscall. 21346 (EXTRA_DIST): Remove restart_syscall.expected 21347 and restart_syscall_unknown.expected. 21348 * tests/.gitignore: Add restart_syscall. 21349 21350 Properly initialize siginfo_t object passed to print_stopped function. 21351 * strace.c (trace): Clear the whole siginfo_t variable before passing it 21352 to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a 21353 part of the structure. 21354 21355 tests: add clock_xettime.test. 21356 * tests/clock_xettime.c: New file. 21357 * tests/clock_xettime.test: New test. 21358 * tests/Makefile.am (check_PROGRAMS): Add clock_xettime. 21359 (TESTS): Add clock_xettime.test. 21360 * tests/.gitignore: Add clock_xettime. 21361 21362 Convert parser of struct itimerval to new mpers infrastructure. 21363 * defs.h [ALPHA] (print_itimerval32): New prototype. 21364 * print_time.c (print_itimerval): New mpers printer. 21365 [ALPHA] (timeval32_t): New typedef. 21366 [ALPHA] (print_timeval32_t, print_itimerval32): New functions. 21367 * time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead 21368 of printitv. 21369 [ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32 21370 instead of printitv_bitness. 21371 (tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove. 21372 21373 tests: add xetitimer.test. 21374 * tests/xetitimer.c: New file. 21375 * tests/xetitimer.test: New test. 21376 * tests/Makefile.am (check_PROGRAMS): Add xetitimer. 21377 (TESTS): Add xetitimer.test. 21378 * tests/.gitignore: Add xetitimer. 21379 21380 Convert parser of struct itimerspec to new mpers infrastructure. 21381 * print_time.c (print_itimerspec): New mpers printer. 21382 * time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd, 21383 sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv. 21384 21385 2015-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 21386 21387 print_time.c: introduce print_timespec_t helper. 21388 * print_time.c (time_fmt): New constant string. 21389 (print_timeval_t): Use it. 21390 (print_timespec_t): New function. 21391 (print_timespec_t_utime): Use it. 21392 21393 tests: add timerfd_xettime.test. 21394 * tests/timerfd_xettime.c: New file. 21395 * tests/timerfd_xettime.test: New test. 21396 * tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime. 21397 (TESTS): Add timerfd_xettime.test. 21398 * tests/.gitignore: Add timerfd_xettime. 21399 21400 tests: add timer_xettime.test. 21401 * tests/timer_xettime.c: New file. 21402 * tests/timer_xettime.test: New test. 21403 * tests/Makefile.am (check_PROGRAMS): Add timer_xettime. 21404 (TESTS): Add timer_xettime.test. 21405 * tests/.gitignore: Add timer_xettime. 21406 21407 time.c: move parser of time syscall to print_time.c. 21408 * time.c (current_time_t_is_int32): Remove. 21409 (sys_time): Move ... 21410 * print_time.c: ... here. Mpersify time_t. 21411 21412 print_time.c: remove unused function parameters. 21413 * print_time.c (print_timespec_t_utime, print_timeval_t): Remove 21414 "struct tcb *" parameter. 21415 (print_timespec_utime_pair, print_timeval_pair): Update callers. 21416 21417 Add struct timex.tai support. 21418 * configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai. 21419 * print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field. 21420 * tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise. 21421 21422 Convert parser of struct timex to new mpers infrastructure. 21423 * defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes. 21424 * print_timex.c (struct_timex): New typedef. Mpersify it. 21425 [IN_MPERS]: Do not include "xlat/adjtimex_modes.h" 21426 and "xlat/adjtimex_status.h". 21427 [SUPPORTED_PERSONALITIES > 1]: Remove. 21428 (tprint_timeval): Remove. 21429 (tprint_timex): Rename to print_timex. Mpersify it. 21430 * time.c (do_adjtimex): Rename tprint_timex to print_timex. 21431 * tests/adjtimex.c: New file. 21432 * tests/adjtimex.test: New test. 21433 * tests/Makefile.am (check_PROGRAMS): Add adjtimex. 21434 (TESTS): Add adjtimex.test. 21435 * tests/.gitignore: Add adjtimex. 21436 21437 Move parser of struct timex to a separate file. 21438 * print_timex.c: New file. 21439 * Makefile.am (strace_SOURCES): Add it. 21440 * time.c (tprint_timex32, tprint_timex): Move to print_timex.c. 21441 21442 Enhance parser of struct sigevent. 21443 * print_sigevent.c (print_sigevent): Always print names 21444 of struct_sigevent fields along with their values. 21445 Print signal name of sigev_signo for those sigev_notify values 21446 that require valid signal numbers. 21447 * tests/timer_create.c: New file. 21448 * tests/timer_create.test: New test. 21449 * tests/Makefile.am (check_PROGRAMS): Add timer_create. 21450 (TESTS): Add timer_create.test. 21451 * tests/.gitignore: Add timer_create. 21452 21453 2015-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 21454 21455 Convert parser of struct sigevent to new mpers infrastructure. 21456 * defs.h (sigev_value): New prototype. 21457 (printsigevent): Remove. 21458 * print_sigevent.c (struct_sigevent): New typedef. Mpersify it. 21459 [IN_MPERS]: Do not include "xlat/sigev_value.h". 21460 (printsigevent32): Remove. 21461 (printsigevent): Rename to print_sigevent. Mpersify it. 21462 * mq.c (sys_mq_notify): Rename printsigevent to print_sigevent. 21463 * time.c (sys_timer_create): Likewise. 21464 21465 Move parser of struct sigevent to a separate file. 21466 * print_sigevent.c: New file. 21467 * Makefile.am (strace_SOURCES): Add it. 21468 * time.c (printsigevent32, printsigevent): Move to print_sigevent.c. 21469 21470 time.c: move fallback definitions of SIGEV_* values to xlat/ 21471 * time.c: Move fallback definitions of SIGEV_* values ... 21472 * xlat/sigev_value.in: ... here. 21473 21474 Simplify use of mpers printers. 21475 * native_defs.h: New file. 21476 * syscall.c: Include it. 21477 * mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h". 21478 * defs.h (MPERS_PRINTER_NAME): Remove. 21479 [SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ... 21480 * Makefile.am (printers.h): ... here. 21481 Add macro definitions for mpers printers. 21482 (m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion 21483 of "$(mpers_PREFIX)printer_decls.h". 21484 (strace_SOURCES): Add native_defs.h. 21485 * README-mpers: Update instructions for using mpers printers. 21486 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly. 21487 * mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly. 21488 * process.c (sys_ptrace): Call printsiginfo_at directly. 21489 * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise. 21490 * resource.c (sys_getrusage): Call printrusage directly. 21491 * utimes.c (sys_utimensat): Call print_timespec_utime_pair directly. 21492 (sys_utimes, sys_futimesat): Call print_timeval_pair directly. 21493 * wait.c (printwaitn): Call printrusage directly. 21494 (sys_waitid): Call printrusage and printsiginfo_at directly. 21495 21496 2015-09-15 Dmitry V. Levin <ldv (a] altlinux.org> 21497 21498 Add a new helper function umove_ulong_array_or_printaddr. 21499 * defs.h (umove_ulong_array_or_printaddr): New prototype. 21500 * util.c (umove_ulong_array_or_printaddr): New function. 21501 * desc.c (sys_pselect6): Use it instead of open-coding 21502 a proxy struct parser for different personalities. 21503 * io.c (tprint_iov_upto): Use it instead of open-coding 21504 a struct iovec parser for different personalities. 21505 * kexec.c (print_kexec_segments): Use it instead of open-coding 21506 a struct kexec_segment parser for different personalities. 21507 (print_seg): Pass arguments using an array. 21508 21509 tests: add pselect6.test. 21510 * tests/pselect6.c: New file. 21511 * tests/pselect6.test: New test. 21512 * tests/Makefile.am (check_PROGRAMS): Add pselect6. 21513 (TESTS): Add pselect6.test. 21514 * tests/.gitignore: Add pselect6. 21515 21516 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 21517 21518 Rename umove_long_or_printaddr to umove_ulong_or_printaddr. 21519 Rename the recently added function to reflect what kind of data type 21520 it actually deals with: unsigned long int, without sign extension. 21521 21522 * defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr, 21523 chage 3rd argument to unsigned long *. 21524 * util.c (umove_long_or_printaddr): Likewise. 21525 * aio.c (sys_io_submit): Update callers. 21526 21527 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 21528 21529 aarch64, ppc64, sparc64, tile: hook up mpers printers. 21530 * defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS, 21531 PERSONALITY0_INCLUDE_PRINTERS_DECLS, 21532 and PERSONALITY0_INCLUDE_PRINTERS_DEFS. 21533 [POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS, 21534 PERSONALITY1_INCLUDE_PRINTERS_DECLS, 21535 and PERSONALITY1_INCLUDE_PRINTERS_DEFS. 21536 [SPARC64 && HAVE_M32_MPERS]: Likewise. 21537 [TILE && HAVE_M32_MPERS]: Likewise. 21538 21539 2015-09-14 Anton Blanchard <anton (a] samba.org> 21540 21541 Add PowerPC specific ptrace constants. 21542 * xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants. 21543 21544 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 21545 21546 Update SCTP_* constants. 21547 * xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF, 21548 SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO, 21549 SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3, 21550 and SCTP_GET_ASSOC_STATS. 21551 21552 Update F_* constants. 21553 * xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS, 21554 and F_GET_SEALS. 21555 21556 Update RENAME_* constants. 21557 * xlat/rename_flags.in: Add RENAME_WHITEOUT. 21558 21559 Update SO_* constants. 21560 * xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS, 21561 SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU, 21562 SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL, 21563 SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS. 21564 21565 Update INPUT_PROP_* constants. 21566 * xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER. 21567 21568 Update KEY_* constants. 21569 * xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A, 21570 KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D. 21571 21572 Update FALLOC_FL_* constants. 21573 * xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE. 21574 21575 Update AF_* and PF_* constants. 21576 * xlat/addrfams.in: Add AF_IB and AF_MPLS. 21577 * xlat/domains.in: Add PF_IB and PF_MPLS. 21578 21579 Update TCP_* constants. 21580 * xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO, 21581 TCP_SAVE_SYN, and TCP_SAVED_SYN. 21582 21583 Update PACKET_* constants. 21584 * xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP, 21585 PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS, 21586 PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA. 21587 21588 Update BPF_MAP_TYPE_* constants. 21589 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY. 21590 21591 Update IPPROTO_* constants. 21592 * xlat/inet_protocols.in: Add IPPROTO_MPLS. 21593 21594 Update IP_* constants. 21595 * xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT. 21596 21597 Update PTRACE_O_* constants. 21598 * ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP. 21599 * xlat/ptrace_setoptions_flags.in: Add it. 21600 21601 Update PR_* constants. 21602 * xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE, 21603 and PR_CAP_AMBIENT. 21604 21605 Update SECBIT_* constants. 21606 * xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE 21607 and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED. 21608 21609 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21610 21611 mpers.m4: workaround missing gnu/stubs-*.h files. 21612 On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation 21613 checks fail. As we want to support multiple personalities despite of 21614 this limitation, workaround the check by creating empty gnu stub files 21615 if necessary. 21616 21617 * m4/mpers.m4 (st_MPERS): Check for the gnu stub file. Create an empty 21618 gnu stub file if the system one is missing. 21619 * Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h. 21620 21621 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21622 21623 tests: add times-fail.test. 21624 * tests/times-fail.c: New file. 21625 * tests/times-fail.test: New test. 21626 * tests/Makefile.am (check_PROGRAMS): Add times-fail. 21627 (TESTS): Add times-fail.test. 21628 * tests/.gitignore: Add times-fail. 21629 21630 2015-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 21631 21632 tests: add times.test. 21633 * tests/times.c: New file. 21634 * tests/times.test: New test. 21635 * tests/Makefile.am (check_PROGRAMS): Add times. 21636 (TESTS): Add times.test. 21637 (times_LDADD): Define. 21638 * tests/.gitignore: Add times. 21639 21640 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21641 21642 Mpersify parser of times syscall. 21643 Fix multiple personalities support in parser of times syscall by 21644 mpersifying struct tms. 21645 21646 * times.c (tms_t): New typedef. Mpersify it. 21647 (sys_times): Use it instead of struct tms. 21648 21649 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21650 21651 tests: add sysinfo.test. 21652 * tests/sysinfo.c: New file. 21653 * tests/sysinfo.test: New test. 21654 * tests/Makefile.am (check_PROGRAMS): Add sysinfo. 21655 (TESTS): Add sysinfo.test. 21656 * tests/.gitignore: Add sysinfo. 21657 21658 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21659 21660 Mpersify parser of sysinfo syscall. 21661 Fix multiple personalities support in parser of sysinfo syscall by 21662 mpersifying struct sysinfo. 21663 21664 * sysinfo.c (sysinfo_t): New typedef. Mpersify it. 21665 (sys_sysinfo): Use it instead of struct sysinfo. 21666 21667 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21668 21669 Enhance msgctl syscall decoding. 21670 Make parser of msgctl syscall print struct msqid_ds. 21671 21672 * ipc_msgctl.c (msqid_ds_t): New typedef. Mpersify it. 21673 (print_msqid_ds): New function. Use msqid_ds_t. 21674 (sys_msgctl): Use print_msqid_ds. 21675 * tests/ipc_msg.c: Update for struct msqid_ds support. 21676 21677 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21678 21679 Enhance shmctl syscall decoding. 21680 Make parser of shmctl syscall print struct shmid_ds. 21681 21682 * ipc_shmctl.c (shmid_ds_t): New typedef. Mpersify it. 21683 (print_shmid_ds): New function. Use shmid_ds_t. 21684 (sys_shmctl): Use print_shmid_ds. 21685 * tests/ipc_shm.c: Update for struct shmid_ds support. 21686 21687 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21688 21689 tests: add ipc_msgbuf.test. 21690 * tests/ipc_msgbuf.c: New file. 21691 * tests/ipc_msgbuf.expected: Likewise. 21692 * tests/ipc_msgbuf.test: New test. 21693 * tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf. 21694 (TESTS): Add ipc_msgbuf.test. 21695 (EXTRA_DIST): Add ipc_msgbuf.expected. 21696 * tests/.gitignore: Add ipc_msgbuf. 21697 21698 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21699 21700 Mpersify tprint_msgsnd and tprint_msgrcv. 21701 Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv 21702 by converting tprint_msgbuf into a mpersified printer. 21703 21704 * print_msgbuf.c (msgbuf_t): New typedef. Mpersify it. 21705 (tprint_msgbuf): Use it instead of long. 21706 Wrap function name into MPERS_PRINTER_DECL. 21707 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified 21708 tprint_msgbuf. 21709 21710 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21711 21712 tests: add mq.test. 21713 * tests/mq.c: New file. 21714 * tests/mq.expected: Likewise. 21715 * tests/mq.test: New test. 21716 * tests/Makefile.am (check_PROGRAMS): Add mq. 21717 (TESTS): Add mq.test. 21718 (EXTRA_DIST): Add mq.expected. 21719 (mq_LDADD): Add -lrt. 21720 * tests/.gitignore: Add mq. 21721 21722 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21723 21724 Mpersify parsers of mq_open and mq_getsetattr syscalls. 21725 Fix multiple personalities support in parsers of mq_open and 21726 mq_getsetattr by converting printmqattr into a mpersified printer. 21727 21728 * print_mq_attr.c (mq_attr_t): New typedef. Mpersify it. 21729 (printmqattr): Use it instead of struct mq_attr. Wrap function name 21730 into MPERS_PRINTER_DECL. 21731 * mq.c (mq_open, mq_getsetattr): Use mpersified printmqattr. 21732 21733 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21734 21735 tests: add wait.test. 21736 * tests/wait.c: New file. 21737 * tests/wait.expected: Likewise. 21738 * tests/wait.test: New test. 21739 * tests/Makefile.am (check_PROGRAMS): Add wait. 21740 (TESTS): Add wait.test. 21741 (EXTRA_DIST): Add wait.expected. 21742 * tests/.gitignore: Add wait. 21743 21744 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21745 21746 Mpersify parsers of getrusage, waitpid, wait4, and waitid syscalls. 21747 Fix multiple personalities support in parsers of getrusage, waitpid, 21748 wait4, and waitid syscalls by converting printrusage into a mpersified 21749 printer. 21750 21751 * defs.h (printrusage): Remove. 21752 * printrusage.c (rusage_t): New typedef. Mpersify it. 21753 (printrusage): Use it instead of struct rusage. 21754 Wrap function name into MPERS_PRINTER_DECL. 21755 * resource.c (sys_getrusage): Use mpersified printrusage. 21756 * wait.c (printwaitn, sys_waitid): Likewise. 21757 21758 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21759 21760 tests: add rt_sigqueueinfo.test. 21761 * tests/rt_sigqueueinfo.c: New file. 21762 * tests/rt_sigqueueinfo.test: New test. 21763 * tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo. 21764 (TESTS): Add rt_sigqueueinfo.test. 21765 * tests/.gitignore: Add rt_sigqueueinfo. 21766 21767 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21768 21769 Mpersify printsiginfo_at printer. 21770 Fix multiple personalities support in parsers of ptrace, 21771 rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls 21772 by converting printsiginfo_at into a mpersified printer. 21773 21774 * printsiginfo.c (siginfo_t): Mpersify. 21775 (printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL. 21776 * defs.h (printsiginfo_at): Remove. 21777 * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified 21778 printsiginfo_at. 21779 * process.c (sys_ptrace): Likewise. 21780 * wait.c (sys_waitid): Likewise. 21781 21782 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21783 21784 Mpersify parser of sigaltstack syscall. 21785 Fix multiple personalities support in parser of sigaltstack syscall by 21786 mpersifying stack_t typedef. 21787 21788 * sigaltstack.c (stack_t): Mpersify. 21789 (print_stack_t): Use it. 21790 21791 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21792 21793 Mpersify parser of utime syscall. 21794 Fix multiple personalities support in parser of utime syscall by using 21795 mpersified utimbuf_t typedef. 21796 21797 * utime.c (utimbuf_t): New typedef. Mpersify it. 21798 (sys_utime): Use it instead of a locally defined union. 21799 21800 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21801 21802 tests: add utimensat.test. 21803 * tests/utimensat.c: New file. 21804 * tests/utimensat.test: New test. 21805 * tests/Makefile.am (check_PROGRAMS): Add utimensat. 21806 (TESTS): Add utimensat.test. 21807 * configure.ac (AC_CHECK_FUNCS): Add utimensat. 21808 * tests/.gitignore: Add utimensat. 21809 21810 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21811 21812 Mpersify parsers of utimes, futimesat, and utimensat syscalls. 21813 Fix multiple personalities support in parsers of utimes, futimesat, 21814 and utimensat syscalls by introducing two mpersified printers: 21815 print_timeval_pair and print_timespec_utime_pair. 21816 21817 * print_time.c: New file. 21818 * Makefile.am (strace_SOURCES): Add it. 21819 * utimes.c (decode_utimes): Remove. 21820 (sys_utimes, sys_futimesat): Use print_timeval_pair instead 21821 of decode_utimes. 21822 (sys_utimensat): Use print_timespec_utime_pair instead of decode_utimes. 21823 21824 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 21825 21826 Add mpers support. 21827 Add a subsystem for semi-automatical definition of how parsers should 21828 work with personality-dependent (mpers) types of tracee's data. Create 21829 auxiliary libraries containing mpers syscall parsers and printer 21830 functions, one library for each possible nonnative target personality. 21831 21832 Currently some parsers do not handle differences in definitions of data 21833 types between personalities, namely LP64 and ILP32. When 21834 this is the case, long integers, pointers, and all compound 21835 types containing long and pointer members may be printed incorrectly, 21836 because of differences in sizes, offsets and alignments. 21837 21838 Since in most cases these are the only differences in desired behaviour 21839 of parsers and printers for different personalities, a correct way 21840 would be to compile one source code into multiple parsers, differing 21841 only in definitions of mpers types. 21842 21843 To get a definition of a given type for nonnative personality 21844 a very basic .c file containing a declaration of a variable of this type 21845 is being compiled for this personality (using -m32 or -mx32 compiler 21846 flag). Information about the type is then being extracted from 21847 this binary's DWARF debug info with an awk script and put 21848 into a corresponding header file. Resulting headers are being used to 21849 compile mpers variations of syscall parsers and printer functions. 21850 21851 In addition to syscall parsers, there can occur a need to create mpers 21852 printing functions, which then can be called from many places 21853 in the code (for example, printsiginfo_at). Such functions (printers) 21854 are marked in a special manner. 21855 21856 For each possible nonnative target personality a library is being 21857 created, containing mpers variations of syscall parsers and printers. 21858 Only syscall parsers from files marked in a special manner and specially 21859 marked functions from such files are being recompiled and included 21860 in these libraries. 21861 21862 generate_mpers_am.sh is called by bootstrap to find the files 21863 from strace_SOURCES which include MPERS_DEFS. During compilation, 21864 these files are being inspected for inclusions of DEF_MPERS_TYPE, 21865 and nonnative variations of each included type are being generated 21866 by an awk script. 21867 21868 Mpers parser names are being modified during inclusions of syscallent 21869 headers for nonnative personalities. Pointers to printers are 21870 being stored in structs struct_printers, and a master 21871 pointer printers is being updated on every set_personality. 21872 21873 * README-mpers: New README explaining how to use mpers support. 21874 * empty.h: New empty file. 21875 * generate_mpers_am.sh: New file. 21876 * mpers.awk: Likewise. 21877 * mpers.sh: Likewise. 21878 * mpers_test.sh: Likewise. 21879 * mpers_type.h: Likewise. 21880 * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. 21881 (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning 21882 of the file. 21883 (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. 21884 (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. 21885 (BUILT_SOURCES, CLEANFILES): Add new generated files: 21886 native_printer_decls.h, native_printer_defs.h, printers.h, 21887 [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] 21888 $(mpers_mx32_targets). 21889 (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, 21890 mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, 21891 libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. 21892 (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, 21893 %_printer_decls.h, %_printer_defs.h, clean-local, 21894 native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): 21895 New targets. 21896 * bootstrap: Add generate_mpers_am.sh. 21897 * configure.ac: Add AC_PROG_RANLIB. 21898 * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. 21899 * defs.h: Include mpers_type.h. 21900 Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. 21901 Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. 21902 [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, 21903 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS 21904 for X86_64, X32. 21905 [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, 21906 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS 21907 for X86_64. 21908 Add fallback definitions of 21909 PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, 21910 PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, 21911 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, 21912 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. 21913 * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, 21914 PERSONALITY2_INCLUDE_FUNCS, 21915 PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, 21916 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, 21917 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. 21918 (printers): New struct. Update it when needed. 21919 * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, 21920 m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, 21921 mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, 21922 mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, 21923 native_printer_decls.h, native_printer_defs.h, and printers.h. 21924 21925 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 21926 21927 tests: convert readlink.test and readlinkat.test from match_awk to match_diff 21928 * tests/readlink.c (main): Print expected output. 21929 * tests/readlinkat.c (main): Likewise. 21930 * tests/readlink.test: Use match_diff instead of match_awk. 21931 * tests/readlinkat.test: Likewise. 21932 * tests/readlink.awk: Remove. 21933 * tests/readlinkat.awk: Likewise. 21934 * tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk. 21935 21936 tests: convert getrandom.test from match_awk to match_diff. 21937 * tests/getrandom.c (main): Print expected output. 21938 * tests/getrandom.test: Use match_diff instead of match_awk. 21939 * tests/getrandom.awk: Remove. 21940 * tests/Makefile.am (EXTRA_DIST): Remove getrandom.awk. 21941 21942 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 21943 21944 tests: convert select.test from match_awk to match_diff. 21945 * tests/select.c (main): Print expected output. 21946 * tests/select.test: Use match_diff instead of match_awk. 21947 * tests/select.awk: Remove. 21948 * tests/Makefile.am (EXTRA_DIST): Remove select.awk. 21949 21950 tests: convert several tests from match_grep to match_diff. 21951 * tests/sendfile.test: Use match_diff instead of match_grep. 21952 * tests/sendfile64.test: Likewise. 21953 * tests/time.test: Likewise. 21954 * tests/utime.test: Likewise. 21955 * tests/xet_robust_list.test: Likewise. 21956 * tests/sendfile.c (main): Update match patterns for match_diff. 21957 * tests/sendfile64.c (main): Likewise. 21958 * tests/time.c (main): Likewise. 21959 * tests/utime.c (main): Likewise. 21960 * tests/xet_robust_list.c (main): Likewise. 21961 21962 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 21963 21964 tests: fix match_diff usage. 21965 The first argument of match_diff should be the file with expected 21966 output, the second argument - the file with actual output. 21967 21968 * tests/aio.test: Swap match_diff arguments. 21969 * tests/restart_syscall.test: Likewise. 21970 * tests/seccomp.test: Likewise. 21971 * tests/umovestr2.test: Likewise. 21972 21973 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 21974 21975 build: fix -I options. 21976 * configure.ac (AM_INIT_AUTOMAKE): Add nostdinc. 21977 * Makefile.am (AM_CPPFLAGS): Append -I$(builddir) and -I$(srcdir). 21978 * tests/Makefile.am (AM_CPPFLAGS): Likewise. 21979 21980 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 21981 21982 aio: rewrite from libaio.h to linux/aio_abi.h. 21983 * configure.ac (AC_CHECK_HEADERS): Remove libaio.h. 21984 * aio.c: Assume that <linux/aio_abi.h> is available, 21985 include it instead of <libaio.h>. 21986 [!IOCB_RESFD]: Remove. 21987 (enum iocb_sub): Remove SUB_POLL. 21988 (tprint_lio_opcode): Update. 21989 (print_common_flags): Use IOCB_FLAG_RESFD instead of IOCB_RESFD, 21990 rename fields of struct iocb. 21991 (iocb_is_valid, print_iocb_header, print_iocb): New functions. 21992 (sys_io_submit): Use print_iocb. 21993 (print_io_event): Fix struct io_event decoding. 21994 (sys_io_cancel): Use print_iocb_header. 21995 * strace.spec (BuildRequires): Remove libaio-devel. 21996 * tests/aio.c (main): Test IOCB_CMD_PREADV, io_cancel, 21997 and struct io_event decoding. 21998 * tests/aio.test (syscalls): Add io_cancel. 21999 22000 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 22001 22002 Fix multiple personalities support in parser of io_submit syscall. 22003 Introduce a new helper function to fetch tracee's long integers 22004 and use it to fix multiple personalities support in io_submit parser. 22005 22006 * defs.h (umove_long_or_printaddr): New prototype. 22007 * util.c (umove_long_or_printaddr): New function. 22008 * aio.c (sys_io_submit): Use it to fetch tracee's pointers. 22009 * tests/aio.c: New file. 22010 * tests/aio.test: New test. 22011 * tests/Makefile.am (check_PROGRAMS): Add aio. 22012 (TESTS): Add aio.test. 22013 * tests/.gitignore: Add aio. 22014 22015 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 22016 22017 tests: fix build on systems that lack O_CLOEXEC definition. 22018 * tests/epoll_create1.c (main): Check that O_CLOEXEC is defined. 22019 * tests/eventfd.c (main): Likewise. 22020 * tests/signalfd.c (main): Likewise. 22021 22022 tests: fix build on systems that lack AT_FDCWD definition. 22023 * tests/readlinkat.c: Stop including <fcntl.h>. 22024 (main): Replace AT_FDCWD with -100. 22025 22026 Fix printing of io_getevents first argument. 22027 * aio.c (sys_io_getevents): Print first argument using "%lu" format. 22028 22029 2015-08-26 Mike Frysinger <vapier (a] gentoo.org> 22030 22031 decode extend getsockopt/setsockopt options. 22032 Currently the code assumes the set of valid options between getsockopt 22033 and setsockopt are exactly the same and thus maintains one list. The 22034 kernel unfortunately does not do this -- it allows for different opts 22035 between the get and set functions. See the {g,s}et_opt{min,max} fields 22036 in the various netfilter subcores. 22037 22038 To support this, extend the printxval function to take multiple sets of 22039 xlats as varargs. Then we add the new get/set lists, and pass them down 22040 in the net code when decoding things. 22041 22042 A simple example is iptables; before: 22043 getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0 22044 getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0 22045 after: 22046 getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0 22047 getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0 22048 22049 If these were setsockopt calls, then 0x40 & 0x41 would be 22050 IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS. 22051 22052 * configure.ac: Check for netfilter headers. 22053 * defs.h (printxvals): New prototype. 22054 (printxval): Change to a define. 22055 * net.c: Include netfilter headers and new sockopts headers. 22056 (print_sockopt_fd_level_name): Add a is_getsockopt argument. Change SOL_IP 22057 and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more 22058 xlats down. 22059 (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true. 22060 (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false. 22061 * util.c (printxval): Rename to ... 22062 (printxvals): ... this. Rewrite to be varargs based. 22063 * xlat/getsockipoptions.in: New xlat list. 22064 * xlat/getsockipv6options.in, xlat/setsockipoptions.in, 22065 xlat/setsockipv6options.in: Likewise. 22066 22067 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 22068 22069 Fix build on systems that lack VIDIOC_CREATE_BUFS definition. 22070 * v4l2.c (v4l2_ioctl): Check that v4l2_ioctl is defined. 22071 22072 Fix build on systems that lack EM_ARM/EM_OPENRISC definitions. 22073 * xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB 22074 with EM_ARM check. Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check. 22075 22076 2015-08-25 Dmitry V. Levin <ldv (a] altlinux.org> 22077 22078 Fix build on systems that lack UBI_IOCVOLCRBLK/UBI_IOCVOLRMBLK definitions 22079 * mtd.c (ubi_ioctl): Check that UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK 22080 are defined. 22081 22082 Fix build on systems that lack O_CLOEXEC definition. 22083 * xlat/efd_flags.in: Check that O_CLOEXEC is defined. 22084 * xlat/epollflags.in: Likewise. 22085 * xlat/sfd_flags.in: Likewise. 22086 * xlat/timerfdflags.in: Fix O_CLOEXEC check. 22087 22088 2015-08-21 Elvira Khabirova <lineprinter0 (a] gmail.com> 22089 22090 printsiginfo.c: fix integer conversions. 22091 * printsiginfo.c (printsigsource): Print si_pid and si_uid as unsigned 22092 integers. 22093 (printsigval): Print si_int as signed int. 22094 22095 2015-08-20 Dmitry V. Levin <ldv (a] altlinux.org> 22096 22097 Fix decoding of times syscall return value. 22098 Always print return value of successful times syscall 22099 as unsigned long integer. 22100 22101 * times.c (sys_times): Return RVAL_UDECIMAL unless syserror. 22102 22103 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 22104 22105 mq.c: remove repeated code. 22106 * mq.c (sys_mq_open): Use printmqattr instead of implementing it again. 22107 [HAVE_MQUEUE_H]: Remove. 22108 22109 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 22110 22111 ipc_msg.c: fix multiple personalities support in msgrcv ipc subcall. 22112 When msgrcv syscall is an ipc subcall, msgp (pointer to struct msgbuf) 22113 and msgtyp (message type) syscall arguments are passed via proxy 22114 structure which definition significantly depends on tracee's 22115 wordsize. 22116 22117 * ipc_msg.c (fetch_msgrcv_args): New function. 22118 (sys_msgrcv): Use it. 22119 22120 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 22121 22122 ipc.c: split into separate files. 22123 In preparation for upcoming mpers-related changes, 22124 split ipc.c into independent groups of parsers. 22125 22126 * ipc_defs.h: New file. 22127 * ipc_msg.c: Likewise. 22128 * ipc_msgctl.c: Likewise. 22129 * ipc_sem.c: Likewise. 22130 * ipc_shm.c: Likewise. 22131 * ipc_shmctl.c: Likewise. 22132 * mq.c: Likewise. 22133 * print_mq_attr.c: Likewise. 22134 * print_msgbuf.c: Likewise. 22135 * ipc.c: Remove. 22136 (sys_mq_open, sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, 22137 sys_mq_getsetattr): Move to mq.c. 22138 (sys_msgget, tprint_msgsnd, sys_msgsnd, tprint_msgrcv, sys_msgrcv): Move 22139 to ipc_msg.c. 22140 (sys_msgctl): Move to ipc_msgctl.c. 22141 (tprint_sembuf, tprint_sembuf_array, sys_semop, sys_semtimedop, 22142 sys_semget, syssemctl): Move to ipc_sem.c. 22143 (sys_shmget, sys_shmat, sys_shmdt): Move to ipc_shm.c. 22144 (sys_shmctl): Move to ipc_shmctl.c. 22145 (printmqattr): Move to print_mq_attr.c. 22146 (tprint_msgbuf): Move to print_msgbuf.c. 22147 (IPC_64, PRINTCTL): Move to ipc_defs.h. 22148 * defs.h (struct xlat resource_flags): New prototype. 22149 * Makefile.am (strace_SOURCES): Remove ipc.c. Add ipc_defs.h, mq.c, 22150 ipc_msg.c, ipc_msgctl.c, ipc_sem.c, ipc_shm.c, ipc_shmctl.c, 22151 print_mq_attr.c, and print_msgbuf.c. 22152 22153 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 22154 22155 .gitignore: add sen.h and sys_func.h. 22156 22157 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 22158 22159 tests: add sendfile.test and sendfile64.test. 22160 * tests/sendfile.c: New file. 22161 * tests/sendfile64.c: New file. 22162 * tests/sendfile.test: New test. 22163 * tests/sendfile64.test: New test. 22164 * tests/Makefile.am (check_PROGRAMS): Add sendfile and sendfile64. 22165 (TESTS): Add sendfile.test and sendfile64.test. 22166 * tests/.gitignore: Add sendfile and sendfile64. 22167 22168 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 22169 22170 sendfile: decode file offset both on entering and exiting syscall. 22171 When sendfile is called with a valid pointer to a file offset variable, 22172 kernel updates this variable on successfull exit from syscall. 22173 22174 * sendfile.c (sys_sendfile, sys_sendfile64): Print tcp->u_arg[2] 22175 on exiting syscall as well as on entering. 22176 22177 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 22178 22179 io.c: move sendfile parsers to a separate file. 22180 * sendfile.c: New file. 22181 * Makefile.am (strace_SOURCES): Add it. 22182 * io.c (sys_sendfile, sys_sendfile64): Move to sendfile.c 22183 22184 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 22185 22186 Make printnum_* functions return boolean status. 22187 With this change, printnum_* functions return true iff they 22188 successfully fetched necessary data from tracee's memory. 22189 22190 * defs.h (printnum_short, printnum_int, printnum_int64, 22191 printnum_long_int, printpair_int, printpair_int64): Return bool. 22192 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. 22193 22194 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 22195 22196 mips: print _MIPS_SIM in configure.ac for debug purposes. 22197 * configure.ac [MIPS]: Print _MIPS_SIM. 22198 22199 xtensa: fix several syscall entries. 22200 * linux/xtensa/syscallent.h: Fix nargs in splice, tee, vmsplice, 22201 pselect6, ppoll, epoll_pwait, and set_robust_list syscall entries. 22202 22203 ia64: fix syscall numbers for set_robust_list, get_robust_list, and splice syscalls 22204 * linux/ia64/syscallent.h: Place syscall entries for set_robust_list, 22205 get_robust_list, and splice in correct order. 22206 22207 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 22208 22209 tests: add a test for get_robust_list and set_robust_list decoding. 22210 * tests/xet_robust_list.c: New file. 22211 * tests/xet_robust_list.test: New test. 22212 * tests/Makefile.am (check_PROGRAMS): Add xet_robust_list. 22213 (TESTS): Add xet_robust_list.test. 22214 * tests/.gitignore: Add xet_robust_list. 22215 22216 Simplify printing of get_robust_list first argument. 22217 * get_robust_list.c (sys_get_robust_list): Print first argument 22218 using "%d" format. 22219 22220 2015-08-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 22221 22222 Fix io_setup first argument printing. 22223 * aio.c (sys_io_setup): Print first argument using "%u" format. 22224 22225 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 22226 22227 Fix printing tracee's long integers. 22228 Replace ambiguous printnum_long that used to fetch native long integers 22229 from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong 22230 that fetch tracee's pointer, signed long, and unsigned long integers. 22231 22232 * defs.h (printnum_long, printpair_long): Remove prototypes. 22233 (printnum_int64, printpair_int64): Remove macros, declare functions 22234 unconditionally. 22235 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): 22236 New prototype. 22237 (printnum_ptr, printnum_slong, printnum_ulong): New macros. 22238 * aio.c (sys_io_setup): Use printnum_ulong. 22239 * block.c (block_ioctl): Use printnum_slong and printnum_ulong. 22240 * get_robust_list.c (sys_get_robust_list): Use printnum_ptr 22241 and printnum_ulong. 22242 * io.c (print_off_t): Remove. 22243 (sys_sendfile): Use printnum_ulong. 22244 * ipc.c (sys_semctl): Use printnum_ptr. 22245 * prctl.c (sys_prctl): Likewise. 22246 * process.c (sys_ptrace): Likewise. 22247 * rtc.c (rtc_ioctl): Use printnum_ulong. 22248 * util.c (printnum_long, printpair_long): Remove. 22249 (printnum_int64, printpair_int64): Define unconditionally. 22250 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): 22251 New function. 22252 22253 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 22254 22255 Fix time syscall decoding for some personalities. 22256 * time.c (current_time_t_is_int32): Define. 22257 (sys_time): Use it, printnum_int, and printnum_int64 instead 22258 of printnum_long. 22259 * tests/time.c: New file. 22260 * tests/time.test: New test. 22261 * tests/Makefile.am (check_PROGRAMS): Add time. 22262 (TESTS): Add time.test. 22263 * tests/.gitignore: Add time. 22264 22265 2015-08-18 Mike Frysinger <vapier (a] gentoo.org> 22266 22267 signal: SIGSYS: decode si_syscall & si_arch fields. 22268 When receiving SIGSYS, the si_syscall & si_arch fields are set to known 22269 values, so make sure we decode their values into the symbol settings. 22270 This makes stracing seccomp failures much easier. 22271 22272 * defs.h (syscall_name): New prototype. 22273 * printsiginfo.c: Include linux/audit.h and xlat/audit_arch.h. 22274 (print_si_info): Decode si_syscall & si_arch for SIGSYS. 22275 * syscall.c (undefined_scno_name): Delete. 22276 (syscall_name): New function. 22277 (trace_syscall_entering): Change undefined_scno_name to syscall_name. 22278 (trace_syscall_exiting): Likewise. 22279 * xlat/audit_arch.in: New file. 22280 22281 2015-08-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 22282 22283 ipc.c: remove unnecesarry #ifdef IPC_64. 22284 * ipc.c (PRINTCTL): Remove #ifdef IPC_64 check as IPC_64 is always 22285 defined at this point. 22286 22287 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 22288 22289 resource.c: move times parser to a separate file. 22290 * times.c: New file. 22291 * Makefile.am (strace_SOURCES): Add it. 22292 * resource.c (sys_times): Move to times.c. 22293 22294 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 22295 22296 sysctl.c: remove KERN_JAVA_* defines handling. 22297 This has been obsoleted by binfmt_misc since Linux 2.1.43. 22298 22299 * sysctl.c (sys_sysctl): Remove KERN_JAVA_INTERPRETER 22300 and KERN_JAVA_APPLETVIEWER. 22301 22302 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 22303 22304 sysinfo.c: remove obsolete code. 22305 struct sysinfo members totalhigh, freehigh and mem_unit are present 22306 since Linux 2.3.48. 22307 22308 * configure.ac (AC_CHECK_MEMBERS): Remove struct sysinfo checks. 22309 * sysinfo.c (sys_sysinfo): Remove HAVE_STRUCT_SYSINFO_* checks. 22310 22311 2015-08-15 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 22312 22313 tests: add readlink.test and readlinkat.test. 22314 * tests/readlink.c: New file. 22315 * tests/readlink.awk: Likewise. 22316 * tests/readlinkat.c: Likewise. 22317 * tests/readlinkat.awk: Likewise. 22318 * tests/readlink.test: New test. 22319 * tests/readlinkat.test: Likewise. 22320 * tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat. 22321 (TESTS): Add readlink.test and readlinkat.test. 22322 (EXTRA_DIST): Add readlink.awk and readlinkat.awk. 22323 * tests/.gitignore: Add readlink and readlinkat. 22324 22325 2015-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 22326 22327 Print nanoseconds along with seconds in stat family syscalls. 22328 * configure.ac (AC_CHECK_MEMBERS): Add stat.st_atim.tv_nsec, 22329 stat.st_ctim.tv_nsec, stat.st_mtim.tv_nsec, stat.st_atime_nsec, 22330 stat.st_atime_csec, and stat.st_mtime_nsec. 22331 * file.c: Explicitly define HAVE_STRUCT_STAT_ST_ATIME_NSEC, 22332 HAVE_STRUCT_STAT_ST_CTIME_NSEC and HAVE_STRUCT_STAT_ST_MTIME_NSEC 22333 for locally defined types. 22334 * printstat.h (DO_PRINTSTAT): Print st_atime_nsec, st_ctime_nsec, 22335 and st_mtime_nsec members. 22336 * tests/stat.c [_FILE_OFFSET_BITS == 64]: Use st_atime_nsec, 22337 st_ctime_nsec, and st_mtime_nsec via st_atim.tv_nsec, st_ctim.tv_nsec, 22338 and st_mtim.tv_nsec. 22339 (main): Print st_atime_nsec, st_ctime_nsec, and st_mtime_nsec members. 22340 22341 This fixes Fedora bug #1251176. 22342 22343 2015-08-03 Dmitry V. Levin <ldv (a] altlinux.org> 22344 22345 signalfd4: fix flags decoding. 22346 * configure.ac (AC_CHECK_FUNCS): Add eventfd. 22347 (AC_CHECK_HEADERS): Add sys/signalfd.h. 22348 * signalfd.c: Include <fcntl.h>. 22349 [HAVE_SYS_SIGNALFD_H] Include <sys/signalfd.h>. 22350 Include "xlat/sfd_flags.h". 22351 (do_signalfd): Use sfd_flags for flags decoding. 22352 * xlat/sfd_flags.in: New file. 22353 * tests/signalfd.c: Likewise. 22354 * tests/signalfd.expected: Likewise. 22355 * tests/signalfd.test: New test. 22356 * tests/Makefile.am (check_PROGRAMS): Add signalfd. 22357 (TESTS): Add signalfd.test. 22358 (EXTRA_DIST): Add signalfd.expected. 22359 * tests/.gitignore: Add signalfd. 22360 22361 signalfd, signalfd4: mark return code with RVAL_FD flag. 22362 * signalfd.c (do_signalfd): Set RVAL_FD flag in the return code. 22363 22364 signal.c: move signalfd parsers to a separate file. 22365 * signalfd.c: New file. 22366 * Makefile.am (strace_SOURCES): Add it. 22367 * signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c 22368 22369 perf_event_open: mark return code with RVAL_FD flag. 22370 * perf.c (sys_perf_event_open): Set RVAL_FD flag in the return code. 22371 22372 pipe, pipe2, socketpair: print returned descriptors using printfd. 22373 * net.c (printpair_fd, decode_pair_fd): New functions. 22374 (do_pipe, sys_socketpair): Use them. 22375 22376 socket: mark return code with RVAL_FD flag. 22377 * net.c (sys_socket): Set RVAL_FD flag in the return code. 22378 * tests/net-yy-accept.awk: Update socket and bind regexps. 22379 * tests/unix-yy-accept.awk: Likewise. 22380 * tests/net-yy-connect.awk: Update socket and connect regexps. 22381 * tests/unix-yy-connect.awk: Likewise. 22382 22383 timerfd, timerfd_create: mark return code with RVAL_FD flag. 22384 * time.c (sys_timerfd, sys_timerfd_create): Set RVAL_FD flag 22385 in the return code. 22386 22387 2015-08-02 Dmitry V. Levin <ldv (a] altlinux.org> 22388 22389 inotify_init1: mark return code with RVAL_FD flag. 22390 * inotify.c (sys_inotify_init1): Set RVAL_FD flag in the return code. 22391 22392 fanotify_init: mark return code with RVAL_FD flag. 22393 * fanotify.c (sys_fanotify_init): Set RVAL_FD flag in the return code. 22394 22395 Fix epoll_create syscall decoding. 22396 * epoll.c (sys_epoll_create): New function. 22397 * linux/dummy.h (sys_epoll_create): Remove. 22398 22399 epoll_create1: mark return code with RVAL_FD flag. 22400 * epoll.c (sys_epoll_create1): Set RVAL_FD flag in the return code. 22401 22402 epoll_create1: fix pathtrace support. 22403 * pathtrace.c (pathtrace_match): Add SEN_epoll_create1. 22404 22405 epoll_create1: fix flags decoding. 22406 * xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition 22407 for EPOLL_CLOEXEC. 22408 * tests/epoll_create1.c: New file. 22409 * tests/epoll_create1.expected: Likewise. 22410 * tests/epoll_create1.test: New test. 22411 * tests/Makefile.am (check_PROGRAMS): Add epoll_create1. 22412 (TESTS): Add epoll_create1.test. 22413 (EXTRA_DIST): Add epoll_create1.expected. 22414 * tests/.gitignore: Add epoll_create1. 22415 22416 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 22417 22418 desc.c: move epoll parsers to a separate file. 22419 * epoll.c: New file. 22420 * Makefile.am (strace_SOURCES): Add it. 22421 * desc.c (sys_epoll_create1, print_epoll_event, sys_epoll_ctl, 22422 print_epoll_event_array, epoll_wait_common, epoll_wait, epoll_pwait): 22423 Move to epoll.c. 22424 22425 eventfd2: fix flags decoding. 22426 * configure.ac (AC_CHECK_HEADERS): Add sys/eventfd.h. 22427 * eventfd.c: Include <fcntl.h>. 22428 [HAVE_SYS_EVENTFD_H] Include <sys/eventfd.h>. 22429 Include "xlat/efd_flags.h". 22430 (do_eventfd): Use efd_flags for flags decoding. 22431 * xlat/efd_flags.in: New file. 22432 * tests/eventfd.c: New file. 22433 * tests/eventfd.expected: Likewise. 22434 * tests/eventfd.test: New test. 22435 * tests/Makefile.am (check_PROGRAMS): Add eventfd. 22436 (TESTS): Add eventfd.test. 22437 (EXTRA_DIST): Add eventfd.expected. 22438 * tests/.gitignore: Add eventfd. 22439 22440 eventfd: print first argument as unsigned int. 22441 * eventfd.c (do_eventfd): Explicitly cast initial value to unsigned int. 22442 22443 Mark eventfd return code with RVAL_FD flag. 22444 * eventfd.c (do_eventfd): Set RVAL_FD flag in the return code. 22445 22446 desc.c: move eventfd parsers to a separate file. 22447 * eventfd.c: New file. 22448 * Makefile.am (strace_SOURCES): Add it. 22449 * desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c. 22450 22451 Update PERF_FLAG_* constants. 22452 * xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC, 22453 provide fallback definitions. 22454 22455 desc.c: move perf_event_open parser to a separate file. 22456 * perf.c: New file. 22457 * Makefile.am (strace_SOURCES): Add it. 22458 * desc.c (sys_perf_event_open): Move to perf.c. 22459 22460 2015-08-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 22461 22462 time.c: remove obsolete code from adjtimex parser. 22463 Linux versions 1.3.28 and below are not supported. 22464 22465 * time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove. 22466 22467 2015-08-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 22468 22469 ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/ 22470 * ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in. 22471 Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in. 22472 Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in. 22473 22474 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 22475 22476 tests/ppoll: replace SIGABRT with SIGHUP. 22477 Use SIGHUP instead of SIGABRT, the number of the former 22478 is more portable across architectures. 22479 22480 * tests/ppoll.c (test2): Replace SIGABRT with SIGHUP. 22481 * tests/ppoll.expected: Update regexp. 22482 * tests/ppoll-v.expected: Likewise. 22483 22484 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 22485 22486 decode_poll_exiting: reserve more space in output buffer. 22487 * poll.c (decode_poll_exiting): Reserve more space in output buffer. 22488 22489 2015-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 22490 22491 Cleanup poll/ppoll decoders. 22492 * poll.c (decode_poll): Split into print_pollfd, decode_poll_entering, 22493 and decode_poll_exiting. 22494 (sys_poll, sys_ppoll): Update callers. 22495 * tests/ppoll.c: New file. 22496 * tests/ppoll.expected: Likewise. 22497 * tests/ppoll-v.expected: Likewise. 22498 * tests/ppoll.test: New test. 22499 * tests/Makefile.am (check_PROGRAMS): Add ppoll. 22500 (TESTS): Add ppoll.test. 22501 (EXTRA_DIST): Add ppoll.expected and ppoll-v.expected. 22502 * tests/.gitignore: Add ppoll. 22503 22504 poll: print timeout argument as int. 22505 * poll.c (sys_poll): Explicitly cast timeout argument to int. 22506 22507 stream.c: move poll and ppoll parsers to a separate file. 22508 * poll.c: New file. 22509 * Makefile.am (strace_SOURCES): Add it. 22510 * stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c. 22511 22512 Assume that <poll.h> is available. 22513 * configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h. 22514 * pathtrace.c: Include <poll.h> unconditionally. 22515 * stream.c: Likewise. 22516 [HAVE_SYS_POLL_H]: Compile unconditionally. 22517 [!HAVE_SYS_POLL_H]: Remove. 22518 22519 tests: add oldselect.test. 22520 * tests/oldselect.c: New file. 22521 * tests/oldselect.expected: Likewise. 22522 * tests/oldselect.test: New test. 22523 * tests/Makefile.am (check_PROGRAMS): Add oldselect. 22524 (TESTS): Add oldselect.test. 22525 (EXTRA_DIST): Add oldselect.expected. 22526 * tests/.gitignore: Add oldselect. 22527 22528 2015-07-30 Elvira Khabirova <lineprinter0 (a] gmail.com> 22529 22530 Fix oldselect decoding on 64-bit architectures. 22531 As struct sel_arg_struct is an array of 32-bit values, 22532 fetch it using an intermediate array on 64-bit architectures. 22533 22534 * desc.c (sys_oldselect): Rename args to long_args. 22535 [SIZEOF_LONG == 4] Alias oldselect_args to long_args. 22536 [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args. 22537 * linux/sh64/syscallent.h (oldselect): Remove. 22538 22539 2015-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 22540 22541 net.c: use printaddr. 22542 * net.c (printsock, sys_recvfrom): Use printaddr. 22543 22544 2015-07-30 Denys Vlasenko <dvlasenk (a] redhat.com> 22545 22546 net.c: recvfrom fixes. 22547 This change fixes these three problems (before/after is shown): 22548 22549 On interrupted syscall, flags are not decoded: 22550 22551 -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS 22552 +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS 22553 22554 If peer address is unavalable (example: anon sockets from socketpair()), 22555 kernel returns socklen of 0, but we ignore that and show bogus sockaddr data: 22556 22557 -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10 22558 +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10 22559 22560 SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock(): 22561 22562 - printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); 22563 + printsock(tcp, tcp->u_arg[4], fromlen); 22564 22565 2015-07-29 Elliott Hughes <enh (a] google.com> 22566 22567 prctl: decode Android-specific PR_SET_VMA. 22568 Android kernels have a prctl to name VMAs. 22569 22570 * prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA. 22571 22572 2015-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 22573 22574 mips: fix stub files. 22575 This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. 22576 22577 * linux/mips/genstub.sh: Output SEN(printargs) instead of printargs. 22578 22579 Reported-by: Elliott Hughes <enh (a] google.com> 22580 22581 2015-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 22582 22583 tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc. 22584 * configure.ac: Check how union bpf_attr.log_buf initialization works. 22585 * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF. 22586 22587 Implement sched_getattr and sched_setattr syscalls decoding. 22588 * xlat/sched_flags.in: New file. 22589 * sched.c: Include "xlat/sched_flags.h". 22590 (print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions. 22591 * linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove. 22592 * tests/sched_xetattr.c: New file. 22593 * tests/sched_xetattr.test: New test. 22594 * tests/Makefile.am (check_PROGRAMS): Add sched_xetattr. 22595 (TESTS): Add sched_xetattr.test. 22596 * tests/.gitignore: Add sched_xetattr. 22597 22598 Implement memfd_create syscall decoding. 22599 * memfd_create.c: New file. 22600 * Makefile.am (strace_SOURCES): Add it. 22601 * linux/dummy.h (sys_memfd_create): Remove. 22602 * pathtrace.c (pathtrace_match): Add SEN_memfd_create. 22603 * xlat/memfd_create_flags.in: New file. 22604 * tests/memfd_create.c: New file. 22605 * tests/memfd_create.expected: Likewise. 22606 * tests/memfd_create.test: New test. 22607 * tests/Makefile.am: (check_PROGRAMS): Add memfd_create. 22608 (TESTS): Add memfd_create.test. 22609 (EXTRA_DIST): Add memfd_create.expected. 22610 * tests/.gitignore: Add memfd_create. 22611 22612 2015-07-28 Elliott Hughes <enh (a] google.com> 22613 22614 Fix builds where HAVE_MQUEUE_H isn't defined. 22615 Android doesn't have <mqueue.h>. 22616 22617 * ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation. 22618 22619 2015-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 22620 22621 tests/restart_syscall: skip if nanosleep looks uninterrupted. 22622 * tests/restart_syscall.test: Skip if restart_syscall is not detected 22623 and nanosleep syscall looks uninterrupted. 22624 22625 Implement execveat syscall decoding. 22626 * execve.c (decode_execve): New function. 22627 (sys_execve): Use it. 22628 (sys_execveat): New function. 22629 * linux/dummy.h (sys_execveat): Remove. 22630 * tests/execveat.c: New file. 22631 * tests/execveat.expected: Likewise. 22632 * tests/execveat-v.expected: Likewise. 22633 * tests/execveat.test: New test. 22634 * tests/Makefile.am (check_PROGRAMS): Add execveat. 22635 (TESTS): Add execveat.test. 22636 (EXTRA_DIST): Add execveat.expected and execveat-v.expected. 22637 * tests/.gitignore: Add execveat. 22638 22639 execve: fix support of personalities with different word size. 22640 * execve.c (printargc): Do not assume that host and target pointers have 22641 the same size. 22642 * tests/execve.c: New file. 22643 * tests/execve.expected: Likewise. 22644 * tests/execve-v.expected: Likewise. 22645 * tests/execve.test: New test. 22646 * tests/Makefile.am (check_PROGRAMS): Add execve. 22647 (TESTS): Add execve.test. 22648 (EXTRA_DIST): Add execve.expected and execve-v.expected. 22649 * tests/.gitignore: Add execve. 22650 22651 Implement bpf syscall decoding. 22652 * bpf.c: New file. 22653 * Makefile.am (strace_SOURCES): Add it. 22654 * configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h. 22655 * linux/dummy.h (sys_bpf): Remove. 22656 * pathtrace.c (pathtrace_match): Add SEN_bpf. 22657 * xlat/bpf_commands.in: New file. 22658 * xlat/bpf_map_types.in: New file. 22659 * xlat/bpf_map_update_elem_flags.in: New file. 22660 * xlat/bpf_prog_types.in: New file. 22661 * tests/bpf.c: New file. 22662 * tests/bpf.test: New test. 22663 * tests/Makefile.am (check_PROGRAMS): Add bpf. 22664 (TESTS): Add bpf.test. 22665 * tests/.gitignore: Add bpf. 22666 22667 2015-07-25 Dmitry V. Levin <ldv (a] altlinux.org> 22668 22669 prctl: fix decoding of unrecognized commands. 22670 The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong: 22671 when the first argument is already printed, printargs cannot be called. 22672 22673 * prctl.c (print_prctl_args): New function. 22674 (sys_prctl): Use it. 22675 22676 2015-07-23 Dmitry V. Levin <ldv (a] altlinux.org> 22677 22678 Macroize -m32/-mx32 configure checks. 22679 Prepare for additional configure checks that would be needed 22680 for new multiple personalities support. 22681 22682 * m4/mpers.m4: New file. 22683 * configure.ac: Use it. 22684 22685 2015-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 22686 22687 tests/uid: import uid overflow check from tests/uid16. 22688 * tests/uid.c (main): Skip if the uid returned by getuid matches 22689 /proc/sys/kernel/overflowuid. 22690 22691 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 22692 22693 sh64: fix inotify_{add,rm}_watch syscall entries. 22694 * linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch): 22695 Set sys_func. 22696 22697 microblaze: fix several syscall entries. 22698 * linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1, 22699 dup3, pipe2, inotify_init1, recvmmsg): Set sys_func. 22700 22701 hppa: fix several syscall entries. 22702 * linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink, 22703 mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr, 22704 clock_nanosleep, signalfd, timerfd): Set sys_func. 22705 22706 ia64: fix getpagesize syscall entry. 22707 * linux/ia64/syscallent.h (getpagesize): Fux nargs. 22708 22709 avr32: fix fstatat64 syscall entry. 22710 * linux/avr32/syscallent.h (fstatat64): Set sys_func. 22711 22712 alpha: fix 2 dummy osf syscall entries. 22713 * linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs. 22714 (osf_sigstack): Fix nargs and sys_name. 22715 22716 alpha, arm, ia64, mips, sh64: fix semop syscall entries. 22717 * linux/alpha/syscallent.h (semop): Fix nargs, set sys_func. 22718 * linux/ia64/syscallent.h (semop): Set sys_func. 22719 * linux/mips/syscallent-n32.h (semop): Likewise. 22720 * linux/mips/syscallent-n64.h (semop): Likewise. 22721 * linux/arm/syscallent.h (semop): Fix nargs. 22722 * linux/sh64/syscallent.h (semop): Likewise. 22723 22724 m68k: fix getpagesize decoding. 22725 * linux/m68k/syscallent.h (getpagesize): Set sys_func. 22726 * mem.c [M68K] (sys_getpagesize): Define. 22727 22728 tests/ip_mreq: skip if basic setsockopt operations fail. 22729 * tests/ip_mreq.c (main): Return 77 if basic 22730 IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set. 22731 22732 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 22733 22734 tests: use -lpthread instead of -pthread. 22735 On some obscure systems, -lpthread is more likely to work than -pthread. 22736 22737 * tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to 22738 filter_unavailable_LDADD and change to -lpthread. 22739 22740 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 22741 22742 mips o32: fix utimensat syscall entry. 22743 * linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func. 22744 22745 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 22746 22747 linux/mips/syscallent-compat.h: use designated initializers. 22748 Change linux/mips/syscallent-compat.h to use designated initializers 22749 like normal syscallent.h files. 22750 22751 * linux/mips/syscallent-compat.h: Use designated initializers. 22752 22753 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 22754 22755 linux/mips/syscallent-compat.h: fix initalization of empty entries. 22756 This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. 22757 22758 * linux/mips/syscallent-compat.h: Fix initalization of empty entries. 22759 22760 2015-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 22761 22762 Remove unused parsers of getmsg and putmsg. 22763 * stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove. 22764 Stop including "xlat/msgflags.h". 22765 * xlat/msgflags.in: Remove. 22766 22767 sigreturn: make use of RVAL_DECODED. 22768 * sigreturn.c (arch_sigreturn): New function. 22769 (sys_sigreturn): Use it. Return RVAL_DECODED. 22770 * linux/alpha/arch_sigreturn.c: Update. 22771 * linux/crisv10/arch_sigreturn.c: Likewise. 22772 * linux/m68k/arch_sigreturn.c: Likewise. 22773 * linux/microblaze/arch_sigreturn.c: Likewise. 22774 * linux/x86_64/arch_sigreturn.c: Likewise. 22775 22776 or1k_atomic.c: make use of RVAL_DECODED. 22777 * or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED. 22778 22779 Update openat parser for the RVAL_DECODED change. 22780 * open.c (sys_openat): Update for RVAL_DECODED. 22781 22782 bjm.c: make use of RVAL_DECODED. 22783 * bjm.c (sys_create_module, sys_delete_module, sys_init_module, 22784 sys_finit_module): Update for RVAL_DECODED. 22785 22786 access.c: make use of RVAL_DECODED. 22787 * access.c (decode_access, sys_faccessat): Update for RVAL_DECODED. 22788 22789 affinity.c: make use of RVAL_DECODED. 22790 * affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED. 22791 22792 affinity.c: use printaddr and umove_or_printaddr. 22793 * affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr. 22794 (sys_sched_getaffinity): Remove redundant u_rval check. 22795 22796 aio.c: enhance io_* syscalls decoding. 22797 * aio.c (sys_io_setup): Use printnum_int64 and printnum_long. 22798 (sys_io_destroy, sys_io_submit): Update for RVAL_DECODED. 22799 (sys_io_submit): Use umove_or_printaddr and printaddr. 22800 Enclose iocb array in square brackets. 22801 Change to traditional structure output format. 22802 (print_io_event): New function. 22803 (sys_io_cancel, sys_io_getevents): Use it. 22804 (sys_io_cancel): Use umove_or_printaddr and printaddr. 22805 (sys_io_getevents): Use printaddr. 22806 22807 cacheflush.c: make use of RVAL_DECODED. 22808 * cacheflush.c (sys_cacheflush): Update for RVAL_DECODED. 22809 22810 cacheflush.c: use printaddr. 22811 * cacheflush.c (sys_cacheflush): Use printaddr. 22812 22813 capability.c: make use of RVAL_DECODED. 22814 * capability.c (sys_capset): Update for RVAL_DECODED. 22815 22816 capability.c: use printaddr and umove_or_printaddr. 22817 * capability.c (get_cap_header): Use printaddr. 22818 (print_cap_data): Use printaddr and umove_or_printaddr. 22819 22820 chdir.c: make use of RVAL_DECODED. 22821 * chdir.c (sys_chdir): Update for RVAL_DECODED. 22822 22823 chmod.c: make use of RVAL_DECODED. 22824 * chmod.c (decode_chmod): Change to return void. 22825 (sys_chmod, sys_fchmodat): Update callers. Update for RVAL_DECODED. 22826 (sys_fchmod): Update for RVAL_DECODED. 22827 22828 clone.c: make use of RVAL_DECODED. 22829 * clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED. 22830 22831 Alias sys_epoll_create to printargs_ld. 22832 * desc.c (sys_epoll_create): Remove. 22833 * linux/dummy.h (sys_epoll_create): Alias to printargs_ld. 22834 22835 desc.c: make use of RVAL_DECODED. 22836 * desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1, 22837 sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update 22838 for RVAL_DECODED. 22839 22840 desc.c: do not use xmalloc, use umove_or_printaddr and printaddr. 22841 * desc.c (printflock64, printflock): Use umove_or_printaddr. 22842 (decode_select): Do not use xmalloc. Use umoven_or_printaddr 22843 and printaddr. 22844 (sys_oldselect): Use printaddr. 22845 (sys_epoll_ctl): Use umoven_or_printaddr and printaddr. 22846 (print_epoll_event_array): New function. 22847 (sys_epoll_wait_common): Use it. 22848 (sys_pselect6): Use umove_or_printaddr. 22849 (sys_eventfd2): Use printaddr. 22850 22851 xlat/epollctls.in: add default values. 22852 * xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add 22853 default values. 22854 22855 dirent.c: do not use xmalloc. 22856 * dirent.c (print_old_dirent): Use umove_or_printaddr. 22857 (sys_readdir): Use printaddr. 22858 (sys_getdents, sys_getdents64): Do not use xmalloc for dirents, 22859 treat malloc failure the same way as umoven failure. Use printaddr. 22860 22861 execve.c: make use of RVAL_DECODED. 22862 * execve.c (sys_execve, sys_execv): Update for RVAL_DECODED. 22863 22864 execve.c: use printaddr and umove_or_printaddr. 22865 * execve.c (printargv): Use umoven_or_printaddr. 22866 (sys_execve, sys_execv): Use printaddr. 22867 22868 fadvise.c: make use of RVAL_DECODED. 22869 * fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED. 22870 22871 fallocate.c: make use of RVAL_DECODED. 22872 * fallocate.c (sys_fallocate): Update for RVAL_DECODED. 22873 22874 fanotify.c: make use of RVAL_DECODED. 22875 * fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update 22876 for RVAL_DECODED. 22877 22878 fchownat.c: make use of RVAL_DECODED. 22879 * fchownat.c (sys_fchownat): Update for RVAL_DECODED. 22880 22881 file.c: use umove_or_printaddr. 22882 * file.c (printstat32, printstatsol): Remove. 22883 (printstat, printstat64, printoldstat): Use umove_or_printaddr. 22884 22885 futex.c: enhance futex syscall decoding. 22886 * futex.c (sys_futex): Use switch statement. Use printaddr. 22887 Print uint32_t syscall arguments using %u format. 22888 Update for RVAL_DECODED. 22889 22890 get_robust_list.c: use printnum_long. 22891 * get_robust_list.c (sys_get_robust_list): Use printnum_long. 22892 22893 getcpu.c: use printnum_int and printaddr. 22894 * getcpu.c (sys_getcpu): Use printnum_int and printaddr. 22895 22896 getcwd.c: use printaddr. 22897 * getcwd.c (sys_getcwd): Use printaddr. 22898 22899 getrandom.c: use printaddr. 22900 * getrandom.c (sys_getrandom): Use printaddr. 22901 22902 hostname.c: make use of RVAL_DECODED. 22903 * hostname.c (sys_sethostname): Update for RVAL_DECODED. 22904 22905 hostname.c: use printaddr. 22906 * hostname.c (sys_gethostname): Use printaddr. 22907 22908 inotify.c: make use of RVAL_DECODED. 22909 * inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch, 22910 sys_inotify_init1): Update for RVAL_DECODED. 22911 22912 io.c: make use of RVAL_DECODED. 22913 * io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile, 22914 sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update 22915 for RVAL_DECODED. 22916 22917 Use printnum_int64 instead of print_loff_t. 22918 * defs.h (print_loff_t): Remove. 22919 * io.c (print_loff_t): Remove. 22920 (sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t. 22921 * mtd.c (mtd_ioctl): Likewise. 22922 22923 io.c: use printaddr and umove_or_printaddr. 22924 * io.c (sys_read, sys_pread): Use printaddr. 22925 (tprint_iov_upto): Do not fetch data in case of syserror. 22926 Use printaddr. 22927 (sys_readv, sys_preadv): Remove redundant check for syserror. 22928 (print_off_t): Use printnum_int and printnum_long. 22929 (print_loff_t): Use umove_or_printaddr. 22930 22931 ioprio.c: make use of RVAL_DECODED. 22932 * ioprio.c (sys_ioprio_set): Update for RVAL_DECODED. 22933 22934 ipc.c: use printaddr and umove_or_printaddr. 22935 * ipc.c (sys_msgctl): Use printaddr. 22936 (tprint_msgbuf): New function. 22937 (tprint_msgsnd, tprint_msgrcv): Use it. 22938 (sys_msgrcv): Use umove_or_printaddr. 22939 (tprint_sembuf): Rename to tprint_sembuf_array. 22940 (tprint_sembuf): New function. 22941 (tprint_sembuf_array): Use it. 22942 (sys_semop, sys_semtimedop): Update callers. 22943 (sys_shmctl, sys_shmat, sys_shmdt): Use printaddr. 22944 (sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr. 22945 * tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp. 22946 * tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp. 22947 22948 kexec.c: use printaddr and umove_or_printaddr. 22949 * kexec.c (print_seg): New function. 22950 (print_kexec_segments): Use it. Use printaddr and umove_or_printaddr. 22951 (kexec_load): Use printaddr. Update for RVAL_DECODED. 22952 22953 keyctl.c: make use of RVAL_DECODED. 22954 * keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED. 22955 (keyctl_join_session_keyring, keyctl_handle_key, 22956 keyctl_set_reqkey_keyring): Remove. 22957 (keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key, 22958 keyctl_read_key, keyctl_keyring_search, keyctl_chown_key, 22959 keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key, 22960 keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent, 22961 keyctl_setperm_key): Change to return void. 22962 Update for RVAL_DECODED. 22963 (sys_keyctl): Update callers. Update for RVAL_DECODED. 22964 22965 keyctl.c: use printaddr. 22966 * keyctl.c (keyctl_read_key): Use printaddr. 22967 22968 ldt.c: make use of RVAL_DECODED. 22969 * ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): 22970 Update for RVAL_DECODED. 22971 22972 ldt.c: use printaddr and umove_or_printaddr. 22973 * ldt.c [I386 || X86_64 || X32] (print_user_desc): 22974 Use umove_or_printaddr. 22975 [I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr. 22976 [(M68K || MIPS] (set_thread_area): Likewise. 22977 [I386 || X86_64 || X32] (set_thread_area): Do not fetch data 22978 if !verbose. 22979 [I386 || X86_64 || X32] (get_thread_area): Remove redundant check 22980 for syserror. 22981 22982 link.c: make use of RVAL_DECODED. 22983 * link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update 22984 for RVAL_DECODED. 22985 22986 lseek.c: make use of RVAL_DECODED. 22987 * lseek.c (sys_lseek): Update for RVAL_DECODED. 22988 22989 lseek.c: use printnum_int64. 22990 * lseek.c (sys_llseek): Use printnum_int64. 22991 22992 mem.c: make use of RVAL_DECODED. 22993 * mem.c (print_mmap): Change to return void. 22994 Update for RVAL_DECODED. 22995 (sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff, 22996 sys_mmap_4koff): Update callers. Update for RVAL_DECODED. 22997 (sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise, 22998 sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind, 22999 sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot): 23000 Update for RVAL_DECODED. 23001 23002 mem.c: use printaddr and umove_or_printaddr. 23003 * mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap, 23004 sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes, 23005 sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr. 23006 (sys_get_mempolicy): Use printaddr and umove_or_printaddr. 23007 23008 mknod.c: make use of RVAL_DECODED. 23009 * mknod.c (decode_mknod): Change to return void. 23010 Update for RVAL_DECODED. 23011 (sys_mknod, sys_mknodat): Update callers. Update for RVAL_DECODED. 23012 [SPARC || SPARC64] (xmknod): Update for RVAL_DECODED. 23013 23014 mount.c: make use of RVAL_DECODED. 23015 * mount.c (sys_mount): Update for RVAL_DECODED. 23016 23017 mount.c: use printaddr. 23018 * mount.c (sys_mount): Use printaddr. 23019 23020 Alias sys_connect to sys_bind. 23021 * linux/dummy.h (sys_connect): Alias to sys_bind. 23022 * net.c (sys_connect): Remove. 23023 23024 net.c: make use of RVAL_DECODED. 23025 * net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto, 23026 sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED. 23027 23028 net.c: use printaddr and umove_or_printaddr. 23029 * net.c (printsock): Use printaddr and umove_or_printaddr. 23030 (printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname, 23031 sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred, 23032 print_tpacket_stats, print_icmp_filter, print_getsockopt, 23033 print_group_req, print_tpacket_req, print_packet_mreq, 23034 print_setsockopt): Use printaddr. 23035 (print_mreq, print_mreq6): Use umove_or_printaddr. 23036 23037 2015-07-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 23038 23039 tests: add sigaltstack.test. 23040 * tests/sigaltstack.c: New file. 23041 * tests/sigaltstack.expected: Likewise. 23042 * tests/sigaltstack.test: New test. 23043 * tests/Makefile.am (check_PROGRAMS): Add sigaltstack. 23044 (TESTS): Add sigaltstack.test. 23045 (EXTRA_DIST): sigaltstack.expected. 23046 * tests/.gitignore: Add sigaltstack. 23047 23048 bootstrap: delete personality test directories beforehand. 23049 * bootstrap: Delete tests-m32 and tests-mx32 directories 23050 before creating them. 23051 23052 2015-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 23053 23054 defs.h: do not include <signal.h> 23055 * printsiginfo.h: New file. 23056 * Makefile.am (strace_SOURCES): Add it. 23057 * defs.h: Do not include <signal.h>. 23058 (printsiginfo): Remove. 23059 * printsiginfo.c: Include <signal.h> and "printsiginfo.h". 23060 * strace.c: Likewise. 23061 * sigaltstack.c: Include <signal.h>. 23062 * signal.c: Likewise. 23063 * sigreturn.c: Likewise. 23064 * time.c: Likewise. 23065 23066 resource.c: move printrusage and printrusage32 to a separate file. 23067 * printrusage.c: New file. 23068 * Makefile.am (strace_SOURCES): Add it. 23069 * resource.c (printrusage, [ALPHA] printrusage32): Move 23070 to printrusage.c. 23071 23072 open.c: make use of RVAL_DECODED. 23073 * open.c (decode_open, sys_creat): Update for RVAL_DECODED. 23074 23075 personality.c: make use of RVAL_DECODED. 23076 * personality.c (sys_personality): Update for RVAL_DECODED. 23077 23078 printsiginfo.c: use umove_or_printaddr. 23079 * printsiginfo.c (printsiginfo_at): Use umove_or_printaddr. 23080 23081 prctl.c: make use of RVAL_DECODED. 23082 * prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl. 23083 (sys_prctl, sys_arch_prctl): Update for RVAL_DECODED. 23084 23085 prctl.c: use printaddr and umove_or_printaddr. 23086 * prctl.c (prctl_exit): Use printaddr and umove_or_printaddr. 23087 23088 process.c: use printaddr. 23089 * process.c (sys_ptrace): Use printaddr. 23090 23091 process_vm.c: make use of RVAL_DECODED. 23092 * process_vm.c (sys_process_vm_writev): Update for RVAL_DECODED. 23093 23094 process_vm.c: use printaddr. 23095 * process_vm.c (sys_process_vm_readv): Use printaddr. 23096 23097 reboot.c: make use of RVAL_DECODED. 23098 * reboot.c (sys_reboot): Update for RVAL_DECODED. 23099 23100 Enhance quotactl decoding. 23101 * quota.c (decode_cmd_data): Use umove_or_printaddr. 23102 (sys_quotactl): Do not disable the parser in verbose mode. 23103 Decode all "set" commands on entering syscall. 23104 23105 readahead.c: make use of RVAL_DECODED. 23106 * readahead.c (sys_readahead.c): Update for RVAL_DECODED. 23107 23108 readlink.c: use printaddr. 23109 * readlink.c (decode_readlink): Use printaddr. 23110 23111 renameat.c: make use of RVAL_DECODED. 23112 * renameat.c (sys_renameat, sys_renameat2): Update for RVAL_DECODED. 23113 23114 resource.c: make use of RVAL_DECODED. 23115 * resource.c (sys_setrlimit, sys_getpriority, sys_setpriority): 23116 Update for RVAL_DECODED. 23117 23118 resource.c: use umove_or_printaddr. 23119 * resource.c (print_rlimit64, print_rlimit32, printrusage32, 23120 printrusage, sys_times): Use umove_or_printaddr. 23121 (decode_rlimit64): Remove. 23122 (decode_rlimit): Remove redundant checks. 23123 [defined(current_wordsize) && current_wordsize != 4] (decode_rlimit): 23124 Define to print_rlimit64. 23125 (sys_prlimit64): Replace decode_rlimit64 with print_rlimit64. 23126 23127 sched.c: make use of RVAL_DECODED. 23128 * sched.c (sys_sched_setscheduler, sys_sched_setparam, 23129 sys_sched_get_priority_min): Update for RVAL_DECODED. 23130 23131 sched.c: use printnum_int and printaddr. 23132 * sched.c (sys_sched_setscheduler, sys_sched_getparam, 23133 sys_sched_setparam): Use printnum_int for sched_param decoding. 23134 (sched_rr_get_interval): Use printaddr. 23135 23136 scsi.c: use printaddr. 23137 * scsi.c (print_sg_io_buffer): Use printaddr. 23138 23139 2015-07-17 Dmitry V. Levin <ldv (a] altlinux.org> 23140 23141 seccomp.c: make use of RVAL_DECODED. 23142 * seccomp.c (sys_seccomp): Update for RVAL_DECODED. 23143 23144 seccomp.c: use printaddr and umove_or_printaddr. 23145 * seccomp.c (decode_fprog, decode_seccomp_set_mode_strict): 23146 Use printaddr. 23147 (print_seccomp_filter): Use umove_or_printaddr. 23148 23149 sigaltstack.c: use printaddr and umove_or_printaddr. 23150 * sigaltstack.c (print_stack_t): Use umove_or_printaddr and printaddr. 23151 23152 signal.c: make use of RVAL_DECODED. 23153 * signal.c (sys_sigsuspend, sys_kill, sys_tgkill, sys_rt_sigsuspend, 23154 sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, sys_restart_syscall, 23155 do_signalfd): Update for RVAL_DECODED. 23156 23157 signal.c: use printaddr and umove_or_printaddr. 23158 * signal.c (print_sigset_addr_len, decode_old_sigaction): 23159 Use printaddr and umove_or_printaddr. 23160 (sys_signal): Use printaddr. 23161 (sys_sigprocmask, sys_sigpending, sys_rt_sigprocmask, 23162 sys_rt_sigpending): Remove redundant checks for syserror. 23163 (decode_new_sigaction): Use umove_or_printaddr. 23164 23165 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 23166 23167 sram_alloc.c: make use of RVAL_DECODED. 23168 * sram_alloc.c [BFIN] (sys_sram_alloc): Update for RVAL_DECODED. 23169 23170 statfs.c: use umove_or_printaddr. 23171 * statfs.c (printstatfs, printstatfs64, printcompat_statfs64): 23172 Use umove_or_printaddr. 23173 23174 swapon.c: make use of RVAL_DECODED. 23175 * swapon.c (sys_swapon): Update for RVAL_DECODED. 23176 23177 swapon.c: move fallback definitions of swap options to xlat/ 23178 * swapon.c: Move definitions of SWAP_FLAG_* flags ... 23179 * xlat/swap_flags.in: ... here. 23180 23181 sync_file_range2: fix typo in flags decoding. 23182 * sync_file_range.c (sys_sync_file_range2): Fix typo in flags decoding. 23183 23184 sync_file_range.c: make use of RVAL_DECODED. 23185 * sync_file_range.c (sys_sync_file_range, sys_sync_file_range2): Update 23186 for RVAL_DECODED. 23187 23188 syslog.c: use umove_or_printaddr and RVAL_DECODED. 23189 * sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED. 23190 23191 sysinfo.c: use umove_or_printaddr. 23192 * sysinfo.c (sys_sysinfo): Use umove_or_printaddr. 23193 23194 syslog.c: make use of RVAL_DECODED. 23195 * syslog.c (sys_syslog): Update for RVAL_DECODED. 23196 23197 syslog.c: use printaddr. 23198 * syslog.c (sys_syslog): Use printaddr. 23199 23200 sysmips.c: cleanup. 23201 * sysmips.c [MIPS] (sys_sysmips): Use switch statement. Use printaddr. 23202 Fix misprinted ", " delimiter. 23203 23204 sysmips.c: make use of RVAL_DECODED. 23205 * sysmips.c [MIPS] (sys_sysmips): Update for RVAL_DECODED. 23206 23207 time.c: make use of RVAL_DECODED. 23208 * time.c (sys_settimeofday, sys_osf_settimeofday, sys_clock_settime, 23209 sys_timerfd, sys_timerfd_create, sys_timerfd_settime): Update 23210 for RVAL_DECODED. 23211 (timerfd_gettime): Decode struct itimerspec argument on exiting syscall. 23212 23213 time.c: use printaddr, printnum_int, and umoven_or_printaddr. 23214 * time.c (sys_nanosleep): Use printaddr. 23215 (printitv_bitness, tprint_timex32, tprint_timex, printsigevent32, 23216 printsigevent): Use umoven_or_printaddr. 23217 (sys_timer_create): Use printnum_int. 23218 (sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer, 23219 do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove 23220 redundant checks for syserror. 23221 23222 sprinttv: do not fetch data in case of syserror. 23223 * time.c (sprinttv): Do not fetch data in case syserror. 23224 Print address instead of {...} in case of umove failure. 23225 (sys_gettimeofday, sys_osf_gettimeofday, sys_adjtime, sys_clock_gettime, 23226 clock_nanosleep): Remove now redundant checks for syserror. 23227 23228 truncate.c: make use of RVAL_DECODED. 23229 * truncate.c (sys_truncate, sys_truncate64, sys_ftruncate, 23230 sys_ftruncate64): Update for RVAL_DECODED. 23231 23232 umask.c: make use of RVAL_DECODED. 23233 * umask.c (sys_umask): Update for RVAL_DECODED. 23234 23235 umount.c: make use of RVAL_DECODED. 23236 * umount.c (sys_umount2): Update for RVAL_DECODED. 23237 23238 utimes.c: make use of RVAL_DECODED. 23239 * utimes.c (decode_utimes): Change to return void. 23240 Update for RVAL_DECODED. 23241 (sys_utimes, sys_futimesat, sys_utimensat, sys_osf_utimes): 23242 Update callers. Update for RVAL_DECODED. 23243 23244 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 23245 23246 tests/uid.test: adopt for alpha. 23247 Make the test work on alpha that has getxuid syscall instead of getuid. 23248 23249 * tests/uid.awk (BEGIN): Update getuid regexp to match both getuid 23250 and getxuid syscalls. 23251 * tests/uid.c (main): Allow __NR_getxuid as an alternative 23252 to __NR_getuid. 23253 * tests/uid.test: If getuid syscall is not available, probe for 23254 getxuid syscall. 23255 23256 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 23257 23258 uid.c: make use of RVAL_DECODED. 23259 * uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown, 23260 sys_setgroups): Update for RVAL_DECODED. 23261 23262 uid.c: use printaddr and umoven_or_printaddr. 23263 * uid.c (get_print_uid): Use umoven_or_printaddr. 23264 (sys_getresuid): Do not check for syserror, get_print_uid now does 23265 the right thing. 23266 (sys_setgroups, sys_getgroups): Add const qualifier to local variables 23267 that are assigned once. Use printaddr. 23268 23269 ia64: wire up utimensat syscall. 23270 * linux/ia64/syscallent.h (utimensat): New entry. 23271 23272 decode_utimes: enclose timespec array in square brackets. 23273 * utimes.c (decode_utimes): enclose timespec array in square brackets 23274 instead of curly brackets. 23275 23276 uname.c: use umove_or_printaddr. 23277 * uname.c (sys_uname): Use umove_or_printaddr. 23278 23279 tests: add utime.test. 23280 * tests/utime.c: New file. 23281 * tests/utime.test: New test. 23282 * tests/Makefile.am (check_PROGRAMS): Add utime. 23283 (TESTS): Add utime.test. 23284 * tests/.gitignore: Add utime. 23285 23286 utime.c: make use of RVAL_DECODED. 23287 * utime.c (sys_utime): Update for RVAL_DECODED. 23288 23289 utime.c: use umoven_or_printaddr. 23290 * utime.c (sys_utime): Use umoven_or_printaddr. 23291 23292 2015-07-15 Dmitry V. Levin <ldv (a] altlinux.org> 23293 23294 wait.c: use printaddr and umove_or_printaddr. 23295 * wait.c (waitid): Do not check for NULL the address passed 23296 to printrusage. 23297 (printwaitn): Likewise. 23298 Use printaddr and umove_or_printaddr for fetching wait status. 23299 23300 wait: move fallback definitions of wait options to xlat/ 23301 * wait.c: Move definitions of __W* flags ... 23302 * xlat/wait4_options.in: ... here. 23303 23304 tests: add xattr.test. 23305 * tests/xattr.c: New file. 23306 * tests/xattr.expected: Likewise. 23307 * tests/xattr.test: New test. 23308 * tests/Makefile.am (check_PROGRAMS): Add xattr. 23309 (TESTS): Add xattr.test. 23310 (EXTRA_DIST): Add xattr.expected. 23311 * tests/.gitignore: Add xattr. 23312 23313 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 23314 23315 xattr.c: make use of RVAL_DECODED. 23316 * xattr.c (sys_setxattr, sys_fsetxattr, sys_removexattr, 23317 sys_fremovexattr): Update for RVAL_DECODED. 23318 23319 print_xattr_val: do not fetch data in case of !verbose || syserror. 23320 * xattr.c (print_xattr_val): Do not fetch data in case 23321 of !verbose || syserror. Use printaddr. 23322 23323 print_xattr_list: use printaddr. 23324 * xattr.c (print_xattr_list): Use printaddr. 23325 23326 print_xattr_val: remove unused argument. 23327 * xattr.c (print_xattr_val): Remove unused "failed" argument. 23328 (sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Update 23329 all callers. 23330 23331 print_xattr_list: remove redundant address check. 23332 * xattr.c (print_xattr_list): Do not check for NULL the address passed 23333 to printstr. 23334 23335 ipc.c: make use of RVAL_DECODED. 23336 * ipc.c (sys_mq_notify, sys_mq_open, sys_mq_timedreceive, 23337 sys_mq_timedsend, sys_msgctl, sys_msgget, sys_msgsnd, sys_semctl, 23338 sys_semget, sys_semop, sys_semtimedop, sys_shmctl, sys_shmdt, 23339 sys_shmget): Update for RVAL_DECODED. 23340 (sys_shmat): Decode all arguments on entering syscall. 23341 23342 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 23343 23344 umoven_or_printaddr: do not fetch data if not in verbose mode. 23345 After this change, umoven_or_printaddr and its callers, including 23346 printnum_* and printpair_*, will not fetch data in !verbose mode. 23347 23348 * util.c (umoven_or_printaddr): Do not call umoven if !verbose. 23349 23350 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 23351 23352 Change printnum_* printers to honor syserror. 23353 With this change, printnum_* printers will not attempt to fetch data 23354 in case of exiting(tcp) && syserror(tcp). 23355 All "at exiting" decoders that call these printers have been made 23356 ready for this change in previous commits. 23357 23358 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr. 23359 * prctl.c (prctl_exit): Use printnum_int and printnum_long. 23360 (sys_arch_prctl): Do not check for syserror. 23361 23362 2015-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 23363 23364 term.c: enhance tty ioctl parser. 23365 Decode as much data on entering syscall as possible. 23366 23367 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 23368 decode_modem_flags): New functions. 23369 (term_ioctl): Use them. Update for RVAL_DECODED. 23370 23371 2015-07-12 Elvira Khabirova <lineprinter0 (a] gmail.com> 23372 23373 Change comparisons with function pointers to comparisons with SENs. 23374 * pathtrace.c (pathtrace_match): Change all comparisons with function 23375 pointers to a single SEN based switch. 23376 * syscall.c (dumpio, trace_syscall_entering): Change all comparisons 23377 with function pointers to comparisons with SENs. 23378 * ipc.c (sys_ipc): Remove. 23379 * sock.c (sys_socketcall): Likewise. 23380 * linux/dummy.h (sys_ipc, sys_socketcall): New aliases. 23381 23382 Add unique syscall entry numbers (SENs) 23383 * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sen.h. 23384 (syscallent_names, syscallent_patterns, syscallent_files): New variables. 23385 (sen.h): New rule. 23386 * defs.h (struct sysent): Add sen field. 23387 * generate_sen.sh: New file. 23388 * linux/syscall.h: Include "sen.h". 23389 * syscall.c (SEN_NAME): New temporary macro. 23390 (SEN): Use it to prepend syscall entry number. 23391 23392 Introduce SEN macro. 23393 * syscall.c (SEN): New temporary macro. 23394 * linux/dummy.h (sys_printargs): New macro. 23395 * linux/subcall.h: Wrap all sys_func entries using SEN. 23396 * linux/*/syscallent*.h: Likewise. 23397 23398 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 23399 23400 scsi.c: enhance SG_IO ioctl parser. 23401 Fix SG_IO ioctl output in case of failed umove 23402 23403 * scsi.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 23404 Update for RVAL_DECODED. 23405 (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 23406 print_sg_io_v4_res): Do not print address in case of failed umove. 23407 (scsi_ioctl): Use printaddr. 23408 23409 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 23410 23411 ptp.c: enhance ptp ioctl parser. 23412 * ptp.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 23413 Update for RVAL_DECODED. 23414 (ptp_ioctl): Use umove_or_printaddr. 23415 23416 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 23417 23418 mtd.c: enhance mtd and ubi ioctl parsers. 23419 Decode as much data on entering syscall as possible. 23420 23421 * xlat/mtd_file_mode_options.in: New file. 23422 * mtd.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 23423 Include "xlat/mtd_file_mode_options.h". 23424 Update for RVAL_DECODED. 23425 (mtd_ioctl, ubi_ioctl): Use printnum_int and umove_or_printaddr. 23426 23427 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 23428 23429 sock.c: enhance socket ioctl parser. 23430 Decode as much data on entering syscall as possible. 23431 23432 * sock.c: Update for RVAL_DECODED. 23433 (print_addr): Remove. 23434 (print_ifreq_addr, print_ifreq, print_ifc_len, decode_ifconf): New 23435 functions. 23436 (sock_ioctl) Use them. Use umove_or_printaddr. 23437 23438 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 23439 23440 block.c: enhance block ioctl parser. 23441 * block.c: Update for RVAL_DECODED. 23442 Define BLKROTATIONAL and BLKZEROOUT. 23443 (block_ioctl): Decode them. Use printnum_short, printnum_int, 23444 printnum_long, printpair_int64, and umove_or_printaddr. 23445 (print_blkpg_req, block_ioctl): Use umove_or_printaddr. 23446 23447 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23448 23449 blkpg_ops: add BLKPG_RESIZE_PARTITION constant. 23450 * xlat/blkpg_ops.in: Add BLKPG_RESIZE_PARTITION. 23451 23452 Reported-by: Christian Neukirchen <chneukirchen (a] gmail.com> 23453 23454 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23455 23456 loop.c: enhance loop ioctl parser. 23457 Decode as much data on entering syscall as possible. 23458 23459 * loop.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 23460 Update for RVAL_DECODED. 23461 (decode_loop_info, decode_loop_info64): New functions. 23462 (loop_ioctl): Use them. Decode LOOP_SET_STATUS, LOOP_SET_STATUS64, 23463 LOOP_SET_FD, LOOP_CHANGE_FD, LOOP_CTL_ADD and LOOP_CTL_REMOVE on 23464 entering syscall. 23465 Print LOOP_SET_FD and LOOP_CHANGE_FD arguments using printfd. 23466 23467 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23468 23469 rtc.c: enhance rtc ioctl parser. 23470 * rtc.c: Update for RVAL_DECODED. 23471 (print_rtc): Rename to print_rtc_time. 23472 (decode_rtc_time, decode_rtc_wkalrm): New functions. 23473 (rtc_ioctl): Use them. 23474 [RTC_VL_READ]: Decode RTC_VL_READ. 23475 Use printnum_long for RTC_IRQP_READ and RTC_EPOCH_READ decoding. 23476 23477 Use printpair_int. 23478 * evdev.c (repeat_ioctl): Use printpair_int. 23479 * net.c (do_pipe, sys_socketpair): Likewise. 23480 23481 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23482 23483 Add several generic integer pairs printing functions. 23484 Add functions to fetch and print pairs of integer types. 23485 Note that these printers do not attempt to fetch data 23486 in case of exiting(tcp) && syserror(tcp). 23487 23488 printnum_* printers will follow as soon as all callers are made ready 23489 for this change. 23490 23491 * defs.h (printpair_int, printpair_long, printpair_int64): New 23492 prototypes. 23493 * util.c (DEF_PRINTPAIR): New macro. 23494 (printpair_int, printpair_long, printpair_int64): New functions. 23495 23496 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23497 23498 Add two generic integer printing functions. 23499 Add printnum_short and printnum_int64 in addition to already existing 23500 printnum_int and printnum_long. 23501 23502 * defs.h (printnum_short, printnum_int64): New prototypes. 23503 * util.c (DEF_PRINTNUM): New macro. 23504 (printnum_int, printnum_long): Use DEF_PRINTNUM. 23505 (printnum_short, printnum_int64): New functions. 23506 23507 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23508 23509 Add address printing functions. 23510 printaddr is a simple function implementing "print NULL or address" 23511 idiom. 23512 umoven_or_printaddr is a wrapper around umoven that has the same return 23513 value semantics as umoven but also prints the address when the data 23514 is not going to be fetched (in case of exiting(tcp) && syserror(tcp)) 23515 or cannot be fetched (umoven fails). 23516 umove_or_printaddr is a macro wrapper around umoven_or_printaddr that 23517 mirrors umove wrapper around umoven. 23518 23519 * defs.h (printaddr, umoven_or_printaddr): New prototypes. 23520 (umove_or_printaddr): New macro. 23521 * util.c (printaddr, umoven_or_printaddr): New functions. 23522 23523 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 23524 23525 Implement RVAL_DECODED flag. 23526 Implement a method for "on entering" parsers to return 23527 "done with decoding" information to their callers. 23528 23529 If a syscall parser called from trace_syscall_entering returns a value 23530 with RVAL_DECODED bit set, record this value in tcp->sys_func_rval 23531 and use it in trace_syscall_exiting instead of calling the parser on 23532 exiting syscall. 23533 23534 If an ioctl parser returned RVAL_DECODED, this would tell 23535 SYS_FUNC(ioctl) that the decoding is finished but fallback printing of 23536 the ioctl command argument is needed, while e.g. RVAL_DONE+1 would mean 23537 that the decoding is finished and no fallback decoding is needed. 23538 23539 * defs.h (struct tcb): Add sys_func_rval. 23540 (RVAL_DECODED): New macro. 23541 * syscall.c (trace_syscall_entering): Initialize tcp->sys_func_rval 23542 along with setting TCB_INSYSCALL flag. 23543 (trace_syscall_exiting): Use tcp->sys_func_rval instead of calling 23544 tcp->s_ent->sys_func when the former has RVAL_DECODED flag set. 23545 Reset tcp->sys_func_rval along with clearing TCB_INSYSCALL flag. 23546 * ioctl.c (sys_ioctl): Set RVAL_DECODED flag on exiting. 23547 Print ioctl argument iff RVAL_DECODED is set and fallback decoding 23548 is requested. 23549 23550 2015-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 23551 23552 time.c: move rtc ioctl parser to a separate file. 23553 * rtc.c: new file 23554 * Makefile.am (strace_SOURCES): Add it. 23555 * time.c (print_rtc, rtc_ioctl): Move to rtc.c. 23556 23557 term.c: fix typo. 23558 * term.c: Rename TCLFLSH to TCFLSH. 23559 23560 Do not include sys/filio.h. 23561 * configure.ac (AC_CHECK_HEADERS): Remove sys/filio.h. 23562 * term.c: Do not include <sys/filio.h>. 23563 23564 2015-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 23565 23566 ioctl: prepare ioctl_decode_command_number for future changes. 23567 * ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*. 23568 (sys_ioctl): Update callers. 23569 23570 ioctl: simplify ioctl_decode signature. 23571 * ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters. 23572 (sys_ioctl): Update callers. 23573 23574 ioctl: consistently use name "code" for ioctl request code. 23575 * ioctl.c (evdev_decode_number, hiddev_decode_number, 23576 ioctl_decode_command_number): Rename "arg" to "code". 23577 23578 Move ioctl syscall parser to ioctl.c. 23579 * io.c (sys_ioctl): Move ... 23580 * ioctl.c: ... here. 23581 (ioctl_lookup, ioctl_next_match, ioctl_print_code, ioctl_decode, 23582 ioctl_decode_command_number): Declare as static. 23583 * defs.h (ioctl_lookup, ioctl_next_match, ioctl_print_code, 23584 ioctl_decode, ioctl_decode_command_number): Remove. 23585 23586 ioctl: remove obsolete registry of ioctl characters. 23587 * ioctl.c: Remove registry of ioctl characters. 23588 23589 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 23590 23591 Fix filtering of <unavailable> syscalls. 23592 * syscall.c (trace_syscall_exiting): Skip filtered syscalls also in case 23593 of get_regs or get_syscall_result failure. 23594 * tests/filter-unavailable.c: New file. 23595 * tests/filter-unavailable.expected: Likewise. 23596 * tests/filter-unavailable.test: New test. 23597 * tests/Makefile.am (check_PROGRAMS): Add filter-unavailable. 23598 (filter_unavailable_LDFLAGS): Add -pthread. 23599 (TESTS): Add filter-unavailable.test. 23600 (EXTRA_DIST): Add filter-unavailable.expected. 23601 * tests/.gitignore: Add filter-unavailable. 23602 23603 Reported-by: Bryan Matsuo <bryan.matsuo (a] gmail.com> 23604 23605 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 23606 23607 Fix -qq option in conjunction with -o option. 23608 This change makes -qq option work in conjunction with -o option, 23609 thus complementing commit v4.7-222-g01997cf. 23610 23611 * strace.c (init): Do not reset qflag. 23612 23613 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 23614 23615 xtensa: wire up new syscalls. 23616 * linux/xtensa/syscallent.h (bpf, execveat): New entries. 23617 23618 bfin: wire up new syscalls. 23619 * linux/bfin/syscallent.h (kcmp, finit_module, sched_setattr, 23620 sched_getattr, renameat2, seccomp, getrandom, memfd_create, 23621 bpf, execveat): New entries. 23622 23623 alpha: wire up new syscalls. 23624 * linux/alpha/syscallent.h (getrandom, memfd_create, execveat): 23625 New entries. 23626 23627 2015-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 23628 23629 tests: skip stat32 test if struct stat is defined incorrectly. 23630 If stat.st_mode returned by syscall is 0, it means that the definition 23631 of struct stat in <asm/stat.h> is incorrect. This is the case e.g. on 23632 mips n32 where the only available stat syscall is 64-bit but at the same 23633 time struct stat defined by <asm/stat.h> is 32-bit. 23634 23635 * tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0. 23636 23637 2015-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 23638 23639 Consistenly use #ifdef to check for AC_DEFINE'd macros. 23640 * aio.c (print_common_flags): Use #ifdef in the check for 23641 HAVE_STRUCT_IOCB_U_C_FLAGS. 23642 * defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG. 23643 * net.c: Use #ifdef in the check for HAVE_SENDMSG. 23644 * syscall.c (dumpio): Likewise. 23645 * printstat.h (DO_PRINTSTAT): Use #ifdef in checks for 23646 HAVE_STRUCT_STAT_ST_* macros. 23647 * util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H. 23648 23649 xattr: move fallback definitions of xattr flags to xlat/ 23650 * xattr.c: Include <sys/xattr.h> insread of <linux/xattr.h>. 23651 Move definitions of XATTR_* flags ... 23652 * xlat/xattrflags.in: ... here. 23653 23654 link: move fallback definitions of AT_* constants to xlat/ 23655 * link.c: Move definitions of AT_* constants ... 23656 * xlat/at_flags.in: ... here. 23657 23658 net: move fallback definitions of SOL_* constants to xlat/ 23659 * net.c: Move definitions of SOL_* constants ... 23660 * xlat/socketlayers.in: ... here. 23661 23662 futex: move fallback definitions of futex constants to xlat/ 23663 * futex.c: Move definitions of FUTEX_OP_CMP_* constants ... 23664 * xlat/futexwakecmps.in: ... here. 23665 * futex.c: Move definitions of other FUTEX_OP_* constants ... 23666 * xlat/futexwakeops.in: ... here. 23667 * futex.c: Move definitions of remaining FUTEX_* constants except 23668 FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME flags ... 23669 * xlat/futexops.in: ... here. 23670 23671 clone: move definitions of cloning flags to xlat/ 23672 * clone.c: Include <sched.h>. Move definitions of CLONE_* flags ... 23673 * xlat/clone_flags.in: ... here. 23674 23675 2015-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 23676 23677 Update mount flags constants. 23678 * mount.c: Remove definitions of mount flags constants. 23679 * xlat/mount_flags.in: Update from linux v4.0, add default values. 23680 23681 mount: update parser to match kernel behaviour. 23682 * mount.c (sys_mount): Do not decode type and data strings for 23683 MS_SHARED, MS_PRIVATE, MS_SLAVE, and MS_UNBINDABLE mount flags 23684 that do not imply valid strings. 23685 23686 mount: robustify MS_MGC_VAL decoding. 23687 * mount.c (sys_mount): When printing mount flags, do not assume that 23688 (flags & MS_MGC_MSK) == MS_MGC_VAL. 23689 23690 2015-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 23691 23692 net: decode setsockopt() multicast arguments. 23693 * configure.ac (AC_CHECK_FUNCS): Add inet_pton. 23694 * net.c (print_mreq, print_mreq6): New functions. 23695 (print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP, 23696 IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, 23697 IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST. 23698 * tests/ip_mreq.c: New file. 23699 * tests/ip_mreq.expected: Likewise. 23700 * tests/ip_mreq.test: New test. 23701 * tests/Makefile.am (check_PROGRAMS): Add ip_mreq. 23702 (TESTS): Add ip_mreq.test. 23703 (EXTRA_DIST): ip_mreq.expected. 23704 * tests/.gitignore: Add ip_mreq. 23705 23706 Based on patch by Ben Noordhuis <info (a] bnoordhuis.nl>. 23707 23708 2015-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 23709 23710 Update IPV6 socket options constants. 23711 * xlat/sockipv6options.in: Update from linux v4.0. 23712 23713 2015-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 23714 23715 net: factor out interface index printing code. 23716 * net.c (print_ifindex): New function. 23717 (printsock) [HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID]: Use it. 23718 23719 2015-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 23720 23721 Consistently use error_msg instead of fprintf(stderr) 23722 * linux/alpha/get_scno.c: Use error_msg. 23723 * linux/arm/get_scno.c: Likewise. 23724 * linux/mips/get_scno.c: Likewise. 23725 * linux/sh/get_scno.c: Likewise. 23726 * linux/x86_64/get_scno.c: Likewise. 23727 * exit.c (sys_exit): Likewise. 23728 * pathtrace.c (pathtrace_select, pathtrace_match): Likewise. 23729 * strace.c (alloctcb, droptcb, detach, startup_attach, 23730 test_ptrace_seize, init, cleanup, print_debug_info, 23731 maybe_allocate_tcb, startup_tcb, trace): Likewise. 23732 * syscall.c (update_personality, trace_syscall_exiting, 23733 get_scno): Likewise. 23734 * unwind.c (DPRINTF): Likewise. 23735 * tests/bexecve.test: Update patterns. 23736 * tests/detach-stopped.test: Likewise. 23737 23738 Consistently print OOM diagnostic messages. 23739 * bjm.c (sys_query_module): Use error_msg to print OOM diagnostics. 23740 * util.c (dumpiov, dumpstr): Likewise. 23741 23742 2015-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 23743 23744 Introduce memory allocation wrappers. 23745 Introduce wrappers to the following functions that do memory allocation: 23746 malloc, calloc, realloc, strdup. 23747 23748 This commit is a follow-up to the related discussions in strace-devel ML: 23749 http://sourceforge.net/p/strace/mailman/message/33618180/ 23750 http://sourceforge.net/p/strace/mailman/message/33733470/ 23751 23752 * defs.h (xmalloc, xcalloc, xreallocarray, xstrdup): New prototypes. 23753 * xmalloc.c: New file. 23754 * Makefile.am (strace_SOURCES): Add it. 23755 * count.c (count_syscall, call_summary_pers): Use xcalloc. 23756 * desc.c (decode_select): Use xmalloc. 23757 * dirent.c (sys_getdents, sys_getdents64): Likewise. 23758 * net.c (sys_recvmmsg): Use xstrdup. 23759 * pathtrace.c (storepath): Use xreallocarray. 23760 (pathtrace_match): Use xmalloc. 23761 * strace.c (die_out_of_memory): Move to xmalloc.c. 23762 (expand_tcbtab): Use xcalloc and xreallocarray. 23763 (startup_child): Use xstrdup. 23764 (init): Use xmalloc, xcalloc, and xstrdup. 23765 * syscall.c (reallocate_qual): Use xreallocarray. 23766 (qualify): Use xstrdup. 23767 * unwind.c (unwind_tcb_init): Use xmalloc. 23768 (build_mmap_cache): Use xcalloc, xreallocarray, and xstrdup. 23769 (get_symbol_name): Use xreallocarray. 23770 (stacktrace_walk, queue_put): Use xmalloc. 23771 * util.c (printstr): Use xmalloc. 23772 * vsprintf.c (strace_vfprintf): Likewise. 23773 23774 2015-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 23775 23776 Fix ioctl entries on 32-bit architectures with 64-bit aligned structures 23777 Some ioctl constants are defined to different values on those 32-bit 23778 architectures where structures containing a 64-bit field are aligned on 23779 a 8-byte boundary and have a size multiple of 8 bytes, and on other 23780 32-bit architectures. 23781 23782 * configure.ac: Check the size of a structure containing a 64-bit field. 23783 * linux/32/ioctls_inc.h: Rename to ... 23784 * linux/32/ioctls_inc_align32.h: ... this. 23785 * linux/32/ioctls_inc_align64.h: New file. 23786 * linux/32/ioctls_inc.h: Include either 32/ioctls_inc_align32.h 23787 or ioctls_inc_align64.h depending on SIZEOF_STRUCT_I64_I32. 23788 * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align32.h and 23789 * linux/32/ioctls_inc_align64.h. 23790 * tests/ioctl.c (main): Test for VIDIOC_ENUMINPUT. 23791 * tests/ioctl.expected: Check VIDIOC_ENUMINPUT decoding. 23792 23793 Reported-by: Philippe De Muyter <phdm (a] macqel.be> 23794 23795 2015-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 23796 23797 maint: make linux/kvm.h parseable on arm. 23798 * maint/ioctls_sym.sh [AARCH64 || ARM]: Add missing definitions for 23799 structures referenced from linux/kvm.h. 23800 23801 2015-05-21 Philippe De Muyter <phdm (a] macqel.be> 23802 23803 v4l2: add decoding for VIDIOC_S_CROP's arg. 23804 * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_S_CROP's arg. 23805 23806 2015-05-19 Ezequiel Garcia <ezequiel (a] vanguardiasur.com.ar> 23807 23808 Add support for Altera's Nios-II softcore architecture. 23809 This commit adds strace support for Altera's Nios-II. The architecture 23810 is supported by Linux since v3.19, and it implements the generic syscall 23811 ABI. 23812 23813 * configure.ac: Add nios2 support. 23814 * cacheflush.c [NIOS2] (sys_cacheflush): New function. 23815 * linux/nios2/*: New Nios-II specific files. 23816 * Makefile.am (EXTRA_DIST): Add them. 23817 23818 2015-05-19 Philippe De Muyter <phdm (a] macqel.be> 23819 23820 v4l2: VIDIOC_CROPCAP: add missing braces around arg printout. 23821 * v4l2.c (v4l2_ioctl): case VIDIOC_CROPCAP: add missing braces around arg 23822 printout. 23823 23824 2015-05-19 Dmitry V. Levin <ldv (a] altlinux.org> 23825 23826 maint: avoid effects of locale when sorting files. 23827 * maint/ioctls_gen.sh: Invoke sort with LC_COLLATE=C. 23828 * maint/ioctls_hex.sh: Likewise. 23829 * maint/ioctls_sym.sh: Likewise. 23830 23831 Reported-by: Philippe De Muyter <phdm (a] macqel.be> 23832 23833 2015-04-18 Philippe De Muyter <phdm (a] macqel.be> 23834 23835 v4l2: add decoding for VIDIOC_CREATE_BUFS's arg. 23836 * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg. 23837 23838 2015-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 23839 23840 mips o32: decode indirect syscall. 23841 Implement decoding of MIPS O32 specific indirect syscall. 23842 23843 * syscall.c [LINUX_MIPSO32] (decode_mips_subcall, sys_syscall): 23844 New functions. 23845 (trace_syscall_entering) [LINUX_MIPSO32]: Use decode_mips_subcall. 23846 * linux/mips/syscallent-o32.h (4000): Change sys_func to sys_syscall. 23847 23848 Reported-and-tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez (a] gmail.com> 23849 23850 2015-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 23851 23852 debian: add gawk to Build-Depends. 23853 * debian/control (Build-Depends): Add gawk. 23854 Patch by Reiner Herrmann <reiner (a] reiner-h.de>. 23855 23856 This fixes Debian bug #780992. 23857 23858 2015-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 23859 23860 tests: fix bexecve.test for the case of mixed personalities. 23861 Fix bexecve.test when the executable being run does not match the 23862 native architecture. 23863 23864 * tests/bexecve.test: Use "set_ptracer_any" instead of "sh". 23865 Allow for a personality switch notification in the strace output. 23866 23867 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 23868 23869 tests: add a test for "resuming interrupted nanosleep" 23870 * tests/restart_syscall.test: New test. 23871 * tests/restart_syscall.expected: New file. 23872 * tests/restart_syscall_unknown.expected: Likewise. 23873 * tests/Makefile.am (TESTS): Add restart_syscall.test. 23874 (EXTRA_DIST): Add restart_syscall.expected 23875 (TEST_LOG_COMPILER): Change to "env". 23876 (OS, ARCH, AM_TEST_LOG_FLAGS): Define. 23877 and restart_syscall_unknown.expected. 23878 23879 tests: strip executable bit from *.expected files. 23880 23881 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 23882 23883 Declare syscall parsers using SYS_FUNC macro. 23884 Introduce SYS_FUNC macro to declare and define all syscall parsers. 23885 23886 * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. 23887 (sys_func.h): New rule. 23888 * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. 23889 * linux/syscall.h: Include "sys_func.h". 23890 [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. 23891 Remove other declarations. 23892 * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs 23893 and osf_fstatfs syscall parsers. 23894 * *.c: Use SYS_FUNC to define syscall parsers. 23895 23896 2015-04-07 Denys Vlasenko <dvlasenk (a] redhat.com> 23897 23898 Fix confusing "resuming interrupted unknown" message. 23899 Dmitry reported seeing the following: 23900 23901 $ sleep 2 & sleep 1; ./strace -erestart_syscall -p $! 23902 [1] 12345 23903 Process 12345 attached 23904 restart_syscall(<... resuming interrupted unknown ...>) = 0 23905 23906 Fixing it by replacing "unknown" with "system call". 23907 23908 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 23909 23910 tests: workaround old gawk versions that do not provide @include support 23911 Some of our tests use GNU awk @include extension, but not all currently 23912 used versions of GNU awk support it. Skip these tests if gawk does not 23913 provide @include support. 23914 23915 * tests/init.sh (check_gawk): New function. 23916 (match_awk): Use it. 23917 23918 2015-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 23919 23920 tests: rewrite umovestr2.test without using grep. 23921 The regular expression generated by umovestr2.c on systems with large 23922 page size is too big for GNU grep. Rewrite the test to use diff 23923 instead of grep. 23924 23925 * tests/umovestr2.test: Use match_diff instead of match_grep. 23926 * tests/umovestr2.c (main): Convert output from regexp to plain text. 23927 23928 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 23929 23930 Cleanup process_vm_writev syscall decoding. 23931 * process_vm.c (sys_process_vm_writev): Do not check for syserror, 23932 it is not applicable on entering syscall. 23933 23934 umovestr: read chunks of memory up to pagesize at a time. 23935 * defs.h (get_pagesize): New prototype. 23936 * mem.c (get_pagesize) Make global. 23937 * util.c (PAGMASK): Remove. 23938 (vm_read_mem): New process_vm_readv proxy function. 23939 (umoven, umovestr): Use it. 23940 (umovestr): Read chunks up to pagesize at a time. 23941 23942 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 23943 23944 umovestr: fix short read bug. 23945 * util.c (umovestr): Check the right address. 23946 * tests/umovestr.c: New file. 23947 * tests/umovestr2.c: Likewise. 23948 * tests/umovestr.expected: Likewise. 23949 * tests/umovestr.test: New test. 23950 * tests/umovestr2.test: Likewise. 23951 * tests/Makefile.am (check_PROGRAMS): Add umovestr and umovestr2. 23952 (TESTS): Add umovestr.test and umovestr2.test. 23953 (EXTRA_DIST): Add umovestr.expected. 23954 * tests/.gitignore: Add umovestr and umovestr2. 23955 23956 Reported-by: Josef T. Burger <bolo (a] cs.wisc.edu> 23957 23958 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 23959 23960 When process_vm_readv fails with EPERM, try PTRACE_PEEKDATA. 23961 process_vm_readv() and ptrace(PTRACE_PEEKDATA) have inconsistent access 23962 control rules wrt traced processes: process_vm_readv() is more likely to 23963 fail with EPERM than ptrace(PTRACE_PEEKDATA) when tracing a process that 23964 has execve'd a privileged executable. 23965 23966 * util.c (umoven, umovestr): If process_vm_readv returned EPERM, 23967 fall back to ptrace(PTRACE_PEEKDATA). 23968 23969 Reported-by: Andrew Guertin <lists (a] dolphinling.net> 23970 23971 2015-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 23972 23973 Use macros for gcc attributes. 23974 * defs.h (error_msg, perror_msg, error_msg_and_die, perror_msg_and_die, 23975 die_out_of_memory, printllval, printnum_int, printnum_long, tprintf): 23976 Use ATTRIBUTE_* macros for gcc attributes. 23977 * file.c (struct stat64): Likewise. 23978 * statfs.c (struct compat_statfs64): Likewise. 23979 * strace.c (die, exec_or_die, init): Likewise. 23980 * linux/sparc/arch_sigreturn.c: Likewise. 23981 * linux/ubi-user.h: Likewise. 23982 23983 2015-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 23984 23985 Introduce macros for gcc attributes. 23986 Define macros for gcc attributes that are already in use 23987 or going to be used soon. 23988 23989 * defs.h (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, 23990 ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, 23991 ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): New macros. 23992 23993 2015-03-28 Felix Janda <felix.janda (a] posteo.de> 23994 23995 Include <linux/ioctl.h> for _IOC_* macros. 23996 Fix a compilation failure with musl libc. 23997 23998 * evdev.c: Include <linux/ioctl.h>. 23999 * ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>. 24000 * ioctlsort.c: Likewise. 24001 24002 Reported-by: Dima Krasner <dima (a] dimakrasner.com> 24003 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 24004 24005 2015-03-28 Felix Janda <felix.janda (a] posteo.de> 24006 24007 Include <sys/stat.h> for S_I* macros. 24008 Fix a compilation failure with musl libc. 24009 24010 * mknod.c: Include <sys/stat.h>. 24011 * printmode.c: Likewise. 24012 24013 Reported-by: Dima Krasner <dima (a] dimakrasner.com> 24014 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 24015 24016 2015-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 24017 24018 signal.c: move siginfo_t parsers to a separate file. 24019 * printsiginfo.c: New file. 24020 * Makefile.am (strace_SOURCES): Add it. 24021 * defs.h (printsiginfo): Change second argument's type from int to bool. 24022 * signal.c: Stop defining siginfo_t related constants. 24023 Move inclusion of xlat/sig*_codes.h files to printsiginfo.c 24024 (printsigsource, printsigval, printsiginfo_at): Move to printsiginfo.c. 24025 (printsiginfo): Change second argument's type from int to bool, 24026 split, and move to printsiginfo.c. 24027 24028 Update siginfo_t constants. 24029 * xlat/sigbus_codes.in: Add BUS_MCEERR_AR and BUS_MCEERR_AO, 24030 add default values. 24031 * xlat/sigtrap_codes.in: Add TRAP_BRANCH and TRAP_HWBKPT, 24032 add default values. 24033 * xlat/sigsegv_codes.in: Add SEGV_BNDERR, add default values. 24034 * xlat/sigchld_codes.in: Add default values. 24035 * xlat/sigemt_codes.in: Likewise. 24036 * xlat/sigfpe_codes.in: Likewise. 24037 * xlat/sigill_codes.in: Likewise. 24038 * xlat/siginfo_codes.in: Likewise. 24039 * xlat/sigpoll_codes.in: Likewise. 24040 * xlat/sigsys_codes.in: Likewise. 24041 24042 2015-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 24043 24044 signal.c: move sigaltstack parser to a separate file. 24045 * sigaltstack.c: New file. 24046 * Makefile.am (strace_SOURCES): Add it. 24047 * signal.c (print_stack_t, sys_sigaltstack): Move to sigaltstack.c. 24048 * xlat/sigaltstack_flags.in: Add default values. 24049 24050 2015-03-25 Denys Vlasenko <dvlasenk (a] redhat.com> 24051 24052 Move sparc64 get_scno() code where it belongs. 24053 24054 sparc: rename personality 2 files to personality 1. 24055 Run-tested in qemu 32-bit sparc. 24056 24057 2015-03-25 Denys Vlasenko <dvlasenk (a] redhat.com> 24058 24059 sparc: delete personality 1. 24060 Personality 1 for sparc and sparc64 appears to be an old attempt 24061 to support stracing Solaris binaries. 24062 24063 It stalled after the only syscall, solaris_open, was covered: 24064 all other solaris_foo's are printargs. 24065 24066 This change deletes personality 1. Now sparc is an one-personality 24067 arch, and sparc64 is a two-personality one. 24068 24069 For clarity, pure renaming of personality 2 files to personality 1 for sparc64 24070 is performed in the next commit - this prevents a state where syscallent1.h 24071 seems to indergo a lot of changes, where in fact in is deleted, and then 24072 replaced by syscallent2.h 24073 24074 Therefore, tree at this commit will not build. 24075 24076 2015-03-24 Denys Vlasenko <dvlasenk (a] redhat.com> 24077 24078 qemu_multiarch_testing/*: make it easier to do debug in sandboxes. 24079 24080 2015-03-24 Denys Vlasenko <dvlasenk (a] redhat.com> 24081 24082 sparc: fix v4.10-25-g8497b62 fallout. 24083 Before: 24084 24085 $ sleep 3 & ./strace -p $! 24086 Process 8703 attached 24087 syscall: unknown syscall trap 1a800003 00025d58 24088 syscall_516(0, 0x40080000, 0, 0xfc000f00, 0x28, 0xefc03b18) = 0 24089 exit_group(0) = ? 24090 +++ exited with 0 +++ 24091 24092 After: 24093 24094 $ sleep 3 & ./strace -p $! 24095 Process 8725 attached 24096 restart_syscall(<... resuming interrupted nanosleep ...>) = 0 24097 exit_group(0) = ? 24098 +++ exited with 0 +++ 24099 24100 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 24101 24102 get_scno: add diagnostics for invalid syscall numbers. 24103 * syscall.c (get_scno): Print a debug level message 24104 for !SCNO_IS_VALID syscall numbers. 24105 24106 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 24107 24108 arm: fix v4.10-25-g8497b62 fallout. 24109 Starting with commit v4.10-25-g8497b62, 24110 24111 arm$ ./strace true 24112 pid 1234 stray syscall exit 24113 Segmentation fault 24114 24115 Fix this by updating ARM syscall sanity check. 24116 In particular, get_scno() should not set TCB_INSYSCALL flag because 24117 other code assumes that s_ent is properly initialized when this flag 24118 is set. 24119 24120 * linux/arm/get_scno.c: Check syscall number after fetching. 24121 Do not apply the check to SCNO_IN_RANGE syscalls. 24122 Do not set TCB_INSYSCALL flag. 24123 Extend diagnostics and move it to debug level. 24124 24125 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 24126 24127 mips: fix pipe syscall decoding. 24128 * linux/mips/arch_getrval2.c: New file. 24129 * Makefile.am (EXTRA_DIST): Add it. 24130 * defs.h [MIPS] (HAVE_GETRVAL2): Define. 24131 24132 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 24133 24134 sigreturn.c: split arch specific code into separate arch files. 24135 Split code that use arch-specific registers to separate arch files. 24136 24137 * sigreturn.c (sys_sigreturn): Move arch-specific code 24138 to linux/*/arch_sigreturn.c, include "arch_sigreturn.c". 24139 * linux/arch_sigreturn.c: New file. 24140 * Makefile.am (EXTRA_DIST): Add linux/arch_sigreturn.c 24141 and linux/*/arch_sigreturn.c files. 24142 24143 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 24144 24145 syscall.c: split arch specific code into separate arch files. 24146 Split code that use arch-specific registers to separate arch files. 24147 24148 * syscall.c: Move definitions of variables containing fetched registers 24149 to linux/*/arch_regs.c files. 24150 [HAVE_GETRVAL2] (getrval2): Move arch-specific code 24151 to linux/*/arch_getrval2.c, include "arch_getrval2.c". 24152 (print_pc): Move arch-specific code to linux/*/print_pc.c files, 24153 include "print_pc.c". 24154 [X86_64] (x86_64_getregs_old): Rename to getregs_old, move to 24155 linux/x86_64/getregs_old.c, include "getregs_old.c". 24156 [POWERPC] (powerpc_getregs_old): Rename to getregs_old, move to 24157 linux/powerpc/getregs_old.c, include "getregs_old.c". 24158 (get_regs) [X86_64, POWERPC]: Update callers. 24159 (get_scno): Move arch-specific code to linux/*/get_scno.c, 24160 include "get_scno.c". 24161 (get_syscall_args): Move arch-specific code 24162 to linux/*/get_syscall_args.c, include "get_syscall_args.c". 24163 (get_error): Move arch-specific code to linux/*/get_error.c, 24164 include "get_error.c". 24165 (get_syscall_result): Move arch-specific code 24166 to linux/*/get_syscall_result.c, include "get_syscall_result.c". 24167 * Makefile.am (EXTRA_DIST): Add new linux/*/*.c files. 24168 24169 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 24170 24171 syscall.c: prepare for the split. 24172 Move functions that use arch-specific registers to the end of file. 24173 24174 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 24175 24176 Move get_regs error check from trace_syscall_entering to get_scno. 24177 Starting with commit v4.10-25-g8497b62, get_scno() can be called outside 24178 trace_syscall_entering(), so move the get_regs_error check from 24179 trace_syscall_entering() to get_scno(). 24180 24181 * syscall.c (trace_syscall_entering): Move get_regs_error check ... 24182 (get_scno): ... here. 24183 24184 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 24185 24186 alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding. 24187 Fix pipe syscall decoding on alpha. 24188 Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64. 24189 24190 * configure.ac (AC_CHECK_FUNCS): Add pipe2. 24191 * defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2): 24192 Define. 24193 * net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros. 24194 Do not use getrval2 for pipe2 decoding. 24195 Print address if umove call fails. 24196 * syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture 24197 macros. Implement for [ALPHA]. 24198 * tests/pipe.c: New file. 24199 * tests/pipe.expected: New file. 24200 * tests/pipe.test: New test. 24201 * tests/Makefile.am (check_PROGRAMS): Add pipe. 24202 (TESTS): Add pipe.test. 24203 (EXTRA_DIST): Add pipe.expected. 24204 * tests/.gitignore: Add pipe. 24205 24206 2015-03-22 Dmitry V. Levin <ldv (a] altlinux.org> 24207 24208 decode_socket_subcall: fetch all arguments with a single umoven call. 24209 * syscall.c (decode_socket_subcall): Replace umoven fetch loop 24210 with a single umoven call. 24211 24212 2015-03-21 Denys Vlasenko <dvlasenk (a] redhat.com> 24213 24214 New test: test/many_looping_threads.c. 24215 24216 test/.gitignore: add missing test targets. 24217 24218 Trivial optimization in sys_sigreturn() 24219 24220 Change last parameter of umoven() from char* to void* 24221 Saves tons of casts. 24222 24223 Remove unused struct tcb::inst field. 24224 It is unused since we dropped support for kernels without PTRACE_SETOPTIONS. 24225 24226 test/Makefile: add missing test targets. 24227 24228 Move the comment about termination logic where it belongs. 24229 24230 startup_tcb() never fails, remove code which checks for failures. 24231 24232 2015-03-21 Denys Vlasenko <dvlasenk (a] redhat.com> 24233 24234 Show the syscall name in "resuming interrupted call" message. 24235 When signal is received, or if we have attached to a process, 24236 current syscall (if process is in one) gets restarted. 24237 24238 Some syscalls are restarted via "restart_syscall()" mechanism. 24239 On such sycalls, we don't show _which_ syscall gets restarted. 24240 24241 IOW: users want to see "resuming interrupted nanosleep" 24242 instead of "resuming interrupted call" when they attach to "sleep 999". 24243 24244 Kernel does expose this information. The only thing we need is 24245 to fetch syscall# on attach, and save it. 24246 24247 This patch does this. It adds tcp->s_prev_ent, which is 24248 a pointer to struct_sysent of the previous syscall of this tracee. 24249 It can be NULL. 24250 24251 sys_restart_syscall() is made to use it when the message is generated. 24252 24253 To similarly handle restart_syscall() *after signals*, not just 24254 on attach, on each syscall exit patch saves exited syscall's data 24255 in the same member (tcp->s_prev_ent). 24256 24257 Example: 24258 24259 $ sleep 3 & strace -p $! 24260 Process 8728 attached 24261 restart_syscall(<... resuming interrupted nanosleep ...>) = 0 24262 _exit(0) = ? 24263 +++ exited with 0 +++ 24264 24265 2015-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 24266 24267 tests: add a test for mmap/mprotect/munmap decoding. 24268 * tests/mmap.c: New file. 24269 * tests/mmap64.c: New file. 24270 * tests/mmap.test: New test. 24271 * tests/mmap64.test: New test. 24272 * tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64. 24273 (mmap64_CFLAGS): Define. 24274 (TESTS): Add mmap.test and mmap64.test. 24275 * tests/.gitignore: Add mmap and mmap64. 24276 24277 sparc, sparc64: fix decoding of mmap2. 24278 * linux/sparc/syscallent.h (mmap2): Decode with sys_mmap_4koff, 24279 not sys_mmap. 24280 * linux/sparc64/syscallent2.h (mmap2): Decode with sys_mmap_pgoff, 24281 not sys_mmap. 24282 24283 2015-03-19 Dmitry V. Levin <ldv (a] altlinux.org> 24284 24285 tests: add a test for SECCOMP_MODE_FILTER decoding. 24286 * tests/seccomp.c: New file. 24287 * tests/seccomp.test: New test. 24288 * tests/Makefile.am (check_PROGRAMS): Add seccomp. 24289 (TESTS): Add seccomp.test. 24290 * tests/.gitignore: Add seccomp. 24291 24292 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 24293 24294 tests: factor out common awk code. 24295 Factor out awk code used in several tests to match.awk. 24296 24297 * tests/match.awk: New file. 24298 * tests/Makefile.am (EXTRA_DIST): Add it. 24299 * tests/caps.awk: Use it. 24300 * tests/getdents.awk: Likewise. 24301 * tests/getrandom.awk: Likewise. 24302 * tests/select.awk: Likewise. 24303 * tests/sigaction.awk: Likewise. 24304 * tests/init.sh (match_awk): Use gawk not awk. Define AWKPATH. 24305 * tests/getdents.test: Likewise. 24306 24307 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 24308 24309 tests: skip netlink based tests when resources are not available. 24310 * tests/netlink_inet_diag.c (main): Return 77 if socket, bind, 24311 or listen syscall fail. 24312 * tests/netlink_unix_diag.c (main): Likewise. 24313 24314 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 24315 24316 aarch64, arm: decode extra padded compat struct statfs64. 24317 According to arch/arm/kernel/sys_oabi-compat.c, 24318 struct statfs64 has extra padding with EABI. 24319 24320 * statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE): 24321 Define. 24322 (do_statfs64_fstatfs64): New function, factored out from sys_statfs64. 24323 [COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to 24324 sizeof(struct compat_statfs64). 24325 (sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64. 24326 24327 Reported-and-tested-by: Elliott Hughes <enh (a] google.com> 24328 24329 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 24330 24331 tests: factor out common shell code to functions. 24332 Factor out shell code used in several tests to common functions. 24333 24334 * tests/fanotify_mark.expected: New file. 24335 * tests/ioctl.expected: New file. 24336 * tests/net-fd.expected: New file. 24337 * tests/net.expected: New file. 24338 * tests/statfs.expected: New file. 24339 * tests/sun_path.expected: New file. 24340 * tests/uio.expected: New file. 24341 * tests/ipc.sh: New file. 24342 * tests/Makefile.am (EXTRA_DIST): Add them. 24343 * tests/init.sh (dump_log_and_fail_with, run_prog, 24344 run_prog_skip_if_failed, run_strace, run_strace_merge, 24345 match_awk, match_diff, match_grep): New functions. 24346 * tests/*.test: Use them. 24347 24348 2015-03-18 Elliott Hughes <enh (a] google.com> 24349 24350 Show f_flags field in printstatfs. 24351 printstatfs64 was right, but printstatfs was missing f_flags. 24352 Noticed on aarch64. 24353 24354 * statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags. 24355 24356 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 24357 24358 tests/uid*: use fchown* instead of chown* 24359 Newer architectures have no chown syscall, so use fchown* syscalls 24360 for testing printuid. 24361 24362 * tests/uid.test: Use fchown instead of chown. 24363 * tests/uid.c: Test __NR_fchown instead of __NR_chown. 24364 (main): Use __NR_fchown instead of __NR_chown. 24365 * tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32. 24366 (main): Use __NR_fchown32 instead of __NR_chown32. 24367 * tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead 24368 of __NR_chown and __NR_chown32. 24369 (main): Use __NR_fchown instead of __NR_chown. 24370 * tests/uid.awk: Update regexp. 24371 24372 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 24373 24374 stat64-v.test: add newfstatat syscall support. 24375 Newer architectures have no stat syscall, so stat() is implemented there 24376 using newfstatat syscall. 24377 24378 * tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers. 24379 [_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support. 24380 (main) [!NR_stat]: Add newfstatat support. 24381 24382 Reported-by: Andreas Schwab <schwab (a] suse.de> 24383 24384 2015-03-16 Andreas Schwab <schwab (a] suse.de> 24385 24386 aarch64: properly decode generic syscalls. 24387 * linux/aarch64/syscallent1.h: Don't override entries 277 to 1023. 24388 24389 tests: verify that all patterns match. 24390 * tests/ipc_msg.test: Count matches to verify that all patterns match. 24391 * tests/ipc_sem.test: Likewise. 24392 * tests/ipc_shm.test: Likewise. 24393 * tests/stat32-v.test: Likewise. 24394 * tests/stat64-v.test: Likewise. 24395 24396 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 24397 24398 Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t. 24399 STRUCT_STAT.st_[acm]time are declared as unsigned int for some 24400 personalities, while time_t is signed. 24401 24402 * printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int, 24403 explicitly cast them to int. 24404 * tests/stat64-v.test: Test that negative time_t is decoded properly. 24405 24406 Reported-by: Andreas Schwab <schwab (a] suse.de> 24407 24408 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 24409 24410 semctl: fix indirect syscall decoding. 24411 On architectures where the semctl call is implemented by the ipc syscall 24412 the 4th argument is passed by reference. 24413 24414 * ipc.c (sys_semctl): Handle the indirect ipc subcall case. 24415 * tests/ipc_sem.c (main): Optionally match indirection 24416 in the 4th argument of semctl calls. 24417 24418 Reported-by: Andreas Schwab <schwab (a] suse.de> 24419 24420 2015-03-16 Andreas Schwab <schwab (a] suse.de> 24421 24422 tests/ipc_*: match IPC_64 flag. 24423 * tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third 24424 argument of the ipc call. 24425 * tests/ipc_sem.c (main): Likewise. 24426 * tests/ipc_shm.c (main): Likewise. 24427 24428 2015-03-16 Andreas Schwab <schwab (a] suse.de> 24429 24430 Fix crash in ipc_sem test. 24431 Properly use union semun as argument of semctl. 24432 24433 * tests/ipc_sem.c (main): Properly use union semun as argument of 24434 semctl. Don't handle EFAULT specially. 24435 * tests/ipc_sem.test: Revert last change. 24436 24437 2015-03-16 Andreas Schwab <schwab (a] suse.de> 24438 24439 m68k: fix sigreturn decoding. 24440 * sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the 24441 signal mask from the proper place. 24442 24443 aarch64: fix ioctl decoding. 24444 * linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h. 24445 * linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h. 24446 * linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h. 24447 * linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h. 24448 24449 2015-03-12 Andreas Schwab <schwab (a] suse.de> 24450 24451 tests/select.test: handle architectures using pselect6 syscall. 24452 * tests/select.awk (BEGIN): Update regexps to match both select 24453 and pselect6 syscalls. 24454 * tests/select.test: Probe for both select and pselect6 syscall. 24455 24456 Distribute linux/aarch64/arch_regs.h. 24457 * Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h. 24458 24459 Fix decoding of mmap2 for arm. 24460 * syscallent.h (mmap2): Decode with sys_mmap_4koff, not 24461 sys_mmap_pgoff. 24462 24463 2015-03-12 Andreas Schwab <schwab (a] suse.de> 24464 24465 m68k: define HAVE_SA_RESTORER. 24466 On m68k the kernel sigaction structure has the sa_restorer member for 24467 historical reasons. 24468 24469 * signal.c (HAVE_SA_RESTORER): Define for M68K. 24470 24471 2015-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 24472 24473 aarch64: fix rt_sigreturn decoding. 24474 * sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check. 24475 24476 2015-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 24477 24478 maint: post-release administrivia. 24479 * NEWS: Add header line for next release. 24480 24481 2015-03-06 Dmitry V. Levin <ldv (a] altlinux.org> 24482 24483 Prepare for 4.10 release. 24484 * NEWS: Update for 4.10 release. 24485 * debian/changelog: 4.10-1. 24486 * strace.spec: 4.10-1. 24487 24488 Move sigreturn/rt_sigreturn parser to a separate file. 24489 * sigreturn.c: New file. 24490 * Makefile.am (strace_SOURCES): Add it. 24491 * defs.h (sprintsigmask_n): New prototype. 24492 (tprintsigmask_addr): New macro. 24493 * signal.c (sprintsigmask_n): Make global. 24494 (tprintsigmask_addr): Remove. 24495 (sys_sigreturn): Move to sigreturn.c. 24496 24497 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24498 24499 ia64: use PTRACE_GETREGS to fetch registers. 24500 * linux/ia64/arch_regs.h: Stop including <asm/rse.h>. 24501 (ia64_frame_ptr): New declaration. 24502 * signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr. 24503 * syscall.c [IA64]: Include <asm/rse.h>. 24504 [IA64] (ia64_regs, ia64_frame_ptr): New variable. 24505 [IA64] (ARCH_REGS_FOR_GETREGS): New macro. 24506 [IA64] (ia64_ia32mode): Convert to macro. 24507 [IA64] (ia64_r8, ia64_r10): Remove. 24508 (getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]: 24509 Use ia64_regs. 24510 (get_syscall_result) [IA64]: Remove. 24511 24512 s390, s390x: use PTRACE_GETREGSET to fetch registers. 24513 * linux/s390/arch_regs.h: New file. 24514 * linux/s390x/arch_regs.h: New file. 24515 * Makefile.am (EXTRA_DIST): Add them. 24516 * signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr. 24517 * syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable. 24518 [S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro. 24519 (print_pc) [S390 || S390X]: Use s390_regset. 24520 (get_scno) [S390 || S390X]: Likewise. 24521 (get_syscall_args) [S390 || S390X]: Likewise. 24522 (get_error) [S390 || S390X]: Likewise. 24523 (get_syscall_result) [S390 || S390X]: Remove. 24524 24525 qemu_multiarch_testing: update. 24526 * qemu_multiarch_testing/README: Update statistics. 24527 24528 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24529 24530 tests: robustify unix-yy.test. 24531 Implement additional synchronization between parent and child processes 24532 to guarantee that the child starts closing connected socket only after 24533 exiting of the parent's accept() syscall. 24534 This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER 24535 messages from NETLINK_SOCK_DIAG interface. 24536 24537 * tests/net-accept-connect.c: Implement additional synchronization 24538 between parent and child processes. 24539 * tests/unix-yy-connect.awk: Update. 24540 24541 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24542 24543 Use SIGRTMIN from kernel headers. 24544 * configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>. 24545 * signal.c: Use ASM_SIGRTMIN instead of constants provided by libc. 24546 * tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value. 24547 Use lower RT_* numbers to support pre-3.18 hppa kernels. 24548 * tests/sigreturn.test: Update regexp. 24549 24550 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24551 24552 ppc64: fix compilation warning. 24553 Fix compilation warning introduced by commit 24554 577be2593d4895ef941e1c4e5e1608f7dd13610d 24555 24556 * signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal 24557 mask on 32bit personality. 24558 24559 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24560 24561 aarch64: fix compilation warnings. 24562 Fix compilation warnings introduced by commit 24563 5b9b7e1d347eb4556084cdccad75e8247c535ed5: 24564 24565 signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare] 24566 syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default] 24567 24568 * syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast. 24569 [AARCH64] (arm_sp_ptr): Change pointer type to unsigned. 24570 * linux/aarch64/arch_regs.h (arm_sp_ptr): Update. 24571 24572 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 24573 24574 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24575 24576 i386: simplify sigreturn decoding. 24577 * signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define 24578 i386_sigcontext_struct and i386_fpstate structures. 24579 24580 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 24581 24582 tests: add a test for sigreturn/rt_sigreturn decoding. 24583 Convert test/sigreturn.c into a regular test. 24584 24585 * test/Makefile (PROGS): Remove sigreturn. 24586 * test/.gitignore: Likewise. 24587 * test/sigreturn.c: Rewrite to ... 24588 * tests/sigreturn.c: ... new file. 24589 * tests/sigreturn.test: New test. 24590 * tests/Makefile.am (check_PROGRAMS): Add sigreturn. 24591 (TESTS): Add sigreturn.test. 24592 * tests/.gitignore: Add sigreturn. 24593 24594 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 24595 24596 sigreturn: print signal mask as a syscall argument. 24597 Although sigreturn takes signal mask via frame pointer, 24598 it's more convenient to display signal mask as a syscall argument 24599 rather than an outstanding object of unknown nature: 24600 24601 Before this change: 24602 sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0 24603 24604 After this change: 24605 sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0 24606 24607 * signal.c (sys_sigreturn): Display signal mask as a syscall argument. 24608 24609 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 24610 24611 aarch64: implement rt_sigreturn decoding. 24612 * linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn 24613 decoding. 24614 * syscall.c [ARM] (arm_regs): Make static. 24615 [ARM] (arm_sp_ptr): New variable. 24616 [AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables. 24617 * linux/aarch64/arch_regs.h: New file. 24618 * linux/arm/arch_regs.h (arm_regs): Remove. 24619 (arm_sp_ptr): New declaration. 24620 * signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr. 24621 [AARCH64]: Print signal mask. 24622 24623 arm: simplify sigreturn decoding. 24624 * signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext 24625 structures, fetch signal mask only, use print_sigset_addr_len. 24626 24627 s390: fix sigreturn decoding. 24628 * signal.c (sys_sigreturn) [S390]: Fix signal mask decoding. 24629 24630 mips o32: fix sigreturn decoding. 24631 * signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask. 24632 [MIPS] Use print_sigset_addr_len to print signal mask. 24633 24634 x86_64, x32: implement rt_sigreturn decoding. 24635 * syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable. 24636 * linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration. 24637 * linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn 24638 decoding. 24639 * linux/x32/syscallent.h (513): Likewise. 24640 * signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask 24641 for non-i386 personalities. 24642 24643 sparc, sparc64: fix sigreturn decoding. 24644 * linux/sparc/arch_regs.h (U_REG_FP): New macro. 24645 * signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding 24646 of upper 32 bits of the sigmask. 24647 24648 ppc, ppc64: fix sigreturn decoding. 24649 * signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits 24650 of the sigmask. 24651 24652 sigreturn: issue a less innocuous warning. 24653 * signal.c (sys_sigreturn): Issue a less innocuous warning on 24654 architectures for which signal mask decoding is not implemented yet. 24655 24656 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 24657 24658 bootstrap: do not link Makefile* files. 24659 * bootstrap: Do not symlink any Makefile* files, not just Makefile.am 24660 and Makefile.in. 24661 24662 Reported-by: Christopher Covington <cov (a] codeaurora.org> 24663 24664 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 24665 24666 ia64: fix sigreturn decoding. 24667 * signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask. 24668 Use print_sigset_addr_len to print signal mask. 24669 24670 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 24671 24672 ia64: use generic signalent. 24673 This complements commit v4.9-321-gfcf7f8d. 24674 24675 * linux/ia64/signalent.h: Remove. 24676 * Makefile.am (EXTRA_DIST): Remove it. 24677 24678 2015-03-04 Giedrius Statkeviius <giedrius.statkevicius (a] gmail.com> 24679 24680 Document that -k is available only with libunwind. 24681 Without this users might get confused why `man strace` describes 24682 an option that doesn't work. 24683 24684 * strace.1: Note that -k is available only if strace is built 24685 with libunwind. 24686 24687 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 24688 24689 debian: update control file. 24690 * debian/control (strace, strace-udeb): Add mips64 and mips64el 24691 to architecture list. 24692 Patch by James Cowgill <james410 (a] cowgill.org.uk> 24693 24694 This fixes Debian bug #773375. 24695 24696 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 24697 24698 debian: sync with 4.9-2 package. 24699 * debian/changelog: Sync with 4.9-2. 24700 * debian/control: Likewise. 24701 24702 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 24703 24704 Add arch-specific PTRACE_* constants. 24705 * xlat/ptrace_cmds.in: Add arch-specific ptrace commands. 24706 * xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile. 24707 * xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile. 24708 24709 This fixes Debian bug #734554. 24710 24711 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 24712 24713 Clarify bootstrap-vs-autoreconf usage. 24714 * README-hacking: Tell people to run ./bootstrap. 24715 24716 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 24717 24718 mips n32: fix preadv/pwritev offset decoding. 24719 In mips n32 abi, like in most of 32-bit architectures, offset 24720 is passed to preadv/pwritev syscalls using two syscall arguments. 24721 24722 * io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove. 24723 24724 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 24725 24726 tests: skip ipc_sem.test on broken kernels. 24727 Rather than trigger an ERROR which fails `make check`, go with SKIP 24728 instead. We don't want the testsuite failing due to kernel bugs. 24729 24730 * tests/ipc_sem.c (main): Change 99 to 77. 24731 24732 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 24733 24734 tests: skip pc.test on s390. 24735 The s390 hardware can't support an exact si_addr, and the current kernels 24736 don't handle text addresses correctly at all. Until that improves, skip 24737 the test on s390. 24738 24739 * tests/pc.c (main): Return 77 on s390 systems. 24740 24741 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 24742 24743 tests: note the kernel configs for -yy options. 24744 * tests/net-yy.test: Note CONFIG_INET_TCP_DIAG. 24745 * tests/unix-yy.test: Note CONFIG_UNIX_DIAG. 24746 24747 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 24748 24749 alpha: fix -yy decoding. 24750 * socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary. 24751 24752 Reported-and-tested-by: Mike Frysinger <vapier (a] gentoo.org> 24753 24754 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 24755 24756 aarch64, x32: fix decoding of compat personality statfs64/fstatfs64. 24757 * statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same 24758 attributes as on X86_64. 24759 24760 mips: fix compilation warning. 24761 * syscall.c (get_scno) [MIPS]: Fix harmless compilation warning 24762 about comparison between signed and unsigned integer expressions. 24763 24764 x32: fix compilation warnings. 24765 * sysinfo.c (sys_sysinfo): Use ll length format modifier 24766 instead of l and cast kernel ulong types to unsigned long long. 24767 24768 aarch64: add -i option support. 24769 * syscall.c (print_pc): Add aarch64 support. 24770 24771 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 24772 24773 ioctl: use x32 specific ioctl entries on x32 personality. 24774 As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h 24775 (by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32 24776 specific ioctl entries on x32 personality. 24777 24778 * linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh. 24779 * linux/x86_64/ioctlent2.h: Remove. 24780 * linux/x86_64/ioctls_arch2.h: New file. 24781 * linux/x86_64/ioctls_inc2.h: New file. 24782 * Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add 24783 linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h. 24784 24785 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 24786 24787 tests/uid16: skip if real uid is larger than 16bit. 24788 * tests/uid16.c (main): Skip if the uid returned by getuid matches 24789 /proc/sys/kernel/overflowuid. 24790 24791 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 24792 24793 tests: fix uid tests on big endian architectures. 24794 * tests/uid.c (main): Ignore uids returned by getresuid to avoid 24795 16bit vs 32bit issues on big endian architectures. 24796 Change real UID instead of effective UID in setresuid test. 24797 * tests/uid16.c (main): Likewise. 24798 * tests/uid32.c (main): Change real UID instead of effective UID 24799 in setresuid test to match uid.c 24800 * tests/uid.awk: Update setresuid regexp. 24801 24802 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 24803 24804 2015-03-01 Mike Frysinger <vapier (a] gentoo.org> 24805 24806 tests/getdents: handle older getdents calls. 24807 If the tools we use call older getdents syscalls where d_type isn't 24808 passed back, or the arch is old (like Alpha) and can't pass back in 24809 either version, make sure we don't fail. 24810 24811 * tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN. 24812 24813 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 24814 24815 Fix multiple personalities support in decoding syscall return values. 24816 * syscall.c (trace_syscall_exiting): When current personality is 32bit, 24817 print 32bit return code. 24818 24819 Update generic 64-bit ioctlent from linux v3.19. 24820 * linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh. 24821 24822 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 24823 24824 sparc, sparc64: fix rt_sigaction decoding. 24825 Fix regression introduced by commit v4.9-9-gc3a5c01. 24826 24827 * signal.c (HAVE_SA_RESTORER): New macro. 24828 [HPPA || IA64]: Do not undefine SA_RESTORER. 24829 (old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER 24830 instead of SA_RESTORER to check whether to define sa_restorer. 24831 (decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in 24832 addition to SA_RESTORER to check whether to use sa_restorer. 24833 24834 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 24835 24836 Fix stack buffer overflow when specified command is too long. 24837 * strace.c (startup_child): Check that the length of the command strace 24838 is going to execute does not exceed PATH_MAX limit. 24839 24840 Reported-by: Cheolung Lee <chpie (a] grayhash.com> 24841 24842 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 24843 24844 build: include ptrace.h after regs.h. 24845 Restore the order of including <sys/reg.h> and <linux/ptrace.h> 24846 headers that was inadvertently changed by commit v4.9-280-g5503dd2. 24847 24848 This should fix build on platforms like m68k where some constants 24849 are defined simultaneously as enums by <sys/reg.h> and as macros 24850 by <asm/ptrace.h>. 24851 24852 * process.c: Include "ptrace.h" after "regs.h". 24853 * signal.c: Likewise. 24854 * syscall.c: Likewise. 24855 * util.c: Likewise. 24856 24857 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 24858 24859 x32: fix decoding of timeval, timespec, and timex structures. 24860 As time_t is a 64-bit type in x32 personality, it is not correct to 24861 treat it as a long int type. 24862 24863 * time.c (current_time_t_is_compat): New macro. 24864 (sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it. 24865 (tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t 24866 when printing tv_sec/tv_usec. 24867 (tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex 24868 members of type kernel_long_t. 24869 24870 2015-02-28 Mike Frysinger <vapier (a] gentoo.org> 24871 24872 tests/ipc_sem: detect broken kernels. 24873 When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc 24874 logic wrongly returns errors. Detect that and throw an error. 24875 24876 * tests/ipc_sem.c: Return 99 when errno is EFAULT. 24877 * tests/ipc_sem.test: Save output to $OUT and show it when failing. 24878 Handle exit status 99 to throw an ERROR. 24879 24880 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 24881 24882 build: do not link strace with -ldl. 24883 * configure.ac: Fix dladdr check. 24884 24885 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 24886 24887 Handle broken PTRACE_EVENT_STOP values. 24888 For a few linux releases (3.1 through 3.3), this define in the exported 24889 headers were broken. Redefine if that's the case. 24890 24891 * ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7. 24892 24893 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 24894 24895 bootstrap: always set up test dirs. 24896 When files get updated, the bootstrap script should make sure the 24897 parallel dirs are kept in sync. 24898 24899 * bootstrap: Always generate the test$m. Clean up symlinks first. 24900 Don't link in Makefile.in files. 24901 24902 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 24903 24904 Fix cross-compiling of ioctlsort. 24905 Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross 24906 compiling. This way ioctlsort uses the build tools all the time. 24907 24908 * configure.ac: Call AX_PROG_CC_FOR_BUILD. 24909 * Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD. 24910 (ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD. 24911 (ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD. 24912 (ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD. 24913 (ioctlsort_LD): Delete. 24914 (ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT). Use ioctlsort_CFLAGS. 24915 * m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package. 24916 24917 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 24918 24919 tests: robustify pc.test. 24920 * configure.ac: Check for dladdr in -ldl. 24921 * tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS). 24922 * tests/pc.c: Include "config.h" and <dlfcn.h>. 24923 (main): Use dladdr to find the address to unmap. 24924 24925 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 24926 24927 tests: drop support for alternative names of select syscall. 24928 This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824. 24929 24930 * tests/select.awk: Drop _newselect support. 24931 * tests/select.test: Skip if select syscall is not supported. 24932 24933 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 24934 24935 Rename _newselect to select. 24936 As an exception to the general rules that syscall names should match 24937 __NR_* constants defined in kernel headers, show select as "select" 24938 and old select as "oldselect". 24939 24940 * linux/arm/syscallent.h (82): Change name to oldselect. 24941 * linux/hppa/syscallent.h (142): Change name to select. 24942 * linux/mips/syscallent-n32.h (6022): Likewise. 24943 * linux/mips/syscallent-n64.h (5022): Likewise. 24944 * linux/mips/syscallent-o32.h (4142): Likewise. 24945 * linux/sparc/syscallent.h (230): Likewise. 24946 24947 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 24948 24949 sparc: sync syscall entries with kernel headers. 24950 * linux/sparc/syscallent.h: Fix syscall entries for vmsplice, 24951 inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch, 24952 ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and 24953 sched_setaffinity. 24954 (67, 68, 202, 230): Change syscall names to match __NR_* constants 24955 defined in arch/sparc/include/uapi/asm/unistd.h. 24956 24957 2015-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 24958 24959 s390, s390x: sync syscall entry names with kernel headers. 24960 * linux/s390/syscallent.h (1, 180, 181): Change syscall names to match 24961 __NR_* constants defined in arch/s390/include/uapi/asm/unistd.h. 24962 * linux/s390x/syscallent.h: Likewise. 24963 24964 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 24965 24966 xlat: avoid fork bombing the build system. 24967 When there were fewer xlat headers, this didn't matter as much. 24968 But now with >200, trying to run them all in parallel can easily 24969 fork bomb smaller systems. 24970 24971 * xlat/gen.sh (main): Do not more jobs than # of cpus. 24972 24973 2015-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 24974 24975 arm: sync syscall entry names with kernel. 24976 * linux/arm/syscallent.h (82, 90, 180, 181, 327): 24977 Change syscall names to match __NR_* constants defined 24978 in arch/arm/include/uapi/asm/unistd.h. 24979 24980 arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries 24981 * linux/arm/syscallent.h (320, 321, 350): Fix names and handlers. 24982 24983 hppa: sync syscall entry names with kernel. 24984 * linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280): 24985 Change syscall names to match __NR_* constants defined in 24986 arch/parisc/include/uapi/asm/unistd.h. 24987 24988 subcall.h: add sendmmsg entry. 24989 * linux/subcall.h: Add sys_sendmmsg entry. 24990 (SYS_socket_nsubcalls): Update. 24991 24992 arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition. 24993 * linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall. 24994 24995 ia64: parametrize i386 syscallent size check. 24996 * linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls) 24997 instead of numeric constant. 24998 24999 Cleanup linux/subcall.h. 25000 * linux/subcall.h: Use SYS_ipc_subcall. 25001 25002 alpha: fix statfs decoding. 25003 * statfs.c (printstatfs) [ALPHA]: Remove faulty code. 25004 25005 x32: fix build regression. 25006 * linux/x32/arch_regs.h: New file. 25007 * Makefile.am (EXTRA_DIST): Add it. 25008 25009 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 25010 25011 hppa: fix fanotify_mark decoding. 25012 The parisc kernel has some legacy baggage here and decodes the 64bit 25013 field in the reverse order. Handle it in strace too. 25014 25015 * fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits. 25016 25017 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 25018 25019 ia64: fix decoding of getresuid/getresgid/setresgid. 25020 Looks like the similarity of these names caused confusion when generating 25021 the syscall table. getresgid was wired to the wrong output while the other 25022 two were wired up to printargs instead of the real printer. 25023 25024 * linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to 25025 sys_getresgid, and setresgid to sys_setresgid. 25026 25027 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 25028 25029 ia64: fix up builds after 16bit uid support. 25030 The ia64 port pulls in the i386 syscall table so it can decode 25031 32bit apps, so we need to enable the 16bit uid parsers for it. 25032 25033 * defs.h (NEED_UID16_PARSERS): Define to 1 for IA64. 25034 * linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings. 25035 25036 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 25037 25038 v4l2: use uintmax_t for times. 25039 There is no guarantee that the backing value for the various time fields 25040 are ints or longs which makes printfs annoying. Lets cast them to the 25041 uintmax_t type so we can use the j flag and not worry about truncation. 25042 25043 * v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec. 25044 25045 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 25046 25047 ignore core/compile files. 25048 Newer autotools includes a compile helper script. 25049 25050 * .gitignore: Add /compile and core. 25051 25052 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 25053 25054 NEWS: Prepare for 4.10 release. 25055 25056 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 25057 25058 Remove support for systems without PTRACE_SETOPTIONS. 25059 Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS 25060 and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE 25061 are universally available. 25062 25063 This change removes all code that implemented post-execve SIGTRAP 25064 handling and fork/vfork/clone->CLONE_PTRACE substitution. 25065 25066 * defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros. 25067 (need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations. 25068 * strace.c (need_fork_exec_workarounds, 25069 test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all): 25070 Remove. 25071 (syscall_trap_sig): Set to (SIGTRAP | 0x80). 25072 (ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC). 25073 (detach): Do not test for TCB_BPTSET. 25074 (init): Do not call test_ptrace_setoptions_followfork and 25075 test_ptrace_setoptions_for_all. Do not test for TCB_BPTSET. 25076 * syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec, 25077 syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove. 25078 (trace_syscall_entering): Do not test for TCB_WAITEXECVE. Do not call 25079 syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec. 25080 (trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and 25081 syscall_fixup_for_fork_exec. 25082 [IA64] (ia64_ia32mode): Make static. 25083 * linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration. 25084 * util.c: Do not include "syscall.h". 25085 (arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0, 25086 restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt): 25087 Remove. 25088 * tests/ptrace_setoptions.test: Remove. 25089 * tests/Makefile.am (TESTS): Remove it. 25090 25091 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 25092 25093 tests: robustify pc.test. 25094 * tests/pc.c (main): Unmap larger memory region. 25095 Dump process map for debug purposes. 25096 * tests/pc.test: Update regexps to take CLD_DUMPED child process 25097 into account. 25098 25099 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 25100 25101 tests: fix "make dist" regression. 25102 * tests/Makefile.am (EXTRA_DIST): Add getrandom.awk. 25103 25104 tests: workaround broken awk. 25105 * tests/getdents.out: New file. 25106 * tests/Makefile.am (EXTRA_DIST): Add it. 25107 * tests/getdents.test: Check whether awk is capable of matching long 25108 regular expressions. 25109 25110 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 25111 25112 Fix compilation warnings about incompatible print formats. 25113 On some platforms printing of __s64 types with "%lld" format, 25114 or __u64 types with "%llu" or "%llx" formats causes a warning 25115 that __s64/__u64 type is not compatible with long long format. 25116 From my PoV, this is nonsense, but the workaround costs nothing. 25117 25118 * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types 25119 to (unsigned long long). 25120 * v4l2.c (v4l2_ioctl): Likewise. Cast __s64 type to (long long). 25121 25122 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 25123 25124 powerpc64: fix build regression. 25125 * linux/powerpc64/arch_regs.h: New file. 25126 * Makefile.am (EXTRA_DIST): Add it. 25127 25128 signalent: update from linux v3.19. 25129 * linux/alpha/signalent.h: Update from linux v3.19 signalent.sh. 25130 * linux/hppa/signalent.h: Likewise. 25131 * linux/mips/signalent.h: Likewise. 25132 * linux/sparc/signalent.h: Likewise. 25133 25134 Cleanup auxiliary signalent files. 25135 * linux/aarch64/signalent1.h: Include "signalent.h". 25136 * linux/powerpc64/signalent1.h: Likewise. 25137 * linux/sparc64/signalent2.h: Likewise. 25138 * linux/tile/signalent1.h: Likewise. 25139 * linux/x32/signalent1.h: Likewise. 25140 * linux/x86_64/signalent1.h: Likewise. 25141 * linux/x86_64/signalent2.h: Likewise. 25142 * linux/sparc64/signalent.h: Include "sparc/signalent.h". 25143 * linux/sparc64/signalent1.h: Include "sparc/signalent1.h". 25144 * linux/x32/signalent.h: Remove. 25145 * Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h. 25146 25147 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 25148 25149 x86_64, x32: fix sys_sigreturn. 25150 On x86_64/x32, sys_sigreturn is defined only for i386 personality. 25151 25152 * signal.c (sys_sigreturn): Define for X32. 25153 (sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only. 25154 25155 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 25156 25157 sparc, x32: fix build regression. 25158 * syscall.c (print_pc): Use current_wordsize iff it is defined. 25159 25160 Change errnoent.h files to use designated initializers. 25161 * signal.c (printsiginfo): Allow elements of errnoent array to be zero. 25162 * syscall.c (trace_syscall_exiting): Likewise. 25163 * errnoent.sh: Output designated initializers. 25164 * linux/errnoent.h: Regenerated. 25165 * linux/alpha/errnoent.h: Regenerated. 25166 * linux/hppa/errnoent.h: Regenerated. 25167 * linux/mips/errnoent.h: Regenerated. 25168 * linux/sparc/errnoent.h: Regenerated. 25169 * linux/sparc/errnoent1.h: Regenerated. 25170 * linux/powerpc/errnoent.h: New file. 25171 * linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h". 25172 * Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h 25173 and linux/powerpc64/errnoent.h. 25174 25175 errnoent: update from linux v3.19. 25176 * linux/errnoent.h: Update from linux v3.19 using errnoent.sh. 25177 * linux/alpha/errnoent.h: Likewise. 25178 * linux/hppa/errnoent.h: Likewise. 25179 * linux/mips/errnoent.h: Likewise. 25180 * linux/sparc/errnoent.h: Likewise. 25181 25182 Cleanup auxiliary errnoent files. 25183 * linux/aarch64/errnoent1.h: Include "errnoent.h". 25184 * linux/powerpc64/errnoent1.h: Likewise. 25185 * linux/sparc64/errnoent2.h: Likewise. 25186 * linux/tile/errnoent1.h: Likewise. 25187 * linux/x32/errnoent1.h: Likewise. 25188 * linux/x86_64/errnoent1.h: Likewise. 25189 * linux/x86_64/errnoent2.h: Likewise. 25190 * linux/sparc64/errnoent.h: Include "sparc/errnoent.h". 25191 * linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h". 25192 * linux/x32/errnoent.h: Remove. 25193 * Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h. 25194 25195 2015-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 25196 25197 evdev: update constants from linux v3.19. 25198 * xlat/evdev_keycode.in: Update from linux v3.19. 25199 * xlat/evdev_prop.in: Likewise. 25200 25201 evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands. 25202 * evdev.c (keycode_V2_ioctl): Use evdev_keycode to print 25203 input_keymap_entry.keycode. 25204 25205 evdev: fix build with old kernel headers. 25206 * configure.ac: Check whether struct input_absinfo.resolution is defined 25207 in <linux/input.h>. 25208 * evdev.c (SYN_MAX): Add fallback definition. 25209 (abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check. 25210 (keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks. 25211 (evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW, 25212 EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW. 25213 (evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP, 25214 EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE. 25215 25216 2015-02-22 Etienne Gemsa <etienne.gemsa (a] lse.epita.fr> 25217 25218 Add decoding for evdev ioctls. 25219 This patch introduces decoding for evdev ioctls. For EVIOCSFF the five 25220 first members are decoded, the union is not. The code was compiled and 25221 tested on x86_64 with Linux 3.13. 25222 25223 * evdev.c: New file. 25224 * Makefile.am (strace_SOURCES): Add it. 25225 * defs.h (evdev_ioctl): New prototype. 25226 * ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands. 25227 * xlat/evdev_autorepeat.in: New file. 25228 * xlat/evdev_ff_status.in: New file. 25229 * xlat/evdev_ff_types.in: New file. 25230 * xlat/evdev_keycode.in: New file. 25231 * xlat/evdev_leds.in: New file. 25232 * xlat/evdev_misc.in: New file. 25233 * xlat/evdev_mtslots.in: New file. 25234 * xlat/evdev_prop.in: New file. 25235 * xlat/evdev_relative_axes.in: New file. 25236 * xlat/evdev_snd.in: New file. 25237 * xlat/evdev_switch.in: New file. 25238 * xlat/evdev_sync.in: New file. 25239 25240 2015-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 25241 25242 Fix build with old kernel headers. 25243 * strace.c (print_debug_info, maybe_allocate_tcb, print_signalled, 25244 print_exited): Remove "const" qualifier from status variable to 25245 workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED 25246 macros. 25247 * v4l2.c: Include <linux/types.h>. 25248 (v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS 25249 macros are defined. 25250 * tests/Makefile.am (AM_CPPFLAGS): Define. 25251 25252 Fix "make dist" regression. 25253 * Makefile.am (EXTRA_DIST): Remove README-linux. 25254 25255 2015-02-20 Elliott Hughes <enh (a] google.com> 25256 25257 test/sfd.c: add missing includes. 25258 25259 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 25260 25261 Remove linux/fanotify.h. 25262 * linux/fanotify.h: Remove. 25263 * Makefile.am (EXTRA_DIST): Remove it. 25264 * fanotify.c: Do not include <linux/fanotify.h>. 25265 * xlat/fan_classes.in: Add default values. 25266 * xlat/fan_event_flags.in: Likewise. 25267 * xlat/fan_init_flags.in: Likewise. 25268 * xlat/fan_mark_flags.in: Likewise. 25269 25270 Remove linux/keyctl.h. 25271 * linux/keyctl.h: Remove. 25272 * Makefile.am (EXTRA_DIST): Remove it. 25273 * keyctl.c: Do not include <linux/keyctl.h>. 25274 * xlat/key_perms.in: Add default values. 25275 * xlat/key_reqkeys.in: Likewise. 25276 * xlat/key_spec.in: Likewise. 25277 * xlat/keyctl_commands.in: Likewise. 25278 25279 Remove linux/kexec.h. 25280 * linux/kexec.h: Remove. 25281 * Makefile.am (EXTRA_DIST): Remove it. 25282 * kexec.c: Do not include <linux/kexec.h>. 25283 * xlat/kexec_arch_values.in: Add default values. 25284 * xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default 25285 values. 25286 25287 Remove linux/inotify.h. 25288 * linux/inotify.h: Remove. 25289 * Makefile.am (EXTRA_DIST): Remove it. 25290 * inotify.c: Do not include <linux/inotify.h>. 25291 * xlat/inotify_flags.in: Add default values. 25292 25293 Remove linux/reboot.h. 25294 * linux/reboot.h: Remove. 25295 * Makefile.am (EXTRA_DIST): Remove it. 25296 * reboot.c: Do not include <linux/reboot.h>. 25297 * xlat/bootflags1.in: Add default values. 25298 * xlat/bootflags2.in: Likewise. 25299 * xlat/bootflags3.in: Likewise. 25300 25301 seccomp: fix fallback definitions of some SECCOMP_* constants. 25302 * seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER, 25303 SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions. 25304 * xlat/seccomp_filter_flags.in: Add default value. 25305 * xlat/seccomp_ops.in: Add default values. 25306 25307 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 25308 25309 is_negated_errno: sync MAX_ERRNO with the kernel. 25310 Linux kernel used to guarantee that the largest errno value will not 25311 exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit 25312 v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently 25313 broke it. The guarantee is back with kernel commit 25314 v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d. 25315 25316 * syscall.c (is_negated_errno): Set maximum errno value to 4095. 25317 25318 2015-02-19 Mike Frysinger <vapier (a] gentoo.org> 25319 25320 README-linux: punt. 25321 Considering we're requiring linux-2.6 era kernels, the discussion of 25322 header troubles that plagued 2.2 and 2.4 are no longer relevant. 25323 25324 * README-linux: Delete. 25325 25326 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 25327 25328 Improve prctl decoding. 25329 * configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h. 25330 * prctl.c (sys_prctl): Implement full decoding of all PR_* constants 25331 as defined in linux v3.19. 25332 (sys_arch_prctl): Fix decoding of unknown commands. 25333 * xlat/cap.in: New file. 25334 * xlat/pr_mce_kill.in: New file. 25335 * xlat/pr_mce_kill_policy.in: New file. 25336 * xlat/pr_set_mm.in: New file. 25337 * xlat/pr_tsc.in: New file. 25338 * xlat/pr_unalign_flags.in: New file. 25339 * xlat/secbits.in: New file. 25340 * xlat/prctl_options.in: Remove non-linux constants, add fallback 25341 definitions. 25342 * xlat/seccomp_mode.in: Add fallback definitions. 25343 25344 xlat: extend syntax. 25345 * xlat/gen.sh (gen_header): If the name of constant is specified with a 25346 value, generate a default definition for the constant using this value. 25347 * xlat/timerfdflags.in: Use extended syntax. 25348 25349 Move CAP_* definitions out to header files. 25350 * Makefile.am (strace_SOURCES): Add caps0.h and caps1.h. 25351 * caps0.h: New file. 25352 * caps1.h: New file. 25353 * capability.c: Remove CAP_* definitions, include "caps0.h" 25354 and "caps1.h" instead. 25355 Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h". 25356 Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h". 25357 (print_cap_bits): Update callers. 25358 * xlat/capabilities.in: Rename to xlat/cap_mask0.in. 25359 * xlat/capabilities1.in: Rename to xlat/cap_mask1.in. 25360 25361 2015-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 25362 25363 Declare all format printers with printf format attribute. 25364 * defs.h (printllval, printnum_int, printnum_long): Mark with 25365 format(printf) attribute. 25366 * sock.c (sock_ioctl): Fix format string. 25367 25368 2015-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 25369 25370 Rename printnum to printnum_long to avoid confusion. 25371 * defs.h (printnum): Rename to printnum_long. 25372 * util.c (printnum): Likewise. 25373 * process.c (sys_ptrace): Likewise. 25374 * time.c (sys_time): Likewise. 25375 25376 Use printnum_int consistently. 25377 * sock.c (sock_ioctl): Use printnum_int instead of printnum to print 25378 integer type. 25379 * stream.c (sys_getpmsg): Likewise. 25380 25381 2015-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 25382 25383 print_pc: fix multiple personalities support. 25384 * syscall.c (print_pc): Choose instruction pointer format depending 25385 on current_wordsize, not the size of long integer type. 25386 * tests/pc.c: New file. 25387 * tests/pc.test: New test. 25388 * tests/Makefile.am (check_PROGRAMS): Add pc. 25389 (TESTS): Add pc.test. 25390 * tests/.gitignore: Add pc. 25391 25392 mips: use PTRACE_GETREGS to fetch all registers. 25393 * linux/mips/arch_regs.h (struct mips_regs): New structure. 25394 (mips_REG_*): New macros. 25395 * signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP. 25396 * syscall.c [MIPS] (struct mips_regs): New variable. 25397 [MIPS] (ARCH_REGS_FOR_GETREGS): New macro. 25398 (mips_a3, mips_r2): Remove. 25399 (print_pc) [MIPS]: Use mips_REG_EPC. 25400 (get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3. 25401 (get_syscall_args) [MIPS]: Use mips_REG_A[0-5]. 25402 (get_syscall_result) [MIPS]: Remove. 25403 (get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0. 25404 25405 mips: move ABI check to configure.ac. 25406 * configure.ac [MIPS]: Check for MIPS ABI. 25407 * defs.h [MIPS]: Remove MIPS ABI check. 25408 * ioctlsort.c: Likewise. 25409 25410 tests: support alternative names of select syscall. 25411 * tests/select.awk: Recognize "_newselect" as another name of "select". 25412 * tests/select.test: Try alternative names of select syscall. 25413 25414 2015-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 25415 25416 i386: fix compilation warning. 25417 Some gcc versions complain about assigning long* to uint32_t* on i386. 25418 25419 * syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*. 25420 * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. 25421 * linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h". 25422 (i386_esp_ptr): New prototype. 25423 25424 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 25425 25426 Do not reset get_regs_error unnecessarily. 25427 As get_regs() is now guaranteed to set get_regs_error, 25428 there is no need to reset get_regs_error before get_regs() call. 25429 25430 * strace.c (trace): Call clear_regs() iff !WIFSTOPPED. 25431 25432 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 25433 25434 get_syscall_result: remove redundant ifdefs. 25435 As get_regs() is now guaranteed to fetch registers when either 25436 ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can 25437 safely replace all checks for architectures where these macros are defined 25438 with a single check for these macros. 25439 25440 * syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET || 25441 ARCH_REGS_FOR_GETREGS]. Remove all checks for architectures where 25442 nothing has to be done after get_regs(). 25443 25444 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 25445 25446 get_regs: define for all architectures. 25447 * defs.h (get_regs_error): Remove. 25448 (clear_regs): Update prototype, declare unconditionally. 25449 (get_regs): Declare unconditionally. 25450 * syscall.c (clear_regs): New function. 25451 (get_regs): Define unconditionally. 25452 (get_regs_error): Define unconditionally, change scope to static. 25453 25454 get_regs: unify code for architectures that use PTRACE_GETREGS. 25455 * syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE] 25456 (ARCH_REGS_FOR_GETREGS): New macro. 25457 (get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures. 25458 25459 get_regset: define iff PTRACE_GETREGSET is used. 25460 * syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET, 25461 ARCH_IOVEC_FOR_GETREGSET): New macros. 25462 (get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change 25463 return type to long, return ptrace() return code instead of assigning it 25464 to get_regs_error; do not list individual architectures, implement 25465 constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET. 25466 (get_regs): Assign get_regset() return code to get_regs_error. 25467 25468 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 25469 25470 arm, i386: switch back to use PTRACE_GETREGS. 25471 PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and 25472 i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS 25473 is a bit more costly, so choose the method that costs less. 25474 This partially reverts commit v4.7-149-gfaa177e. 25475 25476 * syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove. 25477 (get_regset) [ARM || I386]: Remove. 25478 (get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally. 25479 25480 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 25481 25482 syscall.c: remove obsolete ifdefs. 25483 * syscall.c (get_regset, get_regs): Do not check for availability 25484 of PTRACE_GETREGSET and NT_PRSTATUS macros. 25485 25486 syscall.c: ensure that NT_PRSTATUS is defined. 25487 * syscall.c: Do not include <elf.h>. 25488 (NT_PRSTATUS): New macro. 25489 25490 2015-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 25491 25492 Move regs-related macros and declarations from defs.h to regs.h. 25493 * regs.h: New file. 25494 * Makefile.am (strace_SOURCES): Add it. 25495 * linux/arch_regs.h: New file. 25496 * linux/alpha/arch_regs.h: Likewise. 25497 * linux/arm/arch_regs.h: Likewise. 25498 * linux/hppa/arch_regs.h: Likewise. 25499 * linux/i386/arch_regs.h: Likewise. 25500 * linux/ia64/arch_regs.h: Likewise. 25501 * linux/mips/arch_regs.h: Likewise. 25502 * linux/powerpc/arch_regs.h: Likewise. 25503 * linux/sh64/arch_regs.h: Likewise. 25504 * linux/sparc/arch_regs.h: Likewise. 25505 * linux/sparc64/arch_regs.h: Likewise. 25506 * linux/tile/arch_regs.h: Likewise. 25507 * linux/x86_64/arch_regs.h: Likewise. 25508 * Makefile.am (EXTRA_DIST): Add them. 25509 * defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*, 25510 and ARM_* macros. 25511 Remove declarations of struct pt_regs variables. 25512 [SPARC]: Do not include <asm/psr.h>. 25513 [SPARC64]: Do not include <asm/psrcompat.h>. 25514 * bjm.c: Do not include <sys/user.h>. 25515 * process.c: Include "regs.h". 25516 Do not include <sys/user.h> and <sys/reg.h>. 25517 [IA64]: Do not include <asm/ptrace_offsets.h> and <asm/rse.h>. 25518 * util.c: Likewise. 25519 * syscall.c: Likewise. 25520 [AARCH64]: Define struct arm_pt_regs and ARM_* macros. 25521 [SPARC]: Include <asm/psr.h>. 25522 [SPARC64]: Include <asm/psrcompat.h>. 25523 * signal.c: Include "regs.h". 25524 Do not include <sys/user.h> and <sys/reg.h>. 25525 [IA64]: Do not include <asm/ptrace_offsets.h>. 25526 * strace.c [IA64]: Do not include <asm/ptrace_offsets.h>. 25527 25528 Move all ptrace-related macros and declarations from defs.h to ptrace.h. 25529 * ptrace.h: New file. 25530 * Makefile.am (strace_SOURCES): Add it. 25531 * configure.ac (AC_CHECK_HEADERS): Remove linux/ptrace.h and sys/ptrace.h. 25532 * defs.h: Do not include <sys/ptrace.h> and <asm/ptrace.h>. 25533 Remove definitions of PTRACE_* macros. 25534 * process.c: Remove <linux/ptrace.h> workarounds, include "ptrace.h". 25535 * signal.c: Likewise. 25536 * syscall.c: Likewise. 25537 * util.c: Likewise. 25538 * strace.c: Include "ptrace.h". 25539 * wait.c: Likewise. 25540 25541 2015-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 25542 25543 Enhance wait status decoding. 25544 * xlat/ptrace_events.in: New file. 25545 * wait.c: Include "xlat/ptrace_events.h". 25546 (printstatus): In case of WIFSTOPPED, print 0x80 flag separately from 25547 the stop signal name. 25548 [WIFCONTINUED]: Add WIFCONTINUED support. 25549 Decode PTRACE_EVENT_* events. 25550 25551 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 25552 25553 scsi: add bsg support. 25554 The Linux kernel supports two different versions of the SG_IO API, 25555 namely v3 and v4. This patch adds support for version 4 of this API. 25556 At least the sg3_utils package supports version 4 of this API. Version 25557 4 of this API is used if /dev/bsg/H:C:I:L is used as device name. 25558 25559 This patch has been tested by inspecting the output of the following 25560 commands: 25561 25562 modprobe scsi_debug dev_size_mb=16 delay=0 25563 dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p') 25564 ./strace -eioctl -s256 sg_inq $dev 25565 echo 'Test XDWRITEREAD(10)' 25566 bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p') 25567 dd if=/dev/zero bs=512 count=1 | 25568 ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00 25569 25570 * configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h. 25571 * xlat/bsg_protocol.in: New file. 25572 * xlat/bsg_subprotocol.in: Likewise. 25573 * scsi.c: Include them and <linux/bsg.h>. 25574 (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 25575 print_sg_io_v4_res): New functions. 25576 (print_sg_io_req, print_sg_io_res): Use them. 25577 (scsi_ioctl): Update callers. 25578 25579 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 25580 25581 scsi: Add iovec support. 25582 * scsi.c (print_sg_io_req, print_sg_io_res): Add support for decoding 25583 iovecs passed via the SG I/O v3 interface. Decode the "data in" and 25584 "data out" buffers in hex instead of in ASCII. 25585 25586 scsi: on exit, print only initialized part of the buffer. 25587 * scsi.c (print_sg_io_res): Only print that part of the data in buffer 25588 that has been initialized by the SCSI LLD driver. 25589 25590 scsi: make print_sg_io_buffer() print square brackets instead of its callers 25591 * scsi.c (print_sg_io_buffer): Print square brackets in this function. 25592 (print_sg_io_req, print_sg_io_res): Update callers. 25593 25594 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 25595 25596 scsi: improve consistency with other decoding functions. 25597 Pass pointers to tracee's memory as integers instead of pointers. 25598 25599 * scsi.c (print_sg_io_buffer): Change second argument's type to 25600 unsigned long. 25601 (print_sg_io_req, print_sg_io_res): Update callers. 25602 25603 2015-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 25604 25605 tests: extend getdents to support all filesystems regardless of file order 25606 * tests/getdents.awk: Include all 6 possible permutations of 3 25607 direntries to regexps. 25608 25609 2015-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 25610 25611 print_setsockopt: fix fall-through bug in SOL_IP switch case. 25612 This fixes the bug introduced by commit v4.9-250-ga0a4909. 25613 25614 * net.c (print_setsockopt): Separate SOL_IP case from SOL_PACKET. 25615 25616 Reported-by: Ben Noordhuis <info (a] bnoordhuis.nl> 25617 25618 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 25619 25620 Do not watch for post-execve SIGTRAP if PTRACE_O_TRACEEXEC is enabled. 25621 If PTRACE_O_TRACEEXEC option is enabled, then post-execve SIGTRAPs are 25622 suppressed and we can safely skip -ENOSYS heuristics. This partially 25623 reverts commits v4.9-258-g8e398b6 and v4.9-261-gd70c41d. 25624 25625 * syscall.c (syscall_fixup_on_sysenter): Skip if PTRACE_O_TRACEEXEC 25626 flag is set in ptrace_setoptions. Remove all SECCOMP_RET_ERRNO 25627 workarounds as they are not needed when PTRACE_O_TRACEEXEC is not 25628 supported by the kernel. 25629 25630 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 25631 25632 When the process stared by strace exits/terminates, forget its pid. 25633 The process stared by strace can exit/terminate only once. When this 25634 happens, forget its pid, so that any other event or action related to a 25635 process with the same pid as the pid of that first process would not be 25636 confused with that first process. 25637 25638 * strace.c (print_signalled, print_exited): Clear strace_child when it 25639 equals to the given pid. 25640 25641 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 25642 25643 -b execve: avoid misleading warning about unknown pid. 25644 * strace.c (maybe_allocate_tcb): If detach_on_execve is set, do not warn 25645 about !WIFSTOPPED process with pid == strace_child. 25646 * tests/bexecve.test: New test. 25647 * tests/Makefile.am (TESTS): Add it. 25648 25649 -b execve: do not use struct tcb after detach. 25650 * strace.c (trace): Do not proceed after detach. 25651 25652 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 25653 25654 trace: split into several functions. 25655 This change moves the main loop back to main() and splits trace() 25656 into several functions. There are no algorithmic changes. 25657 25658 * strace.c (print_debug_info, maybe_allocate_tcb, maybe_switch_tcbs, 25659 print_signalled, print_exited, print_stopped, startup_tcb): New 25660 functions. 25661 (trace) Use them. Move the main loop ... 25662 (main): ... here. 25663 25664 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 25665 25666 printsiginfo: constify the first argument. 25667 * signal.c (printsiginfo): Make the first argument a pointer to a const type. 25668 * defs.h (printsiginfo): Likewise. 25669 (printsiginfo, printsiginfo_at): Always define these prototypes. 25670 * configure.ac (AC_CHECK_TYPES): Remove siginfo_t, as HAVE_SIGINFO_T 25671 is no longer used. 25672 25673 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25674 25675 test: add a manual test for seccomp decoding. 25676 * test/.gitignore: Add seccomp. 25677 * test/Makefile (PROGS): Likewise. 25678 * test/seccomp.c: New file. 25679 * test/README: Mention ../tests/. 25680 25681 Implement seccomp decoding. 25682 * configure.ac (AC_CHECK_HEADERS): Add linux/filter.h 25683 and linux/seccomp.h. 25684 * defs.h (print_seccomp_filter): New prototype. 25685 * linux/dummy.h (sys_seccomp): Remove. 25686 * linux/syscall.h (sys_seccomp): New prototype. 25687 * prctl.c: Include <linux/seccomp.h>. 25688 (sys_prctl): Decode PR_SET_SECCOMP. 25689 * seccomp.c: New file. 25690 * Makefile.am (strace_SOURCES): Add it. 25691 * xlat/bpf_class.in: New file. 25692 * xlat/bpf_miscop.in: Likewise. 25693 * xlat/bpf_mode.in: Likewise. 25694 * xlat/bpf_op_alu.in: Likewise. 25695 * xlat/bpf_op_jmp.in: Likewise. 25696 * xlat/bpf_rval.in: Likewise. 25697 * xlat/bpf_size.in: Likewise. 25698 * xlat/bpf_src.in: Likewise. 25699 * xlat/seccomp_filter_flags.in: Likewise. 25700 * xlat/seccomp_mode.in: Likewise. 25701 * xlat/seccomp_ops.in: Likewise. 25702 * xlat/seccomp_ret_action.in: Likewise. 25703 25704 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25705 25706 is_negated_errno: support large errno values. 25707 Thanks to SECCOMP_RET_DATA == 0xffff, abnormally large errno 25708 values could be easily seen when a seccomp filter is used, e.g. 25709 BPF_STMT(BPF_RET, SECCOMP_RET_ERRNO | SECCOMP_RET_DATA) 25710 25711 * syscall.c (is_negated_errno): Allow errno values as large as 0xffff. 25712 25713 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25714 25715 x86, x32, x86_64: print SECCOMP_RET_ERRNO filtered syscalls. 25716 This is required to process SECCOMP_RET_ERRNO filtered syscalls on 25717 systems where linux kernel does not change the syscall number to -1. 25718 25719 * syscall.c (is_negated_errno): Move before syscall_fixup_on_sysenter. 25720 (syscall_fixup_on_sysenter) [I386 || X32 || X86_64] : Use it to check 25721 AX register. 25722 25723 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25724 25725 is_negated_errno: merge x86_64 and x32 definitions. 25726 * syscall.c (kernel_long_t, kernel_ulong_t): New types. 25727 (is_negated_errno): Merge [X32] and [!X32] definitions. 25728 (get_error): Merge [X86_64] and [X32] code. 25729 25730 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25731 25732 x32: rename is_negated_errno_x32 to is_negated_errno. 25733 Use the same function name on all architectures. 25734 25735 * syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno. 25736 (get_error) [X32]: Update callers. 25737 25738 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25739 25740 x86, x32, x86_64: do not skip syscall number -1. 25741 Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. 25742 25743 * syscall.c (syscall_fixup_on_sysenter) [I386 || X32 || X86_64]: 25744 Do not skip syscalls that have number -1. 25745 25746 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 25747 25748 x86_64: do not interpet syscall number -1 as a x32 personality syscall. 25749 Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. 25750 25751 * syscall.c (get_scno) [X86_64]: Handle the case of scno == -1. 25752 25753 2015-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 25754 25755 Implement getrandom syscall decoding. 25756 * getrandom.c: New file. 25757 * Makefile.am (strace_SOURCES): Add it. 25758 * linux/dummy.h (sys_getrandom): Remove. 25759 * linux/syscall.h (sys_getrandom): New prototype. 25760 * xlat/getrandom_flags.in: New file. 25761 * tests/getrandom.c: New file. 25762 * tests/getrandom.awk: New file. 25763 * tests/getrandom.test: New test. 25764 * tests/Makefile.am (check_PROGRAMS): Add getrandom. 25765 (TESTS): Add getrandom.test. 25766 (EXTRA_DIST): Add getrandom.awk. 25767 * tests/.gitignore: Add getrandom. 25768 25769 2015-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 25770 25771 tests: add a test for select syscall decoding. 25772 Convert test/select.c into a regular test. 25773 25774 * test/Makefile (PROGS): Remove select. 25775 * test/.gitignore: Likewise. 25776 * test/select.c: Rewrite to ... 25777 * tests/select.c: ... new file. 25778 * tests/select.awk: New file. 25779 * tests/select.test: New test. 25780 * tests/Makefile.am (check_PROGRAMS): Add select. 25781 (TESTS): Add select.test. 25782 (EXTRA_DIST): Add select.awk. 25783 * tests/.gitignore: Add select. 25784 25785 2015-02-01 Dmitry V. Levin <ldv (a] altlinux.org> 25786 25787 tests: add a test for the latest dumpio fix. 25788 * tests/dumpio.expected: New file. 25789 * tests/unix-pair-send-recv.c: New file. 25790 * tests/dumpio.test: New test. 25791 * tests/Makefile.am (check_PROGRAMS): Add unix-pair-send-recv. 25792 (TESTS): Add dumpio.test. 25793 (EXTRA_DIST): Add dumpio.expected. 25794 * tests/.gitignore: Add unix-pair-send-recv. 25795 25796 2015-02-01 Aurelien Jacobs <aurel (a] gnuage.org> 25797 25798 Fix simultaneous -e read and -e write usage. 25799 This allows using both -e read=FD and -e write=FD at the same time 25800 with the same FD. 25801 Without this patch, the -e write=FD is ignored if -e read=FD is used 25802 at the same time. 25803 25804 2015-01-31 Dmitry V. Levin <ldv (a] altlinux.org> 25805 25806 net.c: remove unused HAVE_SIN6_SCOPE_ID_LINUX-based code. 25807 The AC_SIN6_SCOPE_ID autoconf macro that was able to define 25808 HAVE_SIN6_SCOPE_ID_LINUX was removed by commit v4.4-98-g64f793a. 25809 25810 * net.c [HAVE_SIN6_SCOPE_ID_LINUX]: Remove. 25811 25812 2015-01-30 Dmitry V. Levin <ldv (a] altlinux.org> 25813 25814 printsock: do not fetch sockaddr.sa_data twice. 25815 * net.c (printsock): Print addrbuf.sa.sa_data using print_quoted_string. 25816 25817 setsockopt: add decoding of MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP. 25818 * net.c (print_group_req): New function. 25819 (print_setsockopt): Use it. 25820 25821 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 25822 25823 tests: add a test for sockaddr_un.sun_path decoding. 25824 * tests/net-accept-connect.c: Allow long socket addresses. 25825 * tests/sun_path.test: New test. 25826 * tests/Makefile.am (TESTS): Add it. 25827 25828 printsock: print the whole sockaddr_un.sun_path. 25829 * net.c (printsock): If sockaddr_un.sun_path is not NUL-terminated, 25830 do not omit the last byte of sockaddr_un.sun_path array. 25831 25832 printsock: do not fetch sockaddr_un.sun_path twice. 25833 * net.c (printsock): Print addrbuf.sau.sun_path using 25834 print_quoted_string. 25835 25836 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 25837 25838 net: define all SOL_* constants. 25839 Ensure that all known SOL_* constants are defined. 25840 Sync the list of known SOL_* constants with linux/socket.h. 25841 25842 * net.c: Provide definitions for all SOL_* constants. 25843 Remove all SOL_* preprocessor conditionals. 25844 (socketlayers): Disconnect from inet_protocols. 25845 * xlat/socketlayers.in: Remove SOL_ICMP, add SOL_ALG and SOL_NFC. 25846 25847 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 25848 25849 setsockopt: decode PACKET_ADD_MEMBERSHIP. 25850 * xlat/packet_mreq_type.in: New file. 25851 * net.c: Include "xlat/packet_mreq_type.h". 25852 (print_packet_mreq): New function. 25853 (print_setsockopt): Use it. 25854 25855 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 25856 25857 getsockopt, setsockopt: do not decode structures in non-verbose mode. 25858 Move the code that is common between getsockopt and setsockopt parsers 25859 to a separate function. 25860 Move printers specific to getsockopt and setsockopt to separate 25861 functions, choose appropriate parsers depending on verbose mode. 25862 Move parsers of specific socket options to separate functions. 25863 25864 * net.c (printicmpfilter): Rename to print_icmp_filter. 25865 (printsockopt): Remove. 25866 (print_sockopt_fd_level_name, print_linger, print_ucred, 25867 print_tpacket_stats, print_getsockopt, print_tpacket_req, 25868 print_packet_mreq, print_setsockopt): New functions. 25869 (sys_getsockopt, sys_setsockopt): Use them. 25870 25871 2015-01-28 Dmitry V. Levin <ldv (a] altlinux.org> 25872 25873 sendmsg: do not decode msghdr in non-verbose mode. 25874 * net.c (printmsghdr): Do not decode struct msghdr in non-verbose mode. 25875 25876 decode_select: do not allocate unused memory. 25877 * desc.c (decode_select): On entering syscall, do not allocate memory 25878 in non-verbose mode. 25879 25880 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 25881 25882 xattr: quote using print_quoted_string. 25883 * xattr.c (print_xattr_val): Drop local quoting code, use 25884 print_quoted_string. 25885 25886 v4l2: quote pixelformat. 25887 * v4l2.c (print_pixelformat): Output in quoted v4l2_fourcc() format. 25888 25889 v4l2: quote strings. 25890 * v4l2.c (v4l2_ioctl): Print strings using print_quoted_string. 25891 25892 mips: quote sysmips nodename. 25893 * sysmips.c (sys_sysmips): Print nodename using print_quoted_string. 25894 25895 block_ioctl: quote strings. 25896 * block.c (print_blkpg_req): Print blkpg_partition.devname and 25897 blkpg_partition.volname using print_quoted_string. 25898 (block_ioctl): Print blk_user_trace_setup.name using print_quoted_string. 25899 25900 sys_uname: quote struct utsname members. 25901 * uname.c (PRINT_UTS_MEMBER): New macro. 25902 (sys_uname): Use them. 25903 25904 sock_ioctl: quote network interface names. 25905 * sock.c (print_ifname): New function. 25906 (sock_ioctl): Use it to quote ifr_name, ifru_newname, and ifru_slave. 25907 25908 printsock: quote network interface names. 25909 * net.c (printsock): Print network interface names returned by 25910 if_indextoname() using print_quoted_string. 25911 25912 getdents, getdents64: quote filenames. 25913 * dirent.c (print_old_dirent): Fix quoting. 25914 (sys_getdents): Print d_name using print_quoted_string. 25915 (sys_getdents64): Likewise. 25916 * tests/getdents.test: Test it. 25917 * tests/getdents.awk: Update. 25918 25919 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 25920 25921 printfd: quote pathnames. 25922 Change printfd() behaviour in show_fd_path mode to quote pathnames 25923 the same way printpathn() does. 25924 25925 * util.c (printfd): Print non-socket paths using print_quoted_string. 25926 * tests/scm_rights-fd.test: Test it. 25927 * tests/scm_rights.c: Update. 25928 25929 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 25930 25931 Rework string_quote API. 25932 string_quote() has proven to be too hard to use, replace it with 25933 print_quoted_string() that does memory allocation and prints the result. 25934 25935 * defs.h (string_quote): Remove. 25936 (QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES): New macros. 25937 (print_quoted_string): New prototype. 25938 * util.c (string_quote): Make static; take "style" flags instead 25939 of "len", treat QUOTE_0_TERMINATED style flag as former (len == -1); 25940 add QUOTE_OMIT_LEADING_TRAILING_QUOTES style flag support. 25941 (ALLOCA_CUTOFF, use_alloca): New macros. 25942 (print_quoted_string): New function. 25943 (printpathn, printstr): Update to new API. 25944 * loop.c (loop_ioctl): Likewise. 25945 * mtd.c (ubi_ioctl): Likewise. 25946 * net.c (print_scm_security): Likewise. 25947 * socketutils.c (unix_parse_response): Likewise. 25948 25949 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 25950 25951 avr32: fix typo in sys_timerfd syscall entry. 25952 * linux/avr32/syscallent.h (timerfd): Change sys_name to "timerfd". 25953 25954 hppa: fix typos in getresuid and getresgid syscall entries. 25955 * linux/hppa/syscallent.h (getresuid): Change sys_func to sys_getresuid. 25956 (getresgid): Change sys_func to sys_getresgid. 25957 25958 2015-01-24 Helge Deller <deller (a] gmx.de> 25959 25960 hppa: fix typo in getpeername syscall entry. 25961 This fixes an obvious typo which prints "lock" instead of "getpeername" 25962 for the getpeername syscall. 25963 25964 * linux/hppa/syscallent.h (getpeername): Change sys_name to "getpeername". 25965 25966 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 25967 25968 Impove struct cmsghdr decoding. 25969 Print all cmsghdr structures in msg_control array, 25970 not just the first one. 25971 Change output format to be consistent with other parts of strace 25972 where structures and arrays are printed. 25973 Implement decoder for SCM_SECURITY message type. 25974 25975 * net.c (print_scm_rights, print_scm_creds, print_scm_security): 25976 New functions. 25977 (printcmsghdr): Use them. Iterate over all members of the array. 25978 * xlat/scmvals.in: Add SCM_SECURITY. 25979 * tests/scm_rights.c (main): Pass one more descriptor to the receiver. 25980 Set SO_PASSCRED on the receiver part. Reserve enough space to receive 25981 SCM_CREDENTIALS and SCM_RIGHTS. 25982 * tests/scm_rights-fd.test: Update. 25983 25984 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 25985 25986 Update SO_* constants. 25987 * xlat/sockoptions.in: Add SO_DOMAIN, SO_MARK, SO_NOFCS, SO_PASSSEC, 25988 SO_PROTOCOL, SO_RCVBUFFORCE, SO_SNDBUFFORCE, SO_TIMESTAMPING, 25989 and SO_TIMESTAMPNS. 25990 25991 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 25992 25993 tests: run tests for each supported personality. 25994 When strace supports more than one personality, run test suite 25995 for each personality supported by the host system. 25996 25997 * bootstrap: Create tests-m32 and tests-mx32 subtrees from tests. 25998 * configure.ac: Check for -m32 and -mx32 runtime support. 25999 (AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile. 26000 * Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define. 26001 [HAVE_MX32_RUNTIME] (TESTS_MX32): Define. 26002 (SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32). 26003 * .gitignore: Add /tests-m32 and /tests-mx32. 26004 26005 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 26006 26007 Fix ILP32 personality struct cmsghdr decoding on LP64 architectures. 26008 * net.c (union_cmsghdr): New union. 26009 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (cmsghdr32): New structure. 26010 (printcmsghdr): Properly handle the case of current_wordsize < sizeof(long). 26011 26012 Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures 26013 * io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG 26014 && SUPPORTED_PERSONALITIES > 1]: Properly handle the case of 26015 current_wordsize < sizeof(long). 26016 26017 2015-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 26018 26019 ioctl: take all 32 bits of ioctl commands into account. 26020 Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl 26021 commands were used for decoding, which was the source for numerous 26022 annoying collisions like this: 26023 26024 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 26025 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) 26026 26027 The solution is to use all 32 bits for decoding, not just "number" and 26028 "type", but also "size" and "direction". 26029 26030 As some architectures override defaults that come from asm-generic/ and 26031 provide alternative definitions for some ioctl commands, we support 26032 per-architecture ioctl definitions and merge them with common 26033 definitions at build time. During the merge, we used to keep both 26034 generic and architecture-specific definitions, now architecture-specific 26035 definitions have precedence over generic ones -- ioctlsort omits 26036 definitions from asm-generic/ for those ioctl names that have different 26037 definitions in asm/. 26038 26039 Additional bits of "direction" are architecture specific -- the number 26040 of bits and their values differ between architectures. To reduce 26041 architecture differences in the source code, we keep "direction" in 26042 symbolic form and compile it in ioctlsort. 26043 26044 Additional bits of "size" are also architecture specific -- not only the 26045 number of bits differ between architectures, but sizes of many types 26046 depend on sizeof(long). To reduce architecture differences in the 26047 source code, we keep 32-bit and 64-bit versions of common ioctl 26048 definitions, and use the appropriate version for each architecture and 26049 personality. 26050 26051 To implement this, the tools for generating ioctl definitions from 26052 kernel headers have been rewritten, and the source format of ioctl 26053 definitions has been extended. The final ioctlent*.h files that are 26054 included by syscall.c are now generated from source ioctls_inc*.h and 26055 ioctls_arch*.h files at build time with ioctlsort. 26056 26057 * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. 26058 * ioctlsort.c: Rewritten. 26059 * linux/32/ioctls_inc.h: New file. 26060 * linux/64/ioctls_inc.h: New file. 26061 * linux/aarch64/ioctls_arch0.h: New file. 26062 * linux/aarch64/ioctls_arch1.h: New file. 26063 * linux/aarch64/ioctls_inc0.h: New file. 26064 * linux/aarch64/ioctls_inc1.h: New file. 26065 * linux/alpha/ioctls_arch0.h: New file. 26066 * linux/alpha/ioctls_inc0.h: New file. 26067 * linux/arc/ioctls_arch0.h: New file. 26068 * linux/arc/ioctls_inc0.h: New file. 26069 * linux/arm/ioctls_arch0.h: New file. 26070 * linux/arm/ioctls_inc0.h: New file. 26071 * linux/avr32/ioctls_arch0.h: New file. 26072 * linux/avr32/ioctls_inc0.h: New file. 26073 * linux/bfin/ioctls_arch0.h: New file. 26074 * linux/bfin/ioctls_inc0.h: New file. 26075 * linux/hppa/ioctls_arch0.h: New file. 26076 * linux/hppa/ioctls_inc0.h: New file. 26077 * linux/i386/ioctls_arch0.h: New file. 26078 * linux/i386/ioctls_inc0.h: New file. 26079 * linux/ia64/ioctls_arch0.h: New file. 26080 * linux/ia64/ioctls_inc0.h: New file. 26081 * linux/m68k/ioctls_arch0.h: New file. 26082 * linux/m68k/ioctls_inc0.h: New file. 26083 * linux/metag/ioctls_arch0.h: New file. 26084 * linux/metag/ioctls_inc0.h: New file. 26085 * linux/microblaze/ioctls_arch0.h: New file. 26086 * linux/microblaze/ioctls_inc0.h: New file. 26087 * linux/mips/ioctls_arch0.h: New file. 26088 * linux/mips/ioctls_inc0.h: New file. 26089 * linux/or1k/ioctls_arch0.h: New file. 26090 * linux/or1k/ioctls_inc0.h: New file. 26091 * linux/powerpc/ioctls_arch0.h: New file. 26092 * linux/powerpc/ioctls_inc0.h: New file. 26093 * linux/powerpc64/ioctls_arch0.h: New file. 26094 * linux/powerpc64/ioctls_arch1.h: New file. 26095 * linux/powerpc64/ioctls_inc0.h: New file. 26096 * linux/powerpc64/ioctls_inc1.h: New file. 26097 * linux/s390/ioctls_arch0.h: New file. 26098 * linux/s390/ioctls_inc0.h: New file. 26099 * linux/s390x/ioctls_arch0.h: New file. 26100 * linux/s390x/ioctls_inc0.h: New file. 26101 * linux/sh/ioctls_arch0.h: New file. 26102 * linux/sh/ioctls_inc0.h: New file. 26103 * linux/sh64/ioctls_arch0.h: New file. 26104 * linux/sh64/ioctls_inc0.h: New file. 26105 * linux/sparc/ioctls_arch0.h: New file. 26106 * linux/sparc/ioctls_inc0.h: New file. 26107 * linux/sparc64/ioctls_arch0.h: New file. 26108 * linux/sparc64/ioctls_arch2.h: New file. 26109 * linux/sparc64/ioctls_inc0.h: New file. 26110 * linux/sparc64/ioctls_inc2.h: New file. 26111 * linux/tile/ioctls_arch0.h: New file. 26112 * linux/tile/ioctls_arch1.h: New file. 26113 * linux/tile/ioctls_inc0.h: New file. 26114 * linux/tile/ioctls_inc1.h: New file. 26115 * linux/x32/ioctls_arch0.h: New file. 26116 * linux/x32/ioctls_arch1.h: New file. 26117 * linux/x32/ioctls_inc0.h: New file. 26118 * linux/x32/ioctls_inc1.h: New file. 26119 * linux/x86_64/ioctls_arch0.h: New file. 26120 * linux/x86_64/ioctls_arch1.h: New file. 26121 * linux/x86_64/ioctls_inc0.h: New file. 26122 * linux/x86_64/ioctls_inc1.h: New file. 26123 * linux/xtensa/ioctls_arch0.h: New file. 26124 * linux/xtensa/ioctls_inc0.h: New file. 26125 * linux/aarch64/ioctlent.h.in: Remove. 26126 * linux/aarch64/ioctlent1.h: Remove. 26127 * linux/alpha/ioctlent.h.in: Remove. 26128 * linux/arc/ioctlent.h.in: Remove. 26129 * linux/arm/ioctlent.h.in: Remove. 26130 * linux/avr32/ioctlent.h.in: Remove. 26131 * linux/bfin/ioctlent.h.in: Remove. 26132 * linux/hppa/ioctlent.h.in: Remove. 26133 * linux/i386/ioctlent.h.in: Remove. 26134 * linux/ia64/ioctlent.h.in: Remove. 26135 * linux/ioctlent.h.in: Remove. 26136 * linux/ioctlent.sh: Remove. 26137 * linux/m68k/ioctlent.h.in: Remove. 26138 * linux/metag/ioctlent.h.in: Remove. 26139 * linux/microblaze/ioctlent.h.in: Remove. 26140 * linux/mips/ioctlent.h.in: Remove. 26141 * linux/mips/ioctlent.sh: Remove. 26142 * linux/or1k/ioctlent.h.in: Remove. 26143 * linux/powerpc/ioctlent.h.in: Remove. 26144 * linux/powerpc64/ioctlent.h: Remove. 26145 * linux/powerpc64/ioctlent1.h: Remove. 26146 * linux/s390/ioctlent.h.in: Remove. 26147 * linux/s390x/ioctlent.h.in: Remove. 26148 * linux/sh/ioctlent.h.in: Remove. 26149 * linux/sh64/ioctlent.h.in: Remove. 26150 * linux/sparc/ioctlent.h.in: Remove. 26151 * linux/sparc64/ioctlent.h.in: Remove. 26152 * linux/sparc64/ioctlent2.h: Remove. 26153 * linux/tile/ioctlent.h.in: Remove. 26154 * linux/tile/ioctlent1.h: Remove. 26155 * linux/x32/ioctlent.h.in: Remove. 26156 * linux/x32/ioctlent1.h: Remove. 26157 * linux/x86_64/ioctlent.h.in: Remove. 26158 * linux/x86_64/ioctlent1.h: Remove. 26159 * linux/xtensa/ioctlent.h.in: Remove. 26160 * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. 26161 * syscall.c (struct_ioctlent ioctlent0): Likewise. 26162 * Makefile.am: Remove all ioctlent-related definitions. 26163 Define the list of ioctlent*.h files that have to be generated by 26164 presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. 26165 Add rules for ioctlent*.h files generation. 26166 (EXTRA_DIST): Update. 26167 * maint/ioctls_gen.sh: New file. 26168 * maint/ioctls_hex.sh: New file. 26169 * maint/ioctls_sym.sh: New file. 26170 * maint/print_ioctlent.c: New file. 26171 * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. 26172 * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. 26173 * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h 26174 and linux/mmtimer.h for tests. 26175 * tests/ioctl.c: New file. 26176 * tests/ioctl.test: New test. 26177 * tests/Makefile.am (check_PROGRAMS): Add ioctl. 26178 (TESTS): Add ioctl.test. 26179 * tests/.gitignore: Add ioctl. 26180 26181 2015-01-21 Gabriel Laskar <gabriel (a] lse.epita.fr> 26182 26183 ioctl: add decoding for parametrized command names. 26184 Some ioctl commands from evdev, hiddev, mixer, uinput, spi, and joystick 26185 are parametrized by a size or a number that are variable. This change 26186 implements printing of these parametrized ioctl command names. 26187 26188 * configure.ac (AC_CHECK_HEADERS): Add linux/input.h. 26189 * defs.h (ioctl_decode_number): New prototype. 26190 * io.c (sys_ioctl): Use ioctl_decode_number. 26191 * ioctl.c (ioctl_decode_number): New function. 26192 * xlat/evdev_abs.in: New file. 26193 * xlat/evdev_ev.in: New file. 26194 26195 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 26196 26197 Update auxiliary maintainer mode build tools. 26198 * git-set-file-times: Update from rsync. 26199 * git-version-gen: Update from gnulib. 26200 * gitlog-to-changelog: Likewise. 26201 26202 Update warnings.m4. 26203 * m4/warnings.m4: Update from gnulib. 26204 26205 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 26206 26207 powerpc64: maintain own linux/powerpc64 subdirectory. 26208 Most architectures supported by strace have their own subdirectory in 26209 linux directory, but powerpc64 didn't, causing inconveniences. 26210 26211 * configure.ac (arch): Define to "powerpc64" on powerpc64. 26212 * linux/powerpc/errnoent1.h: Move to linux/powerpc64/. 26213 * linux/powerpc/ioctlent1.h: Likewise. 26214 * linux/powerpc/signalent1.h: Likewise. 26215 * linux/powerpc/syscallent1.h: Likewise. 26216 * linux/powerpc64/ioctlent.h: New file. 26217 * linux/powerpc64/syscallent.h: Likewise. 26218 * linux/powerpc64/userent.h: Likewise. 26219 * Makefile.am (EXTRA_DIST): Remove linux/powerpc/ioctlent1.h, 26220 linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, and 26221 linux/powerpc/signalent1.h; added linux/powerpc64/errnoent1.h, 26222 linux/powerpc64/ioctlent.h, linux/powerpc64/ioctlent1.h, 26223 linux/powerpc64/signalent1.h, linux/powerpc64/syscallent.h, 26224 linux/powerpc64/syscallent1.h, and linux/powerpc64/userent.h. 26225 26226 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 26227 26228 configure.ac: remove unused AC_INCLUDEDIR. 26229 * configure.ac (AC_INCLUDEDIR): Remove. 26230 * m4/includedir.m4: Remove. 26231 26232 ioctl: print unrecognized ioctl codes in _IOC(dir,type,nr,size) format. 26233 * defs.h (ioctl_print_code): New prototype. 26234 * ioctl.c: Include xlat/ioctl_dirs.h. 26235 (ioctl_print_code): New function. 26236 * io.c (sys_ioctl): Use it. 26237 * xlat/ioctl_dirs.in: New file. 26238 26239 2015-01-20 Dmitry V. Levin <ldv (a] altlinux.org> 26240 26241 ioctl: assume that all ioctl commands have unsigned int type. 26242 In linux, ioctl command number has a 32-bit unsigned integer type: 26243 fs/ioctl.c:SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) 26244 If the kernel completely ignores other bits on 64-bit architectures, 26245 why should strace care? 26246 Let's follow the kernel and treat it as unsigned int. 26247 26248 * defs.h (struct_ioctlent): Change "code" type to "unsigned int". 26249 (ioctl_decode, ioctl_lookup, block_ioctl, loop_ioctl, mtd_ioctl, 26250 ubi_ioctl, ptp_ioctl, scsi_ioctl, sock_ioctl, term_ioctl, rtc_ioctl, 26251 v4l2_ioctl): Likewise. 26252 * ioctl.c (ioctl_decode, ioctl_lookup, compare, ioctl_next_match): 26253 Likewise. 26254 * block.c (block_ioctl): Likewise. 26255 * loop.c (loop_ioctl): Likewise. 26256 * mtd.c (mtd_ioctl, ubi_ioctl): Likewise. 26257 * ptp.c (ptp_ioctl): Likewise. 26258 * scsi.c (scsi_ioctl): Likewise. 26259 * sock.c (sock_ioctl): Likewise. 26260 * term.c (term_ioctl): Likewise. 26261 * time.c (rtc_ioctl): Likewise. 26262 * v4l2.c (v4l2_ioctl): Likewise. 26263 * ioctlsort.c (struct ioctlent, compare, main): Likewise. 26264 26265 2015-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 26266 26267 ioctlent.sh: cleanup regexps that are used to fetch bases. 26268 26269 ioctlent.sh: sync lookup regexps that are used in grep and sed. 26270 ioctlent.sh looks for ioctl command names using grep, and fetches them 26271 with their definitions using sed. Historically, lookup regexps used in 26272 grep and sed are slightly different, which makes the script more 26273 complicated than necessary. 26274 26275 qemu_multiarch_testing: update. 26276 * qemu_multiarch_testing/.gitignore: New file. 26277 * qemu_multiarch_testing/README: Update statistics. 26278 * qemu_multiarch_testing/hdc.dir/init2: Run "make check". 26279 * qemu_multiarch_testing/make-hdc-img.sh: Robustify, 26280 automatically calculate hdc image size. 26281 * qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce 26282 hdb image size. Report completion of each parallelized task. 26283 26284 2015-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 26285 26286 tests: add IPC_STAT to ipc tests, workaround limitiations of old kernels 26287 * tests/ipc_msg.c: Include <errno.h>. 26288 (main): Add a test call with IPC_STAT, handle old kernels MSG_STAT behaviour. 26289 * tests/ipc_sem.c: Include <errno.h>. 26290 (main): Add a test call with IPC_STAT, handle old kernels SEM_STAT behaviour. 26291 * tests/ipc_shm.c: Include <errno.h>. 26292 (main): Add a test call with IPC_STAT, handle old kernels SHM_STAT behaviour. 26293 26294 Change length type of umoven and umovestr to unsigned. 26295 * defs.h (umoven, umovestr): Change type of 3rd argument from "int" 26296 to "unsigned int". 26297 * util.c (umoven, umovestr): Likewise. Adjust the code appropriately. 26298 26299 tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel 26300 * tests/mmsg.c: #include <errno.h> 26301 (main): Return 77 if sendmmsg failed with ENOSYS. 26302 26303 tests: skip ip network tests when the network is not functional. 26304 * tests/inet-accept-connect-send-recv.c (main): Return 77 if inet stream 26305 socket cannot be created or it cannot be bound to INADDR_LOOPBACK. 26306 * tests/net-yy.test: Skip the test if inet-accept-connect-send-recv 26307 returns 77. 26308 26309 tests: handle the case when all 64 process capability bits are set. 26310 * tests/caps.awk: Handle the case when all bits of 64-bit capability 26311 word are set. 26312 26313 tests: explicitly request gawk when using gawk features. 26314 * tests/uid.test: Check for gawk availability and invoke gawk instead of 26315 plain awk because the test uses gawk's match() feature. 26316 26317 tests: skip detach tests if kill does not work. 26318 * tests/detach-running.test: Skip if "kill -0" does not work. 26319 * tests/detach-sleeping.test: Likewise. 26320 * tests/detach-stopped.test: Likewise. 26321 26322 ARM OABI: fix potential compilation warning. 26323 * syscall.c (get_scno) [!__ARM_EABI__ || ENABLE_ARM_OABI]: Fix 26324 "comparison between signed and unsigned" warning reported by some 26325 gcc versions. 26326 26327 powerpc: fix potential compilation warning. 26328 * mem.c [POWERPC] (sys_subpage_prot): Fix "comparison between signed 26329 and unsigned" warning reported by some gcc versions. 26330 26331 2015-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 26332 26333 sparc, sparc64: remove ioctl header file names from solaris ioctl entries 26334 Starting with commit v4.9-27-g3e252ca, header file names should not be 26335 part of ioctlent files included by syscall.c 26336 26337 * linux/sparc/ioctlent1.h: Remove ioctl header file names. 26338 * linux/sparc64/ioctlent2.h: Remove all entries, include "ioctlent.h". 26339 26340 2015-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 26341 26342 mips: enable indirect ipc subcall support. 26343 * linux/mips/syscallent-n32.h [LINUX_MIPSN32]: Define SYS_socket_subcall, 26344 include "subcall.h". 26345 * linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise. 26346 * linux/mips/syscallent-o32.h [LINUX_MIPSO32]: Likewise. 26347 26348 mips: remove stub entries from syscallent files, generate stubs at build time 26349 * linux/mips/genstub.sh: New file. 26350 * Makefile.am (EXTRA_DIST): Add it. 26351 * configure.ac [MIPS]: Use it to generate syscallent stubs. 26352 * linux/mips/.gitignore: Add syscallent stubs. 26353 * linux/mips/syscallent-n32.h: Remove stub entries, include 26354 the stub file instead. 26355 * linux/mips/syscallent-n64.h: Likewise. 26356 * linux/mips/syscallent-o32.h: Likewise. 26357 26358 build: add $(builddir)/$(OS)/$(ARCH) to the headers search list. 26359 * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS)/$(ARCH) before 26360 -I$(srcdir)/$(OS)/$(ARCH). 26361 26362 build: fix build if siginfo_t lacks si_timerid/si_overrun. 26363 * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_timerid and 26364 siginfo_t.si_overrun. 26365 * signal.c (printsiginfo) [SI_TIMER]: Check HAVE_SIGINFO_T_SI_TIMERID 26366 and HAVE_SIGINFO_T_SI_OVERRUN. 26367 26368 configure.ac: remove unused AM_CONDITIONAL expressions. 26369 * configure.ac (AM_CONDITIONAL): Remove I386, X86_64, X32. 26370 26371 tests: portability fixes. 26372 * tests/stat.test: dd obs= is not portable, use bs= instead. 26373 * tests/stat32-v.test: Likewise. 26374 * tests/stat64-v.test: Likewise. 26375 * tests/net.test: Use $* instead of $@ in the quoted string. 26376 * tests/net-fd.test: Likewise. 26377 * tests/statfs.test: Quote { and } in regexps. 26378 * tests/caps.awk: Likewise. 26379 * tests/getdents.awk: Likewise. 26380 * tests/net-yy-accept.awk: Likewise. 26381 * tests/net-yy-connect.awk: Likewise. 26382 * tests/sigaction.awk: Likewise. 26383 * tests/unix-yy-accept.awk: Likewise. 26384 * tests/unix-yy-connect.awk: Likewise. 26385 26386 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26387 26388 Wire up new syscalls. 26389 * linux/dummy.h (sys_bpf, sys_execveat, sys_getrandom, 26390 sys_kexec_file_load, sys_memfd_create, sys_seccomp): New stub aliases. 26391 * linux/32/syscallent.h (seccomp, getrandom, memfd_create, bpf, 26392 execveat): New entries. 26393 * linux/64/syscallent.h: Likewise. 26394 * linux/arm/syscallent.h: Likewise. 26395 * linux/hppa/syscallent.h: Likewise. 26396 * linux/i386/syscallent.h: Likewise. 26397 * linux/microblaze/syscallent.h: Likewise. 26398 * linux/mips/syscallent-n32.h: Likewise. 26399 * linux/mips/syscallent-n64.h: Likewise. 26400 * linux/mips/syscallent-o32.h: Likewise. 26401 * linux/powerpc/syscallent.h: Likewise. 26402 * linux/sparc/syscallent.h: Likewise. 26403 * linux/ia64/syscallent.h (getrandom, memfd_create, bpf, execveat): 26404 New entries. 26405 * linux/m68k/syscallent.h: Likewise. 26406 * linux/s390/syscallent.h: (seccomp, getrandom, memfd_create, bpf, 26407 s390_pci_mmio_write, s390_pci_mmio_read, execveat): New entries. 26408 * linux/s390x/syscallent.h: Likewise. 26409 * linux/x86_64/syscallent.h (seccomp, getrandom, memfd_create, 26410 kexec_file_load, bpf, execveat): New entries. 26411 * linux/x32/syscallent.h: Likewise. 26412 * linux/xtensa/syscallent.h (seccomp, getrandom, memfd_create): 26413 New entries. 26414 26415 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26416 26417 s390x: adjust some syscall entries. 26418 According to linux/arch/s390/include/uapi/asm/unistd.h, readdir is 26419 defined both on s390 and s390x, while getrlimit, _llseek, sendfile64, 26420 and fadvise64_64 are defined on s390 only. 26421 26422 * linux/s390x/syscallent.h (readdir): Add. 26423 (getrlimit, _llseek, sendfile64, fadvise64_64): Remove. 26424 26425 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26426 26427 Change syscallent.h files to use designated initializers. 26428 Automatically convert all linux syscallent.h files to a form that uses 26429 designated initializers, with subsequent correction of whitespace 26430 indentation. 26431 26432 * linux/alpha/syscallent.h: Use designated initializers. 26433 * linux/arm/syscallent.h: Likewise. 26434 * linux/avr32/syscallent.h: Likewise. 26435 * linux/bfin/syscallent.h: Likewise. 26436 * linux/hppa/syscallent.h: Likewise. 26437 * linux/i386/syscallent.h: Likewise. 26438 * linux/ia64/syscallent.h: Likewise. 26439 * linux/m68k/syscallent.h: Likewise. 26440 * linux/microblaze/syscallent.h: Likewise. 26441 * linux/mips/syscallent-n32.h: Likewise. 26442 * linux/mips/syscallent-n64.h: Likewise. 26443 * linux/mips/syscallent-o32.h: Likewise. 26444 * linux/powerpc/syscallent.h: Likewise. 26445 * linux/s390/syscallent.h: Likewise. 26446 * linux/s390x/syscallent.h: Likewise. 26447 * linux/sh/syscallent.h: Likewise. 26448 * linux/sh64/syscallent.h: Likewise. 26449 * linux/sparc/syscallent.h: Likewise. 26450 * linux/x32/syscallent.h: Likewise. 26451 * linux/x86_64/syscallent.h: Likewise. 26452 * linux/xtensa/syscallent.h: Likewise. 26453 26454 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26455 26456 Create generic 32-bit syscallent.h. 26457 Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and 26458 tile/syscallent1.h share a lot of identical syscall entries described in 26459 <asm-generic/unistd.h>, move these entries to a new file 32/syscallent.h 26460 using the following automated conversion with subsequent correction of 26461 whitespace indentation: 26462 26463 sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^[[:space:]]*\[[[:space:]]*2\(4[4-9]\|5[0-9]\)/d' linux/arc/syscallent.h 26464 26465 * linux/32/syscallent.h: New file. 26466 * Makefile.am (EXTRA_DIST): Add it. 26467 * linux/arc/syscallent.h: Include "32/syscallent.h", 26468 remove generic 32-bit syscall entries, use designated initializers. 26469 * linux/metag/syscallent.h: Likewise. 26470 * linux/or1k/syscallent.h: Likewise. 26471 * linux/tile/syscallent1.h: Likewise. 26472 26473 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26474 26475 tile: fix syscall entries. 26476 * linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3. 26477 (pread64, pwrite64): Change nargs to 5. 26478 (llseek): Change sys_name to _llseek. 26479 26480 s390: fix fadvise64 and fadvise64_64 syscall entries. 26481 * linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to 26482 printargs until special parsers for 31-bit 31 s390 emulation wrappers 26483 are written. 26484 26485 alpha: fix fadvise64 syscall entry. 26486 * linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64. 26487 26488 tile: fix fadvise64_64 syscall entry. 26489 * linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func, 26490 and sys_name. 26491 26492 Fix getrlimit and ugetrlimit syscall entries. 26493 * linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name. 26494 * linux/i386/syscallent.h: Likewise. 26495 * linux/m68k/syscallent.h: Likewise. 26496 * linux/microblaze/syscallent.h: Likewise. 26497 * linux/powerpc/syscallent.h: Likewise. 26498 * linux/avr32/syscallent.h (getrlimit): Fix sys_name. 26499 * linux/or1k/syscallent.h: Likewise. 26500 * linux/s390/syscallent.h (ugetrlimit): Fix sys_name. 26501 * linux/sh/syscallent.h: Likewise. 26502 * linux/sh64/syscallent.h: Likewise. 26503 26504 Fix umount and umount2 syscall entries. 26505 * linux/aarch64/syscallent1.h (umount): Change nargs to 1. 26506 * linux/avr32/syscallent.h: Likewise. 26507 * linux/xtensa/syscallent.h: Likewise. 26508 * linux/ia64/syscallent.h (umount2): Change nargs to 2. 26509 * linux/arm/syscallent.h (umount, umount2): Fix sys_name. 26510 * linux/bfin/syscallent.h: Likewise. 26511 * linux/i386/syscallent.h: Likewise. 26512 * linux/m68k/syscallent.h: Likewise. 26513 * linux/microblaze/syscallent.h: Likewise. 26514 * linux/powerpc/syscallent.h: Likewise. 26515 * linux/s390/syscallent.h: Likewise. 26516 * linux/s390x/syscallent.h: Likewise. 26517 * linux/sh/syscallent.h: Likewise. 26518 * linux/sh64/syscallent.h: Likewise. 26519 * linux/sparc/syscallent.h: Likewise. 26520 * linux/metag/syscallent.h: (umount2): Fix sys_name. 26521 * linux/or1k/syscallent.h: Likewise. 26522 * linux/x32/syscallent.h: Likewise. 26523 * linux/x86_64/syscallent.h: Likewise. 26524 26525 Fix sendfile64 syscall entries. 26526 * linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64. 26527 * linux/metag/syscallent.h: Likewise. 26528 * linux/or1k/syscallent.h: Likewise. 26529 26530 Fix number of arguments in ipc family syscall entries. 26531 * linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget, 26532 shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls. 26533 * linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl, 26534 shmdt, shmget, semtimedop): Likewise. 26535 * linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat, 26536 shmget, shmdt, shmctl): Likewise. 26537 * linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat, 26538 * shmctl, shmdt, shmget, semtimedop): Likewise. 26539 * linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl, 26540 semtimedop): Likewise. 26541 * linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl, 26542 msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise. 26543 * linux/ia64/syscallent.h (semtimedop): Likewise. 26544 * linux/mips/syscallent-n32.h (semtimedop): Likewise. 26545 * linux/mips/syscallent-n64.h (semtimedop): Likewise. 26546 * linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop, 26547 semop, shmget, shmctl, shmat, shmdt): Likewise. 26548 * linux/sh64/syscallent.h (semget, msgget, shmget): Likewise. 26549 * linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget, 26550 shmctl, shmat, shmdt): Likewise. 26551 * linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt, 26552 msgget, semtimedop): Likewise. 26553 * linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop, 26554 shmdt, msgget, semtimedop): Likewise. 26555 * linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop, 26556 semget, semop, msgget, msgrcv, msgctl): Likewise. 26557 26558 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26559 26560 Create generic 64-bit syscallent.h. 26561 Since aarch64/syscallent1.h and tile/syscallent.h share a lot of 26562 identical syscall entries described in <asm-generic/unistd.h>, move 26563 these entries to a new file 64/syscallent.h using the following 26564 automated conversion with subsequent correction of whitespace 26565 indentation: 26566 26567 sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^\[[[:space:]]*2\(4[4-9]\|5[0-9]\)\]/d' linux/tile/syscallent.h 26568 26569 * linux/64/syscallent.h: New file. 26570 * Makefile.am (EXTRA_DIST): Add it. 26571 * linux/aarch64/syscallent1.h: Include "64/syscallent.h", 26572 remove generic 64-bit syscall entries, use designated initializers. 26573 * linux/tile/syscallent.h: Likewise. 26574 26575 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26576 26577 Fix nfsservctl syscall entries. 26578 * linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name. 26579 * linux/metag/syscallent.h: Likewise. 26580 26581 Add missing syscall entries for sched_[gs]etattr and renameat2. 26582 * linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2): 26583 New syscall entries. 26584 * linux/arc/syscallent.h: Likewise. 26585 * linux/metag/syscallent.h: Likewise. 26586 * linux/or1k/syscallent.h: Likewise. 26587 * linux/tile/syscallent.h: Likewise. 26588 * linux/tile/syscallent1.h: Likewise. 26589 26590 Fix NUMA related syscall entries. 26591 * linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy): 26592 Set sys_func. 26593 * linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy): 26594 Fix nargs, set sys_func. 26595 * linux/microblaze/syscallent.h (mbind): Fix nargs. 26596 * linux/mips/syscallent-n32.h (move_pages): Set sys_func. 26597 * linux/mips/syscallent-n64.h (move_pages): Likewise. 26598 * linux/mips/syscallent-o32.h (mbind): Fix nargs. 26599 * linux/or1k/syscallent.h (migrate_pages): Likewise. 26600 * linux/powerpc/syscallent.h (migrate_pages): Likewise. 26601 * linux/sh/syscallent.h (mbind): Likewise. 26602 * linux/sh64/syscallent.h (mbind): Likewise. 26603 26604 xtensa: fix syscall entries. 26605 * linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name. 26606 (restart_syscall, io_setup, io_destroy, io_submit, io_getevents, 26607 io_cancel, add_key, request_key, keyctl): Set sys_func. 26608 (migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages, 26609 fstatat64): Fix nargs. 26610 (renameat2): New entry. 26611 26612 Fix sched_setparam syscall entries. 26613 * linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2. 26614 * linux/arm/syscallent.h (sched_setparam): Likewise. 26615 * linux/avr32/syscallent.h (sched_setparam): Likewise. 26616 * linux/bfin/syscallent.h (sched_setparam): Likewise. 26617 * linux/i386/syscallent.h (sched_setparam): Likewise. 26618 * linux/m68k/syscallent.h (sched_setparam): Likewise. 26619 * linux/microblaze/syscallent.h (sched_setparam): Likewise. 26620 * linux/s390/syscallent.h (sched_setparam): Likewise. 26621 * linux/s390x/syscallent.h (sched_setparam): Likewise. 26622 * linux/sh/syscallent.h (sched_setparam): Likewise. 26623 * linux/sh64/syscallent.h (sched_setparam): Likewise. 26624 * linux/tile/syscallent.h (sched_setparam): Likewise. 26625 * linux/tile/syscallent1.h (sched_setparam): Likewise. 26626 * linux/x32/syscallent.h (sched_setparam): Likewise. 26627 * linux/x86_64/syscallent.h (sched_setparam): Likewise. 26628 26629 arc: fix fanotify_mark syscall entry. 26630 * linux/arc/syscallent.h (fanotify_mark): Change nargs to 6. 26631 26632 ia64: add fallocate syscall entry. 26633 * linux/ia64/syscallent.h (fallocate): Add syscall entry. 26634 26635 Fix lookup_dcookie syscall entries. 26636 * linux/s390/syscallent.h (lookup_dcookie): Add syscall entry. 26637 * linux/s390x/syscallent.h (lookup_dcookie): Likewise. 26638 * linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3. 26639 * linux/x32/syscallent.h (lookup_dcookie): Likewise. 26640 26641 aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate. 26642 * linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate): 26643 Use correct syscall names. 26644 26645 aarch64: fix mlock syscall entry. 26646 * linux/aarch64/syscallent1.h (mlock): Change to mlock entry. 26647 26648 sh, sh64: fix mlock syscall entry. 26649 * linux/sh/syscallent.h (mlock): Change nargs to 2. 26650 * linux/sh64/syscallent.h (mlock): Likewise. 26651 26652 tile: fix swapon syscall entries. 26653 * linux/tile/syscallent.h (swapon): Change nargs to 2. 26654 * linux/tile/syscallent1.h (swapon): Likewise. 26655 26656 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26657 26658 ARM EABI: reserve some space for new syscalls. 26659 Reserve the same space for new syscalls on EABI as it is already 26660 reserved on OABI. 26661 26662 * linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL): 26663 Raise to 400. 26664 26665 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26666 26667 arm: rewrite shuffle_scno in a bit more readable way. 26668 * linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of 26669 ARM_LAST_ORDINARY_SYSCALL. 26670 * syscall.c [ARM || AARCH64] (shuffle_scno): Update. 26671 26672 tests: add tests for ipc syscalls decoding. 26673 * tests/ipc_msg.c: New file. 26674 * tests/ipc_sem.c: Likewise. 26675 * tests/ipc_shm.c: Likewise. 26676 * tests/ipc_msg.test: New test. 26677 * tests/ipc_sem.test: Likewise. 26678 * tests/ipc_shm.test: Likewise. 26679 * tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm. 26680 (TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test. 26681 * tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm. 26682 26683 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26684 26685 Fix indirect ipc subcall handling. 26686 indirect_ipccall used to guess whether currently decoded ipc syscall is 26687 an indirect subcall or not based on generic knowledge, while there is a 26688 robust method to identify indirect ipc subcalls. 26689 26690 * defs.h (TRACE_INDIRECT_SUBCALL): New flag. 26691 * ipc.c (indirect_ipccall): Check it. 26692 * linux/subcall.h: Set it. 26693 26694 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26695 26696 Move socket and ipc subcall entries to subcall.h. 26697 Syscall entries for socket and ipc subcalls are the same on all 26698 architectures, or at least they should be the same, so move them 26699 to the single file. 26700 26701 * linux/subcall.h: Add syscall entries for socket and ipc subcalls. 26702 * linux/arm/syscallent.h: Remove entries for socket and ipc subcalls. 26703 * linux/i386/syscallent.h: Likewise. 26704 * linux/m68k/syscallent.h: Likewise. 26705 * linux/powerpc/syscallent.h: Likewise. 26706 * linux/s390/syscallent.h: Likewise. 26707 * linux/s390x/syscallent.h: Likewise. 26708 * linux/sh/syscallent.h: Likewise. 26709 * linux/sh64/syscallent.h: Likewise. 26710 * linux/sparc/syscallent.h: Likewise. 26711 26712 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 26713 26714 sh: fix typo introduced by commit v4.9-121-gd535b8b. 26715 * linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name. 26716 26717 2015-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 26718 26719 Fix fanotify_mark decoding on 32-bit architectures. 26720 The fanotify_mark syscall takes a 64-bit mask, and on 32-bit 26721 architectures it is split up into two syscall arguments. 26722 26723 * configure.ac (AC_CHECK_FUNCS): Add fanotify_mark. 26724 (AC_CHECK_HEADERS): Add sys/fanotify.h. 26725 * defs.h (getllval): New prototype. 26726 * util.c (getllval): New function based on printllval. 26727 (printllval): Use getllval. 26728 * fanotify.c (sys_fanotify_mark): Use getllval to properly decode 26729 64-bit mask and two syscall arguments followed by it. 26730 * tests/fanotify_mark.c: New file. 26731 * tests/fanotify_mark.test: New test. 26732 * tests/Makefile.am (check_PROGRAMS): Add fanotify_mark. 26733 (TESTS): Add fanotify_mark.test. 26734 * tests/.gitignore: Add fanotify_mark. 26735 26736 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 26737 26738 v4l2: fix build on systems with older kernel headers. 26739 * v4l2.c (print_v4l2_format_fmt): Do not use 26740 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined. 26741 (v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and 26742 VIDIOC_ENUM_FRAMEINTERVALS unless they are defined. 26743 26744 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 26745 26746 tests: fix build with awk that does not support switch-case. 26747 The switch-case statement is a gawk-specific feature which is not 26748 necessarily available, let's use traditional if-else statements instead. 26749 26750 * tests/uid.awk: Rewrite without switch-case statements. 26751 26752 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 26753 26754 Fix build on systems that lack O_CLOEXEC definition. 26755 * xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined. 26756 26757 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 26758 26759 Fix build on systems that lack NETLINK_SOCK_DIAG definition. 26760 NETLINK_INET_DIAG was introduced in linux v2.6.14, 26761 NETLINK_SOCK_DIAG was added much later in linux v3.3. 26762 26763 * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG] 26764 (NETLINK_SOCK_DIAG): Define. 26765 * socketutils.c: Likewise. 26766 * tests/netlink_unix_diag.c: Likewise. 26767 26768 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 26769 26770 Cleanup local copy of linux/fanotify.h. 26771 * linux/fanotify.h: Remove macros and structures not used by 26772 fanotify_init and fanotify_mark parsers. 26773 26774 Fix "make dist" regression introduced by commit v4.9-125-g120e5db. 26775 * Makefile.am (EXTRA_DIST): Add linux/unix_diag.h. 26776 26777 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 26778 26779 tests: fix build with fresh glibc. 26780 * tests/netlink_unix_diag.c: Include <stdint.h>. 26781 26782 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 26783 26784 ioctlent.sh: handle linux/aufs_type.h properly. 26785 Before this change, ioctlent.sh could not recognize unusual constants 26786 defined by linux/aufs_type.h, resulting to ioctls.h with references to 26787 these constants without appropriate definitions in ioctldefs.h. 26788 26789 * linux/ioctlent.sh: Update the regexp that is used to lookup constants 26790 referenced by generated ioctls.h. 26791 26792 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 26793 26794 tests: fix distcheck. 26795 * tests/stat32-v.test: Remove work files if the test is skipped. 26796 26797 Fix printing of time_t values set in the distant future. 26798 * util.c (sprinttime): Increase buffer size. 26799 * tests/stat64-v.test: Try to set modification time of the sample file 26800 to a value set in the distant future. 26801 26802 Use AC_CHECK_TYPES to check for struct statfs64. 26803 * m4/statfs.m4: Remove. 26804 * configure.ac (AC_STATFS64): Remove. 26805 (AC_CHECK_TYPES): Add struct statfs64. 26806 * statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64. 26807 26808 Use AC_CHECK_TYPES to check for struct stat64. 26809 * m4/stat.m4: Remove. 26810 * configure.ac (AC_STAT64): Remove. 26811 (AC_CHECK_TYPES): Add struct stat64. 26812 * file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64. 26813 26814 file.c: fix 32-bit stat decoding on 64-bit architectures. 26815 * file.c [SPARC || SPARC64] (struct stat): Remove, use generic 26816 definition from <asm/stat.h>. 26817 [SPARC64] (struct stat_sparc64, printstat_sparc64): Remove. 26818 [AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32, 26819 STAT32_PERSONALITY): Define. 26820 [STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32. 26821 [STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32. 26822 (printstat) [STAT32_PERSONALITY]: Call printstat32 when 26823 current_personality == STAT32_PERSONALITY. 26824 [HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when 26825 current_personality != STAT32_PERSONALITY. 26826 [!HAVE_STAT64] (sys_stat64): Fallback to sys_stat. 26827 [!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat. 26828 26829 sparc: reuse struct stat parser code for struct solstat decoding. 26830 * printstat.h: Parametrize major() and minor(). 26831 * file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating 26832 printstat.h template. 26833 [SPARC || SPARC64] (printstatsol): Use do_printstat_sol. 26834 26835 ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding. 26836 * file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h 26837 template. 26838 [POWERPC64] (printstat_powerpc32): Use do_printstat32. 26839 26840 file.c: group related parsers together. 26841 * file.c (sys_stat, sys_fstat): Collect in one place right before 26842 the definition of printstat64. 26843 (sys_stat64, sys_fstat64): Collect in one place right after the 26844 definition of printstat64. 26845 26846 file.c: collect scattered __old_kernel_stat related code. 26847 * file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat, 26848 sys_oldstat, sys_oldfstat): Collect functions in one place. 26849 26850 Use the same source code for struct stat/stat64 decoding. 26851 * file.c: Define do_printstat64 by instantiating printstat.h template. 26852 (printstat64): Use do_printstat64. 26853 26854 x32: use generic printstat/printstat64 parsers. 26855 * file.c (printstat) [X32]: Define. 26856 (printstat64) [X32]: Use "struct stat64" instead of "struct stat". 26857 Use printstat for x32 personality processes. 26858 (printstat64_x32): Remove. 26859 (sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of 26860 printstat64_x32. 26861 26862 x32: remove redundant definitions. 26863 * file.c [X32]: Do not define "struct stat" and "struct 26864 __old_kernel_stat" locally, use definitions provided by <asm/stat.h>. 26865 Do not define "struct stat64" exclusively, reuse another definition 26866 added earlier for X86_64. 26867 26868 Convert do_printstat to a template function. 26869 * printstat.h: New file. 26870 * Makefile.am (strace_SOURCES): Add it. 26871 * file.c: Include "printstat.h". 26872 (do_printstat): Move to printstat.h, parametrize its name 26873 and struct stat. 26874 26875 file.c: prepare realprintstat for parametrization. 26876 * file.c (realprintstat): Adjust format strings so that all 64-bit 26877 integer fields are printed with %llu format, and %u format is used for 26878 all the rest. Rename to do_printstat. 26879 (printstat, printoldstat): Update callers. 26880 26881 tests: cleanup stat.test. 26882 * tests/stat.test: Rewrite in a more readable way. 26883 26884 tests: check verbose decoding of 32-bit and 64-bit struct stat. 26885 * tests/stat.c: New file. 26886 * tests/stat32.c: Likewise. 26887 * tests/stat32-v.test: New file. 26888 * tests/stat64-v.test: Likewise. 26889 * tests/Makefile.am (check_PROGRAMS): Add stat and stat32. 26890 (stat_CFLAGS): Define. 26891 (TESTS): Add stat32-v.test and stat64-v.test. 26892 * tests/.gitignore: Add stat and stat32. 26893 26894 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 26895 26896 Cleanup struct stat.st_flags decoding. 26897 There are no symbolic constants defined for struct stat.st_flags, 26898 so decode this rare field as unsigned int. 26899 26900 * xlat/fileflags.in: Remove. 26901 * file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]: 26902 Decode struct stat.st_flags as unsigned int. 26903 26904 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 26905 26906 Drop struct stat.st_aclcnt and stat.st_level support. 26907 Remove the code that supports struct stat.st_aclcnt and stat.st_level 26908 decoding -- these fields are not defined in system headers. 26909 26910 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and 26911 struct stat.st_level. 26912 * file.c (realprintstat, printstat64) 26913 [HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove. 26914 26915 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 26916 26917 tests: fix race condition in net-accept-connect based tests. 26918 Change all net-accept-connect based tests to use different unix domain 26919 socket addresses, so that these tests could be safely run in parallel. 26920 26921 * tests/net-accept-connect.c: Parametrize unix domain socket address. 26922 * tests/net-fd.test: Pass socket address to net-accept-connect. 26923 * tests/net.test: Likewise. 26924 * tests/unix-yy.test: Likewise. 26925 * tests/unix-yy-accept.awk: Update regexps. 26926 * tests/unix-yy-connect.awk: Likewise. 26927 26928 2014-12-31 Mike Frysinger <vapier (a] gentoo.org> 26929 26930 timerfd: update flags decoding. 26931 The current code only decodes TFD_TIMER_ABSTIME when the kernel has 26932 a bunch of newer flags. We have to handle fallbacks for all of them 26933 since the kernel doesn't currently export things to userspace. 26934 26935 * time.c: Include fcntl.h for O_* defines. 26936 (TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in. 26937 * xlat/timerfdflags.in: Add more definitions. 26938 26939 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 26940 26941 sparc: fix fxstat decoding. 26942 * file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor 26943 using printfd. 26944 26945 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 26946 26947 sparc: drop _STAT64_VER support. 26948 Starting with commit v4.6-240-g5afdf12, nobody compiles this 26949 non-Linux code. 26950 26951 * file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove 26952 _STAT64_VER code. 26953 26954 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 26955 26956 sparc: remove redundant sys_lxstat. 26957 * file.c [SPARC || SPARC64] (sys_lxstat): Remove. 26958 * linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat. 26959 * linux/sparc64/dummy2.h (solaris_lxstat): Likewise. 26960 26961 2014-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 26962 26963 file.c: do not include unused headers. 26964 * file.c: Do not include <fcntl.h>. 26965 26966 2014-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 26967 26968 Cleanup UTIME_NOW/UTIME_OMIT decoding. 26969 Move the code that's present in two copies from sprinttv() 26970 to a new helper function. 26971 26972 * time.c (do_sprinttv): New function. 26973 (sprinttv): Use it. 26974 26975 2014-12-27 Elliott Hughes <enh (a] google.com> 26976 26977 Fix UTIME_NOW/UTIME_OMIT decoding. 26978 The kernel doesn't actually care what tv_sec is set to --- it only checks 26979 tv_nsec when looking for the special values. 26980 26981 2014-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 26982 26983 Make -yy output for inet sockets consistent with unix domain sockets. 26984 Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their 26985 protocol name obtained using getxattr. 26986 26987 * socketutils.c (inet_parse_response): Add proto_name argument. 26988 Print proto_name for connected and unconnected sockets. 26989 (receive_responses): Add proto_name argument, pass it to the parser. 26990 (inet_print): Add proto_name argument, pass it to receive_responses. 26991 (unix_parse_response): Add proto_name argument. 26992 (print_sockaddr_by_inode): Pass protocol name to inet_print calls. 26993 * tests/net-yy-accept.awk: Update to match new output format. 26994 * tests/net-yy-connect.awk: Likewise. 26995 26996 2014-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 26997 26998 tests: robustify unix domain socket decoding test. 26999 Unix domain socket address family name is not universally decoded as 27000 AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms. 27001 Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL. 27002 27003 Some test regexps have to be properly initialized before they could 27004 be used, so make sure they are initialized before use. 27005 27006 2014-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 27007 27008 tests: fix unix domain socket decoding availability test. 27009 Since inet_diag and unix_diag interfaces are implemented by different 27010 kernel modules, they have to be tested separately. 27011 27012 * tests/netlink_unix_diag.c: New file. 27013 * tests/unix-yy.test: Use it. 27014 * tests/Makefile.am (check_PROGRAMS): Add it. 27015 * tests/.gitignore: Likewise. 27016 27017 2014-12-25 Masatake YAMATO <yamato (a] redhat.com> 27018 27019 tests: add a test for decoding unix domain socket addresses. 27020 * tests/unix-yy-accept.awk: New file. 27021 * tests/unix-yy-connect.awk: New file. 27022 * tests/unix-yy.test: New test. 27023 * tests/Makefile.am (TESTS): Add it. 27024 (EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk. 27025 27026 2014-12-25 Masatake YAMATO <yamato (a] redhat.com> 27027 27028 Support unix domain sockets in -yy option. 27029 This change extends -yy option to handle unix domain sockets: 27030 their peer addresses will be printed, similar to inet sockets. 27031 27032 For a listening socket, its socket inode and socket path are printed. 27033 For an accepted socket, its socket inode, the peer inode, and the 27034 socket path are printed. 27035 For a client socket, its socket inode and the peer inode are printed. 27036 27037 An example of a server side communication using netcat: 27038 27039 $ ./strace -yy -e network nc -l -U /tmp/example.sock 27040 socket(PF_LOCAL, SOCK_STREAM, 0) = 3 27041 setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 27042 bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 27043 listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0 27044 accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]> 27045 recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6 27046 INPUT 27047 27048 An example of a client side communication using netcat: 27049 27050 $ ./strace -yy -e network nc -U /tmp/example.sock 27051 socket(PF_LOCAL, SOCK_STREAM, 0) = 3 27052 connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 27053 getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 27054 INPUT 27055 ... 27056 sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6 27057 27058 * linux/unix_diag.h: New file. 27059 * socketutils.c (send_query): Rename to inet_send_query. 27060 (parse_response): Rename to inet_parse_response. 27061 (unix_print, unix_send_query, unix_parse_response): New functions. 27062 (receive_responses): Add a new argument named parser: a function for 27063 handling protocol specific data parts of diag messages. 27064 (print_sockaddr_by_inode): Call unix_print. 27065 Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal 27066 but NETLINK_SOCK_DIAG looks more generic. 27067 27068 2014-12-16 Masatake YAMATO <yamato (a] redhat.com> 27069 27070 Use the protocol name of a socket as a hint for peer address resolution. 27071 To resolve the peer address of socket, all combinations of families 27072 (AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried. 27073 This change utilizes the protocol name obtained via getxattr to specify 27074 the right combination. 27075 27076 * socketutils.c (inet_print): New helper function. 27077 (print_sockaddr_by_inode): Use it. Utilize the protocol name 27078 associated with the given inode for resolving the peer socket 27079 address. If the protocol name is NULL, resolve the address 27080 by trying combinations of families and protocols as before. 27081 * defs.h (print_sockaddr_by_inode): Update prototype. 27082 * util.c (printfd): Pass the protocol name associated with 27083 the given path to print_sockaddr_by_inode as the 2nd argument. 27084 27085 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 27086 27087 Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls 27088 Convert parsers of these syscalls to the same scheme as were applied to 27089 parsers of other uid/gid related syscalls. 27090 That is, define two sets of parsers on architectures that support 27091 (either directly or via multiarch) 16-bit and 32-bit gid getgroups 27092 and setgroups syscalls simultaneously, and reuse essentially the same 27093 code by parametrizing uid_t and names of parser functions. 27094 27095 * groups.c: Remove. 27096 (sys_getgroups, sys_setgroups): Move ... 27097 * uid.c: ... here and parametrize their names. 27098 * Makefile.am (strace_SOURCES): Remove groups.c. 27099 * linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove. 27100 [NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes. 27101 * linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16, 27102 rename sys_[gs]etgroups32 to sys_[gs]etgroups. 27103 * linux/bfin/syscallent.h: Likewise. 27104 * linux/i386/syscallent.h: Likewise. 27105 * linux/m68k/syscallent.h: Likewise. 27106 * linux/microblaze/syscallent.h: Likewise. 27107 * linux/s390/syscallent.h: Likewise. 27108 * linux/sh/syscallent.h: Likewise. 27109 * linux/sh64/syscallent.h: Likewise. 27110 * linux/sparc/syscallent.h: Likewise. 27111 * tests/uid.c: Test for getgroups. 27112 * tests/uid16.c: Likewise. 27113 * tests/uid32.c: Test for getgroups32. 27114 * tests/uid.awk: Test for getgroups/getgroups32 decoding. 27115 * tests/uid.test: Trace getgroups/getgroups32 syscalls. 27116 27117 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 27118 27119 Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls. 27120 Define two sets of parsers on architectures that support (either 27121 directly or via multiarch) 16-bit and 32-bit uid/gid syscalls 27122 simultaneously. Since the code in these two sets is essentially 27123 the same and the key difference between them is the size of uid_t, 27124 implement it by parametrizing uid_t and names of parser functions. 27125 27126 * defs.h (NEED_UID16_PARSERS): New macro. 27127 * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16, 27128 sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16, 27129 sys_setreuid16, sys_setuid16): New prototypes. 27130 * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16. 27131 (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16, 27132 sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding 27133 sys_*uid16 functions. 27134 * uid.c: Stop including <asm/posix_types.h>. 27135 Parametrize uid_t and names of all exported functions. 27136 (get_print_uid): New function. 27137 (sys_getresuid): Use it. 27138 (printuid): Check for (uid_t) -1. 27139 * uid16.c: New file. 27140 * Makefile.am (strace_SOURCES): Add it. 27141 * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16, 27142 sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16, 27143 sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16, 27144 sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16, 27145 and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries. 27146 * linux/bfin/syscallent.h: Likewise. 27147 * linux/i386/syscallent.h: Likewise. 27148 * linux/m68k/syscallent.h: Likewise. 27149 * linux/microblaze/syscallent.h: Likewise. 27150 * linux/s390/syscallent.h: Likewise. 27151 * linux/sparc/syscallent.h: Likewise. 27152 * linux/sh/syscallent.h: Likewise. 27153 * linux/sh64/syscallent.h: Likewise. 27154 * tests/uid16.c: New file. 27155 * tests/uid16.test: New test. 27156 * tests/Makefile.am (CHECK_PROGRAMS): Add uid16. 27157 (TESTS): Add uid16.test. 27158 * tests/.gitignore: Add uid16. 27159 27160 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 27161 27162 sh, sh64: fix uid/gid syscall entries. 27163 * linux/sh/syscallent.h: Replace printargs with real syscall 27164 parsers in *chown32 and [gs]et*[gu]id32 syscall entries. 27165 * linux/sh64/syscallent.h: Likewise. 27166 27167 s390: fix uid/gid syscall entries. 27168 * linux/s390/syscallent.h: Add "32" suffix to names of *chown32 27169 and [gs]et*[gu]id32 syscalls #198..216. 27170 27171 sparc: fix uid/gid syscall entries. 27172 * linux/sparc/syscallent.h: Add "32" suffix to names 27173 of [gs]etres[gu]id32 syscalls #108..112. 27174 Fix entry for syscall #112 from setresgid32 to setregid32. 27175 27176 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 27177 27178 chown.c: split into separate files. 27179 This will make further uid/gid fixes simpler. 27180 27181 * fchownat.c: New file. 27182 * chown.c (sys_fchownat: Move to fchownat.c. 27183 (sys_chown, sys_fchown): Move to uid.c. 27184 * Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c. 27185 27186 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 27187 27188 util.c: move printuid to uid.c. 27189 This will make further uid/gid fixes simpler. 27190 27191 * util.c (printuid): Move 27192 * uid.c: ... here. 27193 27194 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 27195 27196 tests/uid.awk: rewrite in a more maintainable style. 27197 Since the test is virtually a FSM, rewrite it as a FSM. 27198 27199 2014-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 27200 27201 printuid: fix uid_t decoding on 64-bit architectures. 27202 It was not a good idea to treat uid_t as a long int type because 27203 the latter is twice larger than uid_t on 64-bit architectures. 27204 27205 * defs.h (printuid): Change uid argument type from "unsigned long" 27206 to "unsigned int". 27207 * util.c (printuid): Likewise. When uid equals to -1, print "-1". 27208 * tests/uid.awk: New file. 27209 * tests/uid.c: New file. 27210 * tests/uid32.c: Likewise. 27211 * tests/uid.test: New test. 27212 * tests/uid32.test: Likewise. 27213 * tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32. 27214 (TESTS): Add uid.test and uid32.test. 27215 (EXTRA_DIST): Add uid.awk. 27216 * tests/.gitignore: Add uid and uid32. 27217 27218 2014-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 27219 27220 Update PTRACE_* constants. 27221 * xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK, 27222 and PTRACE_SETSIGMASK. 27223 27224 Update SWAP_FLAG_* constants. 27225 * swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and 27226 SWAP_FLAG_DISCARD_PAGES are defined. 27227 * xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and 27228 SWAP_FLAG_DISCARD_PAGES. 27229 27230 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 27231 27232 Update SCHED_* constants. 27233 * xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and 27234 SCHED_DEADLINE. 27235 27236 Update prctl PR_* constants. 27237 * xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE, 27238 PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT. 27239 27240 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 27241 27242 Always compile sys_prctl parser. 27243 Since sys_prctl is referenced by syscallent files unconditionally, 27244 conditional compilation of sys_prctl depending on prctl availability is 27245 pointless. 27246 27247 * prctl.c (unalignctl_string, sys_prctl): Compile unconditionally. 27248 27249 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 27250 27251 process.c: split struct_user_offsets into architecture-specific include files 27252 * Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h, 27253 linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h, 27254 linux/crisv10/userent.h, linux/crisv32/userent.h, 27255 linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h, 27256 linux/m68k/userent.h, linux/microblaze/userent.h, 27257 linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h, 27258 linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h, 27259 linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h, 27260 linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h, 27261 linux/tile/userent.h, linux/userent.h, linux/userent0.h, 27262 linux/x32/userent.h, linux/x86_64/userent.h, and 27263 linux/xtensa/userent.h. 27264 * process.c (struct_user_offsets): Split into architecture-specific 27265 include files, inculde userent.h. 27266 27267 process.c: include less headers. 27268 * process.c: Do not include <fcntl.h> and <sys/stat.h>. 27269 Reorder inclusion of xlat header files. 27270 27271 Unexport struct_user_offsets. 27272 * defs.h (struct_user_offsets): Remove. 27273 * process.c (struct_user_offsets): Make static. 27274 27275 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 27276 27277 process.c: introduce XLAT_UOFF macro. 27278 Introduce XLAT_UOFF macro and use it to automatically transform 27279 struct_user_offsets array into a more readable and compact form. 27280 27281 for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do 27282 sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c 27283 done 27284 27285 * process.c (XLAT_UOFF): New macro. 27286 (struct_user_offsets): Use it. 27287 27288 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 27289 27290 process.c: move sethostname and gethostname parsers to a separate file. 27291 * hostname.c: New file. 27292 * Makefile.am (strace_SOURCES): Add it. 27293 * process.c (sys_sethostname, sys_gethostname): Move to hostname.c. 27294 27295 process.c: move exit parser to a separate file. 27296 * exit.c: New file. 27297 * Makefile.am (strace_SOURCES): Add it. 27298 * process.c (sys_exit): Move to exit.c. 27299 27300 process.c: move clone, setns, unshare, and fork parsers to a separate file 27301 * clone.c: New file. 27302 * Makefile.am (strace_SOURCES): Add it. 27303 * process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and 27304 related code to clone.c. 27305 27306 process.c: move get*uid and set*uid parsers to a separate file. 27307 * uid.c: New file. 27308 * Makefile.am (strace_SOURCES): Add it. 27309 * process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid, 27310 sys_setreuid, sys_setresuid): Move to uid.c. 27311 27312 process.c: move getgroups* and setgroups* parsers to a separate file. 27313 * groups.c: New file. 27314 * Makefile.am (strace_SOURCES): Add it. 27315 * process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32, 27316 sys_getgroups32, and related code to groups.c. 27317 27318 process.c: move execve and execv parsers to a separate file. 27319 * execve.c: New file. 27320 * Makefile.am (strace_SOURCES): Add it. 27321 * process.c: Move sys_execve, sys_execv, and related code to execve.c. 27322 27323 process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file 27324 * wait.c: New file. 27325 * Makefile.am (strace_SOURCES): Add it. 27326 * process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and 27327 related code to wait.c. 27328 27329 process.c: move uname parser to a separate file. 27330 * uname.c: New file. 27331 * Makefile.am (strace_SOURCES): Add it. 27332 * process.c (sys_uname): Move to uname.c. 27333 27334 process.c: move futex parser to a separate file. 27335 * futex.c: New file. 27336 * Makefile.am (strace_SOURCES): Add it. 27337 * process.c: Move sys_futex and related code to futex.c. 27338 27339 process.c: move get_robust_list parser to a separate file. 27340 * get_robust_list.c: New file. 27341 * Makefile.am (strace_SOURCES): Add it. 27342 * process.c (sys_get_robust_list): Move to get_robust_list.c. 27343 27344 process.c: move sched_* parsers to a separate file. 27345 * sched.c: New file. 27346 * Makefile.am (strace_SOURCES): Add it. 27347 * process.c: Move sys_sched_getscheduler, sys_sched_setscheduler, 27348 sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min, 27349 sys_sched_rr_get_interval, and related code to sched.c. 27350 27351 process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file 27352 * affinity.c: New file. 27353 * Makefile.am (strace_SOURCES): Add it. 27354 * process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move 27355 to affinity.c. 27356 27357 process.c: move prctl and arch_prctl parsers to a separate file. 27358 * prctl.c: New file. 27359 * Makefile.am (strace_SOURCES): Add it. 27360 * process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c. 27361 27362 process.c: move getcpu parser to a separate file. 27363 * getcpu.c: New file. 27364 * Makefile.am (strace_SOURCES): Add it. 27365 * process.c (sys_getcpu): Move to getcpu.c. 27366 27367 process.c: move process_vm_readv and process_vm_writev parsers to a separate file 27368 * process_vm.c: New file. 27369 * Makefile.am (strace_SOURCES): Add it. 27370 * process.c (sys_process_vm_readv, sys_process_vm_writev): Move 27371 to process_vm.c. 27372 27373 Implement decoding of fallocate FALLOC_FL_* flags. 27374 * xlat/falloc_flags.in: New file. 27375 * configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h. 27376 * fallocate.c [HAVE_LINUX_FALLOC_H]: Include <linux/falloc.h>. 27377 Include xlat/falloc_flags.h. 27378 (sys_fallocate): Decode flags. 27379 27380 Fix decoding of renameat2 RENAME_* flags. 27381 * renameat.c: Include <linux/fs.h> where RENAME_NOREPLACE, 27382 RENAME_EXCHANGE, and RENAME_WHITEOUT are usually defined. 27383 27384 file.c: move open, openat, and creat parsers to a separate file. 27385 * open.c: New file. 27386 * Makefile.am (strace_SOURCES): Add it. 27387 * file.c: Move sys_open, sys_openat, sys_creat, and related code 27388 to open.c. 27389 27390 file.c: move access and faccessat parsers to a separate file. 27391 * access.c: New file. 27392 * Makefile.am (strace_SOURCES): Add it. 27393 * file.c: Move sys_access, sys_faccessat and related code to access.c. 27394 27395 file.c: move umask parser to a separate file. 27396 * umask.c: New file. 27397 * Makefile.am (strace_SOURCES): Add it. 27398 * file.c (sys_umask): Move to umask.c. 27399 27400 file.c: move lseek and llseek parsers to a separate file. 27401 * lseek.c: New file. 27402 * Makefile.am (strace_SOURCES): Add it. 27403 * file.c: Move sys_lseek, sys_llseek, and related code to lseek.c. 27404 27405 file.c: move readahead parser to a separate file. 27406 * readahead.c: New file. 27407 * Makefile.am (strace_SOURCES): Add it. 27408 * file.c (sys_readahead): Move to readahead.c. 27409 27410 file.c: move truncate, truncate64, ftruncate, and ftruncate64 parsers to a separate file 27411 * truncate.c: New file. 27412 * Makefile.am (strace_SOURCES): Add it. 27413 * file.c (sys_truncate, sys_truncate64, sys_ftruncate, sys_ftruncate64): 27414 Move to truncate.c. 27415 27416 file.c: move chdir parser to a separate file. 27417 * chdir.c: New file. 27418 * Makefile.am (strace_SOURCES): Add it. 27419 * file.c (sys_chdir): Move to chdir.c. 27420 27421 file.c: move link, linkat, unlinkat, and symlinkat parsers to a separate file 27422 * link.c: New file. 27423 * Makefile.am (strace_SOURCES): Add it. 27424 * file.c: Move sys_link, sys_linkat, sys_unlinkat, sys_symlinkat, and 27425 related code to link.c. 27426 27427 file.c: move readlink and readlinkat parsers to a separate file. 27428 * readlink.c: New file. 27429 * Makefile.am (strace_SOURCES): Add it. 27430 * file.c (decode_readlink, sys_readlink, sys_readlinkat): Move 27431 to readlink.c. 27432 27433 file.c: move renameat and renameat2 parsers to a separate file. 27434 * renameat.c: New file. 27435 * Makefile.am (strace_SOURCES): Add it. 27436 * file.c: Move sys_renameat, sys_renameat2, and related code 27437 to renameat.c. 27438 27439 file.c: move chown, fchown, and fchownat parsers to a separate file. 27440 * chown.c: New file. 27441 * Makefile.am (strace_SOURCES): Add it. 27442 * file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c. 27443 27444 Export at_flags. 27445 * defs.h (at_flags): New prototype. 27446 27447 file.c: move chmod, fchmod, and fchmodat parsers to a separate file. 27448 * chmod.c: New file. 27449 * Makefile.am (strace_SOURCES): Add it. 27450 * file.c (sys_chmod, sys_fchmodat, sys_fchmod): Move to chmod.c. 27451 27452 file.c: move utimes, futimesat, utimensat, and osf_utimes parsers to a separate file 27453 * utimes.c: New file. 27454 * Makefile.am (strace_SOURCES): Add it. 27455 * file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat, 27456 sys_osf_utimes): Move to utimes.c. 27457 27458 file.c: move utime parser to a separate file. 27459 * utime.c: New file. 27460 * Makefile.am (strace_SOURCES): Add it. 27461 * file.c (sys_utime): Move to utime.c. 27462 27463 Export sprinttime. 27464 * defs.h (sprinttime): New prototype. 27465 * file.c (sprinttime): Make global and move to util.c. 27466 27467 file.c: move mknod, mknodat, and xmknod parsers to a separate file. 27468 * mknod.c: New file. 27469 * Makefile.am (strace_SOURCES): Add it. 27470 * file.c: Move sys_mknod, sys_mknodat, sys_xmknod, and related code 27471 to mknod.c. 27472 27473 file.c: export sprintmode and move it to a separate file. 27474 * printmode.c: New file. 27475 * Makefile.am (strace_SOURCES): Add it. 27476 * defs.h (sprintmode): New prototype. 27477 * file.c (sprintmode): Make global and move to printmode.c. 27478 27479 file.c: move getcwd parser to a separate file. 27480 * getcwd.c: New file. 27481 * Makefile.am (strace_SOURCES): Add it. 27482 * file.c (sys_getcwd): Move to getcwd.c. 27483 27484 file.c: move *xattr parsers to a separate file. 27485 * xattr.c: New file. 27486 * Makefile.am (strace_SOURCES): Add it. 27487 * file.c: Move sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr, 27488 sys_listxattr, sys_flistxattr, sys_removexattr, sys_fremovexattr, 27489 and related code to xattr.c. 27490 27491 file.c: move fadvise64 and fadvise64_64 parsers to a separate file. 27492 * fadvise.c: New file. 27493 * Makefile.am (strace_SOURCES): Add it. 27494 * file.c: Move sys_fadvise64, sys_fadvise64_64, and related code 27495 to fadvise.c. 27496 27497 file.c: move sync_file_range and sync_file_range2 parsers to a separate file 27498 * sync_file_range.c: New file. 27499 * Makefile.am (strace_SOURCES): Add it. 27500 * file.c: Move sys_sync_file_range, sys_sync_file_range2, and related 27501 code to sync_file_range.c. 27502 27503 file.c: move fallocate parser to a separate file. 27504 * fallocate.c: New file. 27505 * Makefile.am (strace_SOURCES): Add it. 27506 * file.c (sys_fallocate): Move to fallocate.c. 27507 27508 file.c: move swapon parser to a separate file. 27509 * swapon.c: New file. 27510 * Makefile.am (strace_SOURCES): Add it. 27511 * file.c: Move sys_swapon and related code to swapon.c. 27512 27513 2014-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 27514 27515 Implement full decoding of 64-bit capabilities. 27516 Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but 27517 before this change only lower 32 capability bits were decoded for 27518 v2 and v3. 27519 27520 * xlat/capabilities1.in: New file. 27521 * capability.c: Define v2/v3 CAP_* constants. 27522 Include xlat/capabilities1.h. 27523 (get_cap_header): New function. 27524 (print_cap_header): Update to use get_cap_header result. 27525 (print_cap_data): Decoder higher capability bits for v2 and v3. 27526 (sys_capget, sys_capset): Use get_cap_header, update print_cap_header 27527 and print_cap_data calls. 27528 * tests/caps.c: New file. 27529 * tests/caps.awk: New file. 27530 * tests/caps.test: New test. 27531 * tests/Makefile.am (CHECK_PROGRAMS): Add caps. 27532 (TESTS): Add caps.test. 27533 (EXTRA_DIST): Add caps.awk. 27534 27535 2014-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 27536 27537 Make parsers of capget and capset syscalls self-contained. 27538 Various versions of <linux/capability.h> used to require different 27539 workarounds to avoid conflicts with types defined by libc headers. 27540 Define all required types and constants locally to fix this issue. 27541 27542 * configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h. 27543 * capability.c: Do not include <linux/capability.h>, remove workarounds 27544 for problematic versions of <linux/capability.h> file. 27545 Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums. 27546 (struct __user_cap_header_struct, struct __user_cap_data_struct): Define. 27547 * xlat/cap_version.in: Add #unconditional. 27548 * xlat/capabilities.in: Likewise. 27549 27550 2014-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 27551 27552 Remove system.c. 27553 All disjoint parts of system.c have been moved to separate files. 27554 27555 * system.c: Remove. 27556 * Makefile.am (strace_SOURCES): Remove it. 27557 27558 2014-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 27559 27560 Move mount parser to a separate file. 27561 * mount.c: New file. 27562 * Makefile.am (strace_SOURCES): Add it. 27563 * system.c: Move sys_mount and related code to mount.c. 27564 27565 Move umount2 parser to a separate file. 27566 * umount.c: New file. 27567 * Makefile.am (strace_SOURCES): Add it. 27568 * system.c: Move sys_umount2 and related code to umount.c. 27569 27570 Move personality parser to a separate file. 27571 * personality.c: New file. 27572 * Makefile.am (strace_SOURCES): Add it. 27573 * system.c: Move sys_personality and related code to personality.c. 27574 27575 Move syslog parser to a separate file. 27576 * syslog.c: New file. 27577 * Makefile.am (strace_SOURCES): Add it. 27578 * system.c: Move sys_syslog and related code to syslog.c. 27579 27580 Move cacheflush parser to a separate file. 27581 * cacheflush.c: New file. 27582 * Makefile.am (strace_SOURCES): Add it. 27583 * system.c: Move inclusion of <asm/cachectl.h> to cacheflush.c. 27584 [M68K, BFIN, SH]: Move to cacheflush.c. 27585 27586 bfin: move sram_alloc parser to a separate file. 27587 * sram_alloc.c: New file. 27588 * Makefile.am (strace_SOURCES): Add it. 27589 * system.c [BFIN]: Move sys_sram_alloc and related code to sram_alloc.c. 27590 27591 Move capget and capset parsers to a separate file. 27592 * capability.c: New file. 27593 * Makefile.am (strace_SOURCES): Add it. 27594 * system.c: Move inclusion of headers and macro definitions related 27595 to capget and capset decoding to capability.c. 27596 (print_cap_header, print_cap_data, sys_capget, sys_capset): Move 27597 to capability.c. 27598 27599 2014-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 27600 27601 Move sysctl parser to a separate file. 27602 * sysctl.c: New file. 27603 * Makefile.am (strace_SOURCES): Add it. 27604 * system.c: Move sys_sysctl and related code to sysctl.c. 27605 27606 mips: move sysmips parser to a separate file. 27607 * sysmips.c: New file. 27608 * Makefile.am (strace_SOURCES): Add it. 27609 * system.c: Fix typo in the check for <linux/utsname.h>. 27610 Move inclusions of <linux/utsname.h> and <asm/sysmips.h> to sysmips.c. 27611 [MIPS]: Likewise. 27612 27613 or1k: move or1k_atomic parser to a separate file. 27614 * or1k_atomic.c: New file. 27615 * Makefile.am (strace_SOURCES): Add it. 27616 * system.c [OR1K]: Move to or1k_atomic.c. 27617 27618 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 27619 27620 Alias sys_setdomainname to sys_sethostname. 27621 Since parsers for setdomainname and sethostname syscalls are identical, 27622 replace sys_setdomainname with an alias to sys_sethostname. 27623 27624 * linux/dummy.h (sys_setdomainname): Alias to sys_sethostname. 27625 * linux/syscall.h (sys_setdomainname): Remove. 27626 * process.c (sys_setdomainname): Remove. 27627 27628 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 27629 27630 Alias sys_getpeername to sys_getsockname. 27631 Since parsers for getpeername and getsockname syscalls are identical, 27632 replace sys_getpeername with an alias to sys_getsockname. 27633 27634 * linux/dummy.h (sys_getpeername): Alias to sys_getsockname. 27635 * linux/syscall.h (sys_getpeername): Remove. 27636 * net.c (sys_getpeername): Remove. 27637 27638 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 27639 27640 Alias sys_stime to sys_time. 27641 Since parsers for stime and time syscalls are identical, 27642 replace sys_stime with an alias to sys_time. 27643 27644 * linux/dummy.h (sys_stime): Alias to sys_time. 27645 * linux/syscall.h (sys_stime): Remove. 27646 * time.c (sys_stime): Remove. 27647 27648 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 27649 27650 Remove unused sys_mctl. 27651 Starting with commit v4.6-240-g5afdf12, nobody compiles this 27652 non-Linux code. 27653 27654 * mem.c [MC_SYNC]: Remove. 27655 * xlat/mctl_funcs.in: Remove. 27656 * xlat/mctl_lockas.in: Remove. 27657 27658 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 27659 27660 Alias sys_mkdir and sys_mkdirat to sys_chmod and sys_fchmodat. 27661 Special parsers for mkdir and mkdirat are redundant because 27662 sys_chmod and sys_fchmodat implement the same decoding. 27663 27664 * file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove. 27665 * linux/dummy.h (sys_mkdir): Alias to sys_chmod. 27666 (sys_mkdirat): Alias to sys_fchmodat. 27667 * linux/syscall.h (sys_mkdir, sys_mkdirat): Remove. 27668 * pathtrace.c (pathtrace_match): Do not check for sys_mkdirat. 27669 27670 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 27671 27672 Remove unused <sys/acl.h> based code. 27673 Starting with commit v4.6-240-g5afdf12, nobody compiles this 27674 non-Linux code. 27675 27676 * configure.ac (AC_CHECK_HEADERS): Remove sys/acl.h. 27677 * file.c [HAVE_SYS_ACL_H]: Remove. 27678 * xlat/aclcmds.in: Remove. 27679 27680 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 27681 27682 Remove unused <sys/asynch.h> based code. 27683 Starting with commit v4.6-240-g5afdf12, nobody compiles this 27684 non-Linux code. 27685 27686 * configure.ac (AC_CHECK_HEADERS): Remove sys/asynch.h. 27687 * file.c [HAVE_SYS_ASYNCH_H]: Remove. 27688 27689 2014-11-27 Masatake YAMATO <yamato (a] redhat.com> 27690 27691 Print protocol name of socket descriptors with -yy option. 27692 For those socket descriptors that have no associated ip:port pairs 27693 (or when this information is not available), -yy option prints 27694 the same <socket:[INODE]> information as -y option, e.g. 27695 27696 $ strace -e sendto -yy ip l > /dev/null 27697 sendto(3<socket:[23456789]>, ... 27698 27699 This change makes -yy output more informative: instead of just 27700 printing "socket", the name of protocol behind the socket descriptor 27701 will be printed, e.g. 27702 27703 sendto(3<NETLINK:[23456789]>, ... 27704 27705 * configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h. 27706 * tests/net-yy-accept.awk: Update to support protocol names. 27707 * tests/net-yy-connect.awk: Likewise. 27708 * util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>. 27709 (getfdproto): New function. 27710 (printfd): Use it. 27711 27712 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 27713 27714 Replace MAXPATHLEN with PATH_MAX. 27715 MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter. 27716 27717 * strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX. 27718 * util.c (printpathn, printpath): Likewise. 27719 27720 2014-11-21 Mike Frysinger <vapier (a] gentoo.org> 27721 27722 Decode FIFREEZE/FITHAW/FITRIM ioctls. 27723 The freeze/thaw ones are simple, but the trim is an interesting struct. 27724 27725 * block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM. 27726 * ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl. 27727 27728 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 27729 27730 Include <sys/uio.h> unconditionally. 27731 Since <sys/uio.h> is standardized by POSIX and is present in all 27732 available versions of glibc, it's safe to assume that any usable 27733 libc implementation provides this header file. 27734 27735 * configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h. 27736 * io.c: Include <sys/uio.h> unconditionally. 27737 (tprint_iov_upto, tprint_iov, sys_readv, sys_writev, 27738 print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define 27739 unconditionally. 27740 * net.c: Include <sys/uio.h> unconditionally. 27741 * util.c: Include <sys/uio.h> unconditionally. 27742 (dumpiov): Define unconditionally. 27743 27744 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 27745 27746 Consistently use C99 designated initializers in the new netlink code. 27747 * socketutils.c (send_query, receive_responses): Use designated 27748 initializers for sockaddr_nl, nlmsghdr, and inet_diag_req_v2 structures. 27749 * tests/netlink_inet_diag.c (send_query, check_responses): Likewise. 27750 27751 2014-11-20 Mike Frysinger <vapier (a] gentoo.org> 27752 27753 Decode open's O_TMPFILE. 27754 * xlat/open_mode_flags.in: Add O_TMPFILE definition. 27755 27756 2014-11-11 Helge Deller <deller (a] gmx.de> 27757 27758 hppa: update error codes and signal numbers. 27759 There are two important changes in here: 27760 27761 1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa 27762 folks had problems with EWOULDBLOCK != EAGAIN, this was changed in 27763 kernel 3.14. 27764 27765 2. Starting with kernel 3.18, hppa folks changed some signal numbers in 27766 such a way that we end up with SIGRTMIN == 32, which brings hppa in sync 27767 with other linux ports. 27768 27769 Both were incompatible changes which basically broke hppa ABI, but since 27770 they have been merged into the kernel, we have to follow. 27771 27772 2014-11-11 Thomas De Schampheleire <thomas.de.schampheleire (a] gmail.com> 27773 27774 stack trace support: fix check on symbol name presence. 27775 The output format of the stack trace is supposed to be different 27776 depending on whether symbol names are available in the build. 27777 27778 However, the check only verified the validity of the pointer, not of the 27779 string pointed to (which could be empty). 27780 27781 This commit fixes the check so that the original output: 27782 27783 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 27784 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] 27785 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] 27786 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] 27787 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] 27788 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] 27789 > /bin/busybox(+0x0) [0x62c60] 27790 > /bin/busybox(+0x0) [0x4940] 27791 > /bin/busybox(+0x0) [0x499c] 27792 > /bin/busybox(+0x0) [0x4e08] 27793 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] 27794 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] 27795 27796 becomes: 27797 27798 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 27799 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] 27800 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] 27801 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] 27802 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] 27803 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] 27804 > /bin/busybox() [0x62c60] 27805 > /bin/busybox() [0x4940] 27806 > /bin/busybox() [0x499c] 27807 > /bin/busybox() [0x4e08] 27808 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] 27809 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] 27810 27811 Acked-by: Masatake YAMATO <yamato (a] redhat.com> 27812 27813 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 27814 27815 tests: add a test for decoding and dumping of recvmmsg/sendmmsg. 27816 * configure (AC_CHECK_FUNCS): Add sendmmsg. 27817 * tests/mmsg.c: New file. 27818 * tests/mmsg.expected: New file. 27819 * tests/mmsg.test: New test. 27820 * tests/.gitignore: Add mmsg. 27821 * tests/Makefile.am (CHECK_PROGRAMS): Add mmsg. 27822 (TESTS): Add mmsg.test. 27823 (EXTRA_DIST): Add mmsg.expected. 27824 27825 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 27826 27827 Add functions for dumping iovecs in mmsghdr used in sendmmsg and recvmmsg 27828 This patch is similar to what I did in commit 27829 02f9f6b386741a52f58e1b31ad4e7fff60781ef8. 27830 That commit was for sendmsg and recvmsg system calls. 27831 This one is for sendmmsg and recvmmsg system calls. 27832 27833 * defs.h (dumpiov_in_mmsghdr): New declaration. 27834 * net.c (extractmmsghdr): New function derived from printmmsghdr. 27835 (printmmsghdr): Use it. 27836 (dumpiov_in_mmsghdr): New function. 27837 * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr 27838 for recvmmsg and sendmmsg syscalls. 27839 27840 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 27841 27842 Use the definition of struct mmsghdr if it is defined in build environment 27843 mmsghrd structure type is defined locally in printmmsghdr function. 27844 27845 However, more functions will refer the definition in modifications for 27846 supporting "-e write=set" and "-e read=set" option for sendmmsg and 27847 recvmmsg system calls. 27848 27849 After this change, the system definition of struct mmsghdr will be used 27850 if configure reports it is available, falling back to the old local 27851 definition. 27852 27853 * configure.ac (AC_CHECK_TYPES): Add struct mmsghdr. 27854 * net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. 27855 (printmmsghdr): Use previously defined struct mmsghdr. 27856 27857 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 27858 27859 Introduce a separate function to copy from msghdr32 to msghdr. 27860 This patch is an initial step for supporting "-e write=set" and 27861 "-e read=set" option for sendmmsg and recvmmsg system calls. 27862 27863 Coverting a data of msghdr32 to msghdr is needed both for 27864 {send,recv}msg and {send,recv}mmsg to decode parameters. 27865 To share the copying code in both decoders, a separate 27866 function named copy_from_msghdr32 is introduced. 27867 27868 * net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] 27869 (copy_from_msghdr32): New function. 27870 (extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it. 27871 27872 2014-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 27873 27874 ioctlsort: rewrite build rules using noinst_PROGRAMS. 27875 * linux/ioctlsort.c: Rename to ioctlsort.c 27876 * Makefile.am (EXTRA_DIST): Rename linux/ioctlsort.c to ioctlsort.c. 27877 [MAINTAINER_MODE] (noinst_PROGRAMS): Add ioctlsort. 27878 (ioctlsort_SOURCES): Add ioctlsort.c. 27879 (nodist_ioctlsort_SOURCES): Add ioctls.h and ioctldefs.h. 27880 (CLEANFILES): Add $(nodist_ioctlsort_SOURCES). 27881 (ioctlsort.$(OBJEXT)): Likewise. 27882 (ioctlsort): Remove. 27883 27884 2014-11-11 Lubomir Rintel <lkundrak (a] v3.sk> 27885 27886 Makefile.am: look for ioctl definitions in the kernel build tree by default 27887 While most of ioctl-related kernel headers are now exported by kernel's 27888 headers_install, some are still modules_install only. The kernel's 27889 headers installed into /usr/include/ are usually headers_install'ed and 27890 therefore don't contain some internal headers we need. The solution is 27891 to look for modules_install'ed headers for the running kernel, and fall 27892 back to old behavior if they aren't found. 27893 27894 2014-11-04 Lubomir Rintel <lkundrak (a] v3.sk> 27895 27896 Dump details for Bluetooth socket operations. 27897 * configure.ac (AC_CHECK_HEADERS): Add bluetooth/bluetooth.h. 27898 * xlat/bt_protocols.in: New file. 27899 * net.c [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include bluetooth 27900 headers. 27901 [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h". 27902 (printsock) [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Dump details 27903 for AF_BLUETOOTH sockets. 27904 (sys_socket) [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Decode 27905 protocol for PF_BLUETOOTH sockets. 27906 27907 2014-11-04 Philippe De Muyter <phdm (a] macqel.be> 27908 27909 Implement Video4Linux video-input ioctls decoder. 27910 Introduce v4l2.c, a decoder for the arguments of the video-input subset 27911 of the v4l2 ioctl's. This is a combination of 27912 - previous work by Peter Zotov <whitequark (a] whitequark.org>, found at 27913 https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch 27914 - previous work by William Manley <will (a] williammanley.net>, found at 27915 http://marc.info/?l=strace&m=139395588520675 27916 - forward port, additions and fixes by Philippe De Muyter <phdm (a] macqel.be> 27917 27918 As v4l2 is a moving target, I have made v4l2.c compilable with ancient 27919 linux kernels by testing the availability of some macros. It has been 27920 succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and 27921 succesfully used on linux 3.10 with a camera device. 27922 27923 * configure.ac: Check for availabilty of V4L2_* enum constants. 27924 * Makefile.am (strace_SOURCES): Add v4l2.c. 27925 * defs.h (v4l2_ioctl): New prototype. 27926 * ioctl.c (ioctl_decode): Use v4l2_ioctl. 27927 * v4l2.c: New file. 27928 * xlat/v4l2_*.in: New files. 27929 27930 Cc: Peter Zotov <whitequark (a] whitequark.org> 27931 Cc: William Manley <will (a] williammanley.net> 27932 27933 2014-11-04 Dmitry V. Levin <ldv (a] altlinux.org> 27934 27935 Update ioctl entries. 27936 * linux/ioctlent.h.in: Regenerate from v3.17 headers. 27937 27938 Remove ioctl header file names from the executable. 27939 * defs.h (struct ioctlent): Remove "doth" field. 27940 * Makefile.am ($(ioctlent_h)): Remove 1st field. 27941 27942 2014-11-04 Dmitry V. Levin <ldv (a] altlinux.org> 27943 27944 Filter out redundant ioctl entries early. 27945 For two ioctl entries with the same code, if one's name is a prefix 27946 to another's name, keep the entry with a shorter name. Filter out 27947 redundant ioctl entries at ioctlsort stage so that distributed 27948 ioctlent.h.in files will be already filtered. 27949 27950 * linux/ioctlsort.c (is_not_prefix): New function. 27951 (main): Use it. 27952 * linux/ioctlent-filter.awk: Remove. 27953 * Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk. 27954 ($(ioctlent_h)): Don't use linux/ioctlent-filter.awk. 27955 27956 2014-11-03 Dmitry V. Levin <ldv (a] altlinux.org> 27957 27958 ioctlent.sh: update the list of directories exported by headers_install. 27959 * linux/ioctlent.sh: Add drm, mtd, rdma, video, and xen directories. 27960 27961 2014-11-01 Masatake YAMATO <yamato (a] redhat.com> 27962 27963 Add a function for dumping iovec in msghdr used in sendmsg and recvmsg. 27964 Here is an example session: 27965 27966 $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null 27967 sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(... 27968 * 40 bytes in buffer 0 27969 | 00000 28 00 00 00 10 00 05 00 d0 d9 aa 53 00 00 00 00 (..........S.... | 27970 | 00010 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ | 27971 | 00020 08 00 04 00 dd 05 00 00 ........ | 27972 ... 27973 27974 $ ./strace -e read=all ip link show > /dev/null 27975 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"... 27976 * 8192 bytes in buffer 0 27977 | 00000 34 00 00 00 02 00 00 00 00 00 00 00 ff 23 00 00 4............#.. | 27978 | 00010 ff ff ff ff 20 00 00 00 10 00 05 00 00 00 00 00 .... ........... | 27979 ... 27980 27981 * defs.h (dumpiov_in_msghdr): New prototype. 27982 * net.c (extractmsghdr): New function derived from printmsghdr. 27983 (printmsghdr): Use extractmsghdr. 27984 (dumpiov_in_msghdr): New function. 27985 * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg 27986 and sendmsg syscalls. 27987 27988 2014-10-31 Maarten ter Huurne <maarten (a] treewalker.org> 27989 27990 Include <linux/ptrace.h> regardless of <sys/reg.h> existence. 27991 This fixes compilation with musl libc. 27992 This approach was already used in process.c, so I assume it is safe. 27993 27994 * signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check. 27995 * syscall.c: Likewise. 27996 * util.c: Likewise. 27997 27998 2014-10-31 Dmitry V. Levin <ldv (a] altlinux.org> 27999 28000 sock: decode SIOCSIFNAME on entering syscall. 28001 * sock.c (sock_ioctl): Handle SIOCSIFNAME on entering syscall. 28002 28003 2014-10-31 Mike Frysinger <vapier (a] gentoo.org> 28004 28005 sock: fix decoding of SIOCSIFNAME. 28006 The decoding of SIOCSIFNAME is incorrect. It does not use 28007 the ifr_index field to look things up, but ifr_newname. 28008 28009 * sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and 28010 display ifr_newname. 28011 28012 2014-10-31 Mike Frysinger <vapier (a] gentoo.org> 28013 28014 sock: fix decoding of struct ifreq.ifr_name. 28015 The ifr name fields of the ifreq structure might not be NUL terminated. 28016 If the user makes an ioctl call where they aren't, then strace ends up 28017 reading random content from its own stack. Limit the printf lengths. 28018 28019 * sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs. 28020 28021 2014-10-03 Elliott Hughes <enh (a] google.com> 28022 28023 Don't risk truncating open flags by using mode_t. 28024 On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short) 28025 as their mode_t. The open(2) flags are actually an int, so high ones 28026 like O_CLOEXEC get truncated if you coerce them to mode_t. 28027 28028 * defs.h (tprint_open_modes, sprint_open_modes): Change argument type 28029 from mode_t to int. 28030 * file.c (tprint_open_modes, sprint_open_modes): Likewise. 28031 28032 2014-09-29 Dmitry V. Levin <ldv (a] altlinux.org> 28033 28034 Enhance sysinfo decoding. 28035 * configure.ac (AC_CHECK_MEMBERS): Check for struct sysinfo.totalhigh, 28036 struct sysinfo.freehigh, and struct sysinfo.mem_unit. 28037 * sysinfo.c (sys_sysinfo): Treat failed umove() call as syserror(). 28038 Print totalhigh, freehigh, and mem_unit members when struct sysinfo 28039 supports them. 28040 28041 Move sysinfo parser to a separate file. 28042 * sysinfo.c: New file. 28043 * Makefile.am (strace_SOURCES): Add it. 28044 * resource.c (sys_sysinfo): Move to sysinfo.c. 28045 28046 2014-09-29 Dmitry V. Levin <ldv (a] altlinux.org> 28047 28048 Fix build with musl libc. 28049 * resource.c: Include <sys/sysinfo.h> for struct sysinfo definition. 28050 28051 Reported-by: Steven Honeyman <stevenhoneyman (a] gmail.com> 28052 28053 2014-09-23 Dmitry V. Levin <ldv (a] altlinux.org> 28054 28055 tests: cleanup checks for basic programs. 28056 * tests/init.sh: Check for cat and rm. 28057 * tests/getdents.test: Check for awk. 28058 * tests/ptrace_setoptions.test: Check for grep. 28059 * tests/net-fd.test: Do not check for rm. 28060 * tests/net.test: Likewise. 28061 * tests/scm_rights-fd.test: Likewise. 28062 * tests/stat.test: Likewise. 28063 * tests/uio.test: Likewise. 28064 28065 tests: add a test for -yy option. 28066 * tests/net-yy.test: New test. 28067 * tests/inet-accept-connect-send-recv.c: New file. 28068 * tests/netlink_inet_diag.c: Likewise. 28069 * tests/net-yy-accept.awk: Likewise. 28070 * tests/net-yy-connect.awk: Likewise. 28071 * tests/.gitignore: Add inet-accept-connect-send-recv, 28072 netlink_inet_diag, *.tmp-*, and *.tmp.*. 28073 * tests/Makefile.am (check_PROGRAMS): Add inet-accept-connect-send-recv 28074 and netlink_inet_diag. 28075 (TESTS): Add net-yy.test. 28076 (EXTRA_DIST): Add net-yy-accept.awk and net-yy-connect.awk. 28077 28078 2014-09-22 Dmitry V. Levin <ldv (a] altlinux.org> 28079 28080 Move statfs related parsers to a separate file. 28081 * statfs.c: New file. 28082 * Makefile.am (strace_SOURCES): Add it. 28083 * file.c (sprintfstype, printstatfs, sys_statfs, sys_fstatfs): Move 28084 to statfs.c. 28085 [HAVE_STATFS64] (printstatfs64, printcompat_statfs64, sys_statfs64, 28086 sys_fstatfs64): Likewise. 28087 [ALPHA] (osf_statfs, osf_fstatfs): Likewise. 28088 28089 fsmagic: sort array by value and use bsearch for faster lookup. 28090 * defs.h (xlat_search): New prototype. 28091 * util.c (xlat_bsearch_compare, xlat_search): New functions. 28092 * file.c (sprintfstype): Use xlat_search for fsmagic lookup. 28093 * xlat/fsmagic.in: Sort by value and mark as not NULL-terminated. 28094 * tests/statfs.c: New file. 28095 * tests/statfs.test: New test. 28096 * tests/Makefile.am (check_PROGRAMS): Add statfs. 28097 (statfs_CFLAGS): Define. 28098 (TESTS): Add statfs.test. 28099 * tests/.gitignore: Add statfs. 28100 28101 2014-09-21 Dmitry V. Levin <ldv (a] altlinux.org> 28102 28103 fsmagic: update from <linux/magic.h> 28104 * xlat/fsmagic.in: Add new constants from <linux/magic.h>. 28105 Reported by Elliott Hughes. 28106 28107 2014-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 28108 28109 Add -yy option: print ip and port associated with socket descriptors. 28110 When two ore more -y options are given, print local and remote ip:port 28111 pairs associated with socket descriptors. This implementation uses 28112 NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch 28113 prepared by Zubin Mithra as a part of his GSoC 2014 strace project. 28114 28115 * Makefile.am (strace_SOURCES): Add socketutils.c 28116 (EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h. 28117 * defs.h (print_sockaddr_by_inode): New prototype. 28118 * linux/inet_diag.h: New file. 28119 * linux/sock_diag.h: Likewise. 28120 * socketutils.c: Likewise. 28121 * strace.1: Document -yy option. 28122 * strace.c (usage): Likewise. 28123 * util.c (printfd): Use print_sockaddr_by_inode. 28124 28125 2014-09-17 Vicente Olivert Riera <vincent (a] gentoo.org> 28126 28127 sigaction: wrap sa_restorer in #ifdef SA_RESTORER consistently. 28128 Wrap sa_restorer member definitions in #ifdef SA_RESTORER to be 28129 consistent with their use. 28130 If an architecture does not provide sa_restorer members but still 28131 defines SA_RESTORER macro, the latter has to be explicitly undefined. 28132 28133 This change fixes compilation failures like this one: 28134 signal.c: In function 'decode_old_sigaction': 28135 signal.c:631:21: error: 'struct old_sigaction' has no member named 'sa_restorer' 28136 signal.c: In function 'decode_new_sigaction': 28137 signal.c:1224:21: error: 'struct new_sigaction' has no member named 'sa_restorer' 28138 28139 * signal.c (struct old_sigaction, struct old_sigaction32, 28140 struct new_sigaction, struct new_sigaction32): 28141 Wrap sa_restorer member in #ifdef SA_RESTORER. 28142 (decode_old_sigaction, decode_new_sigaction): 28143 Wrap use of sa32.sa_restorer in #ifdef SA_RESTORER. 28144 28145 2014-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 28146 28147 Fix compilation warnings reported by gcc -Wsign-compare. 28148 * configure.ac (gl_WARN_ADD): Add -Wsign-compare. 28149 * defs.h (struct tcb): Change 'currpers' type to unsigned. 28150 (struct xlat): Change 'val' type to unsigned 28151 (signame): Add 'const' qualifier to its argument. 28152 (xlookup, printxval): Add 'const' qualifier to the 2nd argument and 28153 change its type to unsigned. 28154 (printpathn): Change the 3rd argument type to unsigned. 28155 (ioctl_lookup): Change 1st argument type to unsigned. 28156 * count.c (call_summary_pers, call_summary): Change 'i' type to unsigned. 28157 * file.c (print_xattr_list): Fix comparisons between signed and unsigned 28158 long values. 28159 * ioctl.c (compare): Fix cast. 28160 (ioctl_lookup): Change 1st argument type to to unsigned. 28161 (ioctl_next_match): Change 'code' type to unsigned. 28162 * mem.c (sys_move_pages): Change 'i' type to unsigned. 28163 * mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned. 28164 Print 'i' using %u format string. 28165 * process.c (sys_prctl): Change 'i' type to unsigned. 28166 (printargv): Change 'n' type to unsigned. 28167 (sys_ptrace): Change 'addr' type to unsigned. 28168 * scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument 28169 and change its type to unsigned. Change 'i' and 'allocated' types 28170 to unsigned. 28171 * signal.c (signame): Add 'const' qualifier to its argument. 28172 Fix comparisons between signed and unsigned values. 28173 (sprintsigmask_n, printsiginfo): Fix comparisons between signed and 28174 unsigned values. 28175 * sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned. 28176 * strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned. 28177 (detach): Change 'sig' type to unsigned. 28178 (startup_attach): Change 'tcbi' type to unsigned. 28179 (startup_child): Change 'm', 'n', and 'len' types to unsigned. 28180 (init): Use new variable to iterate 'tcbtab'. 28181 (pid2tcb): Change 'i' type to unsigned. 28182 (cleanup): Change 'i' and 'sig' types to unsigned. 28183 * syscall.c (update_personality): Change 'personality' argument type 28184 to unsigned. 28185 (struct qual_options): Change 'bitflag' type to unsigned. 28186 (reallocate_qual): Add 'const' qualifier to its argument and change its 28187 type to unsigned. 28188 (qualify_one): Change 'n' and 'bitflag' arguments types to unsigned. 28189 Add 'const' qualifier to 'n', 'not', and 'pers' arguments. 28190 Change 'p' type to signed int. 28191 (qual_syscall): Change 'bitflag' argument type to unsigned. 28192 Add 'const' qualifier to 'bitflag' and 'not' arguments. 28193 Change 'p' type to signed int. 28194 (qual_signal): Change 'bitflag' argument type to unsigned. 28195 Add 'const' qualifier to 'bitflag' and 'not' arguments. 28196 Change 'i' type to unsigned. 28197 (qual_desc): Change 'bitflag' argument type to unsigned. 28198 Add 'const' qualifier to 'bitflag' and 'not' arguments. 28199 (qualify): Change 'i' type to unsigned. 28200 (get_scno): Change 'currpers' type to unsigned. 28201 Fix a comparison between signed and unsigned values. 28202 * system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned. 28203 Fix comparisons between signed and unsigned values. 28204 * util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument 28205 and change its type to unsigned. 28206 (printuid): Fix a comparison between signed and unsigned values. 28207 (printpathn): Change 'n' argument type to unsigned. 28208 (printstr): Change 'size' type to unsigned. 28209 Fix a comparison between signed and unsigned values. 28210 (setbpt): Change 'i' type to unsigned. 28211 * net.c (printsock): Silence a compilation warning. 28212 * reboot.c (sys_reboot): Likewise. 28213 28214 2014-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 28215 28216 Move dirent related parsers to a separate file. 28217 * dirent.c: New file. 28218 * Makefile.am (strace_SOURCES): Add it. 28219 * file.c (print_old_dirent, sys_readdir, sys_getdents, sys_getdents64): 28220 Move to dirent.c. 28221 28222 getdents, getdents64: fix potential out-of-bounds read issues. 28223 * file.c (sys_getdents): Check for invalid d_reclen. 28224 Avoid reading from uninitialized memory. 28225 (sys_getdents64): Likewise. 28226 * tests/getdents.awk: New file. 28227 * tests/getdents.test: New test. 28228 * tests/Makefile.am (TESTS): Add it. 28229 (EXTRA_DIST): Add getdents.awk. 28230 28231 2014-09-10 Dmitry V. Levin <ldv (a] altlinux.org> 28232 28233 tprint_sock_type: remove unused parameter. 28234 * net.c (tprint_sock_type): Remove unused parameter 'tcp'. 28235 (sys_socket, sys_socketpair): Update callers. 28236 28237 printsock: fix decoding of unrecognized AF_PACKET packet types. 28238 * net.c (printsock): Fix fallback string for AF_PACKET packet types. 28239 28240 2014-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 28241 28242 decode_select: fix potential use of an uninitialized variable. 28243 A pointer to fd_set was used uninitialized when nfds == 0. 28244 28245 * desc.c (decode_select): Initialize fds. 28246 28247 Reported-by: Zubin Mithra <zubin.mithra (a] gmail.com> 28248 28249 2014-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 28250 28251 Use external libaio.h. 28252 Stop using an outdated partial copy of libaio.h, switch back to external 28253 libaio.h from libaio. 28254 This partially reverts commit 2df03c494eb3c36c4178eba35c374831031d1a58. 28255 28256 * aio.c: Drop a partial copy of libaio.h, include <libaio.h> instead. 28257 (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS. 28258 (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and 28259 HAVE_DECL_IO_CMD_PWRITEV. 28260 * configure.ac: Check for libaio.h and declaration it provides. 28261 28262 2014-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 28263 28264 maint: post-release administrivia. 28265 * NEWS: Add header line for next release. 28266 28267 2014-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 28268 28269 Prepare for 4.9 release. 28270 * NEWS: Update for 4.9 release. 28271 * debian/changelog: 4.9-1. 28272 * strace.spec: 4.9-1. 28273 28274 Sync strace.spec and debian/ with packages. 28275 * debian/changelog: Sync with 4.8-1.1. 28276 * debian/control: Likewise. 28277 * debian/rules: Likewise. 28278 * strace.spec: Sync with 4.8-5. 28279 28280 NEWS: Update for 4.9 release. 28281 28282 2014-08-15 Mike Frysinger <vapier (a] gentoo.org> 28283 28284 Update syscall tables to the point where they include renameat2. 28285 * linux/dummy.h: Add printargs aliases for sys_sched_getattr and 28286 sys_sched_setattr. 28287 * linux/aarch64/syscallent1.h: Add kcmp/finit_module/sched_setattr/ 28288 sched_getattr/renameat2. 28289 * linux/alpha/syscallent.h: Add kcmp/finit_module. 28290 * linux/arm/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 28291 * linux/hppa/syscallent.h: Add sched_setattr/sched_getattr/utimes/renameat2. 28292 * linux/i386/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 28293 * linux/ia64/syscallent.h: Likewise. 28294 * linux/m68k/syscallent.h: Likewise. 28295 * linux/microblaze/syscallent.h: Likewise. 28296 * linux/mips/syscallent-n32.h: Likewise. 28297 * linux/mips/syscallent-n64.h: Add getdents64/sched_setattr/sched_getattr/ 28298 renameat2. 28299 * linux/mips/syscallent-o32.h: Add sched_setattr/sched_getattr/renameat2. 28300 * linux/powerpc/syscallent.h: Fix finit_module/kcmp order. Add sched_setattr/ 28301 sched_getattr/renameat2. 28302 * linux/s390/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 28303 * linux/s390x/syscallent.h: Likewise. 28304 * linux/sparc/syscallent.h: Likewise. 28305 * linux/x32/syscallent.h: Likewise. 28306 * linux/x86_64/syscallent.h: Likewise. 28307 * linux/xtensa/syscallent.h: Add sched_setattr/sched_getattr. 28308 28309 renameat2: add decoding support. 28310 * file.c (decode_renameat, sys_renameat2): New functions. 28311 (sys_renameat): Use decode_renameat. 28312 * pathtrace.c (pathtrace_match): Handle sys_renameat2. 28313 * linux/syscall.h (sys_renameat2): New prototype. 28314 * xlat/rename_flags.in: New file. 28315 28316 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 28317 28318 CREDITS: fix generation in out of tree builds. 28319 The {...} code changes the working dir with `cd`, but the commands outside 28320 of that block expects to be in the original dir. Change to a subshell so 28321 the path outside of this block remains unchanged. 28322 28323 * Makefile.am ($(srcdir)/CREDITS): Change {...} to (...). 28324 28325 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 28326 28327 ia64: add missing syscalls. 28328 When the preadv/pwritev syscalls were added, the ones before it in the 28329 ia64 list were missed, so all the syscalls there and later were not in 28330 the right location (causing things to be decoded incorrectly). 28331 28332 Add the missing syscalls before preadv which also re-aligns all the 28333 syscalls after that point. This fixes the uio.test. 28334 28335 * linux/ia64/syscallent.h: Add syscalls 1310 through 1318. 28336 28337 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 28338 28339 ia64: fix sigaction decoding. 28340 Looks like ia64 doesn't have sa_restorer either, yet still defines 28341 SA_RESTORER. Deploy the same trick that HPPA is using to make the 28342 test pass. 28343 28344 * signal.c (SA_RESTORER): Undefine when IA64 is defined. 28345 (struct new_sigaction) [IA64]: Disable sa_restorer. 28346 28347 2014-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 28348 28349 tests: skip detach-stopped.test when PTRACE_SEIZE doesn't work. 28350 detach-stopped.test is known to fail when PTRACE_SEIZE is not available, 28351 so skip the test in that case. 28352 28353 * tests/detach-stopped.test: Check for "strace -d" output and skip the 28354 test when it says that PTRACE_SEIZE doesn't work. 28355 28356 2014-08-11 Erik Johansson <erik (a] ejohansson.se> 28357 28358 sh: fix syscall numbering for recv and sendto. 28359 * linux/sh/syscallent.h: Swap recv and sendto syscall entries. 28360 28361 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 28362 28363 tests: fix uio building w/out preadv/pwritev. 28364 The preadv/pwritev symbols weren't added to glibc until the 2.10 release, 28365 so trying to build the uio test leads to link failures. Add configure 28366 tests and update uio.test to handle this. 28367 28368 * configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev. 28369 * tests/uio.c: Include config.h. 28370 (main): Check for HAVE_PREADV and HAVE_PWRITEV. 28371 * tests/uio.test: Check exit status of uio helper. 28372 28373 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 28374 28375 tests: ignore *.tmp files. 28376 The tests like to generate random .tmp files, so ignore them. 28377 28378 * tests/.gitignore: Add *.tmp. 28379 28380 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 28381 28382 tests: fix shell errors in detach tests. 28383 The current detach test code does: 28384 set -e 28385 ... 28386 cleanup() { 28387 set +e 28388 kill ... 28389 wait ... 28390 } 28391 ... 28392 cleanup 28393 exit 0 28394 28395 The problem is that while `set -e` is disabled for the body of the 28396 cleanup function, it isn't necessarily disabled in the caller scope. 28397 So if the return value of the cleanup function (`wait` in this case) 28398 is non-zero, the script ends up failing overall. 28399 28400 Add an explicit return 0 to the cleanup function so that we don't kill 28401 the overall test pipeline. 28402 28403 * tests/detach-running.test (cleanup): Add return 0. 28404 * tests/detach-sleeping.test (cleanup): Likewise. 28405 * tests/detach-stopped.test (cleanup): Likewise. 28406 28407 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 28408 28409 set_ptracer_any: add a little documentation. 28410 This way I don't have to keep reading up on these options and wondering 28411 why the code isn't aborting when the call fails. 28412 28413 * tests/set_ptracer_any.c (main): Note prctl failures are ok. 28414 28415 2014-08-10 Mike Frysinger <vapier (a] gentoo.org> 28416 28417 signal: fix thinko in sa_restorer. 28418 Previous commit here re-added the bugs trying to be fixed due to a 28419 logic thinko. The patches were tested in isolation and hand merged 28420 later. Oops. 28421 28422 * signal.c (struct new_sigaction): Change || to &&. 28423 28424 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 28425 28426 sigaction test: support arches w/out SA_RESTORER and swapped args. 28427 Running Linux 3.15 (sparc64) and glibc 2.17 (sparc32) triggers a 28428 rt_sigaction call that does not use SA_RESTORER and has an order 28429 where it inserts a restorer and a size. The current tests don't 28430 support that ordering, so add another regex. 28431 28432 * tests/sigaction.awk: Support no SA_RESTORER and swapped args. 28433 28434 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 28435 28436 alpha/sparc: fix arg count for rt_sigaction. 28437 Both these arches have a rt_sigaction syscall that takes 5 args, not 4. 28438 28439 * linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5. 28440 * linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5. 28441 28442 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 28443 28444 hppa: fix sigaction decoding. 28445 Since the rt_sigaction syscall on hppa doesn't have a sa_restorer, 28446 do not include it in the kernel struct. 28447 28448 We also have to undefine SA_RESTORER so that code doesn't try to 28449 use it. The headers will export this, but the syscall doesn't 28450 actually respect it. 28451 28452 * signal.c (SA_RESTORER): Undefine when HPPA is defined. 28453 (struct new_sigaction): Disable sa_restorer on hppa. 28454 28455 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 28456 28457 alpha: fix sigaction decoding. 28458 Since the rt_sigaction syscall on alpha doesn't have a sa_restorer, 28459 do not include it in the kernel struct. 28460 28461 * signal.c (struct new_sigaction): Disable sa_restorer on alpha. 28462 28463 2014-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 28464 28465 Prepare for -yy option support. 28466 * defs.h (show_fd_path): Change type to unsigned int. 28467 * strace.c (show_fd_path): Likewise. 28468 (init): Handle repeated -y option. 28469 28470 2014-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 28471 28472 Fix preadv/pwritev offset decoding on ILP32 architectures. 28473 This fixes regression introduced by the previous commit. 28474 28475 * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]: 28476 Cast argument to unsigned long before casting it to unsigned long long. 28477 28478 2014-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 28479 28480 Fix preadv/pwritev offset decoding on bigendian architectures. 28481 This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560. 28482 28483 * util.c (printllval): Remove align argument. 28484 * defs.h (printllval): Update prototype. 28485 (printllval_aligned, printllval_unaligned): Remove. 28486 * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, 28487 sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, 28488 sys_fallocate): Replace printllval_aligned call with printllval. 28489 * io.c (sys_pread, sys_pwrite): Likewise. 28490 (print_llu_from_low_high_val): New function. 28491 (sys_preadv, sys_pwritev): Use it instead of printllval_unaligned. 28492 28493 2014-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 28494 28495 Decode file descriptors returned by accept and accept4 syscalls. 28496 * net.c (do_accept): Rename to do_sockname. 28497 (sys_accept, sys_accept4): Update callers, return RVAL_FD. 28498 (sys_getsockname, sys_getpeername): Call do_sockname directly. 28499 * tests/net-fd.test: Update. 28500 28501 2014-08-01 Mike Frysinger <vapier (a] gentoo.org> 28502 28503 x32: update io_{setup,submit} syscalls. 28504 Starting in 3.16, these two syscalls have gotten their own entry 28505 point for x32. See linux 7fd44dacdd803c0bbf38bf478d51d280902bb0f1. 28506 28507 * linux/x32/syscallent.h: Change existing io_{setup,submit} to 64bit, 28508 and add new entry points for x32 specifically. 28509 28510 2014-06-18 Max Filippov <jcmvbkbc (a] gmail.com> 28511 28512 xtensa: sort values in struct_user_offsets. 28513 Otherwise ptrace syscall argument decoding is wrong: 28514 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0 28515 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0 28516 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0 28517 instead of 28518 ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0 28519 ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0 28520 ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0 28521 28522 * process.c (struct_user_offsets) [XTENSA]: Sort values. 28523 28524 2014-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 28525 28526 Document -k option as experimental. 28527 strace -k does not produce a reliable output on all supported 28528 configurations yet, even basic strace-k.test is known to fail 28529 on some of them. 28530 28531 * strace.c (usage): Document -k option as experimental. 28532 * strace.1: Likewise. 28533 * NEWS: Likewise. 28534 28535 2014-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 28536 28537 tests: robustify -k test. 28538 Split stack-fcall.c into several compilation units so that intermediate 28539 function calls would not be optimized out by compiler. 28540 28541 * tests/stack-fcall.c: Move intermediate functions to ... 28542 * tests/stack-fcall-*.c: ... new files. 28543 * tests/Makefile.am (stack_fcall_SOURCES): Add stack-fcall-*.c. 28544 28545 2014-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 28546 28547 tests: enhance -k test. 28548 Add two more function calls to the stack. Suggested by Masatake YAMATO. 28549 28550 * tests/stack-fcall.c (f1): Rename to f3. 28551 (f1, f2): New functions. 28552 * tests/strace-k.test: Update. 28553 28554 2014-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 28555 28556 unwind: ignore memory mappings that have no PROT_EXEC bit set. 28557 * unwind.c (build_mmap_cache): For each memory mapping being scanned, 28558 save its PROT_EXEC bit and skip the mapping if it is not set. 28559 28560 unwind: cleanup build_mmap_cache. 28561 * unwind.c (build_mmap_cache): Move local variables to the code branch 28562 where they are used. Check return code of sscanf and strdup. Do not 28563 treat unusual memory mappings as fatal errors. Do not skip memory 28564 mappings with path names starting with "[". 28565 28566 unwind: remove unused field from mmap_cache_t. 28567 * unwind.c (mmap_cache_t): Remove "deleted" field. 28568 (build_mmap_cache): Remove initialization of "deleted" field. 28569 28570 2014-06-12 Dmitry V. Levin <ldv (a] altlinux.org> 28571 28572 unwind: refactor stacktrace_walk. 28573 * unwind.c (stacktrace_walk): Move stack frame printing code 28574 to separate function print_stack_frame. 28575 28576 unwind: constify binary_filename and symbol_name functions arguments. 28577 * unwind.c (call_action_fn, print_call_cb, sprint_call_or_error, 28578 queue_put, queue_put_call): Add const qualifier to binary_filename and 28579 symbol_name arguments. 28580 28581 2014-06-11 Luca Clementi <luca.clementi (a] gmail.com> 28582 28583 unwind: disable stack trace with multiple personalities. 28584 * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, 28585 unwind_capture_stacktrace): Disable stack tracing of non-default 28586 personality processes. 28587 28588 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 28589 28590 unwind: rename function_off_set to function_offset. 28591 * unwind.c (call_action_fn, stacktrace_walk, STACK_ENTRY_SYMBOL_FMT, 28592 print_call_cb, sprint_call_or_error, queue_put, queue_put_call): 28593 Rename function_off_set to function_offset. 28594 28595 unwind: fix a bug in range updating of binary search. 28596 * unwind.c (print_stacktrace): Fix another off-by-one error in binary search. 28597 28598 unwind: use fopen64 instead of fopen. 28599 * unwind.c (fopen_for_input): Define to fopen64 iff 28600 [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen. 28601 (build_mmap_cache): Use fopen_for_input instead of fopen. 28602 28603 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 28604 28605 unwind: fix build on 32-bit architectures. 28606 Fix compilation warnings in unwind.c on 32-bit architectures. 28607 On some architectures getuid is actually getuid32, so change the test 28608 to use getpid instead of getuid. 28609 28610 * unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set 28611 to unsigned long. 28612 (queue_put_error): Change the 3rd argument's type to unsigned long. 28613 * tests/stack-fcall.c (f1): Use getpid instead of getuid. 28614 * tests/strace-k.test: Likewise. 28615 28616 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 28617 28618 tests: robustify -w option test. 28619 * tests/count.test: Allow nanosleep to spend a bit less time than 1 second. 28620 28621 2014-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 28622 28623 Fix delete_module decoding. 28624 * xlat/delete_module_flags.in: New file. 28625 * file.c (sys_delete_module): Move ... 28626 * bjm.c (sys_delete_module): ... to here. 28627 Decode 1st argument using printstr instead of printpath. 28628 * NEWS: Mention it. 28629 28630 2014-06-04 Zubin Mithra <zubin.mithra (a] gmail.com> 28631 28632 Decode paths associated with file descriptors returned by syscalls. 28633 * defs.h (RVAL_FD): New macro. 28634 (RVAL_MASK, RVAL_STR, RVAL_NONE): Update. 28635 * desc.c (sys_dup, sys_delete_module): New functions. 28636 (do_dup2, decode_open, sys_creat): Change return value to RVAL_FD. 28637 * linux/dummy.h (sys_delete_module, sys_dup): Remove. 28638 * linux/syscall.h (sys_delete_module, sys_dup): New prototypes. 28639 * syscall.c (trace_syscall_exiting): Handle RVAL_FD. 28640 28641 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 28642 28643 NEWS: Prepare for 4.9 release. 28644 28645 Warn about flags that have no effect with -c. 28646 * strace.c (init): Issue a warning if -i, -k, -r, -t, -T, or -y is used 28647 along with -c. 28648 This fixes Debian bug #443895. 28649 28650 debian: enable security hardening features. 28651 * debian/rules: Follow the advice in https://wiki.debian.org/Hardening 28652 and enable maximum hardening as for programs that handle untrusted data. 28653 Patch by Markus <waldeck (a] gmx.de>. 28654 28655 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 28656 28657 debian: update control file. 28658 * debian/control (strace64): Fix a typo in package description. 28659 Patch by Pascal De Vuyst <pascal.devuyst (a] gmail.com>. 28660 (strace, strace-udeb): Add x32 to architecture list. 28661 Patch by Guillaume Morin <guillaume (a] morinfr.org>. 28662 (strace, strace-udeb): Add or1k to architecture list. 28663 Patch by Christian Svensson <debian (a] cmd.nu>. 28664 (strace, strace-udeb): Add arm64 to architecture list, 28665 and remove defunct arm. 28666 Patch by Wookey <wookey (a] debian.org>. 28667 28668 This fixes Debian bugs: #697625, #727018, #742235, #749956. 28669 28670 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 28671 28672 manpage: minor corrections. 28673 $ groff -ww -mandoc -z strace.1 28674 strace.1:65: warning: macro `IX' not defined 28675 28676 * strace.1: define IX macro as empty for groff. 28677 Change remaining '-' as minus to '\-'. 28678 Have two word spaces after a full stop as an end of sentence. 28679 Use extra space ('\,' or '\/') between roman and italic characters. 28680 Based on patch by Bjarni Ingi Gislason <bjarniig (a] rhi.hi.is>. 28681 This fixes Debian bug #725987. 28682 28683 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28684 28685 unwind: tests: add a test for -k option. 28686 * tests/stack-fcall.c: New test target. 28687 * tests/strace-k.test: New test driver. 28688 * tests/Makefile.am (check_PROGRAMS): Add stack-fcall. 28689 (TESTS): Add strace-k.test. 28690 * tests/.gitignore: Add stack-fcall. 28691 28692 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28693 28694 unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering 28695 Instead of handling stacktrace capturing and mmap cache invalidating in 28696 sys_* functions, handle them uniformly in trace_syscall_entering using 28697 new flags introduced by previous two commits. 28698 28699 The patch is simpler than its older version(v3). The value of 28700 hide_log_until_execve is just ignored. I found the value is nothing 28701 to do with this patch. unwind_cache_invalidate is mentioned only 28702 once in trace_syscall_exiting. 28703 Both are suggested by Dmitry Levin. 28704 28705 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 28706 28707 unwind: add SE and SI flags to syscall entries for all architectures. 28708 Add SE flag to execve, exit, and exit_group syscall entries. 28709 Add SI flag to brk, execve, mmap, mprotect, mremap, munmap, 28710 remap_file_pages, shmat, and shmdt syscall entries. 28711 28712 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28713 28714 unwind: introduce markers specifying the needs of special care in unwinding 28715 Some system calls require capturing the stack trace before they are 28716 processed in kernel. Typical one is execve. Some system calls require 28717 invalidating mmap cache after they are processed in kernel. 28718 28719 In current implementation these requirements are handled directly by 28720 appropriate syscall handlers. However, it is difficult to keep the 28721 source code maintainable using this approach to cover all system calls 28722 which have such requirements. 28723 28724 A more generic way to implement this is to flag all syscalls that 28725 require special processing, and handle these flags right in 28726 trace_syscall_entering instead of changing syscall handlers. 28727 28728 This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and 28729 STACKTRACE_CAPTURE_ON_ENTER. 28730 28731 The names of macros are suggested by Dmitry Levin. 28732 28733 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28734 28735 unwind: enable dwarf cache of libunwind. 28736 Here is the benchmark of the dwarf cache. 28737 28738 Target program: 28739 28740 #include <sched.h> 28741 int main(void) 28742 { 28743 unsigned int max = 0x6fff, i; 28744 for (i = 0; i < max; i++) 28745 sched_yield(); 28746 return 0; 28747 } 28748 28749 Command line: 28750 28751 ./strace -o /dev/null -k a.out 28752 28753 With the dwarf cache: 28754 28755 real 0m12.081s 28756 user 0m3.858s 28757 sys 0m8.194s 28758 28759 Without the dwarf cache: 28760 28761 real 0m22.326s 28762 user 0m5.218s 28763 sys 0m16.952s 28764 28765 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28766 28767 unwind: report expected backtracing error. 28768 When a file mmap'ed to the target process is unlink'ed, backtracing the 28769 stack would fail. Current implementation reports it as 28770 "backtracing_error". To avoid confusion, the message is changed to 28771 "expected_backtracing_error". 28772 28773 Here is the reproducer: 28774 28775 $ cat ./p-deleted.c 28776 #include <unistd.h> 28777 28778 int main(int argc, char **argv) { 28779 return unlink(argv[0]) < 0; 28780 } 28781 28782 $ strace -e unlink -k ./p-deleted 28783 unlink("./p-deleted") = 0 28784 > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17] 28785 > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575] 28786 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 28787 > backtracing_error [0x7ffff1365590] 28788 +++ exited with 0 +++ 28789 28790 p-deleted is deleted therefore backtracing_error is reported. This 28791 patch records the deleted marker when making mmap cache and refers the 28792 recorded information in the case "backtracing_error" to switch the 28793 message. 28794 28795 Here is the output of this patch: 28796 28797 $ strace -e unlink -k ./p-deleted 28798 unlink("./p-deleted") = 0 28799 > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17] 28800 > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575] 28801 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 28802 > expected_backtracing_error [0x7ffff1365590] 28803 +++ exited with 0 +++ 28804 28805 This solution is not perfect: if a file is unlink'ed after making the 28806 mmap cache and before unwinding, strace cannot have a chance to record 28807 the deleted marker. 28808 28809 In this version of patch, hardcoded magic number used in comparing "(delete)" 28810 string is replaced with strlen as suggested by Dmitry Levin. 28811 28812 In old version of patch, the deleted entry was thrown away from mmap 28813 cache to avoid to report "backtracing_error". In this patch I keep it, 28814 and just switch the error message. 28815 Inspired by the review comment from Dmitry Levin. 28816 28817 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28818 28819 unwind: call unwind_tcb_fin before printing detached message. 28820 captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not 28821 empty. This should happen before printing detached message, so 28822 unwind_tcb_fin is moved to the top of droptcb. 28823 28824 This is implicitly suggested by Dmitry Levin in patch review process. 28825 28826 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28827 28828 unwind: implement automatic mmap cache invalidation. 28829 A mmap cache belonging to a tcb was updated when a system call which 28830 changed the memory mapping was called. This implementation was assumed 28831 the mapping was changed only by the tcb. However, this assumption is 28832 incorrect if the target application is multi-threaded; more than two 28833 tcbs can shared the same memory mapping and a tcb can modify it without 28834 being noticed by the others. 28835 28836 This change introduces a global integer variable mmap_cache_generation, 28837 and mmap_cache_generation field to struct tcb. The variable 28838 is incremented each time a process enters a syscall that can modify its 28839 memory mapping. Each tcb records the value of this variable at the 28840 moment if building its mmap cache. Every mmap cache associated with 28841 the given tcb can be validated by comparing its mmap_cache_generation 28842 field with the variable mmap_cache_generation. 28843 28844 This implementation is inefficient. If strace attaches two processes 28845 which don't share the memory mapping, rebuilding mmap cache of a tcb 28846 triggered by another tcb's mmap system call is not necessary. 28847 28848 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28849 28850 unwind: introduce queue_t for capturing stacktrace. 28851 This is the second step for splitting capturing from printing. 28852 28853 New `queue' field is added to tcb. Captured stacktrace is stored here. 28854 The field is initialized/finalized at unwind_tcb_init/unwind_tcb_fin. 28855 28856 New API function unwind_capture_stacktrace is added. This function 28857 captures the currest stack using stracktrace_walker and records it in 28858 tcb. It's printing is delayed to the next call of 28859 unwind_print_stacktrace. 28860 28861 unwind_print_stacktrace is extended. Now it checks queue field of 28862 the given tcb at the start of function. If the function finds a 28863 captured stack trace, the latter is printed using stracktrace_walker. 28864 28865 Currently unwind_capture_stacktrace invocations are added directly to 28866 handlers of mmap, munmap, mprotect, and execve. 28867 28868 Here is the difference of output with/without patch: 28869 28870 (without patch) 28871 execve("./test-fork", ["./test-fork"], [/* 56 vars */]) = 0 28872 > /usr/lib64/ld-2.18.so(check_one_fd.part.0+0x82) [0x11f0] 28873 28874 (with patch) 28875 execve("./test-fork", ["./test-fork"], [/* 54 vars */]) = 0 28876 > /usr/lib64/libc-2.18.so(execve+0x7) [0xbcd27] 28877 > /home/yamato/var/strace/strace(exec_or_die+0x10c) [0x26ac] 28878 > /home/yamato/var/strace/strace(startup_child+0x346) [0x134f6] 28879 > /home/yamato/var/strace/strace(init+0x89f) [0x13dff] 28880 > /home/yamato/var/strace/strace(main+0xa) [0x26ca] 28881 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 28882 > /home/yamato/var/strace/strace(_start+0x29) [0x2799] 28883 28884 In older version output lines of captured elements were built when 28885 printing. In this version they are built when capturing the stack. 28886 As result, unneeded dynamic memory allocations are avoided. 28887 Suggested by Luca Clementi. 28888 28889 In older version the combination of snprintf and realloc were used. 28890 In this version they are replaced with asprintf. 28891 Suggested by Dmitry Levin. 28892 28893 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28894 28895 unwind: introduce own debug macro. 28896 * unwind.c (DPRINTF): New macro, to be utilized in debugging cache 28897 management code. 28898 28899 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28900 28901 unwind: introduce stacktrace_walker. 28902 In current implementation, the stack trace is captured and printed at 28903 the same time, in trace_syscall_exiting. This approach cannot 28904 provide user expected information when a system call changes the 28905 memory mapping. In such cases, the stack trace should be captured on 28906 entering syscall and printed on exiting. 28907 28908 As the initial step for splitting capturing from printing, this change 28909 introduces stacktrace_walker utility function. It can be used both for 28910 capturing in trace_syscall_entering and printing in 28911 trace_syscall_exiting. 28912 28913 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28914 28915 unwind: give all exported functions "unwind_" prefix. 28916 * unwind.c (init_unwind_addr_space): Rename to unwind_init. 28917 (init_libunwind_ui): Rename to unwind_tcb_init. 28918 (free_libunwind_ui): Rename to unwind_tcb_fin. 28919 (delete_mmap_cache): Rename to unwind_cache_invalidate. 28920 (print_stacktrace): Rename to unwind_print_stacktrace. 28921 * defs.h: Update prototypes. 28922 * mem.c: All callers updated. 28923 * process.c: Likewise. 28924 * strace.c: Likewise. 28925 * syscall.c: Likewise. 28926 28927 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28928 28929 unwind: delete mmap cache in free_libunwind_ui. 28930 free_libunwind_ui is expected to release all unwind related resources 28931 attached to tcp. 28932 28933 * strace.c (droptcb): Move delete_mmap_cache call ... 28934 * unwind.c (free_libunwind_ui): ... to here. 28935 28936 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 28937 28938 unwind: make alloc_mmap_cache function local. 28939 * defs.h (alloc_mmap_cache): Remove. 28940 * unwind.c (alloc_mmap_cache): Add static qualifier. 28941 28942 unwind: fix a bug in range updating of binary search. 28943 * unwind.c (print_stacktrace): Fix off-by-one error in binary search. 28944 28945 2014-05-30 Luca Clementi <luca.clementi (a] gmail.com> 28946 28947 Add -k option to print stack trace after each syscall. 28948 Print the stack trace of the traced process after each system call when 28949 -k option is specified. It is implemented using libunwind to unwind the 28950 stack and to obtain the function name pointed by the IP. 28951 28952 Based on the code that was originally taken from strace-plus 28953 of Philip J. Guo. 28954 28955 * configure.ac: Add --with-libunwind option. Check libunwind support. 28956 * Makefile.am: Add libunwind support. 28957 * defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields. 28958 [USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache, 28959 delete_mmap_cache, print_stacktrace): New prototypes. 28960 * mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support. 28961 * process.c (sys_execve): Likewise. 28962 * strace.c (usage, alloctcb, droptcb, init): Likewise. 28963 * syscall.c (trace_syscall_exiting): Likewise. 28964 * unwind.c: New file. 28965 * strace.1: Document -k option. 28966 28967 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 28968 28969 sysctl: update CTL_*, KERN_*, NET_*, and VM_* constants. 28970 * configure.ac (AC_CHECK_DECLS): Add CTL_*, KERN_*, NET_*, and 28971 VM_* constants. 28972 * system.c (CTL_PROC, CTL_CPU): Remove definitions. 28973 * xlat/sysctl_*.in: Update. 28974 28975 Check for constants used by waitid function. 28976 * configure.ac (AC_CHECK_DECLS): Add P_* constants. 28977 28978 Check for LO_FLAGS_READ_ONLY constant. 28979 * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_READ_ONLY. 28980 28981 Compress blank lines. 28982 Suppress empty lines left after automated xlat conversion. 28983 28984 xlat: cleanup the aftermath of automatic conversion. 28985 28986 Generate xlat/*.in files. 28987 Automatically convert xlat structures from *.c files to xlat/*.in files 28988 using "./generate_xlat_in.sh *.c" command. 28989 28990 Rename several xlat structures to avoid collisions. 28991 * bjm.c (which): Rename to qm_which. 28992 * ipc.c (msg_flags): Rename to ipc_msg_flags. 28993 * time.c (which): Rename to itimer_which. 28994 28995 Enhance xlat generator. 28996 * xlat/gen.sh: Define all xlat structs not declared in defs.h as static. 28997 Some symbolic constants are not macros, extend #ifdef check to cover 28998 symbolic constants checked by AC_CHECK_DECLS. 28999 Handle complex symbolic constants in SYMBOL|... form. 29000 Handle symbolic constants in 1<<SYMBOL form. 29001 Handle numeric constants. 29002 Implement #unconditional directive that turns off preprocessor checks. 29003 Implement #unterminated directive that turns off adding XLAT_END. 29004 29005 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 29006 29007 Use bootstrap script consistently. 29008 Now that ./xlat/gen.sh has to be run before autoreconf, 29009 replace all autoreconf calls with ./bootstrap call. 29010 29011 * bootstrap: Forward arguments to autoreconf. 29012 * build_static_example.sh: Replace autoreconf call with bootstrap call. 29013 * make-dist: Likewise. 29014 * qemu_multiarch_testing/README: Likewise. 29015 29016 2014-05-30 Mike Frysinger <vapier (a] gentoo.org> 29017 29018 Implement xlat generator. 29019 * bootstrap: New file. 29020 * xlat/gen.sh: Likewise. 29021 * Makefile.am: Include xlat/Makemodule.am 29022 (EXTRA_DIST): Add $(XLAT_INPUT_FILES), $(XLAT_HEADER_FILES), and 29023 xlat/gen.sh. 29024 29025 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 29026 29027 tests: fix SCM_RIGHTS test for big-endian systems. 29028 * tests/scm_rights.c (main): Send zero integer to avoid issues with 29029 endianness. 29030 * tests/scm_rights-fd.test: Update grep patterns. 29031 29032 Decode file descriptors passed via SCM_RIGHTS control messages. 29033 * net.c (printcmsghdr): Print descriptors from SCM_RIGHTS control 29034 messages using printfd. 29035 * tests/scm_rights.c: New file. 29036 * tests/scm_rights-fd.test: New test. 29037 * tests/Makefile.am (check_PROGRAMS): Add scm_rights. 29038 (TESTS): Add scm_rights-fd.test. 29039 * tests/.gitignore: Add scm_rights and uio. 29040 29041 tests: add a test for -c and -w options. 29042 * tests/count.test: New test. 29043 * tests/Makefile.am (TESTS): Add it. 29044 29045 2014-05-29 Mark Hills <Mark.Hills (a] framestore.com> 29046 29047 Optionally produce stats on syscall latency. 29048 Time spent in system time is not useful where a syscall depends on some 29049 non-CPU resource, eg. typically open() or stat() to a network drive. 29050 29051 This patch adds a new flag (-w) to produce a summary of the time 29052 difference between beginning and end of the system call (ie. latency) 29053 29054 This functionality has been useful to profile slow processes that 29055 are not CPU-bound. 29056 29057 2014-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 29058 29059 Constify count_syscall function. 29060 * count.c (count_syscall): Add const qualifier to timeval argument and 29061 rename it. Store the wall clock time spent while in syscall in separate 29062 timeval variable. 29063 * defs.h (count_syscall): Update prototype. 29064 * syscall.c (trace_syscall_exiting): Update count_syscall invocation. 29065 29066 Constify tv_* functions. 29067 * defs.h (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): Add 29068 const qualifier to read only arguments. 29069 * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): 29070 Likewise. 29071 29072 2014-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 29073 29074 Use printstr for sethostname, setdomainname, and gethostname decoding. 29075 The argument passed to sethostname and setdomainname syscalls, as well 29076 as the string returned by gethostname syscall, is not a pathname, so 29077 printpathn is not the right method for its decoding. 29078 29079 * process.c (sys_sethostname, sys_setdomainname): Decode 1st argument 29080 using printstr instead of printpathn. 29081 [ALPHA] (sys_gethostname): Likewise. 29082 29083 2014-05-21 James Hogan <james.hogan (a] imgtec.com> 29084 29085 Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_T. 29086 When strace is built with large file support definitions in CFLAGS (as 29087 may be provided by buildroot) the C library headers may expose a 64-bit 29088 rlim_t even though the struct rlimit fields used by the system call 29089 interface are only 32-bit. The SIZEOF_RLIM_T will then be 8 which 29090 results in bad decoding of the getrlimit and setrlimit syscalls. 29091 29092 This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with 29093 checks for current_wordsize. 29094 29095 2014-05-13 Masatake YAMATO <yamato (a] redhat.com> 29096 29097 Enhance setns syscall decoding. 29098 * process.c (sys_setns): New function. 29099 Decode the 2nd syscall argument using clone_flags. 29100 * linux/syscall.h (sys_setns): New prototype. 29101 * linux/dummy.h (sys_setns): Remove. 29102 29103 2014-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29104 29105 mips: fix syscall entries that should have TP flag set. 29106 29107 xtensa: fix unshare syscall entry. 29108 29109 alpha, hppa, mips n64: fix waitid syscall entry. 29110 29111 Add TM flag to shmat and shmdt syscall entries. 29112 29113 Alias sys_vfork to sys_fork. 29114 * process.c (sys_vfork): Remove. 29115 * linux/syscall.h (sys_vfork): Likewise. 29116 * linux/dummy.h (sys_vfork): Alias to sys_fork. 29117 * linux/alpha/syscallent.h: Fix vfork entry. 29118 * util.c (setbpt): Do not check for sys_vfork. 29119 * syscall.c (syscall_fixup_for_fork_exec): Likewise. 29120 29121 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 29122 29123 epoll_ctl: fix EPOLL_CTL_DEL argument decoding. 29124 * desc.c (sys_epoll_ctl): Do not parse the event structure for 29125 EPOLL_CTL_DEL operation. 29126 29127 Reported-by: <socketpair (a] gmail.com> 29128 29129 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 29130 29131 Update CLOCK_* constants. 29132 * time.c (clocknames): Add CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM, 29133 CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE, and CLOCK_TAI. 29134 Fixes RH#1088455. 29135 29136 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 29137 29138 Fix preadv/pwritev offset decoding. 29139 * util.c (printllval): Add align argument. 29140 * defs.h (printllval): Update prototype. 29141 (printllval_aligned, printllval_unaligned): New macros. 29142 * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, 29143 sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, 29144 sys_fallocate): Replace printllval call with printllval_aligned. 29145 * io.c (sys_pread, sys_pwrite): Likewise. 29146 (sys_preadv, sys_pwritev): Replace printllval call with 29147 printllval_unaligned. 29148 * linux/arm/syscallent.h: Set the number of preadv and pwritev 29149 arguments to 5. 29150 * linux/mips/syscallent-o32.h: Likewise. 29151 * linux/powerpc/syscallent.h: Likewise. 29152 * linux/sh/syscallent.h: Likewise. 29153 * linux/xtensa/syscallent.h: Likewise. 29154 29155 Reported-by: Dima Kogan <dima (a] secretsauce.net> 29156 29157 2014-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 29158 29159 tests: add a test for pread/pwrite and preadv/pwritev offset decoding. 29160 * tests/uio.c: New file. 29161 * tests/uio.test: New test. 29162 * tests/Makefile.am (check_PROGRAMS): Add uio. 29163 (uio_CFLAGS): Define. 29164 (TESTS): Add uio.test. 29165 29166 2014-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 29167 29168 Refactor LDT decoding. 29169 * configure.ac (AC_CHECK_TYPES): Remove struct user_desc. 29170 * ldt.c: New file. 29171 * Makefile.am (strace_SOURCES): Add ldt.c. 29172 * mem.c: Do not include <asm/ldt.h>. 29173 (print_ldt_entry): Remove. 29174 (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): Move... 29175 * ldt.c: ... here. 29176 * process.c: Do not include <asm/ldt.h>. 29177 (sys_clone) [I386 || X86_64 || X32]: Use print_user_desc. 29178 29179 2014-04-10 Denys Vlasenko <dvlasenk (a] redhat.com> 29180 29181 Make int3 example in comments more cut-n-pastable. 29182 I found that I use it quite often. Lets make it so that 29183 after cut-n-pasting it into a file, there is no need 29184 to edit the result (e.g. no need to remove C comment 29185 chars from every line. 29186 29187 2014-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 29188 29189 mips: enable decoding of set_thread_area. 29190 * linux/dummy.h [MIPS]: Do not redirect sys_set_thread_area to printargs. 29191 * mem.c [MIPS] (sys_set_thread_area): Define. 29192 29193 x86_64, x32: enable decoding of modify_ldt, get_thread_area, and set_thread_area 29194 * linux/dummy.h [X86_64 || X32]: Do not redirect sys_modify_ldt, 29195 sys_get_thread_area, and sys_set_thread_area to printargs. 29196 29197 x32: decode clone LDT user_desc entries for x86 processes. 29198 * mem.c [X32]: Include asm/ldt.h. 29199 [X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area, 29200 sys_get_thread_area): Define. 29201 * process.c [X32]: Include asm/ldt.h. 29202 (sys_clone) [X32]: Decode LDT entry if current_personality == 1. 29203 29204 2014-04-09 Elliott Hughes <enh (a] google.com> 29205 29206 x86-64: decode clone LDT user_desc entries for x86 processes. 29207 * mem.c [X86_64]: Include asm/ldt.h. 29208 [X86_64] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area, 29209 sys_get_thread_area): Define. 29210 * process.c [X86_64]: Include asm/ldt.h. 29211 (sys_clone) [X86_64]: Decode LDT entry if current_personality == 1. 29212 29213 2014-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 29214 29215 x32: fix clone(2) argument order for x86 processes. 29216 Apply the same fix that was made for x86_64. 29217 29218 * process.c [X32] (ARG_CTID, ARG_TLS): Take current 29219 personality into account. 29220 29221 2014-04-09 Elliott Hughes <enh (a] google.com> 29222 29223 x86-64: fix clone(2) argument order for x86 processes. 29224 Without this patch, strace claims that parent_tidptr == tls, which is 29225 clearly wrong. It is expected that parent_tidptr == child_tidptr. 29226 29227 * process.c [X86_64] (ARG_CTID, ARG_TLS): Take current 29228 personality into account. 29229 29230 2014-04-06 Elliott Hughes <enh (a] google.com> 29231 29232 aarch64: Fix decoding of arm struct stat64. 29233 We need to handle this situation more like x86-64. 32-bit arm and i386 29234 actually have a common struct stat64, except the arm one must not be 29235 packed. Additionally, on aarch64 the 32-bit personality is personality 0. 29236 29237 2014-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 29238 29239 ARM EABI: disable OABI support by default. 29240 OABI is rarely used in ARM EABI systems nowadays, so disable its support 29241 by default. Add --enable-arm-oabi option to enable ARM OABI support. 29242 29243 * configure.ac: New option --enable-arm-oabi. 29244 * syscall.c (get_scno) [ARM]: Check ENABLE_ARM_OABI macro defined by 29245 configure instead of undocumented STRACE_KNOWS_ONLY_EABI macro. 29246 29247 2014-03-12 Elliott Hughes <enh (a] google.com> 29248 29249 Fix stat decoding for LP64 bionic. 29250 Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with 29251 HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64. 29252 The workaround needed to be applied to all LP64 architectures, not 29253 just aarch64. This patch fixes that and adds an explanatory comment. 29254 29255 2014-03-11 Masatake YAMATO <yamato (a] redhat.com> 29256 29257 Decode protocol argument for PF_NETLINK sockets. 29258 * net.c (protocols): Rename to inet_protocols. 29259 [PF_NETLINK] (netlink_protocols): New xlat structure. 29260 (sys_socket): Rename protocols to inet_protocols. 29261 [PF_NETLINK]: Decode protocol argument using netlink_protocols. 29262 29263 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 29264 29265 2014-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 29266 29267 Cleanup socketpair decoding. 29268 The only supported domain for socketpair syscall is AF_UNIX, so 29269 no decoding related to other domains is required for socketpair. 29270 29271 * net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains, 29272 print the protocol argument as is. 29273 29274 2014-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 29275 29276 printsiginfo: add SIGSYS decoding. 29277 * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall. 29278 * signal.c (SYS_SECCOMP): Define if not yet defined. 29279 (sigsys_codes): new xlat structure. 29280 (printsiginfo): Decode SIGSYS. 29281 29282 Update siginfo codes. 29283 * signal.c (siginfo_codes): Add SI_DETHREAD. 29284 29285 Factor out printing of si_pid and si_uid members of siginfo_t. 29286 * signal.c (printsigsource): New function. 29287 (printsiginfo): Use it. 29288 29289 2014-03-10 Elliott Hughes <enh (a] google.com> 29290 29291 Improve SI_TIMER decoding. 29292 Decode siginfo_t more clearly for si_code SI_TIMER. 29293 The 'pid' is actually a POSIX timer id, and the 'uid' is actually the 29294 overrun. 29295 Also factor out the si_value dumping so it's the same for every si_code. 29296 29297 2014-03-03 Elliott Hughes <enh (a] google.com> 29298 29299 aarch64: fix decoding of arm syscall numbers. 29300 If an aarch64 strace is tracing a process using the arm personality, it 29301 also needs to call the shuffle_scno function for the ARM-specific 29302 syscalls. 29303 29304 * syscall.c (shuffle_scno): Define on AARCH64. 29305 (get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode. 29306 29307 2014-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 29308 29309 Fix fcntl decoding. 29310 Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined or 29311 not defined altogether. 29312 Do not assume that sizeof(off_t) < sizeof(long long) when F_SETLK64 is 29313 undefined. 29314 29315 This change fixes build with musl libc on x86. 29316 29317 * configure.ac: Define SIZEOF_OFF_T. 29318 * desc.c (USE_PRINTFLOCK64): New macro. 29319 (struct flock64, printflock64): Do not define on X32. 29320 (printflock): Replace X32 specific workaround with SIZEOF_OFF_T check. 29321 Fix printing off_t members of struct flock. 29322 (sys_fcntl): Use USE_PRINTFLOCK64. 29323 29324 2014-03-01 Dmitry V. Levin <ldv (a] altlinux.org> 29325 29326 sys_fcntl: remove F_FREESP and F_FREESP64 support. 29327 F_FREESP and F_FREESP64 fcntl commands are not available in Linux 29328 and therefore the code implementing their decoding is useless. 29329 Besides that, F_FREESP64 decoding is too complicated to support. 29330 29331 * desc.c (fcntlcmds): Remove F_FREESP and F_FREESP64. 29332 Remove F_FREESP64 from the check whether to define struct flock64. 29333 (sys_fcntl): Remove F_FREESP and F_FREESP64 support. 29334 29335 2014-02-28 Elliott Hughes <enh (a] google.com> 29336 29337 Add multi-personality support to struct old_sigaction decoding. 29338 struct sigaction is another structure that contains members 29339 whose size differs between 32-bit and 64-bit personalities. 29340 29341 * signal.c [HAVE_SIGACTION] (old_sigaction32): New structure. 29342 [HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct 29343 old_sigaction on a 64-bit host. 29344 29345 2014-02-28 Elliott Hughes <enh (a] google.com> 29346 29347 Fix decoding of arm struct stat64 by aarch64 strace. 29348 aarch64's uapi header files have a struct stat but no struct stat64. 29349 To correctly decode a 32-bit process' s struct stat64 we need 29350 HAVE_STAT64, but then the build fails because there is no struct stat64. 29351 Luckily, the aarch64 struct stat is structurally equivalent to the arm 29352 struct stat64, so we can just reuse that. 29353 29354 * file.c [AARCH64] (stat64): Define to stat. 29355 29356 2014-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 29357 29358 Remove obsolete ioctlsort.c. 29359 The generic version of ioctlsort.c became obsolete after commit 29360 v4.6-240-g5afdf12 that removed its last non-Linux users. 29361 29362 * ioctlsort.c: Remove. 29363 * Makefile.am (EXTRA_DIST): Remove ioctlsort.c. 29364 29365 Reported-by: Elliott Hughes <enh (a] google.com> 29366 29367 2014-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 29368 29369 Add multi-personality support to stack_t decoding. 29370 stack_t is one of many structures that contain members 29371 whose size differs between 32-bit and 64-bit personalities. 29372 29373 * signal.c (print_stack_t): Decode 32-bit stack_t on a 64-bit host. 29374 29375 Reported-by: Elliott Hughes <enh (a] google.com> 29376 29377 2014-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 29378 29379 Rewrite signal mask decoding without sigset_t. 29380 The sigset_t provided by libc is not quite convenient. 29381 In glibc, sigset_t is an array with space for 1024 bits, which is much 29382 more than required: all architectures supported by Linux have only 64 29383 signals except MIPS, which has 128. 29384 In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than 29385 necessary. 29386 29387 With this change, signal mask is decoded without use of intermediate 29388 sigset_t structure, which saves us some cpu cycles in case of glibc with 29389 its inflated sigset_t, and enables build with libcs where sigset_t is 29390 broken. 29391 29392 Old implementation used to check each signal number in the given signal 29393 mask twice using sigismember(). 29394 New implementation is based on popcount and next_set_bit() so it's 29395 noticeably faster. 29396 29397 * configure.ac: Check for __builtin_popcount. 29398 * signal.c: Ensure that NSIG >= 32. 29399 (sprintsigmask, sprintsigmask_long, printsigmask): Remove. 29400 (popcount32, sprintsigmask_n): New functions. 29401 (tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros. 29402 (print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask, 29403 sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use 29404 new signal mask decoding interface. 29405 * tests/sigaction.c (main): Add a test with almost filled signal mask. 29406 * tests/sigaction.awk: Update. 29407 29408 2014-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 29409 29410 Fix build with Bionic libc. 29411 Add generic tests for fopen64 and fputs_unlocked functions to fix build 29412 with Bionic libc that does not provide them. 29413 29414 * configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked. 29415 * strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64 29416 if !HAVE_FOPEN64. 29417 Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED. 29418 * vsprintf.c: Use fputs instead of fputs_unlocked 29419 if !HAVE_FPUTS_UNLOCKED. 29420 29421 Reported-by: Elliott Hughes <enh (a] google.com> 29422 29423 2014-02-25 James Yang <james.yang (a] freescale.com> 29424 29425 powerpc64: fix 64-bit process detection on embedded. 29426 * syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection 29427 on embedded powerpc. 29428 29429 2014-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 29430 29431 Do not compile scsi ioctl decoding if <scsi/sg.h> is not available. 29432 Add a generic test for <scsi/sg.h> availability to fix build with 29433 Bionic libc that does not provide <scsi/sg.h>. 29434 29435 * configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h. 29436 * ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H. 29437 * scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H. 29438 29439 Reported-by: Elliott Hughes <enh (a] google.com> 29440 29441 2014-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 29442 29443 Revert "Add support for Altera's Nios-II softcore architecture" 29444 The patch originally submitted by Ezequiel Garca was OK, but I somehow 29445 managed to mangle it so that most of the patch was not applied. 29446 29447 According to Ezequiel Garca, an architecture port based on the generic 29448 syscall ABI is in progress. 29449 29450 This reverts commit 61e426e87ac81be4b4ff9de581635b4ea585624f. 29451 29452 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 29453 29454 tests: tighten sigaction check. 29455 * tests/sigaction.awk: Check that input conatins all expected lines. 29456 29457 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 29458 29459 Fix sigaction reporting on non-x86 architectures. 29460 If SA_RESTORER is not defined by libc headers but defined by kernel 29461 headers, use the definition provided by kernel headers for proper 29462 sigaction decoding. 29463 29464 * signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is 29465 defined, regardless of architecure. 29466 29467 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 29468 29469 Check for SA_RESTORER definition in <asm/signal.h> 29470 Kernel header <asm/signal.h> cannot be included from regular code 29471 because it conflicts with libc headers, but SA_RESTORER is needed in 29472 signal.c, so SA_RESTORER value is forwarded from <asm/signal.h> to 29473 config.h using a configure check. 29474 29475 * configure.ac (ASM_SA_RESTORER): Define if SA_RESTORER is defined 29476 in <asm/signal.h>. 29477 29478 2014-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 29479 29480 arm: fix compilation warning. 29481 Fix "dereferencing type-punned pointer will break strict-aliasing rules" 29482 warning introduced by commit v4.8-54-g670b21b. 29483 29484 * signal.c (sys_sigreturn) [ARM]: Avoid dereferencing type-punned pointers. 29485 29486 2014-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 29487 29488 kexec: fix typo. 29489 * kexec.c (print_kexec_segments) [SUPPORTED_PERSONALITIES == 1]: Fix typo. 29490 29491 2014-02-06 Ezequiel Garcia <ezequiel (a] vanguardiasur.com.ar> 29492 29493 Add support for Altera's Nios-II softcore architecture. 29494 This commit adds strace support for Altera's Nios-II official 29495 kernel port as found in git://git.rocketboards.org/linux-socfpga.git 29496 29497 Notice that this an out-of-tree kernel architectural port, and uses the 29498 legacy (non-generic) system call ABI. In particular, the port doesn't 29499 support PTRACE_GETREGSET, so the implementation is based on PTRACE_GETREGS. 29500 29501 Given it's mandatory for new architectures to support the generic 29502 syscall ABI and PTRACE_GETREGSET, if the nios2 architecure is ever 29503 mainlined, the strace support will have to be re-factored accordingly. 29504 29505 * linux/nios2/ioctlent.h.in: New file. 29506 * linux/nios2/syscallent.h: Likewise. 29507 * Makefile.am (EXTRA_DIST): Add linux/nios2/ioctlent.h.in and 29508 linux/nios2/syscallent.h. 29509 * configure.ac: Add NIOS2 to the list of supported architectures. 29510 * defs.h [NIOS2]: Use register reading system. 29511 * process.c (struct_user_offsets): Add NIOS2 support. 29512 * syscall.c (get_regs, get_scno, get_syscall_args, 29513 get_syscall_result, get_error): Likewise. 29514 * util.c (change_syscall): Likewise. 29515 * mem.c (sys_getpagesize): Define on NIOS2. 29516 * system.c [NIOS2] (sys_cacheflush, sys_nios2cmpxchg): New functions. 29517 29518 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 29519 29520 2014-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 29521 29522 Implement add_key, keyctl, and request_key decoding. 29523 * keyctl.c: New file. 29524 * linux/keyctl.h: Likewise. 29525 * Makefile.am (strace_SOURCES): Add keyctl.c. 29526 (EXTRA_DIST): Add linux/keyctl.h. 29527 * linux/dummy.h (sys_add_key, sys_keyctl, sys_request_key): Remove. 29528 * linux/syscall.h (sys_add_key, sys_keyctl, sys_request_key): New 29529 prototypes. 29530 29531 Implement ioprio_get and ioprio_set decoding. 29532 * ioprio.c: New file. 29533 * Makefile.am (strace_SOURCES): Add ioprio.c. 29534 * linux/dummy.h (sys_ioprio_get, sys_ioprio_set): Remove. 29535 * linux/syscall.h (sys_ioprio_get, sys_ioprio_set): New prototypes. 29536 29537 Implement finit_module decoding. 29538 * bjm.c (module_init_flags): New xlat structure. 29539 (sys_finit_module): New function. 29540 * linux/dummy.h (sys_finit_module): Remove. 29541 * linux/syscall.h (sys_finit_module): New prototype. 29542 29543 Cleanup inotify syscalls decoding. 29544 * linux/inotify.h: New file. 29545 * file.c (inotify_modes, inotify_init_flags, sys_inotify_add_watch, 29546 sys_inotify_rm_watch, sys_inotify_init1): Move... 29547 * inotify.c: ... here. 29548 (inotify_modes): Rename to inotify_flags, convert to XLAT form. 29549 (inotify_init_flags): Convert to XLAT form. 29550 * Makefile.am (strace_SOURCES): Add inotify.c. 29551 (EXTRA_DIST): Add linux/inotify.h. 29552 29553 Enhance reboot decoding. 29554 * linux/reboot.h: New file. 29555 * system.c (bootflags1, bootflags2, bootflags3, sys_reboot): Move... 29556 * reboot.c: ... here. 29557 (bootflags2, bootflags3): Update constants. 29558 * Makefile.am (strace_SOURCES): Add reboot.c. 29559 (EXTRA_DIST): Add linux/reboot.h. 29560 29561 Implement kexec_load decoding. 29562 * kexec.c: New file. 29563 * linux/kexec.h: Likewise. 29564 * Makefile.am (strace_SOURCES): Add kexec.c. 29565 (EXTRA_DIST): Add linux/kexec.h. 29566 * linux/dummy.h (sys_kexec_load): Remove. 29567 * linux/syscall.h (sys_kexec_load): New prototype. 29568 29569 Use prepared editions of recently imported linux headers. 29570 * linux/fanotify.h: Replace with edition prepared with headers_install.sh. 29571 * linux/personality.h: Likewise. 29572 29573 Implement fanotify_init and fanotify_mark decoding. 29574 * fanotify.c: New file. 29575 * linux/fanotify.h: Likewise. 29576 * Makefile.am (strace_SOURCES): Add fanotify.c. 29577 (EXTRA_DIST): Add linux/fanotify.h. 29578 * defs.h (print_dirfd): New prototype. 29579 * file.c (print_dirfd): Export. 29580 * linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove. 29581 * linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New 29582 prototypes. 29583 * pathtrace.c (pathtrace_match): Handle sys_fanotify_init and 29584 sys_fanotify_mark. 29585 29586 Use XLAT_END macro. 29587 Automatically update all xlat structures using the following sed regexp: 29588 s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/ 29589 29590 Itroduce XLAT_END macro to make xlat structures more compact. 29591 * defs.h (XLAT_END): New macro. 29592 29593 Convert personality_options to XLAT form. 29594 * linux/personality.h: New file. 29595 * Makefile.am (EXTRA_DIST): Add it. 29596 * system.c: Include <linux/personality.h>. 29597 (personality_options): Update PER_* constants, convert to XLAT form. 29598 29599 Convert futexops to XLAT form. 29600 * process.c: Define FUTEX_*_PRIVATE macros. 29601 (futexops): Convert to XLAT form. 29602 29603 Convert sigev_value to XLAT form. 29604 * time.c (sigev_value): Convert to XLAT form. 29605 (printsigevent32, printsigevent): Update use of sigev_value. 29606 29607 Use XLAT macro. 29608 Automatically convert all xlat structures to XLAT form 29609 using the following sed regexp: 29610 s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/ 29611 29612 2014-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 29613 29614 Introduce XLAT macro to ease maintenance of xlat structures. 29615 * defs.h (XLAT): New macro. 29616 29617 Suggested-by: Mike Frysinger <vapier (a] gentoo.org> 29618 29619 2014-02-04 Stefan Srensen <stefan.sorensen (a] spectralink.com> 29620 29621 Decode ptp ioctls. 29622 * defs.h (ptp_ioctl): New prototype. 29623 * ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='. 29624 * Makefile.am (strace_SOURCES): Add ptp.c. 29625 (EXTRA_DIST): Add linux/ptp_clock.h. 29626 * ptp.c: New file. 29627 * linux/ptp_clock.h: New file. 29628 29629 2014-02-03 Stefan Srensen <stefan.sorensen (a] spectralink.com> 29630 29631 Decode dynamic posix clocks. 29632 * time.c (cpuclocknames): New xlat structure. 29633 (printclockname): New function that decodes posix clock names, 29634 including dynamic fd encoded clocks. 29635 (sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep, 29636 sys_clock_adjtime, sys_timer_create, sys_timerfd, sys_timerfd_create): 29637 Use it. 29638 29639 Update ADJ_* constants. 29640 * time.c (adjtimex_modes): Add ADJ_TAI, ADJ_SETOFFSET, ADJ_MICRO, 29641 ADJ_NANO, ADJ_OFFSET_SS_READ. 29642 29643 2014-02-02 Philippe Ombredanne <pombredanne (a] nexb.com> 29644 29645 Add decoding of sockets descriptor 'paths' for network calls. 29646 * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto, 29647 sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg, 29648 sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode 29649 socket descriptor arguments using printfd. 29650 * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls 29651 that take socket descriptor arguments. 29652 * tests/net-fd.test: New test for socket descriptor arguments decoding. 29653 * tests/Makefile.am (TESTS): Add net-fd.test. 29654 (net-fd.log): New dependency on net.log. 29655 29656 2014-02-02 Dmitry V. Levin <ldv (a] altlinux.org> 29657 29658 tests: rename all tests so that their names end in .test suffix. 29659 Due to automake limitations, some features work only for tests 29660 that end in one of the suffixes listed in TEST_EXTENSIONS. 29661 29662 * tests/detach-running: Rename to detach-running.test. 29663 * tests/detach-sleeping: Rename to detach-sleeping.test. 29664 * tests/detach-stopped: Rename to detach-stopped.test. 29665 * tests/net: Rename to net.test. 29666 * tests/ptrace_setoptions: Rename to ptrace_setoptions.test. 29667 * tests/qual_syscall: Rename to qual_syscall.test. 29668 * tests/sigaction.sh: Rename to sigaction.test. 29669 * tests/stat: Rename to stat.test. 29670 * tests/strace-f: Rename to strace-f.test. 29671 * tests/Makefile.am (TESTS): Update. 29672 (LOG_COMPILER): Rename to TEST_LOG_COMPILER. 29673 29674 2014-01-31 Mike Frysinger <vapier (a] gentoo.org> 29675 29676 net: add more sockopt options. 29677 This syncs with the defines as available in linux-3.13. 29678 29679 * net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY, 29680 IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR, 29681 IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE, 29682 IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP, 29683 MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, 29684 MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL, 29685 IP_UNICAST_IF. 29686 29687 2014-01-08 Chris Dearman <chris.dearman (a] imgtec.com> 29688 29689 mips: fix sigaction reporting. 29690 MIPS userland uses the same sigaction structure with a full signal 29691 mask for old_sigaction and new_sigaction and does does not have 29692 an sa_restorer field. 29693 29694 These changes have been tested on MIPS O32 big/little endian, MIPS N64 29695 big endian and x86-64. 29696 29697 * signal.c (old_sigaction) [MIPS]: Add definition for MIPS. 29698 (decode_old_sigaction) [MIPS]: Print sa_mask according to its definition. 29699 (new_sigaction) [MIPS]: Add definition for MIPS. 29700 29701 2014-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 29702 29703 Factor out struct sigaction printing code. 29704 * signal.c [HAVE_SIGACTION] (decode_old_sigaction): New function. 29705 [HAVE_SIGACTION] (sys_sigaction): Use it. 29706 (decode_new_sigaction): New function. 29707 (sys_rt_sigaction): Use it. 29708 29709 2014-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 29710 29711 tests: add a test for rt_sigaction output. 29712 Since "struct sigaction" varies between architectures, rt_sigaction 29713 decoding sometimes produces incorrect output. This test is expected 29714 to catch basic rt_sigaction decoding bugs. 29715 29716 Based on a patch proposed by Chris Dearman. 29717 29718 * tests/sigaction.c: New file. 29719 * tests/sigaction.awk: Likewise. 29720 * tests/sigaction.sh: New test. 29721 * tests/Makefile.am (check_PROGRAMS): Add sigaction. 29722 (TESTS): Add sigaction.sh. 29723 (EXTRA_DIST): Add sigaction.awk. 29724 * tests/.gitignore: Add sigaction. 29725 29726 2014-01-05 Kirill A. Shutemov <kirill.shutemov (a] linux.intel.com> 29727 29728 mem: add missed MAP_HUGETLB mmap flag. 29729 * mem.c (mmap_flags): Add MAP_HUGETLB mmap flag. 29730 29731 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 29732 29733 2013-12-31 Mike Frysinger <vapier (a] gentoo.org> 29734 29735 Delete old PTRACE_{PEEK,POKE}USR logic. 29736 The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has 29737 logic in defs.h to make sure it's set sanely. Delete this old logic as 29738 the defs.h takes care of it now. 29739 29740 * process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines. 29741 * signal.c: Likewise. 29742 * syscall.c: Delete PTRACE_PEEKUSR define. 29743 * util.c: Likewise. 29744 29745 2013-12-31 Mike Frysinger <vapier (a] gentoo.org> 29746 29747 Decode the O_PATH flag. 29748 * file.c (open_mode_flags): Add O_PATH. 29749 29750 2013-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 29751 29752 Remove unused configure checks. 29753 * configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist. 29754 (AC_CHECK_DECLS): Likewise. 29755 29756 2013-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 29757 29758 Assume that <sys/ptrace.h> provides a valid ptrace prototype. 29759 We used to explicitly list architectures where <sys/ptrace.h> from glibc 29760 is known to provide a valid prototype for ptrace, and use a homegrown 29761 replacement for all the rest. Situation seems to be better nowadays, 29762 glibc is not the only libc available, so let's use ptrace prototype from 29763 <sys/ptrace.h> by default, leaving the replacement for rare broken cases 29764 if any. 29765 29766 * defs.h: Use ptrace prototype workaround iff 29767 NEED_PTRACE_PROTOTYPE_WORKAROUND is defined. 29768 29769 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29770 29771 Stop using _LFS64_LARGEFILE. 29772 There is only one place left in the code where strace guesses whether 29773 libc provides LFS64 functions and structures. The most natural thing to 29774 do there is to check for _LARGEFILE64_SOURCE - the macro provided by 29775 glibc. Other libc implementations that provide nondegenerate LFS64 29776 interfaces are expected to define this macro as well. 29777 29778 * defs.h (_LFS64_LARGEFILE): Remove. 29779 * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE. 29780 29781 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29782 29783 Define truncate64, ftruncate64, and getdents64 decoders unconditionally. 29784 These decoders are referenced by most architectures, there were no 29785 undefined references so far because _LFS64_LARGEFILE appears to be 29786 always defined by glibc when _GNU_SOURCE is defined. 29787 29788 * file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define 29789 unconditionally. 29790 29791 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29792 29793 Define printflock64 only if it is referenced by other code. 29794 * configure.ac (AC_CHECK_TYPES): Add struct flock64. 29795 * desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros. 29796 [!HAVE_STRUCT_FLOCK64] (struct flock64): Define. 29797 (printflock64): Define only if referenced by other code. 29798 (sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff 29799 these constants are defined and differ from their non-64bit versions. 29800 29801 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29802 29803 Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific. 29804 * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and 29805 PTRACE_POKEUSER. 29806 * defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if 29807 they are not provided by <sys/ptrace.h>. 29808 29809 Reported by John Spencer. 29810 29811 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29812 29813 Remove unneeded redefinitions of IPPROTO_* macros. 29814 IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine 29815 them. 29816 29817 * net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP, 29818 IPPROTO_RAW, IPPROTO_MAX): Remove. 29819 29820 Reported by John Spencer. 29821 29822 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29823 29824 Remove unused AC_OFF_T_IS_LONG_LONG configure check. 29825 * configure.ac: Remove AC_OFF_T_IS_LONG_LONG. 29826 * m4/long_long.m4: Likewise. 29827 29828 Remove unused code. 29829 * configure.ac (AC_CHECK_TYPES): Remove struct opthdr and 29830 struct t_opthdr. 29831 * net.c (print_sock_optmgmt): Remove. 29832 29833 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29834 29835 Use struct sigcontext instead of struct sigcontext_struct. 29836 * configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct. 29837 * signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace 29838 struct sigcontext_struct with struct sigcontext. 29839 29840 Reported by John Spencer. 29841 29842 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29843 29844 Use standard names of sched_param structure members. 29845 * process.c (sys_sched_setscheduler, sys_sched_getparam, 29846 sys_sched_setparam): Use portable struct sched_param member name 29847 sched_priority instead of glibc specific __sched_priority. 29848 29849 Reported by John Spencer. 29850 29851 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 29852 29853 Make SIGEV_THREAD_ID decoding less glibc specific. 29854 SIGEV_THREAD_ID decoding requires access to an internal member of 29855 struct sigevent. There seems to be no portable way to do it besides 29856 adding a configure check. 29857 29858 * configure.ac (AC_CHECK_MEMBERS): Check for 29859 struct sigevent._sigev_un._pad and struct sigevent.__pad. 29860 * time.c (printsigevent): Use an appropriate struct sigevent member 29861 to print thread id. 29862 29863 Reported by John Spencer. 29864 29865 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 29866 29867 Remove unused configure checks. 29868 * configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr, 29869 T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2. 29870 29871 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 29872 29873 Assume "long long" availability. 29874 Most of the code already uses long long types unconditionally. 29875 29876 * configure.ac: Remove the check for long long. 29877 * file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format 29878 string unconditionally. 29879 29880 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 29881 29882 Include <sys/poll.h> only if there is no <poll.h> 29883 * pathtrace.c: Do not include <sys/poll.h> if <poll.h> is available. 29884 * stream.c: Likewise. 29885 29886 Move io_* syscalls decoding to a separate file. 29887 * desc.c (sys_io_setup, sys_io_destroy, sys_io_submit, sys_io_cancel, 29888 sys_io_getevents, declarations from libaio.h): Move to ... 29889 * aio.c: new file. 29890 * Makefile.am (strace_SOURCES): Add aio.c. 29891 29892 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 29893 29894 Stop using external libaio.h. 29895 This change incorporates a partial copy instead 29896 of using external libaio.h. 29897 Why? 29898 Because we want to properly decode 32-bit aio calls 29899 by 64-bit strace. For that, we need more definitions than 29900 libaio.h provides. 29901 (These defs are not done yet, but will eventually be done). 29902 Keeping our local 32-bit compat defs in sync with libaio.h 29903 _without seeing libaio structs_ is hard/more bug prone. 29904 A smaller benefit is that we don't need libaio installed. 29905 29906 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 29907 29908 sys_io_submit: simplify iocb_cmd_lookup() helper. 29909 This helper returns two values (a string and an enum). 29910 The caller prints the string. It's simpler to just print 29911 the string in the caller itself. This eliminates 29912 "return by reference" and more importantly, an intermediate 29913 static string buffer for the string result. 29914 29915 Since function of the helper is different now, 29916 it is renamed to tprint_lio_opcode(). 29917 29918 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 29919 29920 sys_io_submit: stop traversing iocb vector after first failure. 29921 The program may use a very large nr but supply either outright 29922 invalid iocbpp[], or one with far fewer elements than nr. 29923 We used to try reading iocbpp[i] until i == nr. 29924 With this change, we stop on the first failure. 29925 29926 2013-11-09 Denys Vlasenko <dvlasenk (a] redhat.com> 29927 29928 Fix pathtrace_match() to match recent fixes to select decoding. 29929 29930 Fix select decoding on e.g. 32-bit ppc process by 64-bit strace. 29931 Added next_set_bit() function which finds the next set bit, 29932 properly taking into account word size of the traced process. 29933 Use it in decode_select() instead of fd_isset(). 29934 Also, properly round fdsize up to word size of traced process, 29935 not to strace's word size. 29936 29937 2013-11-06 Denys Vlasenko <dvlasenk (a] redhat.com> 29938 29939 Speed up and explain fd_isset() 29940 29941 2013-11-05 Dr. David Alan Gilbert <dave (a] treblig.org> 29942 29943 Add a test for the latest select decoding fix. 29944 * test/select.c (main): Add a test for nfds larger than FD_SETSIZE. 29945 29946 2013-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 29947 29948 Fix select decoding for glibc in _FORTIFY_SOURCE mode. 29949 glibc in _FORTIFY_SOURCE mode raises SIGABRT when descriptor greater 29950 or equal to FD_SETSIZE is passed to FD_ISSET. Select family syscalls, 29951 however, can legitimately accept such descriptors. To overcome this 29952 limitation, we have to replace FD_ISSET with an equivalent that imposes 29953 no such restrictions. 29954 29955 * desc.c (fd_isset): New function. 29956 (decode_select): Use it instead of FD_ISSET. 29957 29958 2013-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 29959 29960 More select decoding fixes. 29961 * desc.c (decode_select): Actually print arg[0] as int on entering 29962 syscall. When arg[0] is negative, do not attempt to fetch and decode 29963 descriptor sets on entering syscall, kernel will reject it anyway. 29964 On exiting syscall, stop checking descriptor sets as soon as all 29965 returned descriptors are found. 29966 29967 2013-11-05 Denys Vlasenko <dvlasenk (a] redhat.com> 29968 29969 Truncate arg[0] to int in select decoding. 29970 This matches kernel's behavior. 29971 29972 test/select.c: make comment more understandable. 29973 29974 2013-11-05 Dr. David Alan Gilbert <dave (a] treblig.org> 29975 29976 Fix select decoding with bogus (huge or negative) nfds. 29977 We used to allocate and fetch bit arrays using a sanitized 29978 length, but then iterate over them with "j < arg[0]" condition, 29979 where arg[0] is not sanitized. This segfaults if arg[0] is huge 29980 or negative. This change fixes this. 29981 29982 Add test/select.c to capture the case. 29983 29984 2013-09-26 Ali Polatel <alip (a] exherbo.org> 29985 29986 Work around conflict between <sys/ptrace.h> and <linux/ptrace.h> 29987 Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args 29988 which collides with <linux/ptrace.h>. 29989 29990 * configure.ac: Check for `struct ptrace_peeksiginfo_args' in 29991 <sys/ptrace.h>. 29992 * process.c: Work around potential conflict between <sys/ptrace.h> 29993 and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args. 29994 * signal.c: Likewise. 29995 * syscall.c: Likewise. 29996 * util.c: Likewise. 29997 29998 2013-09-11 Vineet Gupta <Vineet.Gupta1 (a] synopsys.com> 29999 30000 Add support for ARC Cores from Synopsys. 30001 Take #2 on mainlining strace support for ARC (last one was 4.6 based back 30002 in March 2011), see 30003 http://sourceforge.net/p/strace/mailman/message/27210168/ 30004 30005 The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls), 30006 hence very similar to metag port. 30007 30008 test/* all seem to work well. 30009 30010 * linux/arc/ioctlent.h.in: New file. 30011 * linux/arc/syscallent.h: Likewise. 30012 * Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and 30013 linux/arc/syscallent.h. 30014 * configure.ac: Add ARC to the list of supported architectures. 30015 * defs.h: Add ARC support. 30016 * process.c (struct_user_offsets): Likewise. 30017 * signal.c (sys_sigreturn): Likewise. 30018 * syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args, 30019 get_syscall_result, get_error): Likewise. 30020 * util.c (change_syscall): Likewise. 30021 30022 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 30023 30024 2013-09-11 William Manley <william.manley (a] youview.com> 30025 30026 Add support for decoding sync_file_range. 30027 * file.c (sync_file_range_flags): New xlat structure. 30028 (sys_sync_file_range, sys_sync_file_range2): New functions. 30029 * linux/syscall.h (sys_sync_file_range, sys_sync_file_range2): New 30030 prototypes. 30031 * linux/dummy.h (sys_sync_file_range, sys_sync_file_range2): Remove. 30032 * linux/mips/syscallent-o32.h: Set the number of sync_file_range 30033 arguments to 7. 30034 30035 2013-09-11 Mike Frysinger <vapier (a] gentoo.org> 30036 30037 fanotify_mark: fix number of args for 32bit arches. 30038 The fanotify_mark func takes a 64bit mask, so 32bit arches have to split 30039 it up into two fields. When the syscall was added, it was listed as only 30040 having 5 fields total (since that's correct for 64bit systems). 30041 30042 * linux/arm/syscallent.h: Set the number of fanotify_mark arguments to 6. 30043 * linux/bfin/syscallent.h: Likewise. 30044 * linux/hppa/syscallent.h: Likewise. 30045 * linux/i386/syscallent.h: Likewise. 30046 * linux/m68k/syscallent.h: Likewise. 30047 * linux/metag/syscallent.h: Likewise. 30048 * linux/microblaze/syscallent.h: Likewise. 30049 * linux/mips/syscallent-o32.h: Likewise. 30050 * linux/or1k/syscallent.h: Likewise. 30051 * linux/powerpc/syscallent.h: Likewise. 30052 * linux/s390/syscallent.h: Likewise. 30053 * linux/sh/syscallent.h: Likewise. 30054 * linux/sparc/syscallent.h: Likewise. 30055 * linux/tile/syscallent1.h: Likewise. 30056 30057 Acked-by: Chris Metcalf <cmetcalf (a] tilera.com> [for tile] 30058 30059 2013-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 30060 30061 x86, x86_64: fix compilation warnings. 30062 Fix "dereferencing type-punned pointer will break strict-aliasing rules" 30063 warnings introduced by commit v4.8-52-gb51f364. 30064 30065 * signal.c (sys_sigreturn): Avoid dereferencing type-punned pointers. 30066 30067 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30068 30069 Remove rt parameter from [s]printsigmask() 30070 In almost all cases, the parameter was 1 ("decode RT sigs too"). 30071 This change hardwires it to be 1. 30072 30073 The cases where it was 0 are, and why the change to "decode RT sigs too" 30074 is fine: 30075 30076 IA64: 64-bit arch, all 64 signals fit in one word in any case. 30077 S390[x]: sc.oldmask is a sigset_t on kernel side, 30078 (sigset_t *)&sc.oldmask[0] does contain all 64 signals. 30079 TILE: uc.uc_sigmask is a sigset_t on kernel side, 30080 memcpy(&sigm, &uc.uc_sigmask, NSIG / 8) copies all 64 signals. 30081 30082 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30083 30084 Convert some uses of long_to_sigmask+printsigmask to sprintsigmask_long. 30085 This allows to drop long_to_sigmask function, 30086 and a whole bunch of sigset_t variables. 30087 30088 Simplify some sigmask manipulations. 30089 30090 Add compat support for sys_pselect6. 30091 30092 I386: fix signedness mismatch warning. 30093 &i386_regs.esp is a pointer to long, not unsigned long. 30094 It needs a cast. 30095 30096 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30097 30098 Fix sigset printing via print_sigset(). 30099 Replace print_sigset() with print_sigset_addr_len(), 30100 which takes not only addr, but also len parameter. 30101 This allows us to drop "do we need to print RT signals?" parameter, 30102 and this fixes RT signals printing in many syscalls. 30103 30104 sys_epoll_pwait: print RT signals too, print sigmask size argument. 30105 30106 sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize), 30107 no change in functionality. 30108 30109 sys_sigpending: use print_sigset_addr_len(current_wordsize) 30110 instead of open-coding it. 30111 30112 sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it. 30113 sys_rt_sigpending: ditto. 30114 sys_rt_sigsuspend: ditto. 30115 sys_rt_sigtimedwait: ditto. 30116 30117 do_signalfd: print_sigset -> print_sigset_addr_len. This fixes 30118 RT signals printing (wasn't showing them before). 30119 30120 sys_ppoll: ditto. 30121 30122 copy_sigset_len() is folded into its only user, print_sigset_addr_len(), 30123 and copy_sigset() is gone. 30124 30125 While at it, checked kernel sources and noted where kernel enforces 30126 sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)), 30127 and where it allows word-sized sigset_size ([rt_]sigpending). 30128 30129 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30130 30131 sys_rt_sigaction: fix sigset copying. 30132 In practice, we always copy as many bytes as syscall param says 30133 (8, or 16 on mips). However, malicious program can call sigaction 30134 with wrong sigset size. Such syscall will result in EINVAL, 30135 but we (strace) end up copying 128 bytes (sizeof(sigset_t)), 30136 which copyes some garbage from stack after struct sigaction. 30137 30138 Now we always copy NSIG / 8 bytes (which is 8 bytes, or 16 on mips). 30139 30140 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30141 30142 ARM: remove wrong NSIG = 32 define. 30143 ARM in fact has 64 signals (1..64), and NSIG should be 65 30144 (as usual, rememebr that NSIG_libc == NSIG_kernel+1). 30145 30146 I carefully reviewed all usages of NSIG. In syscall.c, 30147 the only usage is: 30148 for (i = 0; i <= NSIG; i++) 30149 if (strcasecmp(s, signame(i) + 3) == 0)... 30150 which is safe even if NSIG is way too big - signame(i) 30151 returns a well-formed string for any i. 30152 30153 In signal.c, memcpy(&sigset, &sc.sc_mask, NSIG / 8) is used by 30154 IA64 and TILE code, so ARM change can't affect it. And final 30155 usage is: 30156 struct new_sigaction::unsigned long sa_mask[NSIG / sizeof(long)]; 30157 It will grow on ARM (and become correct in the process). 30158 Its only use is 30159 memcpy(&sigset, &sa.sa_mask, NSIG / 8); 30160 printsigmask(&sigset, 1); 30161 which used to copy garbage in high bits, now it will copy actual data. 30162 30163 2013-07-17 Denys Vlasenko <dvlasenk (a] redhat.com> 30164 30165 ARM: fix sigreturn decoding. 30166 Decoding of test/sigreturn testcase: 30167 Was: 30168 sigreturn() (mask [QUIT TRAP ABRT BUS SEGV USR2 PIPE STKFLT STOP XCPU VTALRM PROF WINCH IO PWR RTMIN]) = 0 30169 Now: 30170 sigreturn() (mask [CHLD RT_1 RT_3 RT_31 RT_32]) = 0 30171 30172 2013-07-16 Denys Vlasenko <dvlasenk (a] redhat.com> 30173 30174 Group USE_CUSTOM_PRINTF define with other tweakables. 30175 No code changes. 30176 30177 2013-07-16 Denys Vlasenko <dvlasenk (a] redhat.com> 30178 30179 Improve sigreturn decoding on x86 to show RT signal bits too. 30180 This includes decoding of 32-bit sigreturn by 64-bit strace, 30181 which previously wasn't done. 30182 30183 Added a test for it. 30184 30185 2013-07-12 Anton Blanchard <anton (a] samba.org> 30186 30187 powerpc: enhance 32/64bit detection. 30188 We were using uname to determine if userspace was 32 or 64bit. 30189 This fails when we have a 64bit kernel and a 32bit userspace. 30190 30191 * configure.ac (powerpc*): Similar to x86, use a runtime test 30192 to determine if we are 32 or 64bit. 30193 30194 2013-07-12 Anton Blanchard <anton (a] samba.org> 30195 30196 powerpc: fix some compiler warnings. 30197 Fix a number of differing signedness warnings when building on 30198 powerpc. 30199 30200 powerpc: fix iflag build issue (static -> extern) 30201 30202 2013-07-10 Denys Vlasenko <dvlasenk (a] redhat.com> 30203 30204 PTRACE_SEIZE can set ptrace options immediately, use this feature. 30205 This eliminates some rare bugs, such as post-execve SIGTRAP 30206 generation when we attach to a process, and it manages to finish 30207 execve'ing before we set TRACEEXEC option to suppress that. 30208 30209 2013-07-08 Denys Vlasenko <dvlasenk (a] redhat.com> 30210 30211 If -o|logger is in use, exit trace loop if nprocs == 0. 30212 30213 Exit trace loop if got ECHILD, not if nprocs == 0. 30214 Comment gives a testcase which wasn't handled correctly 30215 by the old code. 30216 30217 2013-07-07 Denys Vlasenko <dvlasenk (a] redhat.com> 30218 30219 s390[x]: get rid of syscall_mode, delete code which never triggers. 30220 Before this change, the logic was as follows: 30221 syscall entry: 30222 get_scno: 30223 syscall_mode = GPR2 30224 scno = syscall_mode unless syscall_mode == -ENOSYS 30225 (if -ENOSYS, scn is retrieved by decoding current insn) 30226 fixup: 30227 gpr2 = GPR2 30228 syscall_mode = scno unless syscall_mode == -ENOSYS 30229 if (gpr2 != syscall_mode) stray_entry 30230 syscall exit: 30231 get_res: 30232 gpr2 = GRP2 30233 fixup: 30234 syscall_mode = scno unless syscall_mode == -ENOSYS 30235 if (WAITEXECVE && gpr2 in (-ENOSYS, scno)) gpr2 = 0; 30236 get_error: 30237 gpr2 is retval 30238 30239 Entry fixup's if() can never trigger: 30240 regardless whether GPR2 is -ENOSYS or not, syscall_mode is always 30241 equal to GRP2 value there. So it can be removed. 30242 30243 On sysexit path, syscall mode is never used. 30244 30245 Therefore, syscall_mode variable is deleted. grp2 is read from 30246 GPR2 register in get_scno, redundant read in entry fixup is removed. 30247 As a result, entry fixup's s390 code block vanishes completely. 30248 30249 gpr2 variable is renamed s390_gpr2 to match the convention used 30250 by other arches. 30251 30252 2013-07-04 Denys Vlasenko <dvlasenk (a] redhat.com> 30253 30254 ARM: add STRACE_KNOWS_ONLY_EABI define which can be used to omit OABI support 30255 30256 Add paranoia check before passing a long to pid2tcb(int pid) 30257 30258 2013-07-02 Denys Vlasenko <dvlasenk (a] redhat.com> 30259 30260 In debug output, show waitpid status with 6 hex digits, not 4. 30261 This shows event byte values better (without variable offset): 30262 30263 [wait(0x01057f) = 29491] WIFSTOPPED,sig=SIGTRAP,EVENT_FORK (1) 30264 [wait(0x80057f) = 29492] WIFSTOPPED,sig=SIGTRAP,EVENT_STOP (128) 30265 ^^ 30266 30267 2013-07-02 Denys Vlasenko <dvlasenk (a] redhat.com> 30268 30269 Replace suspicious popen_pid assignment with an obviously correct one. 30270 popen_pid = vfork() does work correctly, but for a subtle reason 30271 that wrong assignment of 0 happens in the child _first_, 30272 and _then_ correct value overwrites it in the parent. 30273 30274 (And in a hyphothetical system where vfork = fork, 30275 popen_pid wouldn't be shared, so it will also be ok.) 30276 30277 However, it's not necessary to be difficult. 30278 This change makes it so that assignment is done only in parent. 30279 30280 2013-07-01 Denys Vlasenko <dvlasenk (a] redhat.com> 30281 30282 Convert trace() from returning int to returning void. 30283 The cleanup sequence in error cases, and on normal code path 30284 was nearly the same, no point in duplicating it. 30285 30286 Remove ia64-specific printing of current address on signal delivery. 30287 The address is printed anyway by printleader() if -i is active. 30288 30289 Rename ia32 to ia64_ia32mode, and make it bool, not long. 30290 Grepping for just ia32 was turning up many false positives. 30291 30292 2013-06-30 Denys Vlasenko <dvlasenk (a] redhat.com> 30293 30294 Fold is_restart_error() into its sole user. 30295 30296 2013-06-29 Denys Vlasenko <dvlasenk (a] redhat.com> 30297 30298 Update qemu_multiarch_testing/README. 30299 30300 2013-06-28 Denys Vlasenko <dvlasenk (a] redhat.com> 30301 30302 sys_clone: add a comment about CLONE_PTRACE and CLONE_UNTRACED. 30303 No code changes. 30304 30305 POWERPC: get rid of "static long ppc_result" 30306 30307 POWERPC: read ppc_regs.nip if -i. 30308 30309 POWERPC: if GETREGS fails with EIO, don't try it again. 30310 30311 Get rid of powerpc_getreg(), it's a copy of upeek() 30312 30313 Change upeek() to take pid, not full tcp. 30314 This will be used by next change. 30315 30316 2013-06-26 Anton Blanchard <anton (a] samba.org> 30317 30318 powerpc: Provide a fallback for old kernels without PTRACE_GETREGS. 30319 PTRACE_GETREGS was added to the ppc kernel in 2.6.23. In order to 30320 provide backward compatibility for very old kernels, add a manual 30321 fallback. 30322 30323 * syscall.c (powerpc_getreg, powerpc_getregs_old): New functions. 30324 (get_regs): Call powerpc_getregs_old if PTRACE_GETREGS is not supported. 30325 30326 2013-06-26 Anton Blanchard <anton (a] samba.org> 30327 30328 powerpc: Use PTRACE_GETREGS to fetch all registers. 30329 * defs.h: declare ppc_regs and get_regs_error. 30330 * signal.c (sys_sigreturn): Use ppc_regs instead of upeek. 30331 * syscall.c: define ppc_regs. 30332 (printcall): Use ppc_regs instead of upeek. 30333 (get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call. 30334 (get_syscall_result): Likewise. 30335 30336 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 30337 30338 Another manpage tweak. 30339 30340 Manpage update. 30341 30342 Update build_static_example.sh. 30343 Now it also contains a tested example of i686 build on 64-bit host. 30344 30345 In -f mode, do not assume that new pid is stopped - handle exits too. 30346 30347 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 30348 30349 Set strace_child only in the right branch. 30350 "strace_child = pid" assignment was racing in NOMMU case 30351 because of vfork (no way to know which process would win). 30352 30353 After this change, strace_child is set to nonzero only 30354 in one process after [v]fork. 30355 30356 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 30357 30358 Get rid of TCB_INUSE and TCB_STRACE_CHILD. 30359 We can use tcb::pid == 0 as an indicator of free tcb, 30360 and we already have strace_child variable which holds 30361 pid of our child, if any. 30362 30363 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 30364 30365 Fix debug output of wait4 result (was reusing buf[] on unknown events) 30366 30367 Show PTRACE_EVENT_STOP correctly in debug output. 30368 30369 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 30370 30371 Panic a bit less when we see an unknown pid. 30372 I stumbeld over this case when I used "exec stace ...". 30373 30374 * strace.c (trace): Do not exit if we see an unknown pid in wait4. 30375 30376 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 30377 30378 detach(): Reorganize code. Logic is the same. 30379 * strace.c (detach): Use goto's instead of excessive nesting. 30380 Drop sigstop_expected and interrupt_done variables. 30381 30382 Eat pending SIGSTOP _before_ PTRACE_DETACH in detach() 30383 * strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set, 30384 di not PTRACE_DETACH - wait for SIGSTOP first. 30385 30386 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 30387 30388 detach(): warn if we see ECHILD from waitpid. 30389 * strace.c (detach): Warn if we see ECHILD from waitpid. 30390 Explain in comments that we don't normally expect !WIFSTOPPED 30391 either, and also that PTRACE_CONT failure isn't expected 30392 (the "break" there is a "I'm confused, bailing out" code style).. 30393 30394 Improve error messages in detach() 30395 * strace.c (detach): Change return type from int to void. 30396 Improve error meesages: show PID, tell exactly which operation fails. 30397 30398 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 30399 30400 Remove workarounds for ancient kernels lacking __WALL. 30401 __WALL is available and working at least since 2.4 kernels: 10 years ago. 30402 30403 * strace (detach): Remove workarounds for ancient kernels lacking __WALL. 30404 Add missing EINTR check. 30405 (trace): Remove workarounds for ancient kernels lacking __WALL. 30406 Remove redundant double error printout. 30407 30408 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 30409 30410 USE_SEIZE: fix detaching from stopped processes. 30411 V3: split SEIZE/!SEIZE code paths to reduce confusion. 30412 Extensively comment every possible case. 30413 Verified that all tests/detach* tests work in both SEIZE and !SEIZE 30414 cases. 30415 30416 * strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee 30417 using PTRACE_INTERRUPT instead of sending it a SIGSTOP. 30418 In a subsequent waitpid loop, correctly wait and suppress SIGSTOP 30419 on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace 30420 stop and detach without suppressing signals. 30421 30422 2013-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 30423 30424 tests: disable /proc based checks when /proc is not mounted. 30425 * tests/detach-running: Disable /proc based checks when 30426 /proc/self/status is not available. 30427 * tests/detach-sleeping: Likewise. 30428 * tests/detach-stopped: Likewise. 30429 30430 2013-06-19 Denys Vlasenko <dvlasenk (a] redhat.com> 30431 30432 tests/detach-{running,sleeping,stopped}: check post-detach state. 30433 Check that traced process still exists and is in a right state 30434 after strace detached from it. 30435 30436 2013-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 30437 30438 tests: ensure that strace can detach from running processes. 30439 * tests/detach-running: New test. 30440 * tests/Makefile.am (TESTS): Add it. 30441 30442 tests: ensure that strace does not leave sleeping processes stopped. 30443 * tests/detach-sleeping: Do not send SIGCONT to the sleeping process. 30444 30445 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 30446 30447 tests: fix parallel-tests support in detach-* tests. 30448 * tests/detach-sleeping: Use $LOG file for set_ptracer_any output. 30449 * tests/detach-stopped: Likewise. 30450 30451 tests: parametrize "sleep 1" 30452 * tests/init.sh (SLEEP_A_BIT): New variable. 30453 * tests/detach-sleeping: Use it. 30454 * tests/detach-stopped: Likewise. 30455 30456 tests: ensure that strace can detach from sleeping and stopped processes 30457 * tests/set_ptracer_any.c: New file. 30458 * tests/detach-sleeping: New test. 30459 * tests/detach-stopped: Likewise. 30460 * tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any. 30461 (TESTS): Add detach-sleeping and detach-stopped. 30462 * tests/.gitignore: Add set_ptracer_any. 30463 30464 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 30465 30466 tests: enhance timeout checks. 30467 Run each test using a wrapper that does all necessary timeout checks. 30468 30469 * tests/run.sh: New file. 30470 * tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it. 30471 * tests/init.sh (check_strace, check_timeout): Remove. 30472 * tests/detach-stopped: Update callers. 30473 * tests/net: Likewise. 30474 * tests/ptrace_setoptions: Likewise. 30475 * tests/qual_syscall: Likewise. 30476 * tests/stat: Likewise. 30477 * tests/strace-f: Likewise. 30478 30479 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 30480 30481 tests: enable parallel-tests support. 30482 * configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests. 30483 30484 tests: prepare for parallel-tests support. 30485 * tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS. 30486 * tests/init.sh (LOG): New variable. 30487 * tests/detach-stopped: Use it. 30488 * tests/net: Likewise. 30489 * tests/qual_syscall: Likewise. 30490 * tests/stat: Likewise. 30491 * tests/strace-f: Likewise. 30492 30493 2013-06-18 Denys Vlasenko <dvlasenk (a] redhat.com> 30494 30495 Cleanups. No logic changes. 30496 * defs.h: Define new ptrace constants unconditionally. 30497 * strace.c (detach): Fix comment. 30498 (trace): Remove now unnecessary "if USE_SEIZE". 30499 30500 2013-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 30501 30502 maint: post-release administrivia. 30503 * NEWS: Add header line for next release. 30504 30505 2013-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 30506 30507 ioctlent: add UAPI support. 30508 * Makefile.am (IOCTLSORT_INCLUDEDIR): Define. 30509 (ioctlsort): Use it. 30510 * linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree. 30511 Strip "uapi/" prefix from output path names. 30512 * linux/ioctlent.h.in: Regenerate from v3.9 headers. 30513 * NEWS: Mention it. 30514 30515 Prepare for 4.8 release. 30516 * NEWS: Update for 4.8 release. 30517 * debian/changelog: 4.8-1. 30518 * strace.spec: 4.8-1. 30519 30520 2013-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 30521 30522 Fix "make dist" on recently added architectures. 30523 * Makefile.am (EXTRA_DIST): Add linux/aarch64/errnoent1.h, 30524 linux/aarch64/ioctlent.h.in, linux/aarch64/ioctlent1.h, 30525 linux/aarch64/signalent1.h, linux/aarch64/syscallent.h, 30526 linux/aarch64/syscallent1.h, linux/metag/ioctlent.h.in, 30527 linux/metag/syscallent.h, linux/or1k/ioctlent.h.in, 30528 linux/or1k/syscallent.h, linux/tile/errnoent1.h, linux/tile/ioctlent1.h, 30529 linux/tile/signalent1.h, linux/tile/syscallent1.h, linux/ubi-user.h, 30530 linux/xtensa/ioctlent.h.in, and linux/xtensa/syscallent.h. 30531 30532 Fix "make dist" regression introduced by commit v4.7-184-gd648f29. 30533 * Makefile.am (EXTRA_DIST): Add linux/ubi-user.h. 30534 30535 2013-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 30536 30537 Do not suppress signal delivery messages with -qq. 30538 Current implementation of -qq does not allow suppressing exit status 30539 messages without suppressing signal delivery messages, which is not 30540 good. There is a traditional "-e signal=none" syntax that can be used 30541 to suppress all signal delivery messages. 30542 This partially reverts commit v4.7-222-g01997cf. 30543 30544 * strace.c (trace): Do not suppress signal delivery messages with -qq. 30545 * strace.1: Update documentation about -qq option. 30546 30547 2013-05-23 Chris Metcalf <cmetcalf (a] tilera.com> 30548 30549 tile: use siginfo_t, not struct siginfo. 30550 As of glibc 2.16, "struct siginfo" is no longer supported, 30551 and "siginfo_t" must be used instead. 30552 30553 tile: remove MAP_CACHE_xxx support in mem.c. 30554 These flags support functionality in mmap() that has not been 30555 pushed back to the community, and which may or may not eventually 30556 end up being the final community model. In the interim, having 30557 these flags unconditionally present for "#ifdef TILE" just means 30558 that the TILE build breaks if using the community versions of 30559 the kernel and glibc, so just revert the code until such time 30560 as it may end up in the community. 30561 30562 2013-05-17 Mike Frysinger <vapier (a] gentoo.org> 30563 30564 Rename COPYRIGHT to COPYING. 30565 The standard name people have adopted is "COPYING" rather than 30566 "COPYRIGHT". Use that as a lot of license scanning tools look for it. 30567 30568 * COPYRIGHT: Rename to ... 30569 * COPYING: ... this. 30570 * Makefile.am (EXTRA_DIST): Rename COPYRIGHT to COPYING. 30571 * README: Likewise. 30572 * strace.spec (%files): Likewise. 30573 30574 2013-05-17 Dmitry V. Levin <ldv (a] altlinux.org> 30575 30576 Sync strace.spec and debian/ with packages. 30577 * debian/changelog: Sync with 4.7-1. 30578 * debian/strace.docs: Likewise. 30579 * strace.spec: Sync with 4.7-3. 30580 30581 Update PTRACE_O_* constants. 30582 * process.c (ptrace_setoptions_flags): Sync with Linux 3.9. 30583 30584 Update AF_*, PF_*, MSG_*, and TCP_* constants. 30585 * net.c (domains, addrfams, protocols, socktcpoptions): Sync with 30586 Linux 3.9. 30587 30588 2013-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 30589 30590 NOMMU: do not hide startup syscalls unless in -D mode. 30591 On NOMMU systems in "strace PROG" case, we have no way to attach to 30592 the tracee before it calls execve unless in -D mode. That is, the 30593 first execve call is very likely to be missed, and setting 30594 hide_log_until_execve just results to empty log. 30595 30596 * strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve 30597 unless in -D mode. 30598 30599 2013-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 30600 30601 Make -D mode work when the Yama LSM is enabled. 30602 * strace.c [HAVE_PRCTL]: Include sys/prctl.h. 30603 (startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]: 30604 In -D mode, allow tracing the process that is going to become the 30605 tracee. 30606 30607 Update PR_* constants. 30608 * process.c (prctl_options): Add PR_SET_PTRACER. 30609 30610 2013-05-14 Denys Vlasenko <dvlasenk (a] redhat.com> 30611 30612 Hide startup syscalls. 30613 Tested with "./strace [-D] [-q] [-bexecve] env true", 30614 all cases seem to work. 30615 30616 * defs.h: Declare new variable: bool hide_log_until_execve. 30617 * strace.c: Define hide_log_until_execve. 30618 Rename skip_startup_execve to skip_one_b_execve. 30619 (startup_child): Do not set skip_one_b_execve = 1 here. 30620 (init): If "strace PROG" case (as opposed to "strace -pPID"), 30621 set skip_one_b_execve and hide_log_until_execve to 1. 30622 (trace): Don't print signal messages if hide_log_until_execve == 1. 30623 * syscall.c (trace_syscall_entering): 30624 Skip syscall printing if hide_log_until_execve == 1. 30625 Reset hide_log_until_execve if we enter execve syscall. 30626 (trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1. 30627 30628 2013-05-13 Daniel P. Berrange <berrange (a] redhat.com> 30629 30630 Allow -q to be repeated for very quiet output. 30631 Even with the -q flag specified, tracing output is still mixed 30632 with messages about signals and process exit status, which is 30633 often irrelevant. Allow the -q option to be repeated to force 30634 the suppression of signals / exit status info too. 30635 30636 * defs.h: Change 'qflag' from 'bool' to 'unsigned int'. 30637 * strace.1: Document ability to repeat '-q' option. 30638 * strace.c: Allow '-q' to be repeated to quieten process 30639 exit status and signal messages. 30640 30641 2013-05-11 Dmitry V. Levin <ldv (a] altlinux.org> 30642 30643 mips o32: fix syscall table. 30644 * linux/mips/syscallent-o32.h: Add entries for getpmsg, putpmsg, 30645 get_mempolicy, set_mempolicy and vserver. Fix names for umount, 30646 umount2, mmap, mmap2, pread64, pwrite64, sigaltstack and fstatat64 30647 syscalls. 30648 30649 2013-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 30650 30651 mips n64: fix syscall table. 30652 * linux/mips/syscallent-n64.h: Add entries for get_mempolicy, 30653 set_mempolicy and timerfd syscalls. Fix entry for socket syscall. 30654 Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack 30655 and umount2 syscalls. 30656 30657 mips n32: fix syscall table. 30658 * linux/mips/syscallent-n32.h: Add entries for mbind, get_mempolicy, 30659 set_mempolicy and timerfd syscalls. Fix entry for socket syscall. 30660 Fix handlers for truncate, ftruncate and getdents64 syscalls. 30661 Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack, 30662 umount2, and getdents64 syscalls. 30663 30664 2013-05-08 Dmitry V. Levin <ldv (a] altlinux.org> 30665 30666 sync_file_range: fix number of syscall arguments. 30667 * linux/avr32/syscallent.h: Set the number of sync_file_range arguments 30668 to 6. 30669 * linux/bfin/syscallent.h: Likewise. 30670 * linux/hppa/syscallent.h: Likewise. 30671 * linux/i386/syscallent.h: Likewise. 30672 * linux/m68k/syscallent.h: Likewise. 30673 * linux/microblaze/syscallent.h: Likewise. 30674 * linux/mips/syscallent-o32.h: Likewise. 30675 * linux/or1k/syscallent.h: Likewise. 30676 * linux/s390/syscallent.h: Likewise. 30677 * linux/sh/syscallent.h: Likewise. 30678 * linux/powerpc/syscallent.h: Change sync_file_range to 30679 sync_file_range2, set the number of sync_file_range2 arguments to 6. 30680 * linux/tile/syscallent.h: Change sync_file_range to sync_file_range2, 30681 set the number of sync_file_range2 arguments to 4. 30682 * linux/tile/syscallent1.h: Change sync_file_range to sync_file_range2. 30683 update handler. 30684 * linux/xtensa/syscallent.h: Likewise. 30685 30686 Add syscall entries for new linux syscalls. 30687 * linux/dummy.h: Add printargs aliases for sys_finit_module, sys_kcmp 30688 and sys_sync_file_range2. 30689 * linux/alpha/syscallent.h: Add entries for process_vm_readv 30690 and process_vm_writev. 30691 * linux/bfin/syscallent.h: Likewise. 30692 * linux/arm/syscallent.h: Add entries for sync_file_range2, kcmp 30693 and finit_module. 30694 * linux/hppa/syscallent.h: Add entries for process_vm_readv, 30695 process_vm_writev, kcmp and finit_module. 30696 * linux/tile/syscallent.h: Likewise. 30697 * linux/tile/syscallent1.h: Likewise. 30698 * linux/ia64/syscallent.h: Add entry for finit_module. 30699 * linux/i386/syscallent.h: Add entries for kcmp and finit_module. 30700 * linux/m68k/syscallent.h: Likewise. 30701 * linux/metag/syscallent.h: Likewise. 30702 * linux/microblaze/syscallent.h: Likewise. 30703 * linux/mips/syscallent-n32.h: Likewise. 30704 * linux/mips/syscallent-n64.h: Likewise. 30705 * linux/mips/syscallent-o32.h: Likewise. 30706 * linux/or1k/syscallent.h: Likewise. 30707 * linux/powerpc/syscallent.h: Likewise. 30708 * linux/sh/syscallent.h: Likewise. 30709 * linux/sh64/syscallent.h: Likewise. 30710 * linux/x32/syscallent.h: Likewise. 30711 * linux/x86_64/syscallent.h: Likewise. 30712 * linux/xtensa/syscallent.h: Likewise. 30713 * linux/s390/syscallent.h: Add entries for s390_runtime_instr, kcmp 30714 and finit_module. 30715 * linux/s390x/syscallent.h: Likewise. 30716 * linux/sparc/syscallent.h: Add entries for kern_features, kcmp 30717 and finit_module. 30718 30719 tests/net: fix portability issues. 30720 * tests/net-accept-connect.c: Fix address length passed to bind() 30721 and connect(). 30722 * tests/net: Update regexps. 30723 30724 tests: add a test for basic network syscalls. 30725 * tests/.gitignore: Add net-accept-connect, *.o and *.log.*. 30726 * tests/Makefile.am (AM_CFLAGS): New variable. 30727 (check_PROGRAMS): Add net-accept-connect. 30728 (TESTS): Add net. 30729 * tests/net-accept-connect.c: New file. 30730 * tests/net: New file. 30731 30732 tests: do not skip tests when timeout utility is not available. 30733 * tests/init.sh (check_timeout): New function. 30734 * tests/ptrace_setoptions: Use it. 30735 * tests/qual_syscall: Likewise. 30736 * tests/stat: Likewise. 30737 * tests/strace-f: Likewise. 30738 30739 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30740 30741 Move subcall decoding configuration out of the common code. 30742 * Makefile.am (EXTRA_DIST): Add linux/subcall.h. 30743 * linux/syscall.h (SYS_socket_subcall): Remove. 30744 (SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ... 30745 * linux/subcall.h: ... new file. 30746 * linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h. 30747 * linux/i386/syscallent.h: Likewise. 30748 * linux/m68k/syscallent.h: Likewise. 30749 * linux/powerpc/syscallent.h: Likewise. 30750 * linux/s390/syscallent.h: Likewise. 30751 * linux/s390x/syscallent.h: Likewise. 30752 * linux/sh/syscallent.h: Likewise. 30753 * linux/sh64/syscallent.h: Likewise. 30754 * linux/sparc/syscallent.h: Likewise. 30755 30756 Suggested by Mike Frysinger and Chris Metcalf. 30757 30758 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30759 30760 sparc: remove some unused declarations and macros. 30761 * linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys, 30762 sys_shmsys): Remove declarations. 30763 [SPARC || SPARC64] (SYS_semsys_subcall, SYS_semsys_nsubcalls, 30764 SYS_msgsys_subcall, SYS_msgsys_nsubcalls, SYS_shmsys_subcall, 30765 SYS_shmsys_nsubcalls): Remove macros. 30766 30767 2013-05-07 Mike Frysinger <vapier (a] gentoo.org> 30768 30769 mips: fix build regression. 30770 The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled 30771 the mips headers around causing it to check the ABI defines before it 30772 included the header which set those up. Now all mips builds fail with: 30773 In file included from count.c:36:0: 30774 defs.h:48:4: error: #error Unsupported _MIPS_SIM 30775 30776 * defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check. 30777 30778 2013-05-07 James Hogan <james.hogan (a] imgtec.com> 30779 30780 metag: rename llseek syscall to _llseek. 30781 The raw llseek syscall is called _llseek from userland, so fix the 30782 naming of it for metag to allow the stat test to pass. 30783 30784 * linux/metag/syscallent.h: Rename llseek syscall to _llseek. 30785 30786 2013-05-07 James Hogan <james.hogan (a] imgtec.com> 30787 30788 metag: disable socket and ipc subcall support. 30789 The metag architecture also uses dedicated syscalls and doesn't need to 30790 multiplex ipc and socket subcalls. 30791 30792 * linux/syscall.h [METAG]: Do not define SYS_socket_subcall and 30793 SYS_ipc_subcall. 30794 30795 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30796 30797 pread, pwrite: fix number of syscall arguments. 30798 The number of pread and pwrite arguments depends on architecture and 30799 personality. For 64bit and ilp32 it equals to 4, for unaligned 30800 32bit it equals to 5, and for aligned 32bit it equals to 6. 30801 30802 * linux/aarch64/syscallent1.h: Change the number of pread and pwrite 30803 arguments to 4. 30804 * linux/alpha/syscallent.h: Likewise. 30805 * linux/mips/syscallent-n32.h: Likewise. 30806 * linux/mips/syscallent-n64.h: Likewise. 30807 * linux/s390x/syscallent.h: Likewise. 30808 * linux/sh64/syscallent.h: Likewise. 30809 * linux/tile/syscallent.h: Likewise. 30810 * linux/x32/syscallent.h: Likewise. 30811 * linux/x86_64/syscallent.h: Likewise. 30812 * linux/or1k/syscallent.h: Change the number of pread and pwrite 30813 arguments to 5. 30814 30815 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30816 30817 preadv, pwritev: fix number of syscall arguments. 30818 The number of preadv and pwritev arguments depends on architecture and 30819 personality. For 64bit and ilp32 it equals to 4, for unaligned 32bit 30820 it equals to 5, and for aligned 32bit it equals to 6. 30821 30822 * linux/aarch64/syscallent1.h: Change the number of preadv and pwritev 30823 arguments to 4. 30824 * linux/alpha/syscallent.h: Likewise. 30825 * linux/ia64/syscallent.h: Likewise. 30826 * linux/mips/syscallent-n32.h: Likewise. 30827 * linux/mips/syscallent-n64.h: Likewise. 30828 * linux/s390x/syscallent.h: Likewise. 30829 * linux/sh64/syscallent.h: Likewise. 30830 * linux/tile/syscallent.h: Likewise. 30831 * linux/x32/syscallent.h: Likewise. 30832 * linux/x86_64/syscallent.h: Likewise. 30833 * linux/powerpc/syscallent.h: Change the number of preadv and pwritev 30834 arguments to 6. 30835 * linux/sh/syscallent.h: Likewise. 30836 * linux/xtensa/syscallent.h: Likewise. 30837 30838 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30839 30840 ftruncate64, truncate64: fix number of syscall arguments. 30841 The number of ftruncate64/truncate64 arguments depends on architecture 30842 and personality. For 64bit and ilp32 it equals to 2, for unaligned 30843 32bit it equals to 3, and for aligned 32bit it equals to 4. 30844 30845 * linux/or1k/syscallent.h: Change the number of ftruncate64 and 30846 truncate64 arguments to 3. 30847 * linux/sh/syscallent.h: Likewise. 30848 * linux/sh64/syscallent.h: Change ftruncate64 and truncate64 handlers. 30849 * linux/sparc/syscallent.h: Change ftruncate64 handler, change the 30850 number of its arguments to 3. 30851 * linux/xtensa/syscallent.h: Change the number of ftruncate64 and 30852 truncate64 arguments to 4. 30853 30854 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30855 30856 fallocate: fix number of syscall arguments. 30857 The number of fallocate arguments depends on architecture and 30858 personality. For 64bit and ilp32 it equals to 4, 30859 for 32bit it equals to 6. 30860 30861 * linux/aarch64/syscallent1.h: Change the number of fallocate arguments 30862 to 4. 30863 * linux/alpha/syscallent.h: Likewise. 30864 * linux/mips/syscallent-n32.h: Likewise. 30865 * linux/mips/syscallent-n64.h: Likewise. 30866 * linux/s390x/syscallent.h: Likewise. 30867 * linux/sh64/syscallent.h: Likewise. 30868 * linux/tile/syscallent.h: Likewise. 30869 * linux/x32/syscallent.h: Likewise. 30870 * linux/x86_64/syscallent.h: Likewise. 30871 * linux/microblaze/syscallent.h: Set fallocate handler and flags. 30872 30873 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30874 30875 fadvise64, fadvise64_64: fix handlers and number of syscall arguments. 30876 The number of fadvise64 arguments depends on architecture and 30877 personality. For 64bit and ilp32 it equals to 4, for unaligned 30878 32bit it equals to 5, and for aligned 32bit it equals to 6. 30879 30880 The number of fadvise64_64 arguments is 4 for 64bit and ilp32, for 30881 unaligned 32bit and most of aligned 32bit it equals to 6, and for 30882 mips o32 it equals to 7. 30883 30884 * linux/alpha/syscallent.h: Set fadvise64 handler. 30885 * linux/s390/syscallent.h: Likewise. 30886 * linux/hppa/syscallent.h: Set fadvise64_64 handler, change the number 30887 of syscall arguments to 6. 30888 * linux/ia64/syscallent.h: Change the number of fadvise64 arguments 30889 to 4. 30890 * linux/mips/syscallent-n32.h: Likewise. 30891 * linux/tile/syscallent1.h: Change the number of fadvise64 arguments 30892 to 5. 30893 * linux/mips/syscallent-o32.h: Change the number of fadvise64_64 30894 arguments to 7. 30895 * linux/s390x/syscallent.h: Change fadvise64_64 handler. Set fadvise64 30896 handler. Change numbers of fadvise64 and fadvise64_64 arguments to 4. 30897 * linux/sh64/syscallent.h: Change fadvise64_64 handler. 30898 Change numbers of fadvise64 and fadvise64_64 arguments to 4. 30899 * linux/sparc/syscallent.h: Set fadvise64 and fadvise64_64 handlers, 30900 change numbers of their arguments to 5 and 6. 30901 * linux/x86_64/syscallent.h: Change fadvise64 handler. 30902 30903 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30904 30905 mips o32: raise the max number of syscall arguments to 7. 30906 On mips o32, fadvise64_64 takes 7 arguments. 30907 30908 * defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7. 30909 30910 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30911 30912 mips: split syscallent.h. 30913 linux/mips/syscallent.h consisted of several parts that had little in 30914 common. Split them into separate files to ease maintenance. 30915 30916 * linux/mips/syscallent-compat.h: New file. 30917 * linux/mips/syscallent-n32.h: Likewise. 30918 * linux/mips/syscallent-n64.h: Likewise. 30919 * linux/mips/syscallent-o32.h: Likewise. 30920 * linux/mips/syscallent.h: Include them. 30921 * Makefile.am (EXTRA_DIST): Add them. 30922 30923 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 30924 30925 readahead: fix number of syscall arguments. 30926 The number of readahead arguments depends on architecture and 30927 personality. For 64bit and ilp32 it equals to 3, for unaligned 32bit it 30928 equals to 4, and for aligned 32bit it equals to 5. 30929 30930 * linux/aarch64/syscallent1.h: Set number of readahead arguments to 3. 30931 * linux/alpha/syscallent.h: Likewise. 30932 * linux/ia64/syscallent.h: Likewise. 30933 * linux/s390x/syscallent.h: Likewise. 30934 * linux/sh64/syscallent.h: Likewise. 30935 * linux/x32/syscallent.h: Likewise. 30936 * linux/x86_64/syscallent.h: Likewise. 30937 * linux/or1k/syscallent.h: Set number of readahead arguments to 4. 30938 * linux/sh/syscallent.h: Likewise. 30939 * linux/tile/syscallent.h: Likewise. 30940 * linux/xtensa/syscallent.h: Set number of readahead arguments to 5. 30941 30942 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 30943 30944 linux/syscall.h: make subcall decoding configuration more readable. 30945 * linux/syscall.h: Inverse and sort the subcall ifdef, 30946 add a comment why subcall decoding support is not enabled 30947 on some architectures. 30948 30949 2013-05-06 Chris Zankel <chris (a] zankel.net> 30950 30951 xtensa: disable socket and ipc subcall support. 30952 The Xtensa architecture also uses dedicated syscalls and doesn't 30953 need to multiplex ipc and socket subcalls. 30954 30955 * linux/syscall.h [XTENSA]: Do not define SYS_socket_subcall and 30956 SYS_ipc_subcall. 30957 30958 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 30959 30960 Fix syscall flags. 30961 * linux/aarch64/syscallent1.h: Fix syscall flags for send. 30962 * linux/alpha/syscallent.h: Fix syscall flags for fchdir, getcwd, 30963 oldumount, sigaltstack, umount, uselib, and utimes. 30964 * linux/arm/syscallent.h: Fix syscall flags for close, creat, dup, dup2, 30965 fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, flock, 30966 fsetxattr, fsync, getdents, getdents64, ioctl, oldfstat, oldselect, 30967 open, pipe, poll, pread, pwrite, read, readahead, readdir, readv, 30968 select, socketcall, write, and writev. 30969 * linux/avr32/syscallent.h: Fix syscall flags for inotify_init and 30970 unshare. 30971 * linux/bfin/syscallent.h: Fix syscall flags for pread64 and pwrite64. 30972 * linux/hppa/syscallent.h: Fix syscall flags for fchdir, flistxattr, 30973 getcwd, pause, signal, umount2, uselib, utime, and vfork. 30974 * linux/ia64/syscallent.h: Fix syscall flags for creat, fchdir, 30975 lstat, umount, uselib, and utimes. Fix syscall handlers for 30976 fgetxattr, flistxattr, fremovexattr, and fsetxattr. 30977 * linux/m68k/syscallent.h: Fix syscall flags for close, creat, dup, 30978 dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, 30979 flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, open, pipe, 30980 poll, pread64, pwrite64, read, readahead, readdir, readv, select, 30981 socketcall, write, and writev. 30982 * linux/metag/syscallent.h: Fix syscall flags for fanotify_init, 30983 prlimit64, process_vm_readv, process_vm_writev, and quotactl. 30984 * linux/microblaze/syscallent.h: Fix syscall flags for close, creat, 30985 dup, dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, 30986 fdatasync, flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, 30987 open, perf_event_open, pipe, poll, pread64, pwrite64, read, readahead, 30988 readdir, readv, select, socketcall, write, and writev. 30989 * linux/mips/syscallent.h: Fix syscall flags for close, creat, dup, 30990 dup2, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, flock, 30991 fsetxattr, getdents, getdents64, getxattr, ioctl, lgetxattr, 30992 listxattr, llistxattr, lremovexattr, lsetxattr, oldfstat, open, pipe, 30993 pivot_root, poll, pread, pwrite, read, readahead, readv, removexattr, 30994 select, setxattr, socketcall, statfs, write, and writev. 30995 * linux/or1k/syscallent.h: Fix syscall flags for fchdir and quotactl. 30996 * linux/powerpc/syscallent.h: Fix syscall flags for fchdir. 30997 * linux/sh/syscallent.h: Fix syscall flags for getcwd. 30998 * linux/sparc/syscallent.h: Fix syscall flags for getresgid, getresuid, 30999 setresgid, setresgid32, and setresuid. 31000 * linux/xtensa/syscallent.h: Fix syscall flags for close, creat, dup, 31001 dup2, fallocate, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, 31002 flock, fsetxattr, fstatfs, fstatfs64, fsync, getdents, getdents64, 31003 ioctl, open, pipe, pivot_root, poll, pread64, pwrite64, read, 31004 readahead, readv, rt_sigreturn, select, setfsgid, setfsuid, setuid, 31005 swapoff, times, utime, write, and writev. 31006 31007 tests/stat: enhance regexps. 31008 * tests/stat: Enhance regexps that check tracing of stat/stat64 and 31009 fstatat/fstatat64 syscalls. 31010 31011 2013-05-06 Chris Metcalf <cmetcalf (a] tilera.com> 31012 31013 tests/stat: support fstatat syscall for stat() 31014 Newer Linux architectures don't support the stat/stat64 syscalls. 31015 Instead they use fstatat() with AT_FDCWD and an extra flags argument. 31016 Support seeing this output in the 'strace -efile' test. 31017 31018 As part of this change, use "grep -E -x" syntax consistently for 31019 all stat tests, since the number of \(foo\)\? expressions was becoming 31020 pretty unwieldy. 31021 31022 * tests/stat: Update stat/stat64 check regexp to handle architectures 31023 that use fstatat instead. Use "grep -E -x" syntax consistently. 31024 31025 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 31026 31027 ARM OABI: fix 64-bit arguments decoding. 31028 ARM OABI and ARM EABI have different function parameters passing rules, 31029 see commit v4.6-11-g7a5b08f for details. 31030 31031 * util.c (printllval): Do not align argument number in case of ARM OABI. 31032 * file.c (sys_fadvise64_64): Likewise. 31033 31034 2013-05-06 Mike Frysinger <vapier (a] gentoo.org> 31035 31036 printllval: fix 64bit unpacking on mips/o32 and xtensa. 31037 The mips/o32 ABI and xtensa arch also do 64bit aligning, so add it to the 31038 printllval list for this. 31039 31040 Normally for sys_fadvise64_64 we'd handle the same list of arches, but 31041 mips/o32 ABI is funky and doesn't shift -- it has 7 args. So just add 31042 xtensa to it. 31043 31044 * file.c (sys_fadvise64_64): Add XTENSA to the shifted list. 31045 * util.c (printllval): Add LINUX_MIPSO32 and XTENSA to the shifted list. 31046 31047 2013-05-06 Chris Metcalf <cmetcalf (a] tilera.com> 31048 31049 tile: disable socket and ipc subcall support. 31050 The tile arch just has the dedicated syscalls, so disable 31051 the logic for parsing subcalls. 31052 31053 * linux/syscall.h [TILE]: Do not define SYS_socket_subcall and 31054 SYS_ipc_subcall. 31055 31056 2013-05-06 Mike Frysinger <vapier (a] gentoo.org> 31057 31058 Blackfin: disable socketcall and ipc subcall support. 31059 The Blackfin arch does not have a socketcall or ipc subcall 31060 (it has dedicated syscalls broken out), so disable the logic for it. 31061 31062 * linux/syscall.h [BFIN]: Do not define SYS_socket_subcall and 31063 SYS_ipc_subcall. 31064 31065 2013-05-05 Mike Frysinger <vapier (a] gentoo.org> 31066 31067 s390: fix # of args truncate64/ftruncate64 takes. 31068 * linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64. 31069 31070 2013-05-05 Mike Frysinger <vapier (a] gentoo.org> 31071 31072 mtd: clamp ubi name strings. 31073 Since the length fields with the ubi volnames are signed 16bit values, 31074 make sure we clamp that number to the size of the buffer we've allocated 31075 on the stack to prevent buffer overflows. 31076 31077 * mtd.c (ubi_ioctl): Clamp length to string_quote to 0/UBI_MAX_VOLUME_NAME. 31078 Check the return of string_quote and tweak the output accordingly. 31079 31080 2013-05-04 Dmitry V. Levin <ldv (a] altlinux.org> 31081 31082 printxval: support more architectures. 31083 * configure.ac: Define SIZEOF_LONG_LONG. 31084 * util.c (printllval): Handle all architectures with sizeof(long) > 4 31085 and sizeof(long) == sizeof(long long). 31086 31087 2013-05-04 Mike Frysinger <vapier (a] gentoo.org> 31088 31089 Fix building for sparc64 targets. 31090 * util.c (printllval): Handle SPARC64 define. 31091 31092 Fix building for mips n64 targets. 31093 * util.c (printllval): Handle LINUX_MIPSN64 define. 31094 31095 2013-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 31096 31097 hppa: fix stat64 and fstat64 decoding. 31098 * file.c [HPPA]: Do not redefine stat64 to hpux_stat64. 31099 31100 arm, aarch64, ppc: fix printllval-based decoders. 31101 * util.c (printllval) [ARM || POWERPC]: Align argument number. 31102 [AARCH64]: Align argument number in 32bit mode. 31103 * file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed 31104 printllval workaround. 31105 [AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode. 31106 31107 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 31108 31109 Decode mtd/ubi ioctls. 31110 Been playing with UBI of late and it'd help if I could see what it was 31111 doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes 31112 a pointer to a 64bit value, not a strict. 31113 31114 * util.c (MAX, MIN): Move to ... 31115 * defs.h (MAX, MIN): ... here. 31116 (CLAMP): Define. 31117 (ubi_ioctl): New prototype. 31118 * ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'. 31119 * mtd.c: Include ubi user API header. 31120 (ubi_volume_types): New enum decode. 31121 (ubi_volume_props): Likewise. 31122 (ubi_ioctl): Define. 31123 * linux/ubi-user.h: Import from linux 3.8. 31124 31125 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 31126 31127 test: add mtd/ubi test helpers. 31128 I used these to develop the mtd/ubi ioctl decoders. 31129 31130 * test/.gitignore: Add mtd/ubi. 31131 * test/Makefile: Declare all tests in a PROGS var. 31132 Declare build targets .PHONY. 31133 (all): Depend on $(PROGS) instead of hardcoded list. 31134 (clean): Remove $(PROGS) instead of hardcoded list. 31135 * test/mtd.c: New file. 31136 * test/ubi.c: Likewise. 31137 31138 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 31139 31140 test: include headers for used funcs. 31141 These funcs use things like wait/write/read/strcmp but sometimes 31142 don't include the right header for them. 31143 31144 * test/Makefile: Add -Wall to CFLAGS. 31145 * test/clone.c: Include unistd.h. 31146 * test/fork.c: Include sys/wait.h. 31147 * test/sig.c: Include unistd.h. 31148 * test/sigkill_rain.c: Include sys/wait.h. 31149 * test/vfork.c: Include sys/wait.h. 31150 * test/wait_must_be_interruptible.c: Include string.h 31151 31152 2013-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 31153 31154 ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1. 31155 * linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and 31156 sys_lstat64 before redefining them to printargs. 31157 31158 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 31159 31160 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 31161 31162 tests: stat: fix clean up of sample file. 31163 * tests/stat: Also rm the sample file at the end of the test. 31164 31165 Ignore more files. 31166 * .gitignore: Add gdb related files. 31167 * tests/.gitignore: Ignore test logs. 31168 31169 2013-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 31170 31171 x32: fix decoding of i386 truncate and ftruncate syscalls. 31172 * linux/x32/syscallent1.h: Remove sys_*truncate64 redirections. 31173 31174 x32: fix printllval-based decoders of i386 syscalls. 31175 * util.c (printllval) [X32]: Handle i386 personality. 31176 31177 tests: add basic test for ftruncate, lseek and stat family syscalls. 31178 * tests/stat: New test. 31179 * tests/Makefile.am (TESTS): Add stat. 31180 31181 2013-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 31182 31183 x32: fix build regressions introduced by commit v4.7-96-g8435d67. 31184 * desc.c (printflock) [X32]: Add special handling required for 31185 this architecture with sizeof(long) < sizeof(off_t). 31186 * file.c [X32] (struct stat64): Add __attribute__((packed)). 31187 [X32] (HAVE_STAT64): Define. 31188 (printstat) [X32]: Redirect to printstat64. 31189 (printstat64) [X32]: Use "struct stat" instead of "struct stat64". 31190 [X32] (realprintstat64): Rename to printstat64_x32. 31191 (sys_stat64, sys_fstat64) [X32]: Remove second definitions of these 31192 functions. Call printstat64_x32 instead of printstat64 31193 * linux/x32/syscallent.h: Fix handlers for truncate and ftruncate. 31194 31195 Alias sys_*lstat* syscall printing functions. 31196 * file.c (sys_lstat, sys_lstat64, sys_oldlstat): Remove. 31197 * linux/dummy.h: Move !HAVE_STRUCT___OLD_KERNEL_STAT aliases forward. 31198 (sys_lstat): Alias to sys_stat. 31199 (sys_lstat64): Alias to sys_stat64. 31200 (sys_oldlstat): Alias to sys_oldstat. 31201 * linux/syscall.h (sys_lstat, sys_lstat64, sys_oldlstat): Remove. 31202 * linux/x32/syscallent1.h (sys_lstat64): Remove. 31203 31204 x86_64: decode __old_kernel_stat based syscalls. 31205 * linux/x86_64/syscallent1.h: Remove sys_old*stat redirections. 31206 31207 x32: fix decoding of __old_kernel_stat based syscalls. 31208 * file.c [X32] (struct __old_kernel_stat): Define. 31209 * linux/x32/syscallent1.h: Remove sys_old*stat redirections. 31210 31211 2013-05-01 James Hogan <james.hogan (a] imgtec.com> 31212 31213 test/threaded_execve: fix on metag. 31214 The metag ABI has stacks growing upwards so clone expects the stack 31215 argument to point at the bottom of the stack instead of the top. 31216 31217 * test/threaded_execve.c [__metag__]: Define clone2 differently 31218 to avoid a segfault at runtime. 31219 31220 2013-05-01 James Hogan <james.hogan (a] imgtec.com> 31221 31222 test/skodic: make a bit more portable. 31223 * test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses 31224 vary between architectures (as far as I can tell the use of MAP_FIXED is 31225 not relevant to the test). Also don't assume the file desriptor returned 31226 by open call is 3 when passing it to mmap. 31227 31228 2013-05-01 Mike Frysinger <vapier (a] gentoo.org> 31229 31230 printllval: handle s390x. 31231 This is a 64bit arch w/no personalities, so fix printing. 31232 It can now trace a simple call like readahead: 31233 $ cat test.c 31234 main(){readahead(-1, (unsigned long long)1 << 50, 0);} 31235 $ gcc test.c 31236 $ ./strace -ereadahead ./a.out 31237 readahead(-1, 1125899906842624, 0) = -1 EBADF (Bad file descriptor) 31238 31239 * util.c (printllval): Handle S390X define. 31240 31241 2013-05-01 Mike Frysinger <vapier (a] gentoo.org> 31242 31243 Stop using old AM_CONFIG_HEADER macro. 31244 Building with automake-1.13 throws an error: 31245 configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete. 31246 You should use the 'AC_CONFIG_HEADERS' macro instead. 31247 31248 * configure.ac (AM_CONFIG_HEADER): Rename to AC_CONFIG_HEADERS. 31249 31250 2013-04-30 Dmitry V. Levin <ldv (a] altlinux.org> 31251 31252 build: introduce git-version-gen. 31253 * .gitignore: Add .version. 31254 * Makefile.am (EXTRA_DIST, BUILT_SOURCES): Add $(srcdir)/.version. 31255 Add rules to check NEWS, generate $(srcdir)/.version and 31256 $(distdir)/.tarball-version files. 31257 Change ChangeLog and CREDITS generation rules to depend on 31258 $(srcdir)/.version instead of $(srcdir)/.git/refs/heads/*. 31259 * NEWS: Add dates to recent releases. 31260 * configure.ac (AC_INIT): Use git-version-gen. 31261 (AM_INIT_AUTOMAKE): Remove check-news. 31262 * git-version-gen: Import from gnulib. 31263 * make-dist: Check NEWS. 31264 31265 Makefile.am: sort long lists to ease maintenance. 31266 * Makefile.am (strace_SOURCES, EXTRA_DIST): Sort, place one list element 31267 per line. 31268 31269 build: fix "make dist" regression introduced by commit v4.7-105-g7270de5 31270 * Makefile.am (EXTRA_DIST): Remove linux/arm/syscallent1.h, 31271 linux/arm/signalent1.h, linux/arm/ioctlent1.h and linux/arm/errnoent1.h. 31272 31273 build: fix "make dist" regression introduced by commit v4.7-29-g17e3860. 31274 * Makefile.am (EXTRA_DIST): Add linux/ioctlent-filter.awk. 31275 31276 2013-04-30 Mike Frysinger <vapier (a] gentoo.org> 31277 31278 Blackfin: tweak sram_alloc syscall decode. 31279 * system.c (sys_sram_alloc): The 2nd argument of sram_alloc syscall 31280 is a bit field, not a specific value, so decode it as such. 31281 31282 2013-03-31 Zev Weiss <zev (a] bewilderbeest.net> 31283 31284 Print io_submit() offsets in decimal. 31285 This makes output formatting more consistent with pread()/pwrite(), 31286 which print their offset parameters in decimal. 31287 31288 * desc.c (sys_io_submit): Change offset output format from %llx to %lld. 31289 31290 2013-03-30 Andreas Schwab <schwab (a] suse.de> 31291 31292 Fix building outside source directory. 31293 The file linux/ioctlent.h is generated in the build directory, so 31294 "../ioctlent.h" won't find it. 31295 31296 * linux/aarch64/ioctlent1.h: Remove "../" from include file name. 31297 * linux/powerpc/ioctlent1.h: Likewise. 31298 * linux/tile/ioctlent1.h: Likewise. 31299 * linux/x32/ioctlent1.h: Likewise. 31300 * linux/x86_64/ioctlent1.h: Likewise. 31301 * linux/x86_64/ioctlent2.h: Likewise. 31302 31303 2013-03-30 Andreas Schwab <schwab (a] suse.de> 31304 31305 AArch64: Fix printing of long long value. 31306 * util.c (printllval): Fix printing of long long values on 31307 AArch64. 31308 31309 2013-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 31310 31311 Update PR_* constants. 31312 * process.c (prctl_options): Add more PR_* constants from linux/prctl.h. 31313 31314 2013-03-25 Chris Zankel <chris (a] zankel.net> 31315 31316 Add support for the XTENSA architecture. 31317 * configure.ac: Add XTENSA to the list of supported architectures. 31318 * defs.h: Add XTENSA support. 31319 * linux/xtensa/syscallent.h: New file. 31320 * linux/xtensa/ioctlent.h.in: Likewise. 31321 * process.c (struct_user_offsets): Add XTENSA support. 31322 * signal.c (sys_sigreturn): Likewise. 31323 * syscall.c (printcall, get_scno, get_syscall_args, 31324 get_syscall_result, get_error): Likewise. 31325 * util.c (change_syscall): Likewise. 31326 31327 2013-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31328 31329 Add example script which builds static (possibly cross-compiled) strace. 31330 31331 2013-03-21 Dmitry V. Levin <ldv (a] altlinux.org> 31332 31333 Use 64-bit versions of stat, readdir and setrlimit functions when available 31334 strace already has a mechanism to use fopen64 for output when the 64-bit 31335 version of fopen is available on 32-bit architectures. Apply this 31336 mechanism for other three functions to make strace fully adopted for 31337 64-bit types. 31338 31339 * strace.c (struct_stat, stat_file, struct_dirent, read_dir, 31340 struct_rlimit, set_rlimit): New macros. 31341 (startup_attach): Use read_dir. 31342 (startup_child): Use struct_stat and stat_file. 31343 (main): Use struct_rlimit and set_rlimit. 31344 31345 2013-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 31346 31347 Do not use struct dirent in readdir decoding. 31348 struct dirent from libc should not be used for umove'ing into because it 31349 contains fixed size d_name. 31350 31351 * file.c (printdir): Rename to print_old_dirent. 31352 [SH64]: Decode using struct kernel_dirent. 31353 [!SH64]: Decode using an open-coded struct with 32-bit d_ino and d_off. 31354 (sys_readdir): Update. 31355 31356 2013-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 31357 31358 Do not use off_t in sendfile decoding. 31359 sendfile parser used to decode off_t* parameter as a pointer to host 31360 off_t type. With this change, it is decoded as a pointer to target long 31361 type. 31362 31363 * io.c (print_off_t): New function. 31364 (sys_sendfile): Use it. 31365 * linux/aarch64/syscallent1.h: Use sys_sendfile64 for sendfile decoding. 31366 * linux/tile/syscallent.h: Likewise. 31367 * linux/x32/syscallent.h: Likewise. 31368 * linux/x86_64/syscallent.h: Likewise. 31369 * linux/hppa/syscallent.h: Use sys_sendfile64 for sendfile64 decoding. 31370 * linux/metag/syscallent.h: Correct sendfile syscall name. 31371 * linux/or1k/syscallent.h: Likewise. 31372 31373 2013-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 31374 31375 Fix build with older versions of libaio.h. 31376 * configure.ac: When libaio.h is available, check for 31377 struct iocb.u.c.flags, IO_CMD_PWRITE and IO_CMD_PWRITEV. 31378 * desc.c (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS. 31379 (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and 31380 HAVE_DECL_IO_CMD_PWRITEV. 31381 31382 Fix io_submit decoding. 31383 * desc.c (print_common_flags, sys_io_submit): Add missing ", " to 31384 SUB_COMMON output, remove extra ", " from SUB_VECTOR output. 31385 31386 2013-03-18 Maxin B. John <maxin.john (a] enea.com> 31387 31388 tests: relax check_prog to allow timeout command provided by busybox. 31389 Busybox version of timeout doesn't have --version option. 31390 Relax check_prog to handle those cases. 31391 31392 * tests/init.sh (check_prog): Use type builtin to check program 31393 availability. 31394 31395 2013-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 31396 31397 Reorganize get_regs code, hopefully without functional changes. 31398 * syscall.c [I386 || ARM || OR1K || METAG] (ARCH_REGS_FOR_GETREGSET): 31399 New macro. 31400 (get_regset): Implement for AARCH64, METAG, OR1K and X32. 31401 (get_regs) [AARCH64 || METAG || OR1K || X32]: Use it. 31402 31403 arm, i386: use PTRACE_GETREGSET if available. 31404 * syscall.c [ARM || I386 || X86_64] (get_regset): New function. 31405 (get_regs) [ARM || I386 || X86_64]: Use it. 31406 31407 Include <sys/uio.h> and <elf.h> on all architectures. 31408 * syscall.c: Include <sys/uio.h> and <elf.h> on all architectures. 31409 31410 x86-64: enhance PTRACE_GETREGSET test. 31411 * syscall.c (get_regs) [X86_64]: Check whether PTRACE_GETREGSET 31412 works regardless of the kernel version. 31413 31414 x32: use PTRACE_GETREGSET unconditionally. 31415 * syscall.c (get_regs) [X32]: Assume that PTRACE_GETREGSET always works 31416 regardless of the kernel version. 31417 31418 x86-64, x32: do not include linux/ptrace.h unnecessarily. 31419 * syscall.c [X86_64 || X32]: Stop including linux/ptrace.h. 31420 31421 i386, tile, x32: do not redefine ptrace prototype. 31422 * defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h. 31423 31424 ptrace: decode note segment descriptor types. 31425 * configure.ac (AC_CHECK_HEADERS): Add elf.h. 31426 * process.c: Include elf.h. 31427 (nt_descriptor_types): New xlat structure. 31428 (sys_ptrace): Use it. 31429 31430 2013-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 31431 31432 Update MADV_* constants. 31433 * mem.c (madvise_cmds): Add more MADV_* constants from 31434 asm-generic/mman-common.h 31435 31436 Reported-by: Robin Hack <hack.robin (a] gmail.com> 31437 31438 2013-03-07 Denys Vlasenko <vda.linux (a] googlemail.com> 31439 31440 Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers() 31441 count_syscall() was calling setitimer/getitimer once in order to find 31442 smallest "tick" OS uses in time accounting, in order to use it 31443 for syscalls which apparently spent less than that time in syscall. 31444 The code assumed that this "tick" is not zero... but it is zero 31445 on linux-3.6.11. Which means that this hack doesn't work... 31446 31447 At least this change prevents this measurement from being done 31448 _repeatedly_, by initializing one_tick to -1, not 0. 31449 31450 While at it, added comments in count_syscall() explaining what we are doing. 31451 31452 Optimized call_summary_pers() a bit, by eliminating redundant tv -> float 31453 conversions, and prevented 0.0/0.0 which was resulting in "% time" 31454 being shown as "-nan" if total CPU time spent was 0.000000 31455 (try "strace -c /bin/true"). 31456 31457 The code seems to seriously underestimate CPU usage: 31458 "strace -c ls -lR /usr/share >/dev/null" shows total time spent 31459 in syscalls to be only ~10..20% of what "time ls -lR /usr/share >/dev/null" 31460 shows. 31461 31462 It might be useful to have a mode where we show wall clock time 31463 spent in syscalls, not CPU time. It might also be more accurate. 31464 31465 text data bss dec hex filename 31466 245019 676 5708 251403 3d60b strace_old 31467 244923 684 5676 251283 3d593 strace 31468 31469 2013-03-06 Denys Vlasenko <vda.linux (a] googlemail.com> 31470 31471 Open-code isprint(c) and isspace(c) 31472 We don't call setlocale, thus we always use C locale. 31473 But libc supports various other locales, and therefore 31474 its ctype interface is general and at times inefficient. 31475 For example, in glibc these macros result in function call, 31476 whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e 31477 suffices. 31478 31479 By open-coding ctype checks (we have only 4 of them) 31480 we avoid function calls, we get smaller code: 31481 31482 text data bss dec hex filename 31483 245127 680 5708 251515 3d67b strace_old 31484 245019 676 5708 251403 3d60b strace 31485 31486 and we don't link in ctype tables (beneficial for static builds). 31487 31488 2013-03-06 Denys Vlasenko <vda.linux (a] googlemail.com> 31489 31490 Makefile: add commented-out tweak to generate link map. 31491 31492 Stop using a large static buffer in getfdpath. 31493 text data bss dec hex filename 31494 245075 680 9836 255591 3e667 strace_old 31495 245143 680 5708 251531 3d68b strace 31496 31497 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 31498 31499 Fix wrongly indented closing curly brace. No code changes. 31500 31501 strace_vfprintf: if malloc fails, exit gracefully. 31502 31503 2013-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 31504 31505 Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFT. 31506 PAGE_SHIFT couldn't be reliably obtained at compile time, 31507 thanks to Chris Metcalf for the hint. 31508 31509 * mem.c: Do not include <sys/user.h>. 31510 [SH64] Do not include <asm/page.h>. 31511 (get_pagesize): New function. 31512 (sys_mmap_pgoff, sys_old_mmap_pgoff): Use it. 31513 31514 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 31515 31516 Emit better message for ERESTARTNOHAND return. 31517 31518 Disable STREAMS syscalls for non-SPARC. 31519 text data bss dec hex filename 31520 3002 0 1024 4026 fba stream.o.old 31521 1729 0 1024 2753 ac1 stream.o 31522 31523 Fix printstrbufarg's address argument to be long, not int. 31524 31525 Remove variable tracing_paths and check in pathtrace_match. 31526 31527 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 31528 31529 Use dynamically-sized selected[] array for -P PATH. 31530 While at it, added a small optimization of not remembering 31531 the path twice if it happens to be the same. 31532 31533 text data bss dec hex filename 31534 245111 680 10860 256651 3ea8b strace_old 31535 245075 680 9804 255559 3e647 strace 31536 31537 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 31538 31539 metag,or1k: whitesace style fix. no code changes. 31540 31541 Assorted fixes to syscallent.h. 31542 or1k was missing TM on many memory-related syscalls 31543 sys_lookup_dcookie is 3-arg on 64-bit arches, and isn't TF 31544 sys_recvmsg is 3-arg on all arches 31545 sys_nfsservctl is 3-arg on all arches 31546 sys_timerfd_create is 2-arg on all arches 31547 sys_[f]truncate64 is 4-arg or 3-arg, never 5-arg 31548 truncate64 is TF 31549 sys_[l]lseek is TD 31550 fstat[64] is TD 31551 31552 2013-03-05 James Hogan <james.hogan (a] imgtec.com> 31553 31554 Add support for Imagination Technologies Meta. 31555 Add support for Imagination Technologies Meta architecture (the 31556 architecture/ABI is usually referred to as metag in code). The Meta 31557 Linux kernel port is in the process of being upstreamed for v3.9 so it 31558 uses generic system call numbers. 31559 31560 sys_lookup_dcookie writes a filename to buffer argument, so I've set 31561 TF flag. 31562 nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h 31563 so I've left it blank. 31564 truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit 31565 args which are packed tightly on metag, so less arguments on metag. 31566 fchdir/llseek takes a file descriptor so s/TF/TD/ 31567 sync_file_range has 2 64bit args so uses 6 args, so s/4/6/ 31568 timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/ 31569 shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args. 31570 oldgetrlimit is just getrlimit for metag. 31571 add TM flag to various memory syscalls. 31572 metag doesn't directly use sys_mmap_pgoff for mmap2. 31573 prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag. 31574 fanotify_init doesn't appear to take a file descriptor so remove TD. 31575 Add kcmp syscall. 31576 31577 Cc: Christian Svensson <blue (a] cmd.nu> 31578 31579 2013-03-01 Denys Vlasenko <vda.linux (a] googlemail.com> 31580 31581 umovestr: speed up check for NUL byte in the fetched word. 31582 31583 2013-03-01 Dmitry V. Levin <ldv (a] altlinux.org> 31584 31585 Fix trace=set regression introduced by commit v4.7-111-g9cbc15b. 31586 * syscall.c (qual_syscall, qualify): Pass personality down to 31587 qualify_one. 31588 * tests/qual_syscall: New test. 31589 * tests/Makefile.am (TESTS): Add qual_syscall. 31590 31591 2013-03-01 Chris Metcalf <cmetcalf (a] tilera.com> 31592 31593 tile: handle printllval like x86_64 or powerpc64. 31594 Without this fix the tilegx build fails when it hits the new #error 31595 about SIZEOF_LONG > 4. 31596 31597 * util.c (printllval): Fix printing of long long values on TILE. 31598 31599 2013-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 31600 31601 Make -b take SYSCALL param, document it in --help and in manpage. 31602 To not waste an option letter for just one trick, 31603 extend -b to take a parameter: 31604 "on which syscalls do you want to detach?". 31605 Currently supports only execve. 31606 31607 While at it, fixed (by removing non-Linux and stale info) 31608 and extended manpage text about -f. 31609 31610 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 31611 31612 Cleanup umoven and umovestr. 31613 Cleanup sloppy error handling. 31614 31615 First, EFAULT kind of errors from process_vm_readv by itself is not 31616 something unusual, so a warning message will not be issued unless a 31617 short read is detected. 31618 31619 Second, clients of umoven and umovestr are not prepared to detect and 31620 handle short reads that can happen in these functions. The most safe 31621 way to handle them is to return an error code. 31622 31623 * util.c (umoven, umovestr): Cleanup handling of errors coming from 31624 process_vm_readv and PTRACE_PEEKDATA. 31625 31626 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 31627 31628 pathtrace: fix umovestr return code check. 31629 * pathtrace.c (upathmatch): Only NUL-terminated strings can be 31630 path-matched, so fix the umovestr return code check to filter out 31631 unsuitable strings. 31632 31633 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 31634 31635 Fix compilation errors uncovered by -Werror=enum-compare. 31636 This fixes regression introduced by commit v4.7-111-g9cbc15b. 31637 31638 * syscall.c: Merge all nsyscalls* enums into single enum. 31639 Likewise merge nerrnos*, nsignals*, and nioctlents* into single enums. 31640 31641 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 31642 31643 Mass replace error_msg("%s", "literal") -> error_msg("literal") 31644 There is no need to print literal strings through "%s". 31645 Only untrusted strings such as filenames need that. 31646 31647 2013-02-26 Ben Noordhuis <info (a] bnoordhuis.nl> 31648 31649 Make umoven report success as 0, not >=0, stop returning success on partial reads 31650 umoven() uses process_vm_readv() when available but it returns the 31651 return value of that syscall, which is the number of bytes copied, 31652 while its callers expect it to simply return zero on success. 31653 31654 It was causing syscalls that take a user-space argument to print 31655 the abbreviated version, e.g.: 31656 31657 epoll_ctl(5, EPOLL_CTL_ADD, 10, {...}) 31658 31659 Instead of: 31660 31661 epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=10, u64=10}}) 31662 31663 * util.c (umoven): Make umove[n] report success as 0, not >=0, 31664 stop returning "success" on partial reads. 31665 31666 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 31667 31668 Assorted NOMMU fixes. 31669 With -D, strdup'ing of pathname is necessary only on NOMMU. 31670 31671 Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode 31672 (try "strace [-D] -b env echo HI" to see whether we detach on correct execve). 31673 31674 Fix test_ptrace_FOO shortcuts on NOMMU to always assume success 31675 and _properly_ set all variables. 31676 31677 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 31678 31679 Shorten help text - no need to show deprecated option -F. 31680 31681 2013-02-23 Denys Vlasenko <vda.linux (a] googlemail.com> 31682 31683 Merge adjacent tprint's. 31684 31685 Correct i > MAX_NSYSCALLS commparison: should be i >= MAX_NSYSCALLS. 31686 31687 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31688 31689 Fix wrong offset display in dumpstr. 31690 BTW, the new code from prev commit is 5 times faster 31691 than old one :) 31692 31693 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31694 31695 Fix a bug in dumpstr (no null termination). Essentially rewrote dumpstr. 31696 This is a 14 year old bug (!). 31697 31698 It wasn't biting us merely because outstr[80] was static, thus ended up 31699 in bss and whatever was after it "accidentally" provided the NUL byte. 31700 When dumpstr was changed to use on-stack buffer, the bug reared its ugly head. 31701 31702 This is a rewrite which is smaller and should be significantly faster 31703 for _long_ strings. 31704 31705 text data bss dec hex filename 31706 244627 680 10860 256167 3e8a7 strace.t9/strace 31707 244563 680 10860 256103 3e867 strace.ta/strace 31708 31709 * util.c (dumpstr): Rewrite to be faster and smaller. 31710 31711 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31712 31713 Eliminate MAX_QUALS, make qualifier array dynamic. 31714 MAX_QUALS was 2048, even though most arches used less than 500 entries 31715 in it. MAX_QUALS had to be maintained by hand to be higher than syscall 31716 count. It also limited the highest possible fd to track. 31717 31718 This change makes qual_flagsN[] arrays start sized to the required minimum 31719 (number of syscalls) and grow dynamically if user requested 31720 -e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit 31721 can be raised with no cost for normal strace invocations. 31722 31723 qual_flags is now a define to qual_vec[current_personality]. 31724 31725 As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent 31726 names in one-personality arches to their corresponding <foo>0 arrays, 31727 removing one indirection level. 31728 31729 text data bss dec hex filename 31730 244471 700 12928 258099 3f033 strace.t7/strace 31731 244627 680 10860 256167 3e8a7 strace.t8/strace 31732 31733 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31734 31735 Create and use struct_sysent and struct_ioctlent typedefs. 31736 This is a preparatory mass replace patch with no code changes. 31737 31738 The future change will need to typedef sysent to sysent0, 31739 which results in compile failures when "struct sysent" string 31740 gets mangled into "struct sysent0". 31741 31742 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 31743 31744 Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev() 31745 We have hundreds of uses of these macros. 31746 Result is more efficient and 1.1 kbyte shorter code: 31747 31748 text data bss dec hex filename 31749 245579 700 12928 259207 3f487 strace.t5/strace 31750 244471 700 12928 258099 3f033 strace.t6/strace 31751 31752 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 31753 31754 Remove unused QUAL_FAULT code (was used by non-Linux code only). 31755 31756 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 31757 31758 Use uint8_t for qual_flags[] instead of ints. 31759 Resulting bss reduction is ~6kbytes: 31760 31761 text data bss dec hex filename 31762 245703 700 19072 265475 40d03 strace.t4/strace 31763 245687 700 12928 259315 3f4f3 strace.t5/strace 31764 31765 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 31766 31767 Eliminate many SCNO_IS_VALID checks. 31768 By adding tcp->s_ent pointer tot syscall table entry, 31769 we can replace sysent[tcp->scno] references by tcp->s_ent. 31770 More importantly, we may ensure that tcp->s_ent is always valid, 31771 regardless of tcp->scno value. This allows us to drop 31772 SCNO_IS_VALID(tcp->scno) checks before we access syscall 31773 table entry. 31774 31775 We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks 31776 with a similar technique. 31777 31778 Resulting code shrink: 31779 text data bss dec hex filename 31780 245975 700 19072 265747 40e13 strace.t3/strace 31781 245703 700 19072 265475 40d03 strace.t4/strace 31782 31783 * count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check. 31784 * defs.h: Add "int qual_flg" and "const struct sysent *s_ent" 31785 to struct tcb. Remove "int u_nargs" from it. 31786 Add UNDEFINED_SCNO constant which will mark undefined scnos 31787 in tcp->qual_flg. 31788 * pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check. 31789 Use tcp->s_ent instead of sysent[tcp->scno]. 31790 * process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs. 31791 (sys_waitid): Likewise. 31792 * strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS 31793 constant is consistent with init code. 31794 * syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs 31795 instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent. 31796 (decode_ipc_subcall): Likewise. 31797 (printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs. 31798 (printargs_lu): Likewise. 31799 (printargs_ld): Likewise. 31800 (get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check. 31801 If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values. 31802 (internal_fork): Use tcp->s_ent instead of sysent[tcp->scno]. 31803 (syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check. 31804 Use tcp->s_ent instead of sysent[tcp->scno]. 31805 (get_syscall_args): Likewise. 31806 (get_error): Drop SCNO_IS_VALID check where it is redundant. 31807 (dumpio): Drop SCNO_IS_VALID check where it is redundant. 31808 Use tcp->s_ent instead of sysent[tcp->scno]. 31809 (trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead 31810 of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno]. 31811 Drop SCNO_IS_VALID check where it is redundant. 31812 Print undefined syscall name with undefined_scno_name(tcp). 31813 (trace_syscall_exiting): Likewise. 31814 * util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno]. 31815 31816 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 31817 31818 ARM: make it one-personality arch. 31819 ARM in fact _is_ one personality. 31820 31821 We had two personalities for it because it has a handful of 31822 syscalls with huge scnos (0x000f00xx). 31823 31824 Extending syscall table to have [0x000f0005] index is of course 31825 not a good idea. 31826 31827 Someone decided to handle that by having a separate personality 31828 just for these syscalls. 31829 31830 But multi-personality arch does a bit more work in other parts. 31831 31832 This patch is another alternative: "move" 0x000f00nn syscalls 31833 down to the entries just above last ordinary syscall, 31834 by manipulating scno if it falls into the 0x000f00xx range. 31835 31836 In order to not worsen genuine undefined scnos' printing, 31837 the code remaps scno back to actual value before printing 31838 "syscall_NNN" string. 31839 31840 * defs.h: Remove multi-reprsonality defines from ARM. 31841 * syscall.c (shuffle_scno): New function. 31842 (undefined_scno_name): New function. 31843 (get_scno): [ARM] Replace personality setting with scno shuffling. 31844 (trace_syscall_entering): Print unknown syscall name using 31845 undefined_scno_name(). 31846 (trace_syscall_exiting): Likewise. 31847 * linux/arm/syscallent.h: Add ARM specific syscalls at the end. 31848 * linux/arm/errnoent1.h: Deleted. 31849 * linux/arm/ioctlent1.h: Deleted. 31850 * linux/arm/signalent1.h: Deleted. 31851 * linux/arm/syscallent1.h: Deleted. 31852 31853 2013-02-20 Denys Vlasenko <vda.linux (a] googlemail.com> 31854 31855 arm: shorten syscall table for EABI - no point in storing NULL entries. 31856 Also, reformatted ARM code in get_scno(), mostly improved comments, 31857 without code changes. 31858 31859 Use the same style of includes in linux/*/* files. 31860 While at it, fix some comments which say 31861 "we use i386 syscalls/ioctls/errnos" but in reality 31862 common ones are used. 31863 31864 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 31865 31866 Fix compiler warnings. 31867 With constant current_wordsize == 4 and 32-bit longs, 31868 gcc was spooked by "1ul << (8 * current_wordsize)" = "1ul << 32". 31869 31870 Make such places conditional on SIZEOF_LONG > 4. 31871 31872 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 31873 31874 Improve comment text. No code changes. 31875 31876 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 31877 31878 Fix NOMMU + daemonized tracer SEGV. 31879 pathname[] was getting destroyed, execve of garbage pathname 31880 failing, and to top it off, the tracer's stack was also 31881 smashed and trecer segfaulted. 31882 31883 * strace.c (exec_or_die): New function. 31884 (startup_child): Don't use pathname[] contents after vfork, 31885 make a malloced copy instead. Explain "NOMMU + -D bug" 31886 and how we work around it. 31887 31888 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 31889 31890 Make it possible to to do test builds for NOMMU architectures. 31891 And while using it, I discovered that -D doesn't work too well 31892 on NOMMU. Added a comment about it. 31893 31894 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 31895 31896 Clean up mmap decoding. 31897 Previous code merges too many similar, but different ways 31898 of decoding mmap. For example, sys_old_mmap is "params in memory" 31899 API... except SH[64], where it is "params in regs", 31900 i.e. what sys_mmap ("new mmap") function does on other arches! 31901 31902 It's much simpler when every mmap handler has same API regardless 31903 of arch. Where API means whether params are in regs or in memory, 31904 and whether offset is in bytes, pages, or 4k blocks. 31905 31906 Then we just insert correct function pointers into 31907 arch syscall tables. 31908 31909 It turns out there are four common mmap APIs over 31910 all architectures which exist in Linux kernel, 31911 and one outlier for S390. 31912 31913 A number of mmap decoders were plain wrong in arch tables. 31914 For example, BFIN has no old_mmap. It returns ENOSYS. 31915 I checked kernel sources for all arches nad fixed the tables. 31916 31917 There was dead code for x86_64 for old_mmap: 31918 x86_64 has no old_mmap. 31919 31920 * mem.c: Refactor mmap functions so that we have five mmap syscall 31921 handlers, each with the fixed API (not varying by arch). 31922 * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks. 31923 * linux/syscall.h: Declare new mmap syscall handler functions. 31924 * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff. 31925 * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff. 31926 * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff. 31927 * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff. 31928 * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff. 31929 * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff. 31930 * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff. 31931 * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff. 31932 * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff. 31933 * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff. 31934 * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff. 31935 * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff. 31936 * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg. 31937 * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff. 31938 * linux/sh64/syscallent.h: Likewise. 31939 * linux/sparc/syscallent1.h: mmap is TD|TM. 31940 * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff. 31941 31942 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 31943 31944 Remove unused function sys_mmap64. 31945 No wonder that it is unused. 31946 It's code looked quite questionable. 31947 31948 * mem.c (sys_mmap64): Remove this function. 31949 31950 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 31951 31952 Remove code which supports systems with long long off_t. 31953 While looking at mmap mess, did experimenting in order 31954 to figure out what gets used when. 31955 31956 Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686, 31957 x86_64 and none of they have long long off_t, 31958 which isn't suprprising: we aren't using glibc defines 31959 which enable that. 31960 31961 Moreover, we SHOULD NOT use off_t in syscall decode! 31962 Its size depends on libc, not on arch! I.e. it is essentially 31963 unpredictable and can even in theory vary on the same arch 31964 with different libc. 31965 31966 We should use longs or long longs, in a way which matches 31967 architectural ABI for the given syscall. There are usually 31968 *at most* two permutations, no need to add yet another variable 31969 (sizeof(off_t)) to the mix. 31970 31971 This change removes almost all HAVE_LONG_LONG_OFF_T conditionals, 31972 which will reveal further possible simplifications. 31973 31974 * mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. 31975 As a result, never remap sys_mmap64 to sys_mmap. 31976 (print_mmap): Compile unconditionally. 31977 (sys_old_mmap): Compile unconditionally. 31978 (sys_mmap): Compile unconditionally. 31979 * io.c (sys_sendfile): Add a FIXME comment. 31980 * file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. 31981 As a result, never remap sys_*stat64 to sys_*stat etc. 31982 (sys_truncate): Compile unconditionally. 31983 (realprintstat): Likewise. 31984 (sys_stat): Likewise. 31985 (sys_fstat): Likewise. 31986 (sys_lstat): Likewise. 31987 * desc.c (printflock): Likewise. 31988 31989 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 31990 31991 Fixes in "new" mmap. 31992 * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5]. 31993 Add page shift of offset for I386. 31994 Use tcp->ext_arg[5] as offset for X32. 31995 (sys_old_mmap): [X32] Remove this function, X32 doesn't use is. 31996 31997 Preliminary simplifications in mmap functions. 31998 * mem.c: Move "define sys_mmap64 sys_mmap" from the top 31999 to the only place it affects. 32000 (print_mmap): Make offset argument unsigned, for safer implicit conversions. 32001 (sys_old_mmap): [IA64] use unsigned narrow_arg[]. 32002 Cast u_arg[5] (offset param) to unsigned long, to prevent erroneous signed 32003 expansion. 32004 32005 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32006 32007 Remove broken HAVE_LONG_LONG conditionals. 32008 We use printllval without HAVE_LONG_LONG guards in many places, 32009 but define it only if HAVE_LONG_LONG. This means that 32010 on !HAVE_LONG_LONG systems we won't build for some time now. 32011 32012 * defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro 32013 and printllval() function declaration. 32014 * util.c: Remove HAVE_LONG_LONG guard around printllval() 32015 function definition. 32016 (printllval): Add compile-time error check for using wrong 32017 if branch. Explain places where we deliberately use mismatched 32018 types for printf formats. 32019 32020 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32021 32022 Use explicit long type instead of off_t. 32023 * file.c (sys_lseek): Use long instead of off_t. 32024 32025 Merge two identical tables. 32026 * defs.h: Declare whence_codes[]. 32027 * desc.c: Delete static whence[]. 32028 (printflock[64]): Use whence_codes. 32029 * file.c: Make whence_codes[] non-static. 32030 Add SEEK_DATA and SEEK_HOLE to them. 32031 32032 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32033 32034 Remove wrong x32-specific lseek. 32035 Testing confirmed what I suspected: x32 lseek uses kernel-sized 32036 (i.e. wide) long for offset parameter. 32037 32038 * file.c: Delete sys_lseek32. 32039 * linux/syscall.h: Likewise. 32040 * linux/x32/syscallent1.h: Likewise. 32041 * test/x32_lseek.c: New file. 32042 32043 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32044 32045 Fix SEGV in lseek. 32046 I found hard way why the code was using "_whence" name. 32047 32048 * file.c: Rename whence[] to whence_codes[]. 32049 (sys_lseek): Fix printxval() to use whence_codes[]. 32050 (sys_lseek32): Likewise. 32051 32052 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32053 32054 Comment inner workings of sys_[l]lseek. 32055 The code doesn't look fully correct to me, but I need to experiment 32056 on actual x32 machine before I start "fixing" things. 32057 For now, add comments, and optimize out one tprints() call... 32058 32059 * file.c (sys_lseek): Rename '_whence' as 'whence'. 32060 Merge printing of ", " into subsequent tprintf. 32061 (sys_lseek32): Likewise. 32062 (sys_llseek): Likewise. 32063 32064 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 32065 32066 Cosmetic fixes to syscall tables, no code changes. 32067 32068 2013-02-16 Denys Vlasenko <vda.linux (a] googlemail.com> 32069 32070 Make linux/mips/syscallent.h smaller. 32071 * linux/mips/syscallent.h: Remove trailing empty elements. 32072 Compactify huge stretches of NULL elements in the middle. 32073 32074 Simple optimization in get_error. 32075 * defs.h: Define SCNO_IN_RANGE(scno) macro. 32076 * syscall.c (get_error): Change return type to void. 32077 Use SCNO_IN_RANGE instead of SCNO_IS_VALID. 32078 (trace_syscall_exiting): Stop checking get_error() return value. 32079 32080 Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALID. 32081 32082 Finish prefixing regs struct names with arch_ 32083 * defs: Rename regs -> sparc_regs. 32084 * signal.c (sys_sigreturn): Use new variable name. 32085 * syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs. 32086 (getrval2): Use new variable names. 32087 (printcall): Likewise. 32088 32089 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32090 32091 Use the same type for i386_regs on 32-bit and 64-bit x86. 32092 * defs.h: Stop including <asm/ptrace.h> for x86. 32093 Change i386_regs from "struct pt_regs" to "struct user_regs_struct". 32094 * syscall.c: Likewise. 32095 32096 Fix build error on Tile. 32097 * syscall.c (get_scno): [TILE] Remove TCB_WAITEXECVE check, 32098 it is never true on Tile, and stopped compiling when 32099 TCB_WAITEXECVE define was removed for Tile. 32100 32101 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32102 32103 x86: zero-extend 32-bit args in syscall entry instead of sign-extension. 32104 Zero-extension is slightly more common that sign-extension: 32105 all pointers are zero-extended, and some other params are unsigned. 32106 32107 Whereas signed ones (fds, pids, etc) are often treated as 32108 _32-bit ints_ even by kernel, so just unconditionally casting 32109 such tcp->u_arg[N] to int works. 32110 32111 * syscall.c (get_syscall_args): [X86] Zero-extend 32-bit args 32112 instead of sign-extension. 32113 32114 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32115 32116 Macroize conditional signed widening operation. 32117 * defs.h: Define widen_to_long() macro. 32118 * signal.c (sys_kill): Use it instead of open-coding it. 32119 (sys_tgkill): Use widen_to_long() on pids. 32120 * resource.c (decode_rlimit): Formatting fix. 32121 32122 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32123 32124 A better handling of current_wordsize. 32125 On x86_64: 32126 text data bss dec hex filename 32127 435661 26628 47424 509713 7c711 strace_old 32128 435501 26612 47440 509553 7c671 strace_new_clever_wordsize 32129 32130 On x32 and arm it should be even better, current_wordsize becomes 32131 a constant there. 32132 32133 * defs.h: Declare current_wordsize as a variable if needed, 32134 else declare as a constant define. 32135 Remove declatation of personality_wordsize[]. 32136 * syscall.c: Make personality_wordsize[] static. 32137 Declare current_wordsize as a variable if needed. 32138 (set_personality): Set current_wordsize only if non-constant. 32139 32140 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32141 32142 Remove unnecessary "return 0" statements. 32143 * util.c (change_syscall): Remove dummy "return 0"s. 32144 32145 2013-02-14 Denys Vlasenko <vda.linux (a] googlemail.com> 32146 32147 x86: fix required kernel version for GETREGSET. 32148 * syscall.c (get_regs): [X86] Use GETREGSET only if kernel >= 2.6.35 32149 32150 Whitespace fix, no code changes. 32151 32152 2013-02-14 Christian Svensson <blue (a] cmd.nu> 32153 32154 Add support for the OpenRISC 1000 platform. 32155 * configure.ac: Added or1k architecture.. 32156 * defs.h: Added or1k to use register reading system. 32157 * linux/or1k/ioctlent.h.in: Use i386 ioctls. 32158 * linux/or1k/syscallent.h: New file. 32159 * process.c: Added or1k register defs to struct_user_offsets[]. 32160 * syscall.c: Added or1k_io iovec for or1k GETREGSET, 32161 regset structure for or1k. 32162 (printcall): Added handling for or1k. 32163 (get_regs): Likewise. 32164 (get_scno): Likewise. 32165 (get_syscall_args): Likewise. 32166 (get_syscall_result): Likewise. 32167 (get_error): Likewise. 32168 * util.c (change_syscall): Added dummy handling for or1k. 32169 * system.c (sys_or1k_atomic): New function (or1k specific syscall). 32170 32171 2013-02-14 Denys Vlasenko <vda.linux (a] googlemail.com> 32172 32173 [X86] Use ptrace(PTRACE_GETREGSET, NT_PRSTATUS) to get registers. 32174 Unlike PTRACE_GETREGS, this new method detects 32-bit processes 32175 reliably, without checking segment register values which 32176 are undocumented and aren't part of any sort of API. 32177 While at it, also fixed x32 detection to use __X32_SYSCALL_BIT, 32178 as it should have been from the beginning. 32179 32180 * defs.h: Declare os_release and KERNEL_VERSION. 32181 * strace.c: Make os_release non-static, remove KERNEL_VERSION define. 32182 * syscall.c: New struct i386_user_regs_struct, 32183 static union x86_regs_union and struct iovec x86_io. 32184 (printcall): Use i386_regs or x86_64_regs depending on x86_io.iov_len. 32185 (get_regs): On x86 and kernels 2.6.30+, use PTRACE_GETREGSET, 32186 on earlier kernels fall back to old method. 32187 (get_scno): [X86] Determine personality based on regset size 32188 on scno & __X32_SYSCALL_BIT. 32189 (syscall_fixup_on_sysenter): Use i386_regs or x86_64_regs depending 32190 on x86_io.iov_len. 32191 (get_syscall_args): Likewise. 32192 (get_error): Likewise. 32193 32194 2013-02-13 Denys Vlasenko <vda.linux (a] googlemail.com> 32195 32196 Rename some register statics by prefixing their names with arch. 32197 This makes it easier to grep for them. 32198 32199 * syscall.c: Rename variables: 32200 r0 -> bfin_r0,alpha_r0,sh_r0. 32201 a3 -> mips_a3. 32202 r2 -> mips_r2. 32203 (get_scno): Use new variable names. 32204 (get_syscall_result): Likewise. 32205 (get_error): Likewise. 32206 32207 2013-02-13 Denys Vlasenko <vda.linux (a] googlemail.com> 32208 32209 Factor out code to check addr, fetch and print siginfo. 32210 * defs.h: Declare new function printsiginfo_at(tcp, addr). 32211 * process.c (sys_waitid): Use printsiginfo_at(). 32212 (sys_ptrace): Likewise. 32213 * signal.c: (printsiginfo_at): Implement this new function. 32214 (sys_rt_sigsuspend): Use printsiginfo_at(). 32215 (sys_rt_sigtimedwait): Likewise. 32216 32217 Decode struct iov in PTRACE_GET/SETREGSET. 32218 * process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET. 32219 32220 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32221 32222 Unify representations of struct user fields for subarchitectures. 32223 * process.c: Unify MIPS and LINUX_MIPSN32, and SH and SH64 parts of 32224 struct_user_offsets[]. 32225 32226 Add start_code and start_data members of struct user. 32227 * process.c: Add start_code and start_data members of struct user 32228 in struct_user_offsets[], where appropriate. 32229 32230 Remove hacks for old kernels for architectures which require new kernels 32231 * util.c (change_syscall): For MICROBLAZE, replace code 32232 with dummy "return 0" and a comment explaining why that is ok 32233 for this architecture. 32234 32235 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32236 32237 Remove stray syscall result reading code on syscall entry for s390. 32238 This is a leftover from sysenter/sysexit split. 32239 I can't run-test it, but from code inspection it seems to be correct. 32240 32241 * syscall.c (get_scno): Remove stray syscall result reading for s390[x]. 32242 32243 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32244 32245 Deobfuscate definitions of struct user offsets. 32246 The maze of ifdefs/ifndefs was scaring new contributors. 32247 Format it so that every arch has its own ifdef block. 32248 32249 * process.c: Deobfuscate definitions of struct user offsets. 32250 32251 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32252 32253 Remove hacks for old kernels for architectures which require new kernels 32254 * defs.h: Do not define TCB_WAITEXECVE for AARCH64. 32255 * util.c (change_syscall): For AARCH64 and X32, replace code 32256 with dummy "return 0" and a comment explaining why that is ok 32257 for these architectures. 32258 32259 Remove old kernel hacks for architectures which require new kernels. 32260 * defs.h: Do not define TCB_WAITEXECVE for AVR32, BFIN and TILE. 32261 * util.c (change_syscall): For AVR32, BFIN and TILE, replace code 32262 with dummy "return 0" and a comment explaining why that is ok 32263 for these architectures. 32264 32265 Handle recv[m]msg for non-native 32-bit personality syscalls. 32266 * net.c (printmsghdr): If current_wordsize is 4 and long is wider than it, 32267 read 32-bit struct msghdr and expand it into a native one before using it. 32268 (printmmsghdr): Likewise for struct mmsghdr. 32269 32270 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32271 32272 Fix is_negated_errno() check for X32. 32273 X32's return value is 64-bit. We were truncating it to 32-bit long 32274 before checking for -errno. 32275 32276 * syscall.c (is_negated_errno_x32): New function. 32277 (get_error): Use is_negated_errno_x32 for X32 architecture. 32278 32279 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 32280 32281 Remove unused / ambiguously used defines. 32282 We sometimes use LINUXSPARC and sometimes (more often) 32283 use "defined(SPARC) || defined(SPARC64)". Better to use 32284 one construct consistently. 32285 LINUX_MIPS64 is altogether unused. 32286 32287 * defs.h: Remove LINUXSPARC and LINUX_MIPS64 defines. 32288 Move PTRACE_xxx compat defines up, before arch-specific 32289 machinery. Use defined(SPARC) || defined(SPARC64) 32290 instead of LINUXSPARC. 32291 * file.c: Use defined(SPARC) || defined(SPARC64) instead of LINUXSPARC. 32292 * signal.c: Likewise. 32293 32294 2013-02-11 Denys Vlasenko <vda.linux (a] googlemail.com> 32295 32296 Preparatory patch for "new" x86 personality detection. 32297 * syscall.c: Move PT_FLAGS_COMPAT define to its only user, get_scno(). 32298 Rename arm_regs_union's fields to names less likely to collide with 32299 system defines. 32300 (get_regs): Use sizeof(arm_regs_union) instead of sizeof(aarch64_regs). 32301 This should be the same, but htis way it's cleaner. 32302 Remove __X32_SYSCALL_MASK and use __X32_SYSCALL_BIT instead. 32303 Explain 64-bit check in X32 build better. 32304 32305 2013-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 32306 32307 Fix sigaltstack decoder. 32308 strace used to hang when decoding sigaltstack called with invalid 32309 stack_t pointers because of mishandling umove() return code. 32310 32311 * signal.c (print_stack_t): Handle unfetchable stack_t properly. 32312 Change return type to void. 32313 (sys_sigaltstack): Update print_stack_t() usage. 32314 32315 Reported-by: kawillia (a] ucalgary.ca 32316 32317 2013-02-09 Mike Frysinger <vapier (a] gentoo.org> 32318 32319 Fix decoding of sysctl() when oldval fields are NULL. 32320 If you call glibc's syscall wrapper like so: 32321 static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE }; 32322 int buffer[2] = { 32768, 61000 }; 32323 size_t size = sizeof(buffer); 32324 sysctl(name, 3, 0, 0, buffer, size); 32325 (note that oldval/oldlenp are NULL). 32326 32327 The current strace code complains like so: 32328 _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, process_vm_readv: Bad address 32329 (nil), 0, 0x7fffe23c3960, 8}) = -1 EACCES (Permission denied) 32330 32331 Since passing NULL for the old values is valid, handle that explicitly. 32332 This also simplifies the code a bit by splitting up the handling of the 32333 new and old args so that we only handle the new args once. 32334 32335 Now the output looks like: 32336 _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, NULL, 0, 0x7fff8c0c91b0, 8) = -1 EACCES (Permission denied) 32337 32338 * system.c (sys_sysctl): Check if info.oldval is NULL first. Move the 32339 processing of oldlen/info.newval/info.newlen out so they always get 32340 executed. Fix the format strings so we use %lu for unsigned long rather 32341 than a mix of %ld and %lu. 32342 32343 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 32344 32345 If we are on a glibc system, assume it's at least glibc 2.1. 32346 It is not likely anyone uses glibc older that that: 32347 glibc 2.1.1 was released in 1999 32348 32349 * net.c: Remove test for glibc >= 2.1. 32350 * signal.c: Remove code which is compiled only for glibc < 2.1. 32351 * util.c: Likewise. 32352 32353 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 32354 32355 S390: stop using needlessly static long pc variable. 32356 * syscall.c: Remove "static long pc" variable. 32357 (get_scno): Use an automatic long variable instead of a static. 32358 32359 Dying suddenly with abort() is rude, avoid if possible. 32360 * file.c (sys_utime): Don't call abort() if wordsize is strange. 32361 Instead, warn user about it. 32362 * desc.c (printflock): Use the same message string as in sys_utime. 32363 32364 Remove vestigial hacks around non-Linux struct sigactions. 32365 * signal.c: Stop using __sighandler_t glibc'ism. Remove SA_HANDLER macro. 32366 Explain why we can't use "sa_handler" as a field name. 32367 (sys_sigaction): Use __sa_handler instead of SA_HANDLER macro. 32368 (sys_rt_sigaction): Likewise. 32369 32370 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 32371 32372 Optimize AArch64 handling of 32-bit personality. 32373 By putting aarch64_regs and arm_regs into a union, 32374 register copying is eliminated. 32375 No need to check and change personality on syscall exit. 32376 32377 * defs.h: Remove unused NUM_ARM_REGS define. Fix indentation. 32378 * syscall.c: Put aarch64_regs and arm_regs into a union. 32379 (update_personality): Shorten bitness message. 32380 (printcall): Add commented-out PC printing. 32381 (get_regs): Remove now-unnecessary 64-to-32 bits register copying. 32382 (get_syscall_result): Drop personality changing code. 32383 32384 2013-02-07 Denys Vlasenko <vda.linux (a] googlemail.com> 32385 32386 Rename some register statics by prefixing their names with arch. 32387 This makes it easier to grep for them. 32388 32389 * syscall.c: Make IA64's r8, r10 global variables static. 32390 Rename variables: 32391 r8,r10 -> ia64_r8,ia64_r10. 32392 d0 -> m68k_d0. 32393 a3 -> alpha_a3. 32394 r28 -> hppa_r28. 32395 r9 -> sh64_r9. 32396 r10 -> cris_r10. 32397 r3 -> microblaze_r3. 32398 (get_scno): Use new variable names. 32399 (syscall_fixup_on_sysenter): Likewise. 32400 (get_syscall_result): Likewise. 32401 (get_error): Likewise. 32402 32403 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 32404 32405 Rename ARM's regs structure to arm_regs. 32406 Compile-tested. 32407 32408 * defs.h: Rename regs structure to arm_regs. 32409 * syscall.c: Likewise. 32410 (printcall): Use new name instead of old one. 32411 (get_regs): Likewise. 32412 (get_scno): Likewise. 32413 (get_syscall_args): Likewise. 32414 (get_error): Likewise. 32415 * signal.c (sys_sigreturn): Likewise. 32416 32417 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 32418 32419 Stop needlessly using static variable. 32420 * syscall.c: Remove static long psr. 32421 (get_scno): Use local psr variable. 32422 (get_syscall_result): Likewise. 32423 32424 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 32425 32426 Shortcut tests for fork/exec syscalls. 32427 This change should speed up strace by a tiny bit. 32428 32429 More importantly, it makes it much more clear that 32430 fork and exec fixups are not necessary for any reasonably 32431 recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees 32432 are all dead code. 32433 32434 * defs.h: Declare new need_fork_exec_workarounds flag variable. 32435 * strace.c: Define need_fork_exec_workarounds flag variable. 32436 (test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator. 32437 (test_ptrace_setoptions_for_all): Likewise. 32438 (init): Set need_fork_exec_workarounds to TRUE if needed. 32439 * syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec(). 32440 (trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if 32441 need_fork_exec_workarounds == TRUE. 32442 (trace_syscall_exiting): Likewise. 32443 32444 2013-02-05 Ben Noordhuis <info (a] bnoordhuis.nl> 32445 32446 Improve perf_event_open argument decoding. 32447 * configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h. 32448 * desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>. 32449 (perf_event_open_flags): New xlat structure. 32450 (sys_perf_event_open): New function. 32451 * linux/dummy.h (sys_perf_event_open): Remove. 32452 * linux/syscall.h (sys_perf_event_open): New prototype. 32453 32454 2013-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 32455 32456 tile: fix merge skew with new get_regs architecture. 32457 * defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error. 32458 * syscall.c (get_regs) [TILE]: Fix merge skew. 32459 (printcall) [TILE]: fix a compiler warning about pt_reg_t in 32460 a printf expression. 32461 32462 2013-02-05 Bernhard Reutner-Fischer <rep.dot.nop (a] gmail.com> 32463 32464 mount: decode MS_NOSEC. 32465 * system.c (MS_NOSEC): Define. 32466 (mount_flags): Add MS_NOSEC. 32467 32468 mmap: decode MAP_UNINITIALIZED. 32469 * mem.c (mmap_flags): Add MAP_UNINITIALIZED. 32470 32471 2013-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 32472 32473 Print 64-bit instruction pointers zero padded. 32474 * syscall.c (printcall): Print 64-bit instruction pointers zero padded. 32475 32476 x86_64: fix compilation warning introduced in previous commit. 32477 * syscall.c (printcall): Cast x86_64_regs.rip to the type being printed. 32478 32479 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 32480 32481 Simple bug fix for x86_86. 32482 * syscall.c (printcall): Use x86_64_regs.rip, not x86_64_regs.ip. 32483 32484 2013-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 32485 32486 Add tilegx support to strace. 32487 tilegx support has been in the kernel since 3.0. 32488 In addition, fix some issues with the tilepro support already 32489 present in strace, primarily the decision to use the 32490 <asm/unistd.h> numbering space for system calls. 32491 32492 * defs.h [TILE]: Include <asm/ptrace.h> and provide an extern 32493 struct pt_regs tile_regs for efficiency. Provide compat 32-bit 32494 personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE, 32495 PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY. 32496 * linux/tile/errnoent1.h: New file, includes linux/errnoent.h. 32497 * linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h. 32498 * linux/tile/signalent1.h: New file, includes linux/signalent.h. 32499 * linux/tile/syscallent.h: Update with new asm-generic syscalls. 32500 The version previously committed was the from the first tile patch 32501 to LKML, which subsequently was changed to use <asm-generic/unistd.h>. 32502 * linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h. 32503 * mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable. 32504 * process.c [TILE]: Choose clone arguments correctly and properly 32505 suppress all "struct user" related offsets in user_struct_offsets. 32506 * signal.c [TILE]: Use tile_regs not upeek. 32507 * syscall.c (update_personality) [TILE]: Print mode. 32508 (PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers. 32509 (tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state. 32510 (get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek. 32511 (get_scno) [TILE]: Set personality. 32512 (get_syscall_args) [TILE]: Use tile_regs. 32513 (get_syscall_result) [TILE]: Update tile_regs. 32514 (get_error) [TILE]: Use tile_regs. 32515 (printcall) [TILE]: Print pc. 32516 (arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]: 32517 Properly handle tile call semantics and support tilegx. 32518 32519 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 32520 32521 Small optimization for SPARC[64] get_scno. 32522 * syscall.c: Remove static unsigned long trap veriable. 32523 (get_scno): Use local trap variable. 32524 32525 Do not compile getrval2() if not needed. 32526 * syscall.c (getrval2): Do not compile it for architetures where 32527 it isn't ever used. 32528 32529 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 32530 32531 Optimize out PTRACE_PEEKUSER with -i. 32532 strace -i was fetching PC with a separate PEEKUSER 32533 despite having GETREGS data: 32534 32535 ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0 32536 ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0 32537 write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82 32538 ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0 32539 32540 Now it does this: 32541 32542 ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0 32543 write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82 32544 ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0 32545 32546 Analogous improvement in sys_sigreturn() is also implemented. 32547 32548 * defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM. 32549 Declare clear_regs(), get_regs() and get_regs_error flag variable. 32550 * strace.c (trace): Call get_regs(pid) as soon as we know the tcb 32551 and that it is stopped. 32552 * syscall.c (get_regs): New function. Used to fetch registers early, 32553 just after tracee has stopped. 32554 (printcall): Move it here from util.c. Use global regs.REG data, 32555 if available on the arch, instead of re-fetching it. 32556 (get_scno): Use global regs.REG data. 32557 (get_syscall_result): Likewise. 32558 * signal.c (sys_sigreturn): Likewise. 32559 * util.c (printcall): Moved to syscall.c. 32560 32561 2012-12-15 Stanislav Brabec <sbrabec (a] suse.cz> 32562 32563 Fix sys_semtimedop decoding on s390x. 32564 The s390 and s390x pass semtimedop arguments differently from other 32565 architectures. sys_semtimedop parser was fixed for s390 by commit 32566 v4.6-177-ge0f5fd8, and s390x requires the same fix. 32567 32568 * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390x. 32569 32570 2012-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 32571 32572 Fix *xattr decoding. 32573 * file.c (print_xattr_val): Do not attempt to decode a zero sized array. 32574 Fixes RH#885233. 32575 32576 2012-12-08 Stanislav Brabec <sbrabec (a] suse.cz> 32577 32578 sys_semtimedop: fix timeval argument index in wrapped call. 32579 Looking at the implementation of wrapped semtimedop() call inside glibc 32580 and kernel, I started to believe that timeval should be located in 32581 tcp->u_arg[4] and not tcp->u_arg[5]. Fortunately, tcp->u_arg[5] now 32582 works correctly as well, due to side effects of decode_ipc_subcall(). 32583 32584 declaration in header: 32585 int semtimedop(semid, *sops, nsops, *timeout); 32586 0 1 2 3 32587 32588 sys_ipc arguments in glibc on all patforms except s390*: 32589 semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout 32590 0 1 2 3 4 32591 We have to use indexes: 0 3 1 4 32592 32593 sys_ipc arguments on s390*: 32594 semid, (int) nsops, timeout, sops 32595 0 1 2 3 32596 We have to use indexes: 0 3 1 2 32597 32598 * ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in 32599 indirect_ipccall case. 32600 32601 2012-12-06 John Spencer <maillist-strace (a] barfooze.de> 32602 32603 Fix glibc version checks. 32604 * util.c: Check if __GLIBC__ is defined before using it. 32605 * signal.c: Likewise. Fix __GLIBC_MINOR__ checks. 32606 32607 2012-11-29 James Hogan <james.hogan (a] imgtec.com> 32608 32609 Add state argument to change_syscall and fix SPARC. 32610 Add a state argument to change_syscall() so that SPARC can modify that 32611 instead of read-modify-writing the whole register set. This function is 32612 always called within an arg_setup/arg_finish_change sequence which on 32613 certain architectures like SPARC will also be doing a read-modify-write. 32614 This prevents the second write (from arg_finish_change) from undoing the 32615 effects of the change_syscall call. 32616 32617 * util.c (change_syscall): Move below definition of arg_setup_state. 32618 Add state argument. 32619 [SPARC || SPARC64] Change to set state->u_regs[U_REG_G1] rather than 32620 read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS. 32621 (setbpt, clearbpt): Pass state argument to change_syscall. 32622 32623 2012-11-12 Steve McIntyre <steve.mcintyre (a] linaro.org> 32624 32625 Add support for tracing 32-bit ARM EABI binaries on AArch64. 32626 * defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the 32627 accessor macros, so it's possible to build on AArch64 without 32628 ARM system headers. Set SUPPORTED_PERSONALITIES to 2. 32629 Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE. 32630 Set DEFAULT_PERSONALITY to 1. 32631 * linux/aarch64/errnoent1.h: New file, includes generic errnoent.h. 32632 * linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h. 32633 * linux/aarch64/signalent1.h: New file, includes generic signalent.h. 32634 * linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h. 32635 * linux/aarch64/syscallent.h: New file, includes arm/syscallent.h. 32636 * syscall.c [AARCH64]: Define aarch64_regs. 32637 (update_personality) [AARCH64]: Add debug output. 32638 (get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by 32639 checking the size of the returned uio structure from PTRACE_GETREGSET 32640 and interpret the structure accordingly. 32641 (get_syscall_result): Likewise. 32642 (get_syscall_args): Merge the AArch64 and ARM sections so that on 32643 AArch64 we can fall back to supporting the ARM personality. 32644 (get_error): Likewise. 32645 32646 2012-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 32647 32648 Move asm-generic ioctl definitions to linux/ioctlent.h.in. 32649 * linux/ioctlent.h.in: Add asm-generic ioctl entries from all 32650 linux/*/ioctlent.h.in files. 32651 * linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries. 32652 * linux/i386/ioctlent.h.in: Likewise. 32653 * linux/powerpc/ioctlent.h.in: Likewise. 32654 * linux/s390/ioctlent.h.in: Likewise. 32655 * linux/sparc/ioctlent.h.in: Likewise. 32656 32657 2012-10-27 Dmitry V. Levin <ldv (a] altlinux.org> 32658 32659 Filter out redundant "*32" ioctl entries. 32660 * linux/ioctlent-filter.awk: New file. 32661 * Makefile.am: Use it. 32662 * linux/ioctlent.h.in: Removed redundant "*32" entries. 32663 32664 2012-10-26 Dmitry V. Levin <ldv (a] altlinux.org> 32665 32666 Enhance quotactl decoding. 32667 * quota.c (sys_quotactl): Decode 2nd syscall argument using printpath. 32668 * pathtrace.c (pathtrace_match): Add quotactl support. 32669 * linux/*/syscallent.h: Add TF flag to quotactl entry. 32670 32671 2012-10-26 Steve McIntyre <steve.mcintyre (a] linaro.org> 32672 32673 Add AArch64 support to strace. 32674 AArch64 has been included in linux from 3.7 onwards. 32675 Add support for AArch64 in strace, tested on linux in a simulator. 32676 32677 * configure.ac: Support AArch64. 32678 * defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE. 32679 * ipc.c (indirect_ipccall): Support AArch64. 32680 * process.c (struct_user_offsets): Likewise. 32681 * syscall.c [AARCH64]: Include <asm/ptrace.h>, <sys/uio.h>, and 32682 <elf.h>. Define struct user_pt_regs regs. 32683 (get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET. 32684 (get_syscall_args, get_error): Support AArch64. 32685 * linux/aarch64/ioctlent.h.in: New file. 32686 * linux/aarch64/syscallent.h: New file, based on linux 3.7 version of 32687 asm-generic/unistd.h. 32688 32689 2012-10-26 Steve McIntyre <steve.mcintyre (a] linaro.org> 32690 32691 linux: add new errno values for EPROBE_DEFER and EOPENSTALE. 32692 New definitions match updates in Linux 3.4 and Linux 3.5 respectively. 32693 32694 * linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER. 32695 (ERRNO_518): Change to EOPENSTALE. 32696 32697 2012-10-26 Namhyung Kim <namhyung.kim (a] lge.com> 32698 32699 Add -e trace=memory option. 32700 Add a new 'memory' category for tracing memory mapping related syscalls. 32701 32702 Affected syscalls are: break, brk, get_mempolicy, madvise, mbind, 32703 migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect, 32704 mremap, msync, munlock, munlockall, munmap, remap_file_pages, and 32705 set_mempolicy. 32706 32707 * defs.h (TRACE_MEMORY): New macro. 32708 * syscall.c (lookup_class): Handle trace=memory option. 32709 * strace.1: Document it. 32710 * linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls. 32711 * linux/arm/syscallent.h: Likewise. 32712 * linux/avr32/syscallent.h: Likewise. 32713 * linux/bfin/syscallent.h: Likewise. 32714 * linux/hppa/syscallent.h: Likewise. 32715 * linux/i386/syscallent.h: Likewise. 32716 * linux/ia64/syscallent.h: Likewise. 32717 * linux/m68k/syscallent.h: Likewise. 32718 * linux/microblaze/syscallent.h: Likewise. 32719 * linux/mips/syscallent.h: Likewise. 32720 * linux/powerpc/syscallent.h: Likewise. 32721 * linux/s390/syscallent.h: Likewise. 32722 * linux/s390x/syscallent.h: Likewise. 32723 * linux/sh/syscallent.h: Likewise. 32724 * linux/sh64/syscallent.h: Likewise. 32725 * linux/sparc/syscallent.h: Likewise. 32726 * linux/tile/syscallent.h: Likewise. 32727 * linux/x32/syscallent.h: Likewise. 32728 * linux/x86_64/syscallent.h: Likewise. 32729 32730 2012-09-28 Mike Frysinger <vapier (a] gentoo.org> 32731 32732 x32: add 64bit annotation too. 32733 Since someone can invoke these entry points directly with syscall(), 32734 at least decode their name and show that they're 64bit versions rather 32735 than just showing syscall_###. 32736 32737 * linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64. 32738 32739 2012-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 32740 32741 Ignore fflush(3) return value. 32742 strace used to honor fflush(3) return value in trace_syscall_entering 32743 which resulted to tracees not being PTRACE_SYSCALL'ed which in turn 32744 caused nasty hangups like this one: 32745 32746 $ strace -o'|:' pwd 32747 |:: Broken pipe 32748 32749 There is little strace can do in case of fflush(3) returning EOF, and 32750 hangup is certainly not the best solution for the issue. 32751 32752 * syscall.c (trace_syscall_entering): Ignore fflush(3) return value. 32753 32754 2012-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 32755 32756 Use perror_msg instead of perror. 32757 * signal.c (sys_sigreturn): Use perror_msg instead of perror. 32758 * strace.c (tprintf, tprints, detach, startup_attach): Likewise. 32759 * syscall.c (get_scno): Likewise. 32760 * util.c (umoven, umovestr): Likewise. 32761 32762 2012-09-27 Denys Vlasenko <vda.linux (a] googlemail.com> 32763 32764 process_vm_readv may return ESRCH if tracee was killed, don't complain. 32765 Discovered by running test/sigkill_rain under strace. 32766 32767 * util.c (umoven): Do not emit error message if process_vm_readv 32768 fails with ESRCH. 32769 (umovestr): LikeWise. 32770 32771 2012-09-13 Denys Vlasenko <vda.linux (a] googlemail.com> 32772 32773 Trivial fixes, no code changes. 32774 * strace.c: Fix compiler warning message about tgkill - we don't use it. 32775 Fix indentation of preprocessor directives. 32776 (trace): Remove outdated comment. 32777 32778 2012-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 32779 32780 Always check setreuid return code. 32781 * strace.c (startup_child): Check setreuid return code. 32782 32783 2012-08-24 Mike Frysinger <vapier (a] gentoo.org> 32784 32785 x32: update {g,s}etsockopt syscall numbers. 32786 Starting with linux 3.6 (and backported to earlier kernels), these two 32787 syscalls have changed numbers (moving from native to compat entry points). 32788 Update the strace syscall list accordingly. 32789 32790 * linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move 32791 getsockopt from 55 to 542. 32792 32793 2012-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 32794 32795 Decode file type returned by getdents system call. 32796 * file.c (sys_getdents): Decode d_type in unabbreviated mode. 32797 32798 2012-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 32799 32800 Close pipe and wait for the pipe process termination. 32801 In case of normal strace termination, when the trace output is 32802 redirected to a file or a pipe, close it and wait for the pipe 32803 process termination. 32804 32805 * strace.c (main): Before normal exit, close shared_log when it 32806 differs from stderr, and wait for popen_pid termination. 32807 32808 2012-07-10 Denys Vlasenko <vda.linux (a] googlemail.com> 32809 32810 Enable usage of PTRACE_SEIZE. 32811 * defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL 32812 and PTRACE_EVENT_STOP1. 32813 * strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL 32814 with 0. 32815 (trace): Do not check for PTRACE_EVENT_STOP1. 32816 32817 2012-06-05 Mike Frysinger <vapier (a] gentoo.org> 32818 32819 x32: update syscall table. 32820 This syncs with the syscall table as it is in linux 3.4. 32821 32822 * linux/x32/syscallent.h (59): Fix comment typo. 32823 (78): Add missing getdents entry. 32824 (174): Delete create_module entry (not in the kernel). 32825 (181, 182, 183, 184, 185): Add missing entries. 32826 (524, 536, 539, 540): Fix spacing. 32827 32828 2012-05-18 Denys Vlasenko <vda.linux (a] googlemail.com> 32829 32830 Merge adjacent printing operations in a few places. 32831 * file.c (sys_readahead): Merge tprints() with following printllval(). 32832 (sys_ftruncate64): Likewise. 32833 (sys_fadvise64): Likewise. 32834 (sys_fadvise64_64): Likewise. 32835 (sys_fallocate): Merge tprints() with following tprintf(). 32836 32837 2012-05-16 Denys Vlasenko <vda.linux (a] googlemail.com> 32838 32839 Use %d printf format instead of %i everywhere. 32840 * loop.c (loop_ioctl): Use %d instead of %i. 32841 * mtd.c (mtd_ioctl): Likewise. 32842 32843 Fix a few goofs in sys_sysctl() 32844 * system.c (sys_sysctl): Cast pointer to long, not size_t, 32845 when we intend to use it as an address. Set oldlen to 0 prior 32846 to reading into it - we want to have deterministic result 32847 if read fails. 32848 32849 2012-05-16 Denys Vlasenko <vda.linux (a] googlemail.com> 32850 32851 Stop using non-standard %Zu and %Zd formats for size_t printing. 32852 The documented formats are %zu and %zd, but since our (normally disabled) 32853 "fast" printf code doesn't support those too, I convert them to %lu and %ld. 32854 32855 * bjm.c (sys_query_module): Convert %Zd usages to %lu. 32856 * system.c (sys_sysctl): Likewise. 32857 32858 2012-05-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32859 32860 Remove outdated comment about suspending new tracees. 32861 We no longer track parent/child relationship between tracees. 32862 Therefore, we no longer suspend new tracee until parent is seen 32863 exiting form [v]fork/clone. The comment is obsolete. 32864 32865 * strace.c (trace): Remove outdated comment. 32866 32867 2012-05-15 Denys Vlasenko <vda.linux (a] googlemail.com> 32868 32869 Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches 32870 On 64bit systems with a single personality, they used to be sizeof(long), 32871 which has type "long", not "int", which complicates printf formats. 32872 32873 * defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int. 32874 This in turn makes sure current_wordsize is also an int. 32875 * count.c (call_summary): Revert the change which added cast to int. 32876 32877 2012-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 32878 32879 Add configure --enable-gcc-Werror option. 32880 * configure.ac: New option --enable-gcc-Werror. 32881 32882 Make x86-64 build free of artificial warnings. 32883 * signal.c (sys_sigreturn): Do not issue "no sys_sigreturn" warning 32884 on X86_64. 32885 32886 2012-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 32887 32888 Fix kernel release string parsing. 32889 * strace.c (get_os_release): Handle "X.Y-something" utsname.release 32890 strings properly. 32891 32892 Reported-by: Bryce Gibson <bryce (a] gibson-consulting.com.au> 32893 32894 2012-05-14 Denys Vlasenko <vda.linux (a] googlemail.com> 32895 32896 On clearing "breakpopint", restore syscall number too. 32897 This fixes Fedora bug 659382. 32898 Low risk: this code is not supposed to be used on any non-acient kernel. 32899 32900 * util.c (clearbpt): Restore syscall number too. 32901 32902 2012-05-05 Mike Frysinger <vapier (a] gentoo.org> 32903 32904 util: fix building when glibc has a stub process_vm_readv. 32905 If you have a newer glibc which provides process_vm_readv, but it is built 32906 against older kernel headers which lack __NR_process_vm_readv, the library 32907 will contain a stub implementation that just returns ENOSYS. Autoconf 32908 checks for this case explicitly and will declare it as unavailable. So we 32909 end up in a case where the headers provide the prototype, but autoconf has 32910 not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again: 32911 32912 util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration 32913 /usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here 32914 32915 So rename our local function to something unique, and add a define so the 32916 callers all hit the right place. 32917 32918 * util.c (strace_process_vm_readv): Rename from process_vm_readv. 32919 (process_vm_readv): Define to strace_process_vm_readv. 32920 32921 2012-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 32922 32923 doc: describe documentation policy. 32924 * README-hacking: Describe documentation policy. 32925 32926 2012-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 32927 32928 maint: post-release administrivia. 32929 * NEWS: Add header line for next release. 32930 32931 Prepare for 4.7 release. 32932 * configure.ac: Version 4.7. 32933 * debian/changelog: 4.7-1. 32934 * strace.spec: 4.7-1. 32935 32936 Fix build with <linux/loop.h> from 2.6.18 kernel headers. 32937 * configure.ac: Check for LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN 32938 declarations. 32939 * loop.c (loop_flags_options): Use LO_FLAGS_AUTOCLEAR and 32940 LO_FLAGS_PARTSCAN only when appropriate declarations are available. 32941 (loop_ioctl): Use LOOP_SET_CAPACITY only when it is defined. 32942 32943 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 32944 32945 * vsprintf.c: Check for USE_CUSTOM_PRINTF earlier. 32946 32947 Remove duplicate names from CREDITS. 32948 * .mailmap: Merge email addresses. 32949 * CREDITS.in: Remove a duplicate name. 32950 32951 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 32952 32953 tests: raise strace check timeout to 60 seconds. 32954 * tests/init.sh (check_timeout): New variable. 32955 * tests/ptrace_setoptions: Use it. 32956 * tests/strace-f: Likewise. 32957 32958 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 32959 32960 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 32961 32962 Update STA_* constants. 32963 * time.c (adjtimex_status): Add STA_NANO, STA_MODE, and STA_CLK. 32964 * NEWS (Improvements): Mention it. 32965 32966 NEWS: update for release. 32967 * NEWS (Improvements): Mention recent recvmsg/recvmmsg decoders 32968 enhancements. 32969 (Portability): Add a recommendation for the minimum Linux kernel 32970 version to use. 32971 32972 Make printing of utsname.domainname more portable. 32973 * configure.ac: Check for struct utsname.domainname field. 32974 * process.c (sys_uname): Print utsname.domainname when the field is 32975 available. 32976 32977 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 32978 32979 Fix recvmmsg decode: do not show more data than actually returned. 32980 This change complements recent fix for recvmsg decoding. 32981 32982 * net.c (printmmsghdr): Add msg_len parameter to pass down to do_msghdr. 32983 When this parameter is zero, pass mmsghdr.msg_len to do_msghdr instead. 32984 (decode_mmsg): Add msg_len parameter, pass it down to printmmsghdr. 32985 (sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L. 32986 (sys_recvmmsg): Call decode_mmsg with msg_len == 0. 32987 32988 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 32989 32990 Remove recently introduced use of ULONG_MAX. 32991 * io.c: Remove limits.h inclusion. 32992 (tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX". 32993 * net.c: Remove limits.h inclusion. 32994 (printmmsghdr, sys_sendmsg): Use "(unsigned long) -1L" instead of 32995 "ULONG_MAX". 32996 32997 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 32998 32999 Enable printing of uts.domainname in uname syscall. 33000 * process.c (sys_uname): Enable printing of uts.domainname 33001 33002 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 33003 33004 Fix printstr's len parameter width. 33005 We often pass syscall params and other long-sized values 33006 as printstr(len). Truncating them to int may be a bad thing. 33007 33008 * defs.h: Change len parameter's type from int to long in 33009 string_quote and printstr function declarations. 33010 * util.c (string_quote): Special-case only len==-1, not all len<0. 33011 (printstr): Likewise. 33012 33013 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 33014 33015 Fix recvmsg decode: do not show more data than actually returned. 33016 I noticed that "hostname -d" talks over netlink and gets 20 bytes 33017 of response, but we show entire 1024 bytes of iov. 33018 This changes fixes that. 33019 33020 * defs.h: New function tprint_iov_upto. 33021 * io.c (tprint_iov_upto): Definition of this function. 33022 (tprint_iov): Call tprint_iov_upto. 33023 * net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto. 33024 (printmsghdr): Add data_size parameter, pass it down to do_msghdr. 33025 (printmmsghdr): Call do_msghdr with data_size==ULONG_MAX. 33026 (sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX. 33027 (sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval. 33028 33029 2012-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 33030 33031 Package strace-log-merge. 33032 * strace.spec (%files): Add strace-log-merge. 33033 33034 2012-04-27 Mike Frysinger <vapier (a] gentoo.org> 33035 33036 NEWS: clarify & fix typo. 33037 33038 2012-04-27 Mike Frysinger <vapier (a] gentoo.org> 33039 33040 Cast current_wordsize to an int. 33041 On 64bit systems with a single personality, we see: 33042 count.c: In function 'call_summary': 33043 count.c:223:5: warning: format '%u' expects type 'unsigned int', 33044 but argument 3 has type 'long unsigned int' 33045 33046 Since on multi-personality systems this is an array of ints, cast 33047 the multiplication to an int and update the printf format. 33048 33049 * count.c (call_summary): Change %u to %d and cast first argument to int. 33050 33051 2012-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 33052 33053 Update NEWS for upcoming 4.7 release. 33054 * NEWS: Update for 4.7 release. 33055 33056 Sync strace.spec and debian/ with packages. 33057 * debian/changelog: Sync with 4.5.20-2.3. 33058 * debian/control: Likewise. 33059 * strace.spec: Sync with 4.6-2. 33060 33061 2012-04-18 Mike Frysinger <vapier (a] gentoo.org> 33062 33063 Decode /dev/loop ioctls. 33064 Needed to debug some losetup failures, and it's easier when you can see 33065 what the kernel is getting vs what you think you're sending, so add some 33066 decoders for those ioctls. 33067 33068 * loop.c: New file. 33069 * Makefile.am (strace_SOURCES): Add loop.c. 33070 * defs.h (loop_ioctl): New prototype. 33071 (string_quote): Likewise. 33072 * ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'. 33073 * util.c (string_quote): Remove static keyword. 33074 33075 2012-04-18 H.J. Lu <hongjiu.lu (a] intel.com> 33076 33077 x32: add ia32 support. 33078 * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h, 33079 linux/x32/ioctlent1.h, linux/x32/signalent1.h and 33080 linux/x32/syscallent1.h. 33081 * configure.ac: Remove AC_GNU_SOURCE, obsoleted by 33082 AC_USE_SYSTEM_EXTENSIONS. 33083 * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32. 33084 (PERSONALITY1_WORDSIZE): Set to 4 for X32. 33085 * file.c (stat64): New struct for X32. 33086 (sys_lseek32): New function for X32. 33087 (stat64): Undef. 33088 (sys_fstat64): Likewise. 33089 (sys_stat64): Likewise. 33090 (realprintstat64): New function for X32. 33091 (sys_fstat64): Likewise. 33092 (sys_stat64): Likewise. 33093 * mem.c (sys_old_mmap): New function for X32. 33094 * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32. 33095 * syscall.c (update_personality): Add X32 support. 33096 (get_scno): Support currpers == 1 for X32. 33097 * linux/syscall.h (sys_lseek32): New function prototype for X32. 33098 * linux/x32/errnoent1.h: New file. 33099 * linux/x32/ioctlent1.h: Likewise. 33100 * linux/x32/signalent1.h: Likewise. 33101 * linux/x32/syscallent1.h: Likewise. 33102 33103 2012-04-17 H.J. Lu <hongjiu.lu (a] intel.com> 33104 33105 Cast clock_t type to unsigned long long. 33106 * resource.c (sys_times): Cast clock_t type to unsigned long long. 33107 * signal.c (printsiginfo): Likewise. 33108 33109 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33110 33111 Add custom (faster) vfprintf implementation (disabled by default) 33112 * defs.h: Declare strace_vfprintf either as a alias to vfprintf 33113 or as a bona fide function. USE_CUSTOM_PRINTF define controls whether 33114 we use strace_vfprintf. By default, we don't. 33115 * strace.c (tprintf): Call strace_vfprintf instead of vfprintf. 33116 * vsprintf.c: New file, implements strace_vfprintf. 33117 33118 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33119 33120 Stop using %h[h]u format specifiers. 33121 This is needed for simplified printf, and reduces code size a bit. 33122 33123 * block.c (block_ioctl): Cast the value to unsinged and use %u 33124 instead of using %hu. 33125 * desc.c (sys_io_cancel): Likewise. 33126 * resource.c (sys_sysinfo): Likewise. 33127 33128 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33129 33130 Trivial speed optimization. 33131 * strace.c (tprints): Use fputs_unlocked instead of fputs. 33132 33133 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 33134 33135 Fix a problem with sys_lseek on x32. 33136 * file.c (sys_lseek): Use MIPS-n32 variant also for x32 33137 33138 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 33139 33140 Add x32 support to strace. 33141 X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with 33142 32bit pointers. At system call level, x32 is also identical to x86-64, 33143 as shown by many changes like "defined(X86_64) || defined(X32)". The 33144 main differerence bewteen x32 and x86-64 is off_t in x32 is long long 33145 instead of long. 33146 33147 This patch adds x32 support to strace. Tested on Linux/x32. 33148 33149 * configure.ac: Support X32. 33150 * defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64, 33151 Set PERSONALITY2_WORDSIZE to 4 for X86_64. 33152 Add tcb::ext_arg for X32. 33153 * file.c (stat): New for X32. 33154 (sys_lseek): Use 64-bit version for X32. 33155 (printstat64): Check current_personality != 1 for X86_64. 33156 * ipc.c (indirect_ipccall): Check current_personality == 1 33157 for X86_64. 33158 * mem.c (sys_mmap64): Also use tcp->u_arg for X32. Print NULL 33159 for zero address. Call printllval for offset for X32. 33160 * pathtrace.c (pathtrace_match): Don't check sys_old_mmap for 33161 X32. 33162 * process.c (ARG_FLAGS): Defined for X32. 33163 (ARG_STACK): Likewise. 33164 (ARG_PTID): Likewise. 33165 (change_syscall): Handle X32. 33166 (struct_user_offsets): Support X32. 33167 (sys_arch_prctl): Likewise. 33168 * signal.c: Include <asm/sigcontext.h> for X32. 33169 (SA_RESTORER): Also define for X32. 33170 * syscall.c (update_personality): Support X32 for X86_64. 33171 (is_restart_error): Likewise. 33172 (syscall_fixup_on_sysenter): Likewise. 33173 (get_syscall_args): Likewise. 33174 (get_syscall_result): Likewise. 33175 (get_error): Likewise. 33176 (__X32_SYSCALL_BIT): Define if not defined. 33177 (__X32_SYSCALL_MASK): Likewise. 33178 (get_scno): Check DS register value for X32. Use 33179 __X32_SYSCALL_MASK on X32 system calls. 33180 * util.c (printllval): Use ext_arg for X32. 33181 (printcall): Support X32. 33182 (change_syscall): Likewise. 33183 (arg0_offset): Likewise. 33184 (arg1_offset): Likewise. 33185 * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h, 33186 linux/x32/ioctlent.h.in, linux/x32/signalent.h, 33187 linux/x32/syscallent.h, linux/x86_64/errnoent2.h, 33188 linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and 33189 linux/x86_64/syscallent2.h. 33190 * linux/x32/errnoent.h: New. 33191 * linux/x32/ioctlent.h.in: Likewise. 33192 * linux/x32/signalent.h: Likewise. 33193 * linux/x32/syscallent.h: Likewise. 33194 * linux/x86_64/errnoent2.h: Likewise. 33195 * linux/x86_64/ioctlent2.h: Likewise. 33196 * linux/x86_64/signalent2.h: Likewise. 33197 * linux/x86_64/syscallent2.h: Likewise. 33198 33199 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 33200 33201 Restore tcb::u_lrval; fix lseek on MIPS-n32. 33202 Linux kernel v3.4 adds x32 support. Both x32 and n32 use 64bit offset 33203 for lseek parameter and return value. We need u_lrval to handle it 33204 properly. Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek. 33205 This patch fixes it properly and prepares lseek for x32. 33206 33207 * defs.h (tcb): Restore tcb::u_lrval field, RVAL_Lfoo constants. 33208 Set RVAL_MASK to 7. 33209 * file.c (sys_lseek): Print 64bit offset and return RVAL_LUDECIMAL 33210 for n32. 33211 * syscall.c (get_error): Set u_lrval for MIPS-n32. 33212 (trace_syscall_exiting): Handle RVAL_Lfoo return value types. 33213 33214 2012-04-06 Mike Frysinger <vapier (a] gentoo.org> 33215 33216 Decode mtd ioctls. 33217 I got tired of figuring out mtd structures (which show up a lot 33218 in the embedded space), so add decoders for those ioctls. 33219 33220 * defs.h (mtd_ioctl): New prototype. 33221 (print_loff_t): Likewise. 33222 * io.c (print_loff_t): Delete static keyword 33223 * ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'. 33224 * Makefile.am (strace_SOURCES): Add mtd.c. 33225 (EXTRA_DIST): Add linux/mtd-abi.h. 33226 * mtd.c: New file. 33227 * linux/mtd-abi.h: New file. 33228 33229 2012-04-05 Mike Frysinger <vapier (a] gentoo.org> 33230 33231 Fix indefinite hang on no-mmu systems. 33232 The ptrace setoptions code will fork a child which goes to sleep and 33233 expects the parent to continue on to do tests. Unfortunately, this 33234 does not work on no-mmu systems as fork() is actually vfork() and any 33235 vforked children will hang the parent until it exits or execs. 33236 33237 We might be able to make this test work on no-mmu systems with a bit 33238 of work, but easier to just disable this for the release so it works 33239 now. 33240 33241 * strace.c (test_ptrace_setoptions_for_all): Return if strace_vforked. 33242 33243 2012-03-29 Denys Vlasenko <vda.linux (a] googlemail.com> 33244 33245 Makefile.am: whitespace fix. 33246 33247 2012-03-27 Anton Blanchard <anton (a] samba.org> 33248 33249 powerpc: Add syscall entries for direct socket system calls. 33250 * linux/powerpc/syscallent.h: Add direct socket system calls. 33251 33252 2012-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 33253 33254 qual_syscall: fix potential NULL dereference. 33255 Fix regression introduced by commit 33256 c1371ebc400fe9578908beca87f2bf407daf1506 33257 33258 * syscall.c (qual_syscall): Handle null sys_name. 33259 33260 Reported-by: Fr. Br. George <george (a] altlinux.org> 33261 33262 2012-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 33263 33264 strace-log-merge: fix file suffix calculation. 33265 * strace-log-merge: Quote file prefix to fix file suffix calculation. 33266 33267 Reported-by: Denys Vlasenko <vda.linux (a] googlemail.com> 33268 Suggested-by: Andreas Schwab <schwab (a] linux-m68k.org> 33269 33270 2012-03-26 Denys Vlasenko <vda.linux (a] googlemail.com> 33271 33272 Remove unreachable code. 33273 * strace.c (process_opt_p_list): Remove unreachable code. 33274 33275 manpage: remove false info about -p being limited to 32 processes. 33276 33277 Tweak help text and manpage (added -In to manpage) 33278 33279 2012-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 33280 33281 printstr: check for potential integer overflow. 33282 * util.c (printstr): Check for potential integer overflow during outstr 33283 buffer size calculation. 33284 33285 Robustify parsing of numbers from strings. 33286 * defs.h (string_to_uint): New prototype. 33287 * util.c (string_to_uint): New function. 33288 * strace.c (error_opt_arg): New function. 33289 (process_opt_p_list): Use string_to_uint instead of atoi. 33290 Terminate in case of invalid process id. 33291 (init): Use string_to_uint instead of atoi. 33292 Use error_opt_arg in case of invalid option argument. 33293 * syscall.c (qual_syscall, qual_signal, qual_desc): Use string_to_uint 33294 instead of atoi. 33295 33296 strace-log-merge: enhance usage error diagnostics. 33297 * strace-log-merge: Add --help option. Check number of arguments. 33298 Issue an error message when no strace output was merged. 33299 33300 configure.ac: sort lists and use m4_normalize to ease maintenance. 33301 * configure.ac (AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_CHECK_MEMBERS, 33302 AC_CHECK_DECLS): Sort lists, use m4_normalize. 33303 33304 2012-03-23 Denys Vlasenko <vda.linux (a] googlemail.com> 33305 33306 Simple optimizations. 33307 Why open-coding isdigit is a good idea? 33308 33309 Before: call __ctype_b_loc 33310 movzbl (%ebx),%edx 33311 mov (%eax),%eax 33312 testb $0x8,0x1(%eax,%edx,2) 33313 je lbl 33314 33315 After: movzbl (%eax),%edx 33316 sub $0x30,%edx 33317 cmp $0x9,%dl 33318 ja lbl 33319 33320 text data bss dec hex filename 33321 236869 704 18944 256517 3ea05 strace.before 33322 236719 700 18944 256363 3e96b strace 33323 33324 * defs.h: Alias sigemptyset to __sigemptyset on glibc. 33325 * syscall.c (qual_syscall): Open-code isdigit. 33326 (qual_desc): Likewise. 33327 (qual_signal): Open-code isdigit. Remove string copying 33328 which was done for no apparent reason. 33329 33330 2012-03-23 Denys Vlasenko <vda.linux (a] googlemail.com> 33331 33332 Reorder declarations in defs.h. No code changes. 33333 * defs.h: Reorder declarations (such as: keep all printing functions together). 33334 33335 2012-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 33336 33337 Simplify current tcp switching and current column handling. 33338 Instead of using "static FILE *outf and static unsigned int curcol" 33339 to cache current outfile and its position, we can simply 33340 remember current tcb and use its ->outf and ->curcol. 33341 This allows to drop numerous "tcp->curcol = curcol" ops in trace(). 33342 33343 Turns out we can't drop "static FILE *outf", but now its role is 33344 a bit clearer: it newer changes after init, stays == stderr or 33345 opened to shared log (which may be the same thing if neither -o 33346 nor -ff was specified). Let's rename it then. 33347 33348 text data bss dec hex filename 33349 236953 704 18944 256601 3ea59 strace.before.prev.commit 33350 236905 704 18944 256553 3ea29 strace.before 33351 236869 704 18944 256517 3ea05 strace 33352 33353 * strace.c: Replace curcol static variable by struct tcb *current_tcp. 33354 Rename static FILE *outf to shared_log (since it no longer caches tcp->outf). 33355 (ptrace_restart): Use current_tcp->curcol instead of curcol. 33356 (tprintf): Check current_tcp != NULL instead of outf != NULL. 33357 Use current_tcp->outf instead of outf, current_tcp->curcol instead of curcol. 33358 (tprints): Likewise. 33359 (line_ended): Likewise. 33360 (printleader): Switch current tcb by "current_tcp = tcp" istead of 33361 assignments to outf and curcol. 33362 (droptcb): Set current_tcp to NULL if we dropped it. 33363 (startup_child): Rename outf to shared_log. 33364 (init): Likewise. 33365 (cleanup): Likewise. 33366 (trace): Simplify current tcp switching and current column handling. 33367 33368 2012-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 33369 33370 Make threaded execve handling code more reabable and somewhat simpler. 33371 * strace.c (droptcb): Remove outfname check in "outfname && followfork >= 2" - 33372 with recent changes, followfork >= 2 check guarantees that outfile 33373 was specified, and _is already opened_. 33374 (trace): Move tcb existence check before threaded execve handling. 33375 This allows to remove tcp != NULL checks in threaded execve handling. 33376 Rewrite threaded execve handling code to be less indented, 33377 keeping the same logic. 33378 33379 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 33380 33381 simple cleanups in defs.h. No logic changes. 33382 * defs.h: Move offsetof macro definition into "libc stuff" section. 33383 Renumber TCB_foo constants (smaller constants -> sometimes smaller code). 33384 Remove uoff macro. 33385 * process.c: Move uoff macro here (sole user). 33386 33387 Show "+++ exited..." with -C. 33388 * strace.c (trace): Show "+++ exited..." with -C too. 33389 Save tcp->curcol after PTRACE_LISTEN failure too, just in case. 33390 33391 Slight tweak to qemu_multiarch_testing scripts. 33392 33393 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 33394 33395 Replace reprinting decision logic. 33396 After this change, we no longer need to decide when we need 33397 to set TCB_REPRINT, and when we don't: it's never needed :) 33398 33399 Well, almost. That pesky pid-changing execve needs special treatment. 33400 If not it, it'd be possible to nuke TCB_REPRINT... 33401 33402 While at it, fix a case of mishandled -C. 33403 33404 * strace.c (printleader): Do not set TCB_REPRINT. 33405 (trace): Set TCB_REPRINT only for execve with changing pid. 33406 Fix mishandling of -C. 33407 * syscall.c (trace_syscall_entering): Do not clear TCB_REPRINT. 33408 (trace_syscall_exiting): Replace reprinting decision logic. 33409 Remove call to printargs(): it is known to just return 0 here. 33410 33411 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 33412 33413 Report some ptrace failures; nuke tcp->ptrace_errno. 33414 Report some (not all) ptrace errors, namely, 33415 errors on ptrace restart operations. 33416 33417 Before: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...> 33418 After: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process> 33419 33420 This tells user that strace failed to let sendto syscall 33421 to be entered - process was dead at that point of time. 33422 It is (marginally) better than to always say "<unfinished ...>" 33423 33424 While at it, patch removes tcp->ptrace_errno. 33425 I added it many months ago, and it looks that after all 33426 it is not needed for ptrace error detection: I failed to execute 33427 a single existing code path which is accessible 33428 through that variable only. 33429 33430 * defs.h: Remove struct tcp::ptrace_errno field. 33431 * strace.c (ptrace_restart): Emit message to log on error. 33432 (printleader): Remove "if (printing_tcp->ptrace_errno)..." code. 33433 (trace): Remove !tcp->ptrace_errno check, it's always true. 33434 33435 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 33436 33437 Eliminate redundant checks of res variable. 33438 * syscall.c (trace_syscall_entering): Eliminate redundant checks of res variable. 33439 (trace_syscall_exiting): Likewise. 33440 33441 Rename POWERPC-specific static variable result to ppc_result. 33442 * syscall.c: Rename POWERPC-specific static variable result to ppc_result. 33443 33444 Remove redundant checks in syscall entry/exit, rename badly named function 33445 * syscall.c (syscall_enter): Rename to get_syscall_args. 33446 Document its return values. 33447 (trace_syscall_entering): Don't check get_syscall_args() return 33448 value for 0, it never returns that. 33449 (syscall_fixup_on_sysexit): Make it return void. 33450 (trace_syscall_exiting): Fix up syscall_fixup_on_sysexit() 33451 call site accordingly. 33452 33453 Trivial tweaks. No logic changes. 33454 * process.c (sys_ptrace): Remove unneeded line wrapping. 33455 * syscall.c (trace_syscall_entering): Use tprints() instead of tprintf(). 33456 33457 Make ptrace_restart() static. No code changes. 33458 * defs.h: Remove ptrace_restart() declaration. 33459 * strace.c (ptrace_restart): Move its definition here. 33460 * util.c (ptrace_restart): Remove its definition. 33461 33462 2012-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 33463 33464 Do not include limits.h unnecessarily. 33465 * ioctl.c: Remove limits.h inclusion left after the reverted change. 33466 33467 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 33468 33469 Partially revert last change. 33470 Thank you Dmitry for spotting it. 33471 33472 * ioctl.c (compare): Partially revert last change - the new 33473 comparison logic was buggy. 33474 33475 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 33476 33477 Simplify search in ioctl table. 33478 text data bss dec hex filename 33479 236973 704 18944 256621 3ea6d strace.before 33480 236929 704 18944 256577 3ea41 strace 33481 33482 * ioctl.c (compare): Simplify generation of compare result. 33483 (ioctl_lookup): Pass key directly, not as part of dummy struct. 33484 (ioctl_next_match): More readable code. No logic changes. 33485 33486 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 33487 33488 Update qemu build script: now tries to upload result back to host. 33489 33490 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 33491 33492 Shrink space needed by undefined syscalls in syscall tables. 33493 Undefined syscall looked like this before this change: 33494 { 5, 0, printargs, "SYS_53" }, 33495 That is, "SYS_53" string had to be allocated and stored in strace binary. 33496 Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL 33497 for valid syscalls, we can replace printargs with NULL in such lines 33498 and make them "invalid", thus not requiring syscall name string. 33499 33500 Savings on i386: 33501 text data bss dec hex filename 33502 237389 704 18944 257037 3ec0d strace.before 33503 236973 704 18944 256621 3ea6d strace 33504 Savings on mips: 33505 336551 153692 38320 528563 810b3 strace.before 33506 275543 153688 38320 467551 7225f strace 33507 33508 Tested to still decode undefined syscalls correctly (syscall no. 222 on i386). 33509 33510 * linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with 33511 'NULL, NULL'. 33512 33513 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 33514 33515 Optimize code if we have only one personality. 33516 On i386: 33517 text data bss dec hex filename 33518 238025 672 18980 257677 3ee8d strace.before 33519 237389 704 18944 257037 3ec0d strace 33520 33521 * defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined. 33522 Introduce new define, current_wordsize as 33523 (personality_wordsize[current_personality]). 33524 Make set_personality() no-op, current_personality constant zero, 33525 current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality. 33526 * count.c (call_summary): Use current_wordsize instead of 33527 personality_wordsize[current_personality]. 33528 * desc.c (printflock): Likewise. 33529 * file.c (sys_utime): Likewise. 33530 * io.c (tprint_iov): Likewise. 33531 * process.c (printargv): Likewise. 33532 * resource.c (decode_rlimit): Likewise. 33533 * signal.c (sys_kill): Likewise. 33534 (sys_rt_sigaction): Likewise. 33535 * time.c (sprinttv): Likewise. 33536 (sprint_timespec): Likewise. 33537 (printitv_bitness): Likewise. 33538 (tprint_timex): Likewise. 33539 (printsigevent): Likewise. 33540 * util.c (dumpiov): Likewise. 33541 (umoven): Likewise. 33542 (umovestr): Likewise. 33543 * syscall.c: Initialize sysent to sysent0 etc. 33544 Make current_personality, personality_wordsize[], set_personality() 33545 conditional on SUPPORTED_PERSONALITIES > 1. 33546 33547 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 33548 33549 Fix mips64 build failure: sys_pwrite64 doesn't exist. 33550 sys_pwrite seems to do the same thing as sys_pwrite64 33551 which we deleted when we removed non-Linux code. 33552 33553 * linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/ 33554 33555 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 33556 33557 qemu_multiarch_testing/: a directory with scripts for build testing. 33558 33559 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 33560 33561 Make internal_fork and internal_exec static. 33562 text data bss dec hex filename 33563 237917 672 18980 257569 3ee21 strace 33564 237845 672 18980 257497 3edd9 strace_new 33565 33566 * defs.h: Remove declarations of internal_fork and internal_exec. 33567 * process.c: Remove definitions of internal_fork and internal_exec. 33568 * syscall.c: Move them here. 33569 (internal_syscall): Return void instead of int. We were always 33570 returning zero, and callers weren't checking it anyway. 33571 33572 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 33573 33574 Remove code which is not used on Linux. 33575 Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686, 33576 mipsel,mips,x86_64 33577 33578 * syscall.c: Remove code which handles RVAL_Lfoo constants. 33579 * defs.h: Remove struct tcb::u_lrval member - it is never set. 33580 Remove RVAL_Lfoo constants which signify return of "long" result - 33581 they are never used. 33582 33583 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 33584 33585 Remove unused version of sys_lseek. 33586 It is buggy: it returns RVAL_LUDECIMAL, which means the return value 33587 is in tcp->u_lrval. But tcp->u_lrval is never set 33588 (on Linux - it used to be set on other OSes). 33589 33590 * file.c (sys_lseek): Remove a version of this function which is 33591 supposed to be used if off_t is long long. It appears to be buggy 33592 and unused. 33593 33594 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 33595 33596 Revert "Remove underscores from a few syscall names which have them" 33597 This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae. 33598 33599 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 33600 33601 Simplify sys_lseek64 conditional compilation. 33602 It looks like sys_lseek64() is never used. 33603 For one, it is buggy (always shows 0 return value), and no one complains. 33604 33605 From code inspection: sys_lseek64 name is not used anywhere. 33606 It is defined to sys_lseek if HAVE_LONG_LONG_OFF_T is true. 33607 Thus, if !HAVE_LONG_LONG_OFF_T, it is never used. 33608 Therefore "if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T" 33609 conditional it sits in can be simplified to 33610 "if HAVE_LONG_LONG_OFF_T". 33611 Therefore, we can move it a bit up and merge with 33612 "if !HAVE_LONG_LONG_OFF_T, use this sys_lseek()" code block, 33613 by addind an "else" clause to it. 33614 To simplify it more, drop define and just rename sys_lseek64 -> 33615 sys_lseek. 33616 33617 Since the function is buggy, I think it is unused and we can 33618 just drop it. (I checked: at least I386 never uses it). 33619 33620 * file.c (sys_lseek64): Rename to sys_lseek; don't compile it 33621 if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case 33622 it is never used. 33623 33624 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 33625 33626 Remove underscores from a few syscall names which have them. 33627 Affected names are "_newselect", "_llseek", "_sysctl". 33628 I see no apparent reason why they have leading underscores. 33629 Moreover, some arches have underscored names and some have 33630 non-underscored ones. This is not consistent. 33631 33632 I verified that every architectire I touched did not have 33633 a similarly named syscall without underscore, thus this change 33634 does not introduce new ambiquities. 33635 33636 I left "_exit" untouched for now, but the same points stand for it too: 33637 some architectures use "exit" and no one complains. So why many 33638 arches are using "_exit"? 33639 33640 * linux/*/syscallent.h: Remove underscores from displayed 33641 syscall names for _newselect, _llseek, _sysctl. 33642 33643 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 33644 33645 Remove unused struct tcb::baddr field. 33646 * defs.h: Remove unused struct tcb::baddr field. 33647 33648 Remove unused PTRACE_WRITE{TEXT,DATA} constants (they are from SunOS) 33649 * util.c: Remove unused PTRACE_WRITE{TEXT,DATA} constants. 33650 33651 Reindent case labels. No code changes. 33652 * net.c (printsockopt): Reindent case labels. 33653 * signal.c (sys_signal): Likewise. 33654 33655 Remove unused constants. No code changes. 33656 * syscall.c: Remove unused ENOIOCTLCMD constant. Fix indentation. 33657 * util.c: Remove unused CLONE_STOPPED constant. 33658 33659 Move change_syscall() to its only user and make it static. 33660 * defs.h: Remove declaration of change_syscall(). 33661 * process.c (change_syscall): Remove definition of this function. 33662 * util.c (change_syscall): Add definition of change_syscall(). 33663 33664 MAP_ANON is the same as MAP_ANONYMOUS, no need to have the former. 33665 * mem.c: Do not allocate string for MAP_ANON if it is the same as 33666 MAP_ANONYMOUS. 33667 33668 Indentation and whitespace fixes. No code changes. 33669 33670 test/threaded_execve: make it also test a case when leader is not in syscall 33671 33672 2012-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 33673 33674 Implement prlimit64 decoding, rewrite [gs]etrlimit decoding. 33675 * configure.ac: Remove AC_RLIM_T_IS_LONG_LONG call. 33676 Define SIZEOF_RLIM_T. 33677 * m4/long_long.m4 (AC_RLIM_T_IS_LONG_LONG): Remove. 33678 * linux/dummy.h (sys_prlimit64): Remove. 33679 * linux/syscall.h (sys_prlimit64): New prototype. 33680 * resource.c (resources): Reindent, add RLIMIT_RTTIME. 33681 (sprintrlim, print_rlimit32, sys_getrlimit, sys_setrlimit): Remove. 33682 [HAVE_LONG_LONG_RLIM_T]: Remove dead code. 33683 [_LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T]: Likewise. 33684 (sprint_rlim64, print_rlimit64, decode_rlimit64, sprint_rlim32, 33685 print_rlimit32, decode_rlimit, sys_getrlimit, sys_setrlimit, 33686 sys_prlimit64): New functions. 33687 33688 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33689 33690 Remove another "interrupt to quit" message. 33691 * strace.c (startup_attach): Remove another "interrupt to quit" message. 33692 33693 Fix "strace -oFILE -ff -p<nonexistant_pid>" behavior. 33694 * strace.c (newoutf): Set tcp->outf in non-ff mode too. 33695 (alloctcb): This define is removed. 33696 (alloc_tcb): Renamed to alloctcb. Does not set tcp->outf anymore. 33697 Lost 'command_options_parsed' flag parameter. 33698 (startup_attach): Do not say "interrupt to quit" in attach message - 33699 ^C does not work in all cases, we mislead users. 33700 Call newoutf(tcp) after successful attach. 33701 (startup_child): Call newoutf(tcp) after successful attach. 33702 (trace): Call newoutf(tcp) when we picked up already attached child. 33703 33704 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33705 33706 Make alloc_tcb and droptcb static. No code changes. 33707 The change is trivial. Diff is large because it is confused 33708 by function definitions being moved around. 33709 33710 * defs.h: Remove declarations of alloc_tcb and droptcb. 33711 * strace.c: Make alloc_tcb and droptcb static. 33712 Shuffle functions around to make compiler happy. 33713 33714 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 33715 33716 Tidy up includes and copyright notices, fix indentation. 33717 The files not mentioned in changelog below had only 33718 copyright notices fixes and indentation fixes. 33719 33720 * defs.h: Include <stdint.h> and <inttypes.h>. 33721 * file.c: Do not include <inttypes.h>. 33722 Move struct kernel_dirent declaration below top include block. 33723 * block.c: Do not include <stdint.h> and <inttypes.h>. 33724 * quota.c: Likewise. 33725 * desc.c: Likewise. 33726 * signal.c: Likewise. 33727 33728 2012-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 33729 33730 scsi.c: add copyright header. 33731 * scsi.c: This file was added back in 2007 without a copyright header. 33732 Add it now. 33733 33734 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 33735 33736 Enhance capget and capset syscalls decoding. 33737 * system.c (cap_version): New xlat structure. 33738 (print_cap_header, print_cap_data): New functions. 33739 (sys_capget, sys_capset): Use them. 33740 33741 Remove unused code. 33742 * syscall.c (subcall_style, decode_subcall): Remove. 33743 [SYS_socket_subcall] (decode_socket_subcall): New function, based on 33744 decode_subcall in deref_style. 33745 [SYS_ipc_subcall] (decode_ipc_subcall): New function, based on 33746 decode_subcall in shift_style. 33747 (trace_syscall_entering): Use decode_socket_subcall and 33748 decode_ipc_subcall instead of decode_subcall. 33749 33750 Fix IPC decoding on alpha and arm. 33751 * ipc.c (indirect_ipccall): Return 0 on ALPHA and ARM EABI. 33752 (sys_shmat): Use indirect_ipccall for proper return value decoding. 33753 33754 arm: fix compilation warnings. 33755 * configure.ac: Define SIZEOF_LONG. 33756 * signal.c (sys_rt_sigaction) [SUPPORTED_PERSONALITIES > 1]: Help 33757 compiler to optimize out unreachable code that is not expected to work 33758 on platforms where sizeof(long) <= 4. 33759 33760 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 33761 33762 tests: robustify again buggy shells. 33763 * tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax 33764 instead of "${parameter-word}". 33765 33766 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 33767 33768 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 33769 33770 improve ifdef check with decode_subcall. 33771 Use the same ifdef logic around the call sites of decode_subcall() 33772 to protect the definition of the func itself. This fixes warnings 33773 for targets like hppa which don't use this func. 33774 33775 * syscall.c (decode_subcall): Wrap in SYS_socket_subcall and 33776 SYS_ipc_subcall define checks. 33777 33778 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 33779 33780 alpha: fix decode of osf_sigprocmask. 33781 The alpha sigprocmask syscall is special in that it comes from OSF rather 33782 than the style that everyone else uses. 33783 33784 Tested with this simple code: 33785 $ cat test.c 33786 #include <signal.h> 33787 main() { 33788 sigset_t set, oldset; 33789 sigemptyset(&set); 33790 sigaddset(&set, SIGINT); 33791 sigaddset(&set, SIGHUP); 33792 sigprocmask(SIG_SETMASK, &set, &oldset); 33793 sigprocmask(SIG_UNBLOCK, &oldset, &set); 33794 sleep(3); 33795 } 33796 $ gcc test.c && ./strace ./a.out 33797 ... 33798 osf_sigprocmask(SIG_SETMASK, [HUP INT]) = 0 (old mask []) 33799 osf_sigprocmask(SIG_UNBLOCK, []) = 0x3 (old mask [HUP INT]) 33800 osf_sigprocmask(SIG_BLOCK, [CHLD]) = 0x3 (old mask [HUP INT]) 33801 ... 33802 33803 * linux/alpha/syscallent.h: Call sys_sigprocmask for osf_sigprocmask, 33804 and change number of arguments to two. 33805 * signal.c (sys_sigprocmask): Fix decoding of alpha osf sigprocmask. 33806 33807 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33808 33809 Fix array size calculation in previous commit. 33810 * pathtrace.c (getfdpath): Fix array size calculation. 33811 33812 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33813 33814 pathtrace_select() is never called with NULL, remove dead code. 33815 pathtrace_select() is only called for -P FILE options, 33816 and FILE is never a NULL pointer. 33817 33818 text data bss dec hex filename 33819 239453 672 19012 259137 3f441 strace.before 33820 239329 672 19012 259013 3f3c5 strace 33821 33822 * pathtrace.c (pathtrace_select): Remove "if (path == NULL)...". 33823 (pathtrace_select): Remove code which only executes if path == NULL. 33824 The code was also buggy, it can free non-malloced pointer. 33825 (getfdpath): Simplify snprintf to sprintf. 33826 (pathmatch): Use strcmp() == 0 idiom for string equality test. 33827 (pathtrace_match): Likewise. 33828 33829 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33830 33831 manpage: remove bugs which are fixed. 33832 "A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x. 33833 "A traced process which tries to block SIGTRAP will be sent a SIGSTOP 33834 in an attempt to force continuation of tracing." - not needed 33835 and no longer done. 33836 "On Linux, exciting as it would be, tracing the init process is forbidden" 33837 - not true anymore. 33838 "When a traced process receives a SIGTRAP signal not 33839 associated with tracing, strace will not report that signal correctly." 33840 - not true anymore. 33841 33842 Simplify SIGCHLD handler setting. 33843 * strace.c (init): Set SIGCHLD to SIG_DFL earlier. 33844 (startup_child): Do not bother restoring SIGCHLD handler. 33845 33846 When reporting signals, use short signal names (SIGfoo) instead of strerror 33847 * defs.h: Remove strsignal declaration. 33848 * signal.c: Better check for SI_FROMUSER define. 33849 * strace.c (strerror): Remove this function. 33850 (trace): Use short signal names (SIGfoo) instead of strerror. 33851 33852 Remove TODO file: it's eleven years old and completely outdated. 33853 33854 Clean up defs.h order. No code changes. 33855 * defs.h: Group together related declarations. No code changes. 33856 33857 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33858 33859 Fix lame kernel version checking code. 33860 The code "os_release[0] >= '3'" is not good for any 33861 finer-grained checks such as "kernel >= 3.2.1". 33862 Let's proactively fix it. 33863 33864 * strace.c: Change os_release from string to integer. 33865 (get_os_release): Parse uname.release to KERNEL_VERSION 33866 representation. 33867 (init): Convert kernel version check to KERNEL_VERSION. 33868 33869 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33870 33871 Experimental support for "detach on execve" feature. 33872 * strace.c: Define new detach_on_execve, skip_startup_execve bool variables. 33873 (init): Set detach_on_execve on -b, set skip_startup_execve if 33874 "strace PROG" form is used. 33875 (trace): Detach from process if -b and we see PTRACE_EVENT_EXEC event. 33876 33877 Simple fixes. 33878 * strace.c (usage): Document -d; document that -F is deprecated. 33879 (droptcb): Print "<detached ...>" correctly for non-ff mode too. 33880 (detach): Suppress a warning. 33881 33882 Remove an outdated comment. 33883 * defs.h: Remove an outdated comment. 33884 33885 Remove extra include directives. No code changes. 33886 * defs.h: Include <signal.h> unconditionally. 33887 Other files were doing it unconditionally, so no harm done. 33888 * bjm.c: Remove system includes which are already included by defs.h. 33889 * pathtrace.c: Likewise. 33890 * process.c: Likewise. 33891 * signal.c: Likewise. 33892 * strace.c: Likewise. 33893 * stream.c: Likewise. 33894 * syscall.c: Likewise. 33895 * system.c: Likewise. 33896 * util.c: Likewise. 33897 33898 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 33899 33900 Tidy up order of includes; make bool variables explicit. 33901 Bool variables are more compact in data and (on x86) on code too: 33902 33903 text data bss dec hex filename 33904 237950 676 19044 257670 3ee86 strace.before 33905 237838 676 19012 257526 3edf6 strace 33906 33907 * defs.h: Group library includes at the top of the file. 33908 Rename dtime to Tflag, debug to debug_flag. 33909 Change debug_flag,Tflag,qflag,not_failing_only,show_fd_path,tracing_paths 33910 variable declarations from int to bool. 33911 * strace.c: Change corresponding definitions. Do the same for static 33912 variables iflag,rflag,print_pid_pfx. 33913 Rename dtime to Tflag, debug to debug_flag. 33914 * syscall.c: Rename dtime to Tflag, debug to debug_flag. 33915 33916 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 33917 33918 Fix compiler warnings about breaking strict-aliasing rules. 33919 * system.c (sys_capget, sys_capset): Use proxy unions to cast long* 33920 pointers to cap_user_header_t and cap_user_data_t pointers without 33921 breaking strict-aliasing rules. 33922 33923 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 33924 33925 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 33926 33927 ppc64: drop unused pid variable. 33928 * syscall.c (get_scno) [POWERPC64]: Delete unused pid variable. 33929 33930 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 33931 33932 ia64: fix compilation warnings. 33933 * linux/ia64/syscallent.h: Remove improper defines and undefs. 33934 33935 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 33936 33937 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 33938 33939 Ensure that SWAP_FLAG_* constants are defined. 33940 * file.c: Define those of SWAP_FLAG_* constants which are not yet 33941 provided by <sys/swap.h>. 33942 33943 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 33944 33945 2012-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 33946 33947 Enhance *listxattr syscalls decoding. 33948 * file.c (print_xattr_list): New function. 33949 (sys_listxattr, sys_flistxattr): Use it. 33950 33951 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 33952 33953 Fix *at syscalls flags decoding. 33954 Several *at decoders were defining own incomplete *atflags xlat 33955 structures. That was error prone, and fchownat decoder actually 33956 failed to recognize AT_EMPTY_PATH. Merging these incomplete 33957 structures into the single at_flags xlat structure will fix 33958 flags handling in all these decoders altogether. 33959 33960 * file.c: Define all AT_* constants used by *at decoders. 33961 (at_flags): New xlat structure, with records for all AT_* constants. 33962 (fstatatflags, linkat_flags, unlinkatflags): Remove. 33963 (sys_newfstatat, sys_linkat, sys_unlinkat, sys_fchownat, 33964 sys_utimensat): Use at_flags. 33965 33966 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 33967 33968 Fix linkat flags decoding. 33969 * file.c (linkat_flags): New xlat structure. 33970 (sys_linkat): Decode flags using linkat_flags. 33971 33972 Implement sys_rt_tgsigqueueinfo syscall decoder. 33973 * linux/dummy.h (sys_rt_tgsigqueueinfo): Remove. 33974 * linux/syscall.h (sys_rt_tgsigqueueinfo): New prototype. 33975 * signal.c (print_sigqueueinfo): New function, based on 33976 sys_rt_sigqueueinfo. 33977 (sys_rt_sigqueueinfo): Use print_sigqueueinfo. 33978 (sys_rt_tgsigqueueinfo): New function. 33979 33980 Implement syslog syscall decoder. 33981 * linux/dummy.h (sys_syslog): Remove. 33982 * linux/syscall.h (sys_syslog): New prototype. 33983 * system.c (syslog_action_type): New xlat structure. 33984 (sys_syslog): New function. 33985 33986 2012-03-13 Denys Vlasenko <vda.linux (a] googlemail.com> 33987 33988 Less ugly debug display of ptrace events. 33989 * strace.c (trace): Less ugly debug display of ptrace events. 33990 33991 Make manpage mention that -p "`pidof PROG`" works. 33992 33993 2012-03-13 Denys Vlasenko <vda.linux (a] googlemail.com> 33994 33995 Fix logging for "strace -o FILE -ff test/threaded_execve" test case. 33996 Our logic which was deciding whether to print "<unfinished ...>" 33997 thingy wasn't working properly for -ff case. 33998 33999 * defs.h: Group log generation-related declarations together. 34000 Add a large comment which explains how it works. 34001 Add declaration of line_ended() function. 34002 * strace.c (line_ended): New function which sets up internal data 34003 to indicate that previous line was finished. 34004 (printleader): Change logic to fix log generation in -ff mode. 34005 (newoutf): Make check for -ff mode consistent with other places. 34006 (droptcb): Print "<detached ...>" if last line for this tcp wasn't finished. 34007 (cleanup): Remove code to print "<unfinished ...>", printleader() 34008 or detach() will do it instead. 34009 (trace): Remove code to print "<unfinished ...>". 34010 Add code which finishes threaded execve's incomplete line 34011 with " <pid changed to PID ...>" message. Replace printing_tcp = NULL 34012 followed by fflush() by line_ended() call. 34013 * process.c (sys_exit): Call line_ended() to indicate that we finished priting. 34014 * syscall.c (trace_syscall_exiting): Set printing_tcp to current tcp. 34015 Call line_ended() to indicate that we finished priting. 34016 Remove call to fflush(), it is done by line_ended() now. 34017 34018 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 34019 34020 net.c: recognize MSG_WAITFORONE. 34021 * net.c (msg_flags): Add MSG_WAITFORONE. 34022 34023 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 34024 34025 Treat -ff without -o FILE as single -f. 34026 * strace.c (init): Treat -ff without -o FILE as single -f. 34027 34028 Style fix. No code changes. 34029 * strace.c (process_opt_p_list): Style fix. 34030 34031 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 34032 34033 Reduce stack usage by ~0.5k. 34034 main() uses ~0.5k of stack for local variables and such. When we enter 34035 main tracing loop, most of these variables are no longer used. 34036 But they still take up stack for the entire life of strace. 34037 We can avoid this wastage if we move init code into a separate function. 34038 (Need to be careful and not allow automatic inlining). 34039 34040 * strace.c (init): New function. Most of pre-existing code of 34041 main is now living here. 34042 (main): Call init() to do initialization. 34043 34044 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 34045 34046 Preparatory cosmetic changes for the next commit. 34047 * strace.c (tprintf): Move function up in the source file. No code changes. 34048 (tprints): Likewise. 34049 (printleader): Likewise. 34050 (tabto): Likewise. 34051 34052 2012-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 34053 34054 Implement sendmmsg syscall decoder. 34055 * linux/dummy.h (sys_sendmmsg): Remove. 34056 * linux/syscall.h (sys_sendmmsg): New prototype. 34057 * net.c (printmmsghdr): Add index argument specifying the element in 34058 mmsghdr array to print. 34059 (decode_mmsg): New function, prints the whole mmsghdr array, its length 34060 and message flags. 34061 (sys_sendmmsg): New function. 34062 (sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding. 34063 34064 Implement sched_rr_get_interval syscall decoder. 34065 * linux/dummy.h (sys_sched_rr_get_interval): Remove. 34066 * linux/syscall.h (sys_sched_rr_get_interval): New prototype. 34067 * process.c (sys_sched_rr_get_interval): New function. 34068 34069 Implement migrate_pages syscall decoder. 34070 * linux/dummy.h (sys_migrate_pages): Remove. 34071 * linux/syscall.h (sys_migrate_pages): New prototype. 34072 * mem.c (sys_migrate_pages): New function. 34073 34074 Implement get_robust_list syscall decoder. 34075 * linux/dummy.h (sys_get_robust_list): Remove. 34076 * linux/syscall.h (sys_get_robust_list): New prototype. 34077 * process.c (sys_get_robust_list): New function. 34078 34079 Define sys_set_robust_list as an alias to sys_munmap. 34080 * linux/dummy.h (sys_set_robust_list): Redefine to sys_munmap. 34081 34082 Implement clock_adjtime syscall decoder. 34083 * linux/dummy.h (sys_clock_adjtime): Remove. 34084 * linux/syscall.h (sys_clock_adjtime): New prototype. 34085 * time.c (do_adjtimex): New function, based on sys_adjtimex. 34086 (sys_adjtimex): Use it. 34087 (sys_clock_adjtime): New function. 34088 34089 Define sys_setns as an alias to sys_inotify_rm_watch. 34090 * linux/dummy.h (sys_setns): Redefine to sys_inotify_rm_watch. 34091 34092 Sort definitions of dummy parsers. No code changes. 34093 * linux/dummy.h: Sort definitions of parsers implemented as aliases. 34094 34095 Correct inotify_rm_watch decoder. 34096 * file.c (sys_inotify_rm_watch): Print second argument as int. 34097 34098 Alias sys_fsync to sys_close. 34099 * file.c (sys_fsync): Remove. 34100 * linux/syscall.h (sys_fsync): Likewise. 34101 * linux/dummy.h (sys_fsync): Alias to sys_close. 34102 * linux/m68k/syscallent.h: Add TD flag to fsync entry. 34103 * linux/microblaze/syscallent.h: Likewise. 34104 * linux/mips/syscallent.h: Likewise. 34105 34106 2012-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 34107 34108 Update ioctl entries. 34109 * linux/ioctlent.h.in: Regenerate from v3.3 headers. 34110 * linux/i386/ioctlent.h.in: Likewise. 34111 34112 strace-log-merge: cleanup. 34113 * strace-log-merge: Redirect usage to stderr, make the check 34114 for numeric suffix simpler. 34115 34116 Add syscall entries for new linux syscalls. 34117 * linux/i386/syscallent.h: Update process_vm_writev handler. 34118 * linux/powerpc/syscallent.h: Likewise. 34119 * linux/x86_64/syscallent.h: Likewise. 34120 * linux/alpha/syscallent.h: Add entries for accept4 and sendmmsg. 34121 * linux/arm/syscallent.h: Add entries for process_vm_readv and 34122 process_vm_writev. 34123 * linux/m68k/syscallent.h: Likewise. 34124 * linux/mips/syscallent.h: Likewise. 34125 * linux/s390/syscallent.h: Likewise. 34126 * linux/s390x/syscallent.h: Likewise. 34127 * linux/sh/syscallent.h: Likewise. 34128 * linux/sh64/syscallent.h: Likewise. 34129 * linux/sparc/syscallent.h: Likewise. 34130 * linux/ia64/syscallent.h: Add entries for process_vm_readv, 34131 process_vm_writev and accept4. 34132 * linux/microblaze/syscallent.h: Add entries for sendmmsg, 34133 process_vm_readv and process_vm_writev. 34134 34135 Implement process_vm_writev decoder. 34136 * process.c (sys_process_vm_writev): New function. 34137 * linux/syscall.h (sys_process_vm_writev): New prototype. 34138 34139 Output iovec length in vmsplice and process_vm_readv decoders. 34140 * io.c (sys_vmsplice): Output iovec length. 34141 * process.c (sys_process_vm_readv): Likewise. 34142 34143 2012-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 34144 34145 swapon: decode swap flags. 34146 * file.c: Include <sys/swap.h>. 34147 (swap_flags): New xlat structure. 34148 (sys_swapon): New function. 34149 * linux/dummy.h (sys_swapon): Remove. 34150 * linux/syscall.h (sys_swapon): New declaration. 34151 34152 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34153 34154 Trivial simplification. 34155 * strace.c (detach): Use waitpid instead of wait4. 34156 34157 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34158 34159 Don't consider PROG to be our child in "strace -D PROG" case. 34160 TCB_STRACE_CHILD is used for the case when "strace PROG" is ^C-ed 34161 or something like that. strace should not just exit - it should 34162 do something with its child (such as signal it too). 34163 34164 In -D case, PROG is not really a child of _strace_, it is a child 34165 of strace's parent. It's ok to handle it exactly as an attached process. 34166 34167 While we are at it, remove nonsensical special-casing of TCB_STRACE_CHILD 34168 in printing of "<unfinished ...>" message. 34169 34170 * strace.c (startup_attach): Don't set TCB_STRACE_CHILD if -D. 34171 (trace): Print "<unfinished ...>" on error regardless of TCB_STRACE_CHILD. 34172 34173 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34174 34175 Fix the case where we try to detach unattached processes. 34176 Before this change: 34177 $ strace -D -p1 34178 strace: -D and -p are mutually exclusive options 34179 Process 1 detached <==== WRONG! (and we try to SIGSTOP it!!!) 34180 34181 * defs.h: Change the meaning of TCB_ATTACHED: now it means "this tracee 34182 is attached to us". Add TCB_STRACE_CHILD: "this tracee is our child". 34183 * strace.c (kill_save_errno): Move up. No code changes. 34184 (process_opt_p_list): Don't set TCB_ATTACHED on new tcb. 34185 (startup_attach): Change how we work with TCB_ATTACHED. 34186 Set TCB_STRACE_CHILD on -D. 34187 (startup_child): Use kill_save_errno instead of kill. 34188 Set TCB_ATTACHED and TCB_STRACE_CHILD on attached strace child. 34189 If we are in -D case, don't set TCB_ATTACHED (we aren't attached yet). 34190 (detach): do not do PTRACE_DETACH if TCB_ATTACHED is not set. 34191 (cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED. 34192 (trace): Likewise. 34193 34194 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34195 34196 Call PTRACE_CONT with addr=0. 34197 * strace.c (trace): Call PTRACE_CONT with addr=0. 34198 34199 install strace-log-merge by "make install" 34200 34201 strace_log_merge: new file. Helper to merge timestamped strace -ff logs. 34202 34203 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34204 34205 Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case. 34206 In this case we were printing PIDs to LOG.* files 34207 even though it is not necessary. 34208 34209 The fix is in the addition of "&& followfork < 2" condition. 34210 34211 * strace.c: Remove pflag_seen variable, add print_pid_pfx one. 34212 (process_opt_p_list): Do not pflag_seen++. 34213 (main): Use "nprocs != 0" condition instead of "pflag_seen != 0". 34214 Set print_pid_pfx before entering main tracing loop. 34215 (printleader): Use print_pid_pfx to decide whether to print pid prefix. 34216 34217 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34218 34219 Allow -p PID to take comma or whitespace-separated list of PIDs. 34220 * defs.h: Clarify meaning of TCB_ATTACHED. No code changes. 34221 * strace.c (process_opt_p_list): New function. 34222 (main): Call process_opt_p_list to process -p PIDs argument. 34223 34224 2012-03-08 Denys Vlasenko <vda.linux (a] googlemail.com> 34225 34226 Pass addr=0 instead of 1 into restarting ptrace calls. 34227 While we are at it, fold do_ptrace into its lone caller. 34228 We no longer set tcp->ptrace_errno = ESRCH on ESRC error in upeek. 34229 Other code paths where ptrace fails wern't doing it, and the code which 34230 checks tcp->ptrace_errno even assumes it is never set to ESRCH. 34231 (It was me who added this code sometime ago, so it was my fault 34232 that it was a bit messy) 34233 34234 I ran sigkill_rain test and verified that unfinished syscalls are 34235 still handled correctly. 34236 34237 * util.c (ptrace_restart): Do not pass addr=1 to ptrace(), pass 0 instead. 34238 I have no idea why we were passing 1. Ptrace documentation says 34239 that addr parameter is ignored. 34240 (do_ptrace): Remove this function. 34241 (upeek): Use ptrace() instead of do_ptrace(). 34242 * defs.h: Remove do_ptrace() declaration. 34243 34244 2012-03-08 Denys Vlasenko <vda.linux (a] googlemail.com> 34245 34246 Trivial tweaks to error messages. 34247 * strace.c (test_ptrace_setoptions_followfork): Use kill_save_errno 34248 instead of kill. 34249 (trace): Use perror_msg instead of perror. 34250 * count.c (set_sortby): Use error_msg_and_die instead of fprintf. 34251 * syscall.c (qualify): Likewise. 34252 * util.c (ptrace_restart): Expand error message. 34253 (umoven): Likewise. 34254 (umovestr): Likewise. 34255 (upeek): Use perror_msg instead of sprintf + perror. 34256 34257 2012-02-28 Denys Vlasenko <vda.linux (a] googlemail.com> 34258 34259 Remove stray sys_swapon() declaration. 34260 * linux/syscall.h: Remove stray sys_swapon() declaration. 34261 * linux/mips/syscallent.h: Include dummy.h with correct relative path. 34262 * linux/dummy.h: Tweak one place where spaces are used instead of tabs. 34263 * linux/dummy_check.sh: New script. It helps in finding stray syscall 34264 handler declarations. 34265 34266 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 34267 34268 Correct syscall entries for t[g]kill. 34269 * linux/hppa/syscallent.h: Make tgkill use sys_tgkill, not printargs. 34270 * linux/sh/syscallent.h: Change tkill type TD -> TS. 34271 * linux/sh64/syscallent.h: Likewise. 34272 * linux/mips/syscallent.h: Change tkill type 0 -> TS. 34273 * linux/x86_64/syscallent.h: Likewise. 34274 * linux/avr32/syscallent.h: Likewise. 34275 34276 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 34277 34278 Assorted trivial optimizations. 34279 text data bss dec hex filename 34280 236448 672 19044 256164 3e8a4 strace.before 34281 236360 672 19044 256076 3e84c strace 34282 34283 * file.c (sprintmode): Use smaller static buffer, eliminate strlen call. 34284 (sprinttime): Use smaller static buffer. 34285 (printstat_sparc64): Coalesce two printing calls into one. 34286 (printstat_powerpc32): Likewise. 34287 (printcompat_statfs6): Likewise. 34288 (sys_utime): Do not fetch personality_wordsize[current_personality] 34289 repeatedly - cache it in local variable instead. 34290 * process.c (printargv): Likewise. 34291 * resource.c (sprintrlim): Return const char*, not char*. This allows 34292 to eliminate sprintf(buf, "RLIM_INFINITY"). Use smaller static buffer. 34293 (sprintrlim64): Likewise. 34294 * strace.c (strerror): Use smaller static buffer. 34295 (strsignal): Likewise. 34296 34297 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 34298 34299 Alias a few more syscall printing functions. 34300 text data bss dec hex filename 34301 237384 672 19044 257100 3ec4c strace.before 34302 236448 672 19044 256164 3e8a4 strace 34303 34304 * defs.h: Declare new functions printargs_lu(), printargs_ld() 34305 which simply print syscall all args as unsigned or signed longs. 34306 * desc.c (sys_epoll_create): Call printargs_ld() instead of open-coding it. 34307 * linux/syscall.h: Remove declarations of the following functions: 34308 sys_alarm, sys_getresgid, sys_getsid, sys_nice, sys_setgid, sys_setpgid, 34309 sys_setpgrp, sys_setregid, sys_setresgid. 34310 * process.c (sys_setgid): Delete this function: now aliased to sys_setuid(). 34311 (sys_getresgid): Delete this function: now aliased to sys_getresuid(). 34312 (sys_setregid): Delete this function: now aliased to sys_setreuid(). 34313 (sys_setresgid): Delete this function: now aliased to sys_setresuid(). 34314 (sys_setpgrp): Delete this function: now aliased to printargs_lu(). 34315 (sys_getsid): Likewise. 34316 (sys_setpgid): Likewise. 34317 (sys_alarm): Likewise. 34318 (sys_getpgrp): Delete this function: was unused - was already shadowed 34319 by a define in linux/dummy.h. 34320 (sys_setsid): Likewise. 34321 (sys_getpgid): Likewise. 34322 * resource.c (sys_nice): Delete this function: now aliased to printargs_ld(). 34323 * linux/dummy.h: Define new aliases (see above for the list). 34324 * syscall.c (printargs_lu): New function. 34325 (printargs_ld): New function. 34326 34327 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 34328 34329 Style fixes, no code changes. 34330 * desc.c (sys_io_getevents): Indentation fix. 34331 * file.c (sys_xstat): Remove space after function name. 34332 (decode_mknod): Indentation fix. 34333 * net.c (printsockopt): Indentation fix. 34334 * process.c (unalignctl_string): Indentation fix. 34335 (sys_sched_getscheduler): Remove space after ! operator. 34336 34337 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 34338 34339 Compress blank lines. 34340 Suppress repeated empty lines left after automated code removal. 34341 This change was made by filtering every source code file through 34342 "cat -s". 34343 34344 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 34345 34346 Remove parts of automake machinery which are not needed on Linux. 34347 This change is a verbatim part of Dmitry's changes to remove support 34348 for non-Linux architectures. 34349 34350 * Makefile.am: Don't install PORTING file. Install README-linux-ptrace file. 34351 Set OS variable to linux unconditionally. 34352 * configure.ac: Remove code to set opsys variable, and its usage. 34353 Remove checks for headers which are never present on Linux. 34354 * m4/stat.m4: Remove 'ifdef LINUX' check. 34355 * m4/statfs.m4: Likewise. 34356 34357 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 34358 34359 Remove and update documentation. 34360 This change is a verbatim part of Dmitry's changes to remove support 34361 for non-Linux architectures. 34362 34363 * PORTING: Deleted. 34364 * INSTALL: Modified. 34365 * README: Modified. 34366 * strace.1: Modified: bugs should be reported to mailing list, not Debian. 34367 * strace.spec: do not install PORTING file. 34368 34369 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 34370 34371 Remove a few more code parts which are unused on Linux. 34372 This change is abapted from Dmitry's changes to remove support for 34373 non-Linux architectures. 34374 34375 * Makefile.am: Remove if LINUX/endif pairs. 34376 * defs.h: Remove stream_ioctl() declaration. 34377 * ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block. 34378 * resource.c: Use 'defined(FOO)' instead of 'defined FOO' form. 34379 * util.c: Likewise. 34380 * signal.c: Remove conditional includes which are never used on Linux. 34381 * stream.c: Likewise. 34382 * file.c: Remove excessive empty lines. 34383 34384 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 34385 34386 Build fixes after non-Linux code removal. 34387 * configure.ac: Remove calls to proc-based ptrace checks. 34388 * proc.c: Remove, it's empty now. 34389 * Makefile.am: Remove reference to proc.c. 34390 * net.c: Remove trailing newlines. 34391 * quota.c: Likewise 34392 * resource.c: Likewise 34393 * strace.c: Likewise 34394 * stream.c: Likewise 34395 * time.c: Likewise 34396 34397 Fix defined(FOO) style. 34398 * file.c: Consistently use defined(FOO) instead of defined (FOO). 34399 * mem.c: Likewise. 34400 * net.c: Likewise. 34401 * signal.c: Likewise. 34402 * sock.c: Likewise. 34403 * linux/mips/syscallent.h: Likewise. 34404 34405 Reindent preprocessor directives in util.c; fix style. 34406 * util.c: Fix indentation of preprocessor directives broken by 34407 automatic removal of non-Linux code. Fix style to use consistent 34408 defined(FOO) instead of defined (FOO). 34409 34410 Reindent preprocessor directives in syscall.c; fix style. 34411 * syscall.c: Fix indentation of preprocessor directives broken by 34412 automatic removal of non-Linux code. Fix style to use consistent 34413 defined(FOO) instead of defined (FOO). 34414 34415 Reindent defs.h preprocessor directives. 34416 * defs.h: Fix indentation of preprocessor directives broken by 34417 automatic removal of non-Linux code. 34418 34419 Cleanup after non-Linux code removal. 34420 Conditions such as defined(LINUX) are always true now, 34421 defined(FREEBSD) etc are always false. 34422 When if directive has them as subexpressions, it can be simplified. 34423 Another trivial changes here are fixes for directive indentation. 34424 34425 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 34426 34427 Manual removal of non-Linux source, documentation, etc. 34428 Remove non-Linux source directories: freebsd/, svr4/, sunos4/, svr4/. 34429 Remove README-freebsd, README-sunos4, README-svr4, m4/procfs.m4. 34430 34431 linux/sparc/{errnoent1,ioctlent1,signalent1}.h used to point to svr4/ files - 34432 replace their contents with copies of used (and now deleted) files. 34433 Make linux/sparc64/{errnoent1,ioctlent1,signalent1}.h include these files 34434 instead of svr4/* ones. 34435 34436 Makefile.am: remove references to deleted files. 34437 configure.ac: Remove a few tests which make no sense on Linux. 34438 Man page: remove non-Linux quirks information. 34439 34440 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 34441 34442 Automated removal of non-Linux code. 34443 This change is generated by running every source through the following command: 34444 34445 unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD 34446 -USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS 34447 -UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c 34448 34449 2012-02-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34450 34451 When accessing data blocks, truncate addr to wordsize. 34452 * util.c (umoven): Truncate addr to wordsize before use. 34453 34454 2012-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 34455 34456 strace.1: fix a typo. 34457 * strace.1: Fix a typo in example description. 34458 This fixes Debian bug #653309. 34459 34460 Fix sockaddr_un.sun_path name in decoded output. 34461 * net.c (printsock): Show sockaddr_un.sun_path as "sun_path". 34462 This fixes Debian bug #554946. 34463 34464 Avoid potential core file clobbering on exit. 34465 * strace.c (main): Set RLIMIT_CORE to zero before terminating itself 34466 with a deadly signal. 34467 This fixes Debian bug #656398. 34468 34469 2012-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 34470 34471 Eliminate native_scno and known_scno. 34472 * defs.h (known_scno): Remove. 34473 (sysent): Remove native_scno field. 34474 * process.c [IA64]: Replace known_scno(tcp) with tcp->scno. 34475 (internal_fork) [USE_PROCFS || !LINUX]: Likewise. 34476 * syscall.c: Do not define NR_SYSCALL_BASE. 34477 (known_scno): Remove. 34478 (syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp) 34479 with tcp->scno. 34480 (trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise. 34481 (syscall_fixup_on_sysexit) [SUNOS4]: Likewise. 34482 34483 Remove initialization of native_scno field. 34484 * linux/i386/syscallent.h: Remove native_scno initialization for clone, 34485 fork and vfork. 34486 * linux/ia64/syscallent.h (sys_fork, sys_vfork): Remove redirections 34487 to printargs. 34488 * linux/syscall.h [IA64]: Do not define SYS_fork and SYS_vfork. 34489 * util.c (printcall) [IA64]: Likewise. 34490 (setbpt): Use sys_func to check for clone, fork and vfork syscalls. 34491 34492 Do not use SYS_ipc and SYS_socketcall. 34493 * linux/dummy.h (sys_ipc, sys_socketcall): Remove redirections to 34494 printargs. 34495 * linux/ia64/syscallent.h: Likewise. 34496 * linux/i386/syscallent.h: Remove native_scno initialization for "ipc" 34497 and "socketcall". 34498 * linux/syscall.h (sys_ipc, sys_socketcall): New prototypes. 34499 (SYS_ipc, SYS_socketcall): Remove no longer used constants. 34500 [IA64]: Remove undefining of ipc and socket SYS_* constants. 34501 [SPARC || SPARC64]: Remove unused ipc SYS_* constants. 34502 * ipc.c (sys_ipc): New function. 34503 * sock.c (sys_socketcall): Likewise. 34504 * syscall.c (trace_syscall_entering): Use sys_func to check for ipc and 34505 socket subcalls. 34506 34507 2012-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 34508 34509 Remove initialization of native_scno field for most of syscalls. 34510 The native_scno field is not so much used in the code than before. 34511 In many cases sys_func is checked instead, and for most of syscall 34512 entries there is no need to initialize native_scno. 34513 34514 * linux/i386/syscallent.h: Remove native_scno initialization for 34515 _exit, read, write, waitpid, execve, wait4, sysfs, readv, writev, 34516 pread64, pwrite64, exit_group, waitid, send, recv, sendto and 34517 recvfrom syscall entries. 34518 * linux/syscall.h: Do not define no longer used SYS_waitid and 34519 SYS_sub_* constants. 34520 [IA64]: Do not define SYS_waitpid and SYS32_* constants. 34521 * defs.h: Do not define no longer used __NR_exit_group constant. 34522 * strace.c [USE_PROCFS] (proc_open): Use sys_func to check for execve. 34523 34524 2012-02-14 Mike Frysinger <vapier (a] gentoo.org> 34525 34526 util: check for process_vm_readv in C library. 34527 glibc-2.15 provides process_vm_readv, so trying to provide it ourselves 34528 with that version fails. 34529 34530 * configure.ac (AC_CHECK_FUNCS): Add process_vm_readv. 34531 * util.c: Handle HAVE_PROCESS_VM_READV. 34532 34533 2012-02-09 Denys Vlasenko <vda.linux (a] googlemail.com> 34534 34535 README-linux-ptrace: correct the description of suppressed signals. 34536 34537 2012-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 34538 34539 strace -P: fix handling of invalid syscalls. 34540 * pathtrace.c (pathtrace_match): Check the given syscall number using 34541 SCNO_IN_RANGE. 34542 34543 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34544 34545 Skip the syscall entry if the sys_func field is NULL. 34546 Avoid NULL dereference when there are holes in sysent tables. 34547 It can happen with syscall (number, ...) and number is in those holes. 34548 There are no targets with holey systent tables so far, but at least 34549 one such a target, x32, is already on the horizon. 34550 34551 * defs.h (SCNO_IN_RANGE): Also check the sys_func field. 34552 34553 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34554 34555 Define RLIM64_INFINITY only if not defined. 34556 * resource.c (RLIM64_INFINITY): Define only if it isn't defined. 34557 34558 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34559 34560 Cast to long for %l in printf. 34561 Cast a value to long for %l in printf to avoid compiler warning 34562 on systems where it may be long long. 34563 34564 * count.c (call_summary_pers): Cast to long. 34565 * ipc.c (sys_mq_open, printmqattr): Likewise. 34566 * quota.c (decode_cmd_data): Likewise. 34567 * resource.c (sys_sysinfo): Likewise. 34568 * time.c (tprint_timex): Likewise. 34569 34570 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34571 34572 Check HAVE_LONG_LONG_OFF_T when printing offset. 34573 When HAVE_LONG_LONG_OFF_T is defined, we need to use %llu to print 34574 offset. 34575 34576 * io.c (sys_sendfile): Check HAVE_LONG_LONG_OFF_T when printing 34577 offset. 34578 34579 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34580 34581 Define old stat functions only if needed. 34582 When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't 34583 used and strace won't link since they use realprintstat which isn't 34584 defined when HAVE_LONG_LONG_OFF_T is defined. 34585 34586 * file.c (convertoldstat, sys_oldstat, sys_oldfstat, sys_oldlstat): 34587 Define only if HAVE_LONG_LONG_OFF_T isn't defined. 34588 34589 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 34590 34591 Print NULL for zero address in sys_mmap64. 34592 * mem.c (sys_mmap64): Print NULL for zero address so that it is 34593 consistent with sys_mmap. 34594 34595 2012-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 34596 34597 Remove unused sys_pread64 and sys_pwrite64 parsers on Linux. 34598 * io.c [HAVE_LONG_LONG_OFF_T]: Remove sys_pread64 and sys_pwrite64 34599 aliases. 34600 (sys_pread64, sys_pwrite64): Define these functions only on 34601 [SVR4 && _LFS64_LARGEFILE] platform. 34602 * linux/mips/syscallent.h: Use sys_pread and sys_pwrite to handle 34603 appropriate syscalls. 34604 * linux/syscall.h (sys_pread64, sys_pwrite64): Remove. 34605 * syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only on 34606 [SVR4 && _LFS64_LARGEFILE] platform. 34607 34608 2012-02-03 Denys Vlasenko <vda.linux (a] googlemail.com> 34609 34610 Trivial changes to help text. No code changes. 34611 * strace.c (usage): Tweak help text: remove unpaired closing brackets, 34612 make -V and -h sit on separate lines (hard to see them otherwise). 34613 34614 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 34615 34616 Simple optimizations. 34617 text data bss dec hex filename 34618 239474 672 20484 260630 3fa16 strace.before 34619 239234 668 19044 258946 3f382 strace 34620 34621 * file.c (sprint_open_modes): Reduce static buffer size. 34622 Simplify separator printing. 34623 * signal.c (sprintsigmask): Reduce static buffer size. 34624 Simplify separator printing and printing of almost full masks. 34625 Use stpcpy instead of sprintf and strcpy+strlen. 34626 * strace.c (startup_child): Don't strchr() for ':' twice in a row. 34627 * util.c (sprintflags): Exit loop early if possible. 34628 34629 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 34630 34631 Trivial optimization. 34632 * strace.c (cleanup): Read 'interrupted' volatile variable only once. 34633 34634 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 34635 34636 Make interactive-ness directly controllable via command line option. 34637 Defaults are often ok, but when they are not, people get confused. 34638 "Why can't I kill strace?" and "Why strace dies on ^C when I want 34639 to _tracee_ to die instead?" are typical complaints. 34640 34641 * strace.c: Replace 'interactive' variable with 'opt_intr' variable. 34642 Define INTR_foo constants for its possible values. 34643 Define 'interactive' as a macro. 34644 (usage): Document -I n option. 34645 (main): Parse -I n option, modify signal handling to accomidate new 34646 -I 1 and -I 4 modes. 34647 34648 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 34649 34650 Suppress compiler warning. 34651 * strace.c (trace): Frame potentially unused label with ifdef/endif. 34652 34653 On Ctrl-C induced detach, send SIGINT to child tracee, not SIGTERM. 34654 * strace.c (interrupt): Remember signal number. 34655 (cleanup): If we exiting due to signal, send that signal to child tracee. 34656 34657 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 34658 34659 Add experimental code to use PTRACE_SEIZE, disabled by default. 34660 All new code is predicated on "ifdef USE_SEIZE". If it is not defined, 34661 behavior is not changed. 34662 34663 If USE_SEIZE is enabled and run-time check shows that PTRACE_SEIZE works, then: 34664 - All attaching is done with PTRACE_SEIZE + PTRACE_INTERRUPT. 34665 This means that we no longer generate (and possibly race with) SIGSTOP. 34666 - PTRACE_EVENT_STOP will be generated if tracee is group-stopped. 34667 When we detect it, we issue PTRACE_LISTEN instead of PTRACE_SYSCALL. 34668 This leaves tracee stopped. This fixes the inability to SIGSTOP or ^Z 34669 a straced process. 34670 34671 * defs.h: Add commented-out "define USE_SEIZE 1" and define PTRACE_SEIZE 34672 and related constants. 34673 * strace.c: New variable post_attach_sigstop shows whether we age going 34674 to expect SIGSTOP on attach (IOW: are we going to use PTRACE_SEIZE). 34675 (ptrace_attach_or_seize): New function. Uses PTRACE_ATTACH or 34676 PTRACE_SEIZE + PTRACE_INTERRUPT to attach to given pid. 34677 (startup_attach): Use ptrace_attach_or_seize() instead of ptrace(PTRACE_ATTACH). 34678 (startup_child): Conditionally use alternative attach method using PTRACE_SEIZE. 34679 (test_ptrace_setoptions_followfork): More robust parameters to PTRACE_TRACEME. 34680 (test_ptrace_seize): New function to test whether PTRACE_SEIZE works. 34681 (main): Call test_ptrace_seize() while initializing. 34682 (trace): If PTRACE_EVENT_STOP is seen, restart using PTRACE_LISTEN in order 34683 to not let tracee run. 34684 * process.c: Decode PTRACE_SEIZE, PTRACE_INTERRUPT, PTRACE_LISTEN. 34685 * util.c (ptrace_restart): Add "LISTEN" to a possible error message. 34686 34687 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 34688 34689 process_vm_readv gets EINVAL if process is gone (SIGKILLed). Don't complain. 34690 * util.c (umoven): Don't complain on EINVAL from process_vm_readv. 34691 (umovestr): Likewise. 34692 34693 Revert last change. Add a comment to prevent further misunderstanding. 34694 * time.c (sys_nanosleep): Display remaining time only on interrupt. 34695 34696 Fix nanosleep decoding: second argument was not shown after success. 34697 * time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check. 34698 * syscall.c (is_restart_error): Remove redundant check. 34699 34700 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 34701 34702 Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks. 34703 Currently, we use PTRACE_PEEKDATA to read things like filenames and 34704 data passed by I/O syscalls. 34705 PTRACE_PEEKDATA gets one word per syscall. This is VERY expensive. 34706 For example, in order to print fstat syscall, we need to perform 34707 more than twenty trips into kernel to fetch one struct stat! 34708 34709 Kernel 3.2 got a new syscall, process_vm_readv(), which can be used to 34710 copy data blocks out of process' address space. 34711 34712 This change uses it in umoven() and umovestr() functions if possible, 34713 with fallback to old method if process_vm_readv() fails. 34714 If it returns ENOSYS, we don't try to use it anymore, eliminating 34715 overhead of trying it on older kernels. 34716 34717 Result of "time strace -oLOG ls -l /usr/lib >/dev/null": 34718 before patch: 0.372s 34719 After patch: 0.262s 34720 34721 * util.c (process_vm_readv): Wrapper to call process_vm_readv syscall. 34722 (umoven): Use process_vm_readv for block reads of tracee memory. 34723 (umovestr): Likewise. 34724 * linux/syscall.h: Declare new function sys_process_vm_readv. 34725 * process.c (sys_process_vm_readv): Decoder for new syscall. 34726 * linux/i386/syscallent.h: Add process_vm_readv, process_vm_writev syscalls. 34727 * linux/x86_64/syscallent.h: Likewise. 34728 * linux/powerpc/syscallent.h: Likewise. 34729 34730 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 34731 34732 Fix a case of broken output if last seen syscall was exit. 34733 * defs.h: Rename tcp_last to printing_tcp. Explain what it means. 34734 Remove printtrailer() function. 34735 * process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL". 34736 * strace.c: Add new variable printing_tcp. 34737 (cleanup): Convert printtrailer() call to "printing_tcp = NULL". 34738 (trace): Likewise. 34739 (trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit. 34740 (printleader): Set printing_tcp. 34741 (printtrailer): Remove this function. 34742 * syscall.c: Remove tcp_last variable. 34743 (trace_syscall_entering): Don't set printing_tcp, printleader call now does it. 34744 (trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL". 34745 34746 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 34747 34748 Fix handling of test/threaded_execve.c testcase. 34749 Since 3.0, Linux has a way to identify which thread execve'ed. 34750 This patch makes use of it in order to properly dispose 34751 of disappeared ("superseded") thread leader, 34752 and replace it with execve'ed thread. 34753 34754 Before this patch, strace was "leaking" thread which exec'ed. 34755 It was thinking that it still runs. It would look like this: 34756 34757 18460 pause( <unfinished ...> <=== thread leader 34758 18466 execve("/proc/self/exe", ["exe", "exe"], [/* 47 vars */] <unfinished ...> 34759 18465 +++ exited with 0 +++ <=== exits from other threads 34760 18460 <... pause resumed> ) = 0 34761 34762 The last line is wrong: it's not pause resumed, it's execve resumed. 34763 If thread leader would do exit instead of pause, it is much worse: 34764 strace panics because it thinks it sees return from exit syscall! 34765 34766 And strace isn't aware 18466 (exec'ed thread) is gone. 34767 It still thinks it's executes execve syscall. 34768 34769 * strace.c: New variable "static char *os_release". 34770 (get_os_release): New static function. 34771 (main): Call get_os_release to retrieve Linux version. 34772 (trace): If we see PTRACE_EVENT_EXEC, retrieve old pid, and if it 34773 differs from new one, free one of tcbs and print correct messages. 34774 34775 2012-01-27 Denys Vlasenko <vda.linux (a] googlemail.com> 34776 34777 Fix readlink result display - was printing bogus "..." semi-randomly. 34778 * file.c (decode_readlink): Use printstr() instead of printpathn(). 34779 34780 Add new test program: test/threaded_execve.c. 34781 34782 Make pid2tcb static. 34783 * defs.h: Remove pid2tcb declaration. 34784 * strace.c (pid2tcb): Make this function static. 34785 34786 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34787 34788 Per Dmitry's request, remove paranoid check in verror_msg() 34789 * strace.c (verror_msg): Remove redundant check for msg != NULL. 34790 34791 More robust error check for vasprintf. 34792 * strace.c (verror_msg): More robust error check for vasprintf. 34793 34794 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34795 34796 Slightly more compact handling of argv[] 34797 text data bss dec hex filename 34798 238274 672 20484 259430 3f566 strace.before 34799 238226 672 20484 259382 3f536 strace 34800 34801 * strace.c (main): Slightly more compact handling of argv[] 34802 34803 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34804 34805 Trivial optimization. 34806 * strace.c: Set default interactive = 1 statically instead 34807 of doing it in main(). 34808 34809 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34810 34811 Allocate -o OUTFILE buffer only if needed. 34812 text data bss dec hex filename 34813 238258 668 28676 267602 41552 strace.before 34814 238274 668 20484 259426 3f562 strace 34815 34816 * strace.c (main): Allocate -o OUTFILE buffer only if needed: 34817 unused buffer in bss is not entirely free. 34818 34819 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 34820 34821 Use single fprintf in verror_msg() 34822 This change partially reverts commit 44d0532. 34823 34824 In code before commit 44d0532, single fprintf was used on purpose: 34825 we want to send entire message as one write() call. Since stderr 34826 is unbuffered, separate fprintf's to it always result in separate 34827 writes, they are not coalesced. If we aren't the only program 34828 which writes to this particular stderr, this may result 34829 in interleaved messages. 34830 34831 Since this function is not performance critical, I guess 34832 it's ok to make it less efficient. 34833 34834 * strace.c (verror_msg): Attempt to print the message in single 34835 write operation. Use separate fprintfs as a fallback if malloc fails. 34836 34837 2012-01-21 Denys Vlasenko <vda.linux (a] googlemail.com> 34838 34839 Improve code readability (logic is unchanged) 34840 * util.c (umoven): Move assignment out of function call. Make assignment 34841 to a flag variable later, closer to the place where it will be used. 34842 (umovestr): Likewise. 34843 (uload): Likewise. 34844 34845 2012-01-20 Denys Vlasenko <vda.linux (a] googlemail.com> 34846 34847 Change umovestr API: return > 0 instead of 0 if NUL was seen. 34848 * pathtrace.c (upathmatch): Adjust umovestr return value check for new API. 34849 * util.c (printpathn): Use umovestr() > 0 return value for more efficient 34850 (and robust - we don't depend on "no overwrote past NUL" behavior anymore) 34851 handling of terminating NUL. 34852 (printstr): Remove useless NUL placement before umovestr() call. 34853 Allocate 1 byte more to outstr[] array - for NUL. 34854 (umovestr): Change to return 1 if NUL was seen. 34855 34856 umovestr result may have no NUL, use "%.*s" instead of "%s" to print it. 34857 * system.c (sys_mount): Be careful when printing umovestr result, 34858 it may have no terminating NUL. 34859 (sys_sysmips): Likewise. 34860 34861 2012-01-20 Denys Vlasenko <vda.linux (a] googlemail.com> 34862 34863 Eliminate code duplication in time printing, reduce a few static buffers 34864 text data bss dec hex filename 34865 238454 664 28772 267890 41672 strace.before 34866 238106 664 28676 267446 414b6 strace 34867 34868 * defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines. 34869 Add 'int special' parameter to sprinttv(). 34870 * time.c (sprinttv): Add 'int special' parameter, and use it 34871 similarly to 'int special' parameter of printtv_bitness(). 34872 (printtv_bitness): Use sprinttv() instead of duplicating its code. 34873 (print_timespec): Use sprint_timespec() instead of duplicating 34874 its code. 34875 * desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128 34876 when checking remaining buffer size. 34877 * net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128 34878 for static buffer size. 34879 * stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128 34880 when checking remaining buffer size. 34881 34882 2012-01-19 Denys Vlasenko <dvlasenk (a] redhat.com> 34883 34884 Reduce bss usage and speed up string printing. 34885 text data bss dec hex filename 34886 237913 660 49284 287857 46471 strace.before 34887 237973 660 28772 267405 4148d strace 34888 34889 This reduces L1 D-cache pressure a bit: instead of dirtying 34890 20k of bss, we will reuse already dirty stack area. 34891 34892 * util.c (printpathn): Use on-stack buffers instead of static ones. 34893 Saves 5*MAXPATHLEN in bss. 34894 (printstr): Use tprints() instead of tprintf("%s") when printing 34895 formatted string. May be a bit faster, depending on libc. 34896 34897 2012-01-18 Andreas Schwab <schwab (a] linux-m68k.org> 34898 34899 Add support for compat_statfs64. 34900 * file.c (struct compat_statfs64, printcompat_statfs64): Define. 34901 (sys_statfs64, sys_fstatfs64): Use it. 34902 34903 Add support for statfs64.f_flags. 34904 * file.c (printstatfs64): Print f_flags if available. 34905 34906 Fix missing parens. 34907 * signal.c (sys_sigreturn): Add missing parens. 34908 34909 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 34910 34911 Get rid of TCB_SIGTRAPPED. 34912 On attempts to block or set SIGTRAP handler, 34913 for example, using sigaction syscall, we generate 34914 an additional SIGSTOP. 34915 34916 This change gets rid of this SIGSTOP sending/ignoring. 34917 It appears to work just fine. 34918 34919 It also works if I force strace to not use PTRACE_O_TRACESYSGOOD, 34920 which means strace stops will be marked with SIGTRAP, 34921 not (SIGTRAP | 0x80) - I wondered maybe that's when 34922 this hack is needed. 34923 34924 So, why we even have TCB_SIGTRAPPED? No one knows. It predates 34925 version control: this code was present in the initial commit, 34926 in 1999. No adequate comments, either. 34927 34928 Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction 34929 and sys_sigprocmask syscalls - the ones which are most usually 34930 used to implement signal blocking, it is only set in obsolete 34931 sys_signal, sys_sigaction, sys_sigsetmask, and in some dead 34932 non-Linux code. 34933 34934 I think whatever bug it was fixing is gone long ago - 34935 at least as long as sys_rt_sigaction is used by glibc. 34936 Again, since glibc (and uclibc) uses sys_rt_sigaction 34937 and sys_sigprocmask, modified code paths are not used 34938 by most programs anyway. 34939 34940 * defs.h: Remove definition of TCB_SIGTRAPPED. 34941 * signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP. 34942 (sys_sigsetmask): Likewise. 34943 (sys_sigaction): Likewise. 34944 (sys_signal): Likewise. 34945 * strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set. 34946 34947 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 34948 34949 When we write log, flush output buffers in a few more cases. 34950 I observed a case when signal delivery message was buffered 34951 by stdio until it was flushed along with the next syscall 34952 entry message. 34953 34954 * strace.c (trace): Flush output buffers in a few more cases. 34955 34956 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 34957 34958 Fix old sigaction display. 34959 * signal.c (sys_sigaction): Fix display of sigaction with 34960 SIG_DFL/SIG_IGN handlers. 34961 34962 Change x86_64_regs struct type from pt_regs to user_regs_struct. 34963 * syscall.c: Change x86_64_regs struct type from 34964 pt_regs to user_regs_struct, and explain the change in comment. 34965 34966 2012-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 34967 34968 Fix struct pt_regs declaration on i386 and x86-64. 34969 * defs.h [I386] (i386_regs): Replace definition with declaration. 34970 [X86_64] (x86_64_regs): Remove. 34971 * syscall.c [X86_64] (x86_64_regs): Make static. 34972 34973 2012-01-12 Denys Vlasenko <dvlasenk (a] redhat.com> 34974 34975 Make ERESTARTxyz messages more descriptive. 34976 There is widespread confusion about exact meaning 34977 of ERESTARTxyz codes. Before this change, we were showing 34978 all four of them the same: as "(To be restarted)". 34979 34980 This change prints better explanations for these codes, 34981 and contains verbose comments which explain *why* we display 34982 codes that way - or else someone confused 34983 is bound to come later and mangle them again. 34984 New messages are: 34985 34986 ERESTARTSYS (To be restarted if SA_RESTART is set) 34987 ERESTARTNOINTR (To be restarted) 34988 ERESTARTNOHAND (Interrupted by signal) 34989 ERESTART_RESTARTBLOCK (Interrupted by signal) 34990 34991 * syscall.c (trace_syscall_exiting): Make ERESTARTxyz messages 34992 more descriptive. 34993 34994 2012-01-10 Denys Vlasenko <dvlasenk (a] redhat.com> 34995 34996 Fix sigreturn arg count from 1 to 0 on all architectures. 34997 * linux/alpha/syscallent.h: Change [rt_]sigreturn's arg count to 0. 34998 * linux/arm/syscallent.h: Likewise. 34999 * linux/avr32/syscallent.h: Likewise. 35000 * linux/bfin/syscallent.h: Likewise. 35001 * linux/m68k/syscallent.h: Likewise. 35002 * linux/microblaze/syscallent.h: Likewise. 35003 * linux/mips/syscallent.h: Likewise. 35004 * linux/powerpc/syscallent.h: Likewise. 35005 * linux/sh/syscallent.h: Likewise. 35006 * linux/sh64/syscallent.h: Likewise. 35007 * linux/sparc/syscallent.h: Likewise. 35008 * linux/tile/syscallent.h: Likewise. 35009 35010 2012-01-10 Denys Vlasenko <dvlasenk (a] redhat.com> 35011 35012 Display mask on enter to sigreturn, not on exit. 35013 sys_sigreturn() performs ugly manipulations in order to show 35014 signal mask which is restored by this syscall: on syscall entry, 35015 fetches it from the stack, saves it in tcp->u_arg[] 35016 (where it used to overflow this array - fixed sometime ago), 35017 then retrieves the mask and displays it on syscall exit. 35018 35019 Apparently, the motivation is to make it slightly more obvious 35020 to user that signal mask is restored only when this syscall returns. 35021 IMO, this hardly justifies the necessary hacks. It is much easier 35022 to display the mask at the point when we fetch it - on syscall entry. 35023 35024 While at it, I made it so that we do display returned value/errno. 35025 I see no point in hiding it and showing uninformative "= ?" instead. 35026 35027 Example of pause() being interrupted by ALRM which has installed handler 35028 which re-arms ALRM: 35029 35030 Before the patch: 35031 35032 rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted) 35033 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) --- 35034 alarm(1) = 0 35035 sigreturn() = ? (mask now [INT]) 35036 35037 After: 35038 35039 rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted) 35040 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) --- 35041 alarm(1) = 0 35042 sigreturn() (mask [INT]) = -1 EINTR (Interrupted system call) 35043 35044 * defs.h: Declare struct pt_regs i386_regs and struct pt_regs x86_64_regs. 35045 * syscall.c: Remove "static" keywork from these structures' definitions. 35046 * signal.c (sys_sigreturn): Display mask on enter, not on exit. 35047 35048 2012-01-04 Denys Vlasenko <dvlasenk (a] redhat.com> 35049 35050 Do not detach from tracee which experienced ptrace error. 35051 Before this patch, if a thread got nuked by exit in another thread 35052 and we happened to poke it at the same time, we print "????(" thingy 35053 and detach the thread. Since we removed "detach before death" logic, 35054 this no longer matches the behavior of other threads. 35055 Before patch: 35056 [pid 1780] exit_group(1) = ? 35057 [pid 1778] ????( <unfinished ...> 35058 Process 1778 detached 35059 [pid 5860] +++ exited with 1 +++ 35060 After: 35061 [pid 17765] exit_group(1) = ? 35062 [pid 21680] ????( <unfinished ...> 35063 [pid 17791] +++ exited with 1 +++ 35064 [pid 21680] +++ exited with 1 +++ 35065 35066 * strace (trace): Do not detach from tracee which experienced ptrace error. 35067 35068 2012-01-04 Denys Vlasenko <dvlasenk (a] redhat.com> 35069 35070 Remove sig parameter from detach() 35071 * strace.c (detach): Drop sig parameter - it is zero in all calls. 35072 (cleanup): Don't pass sig = 0 to detach() call. 35073 (detach): Ditto. 35074 35075 2011-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 35076 35077 Enhance decoding for personalities with small wordsize. 35078 * util.c (umoven, umovestr) [SUPPORTED_PERSONALITIES > 1]: If current 35079 personality's wordsize is less than sizeof(long), use only significant 35080 bits of the given address. 35081 35082 2011-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 35083 35084 Enhance personality switching. 35085 On syscall entry, save current personality in the tcb structure 35086 along with scno. 35087 On syscall exit, restore current personality from the tcb structure. 35088 * defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers 35089 field. 35090 * strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize 35091 tcp->currpers. 35092 * syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New 35093 function. 35094 (get_scno, trace_syscall_exiting): Use it. 35095 35096 Reported-by: Michael A Fetterman <mafetter (a] nvidia.com> 35097 35098 2011-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 35099 35100 * net.c (socktcpoptions): Add more TCP_* constants from linux/tcp.h. 35101 Reported-by: Rick Jones <rick.jones2 (a] hp.com> 35102 35103 2011-12-01 Heiko Carstens <heiko.carstens (a] de.ibm.com> 35104 35105 Fix sys_ipc/sys_semtimedop decoding on s390. 35106 The s390 kernel sys_ipc system call only takes five arguments instead of 35107 six arguments which the common code sys_ipc implementation takes. 35108 One of the arguments of the sys_semtimedop subcall is therefore passed in 35109 a different register than in the common code implementation. 35110 This leads to broken decoding of the timespec argument: 35111 35112 semtimedop(0, 0x3ffffb43832, 1, {...}) = -1 EAGAIN 35113 35114 Fixed it looks like this: 35115 35116 semtimedop(0, 0x3ffffc2c842, 1, {0, 10000000}) = -1 EINTR 35117 35118 * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390. 35119 35120 2011-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 35121 35122 strace.c (trace): Fix compilation warning. 35123 35124 2011-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 35125 35126 linux/syscall.h: Remove redundant function declarations. 35127 Remove 51 function declarations aliased to other declarations in 35128 linux/dummy.h file. 35129 35130 linux/syscall.h: Sort function declarations. 35131 35132 linux/syscall.h: Place one function declaration per line. 35133 35134 Remove redundant parsers. 35135 * desc.c (sys_dup): Remove. 35136 * file.c (sys_pivotroot, sys_rmdir, sys_fchdir, sys_chroot, sys_fchroot, 35137 sys_unlink, sys_symlink, sys_rename): Remove. 35138 * linux/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_pivotroot, 35139 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 35140 * linux/dummy.h: Add aliases for sys_chroot, sys_dup, sys_pivotroot, 35141 sys_rename, sys_rmdir, sys_symlink, sys_unlink. 35142 * pathtrace.c (pathtrace_match): Update. 35143 * sunos4/dummy.h: Add aliases for sys_chroot, sys_dup, sys_fchdir, 35144 sys_fchroot, sys_rename, sys_rmdir, sys_symlink, sys_unlink. 35145 * svr4/dummy.h: Likewise. 35146 * sunos4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot, 35147 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 35148 * svr4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot, 35149 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 35150 35151 Reflect the fact that nfsservctl syscall was removed from linux kernels. 35152 linux/dummy.h: Move nfsservctl to "unimplemented" section. 35153 35154 2011-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 35155 35156 x86_64: add getcpu syscall entry. 35157 * linux/x86_64/syscallent.h: Add syscall entry for getcpu. 35158 35159 2011-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35160 35161 Add syscall entries for new linux syscalls. 35162 * linux/dummy.h: Add printargs parsers for new syscalls. 35163 * linux/arm/syscallent.h: Add entries for sys_clock_adjtime, 35164 sys_name_to_handle_at, sys_open_by_handle_at, sys_sendmmsg, sys_setns 35165 and sys_syncfs. 35166 * linux/i386/syscallent.h: Likewise. 35167 * linux/ia64/syscallent.h: Likewise. 35168 * linux/mips/syscallent.h: Likewise. 35169 * linux/powerpc/syscallent.h: Likewise. 35170 * linux/sh/syscallent.h: Likewise. 35171 * linux/sh64/syscallent.h: Likewise. 35172 * linux/sparc/syscallent.h: Likewise. 35173 * linux/x86_64/syscallent.h: Likewise. 35174 * linux/alpha/syscallent.h: Add entries for sys_clock_adjtime, 35175 sys_name_to_handle_at, sys_open_by_handle_at, sys_setns and sys_syncfs. 35176 * linux/m68k/syscallent.h: Likewise. 35177 * linux/microblaze/syscallent.h: Likewise. 35178 * linux/s390/syscallent.h: Likewise. 35179 * linux/s390x/syscallent.h: Likewise. 35180 * linux/avr32/syscallent.h: Add entry for sys_setns. 35181 * linux/bfin/syscallent.h: Add entries for sys_sendmmsg and sys_setns. 35182 * linux/hppa/syscallent.h: Add entries for sys_clock_adjtime, 35183 fanotify_init, fanotify_mark, sys_name_to_handle_at, 35184 sys_open_by_handle_at, sys_sendmmsg, sys_setns and sys_syncfs. 35185 35186 Fix prctl syscall entries. 35187 * linux/mips/syscallent.h: Fix prctl handler. 35188 * linux/tile/syscallent.h: Likewise. 35189 35190 arm: fix io_* syscall entries. 35191 * linux/arm/syscallent.h: Fix handlers for io_setup, io_destroy, 35192 io_getevents, io_submit and io_cancel. 35193 35194 Fix mincore syscall entries. 35195 * linux/arm/syscallent.h: Fix mincore handler. 35196 * linux/avr32/syscallent.h: Likewise. 35197 * linux/mips/syscallent.h: Likewise. 35198 * linux/sh/syscallent.h: Likewise. 35199 * linux/sh64/syscallent.h: Likewise. 35200 35201 2011-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 35202 35203 Fix sendmsg syscall entries. 35204 * linux/arm/syscallent.h: Fix number of sendmsg arguments. 35205 * linux/avr32/syscallent.h: Likewise. 35206 * linux/bfin/syscallent.h: Likewise. 35207 * linux/hppa/syscallent.h: Likewise. 35208 * linux/i386/syscallent.h: Likewise. 35209 * linux/m68k/syscallent.h: Likewise. 35210 * linux/microblaze/syscallent.h: Likewise. 35211 * linux/powerpc/syscallent.h: Likewise. 35212 * linux/s390/syscallent.h: Likewise. 35213 * linux/s390x/syscallent.h: Likewise. 35214 * linux/sh/syscallent.h: Likewise. 35215 * linux/sh64/syscallent.h: Likewise. 35216 * linux/sparc/syscallent.h: Likewise. 35217 * linux/tile/syscallent.h: Likewise. 35218 * linux/x86_64/syscallent.h: Likewise. 35219 35220 Fix epoll_wait syscall entries. 35221 * linux/arm/syscallent.h: Fix epoll_wait flags and handler. 35222 * linux/m68k/syscallent.h: Fix epoll_wait flags. 35223 * linux/microblaze/syscallent.h: Fix number of epoll_wait arguments. 35224 * linux/sh/syscallent.h: Likewise. 35225 * linux/sh64/syscallent.h: Likewise. 35226 * linux/x86_64/syscallent.h: Likewise. 35227 35228 Fix epoll_ctl syscall entries. 35229 * linux/arm/syscallent.h: Fix epoll_ctl flags and handler. 35230 * linux/m68k/syscallent.h: Fix epoll_ctl flags. 35231 * linux/x86_64/syscallent.h: Fix number of epoll_ctl arguments. 35232 35233 arm: fix epoll_create syscall entry. 35234 * linux/arm/syscallent.h: Fix epoll_create handler. 35235 35236 Fix mlockall syscall entries. 35237 * linux/arm/syscallent.h: Fix number of mlockall arguments. 35238 * linux/avr32/syscallent.h: Likewise. 35239 * linux/bfin/syscallent.h: Likewise. 35240 * linux/i386/syscallent.h: Likewise. 35241 * linux/m68k/syscallent.h: Likewise. 35242 * linux/microblaze/syscallent.h: Likewise. 35243 * linux/s390/syscallent.h: Likewise. 35244 * linux/s390x/syscallent.h: Likewise. 35245 * linux/sh/syscallent.h: Likewise. 35246 * linux/sh64/syscallent.h: Likewise. 35247 * linux/sparc/syscallent.h: Likewise. 35248 * linux/tile/syscallent.h: Likewise. 35249 * linux/x86_64/syscallent.h: Likewise. 35250 35251 Fix epoll_pwait syscall entries. 35252 * linux/alpha/syscallent.h: Fix number of epoll_pwait arguments. 35253 * linux/arm/syscallent.h: Likewise. 35254 * linux/avr32/syscallent.h: Likewise. 35255 * linux/bfin/syscallent.h: Likewise. 35256 * linux/i386/syscallent.h: Likewise. 35257 * linux/ia64/syscallent.h: Likewise. 35258 * linux/m68k/syscallent.h: Likewise. 35259 * linux/microblaze/syscallent.h: Likewise. 35260 * linux/mips/syscallent.h: Likewise. 35261 * linux/powerpc/syscallent.h: Likewise. 35262 * linux/s390/syscallent.h: Likewise. 35263 * linux/s390x/syscallent.h: Likewise. 35264 * linux/sh/syscallent.h: Likewise. 35265 * linux/sh64/syscallent.h: Likewise. 35266 * linux/sparc/syscallent.h: Likewise. 35267 * linux/tile/syscallent.h: Likewise. 35268 * linux/x86_64/syscallent.h: Likewise. 35269 35270 Fix reboot syscall entries. 35271 * linux/alpha/syscallent.h: Fix number of reboot arguments. 35272 * linux/arm/syscallent.h: Likewise. 35273 * linux/avr32/syscallent.h: Likewise. 35274 * linux/bfin/syscallent.h: Likewise. 35275 * linux/hppa/syscallent.h: Likewise. 35276 * linux/i386/syscallent.h: Likewise. 35277 * linux/ia64/syscallent.h: Likewise. 35278 * linux/m68k/syscallent.h: Likewise. 35279 * linux/microblaze/syscallent.h: Likewise. 35280 * linux/mips/syscallent.h: Likewise. 35281 * linux/powerpc/syscallent.h: Likewise. 35282 * linux/s390/syscallent.h: Likewise. 35283 * linux/s390x/syscallent.h: Likewise. 35284 * linux/sh/syscallent.h: Likewise. 35285 * linux/sh64/syscallent.h: Likewise. 35286 * linux/sparc/syscallent.h: Likewise. 35287 * linux/tile/syscallent.h: Likewise. 35288 * linux/x86_64/syscallent.h: Likewise. 35289 35290 Fix swapon syscall entries. 35291 * linux/arm/syscallent.h: Fix number of swapon arguments. 35292 * linux/avr32/syscallent.h: Likewise. 35293 * linux/bfin/syscallent.h: Likewise. 35294 * linux/i386/syscallent.h: Likewise. 35295 * linux/m68k/syscallent.h: Likewise. 35296 * linux/microblaze/syscallent.h: Likewise. 35297 * linux/mips/syscallent.h: Likewise. 35298 * linux/powerpc/syscallent.h: Likewise. 35299 * linux/s390/syscallent.h: Likewise. 35300 * linux/s390x/syscallent.h: Likewise. 35301 * linux/sh/syscallent.h: Likewise. 35302 * linux/sh64/syscallent.h: Likewise. 35303 * linux/sparc/syscallent.h: Likewise. 35304 * linux/tile/syscallent.h: Likewise. 35305 * linux/x86_64/syscallent.h: Likewise. 35306 * linux/alpha/syscallent.h: Fix number of swapon arguments, add TF flag. 35307 * linux/hppa/syscallent.h: Likewise. 35308 * linux/ia64/syscallent.h: Likewise. 35309 35310 Fix sgetmask and ssetmask syscall entries. 35311 * linux/hppa/syscallent.h: Fix sgetmask and ssetmask entries. 35312 * linux/powerpc/syscallent.h: Likewise. 35313 * linux/sparc/syscallent.h: Likewise. 35314 * linux/tile/syscallent.h: Likewise. 35315 35316 Rename siggetmask to sgetmask and sigsetmask to ssetmask. 35317 * linux/arm/syscallent.h: Rename siggetmask to sgetmask and 35318 sigsetmask to ssetmask. 35319 * linux/bfin/syscallent.h: Likewise. 35320 * linux/i386/syscallent.h: Likewise. 35321 * linux/m68k/syscallent.h: Likewise. 35322 * linux/microblaze/syscallent.h: Likewise. 35323 * linux/mips/syscallent.h: Likewise. 35324 * linux/sh/syscallent.h: Likewise. 35325 * linux/sh64/syscallent.h: Likewise. 35326 * linux/ia64/syscallent.h: Rename sys_sgetmask to sys_siggetmask, 35327 sys_ssetmask to sys_sigsetmask. 35328 35329 Add TRACE_IPC flag to sys_ipc syscall entries. 35330 * linux/arm/syscallent.h: Add TI flag to sys_ipc entry. 35331 * linux/avr32/syscallent.h: Likewise. 35332 * linux/bfin/syscallent.h: Likewise. 35333 * linux/i386/syscallent.h: Likewise. 35334 * linux/m68k/syscallent.h: Likewise. 35335 * linux/microblaze/syscallent.h: Likewise. 35336 * linux/mips/syscallent.h: Likewise. 35337 * linux/powerpc/syscallent.h: Likewise. 35338 * linux/s390/syscallent.h: Likewise. 35339 * linux/s390x/syscallent.h: Likewise. 35340 * linux/sh/syscallent.h: Likewise. 35341 * linux/sh64/syscallent.h: Likewise. 35342 * linux/sparc/syscallent.h: Likewise. 35343 35344 2011-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 35345 35346 gitlog-to-changelog: update from gnulib. 35347 * gitlog-to-changelog: Update from gnulib. 35348 * Makefile.am: Add --append-dot to gitlog-to-changelog invocation. 35349 35350 2011-10-22 Denys Vlasenko <dvlasenk (a] redhat.com> 35351 35352 Decode TIOCSCTTY's third parameter. 35353 * term.c (term_ioctl): Decode TIOCSCTTY's third parameter. 35354 35355 2011-10-14 Dmitry V. Levin <ldv (a] altlinux.org> 35356 35357 Remove useless and obsolete "#if DONE" sections. No code changes. 35358 * linux/dummy.h: Remove "#if DONE" section. 35359 * linux/sparc/dummy2.h: Likewise. 35360 * linux/sparc64/dummy2.h: Likewise. 35361 * sunos4/dummy.h: Likewise. 35362 * svr4/dummy.h: Likewise. 35363 35364 Add names for dummy parsers. No code changes. 35365 * linux/dummy.h: Add aliases to printargs() for those of dummy parsers 35366 that had no own names before. 35367 * linux/*/syscallent.h: Use these new names instead of printargs. 35368 35369 Sort definitions of dummy parsers. No code changes. 35370 * linux/dummy.h: Sort definitions of parsers implemented as aliases 35371 to printargs(). 35372 35373 2011-10-14 Mike Frysinger <vapier (a] gentoo.org> 35374 35375 sys_epoll_create1: decode flag arguments correctly. 35376 * desc.c (epollflags): Define. 35377 (sys_epoll_create1): Use epollflags to printflags. Change "O" to "EPOLL". 35378 35379 Reported-by: <socketpair (a] gmail.com> 35380 35381 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 35382 35383 Implement decoding of splice, tee and vmsplice(2) syscalls. 35384 * io.c (print_loff_t): New function. 35385 (sys_sendfile64): Use it. 35386 (splice_flags): New xlat structure. 35387 (sys_tee, sys_splice, sys_vmsplice): New functions. 35388 * linux/syscall.h (sys_tee, sys_splice, sys_vmsplice): Declare them. 35389 * linux/*/syscallent.h: Use them. 35390 35391 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 35392 35393 Fix epoll_wait and epoll_pwait decoding. 35394 * desc.c (epoll_wait_common): Print "maxevents" and "timeout" arguments 35395 as integers. 35396 35397 Reported-by: <socketpair (a] gmail.com> 35398 35399 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 35400 35401 Decode EPOLLRDHUP. 35402 * desc.c (epollevents): Add EPOLLRDHUP. 35403 35404 Reported-by: <socketpair (a] gmail.com> 35405 35406 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 35407 35408 Remove unreachable code in umoven() and umovestr(). 35409 * util.c (umoven, umovestr): Remove unreachable code. 35410 35411 Reported-by: Weichuan Yan <wchyan (a] marvell.com> 35412 35413 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 35414 35415 Do post-attach initialization earlier; fix "we ignore SIGSTOP on NOMMU" bug 35416 We set ptrace options when we see post-attach SIGSTOP. 35417 This is wrong: it's better to set them right away on the very first 35418 stop (whichever it will be). It also will make adding SEIZE support easier, 35419 since SEIZE has no post-attach SIGSTOP. 35420 35421 We do it by adding a new bit, TCB_IGNORE_ONE_SIGSTOP, and treating 35422 TCB_STARTUP and TCB_IGNORE_ONE_SIGSTOP as two slightly different things. 35423 35424 * defs.h: Add a new flag bit, TCB_IGNORE_ONE_SIGSTOP. 35425 * process.c (internal_fork): Set TCB_IGNORE_ONE_SIGSTOP on a newly added child. 35426 * strace.c (startup_attach): Set TCB_IGNORE_ONE_SIGSTOP after attach. 35427 Fix a case when "strace -p PID" found PID dead but sone other of its threads 35428 still alive. 35429 (startup_child): Set TCB_IGNORE_ONE_SIGSTOP after attach, _if needed_. 35430 This fixes a bogus case where we can ignore a _real_ SIGSTOP on NOMMU. 35431 (detach): Perform anti-SIGSTOP dance only if TCB_IGNORE_ONE_SIGSTOP is set, 35432 not if TCB_STARTUP is set. 35433 (trace): Set TCB_IGNORE_ONE_SIGSTOP after attach. 35434 Clear TCB_STARTUP and initialize tracee on the very first tracee stop. 35435 Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen. 35436 35437 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 35438 35439 Get rid of TCB_ATTACH_DONE. 35440 * defs.h: Remove TCB_ATTACH_DONE constant. 35441 * strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE 35442 to distinquish attached from not-yet-attached threads. 35443 35444 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 35445 35446 Set TCB_STARTUP only _after_ we attached. 35447 This fixes logic in detach() which thinks that TCB_STARTUP 35448 means that we are already attached, but did not see SIGSTOP yet. 35449 This also allows to get rid of TCB_ATTACH_DONE flag. 35450 35451 * process.c (internal_fork): Set TCB_STARTUP after attach. 35452 * strace.c (startup_attach): Likewise. 35453 (startup_child): Likewise. 35454 (alloc_tcb): Do not set TCB_STARTUP on tcb allocation - we are 35455 not attached yet. 35456 (trace): Set TCB_STARTUP when we detech an auto-attached child. 35457 35458 2011-09-02 Denys Vlasenko <dvlasenk (a] redhat.com> 35459 35460 Simple optimizations in trace() 35461 * strace.c (trace): Calculate WSTOPSIG(status) once, 35462 unify code paths to ptrace(PTRACE_SYSCALL). 35463 35464 Trivial fixes on error paths. 35465 * strace.c (startup_attach): Emit message on fork() failure. 35466 (startup_child): Remove non-informative comment. 35467 * util.c (ptrace_restart): use perror_msg() on error instead of fprintf(). 35468 35469 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 35470 35471 Fix compile failure introduced by last commit. 35472 * desc.c (decode_select): Fix double definition of nfds. 35473 35474 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 35475 35476 Roll back "die on malloc failure" behaviour a bit. 35477 After recent change, select(2^31-1, NULL, NULL, NULL) 35478 would make strace exit. This change caps fdsize so that 35479 it is always in [0, 1025*1024], IOW: we will try to allocate at most 35480 1 megabyte, which in practice will almost always work, 35481 unlike malloc(2Gig). 35482 35483 * desc.c (decode_select): Cap fdsize to 1024*1024. 35484 * pathtrace.c (pathtrace_match): Cap fdsize to 1024*1024. 35485 * file.c (sys_getdents): Cap len to 1024*1024. 35486 (sys_getdents64): Cap len to 1024*1024. 35487 * util.c (dumpiov): Refuse to process iov with more than 1024*1024 35488 elements. Don't die on malloc failure. 35489 (dumpstr): Don't die on malloc failure. 35490 35491 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 35492 35493 Add stpcpy to autoconf machinery. 35494 * configure.ac: Add stpcpy to AC_CHECK_FUNCS. 35495 * defs.h: Frame stpcpy with "if !defined HAVE_STPCPY". 35496 * util.c: Likewise. 35497 35498 Simplify sprinttv() 35499 * time.c (sprinttv): Trivial simplifications. 35500 35501 * desc.c (decode_select): Set tcp->auxstr as late as possible. 35502 35503 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 35504 35505 Reformat setuid-ing code in startup_child() 35506 New code does the same as old one, but is more readable (I hope). 35507 35508 * strace.c (startup_child): Reformat setuid-ing code. 35509 35510 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 35511 35512 Minor tweaks in startup_child(). Logic isn't changed (but code is) 35513 * strace.c (startup_attach): Tweak comment. 35514 (startup_child): Move common code out of ifdef. 35515 Indent nested ifdefs. Tweak comments. Remove two 35516 unnecessary calls to getpid(). 35517 35518 Use tprints with literal strings, it may be faster than tprintf. 35519 * bjm.c: Replace tprintf("str") with tprints("str"). 35520 * block.c: Likewise. 35521 * desc.c: Likewise. 35522 * file.c: Likewise. 35523 * io.c: Likewise. 35524 * ipc.c: Likewise. 35525 * mem.c: Likewise. 35526 * net.c: Likewise. 35527 * proc.c: Likewise. 35528 * process.c: Likewise. 35529 * quota.c: Likewise. 35530 * resource.c: Likewise. 35531 * scsi.c: Likewise. 35532 * signal.c: Likewise. 35533 * sock.c: Likewise. 35534 * strace.c: Likewise. 35535 * stream.c: Likewise. 35536 * syscall.c: Likewise. 35537 * system.c: Likewise. 35538 * term.c: Likewise. 35539 * time.c: Likewise. 35540 * util.c: Likewise. 35541 35542 Fix "format not a string literal" warning caused by tprintf(str) 35543 * defs.h: Declare tprints(). 35544 * strace.c: Define tprints(). 35545 (tabto): Use tprints(str), since tprintf(str) was throwing a warning. 35546 * desc.c: Use tprints(str) instead of tprintf("%s", str). 35547 * file.c: Likewise. 35548 * io.c: Likewise. 35549 * net.c: Likewise. 35550 * process.c: Likewise. 35551 * signal.c: Likewise. 35552 * syscall.c: Likewise. 35553 * util.c: Likewise. 35554 35555 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 35556 35557 Add README-linux-ptrace file. 35558 I tried to push this doc to Michael Kerrisk <mtk.manpages (a] gmail.com>, 35559 but got no reply. To avoid losing the document, let it live 35560 in strace tree for now. 35561 35562 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 35563 35564 Make out-of-memory handling more uniform. 35565 This fixes one real bug in dumpstr(). 35566 35567 * defs.h: Declare die_out_of_memory(). 35568 * strace.c (die_out_of_memory): New function. 35569 (strace_popen): If allocation fails, call die_out_of_memory(). 35570 (main): Likewise. 35571 (expand_tcbtab): Likewise. 35572 (rebuild_pollv): Likewise. 35573 * count.c (count_syscall): Likewise. 35574 (call_summary_pers): Likewise. 35575 * desc.c (decode_select): Likewise. 35576 * file.c (sys_getdents): Likewise. 35577 (sys_getdents64): Likewise. 35578 (sys_getdirentries): Likewise. 35579 * pathtrace.c (pathtrace_match): Likewise. 35580 * syscall.c (qualify): Likewise. 35581 * util.c (printstr): Likewise. 35582 (dumpiov): Likewise. 35583 (dumpstr): Likewise. 35584 (fixvfork): Likewise. 35585 * mem.c (sys_mincore): Don't check free() parameter for NULL. 35586 35587 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 35588 35589 Optimization: eliminate all remaining usages of strcat() 35590 After this change, we don't use strcat() anywhere. 35591 35592 * defs.h: Change sprinttv() return type to char *. 35593 * time.c (sprinttv): Return pointer past last stored char. 35594 * desc.c (decode_select): Change printing logic in order to eliminate 35595 usage of strcat() - use stpcpy(), *outptr++ = ch, sprintf() instead. 35596 Also reduce usage of strlen(). 35597 * stream.c (decode_poll): Likewise. 35598 35599 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 35600 35601 Optimize string_quote() for speed. 35602 * util.c (string_quote): Speed up check for terminating NUL. 35603 Replace strintf() with open-coded binary to hex/oct conversions - 35604 we potentially do them for every single byte, need to be fast. 35605 35606 Optimization: eliminate some usages of strcat() 35607 * defs.h: Declare stpcpy(). 35608 * util.c: Define stpcpy(). 35609 * file.c: Remove static str_append(). 35610 (sprint_open_modes): Use stpcpy() instead of str_append(). 35611 (sprintflags): Use stpcpy() instead of strcat(). 35612 (printpathn): Eliminate usage of strcat(). 35613 (printstr): Eliminate usage of strcat(). 35614 35615 2011-08-30 Denys Vlasenko <dvlasenk (a] redhat.com> 35616 35617 Small optimization on AVR32. 35618 * syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting 35619 from regs.FOO for AVR32. 35620 35621 2011-08-30 Denys Vlasenko <dvlasenk (a] redhat.com> 35622 35623 On X86_64 and I386, use PTRACE_GETREGS to fetch all registers. 35624 Before this change, registers were read with PTRACE_PEEKUSER 35625 ptrace operation, one per register. This is slower than 35626 fetching them all in one ptrace operation. 35627 35628 * defs.h: include asm/ptrace.h on X86_64 and I386. 35629 * syscall.c: New static variables i386_regs and x86_64_regs. 35630 Remove static eax/rax variables. 35631 (get_scno): Fetch all registers with single PTRACE_GETREGS operation. 35632 (get_syscall_result): Likewise. 35633 (syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs. 35634 (syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results. 35635 (get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results. 35636 35637 2011-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 35638 35639 Do not include <limits.h> 35640 * strace.c: Do not include <limits.h> explicitly, it is already included 35641 implicitly by <sys/param.h>. 35642 35643 2011-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 35644 35645 Include <sys/param.h> to get PATH_MAX definition. 35646 * pathtrace.c: Include <sys/param.h> instead of <limits.h> to get 35647 PATH_MAX definition. 35648 35649 Reported-by: Steve Bennett <steveb (a] workware.net.au> 35650 35651 2011-08-26 Denys Vlasenko <dvlasenk (a] redhat.com> 35652 35653 Indent a large set of nested ifdefs/endifs. No code changes. 35654 * defs.h: Indent a large set of nested ifdefs/endifs 35655 35656 Rename syscall_fixup to syscall_fixup_on_sysenter. 35657 * defs.h: Tweak comment. 35658 * syscall.c: Rename syscall_fixup to syscall_fixup_on_sysenter. 35659 (trace_syscall_entering): Use new finction name. 35660 35661 Make syscall result reading more consistent among different arches. 35662 * syscall.c: Eliminate static flags variable for POWERPC. 35663 (syscall_fixup): Don't fetch syscall results. Affected arches: 35664 POWERPC, BFIN, HPPA. 35665 (syscall_fixup_on_sysexit): Move syscall results fetching code 35666 for this function to get_syscall_result. Affected arches: 35667 S390X, POWERPC, BFIN, M68K, HPPA, CRIS, MICROBLAZE. 35668 (get_syscall_result): Add syscall results fetching. 35669 35670 2011-08-25 Denys Vlasenko <dvlasenk (a] redhat.com> 35671 35672 Simplify syscall_fixup[_on_sysexit] 35673 * syscall.c (syscall_fixup): Remove checks for entering(tcp). 35674 Remove code which executes if exiting(tcp). 35675 (syscall_fixup_on_sysexit): Remove code which executes 35676 if entering(tcp). Remove checks for exiting(tcp). 35677 35678 Split syscall_fixup into enter/exit pair of functions. 35679 * syscall.c: Create syscall_fixup_on_sysexit() which is a copy of 35680 syscall_fixup(). 35681 (trace_syscall_exiting): Call syscall_fixup_on_sysexit() instead of 35682 syscall_fixup(). 35683 35684 Remove stray commas in struct initializers. No code changes. 35685 * process.c: Remove stray commas in struct initializers. 35686 35687 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35688 35689 Optimize tabto() 35690 tabto is used in many lines of strace output. 35691 On glibc, tprintf("%*s", col - curcol, "") is noticeably slow 35692 compared to tprintf(" "). Use the latter. 35693 Observed ~15% reduction of time spent in userspace. 35694 35695 * defs.h: Drop extern declaration of acolumn. Make tabto() 35696 take no parameters. 35697 * process.c (sys_exit): Call tabto() with no parameters. 35698 * syscall.c (trace_syscall_exiting): Call tabto() with no parameters. 35699 * strace.c: Make acolumn static, add static char *acolumn_spaces. 35700 (main): Allocate acolumn_spaces as a string of spaces. 35701 (printleader): Call tabto() with no parameters. 35702 (tabto): Use simpler method to print lots of spaces. 35703 35704 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35705 35706 * syscall.c (sys_indir): Use %ld for printing long, not %u. 35707 35708 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35709 35710 Opotimize "scno >= 0 && scno < nsyscalls" check. 35711 gcc can't figure out on its own that this check can be done with 35712 single compare, and does two compares. We can help it by casting 35713 scno to unsigned long: ((unsigned long)(scno) < nsyscalls) 35714 35715 * defs.h: New macro SCNO_IN_RANGE(long_var). 35716 * count.c (count_syscall): Use SCNO_IN_RANGE() instead of open-coded check. 35717 * syscall.c (getrval2): Use SCNO_IN_RANGE() instead of open-coded check. 35718 This fixes a bug: missing check for scno < 0 and scno > nsyscalls 35719 instead of scno >= nsyscalls. 35720 (get_scno): Use SCNO_IN_RANGE() instead of open-coded check. 35721 This fixes a bug: scno > nsyscalls instead of scno >= nsyscalls. 35722 (known_scno): Use SCNO_IN_RANGE() instead of open-coded check. 35723 (internal_syscall): Likewise. 35724 (syscall_enter): Likewise. 35725 (trace_syscall_entering): Likewise. 35726 (get_error): Likewise. 35727 (trace_syscall_exiting): Likewise. 35728 35729 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35730 35731 Remove scno_good logic in syscall exit. 35732 * syscall.c (trace_syscall_exiting): Remove scno_good logic, 35733 it can't trigger in syscall exit. 35734 35735 Remove redundant assignments. 35736 * syscall.c (get_error): Remove redundant "u_error = 0" and redundant 35737 and unclear comments. 35738 35739 Group int-sized fields together in struct tcb. 35740 * defs.h: Group int-sized fields together in struct tcb. 35741 35742 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35743 35744 Reorder functions in syscall.c. No code changes. 35745 Old order (basically "in no particular order"): 35746 dumpio 35747 decode_subcall 35748 internal_syscall 35749 get_scno 35750 get_syscall_result 35751 known_scno 35752 syscall_fixup 35753 is_negated_errno 35754 get_error 35755 syscall_enter 35756 trace_syscall_entering 35757 trace_syscall_exiting 35758 trace_syscall 35759 printargs 35760 getrval2 35761 sys_indir 35762 is_restart_error 35763 35764 New order: 35765 various utility functions: 35766 decode_subcall 35767 printargs 35768 getrval2 35769 sys_indir 35770 is_restart_error 35771 syscall enter handling functions: 35772 get_scno 35773 known_scno 35774 syscall_fixup (also used in syscall exit code) 35775 internal_syscall (also used in syscall exit code) 35776 syscall_enter 35777 trace_syscall_entering 35778 syscall exit handling functions: 35779 get_syscall_result 35780 is_negated_errno 35781 get_error 35782 dumpio 35783 trace_syscall_exiting 35784 main syscall enter/exit function: 35785 trace_syscall 35786 35787 * syscall.c: Reorder functions so that related ones are closer 35788 in the source. 35789 35790 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35791 35792 Rename some functions, delete unused one. No code changes. 35793 * defs.h: Rename get_scno_on_sysenter() to get_scno(); 35794 delete force_result() declaration. 35795 * strace.c (proc_open): Rename get_scno_on_sysenter() to get_scno(). 35796 * syscall.c: Rename get_scno_on_sysenter() to get_scno(). 35797 Rename get_scno_on_sysexit() to get_syscall_result(). 35798 Delete unused force_result(). 35799 35800 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35801 35802 Unify per-architecture post-execve SIGTRAP check. 35803 Move post-execve SIGTRAP check from get_scno_on_sysenter 35804 (multitude of places on many architectures) to a single location 35805 in trace_syscall_entering. This loosens the logic for some arches, 35806 since many of them had additional checks such as scno == 0. 35807 However, on non-ancient Linux kernels we should never have post-execve 35808 SIGTRAP in the first place, by virtue of using PTRACE_O_TRACEEXEC. 35809 35810 * syscall.c (get_scno_on_sysenter): Remove tcp->flags & TCB_WAITEXECVE checks. 35811 (trace_syscall_entering): Do tcp->flags & TCB_WAITEXECVE check here. 35812 (get_scno_on_sysexit): Tweak comment. 35813 (syscall_fixup): Likewise. 35814 (trace_syscall_exiting): Likewise. 35815 35816 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35817 35818 Speed up x86 by avoiding EAX read on syscall entry. 35819 on x86, EAX read on syscall entry is not necessary if we know 35820 that post-execve SIGTRAP is disabled by PTRACE_O_TRACEEXEC ptrace option. 35821 This patch (a) moves EAX retrieval from syscall_fixup 35822 to get_scno_on_sysexit, and (b) perform EAX retrieval in syscall_fixup 35823 only if we are in syscall entry and PTRACE_O_TRACEEXEC option is not on. 35824 35825 * syscall.c (get_scno_on_sysexit): On I386 and X86_64, read eax/rax 35826 which contain syscall return value. 35827 (syscall_fixup): On I386 and X86_64, read eax/rax only on syscall enter 35828 and only if PTRACE_O_TRACEEXEC is not in effect. 35829 35830 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35831 35832 Do not read syscall no in get_scno_on_sysexit. 35833 * syscall.c (get_scno_on_sysexit): Remove scno retrieval code, since 35834 we don't save it anyway. This is the first real logic change 35835 which should make strace faster: for example, on x64 ORIG_EAX 35836 is no longer read in each syscall exit. 35837 35838 Simplify get_scno_on_sysenter/sysexit. 35839 * syscall.c (get_scno_on_sysenter): Remove "if (exiting(tcp))" code, 35840 make "if (entering(tcp))" code unconditional. 35841 (get_scno_on_sysexit): Remove "if (entering(tcp))" code, 35842 make "if (exiting(tcp))" code unconditional. 35843 35844 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 35845 35846 get_scno is an unholy mess, make it less horrible. 35847 Currently, get_scno does *much* more than "get syscall no". 35848 It checks for post-execve SIGTRAP. It checks for changes 35849 in personality. It retrieves params on entry and registers on exit. 35850 Worse still, it is different in different architectures: for example, 35851 for AVR32 regs are fetched in get_scno(), while for e.g. I386 35852 it is done in syscall_enter(). 35853 35854 Another problem is that get_scno() is called on both syscall entry and 35855 syscall exit, which is stupid: we don't need to know scno on syscall 35856 exit, it is already known from last syscall entry and stored in 35857 tcp->scno! In essence, get_scno() does two completely different things 35858 on syscall entry and on exit, they are just mixed into one bottle, like 35859 shampoo and conditioner. 35860 35861 The following patches will try to improve this situation. 35862 35863 This change duplicates get_scno into identical get_scno_on_sysenter, 35864 get_scno_on_sysexit functions. Call them in syscall enter and syscall 35865 exit, correspondingly. 35866 35867 * defs.h: Rename get_scno to get_scno_on_sysenter; declare it only 35868 if USE_PROCFS. 35869 * strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno. 35870 * syscall.c (get_scno): Split into two (so far identical) functions 35871 get_scno_on_sysenter and get_scno_on_sysexit. 35872 (trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno. 35873 (trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno. 35874 35875 2011-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 35876 35877 Reduce code redundancy in syscall_enter() 35878 * syscall.c [LINUX] (syscall_enter): Move tcp->u_nargs initialization 35879 from arch-specific ifdefs to common code. Always cache tcp->u_nargs in 35880 a local variable and use it in for() loops. 35881 [IA64, AVR32] Rewrite tcp->u_arg[] initialization using a loop. 35882 35883 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35884 35885 Define MAX_ARGS to 6 for all Linux arches. 35886 * defs.h: Define MAX_ARGS to 6 for all Linux arches. 35887 * linux/ia64/syscallent.h: Change all 8-argument printargs 35888 to MA (MAX_ARGS). 35889 linux/mips/syscallent.h: Change all two 7-argument printargs 35890 to MA (MAX_ARGS). 35891 35892 Fix argument printing in sys_mmap64. 35893 * mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i] 35894 instead of argument values copied from memory. 35895 35896 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35897 35898 Cache tcp->u_nargs in a local variable for for() loops. 35899 Loops of the form "for (i = 0; i < tcp->u_nargs; i++) ..." 35900 need to fetch tcp->u_nargs from memory on every iteration 35901 if "..." part has a function call (gcc doesn't know that 35902 tcp->u_nargs won't change). This can be sped up 35903 by putting tcp->u_nargs in a local variable, which might 35904 go into a CPU register. 35905 35906 * syscall.c (decode_subcall): Cache tcp->u_nargs in a local variable 35907 as for() loop limit value. 35908 (syscall_enter): Likewise. 35909 35910 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35911 35912 Drop checks for sysent[i].nargs == -1. 35913 * defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned. 35914 * syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned. 35915 (decode_subcall): Drop checks for sysent[i].nargs == -1. 35916 (syscall_enter): Likewise. 35917 35918 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35919 35920 Stop using nargs == -1 in syscallent tables. 35921 Usage -1 as argument count in syscallent tables 35922 necessitates the check for it, a-la: 35923 if (sysent[tcp->scno].nargs != -1) 35924 tcp->u_nargs = sysent[tcp->scno].nargs; 35925 else 35926 tcp->u_nargs = MAX_ARGS; 35927 which is stupid: we waste cycles checking something which 35928 is constant and known at compile time. 35929 35930 * defs.h: Make struct sysent::nargs unsigned. 35931 * freebsd/i386/syscallent.h: Replace nargs of -1 with MA. 35932 * linux/s390/syscallent.h: Likewise. 35933 * linux/s390x/syscallent.h: Likewise. 35934 * svr4/syscallent.h: Likewise. 35935 * freebsd/syscalls.pl: Likewise in generator script. 35936 * syscallent.sh: Likewise in generator script. 35937 * syscall.c: Add define MA MAX_ARGS / undef MA around includes 35938 of syscallent[N].h. 35939 35940 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35941 35942 Move trace_syscall_exiting below trace_syscall_entering. No code changes. 35943 Syscall enter happens before syscall exit. Having functions 35944 in opposite order in the source is confusing. 35945 35946 * syscall.c: Move trace_syscall_exiting below trace_syscall_entering. 35947 35948 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35949 35950 Fix -z display. 35951 Before this patch, the following: 35952 open("qwerty", O_RDONLY) = -1 ENOENT 35953 write(2, "wc: qwerty: No such file or dire"..., 38) = 38 35954 was shown totally wrongly with -z: 35955 open("qwerty", O_RDONLY) = 38 35956 (yes, that's right, write syscall is lost!) 35957 Now it is shown "less wrongly" as: 35958 open("qwerty", O_RDONLY <unfinished ...> 35959 write(2, "wc: qwerty: No such file or dire"..., 38) = 38 35960 35961 * syscall.c (trace_syscall_exiting): Use common TCB_INSYSCALL clearing 35962 via "goto ret". This fixes totally broken display of -z, but even now 35963 it is not working as intended. Add a comment about that. 35964 (trace_syscall_entering): Use common TCB_INSYSCALL setting 35965 via "goto ret". 35966 35967 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 35968 35969 Straighten up confused comments/messages about post-execve SIGTRAP handling 35970 * defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail. 35971 * strace.c (choose_pfd): Use entering/exiting macros instead of direct check 35972 for TCB_INSYSCALL. 35973 * syscall.c (get_scno): Use entering/exiting macros instead of direct check 35974 for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP. 35975 (syscall_fixup): Use entering/exiting instead of direct check 35976 for TCB_INSYSCALL. Add a comment what "not a syscall entry" message 35977 usually means. Change wrong "stray syscall exit" messages into 35978 "not a syscall entry" ones. 35979 35980 count_syscall() always returns 0, optimize it. 35981 * defs.h (count_syscall): Change return type from int to void. 35982 * count.c (count_syscall): Change return type from int to void. 35983 * syscall.c (trace_syscall_exiting): Change code around call 35984 to count_syscall accordingly. 35985 35986 Optimize out dummy PC printing on signal delivery. 35987 * strace.c (trace): Optimize out dummy PC printing on signal delivery. 35988 While at it, tweak comments. 35989 35990 Conditionally optimize out unused code. 35991 * syscall.c (internal_syscall): Call internal_exec only if 35992 SUNOS4 || (LINUX && TCB_WAITEXECVE). 35993 * process.c (internal_exec): Define this function only if 35994 SUNOS4 || (LINUX && TCB_WAITEXECVE). 35995 (printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1. 35996 * signal.c (sys_kill): Likewise. 35997 * syscall.c (is_negated_errno): Likewise. 35998 (trace_syscall_exiting): Fold a tprintf into tprintfs which follow it. 35999 36000 Cosmetic improvement in ifdefs. No code changes. 36001 * strace.c (proc_open): Change ifdefs so that braces are properly paired. 36002 36003 Exclude tcp->pfd from non-procfs systems. 36004 * defs.h: Make struct tcb::pfd fields conditional on USE_PROCFS. 36005 * strace.c (alloc_tcb): Use tcp->pfd only if USE_PROCFS. 36006 (droptcb): Likewise. 36007 36008 Small optimizations related to memory allocation. 36009 * strace (expand_tcbtab): Shorten "out of memory" message. 36010 (rebuild_pollv): Remove unnecessary NULL check before free(). 36011 * util.c (dumpstr): Add a comment about likely bug. 36012 36013 Improve code readability by avoiding assignments inside if() 36014 * desc.c (decode_select): Move assignment out of if() condition. 36015 * file.c (sprinttime): Likewise. 36016 (sys_getdirentries): Likewise. 36017 * io.c (sys_ioctl): Likewise. 36018 * strace.c (test_ptrace_setoptions_followfork): Likewise. 36019 (main): Likewise. 36020 (proc_open): Likewise. 36021 (detach): Likewise. 36022 (proc_poll): Likewise. 36023 (trace): Likewise. 36024 * syscall.c (qualify): Likewise. 36025 (sys_indir): Likewise. 36026 * test/procpollable.c (main): Likewise. 36027 * test/sfd.c (main): Likewise. 36028 * time.c (printtv_bitness): Likewise. 36029 (sprinttv): Likewise. 36030 (print_timespec): Likewise. 36031 (void sprint_timespec): Likewise. 36032 (printitv_bitness): Likewise. 36033 * util.c (dumpstr): Likewise. 36034 (umovestr): Likewise. 36035 (fixvfork): Likewise. 36036 36037 Convert ioctl_next_match() to new-style C function definition. 36038 * ioctl.c (ioctl_next_match): Convert to new-style C function definition. 36039 36040 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36041 36042 Small optimization in signal and ioctl tables. 36043 Trivial shuffling of data tables puts them all in one file, 36044 allowing gcc to see their sizes and eliminate variables 36045 which store these sizes. 36046 36047 Surprisingly, in C mode gcc does not optimize out static const int 36048 variables. Help it by using enums instead. 36049 36050 * defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2}, 36051 signalent{0,1,2}, nsignals{0,1,2}. 36052 * ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}. 36053 * signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}. 36054 * syscall.c: Move above definitions to this file. Make them static const 36055 or enums if suitable. 36056 36057 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36058 36059 Don't return int from set_personality(), no one checks it. 36060 * defs.h (set_personality): Change return type to void. 36061 * syscall.c (set_personality): Change return type to void. 36062 36063 Remove unused declaration. 36064 * defs.h: Remove unused declaration of handle_new_child(). 36065 36066 Use natural-sized integer field for tcb::flags. 36067 * defs: Change struct tcb::flags type from short to int. 36068 This results in smaller code at least on x86. 36069 36070 Make needlessly static data local. 36071 * syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers 36072 is declared static. But its old data is never used. Convert it 36073 to ordinary local variable. 36074 36075 Optimize get_scno function. 36076 * syscall.c (get_scno): Make gpr_offset[] array static const. 36077 36078 Optimize iocb_cmd_lookup. 36079 * desc.c (iocb_cmd_lookup): Make command table constant. 36080 Reduce size of static char buffer. 36081 36082 Correct sys_sendfile[64] type and nargs. 36083 * freebsd/i386/syscallent.h: Correct sys_sendfile nargs 7->8 36084 * linux/mips/syscallent.h: Correct sys_sendfile64 nargs 5->4 36085 * linux/sh/syscallent.h: Correct sys_sendfile64 nargs 5->4 36086 * linux/sh64/syscallent.h: Correct sys_sendfile64 nargs 5->4 36087 * linux/m68k/syscallent.h: Correct sys_sendfile64 type TF->TD|TN 36088 * linux/microblaze/syscallent.h: Correct sys_sendfile64 type TF->TD|TN 36089 * linux/tile/syscallent.h: Correct sys_sendfile and sys_sendfile64 type TD->TD|TN 36090 36091 Make addflags return void. 36092 * defs.h (addflags): Change return type from int to void. 36093 * util.c (addflags): Change return type from int to void. 36094 36095 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36096 36097 Set saner MAX_ARGS (6 or 8) for X86_64 and I386. 36098 I noticed that tcp->u_args[MAX_ARGS] array is way larger than 36099 I'd expect: for all arches except HPPA it has 32 (!) elements. 36100 36101 I looked at the code and so far I spotted only one abuser of 36102 this fact: sys_sigreturn. On several arches, it saves sigset_t 36103 into tcp->u_args[1...N] on entry and prints it on exit, a-la 36104 36105 memcpy(&tcp->u_arg[1], &sc.oldmask[0], sizeof(sigset_t)) 36106 36107 The problem here is that in glibc sigset_t is insanely large: 36108 128 bytes, and using sizeof(sigset_t) in memcpy will overrun 36109 &tcp->u_args[1] even with MAX_ARGS == 32: 36110 On 32 bits, sizeof(tcp->u_args) == 32*4 == 128 bytes! 36111 We may already have a bug there! 36112 36113 This commit changes the code to save NSIG / 8 bytes only. 36114 NSIG can't ever be > 256, and in practice is <= 129, 36115 thus NSIG / 8 is <= 16 bytes == 4 32-bit words, 36116 and even MAX_ARGS == 5 should be enough for saving signal masks. 36117 36118 * defs.h: Reduce MAX_ARGS for X86_64 and I386 from 32 to 8 36119 for FreeBSD and to 6 for everyone else. Add comment about current 36120 state of needed MAX_ARGS. 36121 * signal.c: Add comment about size of sigset_t. 36122 (sprintsigmask): Reduce static string buffer from 8k to 2k. 36123 (sys_sigreturn): Fix sigset saving to save only NSIG / 8 bytes, 36124 not sizeof(sigset_t) bytes. 36125 * linux/mips/syscallent.h: Reduce nargs of printargs-type syscall to 7. 36126 * linux/arm/syscallent.h: Reduce nargs of printargs-type syscall to 6. 36127 * linux/i386/syscallent.h: Likewise. 36128 * linux/m68k/syscallent.h: Likewise. 36129 * linux/powerpc/syscallent.h: Likewise. 36130 * linux/s390/syscallent.h: Likewise. 36131 * linux/s390x/syscallent.h: Likewise. 36132 * linux/sh/syscallent.h: Likewise. 36133 * linux/sh64/syscallent.h: Likewise. 36134 * linux/sparc/syscallent.h: Likewise. 36135 36136 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36137 36138 Optimize sys_old_mmap. 36139 * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64, 36140 copy narrow parameters from userspace by single umove, not by six 36141 separate ones; then assign them to long u_arg[i]. For SH[64], 36142 avoid copying of tcp->u_arg. 36143 (sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled 36144 differently for no apparent reason. 36145 * test/mmap_offset_decode.c: New test program, illustrates FIXME. 36146 36147 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36148 36149 Untangle ifdef forest in sys_mmap64. No code changes. 36150 After careful analysis, it looks like !LINUX and ALPHA 36151 pass all seven parameters in registers; and in all other cases 36152 parameters are on stack (pointed to by tcp->u_arg[0]). 36153 In light of this, reorganize ifdefs, making them simpler, 36154 without changing any logic. 36155 After this, it's apparent we use tcp->u_arg[4,5,6] and possibly 36156 [7] without checking that it's valid to do so. 36157 So far, just add a comment about this. 36158 36159 * mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way. 36160 Add comments about apparent bugs. 36161 36162 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36163 36164 Style and comment fixes, no code changes. 36165 * mem.c: Indent includes to show nesting better. 36166 (addtileflags): Fix style of this function definition; 36167 correct wrong endif comment, add another endif comment. 36168 36169 Use simpler rounding up to next multiple of 2. 36170 * util.c (printllval): simpler rounding up to next multiple of 2. 36171 36172 Cosmetic fixes, no code changes. 36173 * defs.h: Add/reformat comments. 36174 * signal.c: Remove wrong comment. Add warning directive 36175 when we detect that NSIG is undefined. Add comment about 36176 NSIG on ARM. Fix typo in comment. 36177 (signame): Reformat code a bit without changes to logic. 36178 Shorten static buffer. 36179 (sys_rt_sigprocmask): Remove stray empty line. 36180 * syscall.c: Add warning directive when we detect that 36181 NSIG is undefined. Add comment about NSIG on ARM. 36182 36183 2011-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 36184 36185 Fix PTRACE_SETOPTIONS tests. 36186 * strace.c [LINUX] (kill_save_errno): New function. 36187 (test_ptrace_setoptions_followfork): Change return type to void. 36188 Fix and harden error handling. Use kill_save_errno() to avoid errno 36189 clobbering. Treat EIO from ptrace() the same way as EINVAL. 36190 (test_ptrace_setoptions_for_all): Use kill_save_errno() to avoid errno 36191 clobbering. Treat EIO from ptrace() the same way as EINVAL. 36192 (main): Update use of test_ptrace_setoptions_followfork(). 36193 36194 Fix compilation on linux 2.4.x. 36195 * configure.ac: Check for BLKGETSIZE64. 36196 * block.c (block_ioctl): Check for HAVE_BLKGETSIZE64. 36197 36198 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 36199 36200 Remove tcp->parent and TCB_CLONE_THREAD. 36201 tcp->parent is used for only two things: 36202 (1) to send signal on detach via tgkill (need to know tgid). 36203 Solution: use tkill, it needs only tid. 36204 (2) to optimize out ptrace options setting for new tracees. 36205 Not a big deal if we drop this optimization: "set options" op is fast, 36206 doing it just one extra time once per each tracee is hardly measurable. 36207 36208 TCB_CLONE_THREAD is a misnomer. It used only to flag sibling we attached to 36209 in startup_attach. This is used to prevent infinite recursive rescanning 36210 of /proc/PID/task. 36211 Despite the name, there is no guarantee it is set only on non-leader: 36212 if one would run "strace -f -p THREAD_ID" and THREAD_ID is *not* 36213 a thread leader, strace will happily attach to it and all siblings 36214 and will think that THREAD_ID is the leader! Which is a bug, but 36215 since we no longer detach when we think tracee is going to die, 36216 this bug no longer matters, because we do not use the knowledge 36217 about thread group leaders for anything. (We used it to delay 36218 leader's exit). 36219 36220 IOW: after this patch strace has no need to know about threads, parents 36221 and children, and so on. Therefore it does not track that information. 36222 It treats all tracees as independent entities. Overall, 36223 this simplifies code a lot. 36224 36225 * defs.h: Add TCB_ATTACH_DONE flag, remove TCB_CLONE_THREAD flag 36226 and struct tcb::parent field. 36227 * process.c (internal_fork): Don't set tcpchild->parent. 36228 * strace.c (startup_attach): Use TCB_ATTACH_DONE flag instead of 36229 TCB_CLONE_THREAD to avoid attach attempts on already-attached threads. 36230 Unlike TCB_CLONE_THREAD, TCB_ATTACH_DONE bit is used only temporarily, 36231 and only in this function. We clear it on every tcb before we return. 36232 (detach): Use tkill instead of tgkill. 36233 (trace): Set ptrace options on new tracees unconditionally, 36234 not only when tcp->parent == NULL. 36235 36236 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 36237 36238 Remove TCB_SUSPENDED constant and related code. 36239 Since we no longer suspend waitpid'ing tracees, we have only one case when 36240 we suspend tracee: when we pick up a new tracee created by clone/fork/vfork. 36241 36242 Background: on some other OSes, attach to child is done this way: 36243 get fork's result (pid), loop ptrace(PTRACE_ATTACH) until you hook up 36244 new process/thread. This is ugly and not safe, but what matters for us 36245 is that it doesn't require suspending. Suspending is required 36246 on Linux only, because on Linux attach to child is done differently. 36247 36248 On Linux, we use two methods of catching new tracee: 36249 adding CLONE_THREAD bit to syscall (if needed, we change 36250 [v]fork into clone before that), or using ptrace options. 36251 In both cases, it may be so that new tracee appears before one which 36252 created it returns from syscall. In this case, current code 36253 suspends new tracee until its creator returns. Only then 36254 strace can determine who is its parent (it needs child's pid for this, 36255 which is visible in parent's [v]fork/clone result). 36256 This is inherently racy. For example, what if SIGKILL kills 36257 creator after it succeeded creating child, but before it returns? 36258 Looks like we will have child suspended forever. 36259 36260 But after previous commit, we DO NOT NEED parent<->child link for anything. 36261 Therefore we do not need suspending too. Bingo! 36262 36263 This patch removes suspending code. Now new tracees will be continued 36264 right away. Next patch will remove tcp->parent member. 36265 36266 * defs.h: Remove TCB_SUSPENDED constant 36267 * process.c (handle_new_child): Delete this function. 36268 (internal_fork): Do not call handle_new_child on syscall exit. 36269 * strace.c (handle_ptrace_event): Delete this function. 36270 (trace): Do not suspend new child; remove all handling 36271 of now impossible TCB_SUSPENDED condition. 36272 36273 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 36274 36275 Do not detach when we think tracee is going to die. 36276 Current code plays some ungodly tricks, trying to not detach 36277 thread group leader until all threads exit. 36278 36279 Also, it detaches from a tracee when signal delivery is detected 36280 which will cause tracee to exit. 36281 This operation is racy (not to mention the determination 36282 whether signal is set to SIG_DFL is a horrible hack): 36283 after we determined that this signal is indeed fatal 36284 but before we detach and let process die, 36285 *other thread* may set a handler to this signal, and 36286 we will leak the process, falsely displaying it as killed! 36287 36288 I need to look in the past to figure out why we even do it. 36289 First guess is that it's a workaround for old kernel bugs: 36290 kernel used to deliver exit notifications to the tracer, 36291 not to real parent. These workarounds are ancient 36292 (internal_exit is from 1995). 36293 36294 The patch deletes the hacks. We no longer need tcp->nclone_threads, 36295 TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather 36296 ugly functions. 36297 36298 I also added a new message: "+++ exited with EXITCODE +++" 36299 which shows exact moment strace got exit notification. 36300 It is analogous to existing "+++ killed by SIG +++" message. 36301 36302 * defs.h: Delete struct tcb::nclone_threads field, 36303 TCB_EXITING and TCB_GROUP_EXITING constants, 36304 declarations of sigishandled() and internal_exit(). 36305 * process.c (internal_exit): Delete this function. 36306 (handle_new_child): Don't ++tcp->nclone_threads. 36307 * signal.c (parse_sigset_t): Delete this function. 36308 (sigishandled): Delete this function. 36309 * strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++. 36310 (droptcb): Don't delay dropping if tcp->nclone_threads > 0, 36311 don't drop parent if its nclone_threads reached 0: 36312 just drop (only) this tcb unconditionally. 36313 (detach): don't drop parent. 36314 (handle_group_exit): Delete this function. 36315 (handle_ptrace_event): Instead of handle_group_exit, just drop tcb; 36316 do not panic if we see WIFEXITED from an attached pid; 36317 print "+++ exited with EXITCODE +++" for every WIFEXITED pid. 36318 * syscall.c (internal_syscall): Do not treat sys_exit specially - 36319 don't call internal_exit on it. 36320 36321 2011-08-16 Sergei Trofimovich <slyfox (a] gentoo.org> 36322 36323 Declare printrusage32() on Alpha. 36324 * defs.h [ALPHA] (printrusage32): New declaration. 36325 36326 2011-08-15 Denys Vlasenko <dvlasenk (a] redhat.com> 36327 36328 Slight optimization and cleanup in trace() 36329 * strace.c (trace): Do not recalculate "cflag ? &ru : NULL" 36330 again and again. Do not clear errno unnecessarily. 36331 Consistently check wait errors as pid < 0, not pid == -1. 36332 Indent ifdefs for better readability. 36333 Remove comments after endif if ifdef/endif block is really tiny. 36334 36335 Fix compilation on 2.4.20 kernel based system. 36336 * block.c (block_ioctl): add ifdef/endif around BLKGETSIZE64 usage 36337 * strace.c (trace): add ifdef/endif around WIFCONTINUED usage 36338 36339 2011-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 36340 36341 Check for additional PTRACE_* constants. 36342 * configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD, 36343 PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC, 36344 PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT. 36345 * defs.h [LINUX]: Define these PTRACE_* constants when they are not 36346 provided by <sys/ptrace.h>. 36347 36348 Reported-by: Douglas Mencken <dougmencken (a] gmail.com> 36349 Reported-by: Steve Bennett <steveb (a] workware.net.au> 36350 36351 2011-07-19 Denys Vlasenko <dvlasenk (a] redhat.com> 36352 36353 Remove superfluous backslash-continuation in configure.ac. 36354 * configure.ac: remove superfluous backslash continuation 36355 in AC_CHECK_DECLS 36356 36357 2011-06-24 Denys Vlasenko <dvlasenk (a] redhat.com> 36358 36359 Make IOCTL_WSTOP more readable. 36360 * defs.h: Make IOCTL_WSTOP more readable 36361 36362 Trivial cleanups. 36363 * strace.c (trace): Change ifdef LINUX to make a bit more sense, 36364 remove wrong comment at its endif. Slightly optimize 36365 "+++ killed by SIG +++" message for systems without WCOREDUMP macro. 36366 36367 Remove redundant include <stdarg.h> 36368 * strace.c: Remove redundant include <stdarg.h> 36369 36370 Clean up two old comments. 36371 * strace.c (startup_attach): Remove misplaced comment. 36372 (trace) Remove incomplete part of a comment. 36373 36374 Make a few variables static. 36375 * defs.h: Remove tcbtab declaration. 36376 * strace.c: Make run_uid, run_gid, outf, tcbtab, progname 36377 global variables static 36378 36379 Add debug output in initial attachment code. 36380 * strace.c (startup_attach): If -d, report pid and success/failure 36381 of every attach attempt. 36382 36383 Better debug logging of allocations and waitpit results. 36384 * strace.c (alloc_tcb): Print number of allocated tcb's if -d. 36385 (droptcb): Likewise. 36386 (handle_ptrace_event): Remove PTRACE_EVENT_EXEC debug message. 36387 (trace): Improve logging of waitpid: show WIFxxx, exitcode/signal, 36388 ptrace event name, WCOREDUMP - all on one line. 36389 36390 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36391 36392 Optimize arrays of register indexes in syscall_enter. 36393 * syscall.c (syscall_enter) [BFIN]: Make register no array "static const". 36394 [SH]: Make register no array "const", pre-multiply it by 4. 36395 [SH64]: Make register no array "const". 36396 [X86_64]: Make register no array "const", pre-multiply it by 8. 36397 36398 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36399 36400 Deindent syscall_enter by removing unnecessary braces. No code changes. 36401 syscall_enter has many long (>80 columns) lines. 36402 It is aggravated by the fact that it has a lot of {} blocks 36403 which are not necessary (the code is the same without them). 36404 This patch removes {}s and deindents affected lines. 36405 While at it, it indents ifdefs so that nesting is easier to track, 36406 and adds a few spaces in the expressions, such as 36407 "tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...". 36408 There is no actual changes to the code here. 36409 36410 * syscall.c (syscall_enter): Remove unnecessary {} blocks. 36411 36412 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36413 36414 Remove dead "ifndef CLONE_PTRACE" branch. 36415 process.c defines CLONE_PTRACE for Linux, so it can't be undefined. 36416 Therefore ifndef CLONE_PTRACE code is dead (since at least 2004). 36417 This patch removes it. 36418 36419 * process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not 36420 the code inside) and entire ifndef CLONE_PTRACE/endif block. 36421 36422 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36423 36424 Add a comment about setbpt. No code changes. 36425 * defs.h: Add a comment about setbpt(). 36426 36427 Untangle a particularly badly obfuscated bit of code. No logic changes. 36428 * util.c (setbpt): Calculate new arg0 in more readable way. 36429 36430 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36431 36432 Remove TCB_FOLLOWFORK. 36433 TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow 36434 all [v]forks/clones or don't follow any, therefore global variable 36435 followfork is an already existing indicator of what we want to do. 36436 This patch drops all setting/clearing of TCB_FOLLOWFORK bit, 36437 and replaces checks for this bit by checks of followfork value. 36438 In internal_fork, check is moved to in front of if(), since 36439 the check is needed on both "entering" and "exiting" branch. 36440 36441 * defs.h: Remove TCB_FOLLOWFORK define. 36442 * process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK, 36443 test followfork instead of tcp->flags & TCB_FOLLOWFORK. 36444 (handle_new_child): Likewise. 36445 * strace.c (startup_attach): Likewise. 36446 36447 2011-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 36448 36449 * system.c (sys_capget, sys_capset): Fix pointer arithmetics. 36450 36451 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36452 36453 Make initial tcb allocation more readable. No logic changes. 36454 * strace.c (main): Make initial tcb allocation more readable. 36455 36456 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36457 36458 Do not allocate tiny cap_user_header/data structures, place them on stack. 36459 This allows us to avoid having code to malloc them, and code to check 36460 for malloc failure. Resulting code decrease: 36461 text data bss dec hex filename 36462 10175 0 16 10191 27cf system.o.old 36463 9797 0 0 9797 2645 system.o 36464 36465 * system.c (sys_capget): Put cap_user_header_t and cap_user_data_t 36466 on stack, rather than allocating them in heap. These structures 36467 are very small (a few integer fields), stack is a better place 36468 for them. 36469 (sys_capset): Likewise. 36470 36471 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36472 36473 Use [p]error_msg[_and_die] where appropriate. No logic changes. 36474 Resulting size changes: 36475 text data bss dec hex filename 36476 17445 16 8572 26033 65b1 strace.o.old 36477 16850 16 8572 25438 635e strace.o 36478 36479 * strace.c: Replace fprintf[+cleanup]+exit with [p]error_msg_and_die, 36480 fprintf("progname: ...") with [p]error_msg where appropriate. 36481 36482 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36483 36484 Whitespace cleanups. No code changes. 36485 * count.c: Place opening curly brace after if (), 36486 not on the next line. Almost all strace code alredy 36487 uses this style. 36488 * desc.c: Likewise. 36489 * file.c: Likewise. 36490 * net.c: Likewise. 36491 * pathtrace.c: Likewise. 36492 * process.c: Likewise. 36493 * quota.c: Likewise. 36494 * signal.c: Likewise. 36495 * strace.c: Likewise. 36496 * syscall.c: Likewise. 36497 * time.c: Likewise. 36498 36499 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36500 36501 Make strace_fopen abort on error. 36502 Error from strace_fopen in main results in call to exit(1). 36503 Error from strace_fopen in newoutf is propagated to newoutf 36504 callers: startup_attach (where it results in exit(1)) 36505 and alloc_tcb (where error is ignored). In second case, 36506 the behavior doesn't seem to be right: it means with -ff 36507 on open error for new LOGFILE.PID the output will continue 36508 to go into *the same file as the previous process* - which 36509 would be confusing. Moreover, on droptcb outf may be closed 36510 and the output of other, still running process outputting 36511 to the same outf will be lost. I don't think this is sane. 36512 IOW: in all cases, error in strace_fopen should be fatal. 36513 36514 * strace.c (strace_fopen): Abort on error instead of returning NULL. 36515 (newoutf): Change return type to void. 36516 (startup_attach): Remove error check on newoutf return value. 36517 (main): Remove error check on strace_fopen return value. 36518 36519 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36520 36521 Make set_cloexec_flag abort on error. 36522 set_cloexec_flag() may fail only if we pass it a bad fd, 36523 such as -1 or non-opened one. If we do, we have a bug 36524 in the caller. It makes no sense to try to continue 36525 running when we detect such a blatant bug in our own code. 36526 36527 * strace (set_cloexec_flag): Abort instead of returning error 36528 indicator. Change function to return void. 36529 (strace_fopen): Remove error check on set_cloexec_flag return value. 36530 (proc_open): Likewise. 36531 (proc_poll_open): Likewise. 36532 36533 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36534 36535 Make strace_popen abort on error. 36536 It makes no sense to postpone abort on strace_popen error 36537 unti it returns. Moreover, out-of-memory error was exiting 36538 without any message. 36539 While at it, use 0 as "none" for popen_pid, as optimization. 36540 36541 * strace: Initialize popen_pid to 0 - this puts it in bss. 36542 (trace): Reset popen_pid to 0 instead of -1. 36543 (strace_popen): Never return NULL as error indicator, 36544 abort with good error message instead. 36545 (main): Remove NULL check of strace_popen result. 36546 36547 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36548 36549 Delete fork_tcb() 36550 Get rid of fork_tcb() function. It used to do what the comment 36551 above it says, but now it doesn't do much: 36552 it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls 36553 expand_tcbtab(). The second operation is not necessary, since 36554 alloc_tcp() will do it itself when needed. 36555 This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK 36556 where it was formerly called. It also makes nprocs, tcbtabsize and 36557 expand_tcbtab() static. (While at it, I nuked redundant 36558 extern char **environ declaration: strace.c had *two* of them...) 36559 36560 * defs.h: Remove declarations of nprocs, tcbtabsize and 36561 expand_tcbtab. 36562 * process.c (fork_tcb): Remove this function. 36563 (internal_fork): Open-code fork_tcb. 36564 (handle_new_child): Likewise. 36565 * strace.c: Remove redundant "extern char **environ". Declare 36566 nprocs and tcbtabsize static. 36567 (expand_tcbtab): Make it static. 36568 36569 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 36570 36571 Simplify expand_tcbtab and alloc_tcb. 36572 Get rid of a few intermediate variables, simplifies a few expressions, 36573 and uses error_msg_and_die instead of more verbose 36574 fprintf+cleanup+exit sequence. 36575 In alloc_tcp, I use memset to clear entire new tcp. 36576 This not only saves a few bytes of code, but lowers the chances 36577 of future bugs where some data "leaks out" into new tcb's 36578 from old ones because we forgot to re-initialize it. 36579 36580 * strace.c (expand_tcbtab): Simplify this function. No logic changes. 36581 (alloc_tcb): Likewise. 36582 36583 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 36584 36585 Trivial fixes. 36586 * process.c (internal_fork): Remove conditionals which make no difference 36587 (we return 0 on both branches of these ifs). 36588 * util.c: Fix indentation of an ifdef. 36589 36590 2011-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 36591 36592 Fix build when libaio-devel is not available. 36593 * desc.c: Do not compile code that uses struct iocb unless 36594 HAVE_LIBAIO_H is set. 36595 36596 Reported-by: Denys Vlasenko <dvlasenk (a] redhat.com> 36597 36598 2011-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 36599 36600 tests: finish ptrace_setoptions_* merge. 36601 * tests/Makefile.am (TESTS): Merge ptrace_setoptions_*. 36602 * tests/ptrace_setoptions: Check for Linux kernel > 2.6. 36603 36604 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 36605 36606 Remove write-only nchildren member from struct tcb. 36607 * defs.h: Remove nchildren member from struct tcb. 36608 * process.c (handle_new_child): Remove inc/decrements of tcp->nchildren. 36609 (internal_fork): Likewise. 36610 * strace.c (startup_attach): Likewise. 36611 (droptcb): Likewise. 36612 (alloc_tcb): Remove initialization of tcp->nchildren. 36613 36614 Fix tests/ptrace_setoptions_* to match last fix in ptrace options code. 36615 36616 Remove write-only nzombies member from struct tcb. 36617 * defs.h: Remove nzombies member from struct tcb. 36618 * strace.c (droptcb): Remove "tcp->parent->nzombies++". 36619 (alloc_tcb): Remove "tcp->nzombies = 0". 36620 36621 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 36622 36623 Fix regression introduced by "Properly handle real SIGTRAPs" change. 36624 Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54 36625 introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set. 36626 The check (tcp->parent == NULL) in old code was meant to check 36627 "if we are not a child created by auto-attach" - in this case, 36628 options need to be set on the child; otherwise they are inherited 36629 and do not need to be set. 36630 I misunderstood the check and if tcp->parent is not NULL, I was 36631 setting only ptrace_setoptions_for_all bits. 36632 This change fixes the problem. Since the fixed logic makes it 36633 unnecessary to keep two sets of options in separate variables, 36634 I merge them back into one variable, ptrace_setoptions. 36635 36636 * defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all 36637 into one variable, ptrace_setoptions. 36638 * strace.c: Likewise. 36639 (test_ptrace_setoptions_followfork): Use ptrace_setoptions variable. 36640 (test_ptrace_setoptions_for_all): Likewise. 36641 (main): Likewise. 36642 * process.c (internal_fork): Likewise. 36643 (internal_exec): Likewise. 36644 * strace.c (trace): Fix the bug where different options were set 36645 depending on "tcp->parent == NULL" condition. Add a comment 36646 which makes it more clear why this condition is checked. 36647 36648 2011-06-18 Denys Vlasenko <dvlasenk (a] redhat.com> 36649 36650 Do not suspend waitpid. 36651 strace used to suspend waitpid until there is a child 36652 for waitpid'ing process to collect status from. 36653 Apparently, it was done because in some very old kernels 36654 (circa 2002 or even earlier) there were ptrace bugs which 36655 were making waitpid in real parent to not see children. 36656 This kernel bug is fixed long ago. This change removes the workaround. 36657 test/wait_must_be_interruptible.c is a test program which 36658 illustrates why without this change strace changes 36659 programs's behavior. 36660 36661 * defs.h: Delete waitpid and nclone_waiting members from from struct tcb. 36662 Remove declaration of internal_wait(). 36663 * process.c (internal_wait): Remove this function. 36664 * strace.c (alloc_tcb): Do not set tcp->nclone_waiting. 36665 (resume): Remove this function. 36666 (resume_from_tcp): Remove this function. 36667 (detach): Do not call resume_from_tcp(). 36668 (handle_group_exit): Do not call resume_from_tcp(). 36669 * syscall.c (internal_syscall): Do not call internal_wait(). 36670 36671 2011-06-13 Andi Kleen <ak (a] linux.intel.com> 36672 36673 Enhance io_submit() decoding. 36674 strace didn't decode important fields in the iocb passed to io_submit. 36675 This patch changes the code to dump them all. Also it prefixes the fields 36676 with names to make it easier to read. 36677 36678 * desc.c (iocb_cmd_lookup, print_common_flags): New functions. 36679 (sys_io_submit): New iocb decoder. 36680 36681 2011-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 36682 36683 Add argument to tprint_iov() specifying whether to decode each iovec. 36684 * defs.h (tprint_iov): Add decode_iov argument. 36685 * io.c (tprint_iov): Implement new decode_iov argument. 36686 (sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update 36687 tprint_iov calls. 36688 * net.c (do_msghdr): Likewise. 36689 36690 Introduce ARRAY_SIZE() macro. 36691 * defs.h (ARRAY_SIZE): New macro. 36692 * ioctl.c: Use it. 36693 * pathtrace.c (pathmatch, storepath): Likewise. 36694 * process.c (printpriv): Likewise. 36695 * signal.c: Likewise. 36696 * syscall.c: Likewise. 36697 36698 2011-06-13 Andi Kleen <ak (a] linux.intel.com> 36699 36700 Fix decoding of timer id returned by timer_create. 36701 * time.c (sys_timer_create): The kernel returns a integer, not a 36702 pointer for the timer id in the memory pointed to by timer_id. 36703 36704 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 36705 36706 Add test for PTRACE_O_TRACESYSGOOD. 36707 * tests/ptrace_setoptions_for_all: New file. 36708 * tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all. 36709 36710 tests: update test for linux kernel version. 36711 * tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6. 36712 36713 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 36714 36715 Update ptrace_setoptions test. 36716 The test have to be adjusted after commit v4.6-5-g3454e4b. 36717 36718 * ptrace_setoptions: Update grep pattern, rename to 36719 ptrace_setoptions_followfork. 36720 * tests/Makefile.am (TESTS): Rename ptrace_setoptions to 36721 ptrace_setoptions_followfork. 36722 36723 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 36724 36725 * strace.c (verror_msg): Rewrite without use of heap memory allocation. 36726 36727 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 36728 36729 Fix MIPS syscall entries. 36730 * linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337, 36731 and 4338 syscall numbers. 36732 36733 Reported-by: Denys Vlasenko <dvlasenk (a] redhat.com> 36734 36735 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 36736 36737 Don't display bogus parameter for sigreturn syscall. 36738 * linux/*/syscallent.h: For those arches which use sys_sigreturn, 36739 not printargs, to show [rt_]sigreturn syscall, change number of arguments 36740 from 1 to 0: sys_sigreturn function doesn't use syscall parameters. 36741 (I guess kernel doesn't actually _have_ any parameters for this syscall, 36742 at least on these architectures). Do the same change for I386 and x86-64 36743 even though they use printargs: I looked at kernel code and syscall 36744 definitely doesn't have any parameters on these arches. 36745 (I hesitate to change 1 to 0 params for arches I don't know - 36746 it is remotely possible some of them do have a parameter for this syscall). 36747 36748 Optimize sigreturn handling. 36749 * signal.c (sys_sigreturn): move stack pointer variables, 36750 and for SPARC and MIPS, stack pointer and sigmask reading code 36751 into "if (entering) ..." block, because it is only needed 36752 in this branch; load tcp->u_arg[1] into sigmask for display 36753 _after_ we know for sure u_arg[1] does contain valid sigmask 36754 (IOW: perform operation only when we know we will need the result) 36755 36756 Do not call umoven to fetch parameters if we have zero params. 36757 * syscall.c [I386] (syscall_enter): Do not call umoven 36758 to fetch zero bytes. This is just an optimization. 36759 36760 "Modernize" four old-style function parameter declarations. 36761 * signal.c (signame, long_to_sigset, printsigmask, printsignal): 36762 Convert old-style C function definitions to a "modern" form. 36763 This does not change any actual code. 36764 36765 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 36766 36767 Fix sigreturn decoding on MIPS. 36768 The "return 0" line was accidentally deleted circa 2007, 36769 which made sigreturn on MIPS always display "= 0" return 36770 instead of more informative " = ? (mask now [MASK])". 36771 36772 * strace.c (sys_sigreturn): Add wrongly deleted "return 0" line 36773 36774 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 36775 36776 Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed 36777 We already do it in the normal case, but in rare code path where 36778 tracee is gone (SIGKILLed?) sometimes we were printing this: 36779 "SYSCALL(ARGS <unavailable>)= ? <unavailable>" - note jammed together ")=". 36780 test/sigkill_rain.c can be used to verify the fix. 36781 36782 * strace.c (printleader): add a space after ")" in " <unavailable>)" 36783 36784 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 36785 36786 Add fflush after printf in test/sigkill_rain.c. 36787 36788 Update test/* directory, it seem to be a bit bit-rotted. 36789 Added README; modified sigkill_rain.c to be more understandable, 36790 made clone.c compile; added wait_must_be_interruptible.c test; 36791 updated Makefile and .gitignore. 36792 36793 2011-06-07 Denys Vlasenko <dvlasenk (a] redhat.com> 36794 36795 Whitespace cleanups. no code changes. 36796 * bjm.c: Fix tabulation (such as extra spaces before tabs), 36797 convert punctuation where it deviates from prevalent form 36798 elsewhere in strace code, convert sizeof and offsetof where 36799 it deviates from from prevalent form, remove space between 36800 function/macro/array names and (parameters) or [index], 36801 add space between "if" and (condition), correct non-standard 36802 or wrong indentaion. 36803 * defs.h: Likewise 36804 * desc.c: Likewise 36805 * file.c: Likewise 36806 * ipc.c: Likewise 36807 * linux/arm/syscallent.h: Likewise 36808 * linux/avr32/syscallent.h: Likewise 36809 * linux/hppa/syscallent.h: Likewise 36810 * linux/i386/syscallent.h: Likewise 36811 * linux/ioctlsort.c: Likewise 36812 * linux/m68k/syscallent.h: Likewise 36813 * linux/microblaze/syscallent.h: Likewise 36814 * linux/powerpc/syscallent.h: Likewise 36815 * linux/s390/syscallent.h: Likewise 36816 * linux/s390x/syscallent.h: Likewise 36817 * linux/sh/syscallent.h: Likewise 36818 * linux/sh64/syscallent.h: Likewise 36819 * linux/tile/syscallent.h: Likewise 36820 * linux/x86_64/syscallent.h: Likewise 36821 * mem.c: Likewise 36822 * net.c: Likewise 36823 * pathtrace.c: Likewise 36824 * process.c: Likewise 36825 * signal.c: Likewise 36826 * sock.c: Likewise 36827 * strace.c: Likewise 36828 * stream.c: Likewise 36829 * sunos4/syscall.h: Likewise 36830 * sunos4/syscallent.h: Likewise 36831 * svr4/syscall.h: Likewise 36832 * svr4/syscallent.h: Likewise 36833 * syscall.c: Likewise 36834 * system.c: Likewise 36835 * test/childthread.c: Likewise 36836 * test/leaderkill.c: Likewise 36837 * test/skodic.c: Likewise 36838 * time.c: Likewise 36839 * util.c: Likewise 36840 36841 2011-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 36842 36843 ARM EABI: fix 64-bit syscall's arguments decoding. 36844 ARM OABI and ARM EABI have different function parameters passing rules. 36845 With EABI, 64-bit function parameters passed in registers are aligned to 36846 an even-numbered register instead of using the next available pair, see 36847 http://lkml.org/lkml/2006/1/12/175 36848 This rule also applies to syscall's arguments. 36849 36850 * linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64, 36851 readahead, preadv, pwritev): Fix number of arguments. 36852 * util.c (printllval): Align 64bit argument to 64bit boundary on 36853 __ARM_EABI__. 36854 36855 Reported-by: Damir Shayhutdinov <damir (a] altlinux.org> 36856 36857 2011-05-30 Damir Shayhutdinov <damir (a] altlinux.ru> 36858 36859 Linux: implement decoding of preadv and pwritev syscalls. 36860 * io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions. 36861 * linux/syscall.h (sys_preadv, sys_pwritev): Declare them. 36862 * linux/*/syscallent.h: Use them. 36863 36864 2011-05-30 Denys Vlasenko <dvlasenk (a] redhat.com> 36865 36866 "Modernize" all old-style function parameter declarations. 36867 * bjm.c: Convert all remaining old-style C function definitions 36868 to a "modern" form. This does not change any actual code. 36869 * io.c: Likewise 36870 * ioctl.c: Likewise 36871 * net.c: Likewise 36872 * proc.c: Likewise 36873 * process.c: Likewise 36874 * signal.c: Likewise 36875 * sock.c: Likewise 36876 * strace.c: Likewise 36877 * stream.c: Likewise 36878 * syscall.c: Likewise 36879 * system.c: Likewise 36880 * time.c: Likewise 36881 * util.c: Likewise 36882 36883 2011-05-27 Denys Vlasenko <dvlasenk (a] redhat.com> 36884 36885 Cleanups on top of "handle SIGTRAP properly" change, based on Dmitry's comments. 36886 * defs.h ([p]error_msg[_and_die]): Declare new functions. 36887 * strace.c (SYSCALLTRAP): Rename to syscall_trap_sig. 36888 ([p]error_msg[_and_die]): Define new functions. 36889 (strace_tracer_pid): New variable, it controls which pid will 36890 do cleanup on exit via [p]error_msg_and_die. 36891 (main): Set strace_tracer_pid to our initial pid. 36892 (startup_attach): Change strace_tracer_pid if we are in -D mode. 36893 (test_ptrace_setoptions_for_all): Minor changes to logic, 36894 such as better diagnostic messages. 36895 36896 2011-05-25 Denys Vlasenko <dvlasenk (a] redhat.com> 36897 36898 Identifier "errno" may be a macro, it's unsafe to use it. 36899 * strace.c (strerror): Rename parameter errno to err_no 36900 36901 2011-05-24 Denys Vlasenko <dvlasenk (a] redhat.com> 36902 36903 Don't perform TCB_WAITEXECVE wait if not needed. 36904 * defs.h (ptrace_setoptions_for_all): Expose this variable. 36905 * strace.c (ptrace_setoptions_for_all): Remove "static". 36906 * process.c (internal_exec): Don't set TCB_WAITEXECVE bit 36907 if we know that post-execve SIGTRAP is not going to happen. 36908 36909 2011-05-23 Denys Vlasenko <dvlasenk (a] redhat.com> 36910 36911 Properly handle real SIGTRAPs. 36912 * defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork. 36913 * process.c (internal_fork): Ditto. 36914 * strace.c (ptrace_setoptions_for_all): New variable. 36915 (SYSCALLTRAP): New variable. 36916 (error_msg_and_die): New function. 36917 (test_ptrace_setoptions_for_all): New function. 36918 (main): Call test_ptrace_setoptions_for_all() at init. 36919 (handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it). 36920 (trace): Check events and set ptrace options without -f too. 36921 Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP. 36922 36923 2011-04-24 Mike Frysinger <vapier (a] gentoo.org> 36924 36925 Blackfin: update syscall list. 36926 36927 * linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at, 36928 clock_adjtime, and syncfs syscalls. 36929 36930 2011-04-24 Mike Frysinger <vapier (a] gentoo.org> 36931 36932 linux: add new EHWPOISON errno. 36933 36934 * linux/errnoent.h: Change ERRNO_133 to EHWPOISON. 36935 36936 2011-04-08 Grant Edwards <grant.b.edwards (a] gmail.com> 36937 36938 Add ability to print file descriptor paths and filter by those paths. 36939 * pathtrace.c: New file, implements matching syscall arguments to 36940 user-specified file paths. 36941 * Makefile.am (strace_SOURCES): Add pathtrace.c. 36942 * defs.h (TCB_FILTERED, filtered): New defines. 36943 (getfdpath, pathtrace_select, pathtrace_match, show_fd_path, 36944 tracing_paths): New declarations. 36945 * strace.c (show_fd_path, tracing_paths): New global variables. 36946 (usage, main): Implement handling of -y and -P options. 36947 * strace.1: Add descriptions of -y and -P options. 36948 * syscall.c (trace_syscall_entering): Add path matching logic to the 36949 print/noprint decision and set the TCB_FILTERED bit appropriately. 36950 (trace_syscall_exiting): Use filtered() macro that checks the 36951 TCB_FILTERED bit to determine print/noprint status. 36952 * util.c (printfd): Use getfdpath(). 36953 36954 2011-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 36955 36956 Fix BLKTRACESTOP definition. 36957 * block.c: Fix typo in the check for BLKTRACESTOP. 36958 Reported by Gabor Z. Papp. 36959 36960 2011-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 36961 36962 Ensure that PTRACE_GETSIGINFO et al are always defined on Linux. 36963 * configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants. 36964 * defs.h [LINUX]: Define those PTRACE_* constants that are not provided 36965 by <sys/ptrace.h>. 36966 36967 * CREDITS.in: Fix typo. 36968 36969 2011-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 36970 36971 Update PTRACE_* constants. 36972 * process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET. 36973 36974 Prepare for 4.6 release. 36975 * NEWS: Update for 4.6 release. 36976 * configure.ac: Version 4.6. 36977 * debian/changelog: 4.6-1. 36978 * strace.spec: 4.6-1. 36979 36980 2011-03-14 Mike Frysinger <vapier (a] gentoo.org> 36981 36982 linux/ioctlent: unify them all. 36983 This unifies all the ioctlent.h's in the linux subdir while still 36984 allowing each arch to maintain its own minor list. 36985 36986 The basic method is: 36987 - each arch has linux/<arch>/ioctlent.h.in which defines only the 36988 arch-specific ioctls; 36989 - linux/ioctlent.h.in which defines only the common ioctls; 36990 - at build time, these two headers are combined and sorted to produce 36991 the linux/ioctlent.h file. 36992 36993 This also requires a little tweaking of the include files since the 36994 common ioctlent.h is a built file. 36995 36996 * linux/ioctlent.h: Split into linux/ioctlent.h.in and 36997 linux/i386/ioctlent.h.in, remove asm entries from the former, remove 36998 non-asm entries from the latter. 36999 * linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove 37000 non-asm entries. 37001 * linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove 37002 non-asm entries. 37003 * linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove 37004 non-asm entries. 37005 * linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove 37006 non-asm entries. 37007 * linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove 37008 non-asm entries. 37009 * linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in, 37010 remove non-asm entries. 37011 * linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove 37012 non-asm entries. 37013 * linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove 37014 non-asm entries. 37015 * linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove 37016 non-asm entries. 37017 * linux/arm/ioctlent.h.in: New file. 37018 * linux/avr32/ioctlent.h.in: Likewise. 37019 * linux/i386/ioctlent.h.in: Likewise. 37020 * linux/m68k/ioctlent.h.in: Likewise. 37021 * linux/microblaze/ioctlent.h.in: Likewise. 37022 * linux/tile/ioctlent.h.in: Likewise. 37023 * linux/x86_64/ioctlent.h.in: Likewise. 37024 * linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of 37025 ioctlent.h. 37026 * linux/sh64/ioctlent.h.in: Likewise. 37027 * linux/sparc64/ioctlent.h.in: Likewise. 37028 * linux/arm/ioctlent1.h: Update ioctlent.h include. 37029 * linux/powerpc/ioctlent1.h: Likewise. 37030 * linux/sparc/ioctlent1.h: Likewise. 37031 * linux/sparc64/ioctlent1.h: Likewise. 37032 * linux/x86_64/ioctlent1.h: Likewise. 37033 * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS). 37034 (EXTRA_DIST): Update. 37035 [MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in. 37036 [LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules. 37037 * .gitignore: Add linux/ioctlent.h. 37038 37039 2011-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 37040 37041 Show more details about signals received by traced processess. 37042 * strace.c [!USE_PROCFS] (trace): Differentiate output format depending 37043 on PTRACE_GETSIGINFO success or failure. In the former case, use 37044 printsiginfo() to show more details about received signal. 37045 37046 Get rid of PT_GETSIGINFO. 37047 * strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is 37048 available. Replace PT_GETSIGINFO with PTRACE_GETSIGINFO. Use 37049 PTRACE_GETSIGINFO for all signals. 37050 37051 Enhance decoding of kernel-generated signals. 37052 * signal.c (printsiginfo) [LINUX]: Do not print uninteresting 37053 zero-initialized fields. 37054 37055 Fix decoding of user-generated signals. 37056 * signal.c [LINUX] (SI_FROMUSER): Define. 37057 [LINUX || SVR4] (printsiginfo) [SI_FROMUSER]: Enhance decoding. 37058 37059 Recognize SI_KERNEL and SI_ASYNCNL. 37060 * signal.c [LINUX] (SI_KERNEL, SI_ASYNCNL): Define. 37061 [LINUX || SVR4] (siginfo_codes): Add entries for SI_KERNEL and 37062 SI_ASYNCNL, reorder entries. 37063 37064 2011-03-05 Sebastian Pipping <sebastian (a] pipping.org> 37065 37066 Take all git branches into account for generation of CREDITS file. 37067 * Makefile.am: Make CREDITS target depend on all git branches. 37068 37069 2011-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 37070 37071 Fix decoding of file descriptors. 37072 * defs.h (printfd): New function prototype. 37073 * util.c (printfd): New function. 37074 * file.c (print_dirfd): Update prototype to use printfd(). 37075 (sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat, 37076 sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat, 37077 sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd(). 37078 (sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64, 37079 sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64, 37080 sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync, 37081 sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr, 37082 sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64, 37083 sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch, 37084 sys_fallocate): Use printfd() for decoding of file descriptors. 37085 * desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2, 37086 decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for 37087 decoding of file descriptors. 37088 * io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread, 37089 sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64, 37090 sys_ioctl): Likewise. 37091 * mem.c (print_mmap, sys_mmap64): Likewise. 37092 * signal.c (do_signalfd): Likewise. 37093 * stream.c (decode_poll): Likewise. 37094 * time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise. 37095 Based on patch from Grant Edwards <grant.b.edwards (a] gmail.com>. 37096 37097 2011-03-03 Sebastian Pipping <sebastian (a] pipping.org> 37098 37099 Print shutdown(2) modes as SHUT_* constants. 37100 * net.c (shutdown_modes): New xlat structure. 37101 (sys_shutdown): Use shutdown_modes to decode 2nd syscall argument. 37102 37103 Fix decoding of inotify_init1() flags. 37104 * file.c (inotify_init_flags): New xlat structure. 37105 (sys_inotify_init1): Use it instead of open_mode_flags. 37106 37107 2011-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 37108 37109 Fix struct xlat initialization bugs. 37110 * file.c (inotify_modes): Terminate with NULL entry. 37111 * net.c (sock_type_flags): Make this array static. 37112 (socketlayers): Add a comment that this array should remain not 37113 NULL-terminated. 37114 37115 tests: avoid SIGPIPE. 37116 * tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null". 37117 The former may result to strace being killed by SIGPIPE, which in 37118 certain configuratons may lead to generation of a core file. 37119 Suggested by Mike Frysinger. 37120 37121 2011-03-01 Mike Frysinger <vapier (a] gentoo.org> 37122 37123 tests: do not make missing /usr/bin/time a failure. 37124 * tests/init.sh (framework_skip_): New function. 37125 (check_prog): Use it instead of framework_failure_. 37126 37127 2011-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 37128 37129 Generate an xz tar archive of the distribution. 37130 * configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with dist-xz. 37131 * Makefile.am: Update srpm target. 37132 * make-dist: Update for dist-xz. 37133 * strace.spec: Update Source tag. 37134 * debian/watch: Update regexp. 37135 * .gitignore: Add strace-*.tar.xz. 37136 37137 Use "make check" in debian/rules and strace.spec. 37138 * debian/control: Update Build-Depends. 37139 * debian/rules: Run "make check". 37140 * strace.spec: Update BuildRequires. Run "make check" in %check section. 37141 37142 Implement two basic "strace -f" tests. 37143 * Makefile.am (SUBDIRS): Add tests. 37144 * configure.ac (AC_CONFIG_FILES): Add tests/Makefile. 37145 * tests/.gitignore: New file. 37146 * tests/Makefile.am: Likewise. 37147 * tests/init.sh: Likewise. 37148 * tests/ptrace_setoptions: Likewise. 37149 * tests/strace-f: Likewise. 37150 37151 2011-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 37152 37153 ppc, s390, sparc: regenerate ioctlent.h files. 37154 * linux/powerpc/ioctlent.h: Regenerated using Fedora 15 kernel headers. 37155 * linux/s390/ioctlent.h: Likewise. 37156 * linux/sparc/ioctlent.h: Likewise. 37157 37158 Remove redundant ioctlent.h files. 37159 * linux/s390x/ioctlent.h: Replace old contents with include of 37160 s390/ioctlent.h file. 37161 * linux/sparc64/ioctlent.h: Replace old contents with include of 37162 sparc/ioctlent.h file. 37163 37164 2011-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 37165 37166 ioctlsort: sync with ioctl_lookup() 37167 * linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with 37168 ioctl_lookup() which looks at these bits only. 37169 37170 Remove obsolete .cvsignore files. 37171 * test/.cvsignore: Rename to test/.gitignore. 37172 * */.cvsignore, */*/.cvsignore: Removed. 37173 37174 Ignore generated intermediate header files. 37175 * .gitignore: Add ioctls.h and ioctldefs.h. 37176 37177 2011-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 37178 37179 Generate much of the CREDITS file from git log. 37180 * CREDITS.in: New file, derived from CREDITS, without names of 37181 those who are listed as git log 'Author:'s. 37182 * CREDITS: Remove file. 37183 * Makefile.am [MAINTAINER_MODE] (CREDITS): New rule. 37184 * .gitignore: Add CREDITS. 37185 * .mailmap: New file, required to map git author names and email 37186 addresses to canonical/preferred form. 37187 37188 2011-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 37189 37190 sparc: fix compilation warning. 37191 * file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size 37192 to unsigned long. 37193 37194 Update the list of files that must be distributed. 37195 * Makefile.am (EXTRA_DIST): Add debian/source/format, debian/watch, 37196 linux/ia64/signalent.h, linux/powerpc/ioctlent1.h, 37197 linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, 37198 linux/powerpc/signalent1.h. 37199 37200 Fix compilation warning reported by gcc -Wunused-but-set-variable. 37201 * process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable. 37202 37203 2011-02-22 Mike Frysinger <vapier (a] gentoo.org> 37204 37205 ioctlsort: zero pad ioctl codes to 4 places. 37206 Zero padding the ioctl number will allow simple sorting via shell scripts. 37207 37208 * linux/ioctlsort.c (main): Output ioctl codes zero padded. 37209 * linux/ioctlent.h: Regenerated. 37210 37211 2011-02-22 Mike Frysinger <vapier (a] gentoo.org> 37212 37213 Update mount flags to latest linux. 37214 * system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION, 37215 MS_STRICTATIME, MS_BORN): Define. 37216 (mount_flags): Add MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION, 37217 MS_STRICTATIME, MS_BORN. 37218 37219 2011-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 37220 37221 Sync debian/changelog and strace.spec with packages. 37222 * debian/changelog: Sync with 4.5.20-2. 37223 * strace.spec: Likewise. 37224 37225 2011-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 37226 37227 Add TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries. 37228 * linux/*/syscallent.h: Add TD flag to fanotify_init. Add TD|TF flags 37229 to fanotify_mark. 37230 37231 Fix flags of fallocate sysentries. 37232 * linux/*/syscallent.h: Fix sys_fallocate flags. 37233 37234 Add TRACE_DESC flag to epoll_create* sysentries. 37235 * linux/*/syscallent.h: Add TD flag to sys_epoll_create and 37236 sys_epoll_create1. 37237 37238 Add TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries 37239 * linux/*/syscallent.h: Add TD flag to sys_fgetxattr, sys_flistxattr, 37240 and fremovexattr. 37241 37242 Add TRACE_FILE flag to swapoff sysentries. 37243 * linux/*/syscallent.h: Add TF flag to sys_swapoff. 37244 37245 Add TRACE_DESC flag to fadvise64* sysentries. 37246 * linux/*/syscallent.h: Add TD flag to sys_fadvise64 and 37247 sys_fadvise64_64. 37248 37249 Add TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries. 37250 * linux/*/syscallent.h: Add TD flag to sys_mmap and sys_old_mmap. 37251 37252 Do not initialize native_scno on platforms with only one personality. 37253 * linux/bfin/syscallent.h: Remove redundant native_scno initialization. 37254 * linux/m68k/syscallent.h: Likewise. 37255 * linux/microblaze/syscallent.h: Likewise. 37256 37257 Add LOOP_* ioctls defined in linux/loop.h. 37258 * linux/ioctlent.sh: Add LOOP_* ioctls (0x4C..) defined in linux/loop.h 37259 header file. 37260 * linux/ioctlent.h: Regenerated. 37261 Reported by Mike Frysinger. 37262 37263 2011-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 37264 37265 Fix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions() 37266 * strace.c (handle_ptrace_event): Fix PTRACE_GETEVENTMSG usage. 37267 (test_ptrace_setoptions): Test that PTRACE_GETEVENTMSG works properly. 37268 37269 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 37270 37271 linux/sparc: move to common syscall.h. 37272 Rather than constantly deal with the sparc/syscall.h going stale, merge 37273 the few sparc-specific pieces into the linux/syscall.h header. 37274 37275 * linux/syscall.h: Add sparc-specific pieces from sparc/syscall.h. 37276 * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h and 37277 linux/sparc64/syscall.h. 37278 * linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted. 37279 37280 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 37281 37282 sparc: add new funcs to syscall.h. 37283 Sync missing defs from the common syscall.h here. 37284 37285 * linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and 37286 sys_pwrite64 prototypes. 37287 37288 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 37289 37290 sparc: punt unused syscall.h.2. 37291 I can't find any mention of this header actually being used. 37292 Seems to be a really old copy of the common syscall.h. 37293 37294 * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h.2. 37295 * linux/sparc/syscall.h.2: Deleted. 37296 37297 2011-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 37298 37299 Fix raw exit_group(2) decoding. 37300 * syscall.c (trace_syscall_entering): Check for sys_exit instead of 37301 SYS_exit to handle exit_group(2) as well as _exit(2). 37302 37303 2011-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 37304 37305 Optimize known_scno() 37306 * syscall.c (known_scno): Do not check for native_scno field on 37307 platforms that support only one personality. 37308 37309 * process.c (internal_exit) [IA64]: Remove redundant check. 37310 37311 2011-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 37312 37313 Fix biarch support in IO dumping. 37314 * syscall.c (dumpio): Switch on tcp->sys_func instead of tcp->scno 37315 for more reliable results. 37316 37317 Simplify tprintf() declaration. 37318 * defs.h (tprintf): Simplify declaration. 37319 37320 2011-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 37321 37322 * defs.h (SYSCALL_NEVER_FAILS): Fix typo. 37323 37324 2011-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 37325 37326 Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values. 37327 * defs.h (SYSCALL_NEVER_FAILS): New syscall flag. 37328 * linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id 37329 and setfs[ug]id. 37330 * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id, 37331 gete[ug]id and setfs[ug]id syscalls. 37332 * process.c [LINUX] (sys_getuid, sys_setfsuid): New functions. 37333 * syscall.c (NF): New shorthand macro for use in syscallent.h files. 37334 (get_error): Check SYSCALL_NEVER_FAILS flag. 37335 Reported by <socketpair (a] gmail.com>. 37336 37337 * linux/*/syscallent.h: Fix typo in sys_newfstatat syscall flags. 37338 37339 2011-01-18 Mike Frysinger <vapier (a] gentoo.org> 37340 37341 Blackfin: update ioctl list. 37342 * linux/bfin/ioctlent.h: Sync with latest kernel sources. 37343 37344 2011-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 37345 37346 Fix stat64 decoding on mips. 37347 * linux/mips/syscallent.h: Use sys_stat64() to decode stat64 syscall. 37348 This fixes Debian bug #599028. 37349 37350 Update linux/*/syscallent.h files to match Linux kernel v2.6.37. 37351 * linux/alpha/syscallent.h: Add hooks for fanotify_init, fanotify_mark, 37352 and prlimit64. 37353 * linux/i386/syscallent.h: Likewise. 37354 * linux/ia64/syscallent.h: Likewise. 37355 * linux/m68k/syscallent.h: Likewise. 37356 * linux/microblaze/syscallent.h: Likewise. 37357 * linux/mips/syscallent.h: Likewise. 37358 * linux/powerpc/syscallent.h: Likewise. 37359 * linux/s390/syscallent.h: Likewise. 37360 * linux/s390x/syscallent.h: Likewise. 37361 * linux/sh/syscallent.h: Likewise. 37362 * linux/sh64/syscallent.h: Likewise. 37363 * linux/sparc/syscallent.h: Likewise. 37364 * linux/x86_64/syscallent.h: Likewise. 37365 * linux/arm/syscallent.h: Add hooks for accept4, fanotify_init, 37366 fanotify_mark, and prlimit64. 37367 * linux/hppa/syscallent.h: Add hook for prlimit64. 37368 37369 2011-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 37370 37371 block.c: cleanup. 37372 * block.c: Include <inttypes.h>. 37373 (print_blkpg_req): Always decode struct blkpg_ioctl_arg. 37374 Robustify decoding of strings. 37375 (block_ioctl): Do not decode return values passed by pointers on exit 37376 from failed syscalls. 37377 Use format macros from inttypes.h to print values of type uint64_t. 37378 37379 2011-01-15 Dmitry V. Levin <ldv (a] altlinux.org> 37380 37381 Add block ioctl support. 37382 * block.c: New file. 37383 * Makefile.am (strace_SOURCES): Add it. 37384 * defs.h [LINUX] (block_ioctl): New function. 37385 * ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK* 37386 ioctls. 37387 Patch by Jeff Mahoney <jeffm (a] suse.com> 37388 37389 2011-01-14 Holger Hans Peter Freyther <zecke (a] selfish.org> 37390 37391 Parse SOL_SCTP socket options. 37392 * configure.ac (AC_CHECK_HEADERS): Add netinet/sctp.h. 37393 * net.c [HAVE_NETINET_SCTP_H]: Include <netinet/sctp.h>. 37394 [SOL_SCTP] (socksctpoptions): New xlat structure. 37395 (sys_getsockopt, printsockopt): Parse SOL_SCTP options. 37396 37397 * net.c (socketlayers): Add more SOL_* constants from linux/socket.h. 37398 37399 2011-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 37400 37401 strace.1: fix misleading italics. 37402 * strace.1: Use bold instead of italics for "-e trace=" keywords. 37403 This fixes Debian bug #589323. 37404 37405 Update linux/ioctlent.h. 37406 * linux/ioctlent.h: Regenerate using linux v2.6.37 headers. 37407 37408 Add HDIO_* ioctls defined in linux/hdreg.h. 37409 * linux/ioctlent.sh: Add HDIO_* ioctls (0x03..) defined in 37410 linux/hdreg.h header file. 37411 This fixes Debian bug #450953. 37412 37413 2011-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 37414 37415 Test PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK along with PTRACE_O_TRACEFORK 37416 * strace.c (test_ptrace_setoptions): Add PTRACE_O_TRACECLONE and 37417 PTRACE_O_TRACEVFORK to PTRACE_SETOPTIONS call, to test exactly 37418 the same set of options that is going to be used later in trace(). 37419 37420 2011-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 37421 37422 * net.c (protocols): Add more IPPROTO_* constants defined in netinet/in.h 37423 37424 2011-01-10 Holger Hans Peter Freyther <holger (a] freyther.de> 37425 37426 * net.c (protocols): Add IPPROTO_GRE, IPPROTO_SCTP and IPPROTO_UDPLITE. 37427 37428 2011-01-10 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 37429 37430 sh: Add entry for not-multiplexed accept4. 37431 * linux/sh/syscallent.h: Add specific entry for not-multiplexed accept4 37432 available in kernel mainline since v2.6.37-rc6, see 37433 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21b6e4c7106b2d68a6710506d8706608272fd78b 37434 37435 2010-12-14 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 37436 37437 sh: Add entries for not-multiplexed socket calls. 37438 * linux/sh/syscallent.h: Add specific entries for not-multiplexed 37439 socket calls (available in kernel mainline since v2.6.37-rc1) 37440 37441 sh: Fix compilation warning in do_pipe due to missing prototype. 37442 * defs.h [SH]: Make getrval2 prototype visible to do_pipe 37443 and fix the following compiler warning: 37444 .../net.c: In function 'do_pipe': 37445 .../net.c:1632: warning: implicit declaration of function 'getrval2' 37446 .../net.c:1632: warning: format '%lu' expects type 'long unsigned int', 37447 but argument 3 has type 'int' 37448 37449 2010-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 37450 37451 Fix build on uClibc. 37452 * defs.h [LINUX]: Define PTRACE_GETEVENTMSG macro. 37453 Patch by Douglas Mencken <dougmencken (a] gmail.com>. 37454 37455 2010-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 37456 37457 Fix strace -f -o '|command' hangup. 37458 * strace.c (main): Call test_ptrace_setoptions() before parsing 37459 -o option, otherwise a forked command will cause a hangup inside 37460 test_ptrace_setoptions(). 37461 37462 2010-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 37463 37464 Output diagnostics to stderr. 37465 * syscall.c (get_scno): Output information about changes in 37466 personality mode to stderr. Reported by Pdraig Brady. 37467 37468 Recognize more clone flags. 37469 * process.c (CLONE_*): Define more flags from linux v2.6.25. 37470 (clone_flags): Add entries for them. 37471 Proposed by <zhangyanfei (a] cn.fujitsu.com>. 37472 37473 Decode struct ucred for getsockopt SO_PEERCRED. 37474 * net.c (sys_getsockopt): Decode SO_PEERCRED. 37475 Proposed by Arkadiusz Mikiewicz <arekm (a] maven.pl>. 37476 37477 2010-12-03 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 37478 37479 sh: Add support for tracing sys_cacheflush system call. 37480 * linux/sh/syscallent.h: Update sys_cacheflush entry. 37481 * linux/syscall.h [SH] (sys_cacheflush): New function declaration. 37482 * system.c [SH] (cacheflush_flags): New xlat structure. 37483 [SH] (sys_cacheflush): New function. 37484 37485 Reviewed-by: Angelo Castello <angelo.castello (a] st.com> 37486 37487 2010-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 37488 37489 Cleanup test_ptrace_setoptions() 37490 * strace.c (test_ptrace_setoptions): Cleanup. 37491 (main): Fix test_ptrace_setoptions() error diagnostics message. 37492 Print ptrace_setoptions value in debug mode. 37493 37494 2010-11-30 Wang Chao <wang.chao (a] cn.fujitsu.com> 37495 37496 Handle followfork using ptrace_setoptions if available. 37497 If PTRACE_O_TRACECLONE et al options are supported by kernel, 37498 use them to do followfork rather than the original setbpt 37499 method that changes registers ourselves. 37500 37501 * defs.h [LINUX] (handle_new_child): New function prototype. 37502 * process.c [LINUX] (handle_new_child): New function based on the 37503 code from internal_fork(), with a trivial change: do reparent only 37504 for sys_clone. 37505 [LINUX] (internal_fork): Use handle_new_child(). Do nothing if 37506 ptrace_setoptions is in effect. 37507 * strace.c [LINUX] (handle_ptrace_event): New function. 37508 [LINUX] (trace): If ptrace_setoptions is in effect, then 37509 call the new function to handle PTRACE_EVENT_* status, and 37510 set PTRACE_SETOPTIONS when we see the initial stop of tracee. 37511 37512 2010-11-30 Wang Chao <wang.chao (a] cn.fujitsu.com> 37513 37514 Test how PTRACE_SETOPTIONS support works. 37515 Currently test fork related options only. Fork a child that uses 37516 PTRACE_TRACEME at startup and then does a fork so strace can test 37517 how the PTRACE_SETOPTIONS support works before it handles any real 37518 tracee. Since PTRACE_O_TRACECLONE/*FORK were introduced to kernel 37519 at the same time, this test seems to be enough for these 3 options. 37520 37521 * defs.h [LINUX]: Define PTRACE_O_TRACECLONE et al macros here. 37522 (ptrace_setoptions): New variable declaration. 37523 * strace.c [LINUX] (test_ptrace_setoptions): New function, tests 37524 whether kernel supports PTRACE_O_CLONE/*FORK, the result is stored 37525 in the new variable ptrace_setoptions for later use. 37526 (main): Call test_ptrace_setoptions() if followfork option is set. 37527 37528 2010-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 37529 37530 Enable support for less verbose build rules. 37531 * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules. 37532 37533 2010-09-17 Wang Chao <wang.chao (a] cn.fujitsu.com> 37534 37535 Do not trace children cloned with CLONE_UNTRACED flag. 37536 If clone is called with flag CLONE_UNTRACED, to be consistent with 37537 option PTRACE_O_TRACECLONE, we should not set CLONE_PTRACE flag on 37538 its arguments. 37539 37540 * process.c [LINUX] (internal_fork): Check the syscall and arguments. 37541 37542 2010-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 37543 37544 Update the list of CLOCK_* constants to match Linux kernel v2.6.32+ 37545 * time.c (struct xlat clocknames[]): Add more RT clock IDs. 37546 Reported by Tommi Rantala. 37547 37548 2010-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 37549 37550 Update linux/hppa/syscallent.h to match Linux kernel v2.6.35. 37551 * linux/hppa/syscallent.h: Add hooks for recvmmsg and accept4. 37552 37553 2010-09-15 Dmitry V. Levin <ldv (a] altlinux.org> 37554 37555 Pass less information to qualify_one and qual_* 37556 * syscall.c (qualify_one, qual_syscall, qual_signal, qual_fault, 37557 qual_desc): Take just a bitflag argument instead of pointer to the whole 37558 qual_options structure. 37559 (struct qual_options): Update prototype of "qualify" field. 37560 (qualify): Update use of qualify_one and qual_options->qualify. 37561 37562 2010-09-15 Wang Chao <wang.chao (a] cn.fujitsu.com> 37563 37564 Fix -e option with only one value in qualifier statement. 37565 Fix regression introduced by commit v4.5.20-19-g30145dd: 37566 if -e option is used with only one value in qualifier statement, 37567 e.g. 'strace -e trace=open ls', syscall information would not be 37568 printed properly. 37569 37570 * syscall.c (qualify): Remove faulty optimization. 37571 37572 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 37573 37574 Fix off_t/rlim_t size checks when cross-compiling. 37575 The current off_t/rlim_t size checks (wrt size of long long) use AC_RUN 37576 which obviously doesn't work when cross-compiling. While we don't hit 37577 any configure errors, the fall back code is pretty dumb (which is to say 37578 there isn't any). Considering the code in question though, we can use 37579 some fun compiler tricks with sizeof and array lengths to turn it into 37580 a pure build test and avoid the RUN issue completely. 37581 37582 * m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG): 37583 Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE. 37584 37585 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 37586 37587 Fix long long little endian detection when cross-compiling. 37588 The long long endian detection code does an AC_TRY_RUN() and since that 37589 doesn't work when cross-compiling, it sets a fallback value. However, 37590 rather than do any sort of default endian detection, the code simply 37591 sets it to "no". This probably breaks most little endian systems out 37592 there when cross-compiling for them. It certainly breaks Blackfin 37593 systems. So use the common endian detection code provided by autoconf 37594 and key off of that when cross-compiling. 37595 37596 * configure.ac: Call AC_C_BIGENDIAN. 37597 * m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling 37598 logic based on ac_cv_c_bigendian. 37599 37600 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 37601 37602 Blackfin: decode new syscalls. 37603 * linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls. 37604 * linux/syscall.h: Add sys_cacheflush() decl. 37605 * system.c: Decode Blackfin's cacheflush syscall. 37606 37607 * linux/ioctlent.sh: Search a few non-exported paths. 37608 37609 2010-09-15 Roland McGrath <roland (a] redhat.com> 37610 37611 Clean up pid2tcb usage. 37612 * strace.c (pid2tcb): Always match pid. Fail for argument <= 0. 37613 [USE_PROCFS] (first_used_tcb): New function. 37614 [USE_PROCFS] (trace): Use that instead of pid2tcb(0). 37615 37616 2010-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 37617 37618 Turn on more compiler warnings. 37619 * configure.ac: Enable gcc -Wwrite-strings. 37620 37621 Import warnings.m4 from gnulib. 37622 * m4/warnings.m4: Replace with warnings.m4 from gnulib. 37623 * configure.ac: Use gl_WARN_ADD from new warnings.m4. 37624 * Makefile.am (AM_CFLAGS): Update for new warnings.m4. 37625 37626 Split acinclude.m4. 37627 * Makefile.am (ACLOCAL_AMFLAGS): Add "-I m4". 37628 * acinclude.m4: Remove. 37629 * m4/includedir.m4: New file, with definition of AC_INCLUDEDIR from 37630 acinclude.m4. 37631 * m4/long_long.m4: New file, with definitions of AC_OFF_T_IS_LONG_LONG, 37632 AC_RLIM_T_IS_LONG_LONG and AC_LITTLE_ENDIAN_LONG_LONG from acinclude.m4. 37633 * m4/procfs.m4: New file, with definitions of AC_MP_PROCFS, 37634 AC_POLLABLE_PROCFS and AC_STRUCT_PR_SYSCALL from acinclude.m4. 37635 * m4/stat.m4: New file, with definition of AC_STAT64 from acinclude.m4. 37636 * m4/statfs.m4: New file, with definition of AC_STATFS64 from 37637 acinclude.m4. 37638 * m4/warnings.m4: New file, with definition of AC_WARNFLAGS from 37639 acinclude.m4. 37640 37641 * process.c (sys_waitid): Remove unused variable. 37642 37643 2010-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 37644 37645 Fix const-correctness issues uncovered by gcc -Wwrite-strings. 37646 * defs.h (struct xlat): Add const qualifier to the field of 37647 type "char *". 37648 (set_sortby, qualify, printnum, printnum_int): Add const qualifier to 37649 arguments of type "char *". 37650 * count.c (set_sortby): Add const qualifier to the argument and 37651 automatic variable of type "char *". 37652 * desc.c (decode_select): Add const qualifier to automatic variables of 37653 type "char *". 37654 * ioctlsort.c (struct ioctlent): Add const qualifier to fields of 37655 type "char *". 37656 (main): Add const qualifier to argv. 37657 * process.c (printargv): Add const qualifier to the argument and 37658 automatic variable of type "char *". 37659 (printargc) Add const qualifier to argument of type "char *". 37660 * signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to 37661 arguments of type "char *". 37662 * strace.c (progname): Add const qualifier. 37663 (detach): Add const qualifier to automatic variable of type "char *". 37664 * stream.c (struct strbuf): Add const qualifier to the field of 37665 type "char *". 37666 * syscall.c (struct qual_options): Add const qualifier to fields of 37667 type "char *". 37668 (qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier 37669 to arguments of type "char *". 37670 (qual_signal): Add const qualifier to the argument of type "char *", 37671 avoid modification of constant argument. 37672 (qualify): Likewise. 37673 * util.c (printflags): Add const qualifier to automatic variable of 37674 type "char *". 37675 (printnum, printnum_int): Add const qualifier to arguments of 37676 type "char *". 37677 37678 2010-09-04 Wang Chao <wang.chao (a] cn.fujitsu.com> 37679 37680 Fix printing clone flags. 37681 When we trace clone() syscall with only exit signal as clone 37682 flags, strace would print an unnecessary OR operator. 37683 37684 * process.c (sys_clone): Fix this. 37685 37686 2010-08-28 Wang Chao <wang.chao (a] cn.fujitsu.com> 37687 37688 Drop nclone_detached and related flags. 37689 Remove nclone_detached since CLONE_DETACHED flag was no-op for a very 37690 long time in kernel. 37691 37692 * defs.h (struct tcb): Remove nclone_detached field. 37693 Remove TCB_CLONE_DETACHED flag. 37694 * process.c: Remove CLONE_DETACHED flag. 37695 (clone_flags): Remove CLONE_DETACHED entry. 37696 (internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED 37697 flag and nclone_detached. 37698 * strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit): 37699 Likewise. 37700 37701 2010-08-09 Neil Campbell <lists (a] thebatcave.org.uk> 37702 37703 Correct get/set_robust_list syscall numbers for powerpc. 37704 * linux/powerpc/syscallent.h: Swap positions of get_ and set_robust_list. 37705 37706 2010-08-09 Wang Chao <wang.chao (a] cn.fujitsu.com> 37707 37708 Handle CLONE_PARENT flag. 37709 * process.c (internal_fork): The parent of new cloned process is the 37710 same of the calling process when CLONE_PARENT is set. 37711 37712 Fix error when judging if process has children. 37713 * process.c (internal_wait): Processes counted in tcp->nclone_threads 37714 are tcp's threads, rather than tcp's children. 37715 37716 2010-08-09 Wang Chao <wang.chao (a] cn.fujitsu.com> 37717 37718 Forbid using mutually exclusive options -D and -p together. 37719 If we use -D and -p option together to trace a multi-thread program, in 37720 addition to the main thread, other threads could not be traced even if we 37721 present -f option. Moreover, when executing 'strace -D -p <non-exist pid>', 37722 strace could not terminate normally. 37723 37724 * strace.c (main): Check it. 37725 37726 2010-08-05 David Daney <ddaney (a] caviumnetworks.com> 37727 37728 Update Linux MIPS syscalls to match 2.6.35-rc6+ 37729 * linux/mips/syscallent.h: Add and update 405 hooks. 37730 37731 2010-08-05 Edgar E. Iglesias <edgar.iglesias (a] gmail.com> 37732 37733 Add support for the MicroBlaze architecture. 37734 * configure.ac: Recognize MicroBlaze. 37735 * linux/microblaze/syscallent.h: New file. 37736 * Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h 37737 * process.c (change_syscall, struct_user_offsets): Add MicroBlaze 37738 support. 37739 * signal.c (sys_sigreturn): Likewise. 37740 * syscall.c (internal_syscall, get_scno, syscall_fixup, get_error, 37741 syscall_enter): Likewise. 37742 37743 2010-08-05 Frederik Schler <fs (a] debian.org> 37744 37745 linux/sparc: add missing syscall declarations. 37746 * linux/sparc/syscall.h: Sync with linux/syscall.h 37747 37748 2010-07-17 Andreas Schwab <schwab (a] linux-m68k.org> 37749 37750 Handle biarch get/setrlimit. 37751 * resource.c (print_rlimit32) [POWERPC64 || X86_64]: Define. 37752 (sys_getrlimit, sys_setrlimit) [POWERPC64 || X86_64]: Use it. 37753 37754 2010-07-13 Andreas Schwab <schwab (a] linux-m68k.org> 37755 37756 Add biarch support for powerpc64. 37757 * acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of 37758 long. 37759 * configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if 37760 $host_cpu = powerpc64. 37761 * defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE) 37762 (PERSONALITY1_WORDSIZE) [POWERPC64]: Define. 37763 * file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]: 37764 Define. 37765 (printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in 37766 32-bit personality. 37767 (sys_newfstatat) [POWERPC64]: Handle personalities. 37768 * signal.c (sys_sigreturn) [POWERPC64]: Likewise. 37769 * util.c (printllval) [POWERPC64]: Likewise. 37770 (printcall) [POWERPC64]: Use wider format for IP prefix. 37771 * syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode. 37772 * linux/powerpc/errnoent1.h: New file. 37773 * linux/powerpc/ioctlent1.h: New file. 37774 * linux/powerpc/signalent1.h: New file. 37775 * linux/powerpc/syscallent1.h: New file. 37776 37777 2010-07-09 Andreas Schwab <schwab (a] redhat.com> 37778 37779 Balance braces. 37780 * strace.c (proc_open): Avoid unbalanced braces. 37781 (trace): Likewise. 37782 37783 2010-07-06 Andreas Schwab <schwab (a] linux-m68k.org> 37784 37785 Remove extern declaration at file scope. 37786 * defs.h (force_result): Declare. 37787 * process.c (internal_wait): Don't declare force_result. 37788 37789 2010-06-24 Andreas Schwab <schwab (a] redhat.com> 37790 37791 Document -C/-D. 37792 * strace.c (usage): Document -C. 37793 * strace.1: Document -D. 37794 37795 2010-06-13 Roland McGrath <roland (a] redhat.com> 37796 37797 Fix sourceforge download URL. 37798 37799 2010-06-05 Andreas Schwab <schwab (a] linux-m68k.org> 37800 37801 M68K: Fix fetching syscall arguments. 37802 * syscall.c (syscall_enter) [M68K]: Properly handle more than five 37803 syscall arguments. 37804 37805 2010-05-28 Andreas Schwab <schwab (a] linux-m68k.org> 37806 37807 Decode TLS syscalls on m68k. 37808 * linux/m68k/syscallent.h: Add entries for get_thread_area, 37809 set_thread_area, atomic_comxchg_32, atomic_barrier. 37810 * linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]: 37811 Don't redefine. 37812 * mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New. 37813 37814 Fix warning when compiling for m68k. 37815 * syscall.c (d0): Define as long. 37816 37817 2010-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 37818 37819 Prepare for 4.5.20 release. 37820 * NEWS: Update for 4.5.20 release. 37821 * configure.ac: Version 4.5.20. 37822 * debian/changelog: 4.5.20-1. 37823 * strace.spec: 4.5.20-1. 37824 37825 2010-04-13 Frederik Schler <fs (a] debian.org> 37826 37827 Update debian/* files for the upcoming release. 37828 * debian/control: update standards-version to 3.8.4. 37829 * debian/rules: allow parallel building. 37830 * debian/rules: comment out verbose build, only needed for debugging. 37831 * debian/rules: clean up clean: target, dh_clean does most of the work 37832 already. 37833 * debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy 37834 up for us. 37835 37836 2010-04-13 Heiko Carstens <heiko.carstens (a] de.ibm.com> 37837 37838 Fix s390 system call table list. 37839 * linux/s390/syscallent.h: Add the missing entries for preadv and 37840 pwritev to the system call table list. 37841 * linux/s390x/syscallent.h: Likewise. 37842 37843 2010-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 37844 37845 Update linux/ioctlent.h. 37846 * linux/ioctlent.sh: Search in asm-generic directory as well. 37847 * linux/ioctlent.h: Regenerated. 37848 37849 Update linux/*/syscallent.h files to match Linux kernel v2.6.33. 37850 * linux/alpha/syscallent.h: Add 47 hooks. 37851 * linux/arm/syscallent.h: Update hooks for pselect6, ppoll, 37852 epoll_pwait. Add 11 hooks. 37853 * linux/bfin/syscallent.h: Update hooks for prctl, fallocate, 37854 signalfd4, eventfd2, epoll_create1, dup3, pipe2, perf_event_open. 37855 Hook up recvmmsg. 37856 * linux/hppa/syscallent.h: Update hooks for signalfd4, eventfd2, 37857 epoll_create1, dup3, pipe2, perf_event_open. 37858 * linux/i386/syscallent.h: Fix syscall name for the kexec_load hook. 37859 Add 5 hooks. 37860 * linux/ia64/syscallent.h: Fix syscall name for the kexec_load hook. 37861 Add 4 hooks. 37862 * linux/m68k/syscallent.h: Add 50 hooks. 37863 * linux/powerpc/syscallent.h: Fix hook for timerfd_create. Fix 37864 6 syscall names to match the kernel. Use sys_semop to parse semop. 37865 Add 14 hooks. 37866 * linux/s390/syscallent.h: Fix syscall name for the kexec_load hook. 37867 Add 14 hooks. 37868 * linux/s390x/syscallent.h: Likewise. 37869 * linux/sh/syscallent.h: Add 13 hooks. 37870 * linux/sh64/syscallent.h: Add 15 hooks. 37871 * linux/sparc/syscallent.h: Add 22 hooks. 37872 * linux/x86_64/syscallent.h: Add 5 hooks. 37873 37874 Enhance recvmmsg parser. 37875 * net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the 37876 syscall. Decode timespec structure both on entrance and on exit. 37877 37878 2010-04-07 Andreas Schwab <schwab (a] linux-m68k.org> 37879 37880 Decode recvmmsg syscall. 37881 * net.c (do_msghr): New function to print struct msghdr. 37882 (printmsghdr): Use it. 37883 (printmmsghdr, sys_recvmmsg): New. 37884 * linux/syscall.h: Declare sys_recvmmsg. 37885 (SYS_sub_recvmmsg): Define. 37886 (SYS_socket_nsubcalls): Bump. 37887 * linux/sparc/syscall.h: Likewise. 37888 * linux/arm/syscallent.h: Add sys_recvmmsg. 37889 * linux/bfin/syscallent.h: Likewise. 37890 * linux/i386/syscallent.h: Likewise. 37891 * linux/m68k/syscallent.h: Likewise. 37892 * linux/powerpc/syscallent.h: Likewise. 37893 * linux/s390/syscallent.h: Likewise. 37894 * linux/s390x/syscallent.h: Likewise. 37895 * linux/sh/syscallent.h: Likewise. 37896 * linux/sh64/syscallent.h: Likewise. 37897 * linux/sparc/syscallent.h: Likewise. 37898 * linux/ia64/syscallent.h: Adjust. 37899 37900 2010-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 37901 37902 * strace.1: Fix quoting of hyphens and formatting of strace options. 37903 37904 Split trace_syscall() for better readability. 37905 * syscall.c (trace_syscall): Split into trace_syscall_exiting() and 37906 trace_syscall_entering(). 37907 37908 Implement -C option to combine regular and -c output. 37909 * defs.h (cflag_t): New enum. 37910 * strace.1: Document -C option. 37911 * strace.c (cflag): Update type. 37912 (main): Handle -C option. 37913 (trace): Update use of cflag. 37914 * count.c (count_syscall): Move clearing of TCB_INSYSCALL to ... 37915 * syscall.c (trace_syscall): ... here. Update use of cflag. 37916 Based on patch by Adrien Kunysz. 37917 37918 Fix "make dist" regression introduced by commit v4.5.19-12-g5078770. 37919 * Makefile.am (EXTRA_DIST): Rename linux/syscallent.h to linux/i386/syscallent.h 37920 37921 * desc.c (sys_epoll_pwait): Fix output formatting bug. 37922 37923 * desc.c (decode_select): Fix potential stack buffer overflow. 37924 37925 2010-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 37926 37927 Fix msgsnd indirect ipccall decoding. 37928 This regression was introduced by commit v4.5.18-136-g783f5bc. 37929 * ipc.c (tprint_msgsnd): Add and use "flags" argument. 37930 (sys_msgsnd): Pass "flags" argument to tprint_msgsnd(). 37931 Patch by Anton Blanchard. 37932 37933 2010-03-23 Mark Wielaard <mjw (a] redhat.com> 37934 37935 Hook up inotify_init1 open mode flags printer. 37936 * file.c [LINUX] (sys_inotify_init1): New function. 37937 * linux/syscall.h: Declare new sys_inotify_init1 handler. 37938 * linux/bfin/syscallent.h: Hook up new handler. 37939 * linux/hppa/syscallent.h: Likewise. 37940 * linux/i386/syscallent.h: Likewise. 37941 * linux/x86_64/syscallent.h: Likewise. 37942 37943 2010-03-09 Andreas Schwab <schwab (a] redhat.com> 37944 37945 Avoid spurious error when checking for linux/netlink.h. 37946 * configure.ac: Include <asm/types.h> when checking for 37947 linux/netlink.h. 37948 37949 2010-02-23 Andreas Schwab <schwab (a] linux-m68k.org> 37950 37951 Fix reporting signal mask by sigreturn on powerpc. 37952 * signal.c (sys_sigreturn) [POWERPC]: Skip dummy stack frame when 37953 locating signal context. 37954 37955 2010-02-09 David Daney <ddaney (a] caviumnetworks.com> 37956 37957 Fix MIPS N32/N64 compile error. 37958 * syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass 37959 tcp->pid to ptrace(). 37960 37961 2010-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 37962 37963 Add support for the TILE architecture. 37964 * configure.ac: Add TILE to the list of supported architectures. 37965 * defs.h: Define TCB_WAITEXECVE for TILE. 37966 * linux/tile/syscallent.h: New file. 37967 * Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h 37968 * process.c (change_syscall, struct_user_offsets): Add TILE support. 37969 * syscall.c (get_scno, get_error, syscall_enter): Likewise. 37970 * mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions 37971 support. 37972 * signal.c (sigact_flags): Add SA_NOPTRACE. 37973 (sys_sigreturn): Add TILE support. 37974 37975 2010-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 37976 37977 Remove dead code. 37978 * defs.h (tv_tv): Remove. 37979 * net.c (sys_xsetsockaddr): Remove commented out dead code. 37980 * process.c (setarg, sys_execv, sys_execve, struct_user_offsets): 37981 Likewise. 37982 * signal.c (sys_sigsuspend): Likewise. 37983 * strace.c (reaper, trace): Likewise. 37984 * stream.c (internal_stream_ioctl): Likewise. 37985 * syscall.c (trace_syscall): Likewise. 37986 * term.c (term_ioctl): Likewise. 37987 * util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt): 37988 Likewise. 37989 37990 Merge Linux internal_clone() into internal_fork() 37991 * defs.h (internal_clone): Remove. 37992 * process.c (internal_clone): Merge into internal_fork(). 37993 (internal_fork) [!LINUX]: Remove dead code. 37994 * syscall.c (internal_syscall): Replace internal_clone() with 37995 internal_fork(). 37996 37997 * Makefile.am (INCLUDES): Remove redundant search directories. 37998 37999 2010-02-04 Frederik Schler <fs (a] debian.org> 38000 38001 Update debian/* files. 38002 * debian/control: add sparc64 to the architectures list. 38003 This closes Debian bug #560062 38004 * Backport commit f0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 to fix FTBFS. 38005 This closes Debian bug #560516 38006 * debian/control: Update standards-version to 3.8.3. 38007 * debian/control: Lower package priority to optional, matching 38008 the archive override. 38009 * debian/control: add ${misc:Depends} to Depends: lines where 38010 appropriate. 38011 * debian/watch: new file, allows automatic tracking of new 38012 upstream versions. 38013 * debian/source/format: new file, adapt to debian source format "quilt" 38014 * debian/rules: indentation cleanups; use dh_testroot and dh_prep 38015 in clean target. 38016 38017 2010-01-25 Andreas Schwab <schwab (a] redhat.com> 38018 38019 Fix spurious failure of AC_STAT64 test. 38020 * acinclude.m4 (AC_STAT64): Include <sys/types.h> first. 38021 38022 2010-01-12 Andreas Schwab <schwab (a] redhat.com> 38023 38024 Don't kill the process when detaching. 38025 * strace.c (detach): Call clearbpt when TCB_BPTSET is set. 38026 38027 2009-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 38028 38029 Decode fifth argument of mremap syscall. 38030 * mem.c (sys_mremap): Decode fifth argument. 38031 * linux/*/syscallent.h: Update the number of mremap syscall arguments. 38032 38033 2009-12-24 Chris Metcalf <cmetcalf (a] tilera.com> 38034 38035 * mem.c (sys_mbind): Display first argument in hex. 38036 38037 * mem.c (mremap_flags): Add MREMAP_FIXED. 38038 38039 2009-11-16 Mike Frysinger <vapier (a] gentoo.org> 38040 38041 Move i386-specific files out of common linux dir. 38042 * linux/syscallent.h: Moved to ... 38043 * linux/i386/syscallent.h: ... here. 38044 * linux/ia64/syscallent.h: Update i386 syscallent.h include. 38045 * linux/sparc/gen.pl: Likewise. 38046 * linux/x86_64/syscallent1.h: Likewise. 38047 38048 2009-11-16 Andreas Schwab <schwab (a] redhat.com> 38049 38050 Remove support for pre-C89. 38051 * defs.h: Remove references to __STDC__ and P macros. 38052 * strace.c: Likewise. 38053 38054 2009-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 38055 38056 Decode more SOL_PACKET socket options. 38057 * net.c (sockpacketoptions): Add more PACKET_* entries. 38058 (sys_getsockopt): Decode PACKET_STATISTICS. 38059 (printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING. 38060 Patch by Gabor Gombas. 38061 38062 2009-11-11 Andreas Schwab <schwab (a] redhat.com> 38063 38064 Ignore errors if a thread is killed. 38065 * util.c (clearbpt): Ignore ESRCH error. 38066 38067 2009-11-06 Bernhard Reutner-Fischer <rep.dot.nop (a] gmail.com> 38068 38069 Fix handling of Linux systems without struct statfs64. 38070 * acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64. 38071 * configure.ac: Call AC_STATFS64. 38072 * file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only 38073 if struct statfs64 is available. 38074 38075 2009-11-06 Dmitry V. Levin <ldv (a] altlinux.org> 38076 38077 Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int) 38078 * net.c (sys_getsockopt): Optimize output a bit. 38079 Decode integer argument using printnum_int(), patch by Gabor Gombas. 38080 38081 Check umove() return code. 38082 * bjm.c (sys_query_module): Print input parameters when entering 38083 syscall. Fix handling of syscall error. Handle unlikely umove() 38084 failures. 38085 * ipc.c (tprint_msgrcv): New function. Move part of msgrcv parser code 38086 here, add check umove() return code. 38087 (sys_msgsnd): Print msqid parameter as int instead of long. 38088 (sys_msgrcv): Likewise. Use tprint_msgrcv(). 38089 * process.c (print_affinitylist): Check umove() return code. 38090 * sock.c (sock_ioctl): Handle unlikely umove() failure in the 38091 SIOCGIFCONF parser. 38092 38093 Fix check for linux/netlink.h on Linux 2.6.32-rc5+ 38094 * configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include 38095 sys/socket.h instead of linux/socket.h beforehand. 38096 38097 2009-11-04 Andreas Schwab <schwab (a] redhat.com> 38098 38099 Decode fallocate on PowerPC. 38100 * linux/powerpc/syscallent.h: Decode fallocate. 38101 38102 Factor out printing of 64bit syscall argument. 38103 * defs.h (ALIGN64): Remove. 38104 (printllval): Declare. 38105 * util.c (printllval): Define. 38106 * file.c (sys_readahead): Use printllval. 38107 (sys_lseek64): Likewise. 38108 (sys_truncate64): Likewise. 38109 (sys_ftruncate64): Likewise. 38110 (sys_fadvise64): Likewise. 38111 (sys_fadvise64_64): Likewise. 38112 (sys_fallocate): Likewise. 38113 * io.c (sys_pread): Likewise. 38114 (sys_pwrite): Likewise. 38115 (sys_pread64): Likewise. 38116 (sys_pwrite64): Likewise. 38117 * mem.c (sys_mmap64): Likewise. 38118 38119 2009-11-03 Andreas Schwab <schwab (a] redhat.com> 38120 38121 Correct decoding of readahead and fadvice64(_64) on PowerPC. 38122 * file.c (sys_readahead): Align 64bit argument. Handle PowerPC64 38123 like other 64bit architectures. 38124 (sys_fadvise64): Likewise. 38125 (sys_fadvise64_64): Handle PowerPC like ARM. 38126 * linux/powerpc/syscallent.h (sys_readahead): Account for 64bit 38127 argument alignment on PowerPC32. 38128 38129 2009-10-27 Andreas Schwab <schwab (a] redhat.com> 38130 38131 Maintain separate print column for each process. 38132 * defs.h (struct tcp): Add curcol. 38133 * strace.c: (alloc_tcb): Initialize it. 38134 (trace): Use curcol from current process and save it before 38135 continuing. 38136 (tprintf): Don't modify curcol on output error. 38137 38138 2009-10-21 Roland McGrath <roland (a] redhat.com> 38139 38140 * strace.spec: 4.5.19-1 release. 38141 38142 2009-10-21 Dmitry V. Levin <ldv (a] altlinux.org> 38143 38144 * file.c (printstat64): Cleanup trailing whitespace. 38145 38146 2009-10-16 Andreas Schwab <schwab (a] redhat.com> 38147 38148 Fix decoding of newfstatat syscall on x86-64. 38149 * file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit 38150 process redirect to printstat. 38151 Fixes RH#529316 "Field values shown for "newfstatat" system 38152 call are incorrect" 38153 38154 2009-10-12 Dmitry V. Levin <ldv (a] altlinux.org> 38155 38156 * configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h. 38157 38158 2009-10-12 Mike Frysinger <vapier (a] gentoo.org> 38159 38160 sparc/linux: Rewrite to use asm/ptrace.h. 38161 The current sparc/linux code uses asm/reg.h, but recent Linux kernels 38162 dropped that header completely. So switch over to the ptrace headers 38163 as those should stick around indefinitely as part of the ABI. 38164 38165 * defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define. 38166 * process.c: Drop asm/regs.h include. 38167 [SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs. 38168 * signal.c: Drop asm/regs.h include. 38169 (m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS]. 38170 [SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs. 38171 * syscall.c: Drop asm/regs.h include. 38172 [SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result, 38173 syscall_enter): Change struct regs to struct pt_regs. 38174 * util.c: Drop asm/regs.h include. 38175 (_hack_syscall5, _ptrace): Delete. 38176 [SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change 38177 struct regs to struct pt_regs. 38178 38179 2009-10-11 Roland McGrath <roland (a] redhat.com> 38180 38181 * make-dist: Clean up. 38182 38183 * configure.ac: Use AC_CONFIG_AUX_DIR([.]). 38184 38185 2009-10-09 Dmitry V. Levin <ldv (a] altlinux.org> 38186 38187 * make-dist: New script for preparing release tarballs. 38188 38189 * git-set-file-times: Import from rsync. 38190 38191 * Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS. 38192 38193 2009-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 38194 38195 Enhance msgsnd() parser. 38196 * ipc.c (tprint_msgsnd): New function. Move msgsnd parser code here, 38197 add check for umove() return code. 38198 (sys_msgsnd): Use tprint_msgsnd(). 38199 38200 * NEWS: Update for 4.5.19 release. 38201 38202 Enhance semop()/semtimedop() sembuf parser. 38203 * ipc.c (tprint_sembuf): New function. Move sembuf parser code here, 38204 add abbrev() support. 38205 (sys_semop, sys_semtimedop): Use tprint_sembuf(). 38206 38207 2009-10-08 Jakub Bogusz <qboosh (a] pld-linux.org> 38208 38209 Add pretty printing of sembuf argument to semop() and semtimedop() 38210 * ipc.c (semop_flags): New xlat structure. 38211 (sys_semop, sys_semtimedop): Add pretty printing of sembuf argument. 38212 38213 2009-10-08 Mike Frysinger <vapier (a] gentoo.org> 38214 38215 Add support for Linux/no-mmu with vfork. 38216 * configure.ac (AC_CHECK_FUNCS): Add fork. 38217 * strace.c (strace_vforked): Define. 38218 (startup_child): Do not raise SIGSTOP if vforked. 38219 (trace): Skip first exec when starting up after vforked. 38220 * syscall.c [BFIN] (get_scno): Drop waitexec checks. 38221 38222 Avoid malloc(0) in getdents parsers. 38223 On end of directory, getdents returns 0. This return value is used to 38224 then try and do malloc(0), but on some systems this will always return 38225 NULL. Since the code won't read the pointer in question if len is 0, 38226 then don't bother calling malloc(0) and set the pointer to NULL ourself. 38227 * file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call. 38228 38229 2009-10-07 Mike Frysinger <vapier (a] gentoo.org> 38230 38231 Add sys_nanosleep() prototype for sparc. 38232 * linux/sparc/syscall.h (sys_nanosleep): New prototype. 38233 Reported by Frederik Schler. 38234 38235 Silence compiler warnings about implicit cast from pointer to integer. 38236 * util.c (do_ptrace): Cast ptrace() 4th arg to long. 38237 (ptrace_restart): Drop void* cast on ptrace() 4th arg. 38238 38239 Ignore .gdb files from FLAT toolchains. 38240 * .gitignore: Add /*.gdb. 38241 38242 * configure.ac (AC_CHECK_FUNCS): Sort and expand. 38243 38244 Blackfin: Update ioctl/syscall lists. 38245 * linux/bfin/ioctlent.h: Sync list with latest kernel sources. 38246 * linux/bfin/syscallent.h: Likewise. 38247 38248 ioctlsort: Check ppc hosts too. 38249 * linux/ioctlsort.c: Check for __powerpc__. 38250 38251 2009-10-07 Andreas Schwab <schwab (a] redhat.com> 38252 38253 Fix build on ia64. 38254 * linux/ia64/syscallent.h: Update for addition of accept4 syscall 38255 in ../syscallent.h. 38256 38257 2009-10-07 Roland McGrath <roland (a] redhat.com> 38258 38259 * strace.spec (%doc): Add ChangeLog-CVS. 38260 38261 * Makefile.am (srpm): New phony target. 38262 38263 * Makefile.am (EXTRA_DIST): Add ChangeLog. 38264 ($(srcdir)/ChangeLog): New target, replaces gen-changelog phony target. 38265 Put it inside [MAINTAINER_MODE]. 38266 38267 2009-10-06 Dmitry V. Levin <ldv (a] altlinux.org> 38268 38269 * NEWS: Update for 4.5.19 release. 38270 38271 2009-10-05 Frederik Schler <fs (a] debian.org> 38272 38273 Prepare debian/* files for release. 38274 * debian/rules: Do not ship ChangeLog anymore. 38275 * debian/control: Update to Debian standards version 3.8.1, and remove 38276 Roland from the Maintainers list. This closes Debian bug #521458. 38277 * debian/changelog: Document changes and prepare for release. 38278 38279 2009-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 38280 38281 * defs.h [HPPA]: Lower MAX_ARGS from 32 to 6. 38282 38283 * ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer. 38284 Based on patch from Carlos O'Donell. 38285 38286 2009-10-05 Carlos O'Donell <carlos (a] systemhalted.org> 38287 38288 * linux/hppa/syscallent.h: Update syscalls. 38289 Based on work by Kyle McMartin and Helge Deller. 38290 38291 Fix SA_HANDLER function pointer comparisons for hppa. 38292 * signal.c (sys_sigaction): Cast SA_HANDLER function pointers to long. 38293 (sys_rt_sigaction): Likewise. 38294 38295 2009-10-05 Edgar E. Iglesias <edgar.iglesias (a] gmail.com> 38296 38297 CRIS: Correct first argument to upeek() 38298 This complements commit ea0e6e80260d2b1b7ad40282012b0e47869bcddf. 38299 * syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass 38300 tcp pointer instead of pid to upeek(). 38301 * util.c [CRISV10 || CRISV32] (printcall): Likewise. 38302 38303 2009-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 38304 38305 * signal.c (do_signalfd): Fix typo in output format. 38306 38307 2009-09-21 Dmitry V. Levin <ldv (a] altlinux.org> 38308 38309 * Makefile.am (gen_changelog_start_date): Fix date. 38310 38311 2009-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 38312 38313 Prepare for 4.5.19 release. 38314 * NEWS: Update for 4.5.19 release. 38315 * configure.ac: Version 4.5.19. 38316 * debian/changelog: 4.5.19-1. 38317 * strace.spec: 4.5.19-1. 38318 38319 Update debian/* to 4.5.18-1. 38320 * debian/changelog: Update to 4.5.18-1. 38321 * debian/compat: Set compatibility level to 7. 38322 * debian/control (Build-Depends): Update debhelper requirement. 38323 (strace, strace64): Add Section and Priority tags. 38324 38325 2009-09-19 Kirill A. Shutemov <kirill (a] shutemov.name> 38326 38327 Fix fadvise64 decoding on ARM. 38328 * file.c (sys_fadvise64_64) [ARM]: Fix argument ordering. 38329 38330 2009-09-18 Dmitry V. Levin <ldv (a] altlinux.org> 38331 38332 Fix follow fork/vfork on Linux ARM OABI. 38333 __NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI. 38334 * process (change_syscall) [LINUX && ARM]: Mask off the high order bits 38335 when changing syscall. 38336 38337 Reviewed-by: Kirill A. Shutemov <kirill (a] shutemov.name> 38338 38339 2009-09-18 Mike Frysinger <vapier (a] gentoo.org> 38340 38341 Mark shell scripts as executable. 38342 38343 Ignore ioctlsort helper program. 38344 * .gitignore: Add ioctlsort. 38345 38346 linux/errno: Add ERFKILL. 38347 * linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132 38348 definition introduced in Linux 2.6.31. 38349 38350 2009-09-01 Paolo Bonzini <pbonzini (a] redhat.com> 38351 38352 Add accept4 socketcall. 38353 This second patch in the series adds support for accept4 as a socketcall 38354 sub-call. Besides the need to renumber all system calls, this poses 38355 no problem. 38356 Tested on i686. 38357 38358 * linux/arm/syscallent.h: Add accept4 socketcall. 38359 * linux/m68k/syscallent.h: Likewise. 38360 * linux/powerpc/syscallent.h: Likewise. 38361 * linux/s390/syscallent.h: Likewise. 38362 * linux/s390x/syscallent.h: Likewise. 38363 * linux/sh/syscallent.h: Likewise. 38364 * linux/sh64/syscallent.h: Likewise. 38365 * linux/sparc/syscallent.h: Likewise. 38366 * linux/syscallent.h: Likewise. 38367 38368 * linux/sparc/syscall.h (SYS_sub_accept4): Declare. 38369 (SYS_socket_nsubcalls): Update. 38370 * linux/syscall.h: Likewise. 38371 38372 2009-09-01 Paolo Bonzini <pbonzini (a] redhat.com> 38373 38374 Replace x86-64 paccept with accept4. 38375 This patch changes the paccept syscall to accept4 for x86-64, since 38376 the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826. 38377 At the same time, it adds support for pretty printing its arguments. 38378 38379 * linux/x86_64/syscallent.h: Replace paccept with accept4, 38380 hook in sys_accept4. 38381 * net.c (sys_accept): Leave a small stub calling the new... 38382 (do_accept): ... function, which also adds a flags_arg argument. 38383 (sys_accept4): New. 38384 38385 2009-08-28 Andreas Schwab <schwab (a] redhat.com> 38386 38387 Zero-extend 32-bit addresses when printing argv array. 38388 (printargv): Zero-extend 32-bit addresses. 38389 Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit 38390 process". 38391 38392 2009-08-12 Andreas Schwab <schwab (a] redhat.com> 38393 38394 Add more futex decoding. 38395 * process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI) 38396 (FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define. 38397 (futexops): Add entries for them. 38398 (sys_futex): Decode FUTEX_CMP_REQUEUE_PI and 38399 FUTEX_WAIT_REQUEUE_PI. 38400 38401 2009-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 38402 38403 Generate ChangeLog from git log. 38404 * .gitignore: Add ChangeLog 38405 * ChangeLog: Rename to ChangeLog-CVS. 38406 * Makefile.am (gen-changelog): New rule. 38407 (dist-hook): Depend on it. 38408 (EXTRA_DIST): Add ChangeLog-CVS. 38409 * README-hacking: Describe changes. 38410 * gitlog-to-changelog: Import from gnulib. 38411 38412 38413 See ChangeLog-CVS for older changes. 38414