1 2018-10-30 Dmitry V. Levin <ldv (a] altlinux.org> 2 3 Prepare for 4.25 release. 4 * NEWS: Update for 4.25 release. 5 6 Update copyright headers. 7 Headers updated automatically using maint/update_copyright_years.sh 8 script. 9 10 2018-10-25 Dmitry V. Levin <ldv (a] altlinux.org> 11 12 Update NEWS. 13 14 2018-10-25 Elvira Khabirova <lineprinter (a] altlinux.org> 15 16 Implement decoding of NBD_* ioctl commands. 17 * nbd_ioctl.c: New file. 18 * Makefile.am (strace_SOURCES): Add it. 19 * defs.h (DECL_IOCTL): Add nbd. 20 * ioctl.c (ioctl_decode): Add 0xab (nbd) case. 21 * xlat/nbd_ioctl_cmds.in: Likewise. 22 * xlat/nbd_ioctl_flags.in: Likewise. 23 * tests/ioctl_nbd.c: Likewise. 24 * tests/.gitignore: Add ioctl_nbd. 25 * tests/pure_executables.list: Likewise. 26 * tests/gen_tests.in (ioctl_nbd): New entry. 27 28 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 29 30 2018-10-25 Dmitry V. Levin <ldv (a] altlinux.org> 31 32 tests: fix build with recent kernel headers. 33 Linux commit v4.19-rc2-5-g2ecefa0a15fd0ef88b9cd5d15ceb813008136431 34 changed the definition of struct keyctl_dh_params in an incompatible 35 way again. Workaround this issue by using designated initializers. 36 37 * tests/keyctl.c (main): Use designated initializers for 38 struct keyctl_dh_params. 39 40 2018-10-24 Dmitry V. Levin <ldv (a] altlinux.org> 41 42 arm, sparc, sparc64: wire up io_pgetevents. 43 * linux/arm/syscallent.h ([399]): Wire up io_pgetevents syscall 44 introduced by Linux commit v4.19-rc7~24^2~1. 45 (ARM_FIRST_SHUFFLED_SYSCALL, SYS_socket_subcall): Raise from 400 to 500, 46 to make room for new syscalls. 47 * linux/sparc/syscallent.h ([361]): Wire up io_pgetevents syscall 48 introduced by Linux commit v4.19~31^2~5. 49 * linux/sparc64/syscallent.h: Likewise. 50 51 2018-10-24 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 52 53 Update ioctl entries from linux v4.19. 54 * linux/32/ioctls_inc_align16.h: Update from linux v4.19-rc8 55 using ioctls_gen.sh. 56 * linux/32/ioctls_inc_align32.h: Likewise. 57 * linux/32/ioctls_inc_align64.h: Likewise. 58 * linux/64/ioctls_inc.h: Likewise. 59 * linux/x32/ioctls_inc0.h: Likewise. 60 * linux/i386/ioctls_arch0.h: Likewise. 61 * linux/x86_64/ioctls_arch0.h: Likewise. 62 * NEWS: Mention this. 63 64 maint: update for linux 4.19-rc8. 65 * maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE. 66 67 2018-10-24 Dmitry V. Levin <ldv (a] altlinux.org> 68 69 Remove redundant VIDIOC_SUBDEV_* constants. 70 Remove those of VIDIOC_SUBDEV_* constants are defined exactly the same 71 way by the Linux kernel as their VIDIOC_* origins. 72 73 Linux kernel commit v4.19-rc1~137^2~248 introduced more of such 74 duplicates, forward remove them as well. 75 76 * linux/32/ioctls_inc_align16.h: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP, 77 VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS, 78 VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_QUERY_DV_TIMINGS, 79 VIDIOC_SUBDEV_S_DV_TIMINGS, and VIDIOC_SUBDEV_S_EDID. 80 * linux/32/ioctls_inc_align32.h: Likewise. 81 * linux/32/ioctls_inc_align64.h: Likewise. 82 * linux/64/ioctls_inc.h: Likewise. 83 * linux/x32/ioctls_inc0.h: Likewise. 84 * maint/ioctls_sym.sh: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP, 85 VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUMSTD, 86 VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_G_STD, 87 VIDIOC_SUBDEV_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERYSTD, 88 VIDIOC_SUBDEV_S_DV_TIMINGS, VIDIOC_SUBDEV_S_EDID, and 89 VIDIOC_SUBDEV_S_STD. 90 91 2018-09-27 Dmitry V. Levin <ldv (a] altlinux.org> 92 93 xtensa: fix typo in pkey_alloc syscall number. 94 * linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349. 95 96 2018-09-23 Dmitry V. Levin <ldv (a] altlinux.org> 97 98 xlat: print _IOC_NONE in symbolic form even if it is equal to 0. 99 On some architectures _IOC_NONE equals to 1, on others it is 0. 100 Change the way how ioctl direction flags are printed so that 101 _IOC_NONE is printed in symbolic form even if it is equal to 0. 102 103 * xlat/ioctl_dirs.in (_IOC_NONE): Move to the head of the list. 104 * tests/ioctl_inotify.c (main): Update expected output. 105 * tests/ioctl_loop. (main): Likewise.c 106 * tests/ioctl_perf.c (main): Likewise. 107 * tests/ioctl_scsi.c (main): Likewise. 108 109 2018-09-18 Dmitry V. Levin <ldv (a] altlinux.org> 110 111 Disable git-archive. 112 Since configure uses git-version-gen which in turn depends 113 on "git describe" or a .tarball-version file, raw archives 114 generated by "git archive" cannot be built. 115 116 * .gitattributes: New file. 117 * README-github_gitlab-autogenerated-archives.txt: Likewise. 118 119 2018-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 120 121 Workaround signedness bugs in system NLMSG_OK reported by -Wsign-compare 122 Introduce a replacement for NLMSG_OK provided by <linux/netlink.h> since 123 that system macro contains signedness bugs that are not going to be fixed. 124 125 * netlink.h: Include <stdbool.h>. 126 (is_nlmsg_ok): New static inline function. 127 * socketutils.c (receive_responses): Use it instead of NLMSG_OK. 128 * tests/netlink_inet_diag.c (check_responses): Likewise. 129 * tests/netlink_netlink_diag.c (check_responses): Likewise. 130 * tests/netlink_unix_diag.c (check_responses): Likewise. 131 132 Closes: https://github.com/strace/strace/issues/79 133 134 2018-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 135 136 tests/sprintrc.c: drop redundant check. 137 * tests/sprintrc.c (sprintrc_ex): Remove fmt check, this also fixes the 138 warning reported by clang -Wtautological-constant-out-of-range-compare. 139 140 build: enable gcc -Woverride-init and clang -Winitializer-overrides. 141 * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Winitializer-overrides 142 and -Woverride-init. 143 144 2018-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 145 146 tests: exclude arm_sync_file_range from ksysent test. 147 arm_sync_file_range is better known as sync_file_range2. 148 149 * tests/ksysent.sed: Filter out arm_sync_file_range. 150 151 2018-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 152 153 Ignore warnings about overridden initialization of hwaddr_sizes. 154 As hwaddr_sizes array is explicitly initialized this way, 155 ignore potential warnings reported by gcc -Woverride-init 156 and clang -Winitializer-overrides. 157 158 * gcc_compat.h (CLANG_PREREQ): New macro. 159 (DIAG_PUSH_IGNORE_OVERRIDE_INIT, DIAG_POP_IGNORE_OVERRIDE_INIT): New 160 macros non-trivially defined for gcc >= 4.2 and clang >= 2.8. 161 * sock.c (print_ifreq): Use them to ignore warnings about overridden 162 initialization of hwaddr_sizes array. 163 164 Closes: https://github.com/strace/strace/issues/77 165 166 2018-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 167 168 tests: workaround clang -Wunneeded-internal-declaration bug. 169 * tests/execve.c (main): Explicitly mark q_envp variable as used 170 to workaround clang -Wunneeded-internal-declaration bug. 171 * tests/execveat.c (main): Likewise. 172 * tests/nsyscalls.c (main): Explicitly mark syscallent variable as used 173 to workaround clang -Wunneeded-internal-declaration bug. 174 175 Closes: https://github.com/strace/strace/issues/78 176 177 2018-09-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 178 179 process: honor xlat style in print_user_offset_addr. 180 * process.c (print_user_offset_addr): Print in accordance with xlat 181 verbosity setting. 182 183 time: add xlat styles support to printclockname. 184 * time.c (printclockname): Respectl xlat_verbosity. 185 186 perf: rewrite print_perf_event_attr using PRINT_FIELD_* macros. 187 * perf.c: Include "print_fields.h". 188 (PRINT_XLAT): Remove. 189 (print_perf_event_attr): Use PRINT_FIELD_* macros. 190 191 2018-09-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 192 193 tests: check stack unwinding for signals. 194 * tests/stack-fcall-3.c: Include <signal.h>. 195 (f3): Call getpid or kill depending on the argument, store getpid result. 196 * tests/stack-fcall.c (main): Remove arguments, call f0(0) and f0(1). 197 * tests/strace-k-demangle.expected: Update expected output. 198 * tests/strace-k.expected: Likewise. 199 * tests/strace-k.test: Rewrite pattern matching code. 200 201 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 202 203 2018-09-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 204 205 Print stack traces on signals. 206 I don't know why it hasn't been done earlier. 207 208 * strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print 209 if stack trace printing is enabled. 210 211 2018-09-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 212 213 xlat: provide fallback definitions for open_access_modes constants. 214 * xlat/open_access_modes.in: Add fallback values. 215 216 xlat: update resources. 217 * xlat/resources.in: Declare as #value indexed, provide fallback values. 218 (RLIMIT_VMEM): Remove. 219 220 nlattr: ignore nla_type flags when selecting nlattr decoder. 221 * nlattr.c (decode_nlattr_with_data): Apply NLA_TYPE_MASK to nla_type 222 before decoder selection. 223 224 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 225 226 netlink_packet_diag: assorted decoding fixes. 227 * xlat/af_packet_versions.in: New file. 228 * netlink_packet_diag.c: Include "xlat/af_packet_versions.h". 229 (decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol, 230 currently it should be set to 0. 231 (decode_packet_diag_info): Decode pdi_version field using af_packet_versions 232 xlat; decode pdi_index field as an interface index. 233 (packet_diag_msg_nla_decoders) <PACKET_DIAG_UID>: Decode using 234 decode_nla_uid. 235 (decode_packet_diag_msg): Decode pdiag_num as an low-level protocol. 236 * tests/netlink_sock_diag.c: Update expected output. 237 * tests/nlattr_packet_diag_msg.c: Likewise. 238 239 sockaddr: add X.25 socket address decoding support. 240 * sockaddr.c: Include <linux/x25.h>. 241 (print_sockaddr_data_x25): New function. 242 (sa_printers) <[AF_X25]>: New socket address handler. 243 * tests/net-sockaddr.c (check_x25): New function. 244 (main): Use it to check X.25 socket address decoding. 245 246 net: add support for AX.25 protocols and socket option names decoding. 247 * xlat/ax25_protocols.in: New file. 248 * xlat/sock_ax25_options.in: Likewise. 249 * net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h". 250 * (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using 251 ax25_protocols xlat. 252 (print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name 253 using sock_ax25_options xlat. 254 255 sockaddr: decode AX.25 socket addresses. 256 * defs.h (print_ax25_addr): New prototype. 257 * print_fields.h (PRINT_FIELD_AX25_ADDR): New macro. 258 * sockaddr.c: Include <linux/ax25.h>. 259 (check_ax25_address, ax25_addr2str, print_ax25_addr_raw, 260 print_ax25_addr, print_sockaddr_data_ax25): New functions. 261 (sa_printers) <[AF_AX25]>: New printer. 262 * tests/net-sockaddr.c (AX25_ADDR): New macro. 263 (check_ax25): New function. 264 (main): Use it to check AX.25 socket address decoding. 265 266 macros: add ROUNDUP macro. 267 * macros.h (ROUNDUP): New macro. 268 269 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 270 271 futex: recognise FUTEX_BITSET_MATCH_ANY bitmask. 272 * xlat/futexbitset.in: New file. 273 * futex.c: Include "xlat/futexbitset.h". 274 (futex) <FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET>: Decode val3 using 275 futexbitset xlat. 276 * tests/futex.c: Add checks for 0xffffffff bitset mask printing. 277 278 Closes: Linux commit v4.16-rc1~166^2^2~2 279 280 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 281 282 ioprio: move constant definitions to xlat. 283 * xlat/ioprio_class.in: Add fallback values. 284 * xlat/ioprio_who.in: Likewise. 285 * ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums. 286 287 net: decode AF_PACKET protocols in socket syscall. 288 * net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode. 289 (SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols xlat. 290 291 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 292 293 print_ifindex: add public get_ifname method. 294 In order to be able to obtain sanitised device name internally. 295 296 * defs.h (get_ifname): New declaration. 297 * print_ifindex.c (get_ifname): Refactor, leaving out addition 298 of if_nametoindex("") part. 299 (sprint_ifname): New function, adds if_nametoindex("") 300 to get_ifname's output. 301 (print_ifindex): Use sprint_ifname instead of get_ifname. 302 303 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 304 305 socketutils: introduce get_family_by_proto. 306 Add a helper function that returns address family based on the internal 307 notion of the socket protocol using protocols table. 308 309 * defs.h (get_family_by_proto): New declaration. 310 * socketutils.c (get_family_by_proto): New function. 311 312 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 313 314 socketutils: add more IP/IPv6 transport protocols. 315 * defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP, 316 SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW, 317 SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6, 318 SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6. 319 * socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY 320 mode. 321 (protocols): Add protocol descriptions for them. 322 323 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 324 325 socketutils: store more information in protocols table. 326 This also allows getting rid of all these *_v[46]_get calls. 327 328 * socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol, 329 and proto_name paramteres, use them where appropriate. 330 (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove. 331 (protocols): Add family and proto fields to the structure, call inet_get 332 for IP/IPv6 protocols. 333 (get_sockaddr_by_inode_uncached): Update protocols->get calls. 334 335 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 336 337 sockaddr: whitespace cleanup, fix typo in comment. 338 * sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess 339 indentation from the switch statement. 340 341 tests: add utimensat test variants with different xlat verbosity levels. 342 * tests/utimensat-Xabbrev.c: New file. 343 * tests/utimensat-Xraw.c: Likewise. 344 * tests/utimensat-Xverbose.c: Likewise. 345 * tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. 346 * tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw, 347 and utimensat-Xverbose. 348 * tests/.gitignore: Likewise. 349 * tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New 350 tests. 351 352 print_timespec: make print_timespec_t_utime respect xlat style setting. 353 * print_timespec.c (print_timespec_t_utime): Print raw timespec value 354 in accordance with xlat style setting. 355 356 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 357 358 netlink: honor custom xlat style setting during nlmsg flags printing. 359 Commit v4.23~343 introduced xlat style argument to printflags_ex, but 360 XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342, 361 which led to missing out fixing the sole external user of this 362 peculiar extended interface. 363 364 * netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of 365 XLAT_STYLE_ABBREV in printflags_ex call. 366 367 Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT" 368 369 2018-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 370 371 netlink_netfilter: use xlat styles for res_id workaround printing. 372 * netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex 373 in order to respect xlat style setting. 374 375 xlat: provide fallback definitions for epollevents. 376 * xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL 377 constant (introduced by Linux commit v4.16-rc1~3^2~3). 378 379 xlat: provide fallback definitions to pollflags. 380 * xlat/pollflags.in: Add fallback definitions for POLLWRNORM, 381 POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP. 382 383 xlat: provide fallback values for socktypes. 384 * xlat/socktypes.in: Provide fallback values. 385 386 xlat: provide fallback values to route_nexthop_flags. 387 * xlat/route_nexthop_flags.in: Add fallback values. 388 389 2018-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 390 391 block: move fallback definitions for ioctl commands to xlat. 392 * xlat/block_ioctl_cmds.in: New file. 393 * block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode. 394 (BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN, 395 BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET, 396 BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove 397 fallback definitions as those are porvided by block_ioctl_cmds xlat now. 398 399 2018-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 400 401 Decode BLKGETSIZE64 unconditionally. 402 It is available on all supported kernel versions. 403 404 * block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64. 405 * configure.ac: Remove BLKGETSIZE64 check. 406 407 2018-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 408 409 xlat: add ability to specify a default string to print_xlat_ex. 410 In order to avoid dealing with xlat verbosity styles outside xlat code 411 as much as possible. 412 413 * defs.h (xlat_style_private_flag_bits): Rename from 414 print_array_flag_bits, add PXF_DEFAULT_STR_BIT. 415 (xlat_style_private_flags): Rename from print_array_flags, add 416 FLAG_(PXF_DEFAULT_STR). 417 * xlat.c (print_xlat_ex): Handle PXF_DEFAULT_STR by interpreting str 418 as a default value (print both value and str in XLAT_STYLE_ABBREV). 419 420 2018-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 421 422 nlattr: provide common AF_INET{,6} address decoders. 423 Rename decode_ifla_inet6_token to decode_nla_in6_addr, 424 add a sister function decode_nla_in_addr for future use. 425 426 * nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions. 427 * nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations. 428 * rtnl_link.c (decode_ifla_inet6_token): Remove. 429 (ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr. 430 431 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 432 433 net: decode SOL_XDP socket option names. 434 * xlat/sock_xdp_options.in: New file. 435 * net.c: Include "xlat/sock_xdp_options.h". 436 (print_sockopt_fd_level_name) <case SOL_XDP>: Print SOL_XDP socket 437 option names. 438 439 xlat: add SOL_XDP to socketlayers.in. 440 * xlat/socketlayers.in (SOL_XDP): New constant, introduced by Linux 441 commit v4.18-rc1~114^2~304^2~4^2~14. 442 443 xlat: add AF_XDP to addrfams.in. 444 * xlat/addrfams.in (AF_XDP): New constant, introduced by Linux commit 445 v4.18-rc1~114^2~304^2~4^2~14. 446 447 netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value. 448 * xlat/sock_shutdown_flags.in: New file. 449 * netlink_smc_diag.c: Include "xlat/sock_shutdown_flags.h". 450 (decode_smc_diag_shutdown): New function. 451 (smc_diag_msg_nla_decoders) <[SMC_DIAG_SHUTDOWN]>: Use 452 decode_smc_diag_shutdown. 453 * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_SHUTDOWN. 454 455 tests/ioctl_v4l2: do not calculate page end address each time. 456 * tests/ioctl_v4l2.c (main): Replace page + size with page_end. 457 458 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 459 460 print_fields: simplify UINT64_MAX printing. 461 As we have print_xlat_u now. 462 463 * print_fields.h (PRINT_FIELD_U64): Use print_xlat_u for UINT64_MAX 464 printing. 465 466 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 467 468 nsfs: simplify auxstr logic. 469 There's no need to check whether non-NULL value is being assigned to 470 auxstr; syscall_exiting_trace does it itself. 471 472 * nsfs.c (nsfs_ioctl) <case NS_GET_NSTYPE>: Simply assign result of 473 xlookup to auxstr if syserror(tcp) is false. 474 475 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 476 477 xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in. 478 * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_REUSEPORT): New constant, 479 introduced by Linux commit v4.19-rc1~140^2~24^2~2^2~5. 480 * tests/bpf.c: Update expected output. 481 482 xlat: add IPSTATS_MIB_REASM_OVERLAPS to snmp_ip_stats_mib.in. 483 * xlat/snmp_ip_stats.in (IPSTATS_MIB_REASM_OVERLAPS): New constant, 484 introduced by Linux commit v4.19-rc1~140^2~128^2~2. 485 486 xlat: update bpf_map_types.in. 487 * xlat/bpf_map_types.in (BPF_MAP_TYPE_CGROUP_STORAGE): New constant, 488 introduced by Linux commit v4.19-rc1~140^2~108^2~3^2~12. 489 (BPF_MAP_TYPE_REUSEPORT_SOCKARRAY): New constant, introduced by Linux 490 commit v4.19-rc1~140^2~24^2~2^2~6. 491 * tests/bpf.c: Update expected output. 492 493 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 494 495 rtnl_link: add IFLA_MIN_MTU and IFLA_MAX_MTU attributes. 496 Introduced by Linux commit v4.19-rc1~140^2~205^2~1. 497 498 * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>: 499 New decoder, calls decode_nla_u32. 500 * xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant. 501 502 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 503 504 xlat: add IPV4_DEVCONF_BC_FORWARDING-1 to inet_devconf_indices.in. 505 * xlat/inet_devconf_indices.in (IPV4_DEVCONF_BC_FORWARDING-1): New 506 constant, introduced by Linux commit v4.19-rc1~140^2~208^2~1. 507 508 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 509 510 rtnl_netconf: add NETCONFA_BC_FORWARDING attribute. 511 Introduced by Linux commit v4.19-rc1~140^2~208^2~1. 512 513 * rtnl_netconf.c (netconfmsg_nla_decoders) <[NETCONFA_BC_FORWARDING]>: 514 New decoder, calls decode_nla_s32. 515 * xlat/rtnl_netconf_attrs.in (NETCONFA_BC_FORWARDING): New constant. 516 517 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 518 519 netlink_smc_diag: add SMC_DIAG_FALLBACK attribute support. 520 Introduced by Linux commit v4.19-rc1~140^2~253^2~1. 521 522 * linux/smc_diag.h (SMC_DIAG_FALLBACK): New enumeration item. 523 (struct smc_diag_fallback): New type definition. 524 * netlink_smc_diag.c: Include "xlat/smc_decl_codes.h". 525 (decode_smc_diag_fallback): New function. 526 (smc_diag_msg_nla_decoders) <[SMC_DIAG_FALLBACK]>: New decoder, calls 527 decode_smc_diag_fallback. 528 * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_FALLBACK 529 attribute decoding. 530 * xlat/smc_decl_codes.in: New file. 531 * xlat/smc_diag_attrs.in (SMC_DIAG_FALLBACK): New constant. 532 533 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 534 535 defs.h: add style argument to printxval_search_ex macro. 536 It is identical to printxval_search otherwise. 537 538 * defs.h (printxval_search_ex): Add style argument. 539 540 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 541 542 xlat: update v4l2_pix_fmts.in. 543 * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT): New constant, introduced by 544 Linux commit v4.19-rc1~137^2~221. 545 (V4L2_PIX_FMT_SBGGR14P, V4L2_PIX_FMT_SGBRG14P, V4L2_PIX_FMT_SGRBG14P, 546 V4L2_PIX_FMT_SRGGB14P): New constants, introduced by Linux commit 547 v4.19-rc1~137^2~97. 548 (V4L2_PIX_FMT_Y10P): New constant, introduced by Linux commit 549 v4.19-rc1~137^2~95. 550 551 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 552 553 netlink_smc_diag: decode smc_diag_msg.diag_fallback constant names. 554 Introduced by Linux commit v4.19-rc1~140^2~285^2~4. 555 556 * xlat/smc_diag_mode.in: New file. 557 * netlink_smc_diag.c: Include "xlat/smc_diag_mode.h". 558 (decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode 559 xlat. 560 * tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output. 561 * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise. 562 563 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 564 565 rtnl_link: add IFLA_BRPORT_BACKUP_PORT attribute. 566 Introduced by Linux commit v4.19-rc1~140^2~288^2. 567 568 * xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New 569 constant. 570 * rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>: 571 New decoder. 572 573 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 574 575 xlat: update nt_descriptor_types.in. 576 * xlat/nt_descriptor_types.in (NT_VMCOREDD): New named constant, 577 introduced by Linux commit v4.18-rc1~114^2~252^2~2. 578 (NT_MIPS_DSP): New named constant, introduced by Linux commit 579 v4.19-rc1~42^2~63. 580 (NT_MIPS_FP_MODE): New named constant, introduced by Linux commit 581 v4.19-rc1~42^2~62. 582 583 xlat: add AUDIT_INTEGRITY_POLICY_RULE to nl_audit_types.in. 584 * xlat/nl_audit_types.in (AUDIT_INTEGRITY_POLICY_RULE): New constant, 585 introduced by Linux commit v4.19-rc1~124^2~5. 586 587 rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value. 588 * xlat/rtnl_ifla_xdp_attached_mode.in: New file. 589 * rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h". 590 (decode_ifla_xdp_attached): New function. 591 (ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use 592 decode_ifla_xdp_attached instead of decode_nla_u8. 593 * tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding. 594 595 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 596 597 rtnl_link: add new IFLA_XDP_* attributes. 598 Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6. 599 600 * xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID, 601 IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants. 602 * rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for 603 IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID. 604 * tests/nlattr_ifla_xdp.c: Add checks for new attributes. 605 606 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 607 608 xlat: update v4l2_control_ids.in. 609 * xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_VP8_PROFILE): Renamed 610 from V4L2_CID_MPEG_VIDEO_VPX_PROFILE (the latter is now a synonym), 611 by Linux commit v4.19-rc1~137^2~270. 612 (V4L2_CID_MPEG_VIDEO_VP9_PROFILE): New constant, introduced by Linux 613 commit v4.19-rc1~137^2~269. 614 615 xlat: add SO_TXTIME to sock_options.in. 616 * xlat/sock_options.in (SO_TXTIME): New constant, introduced by Linux 617 commit v4.19-rc1~140^2~465^2~12. 618 619 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 620 621 netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding. 622 The message has been added by Linux commit v4.19-rc1~140^2~507^2~1. 623 624 * linux/smc_diag.h: Include "gcc_compat.h". 625 (enum): Add SMC_DIAG_DMBINFO. 626 (struct smcd_diag_dmbinfo): New type definition. 627 * xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant. 628 * netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function. 629 (smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls 630 decode_smc_diag_dmbinfo. 631 * tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check. 632 633 2018-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 634 635 xlat: add SCTP_REUSE_PORT to sock_sctp_options.in. 636 * xlat/sock_sctp_options.in (SCTP_REUSE_PORT): New constant, introduced 637 by Linux commit v4.19-rc1~140^2~518. 638 639 xlat: add IN_MASK_CREATE to inotify_flags.in. 640 * xlat/inotify_flags.in (IN_MASK_CREATE): New constant, introduced by 641 Linux commit v4.19-rc1~115^2. 642 * tests/inotify.c (main): Update expected output. 643 644 2018-08-22 Dmitry V. Levin <ldv (a] altlinux.org> 645 646 tests: workaround systemd-nspawn habit of disabling unimplemented syscalls 647 * tests/nsyscalls.c (test_syscall): Do not assume that unimplemented 648 syscalls always fail with ENOSYS. 649 650 tests: workaround systemd-nspawn habit of disabling mlockall syscall. 651 * tests/mmap.c (main): Do not assume that mlockall syscall always 652 succeeds. 653 654 tests: workaround systemd-nspawn habit of disabling munlockall syscall. 655 * tests/munlockall.c (main): Do not assume that munlockall syscall 656 always succeeds. 657 658 2018-08-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 659 660 Decode AF_SMC netlink messages unconditionally. 661 As smc_diag.h is bundled, there is little sense to build AF_SMC support 662 conditionally. 663 664 * netlink_smc_diag.c [!AF_SMC]: Include xlat/addrfams.h under 665 XLAT_MACROS_ONLY, enable the rest of file. 666 * netlink_sock_diag.c: Include xlat/addrfams.h under XLAT_MACROS_ONLY. 667 (diag_decoders): Remove "ifdef AF_SMC" condition for [AF_SMC], reorder 668 in accordance with address family values. 669 * tests/nlattr_smc_diag_msg.c [!AF_SMC]: Define AF_SMC to 43, enable 670 the rest of test. 671 672 2018-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 673 674 strace.c: introduce struct tcb_wait_data. 675 Introduce a new structure to pass information between next_event(), 676 restart_delayed_tcb(), and dispatch_event(). 677 678 This is going to be used by a subsequent change of next_event(). 679 680 * strace.c (struct tcb_wait_data): New type. 681 (next_event): Remove parameters, return a pointer 682 to const struct tcb_wait_data. Return NULL instead of TE_BREAK. 683 (dispatch_event): Replace all parameters with a pointer 684 to const struct tcb_wait_data, obtain the trace event, siginfo, 685 and status from its fields. 686 (restart_delayed_tcb): Add local struct tcb_wait_data variable 687 with te field set to TE_RESTART, pass it to dispatch_event(). 688 (main): Remove status and si variables, update next_event() 689 and dispatch_event() invocations. 690 691 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 692 693 2018-08-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 694 695 xlat: fix typo in smc_protocols.in. 696 * xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/. 697 698 2018-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 699 700 ci: add a test with the latest gcc and mainline headers. 701 * .gitlab-ci.yml (gcc-x86_64-libdw-mainline): New entry. 702 * .travis.yml (CC=gcc-8, KHEADERS=torvalds/linux): Likewise. 703 704 ci: update gitlab ubuntu image. 705 * .gitlab-ci.yml (image): Replace "ubuntu:17.10" with "ubuntu:18.04". 706 707 ci: install kernel headers after compiler dependencies. 708 * ci/install-dependencies.sh: Install kernel headers after compiler 709 dependencies to avoid a needless attempt to install $common_packages. 710 711 ci: fix kernel headers version diagnostics. 712 * ci/run-build-and-tests.sh: Honor $CPPFLAGS when printing 713 kernel headers version. 714 715 2018-08-19 Zhibin Li <08826794brmt (a] gmail.com> 716 717 tests: enhance test coverage of evdev ioctl. 718 * tests/ioctl_evdev.c (main): Test EVIOCGMTSLOTS(8) command. 719 720 tests: check decoding of successful evdev ioctl. 721 * tests/ioctl_evdev-success.c: New file. 722 * tests/ioctl_evdev-success-v.c: Likewise. 723 * tests/ioctl_evdev-success.test: New test. 724 * tests/ioctl_evdev-success-v.test: Likewise. 725 * tests/.gitignore: Add ioctl_evdev-success and ioctl_evdev-success-v. 726 * tests/Makefile.am (check_PROGRAMS): Likewise. 727 (DECODER_TESTS): Add the two tests mentioned above. 728 729 2018-08-19 Zhibin Li <08826794brmt (a] gmail.com> 730 731 evdev: fix decoding of EVIOCGBIT(0, ...) 732 There is a comment in drivers/input/evdev.c which says: 733 /* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */ 734 735 That is, EVIOCGBIT(0, ...) should return a bit mask with supported 736 event types instead of SYN_* event codes. 737 738 * defs.h (evdev_ev): New prototype. 739 * evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h". 740 (bit_ioctl) <case EV_SYN>: Replace EV_SYN with 0, use evdev_ev 741 with XT_SORTED in decode_bitset invocation instead. 742 * ioctl.c: Do not include "xlat/evdev_ev.h". 743 (evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN". 744 * tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT 745 output. 746 * xlat/evdev_sync.in: Remove. 747 748 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 749 Fixes: v4.10~89 "Add decoding for evdev ioctls" 750 751 2018-08-19 Zhibin Li <08826794brmt (a] gmail.com> 752 753 evdev: fix decoding of bit sets. 754 According to drivers/input/evdev.c:bits_to_user(), 755 the Linux kernel returns the number of bytes, not bits. 756 757 * evdev.c (decode_bitset_): Treat syscall return value as the number 758 of bytes. 759 760 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 761 Fixes: v4.10~89 "Add decoding for evdev ioctls" 762 763 2018-08-19 Pierre Marsais <pierre.marsais (a] lse.epita.fr> 764 765 kvm: decode the argument of KVM_CHECK_EXTENSION. 766 xlat/kvm_cap.in has been generated using the following command line: 767 768 grep '#define\s\+KVM_CAP' $linux/include/uapi/linux/kvm.h | 769 sed -E -e 's/^#define\s+([^ \t]+)\s*([0-9]+).*$/printf "%-40s%s\n" \1 \2/e' \ 770 -e 's/ {8}/\t/g; s/ +/\t/g' 771 772 * xlat/kvm_cap.in: New file. 773 * kvm.c: Include "xlat/kvm_cap.h". 774 (kvm_ioctl_decode_check_extension): New function. 775 (kvm_ioctl): Use it. 776 * tests/ioctl_kvm_run_common.c (main): Check decoding 777 of KVM_CHECK_EXTENSION command. 778 779 2018-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 780 781 xlat: update V4L2_CID_USER_*_BASE constants. 782 * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_S2255_BASE, 783 V4L2_CID_USER_SI476X_BASE, V4L2_CID_USER_SAA7134_BASE, 784 V4L2_CID_USER_ADV7180_BASE, V4L2_CID_USER_TC358743_BASE, 785 V4L2_CID_USER_MAX217X_BASE): New constants. 786 787 2018-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 788 789 xlat: workaround V4L2_CID_USER_IMX_BASE Linux kernel ABI breakage. 790 Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48 791 has changed the value of V4L2_CID_USER_IMX_BASE constant introduced 792 by commit v4.13-rc1~141^2~121 because the old value was already used 793 by V4L2_CID_USER_MAX217X_BASE. 794 795 This is of course an ABI breakage that affects Linux kernels starting 796 with 4.13 and up to 4.18, as well as their LTS derivatives. 797 798 Since the imx driver didn't provide any public control ID definitions, 799 it looks like the best way to handle this situation is to pretend that 800 the old value of V4L2_CID_USER_IMX_BASE didn't exist. 801 802 * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_IMX_BASE): Redefine. 803 804 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 805 806 2018-08-14 Dmitry V. Levin <ldv (a] altlinux.org> 807 808 Post-release administrivia. 809 * NEWS: Add a header line for the next release. 810 * debian/changelog.in: Add a changelog entry for 4.24-1. 811 * strace.spec.in: Likewise. 812 813 Prepare for 4.24 release. 814 * NEWS: Update for 4.24 release. 815 816 2018-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 817 818 Update copyright headers. 819 Headers updated automatically using maint/update_copyright_years.sh 820 script. 821 822 2018-08-12 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 823 824 Update ioctl entries from linux v4.18. 825 * linux/32/ioctls_inc_align16.h: Update from linux v4.18-rc8 826 using ioctls_gen.sh. 827 * linux/32/ioctls_inc_align32.h: Likewise. 828 * linux/32/ioctls_inc_align64.h: Likewise. 829 * linux/64/ioctls_inc.h: Likewise. 830 * linux/x32/ioctls_inc0.h: Likewise. 831 * linux/s390x/ioctls_arch0.h: Likewise. 832 * NEWS: Mention this. 833 834 maint: update for linux v4.18. 835 * maint/ioctls_sym.sh: Add workaround for linux/omap3isp.h file. 836 837 2018-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 838 839 Replace BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL. 840 Linux kernel commit v4.18-rc1~37^2~66 introduced FS_IOC_[GS]ETFSLABEL 841 ioctl constants as generalized copies of BTRFS_IOC_[GS]ET_FSLABEL. 842 843 * linux/32/ioctls_inc_align16.h: Replace BTRFS_IOC_[GS]ET_FSLABEL 844 with FS_IOC_[GS]ETFSLABEL. 845 * linux/32/ioctls_inc_align32.h: Likewise. 846 * linux/32/ioctls_inc_align64.h: Likewise. 847 * linux/64/ioctls_inc.h: Likewise. 848 * linux/x32/ioctls_inc0.h: Likewise. 849 * maint/ioctls_sym.sh: Remove BTRFS_IOC_[GS]ET_FSLABEL. 850 * tests/btrfs.c (FS_IOC_GETFSLABEL, FS_IOC_SETFSLABEL): Add fallback 851 definitions. 852 (btrfs_test_label_ioctls, btrfs_test_read_ioctls): Replace 853 BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL. 854 855 2018-08-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 856 857 open.c: use __O_TMPFILE. 858 As it is the flag kernel actually checks against, 859 and it is now guaranteed to have a fallback definition. 860 861 * open.c (STRACE_O_TMPFILE): Remove. 862 (decode_open): Use __O_TMPFILE instead of STRACE_O_TMPFILE. 863 864 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 865 866 xlat: regenerate sock_options.in. 867 * xlat/sock_options.in: Regenerate using maint/gen_xlat_defs.sh script. 868 * xlat/sock_options.sh: Remove. 869 870 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 871 872 xlat: add fallback definitions to open_mode_flags. 873 * xlat/open_mode_flags.in: Regenerate using maint/gen_xlat_defs.sh script 874 to provide fallback definitions. Implement a workaround for O_NDELAY. 875 876 Co-Authored-by: Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 877 878 2018-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 879 880 xlat: remove non-Linux flags from open_mode_flags. 881 * xlat/open_mode_flags.in (O_PRIV, FNDELAY, FAPPEND, FMARK, FDEFER, 882 FSHLOCK, FEXLOCK, FCREAT, FTRUNC, FEXCL, FNBIO, FSYNC, FNOCTTY, 883 O_SHLOCK, O_EXLOCK): Remove flags that are not present in Linux. 884 885 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 886 887 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 888 889 xlat: add fallback definitions to madvise_cmds. 890 * xlat/madvise_cmds.in: Regenerate using maint/gen_xlat_defs.sh script 891 to provide fallback definitions. 892 893 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 894 895 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 896 897 xlat: add fallback definitions to mmap_flags. 898 * xlat/mmap_flags.in: Regenerate using maint/gen_xlat_defs.sh script 899 to provide fallback definitions. Implement a workaround for MAP_RENAME. 900 901 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 902 903 2018-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 904 905 maint: add a Linux UAPI headers crawler. 906 This script is going to be used to generate xlat fallback values. 907 908 * maint/gen_xlat_defs.sh: New file. 909 910 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 911 912 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 913 914 strace.spec.in: use $RPM_OPT_FLAGS when building auxiliary programs. 915 * strace.spec.in: Set CFLAGS_FOR_BUILD to "$RPM_OPT_FLAGS" so that 916 $RPM_OPT_FLAGS is honored when building auxiliary programs like 917 ioctlsort. 918 919 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 920 921 strace.spec.in: compress changelog files. 922 Some say uncompressed changelog files are too big. 923 924 * strace.spec.in: Compress ChangeLog and ChangeLog-CVS using gzip -9n. 925 926 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 927 928 strace.spec.in: use a SUSE-specific group name for SUSE. 929 Since, apparently, it isn't quite happy with a simple group name 930 "Development/Debuggers". 931 932 * strace.spec.in (Group): Add %{?suse_version:/Tools}. 933 934 2018-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 935 936 strace.spec.in: use a SUSE-specific license name for SUSE. 937 Since, apparently, it isn't quite happy with a simple "BSD". 938 939 * strace.spec.in (License): Add %{?suse_version:-3-Clause}. 940 941 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 942 943 2018-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 944 945 tests: allow any error code when trying to set time. 946 Lower expectations of particular error code numbers when trying to set 947 time. This helps to workaround issues with unexpected return codes 948 in some exotic environments where EPERM is returned instead of EINVAL 949 (e.g. mock that uses systemd-nspawn). 950 951 * tests/clock_xettime.c (main): Do not hardcode EINVAL, print return 952 codes using sprintrc. 953 * tests/xettimeofday.c (main): Likewise. 954 * NEWS: Mention this fix. 955 956 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 957 958 2018-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 959 960 s390x: fix build with old kernel headers. 961 Avoid defining psw_compat_t and s390_compat_regs if their definitions 962 are provided by kernel. Before Linux commit v3.10-rc1~201^2~11, 963 these definition were available in <asm/ptrace.h>. 964 965 * configure.ac (AC_CHECK_TYPES): Check for s390_compat_regs. 966 * linux/s390x/arch_regs.c [HAVE_S390_COMPAT_REGS]: Do not define 967 psw_compat_t and s390_compat_regs. 968 * NEWS: Mention this fix. 969 970 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 971 972 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 973 974 strace.spec.in: minor updates here and there. 975 * strace.spec.in: Add descriptive comments to build requirements. 976 Introduce %maybe_use_defattr and use it instead of %defattr. 977 Add output of ld --version to the build environment information. 978 Use printf instead of echo -e. 979 980 2018-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 981 982 strace.spec.in: remove strace64 subpackage. 983 strace64 subpackage used to be installed into ppc32 and sparc32 984 userspace running by a 64-bit kernel to trace 64-bit processes. 985 986 As simultaneous decoding of processes running both in 64-bit and 32-bit 987 personality is fully supported on every architecture with compat kernel 988 support for quite some time, one can just install a 64-bit strace and 989 there is no more need for that strace64 kludge. 990 991 * strace.spec.in (strace64_arches, copy64, %ifarch %{strace64_arches}): 992 Remove. 993 994 2018-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 995 996 Update NEWS. 997 998 Update NEWS. 999 1000 rtnl_route: decode new RTA_* attributes. 1001 * rtnl_route.c (rtmsg_nla_decoders): Add entries for RTA_IP_PROTO, 1002 RTA_SPORT, and RTA_DPORT. 1003 1004 xlat: update RTA_* constants. 1005 * xlat/rtnl_route_attrs.in: Add RTA_IP_PROTO, RTA_SPORT, and RTA_DPORT 1006 * constants introduced by Linux kernel commit v4.18-rc1~114^2~165^2~2. 1007 1008 rtnl_link: decode new IFLA_BRPORT_* attributes. 1009 * rtnl_link.c (ifla_brport_nla_decoders): Add entries for 1010 IFLA_BRPORT_GROUP_FWD_MASK, IFLA_BRPORT_NEIGH_SUPPRESS, and 1011 IFLA_BRPORT_ISOLATED. 1012 1013 xlat: update IFLA_BRPORT_* constants. 1014 * xlat/rtnl_ifla_brport_attrs.in: Add IFLA_BRPORT_GROUP_FWD_MASK 1015 constant introduced by Linux kernel commit v4.15-rc1~84^2~607. 1016 Add IFLA_BRPORT_NEIGH_SUPPRESS constant introduced by Linux kernel 1017 commit v4.15-rc1~84^2~523^2~2. 1018 Add IFLA_BRPORT_ISOLATED constant introduced by Linux kernel commit 1019 v4.18-rc1~114^2~142. 1020 1021 xlat: update IFA_* constants. 1022 * xlat/rtnl_addr_attrs.in: Add IFA_RT_PRIORITY constant introduced 1023 by Linux kernel commit v4.18-rc1~114^2~108^2~3 1024 1025 xlat: update RTPROT_* constants. 1026 * xlat/routing_protocols.in: Add RTPROT_BGP, RTPROT_ISIS, RTPROT_OSPF, 1027 RTPROT_RIP, and RTPROT_EIGRP constants introduced by Linux kernel commit 1028 v4.18-rc1~114^2~90. 1029 1030 2018-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 1031 1032 xlat: save the script used to generate xlat/sock_options.in. 1033 * xlat/sock_options.sh: New file from commit message of commit v4.23~199. 1034 1035 2018-08-01 Zhibin Li <08826794brmt (a] gmail.com> 1036 1037 tests: check decoding of getsockopt(PACKET_STATISTICS) 1038 * tests/net-tpacket_stats.c: New file. 1039 * tests/net-tpacket_stats-success.c: Likewise. 1040 * tests/gen_tests.in (net-tpacket_stats): New test. 1041 * tests/net-tpacket_stats-success.test: Likewise. 1042 * tests/.gitignore: Add net-tpacket_stats and net-tpacket_stats-success. 1043 * tests/Makefile.am (check_PROGRAMS): Add net-tpacket_stats-success. 1044 (DECODER_TESTS): Add net-tpacket_stats-success.test. 1045 * tests/pure_executables.list: Add net-tpacket_stats. 1046 1047 tests: check decoding of setsockopt(PACKET_[R|T]X_RING) 1048 * tests/net-tpacket_req.c: New file. 1049 * tests/.gitignore: Add net-tpacket_req. 1050 * tests/pure_executables.list: Likewise. 1051 * tests/gen_tests.in (net-tpacket_req): New test. 1052 1053 tests: check decoding of setsockopt(PACKET_[ADD|DROP]_MEMBERSHIP) 1054 * tests/net-packet_mreq.c: New file. 1055 * tests/.gitignore: Add net-packet_mreq. 1056 * tests/pure_executables.list: Likewise. 1057 * tests/gen_tests.in (net-packet_mreq): New test. 1058 1059 2018-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 1060 1061 tests: bring lists back to the sorted order. 1062 * tests/.gitignore: Make the list sorted again. 1063 * tests/pure_executables.list: Likewise. 1064 * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS): 1065 Likewise. 1066 1067 2018-07-20 Zhibin Li <08826794brmt (a] gmail.com> 1068 1069 tests: check decoding of successful quotactl. 1070 * tests/quotactl-success.c: New file. 1071 * tests/quotactl-success-v.c: Likewise. 1072 * tests/quotactl-xfs-success.c: Likewise. 1073 * tests/quotactl-xfs-success-v.c: Likewise. 1074 * tests/quotactl-success.test: New test. 1075 * tests/quotactl-success-v.test: Likewise. 1076 * tests/quotactl-xfs-success.test: Likewise. 1077 * tests/quotactl-xfs-success-v.test: Likewise. 1078 * tests/.gitignore: Add quotactl-success, quotactl-success-v, 1079 quotactl-xfs-success and quotactl-xfs-success-v. 1080 * tests/Makefile.am (check_PROGRAMS): Likewise. 1081 (DECODER_TESTS): Add four new tests listed above. 1082 * tests/quotactl.h: [INJECT_RETVAL] (check_quota): Use errstr instead of 1083 sprintrc; check that returned value is equivalent to the injected one; 1084 append "(INJECTED)" string to errstr. 1085 * tests/quotactl.c: Changed condition rc != 0 to rc < 0 in callback 1086 functions and value of opaque pointer addr_cb_arg in order to check 1087 successful injection. 1088 * tests/quotactl-xfs.c: Likewise. 1089 1090 2018-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 1091 1092 net: enhance decoding of getsockopt(PACKET_STATISTICS) 1093 * net.c (print_tpacket_stats): Change decoder to match the kernel 1094 behaviour: getsockopt syscall accepts any non-negative *optlen and 1095 writes either MIN(sizeof(struct tpacket_stats), *optlen) or 1096 MIN(sizeof(struct tpacket_stats_v3), *optlen) bytes of data. 1097 1098 net: compile SO_PEERCRED/SO_ATTACH_FILTER/SO_ATTACH_REUSEPORT_CBPF code unconditionally 1099 * net.c: Remove checks for SO_PEERCRED, SO_ATTACH_FILTER, and 1100 SO_ATTACH_REUSEPORT_CBPF macros as they are defined unconditionally 1101 since commit v4.23~199. 1102 1103 net: enhance decoding of getsockopt(SO_PEERCRED) 1104 * net.c (print_ucred): Rename to print_get_ucred, change decoder 1105 to match the kernel behaviour: getsockopt syscall accepts any 1106 non-negative *optlen and writes MIN(sizeof(struct ucred), *optlen) 1107 bytes of data. 1108 (print_getsockopt): Replace print_ucred with print_get_ucred. 1109 * tests/so_percred.c: Include <string.h>. 1110 (main): Update expected output. 1111 1112 net: enhance decoding of getsockopt(SO_LINGER) 1113 * net.c (print_get_linger): Change decoder to match the kernel 1114 behaviour: getsockopt syscall accepts any non-negative *optlen 1115 and writes MIN(sizeof(struct linger), *optlen) bytes of data. 1116 (print_set_linger): Move after definition of SYS_FUNC(getsockopt). 1117 * tests/so_linger.c: Include <stddef.h> and <string.h>. 1118 (main): Update expected output. 1119 1120 net: generalize getsockopt length check. 1121 * net.c (print_getsockopt): Apply (ulen < 0 || rlen < 0) check for all 1122 cases. As the kernel neither accepts nor returns a negative length 1123 in case of successful getsockopt syscall invocation, these negative 1124 values must have been forged by userspace. 1125 1126 2018-07-15 Dmitry V. Levin <ldv (a] altlinux.org> 1127 1128 tests: fix build with fresh glibc. 1129 Workaround additional incompatibility between <sys/stat.h> and 1130 <asm/stat.h> introduced by glibc-2.27.9000-566-gfd70af4. 1131 1132 * tests/xstatx.c (statx, statx_timestamp): Redefine before the inclusion 1133 of <sys/stat.h> to avoid conflicts between definitions provided by the 1134 linux kernel headers and the GNU libc. 1135 1136 2018-07-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1137 1138 tests/quotactl.h: document check_quota. 1139 * tests/quotactl.h (check_quota): Add a comment describing the function 1140 usage. 1141 1142 2018-07-15 Zhibin Li <08826794brmt (a] gmail.com> 1143 1144 tests/quotactl-xfs.c: fix indentation. 1145 1146 2018-07-15 Zhibin Li <08826794brmt (a] gmail.com> 1147 1148 tests: use check_quota for invalid quotactl commands. 1149 Use check_quota function for invalid commands instead of manual quotactl 1150 syscall invocations. In this way successful injection can also be checked 1151 for these commands in the next commit. 1152 1153 * tests/quotactl.c (main): Add invalid_cmd_str and invalid_id_str local 1154 variables, remove unused variable rc, use check_quota instead of manual 1155 quotactl syscall invocations. 1156 * tests/quotaclt.c (main): Add invalid_cmd_str variable, remove unused 1157 variable rc, use check_quota instead of manual quotactl syscall invocations. 1158 1159 2018-07-15 Zhibin Li <08826794brmt (a] gmail.com> 1160 1161 tests: enhance test coverage of quotactl syscall parser. 1162 * tests/quotactl.c (print_dqfmt): New function. 1163 (main): Use print_dqfmt to print flags of quota format, improve existing 1164 tests and add more tests for Q_GETFMT. 1165 * tests/quotactl-xfs.c: Improve existing tests and add more tests for 1166 Q_XGETQSTAT and Q_XGETQSTATV. 1167 1168 tests/quotactl-xfs.c: fix typos in QCMD. 1169 * tests/quotactl-xfs.c (main): fix typos of sub-commands in QCMD. 1170 1171 Mpersify decoder of struct xfs_dqstats. 1172 * xfs_quota_stat.h: New file. 1173 * fetch_struct_xfs_quotastat.c: Likewise. 1174 * Makefile.am (strace_SOURCES): Add them. 1175 * quota.c: Include xfs_quota_stat.h 1176 (struct fs_qfilestat, struct xfs_dqstats): Moved to xfs_quota_stat.h. 1177 (decode_cmd_data) <case Q_XGETQSTAT>: Use fetch_struct_quotastat. 1178 1179 quota: fix disorder of PRINT_FIELD invocations. 1180 * quota.c (decode_cmd_data) <case Q_XGETQSTAT>: Print fields 1181 of struct xfs_dqstats in the structure order. 1182 1183 2018-07-12 Zhibin Li <08826794brmt (a] gmail.com> 1184 1185 tests: extend coverage for other fcntl flags. 1186 * tests/fcntl-common.c: Include <assert.h>. 1187 (struct fcntl_cmd_check): New structure. 1188 (print_retval_flags, test_other_set_cmd, test_other_get_cmd, 1189 print_flags_getfd, print_flags_getsig, print_flags_getlease, 1190 test_fcntl_others): New functions. 1191 (main): Use test_fcntl_others. 1192 1193 2018-07-11 Dmitry V. Levin <ldv (a] altlinux.org> 1194 1195 Implement -e kvm= option on all architectures. 1196 Make -e kvm= interface available on all architectures by adding a stub 1197 on those architectures that do not have <linux/kvm.h>. 1198 1199 * filter_qualify.c (qualify_kvm): Define unconditionally. 1200 (qual_options): Define qualify_kvm entry unconditionally. 1201 * strace.c (usage): Mention kvm argument of -e option unconditionally. 1202 1203 2018-07-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1204 1205 xlat: update bpf(2)-related constants. 1206 * xlat/bpf_attach_type.in (BPF_CGROUP_UDP4_SENDMSG, 1207 BPF_CGROUP_UDP6_SENDMSG): New constant, introduced by Linux commit 1208 v4.18-rc1~114^2~9^2~20^2~4. 1209 (BPF_LIRC_MODE2): New constant, introduced by Linux commit 1210 v4.18-rc1~114^2~9^2~15^2~1. 1211 * xlat/bpf_commands.in (BPF_BTF_LOAD): New constant, introduced by Linux 1212 commit v4.18-rc1~114^2~417^2~1^2~5. 1213 (BPF_BTF_GET_FD_BY_ID): New constant, introduced by Linux commit 1214 v4.18-rc1~114^2~223^2~21^2~4. 1215 (BPF_TASK_FD_QUERY): New constant, introduced by Linux commit 1216 v4.18-rc1~114^2~148^2~1^2~5. 1217 * xlat/bpf_map_types.in (BPF_MAP_TYPE_XSKMAP): New constant, introduced 1218 by Linux commit v4.18-rc1~114^2~304^2~4^2~8. 1219 (BPF_MAP_TYPE_SOCKHASH): New constant, introduced by Linux commit 1220 v4.18-rc1~114^2~223^2~5^2~2. 1221 * xlat/bpf_prog_types.in (BPF_PROG_TYPE_LWT_SEG6LOCAL): New constant, 1222 introduced by Linux commit v4.18-rc1~114^2~148^2~2^2~1. 1223 (BPF_PROG_TYPE_LIRC_MODE2): New constant, introduced by Linux commit 1224 v4.18-rc1~114^2~9^2~15^2~1. 1225 * tests/bpf.c: Update expected output. 1226 1227 2018-07-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1228 1229 Wire up io_pgetevents and rseq on hppa, microblaze, mips, powerpc, and s390 1230 * linux/hppa/syscallent.h ([350]): Wire up io_pgetevents syscall 1231 introduced by Linux commit v4.18-rc3~7^2~2. 1232 * linux/microblaze/syscallent.h ([399], [400]): Wire up io_pgetevents 1233 and rseq syscalls introduced by Linux commit v4.18-rc3~33^2~2. 1234 * linux/mips/syscallent-n32.h ([6331], [6332]): Wire up rseq and 1235 io_pgetevents syscalls introduced by Linux commits v4.18-rc2~11^2~2 1236 and v4.18-rc2~11^2, respectively. 1237 * linux/mips/syscallent-n64.h ([5327], [5328]): Likewise. 1238 * linux/mips/syscallent-o32.h ([4367], [4368]): Likewise. 1239 * linux/powerpc/syscallent.h ([388]): Wire up io_pgetevents syscall 1240 introduced by Linux commit v4.18-rc3~14^2~2. 1241 * linux/powerpc64/syscallent.h ([388]): Likewise. 1242 * linux/s390/syscallent.h ([382], [383]): Wire up io_pgetevents 1243 and rseq syscalls introduced by Linux commits v4.18-rc4~18^2~1 1244 and v4.18-rc4~18^2, respectively. 1245 * linux/s390x/syscallent.h([382], [383]): Likewise. 1246 1247 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1248 1249 2018-07-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1250 1251 maint: improve the tag message. 1252 * maint/gen-tag-message.sh: Align the wording of the changes section 1253 header with the one used in NEWS, add a reference to CREDITS in 1254 "Contributors" section. 1255 1256 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1257 1258 2018-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 1259 1260 Upgrade invalid -e kvm= argument to a fatal error. 1261 * filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of 1262 error_msg in case of invalid -e kvm= argument. 1263 * tests/options-syntax.test: Check it. 1264 1265 Mention -e inject option in "strace -h" output. 1266 * strace.c (usage): Mention inject argument of -e option. 1267 1268 2018-07-07 Masatake YAMATO <yamato (a] redhat.com> 1269 1270 tests: check decoding of vcpu auxstr. 1271 * tests/ioctl_kvm_run_common.c: Rename from ioctl_kvm_run.c. 1272 (run_kvm): Parametrize printing of KVM_RUN ioctl with print_KVM_RUN 1273 invocation. 1274 (main): Invoke optional KVM_NO_CPUID_CALLBACK macro when the old kernel 1275 behavior is detected. 1276 * tests/Makefile.am (EXTRA_DIST): Add ioctl_kvm_run_common.c. 1277 * tests/ioctl_kvm_run.c: New file, a wrapper around 1278 ioctl_kvm_run_common.c. 1279 * ioctl_kvm_run_auxstr_vcpu.c: Likewise. 1280 * tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu): New test. 1281 * tests/pure_executables.list: Add ioctl_kvm_run_auxstr_vcpu. 1282 * tests/.gitignore: Likewise. 1283 1284 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1285 1286 2018-07-07 Masatake YAMATO <yamato (a] redhat.com> 1287 1288 strace.1.in: document -e kvm=vcpu option. 1289 * strace.1.in (-e kvm=vcpu): Document new option. 1290 * NEWS: Mention -e kvm=vcpu option. 1291 1292 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1293 1294 2018-07-07 Masatake YAMATO <yamato (a] redhat.com> 1295 1296 kvm: attach the exit reason of vcpu as auxstr to KVM_RUN output. 1297 In KVM, a virtual machine implementation like Qemu can access a vcpu 1298 via ioctl. KVM_RUN is an ioctl command to enter vcpu. The command 1299 returns control for various reasons: needs of device emulation or 1300 consuming time slices are the typical ones. The vmi takes a different 1301 action for the reason. 1302 1303 We, strace users, want to know the reason to understand kvm. This 1304 change prints the reason as auxstr if "-e kvm=vcpu" option is given, 1305 and if strace runs on Linux 4.16.0 or higher, which includes commit 1306 e46b469278a59781f9b25ff608af84892963821b, "kvm: embed vcpu id to dentry 1307 of vcpu anon inode." 1308 1309 The way to get the reason is a bit complicated because the ioctl does 1310 not return it to the userspace directly. Instead, the vmi and kvm 1311 communicate via an area of the process virtual memory where the fd of 1312 vcpu is mmap'ed. strace must peek the area to know the reason. 1313 1314 The change does three things: (1) recording the area for the given vcpu 1315 when the target calls VCPU_CREATE to vcpu_info_list per tcb data field, 1316 (2) verifying the data recorded in vcpu_info_list before doing (3), and 1317 (3) decoding the exit reason field of the area. 1318 1319 The change is complicated because there is a case that strace 1320 does not have a chance to do (1) if -p option is used. 1321 In this case, vcpu_info data created in the step (2). 1322 1323 The area has more fields than "exit reason", 1324 dumping them may be implemented in the future. 1325 1326 * defs.h (struct tcb) [HAVE_LINUX_KVM_H]: Add vcpu_info_list field. 1327 [HAVE_LINUX_KVM_H]: (kvm_run_structure_decoder_init, 1328 kvm_vcpu_info_free): New declarations. 1329 * strace.c (usage): Add "kvm" as a new expression for -e option. 1330 (droptcb): Call kvm_vcpu_info_free. 1331 * filter_qualify.c (qualify_kvm): New function calling 1332 kvm_run_structure_decoder_init to enable for attaching the exit 1333 reason to auxstr. 1334 (qual_options): Add "kvm" as an entry. 1335 * xlat/kvm_exit_reason.in: New file. 1336 * kvm.c: Include xmalloc.h and mmap_cache.h. 1337 (dump_kvm_run_structure): New static variable. 1338 (kvm_run_structure_decoder_init): New function. 1339 (vcpu_info): New struct definition representing the 3-tuple: vcpu file 1340 descriptor, id of the vcpu, and mmap'ed entry. 1341 (vcpu_find, vcpu_alloc, vcpu_register, vcpu_getinfo, 1342 kvm_vcpu_info_free): New functions to access tcb's vcpu_info_list 1343 field and vcpu_info data type. 1344 (is_map_for_file, map_len): New helper functions. 1345 (kvm_ioclt_run_attach_auxstr, kvm_ioctl_decode_run): New functions 1346 decoding vcpu exit reason and attaching the decoded data to auxstr 1347 field of tcb. 1348 (kvm_ioctl_create_vcpu): Call vcpu_register to make an entry mapping 1349 a file descriptor and the vcpu id associated with the fd. 1350 (kvm_ioctl): Call kvm_ioctl_decode_run. 1351 1352 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1353 1354 2018-07-07 Masatake YAMATO <yamato (a] redhat.com> 1355 1356 mmap_cache: add customizable search function. 1357 * mmap_cache.c (mmap_cache_search_custom): New function. 1358 * mmap_cache.h (mmap_cache_search_fn): New type. 1359 (mmap_cache_search_custom): New function prototype. 1360 1361 2018-07-07 Pierre Marsais <pierre.marsais (a] lse.epita.fr> 1362 1363 tests: check verbose decoding of kvm ioctl. 1364 * tests/ioctl_kvm_run-v.c: New file. 1365 * tests/ioctl_kvm_run.c: Include xlat.h and xlat/kvm_cpuid_flags.h. 1366 (print_kvm_segment, print_kvm_sregs, print_kvm_regs): New functions. 1367 (run_kvm): Use them. 1368 (print_cpuid_ioctl) [VERBOSE]: Print verbose ioctl decoding. 1369 * tests/gen_tests.in (ioctl_kvm_run-v): New entry. 1370 * tests/pure_executables.list: Add ioctl_kvm_run-v. 1371 * tests/.gitignore: Likewise. 1372 1373 tests: check decoding of kvm ioctls related to struct kvm_cpuid2. 1374 * tests/ioctl_kvm_run.c [!HAVE_STRUCT_KVM_CPUID2]: Skip the test. 1375 (KVM_MAX_CPUID_ENTRIES): New macro. 1376 (print_cpuid_ioctl): New function. 1377 (main): Add tests for cpuid related ioctl. 1378 1379 2018-07-07 Pierre Marsais <pierre.marsais (a] lse.epita.fr> 1380 1381 kvm: decode the argument of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands 1382 * configure.ac (AC_CHECK_TYPES): Add struct kvm_cpuid2. 1383 * xlat/kvm_cpuid_flags.in: New file. 1384 * kvm.c [HAVE_STRUCT_KVM_CPUID2]: Include "xlat/kvm_cpuid_flags.h". 1385 [HAVE_STRUCT_KVM_CPUID2] (print_kvm_cpuid_entry, kvm_ioctl_decode_cpuid2): 1386 New functions. 1387 (kvm_ioctl) [HAVE_STRUCT_KVM_CPUID2]: Use kvm_ioctl_decode_cpuid2. 1388 * NEWS: Mention this improvement. 1389 1390 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1391 1392 2018-07-07 Zhibin Li <08826794brmt (a] gmail.com> 1393 1394 net: fix a typo in print_tpacket_stats. 1395 1396 2018-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 1397 1398 tests: fix race condition in aio.test. 1399 * tests/aio.c (main): Print aio_key fields before the io_submit syscall 1400 invocation to avoid races with the kernel. 1401 1402 2018-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 1403 1404 ci: robustify network-related operations. 1405 Reduce false positives by wrapping network-related operations into a loop. 1406 1407 * ci/install-dependencies.sh (retry_if_failed): New function. 1408 Use it to invoke apt-get update, apt-get install, git clone, 1409 add-apt-repository, and pip install. 1410 1411 2018-06-29 Zhibin Li <08826794brmt (a] gmail.com> 1412 1413 .gitignore: ignore linux/linux. 1414 Ignore directory linux/linux created by workaround from commit 1415 v4.23-11-g15003d4. 1416 1417 * .gitignore: Add /linux/linux. 1418 1419 2018-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 1420 1421 Fix build on systems where libc relies on <linux/signal.h> 1422 Commit v4.23~10 has broken the build with Android's libc because it 1423 relies on the UAPI headers (such as <linux/signal.h>) to define various 1424 types, rather than copying them into the libc headers (such as <signal.h>) 1425 like most other Linux C libraries. 1426 1427 * linux/linux/signal.h: Rename to linux/signal.h.in. 1428 * Makefile.am (strace_SOURCES): Remove linux/linux/signal.h. 1429 (EXTRA_DIST): Add linux/signal.h.in. 1430 (DISTCLEANFILES): Add linux/linux/signal.h. 1431 * configure.ac (AC_CACHE_CHECK): Check whether <linux/signal.h> 1432 can be used along with <signal.h>, install linux/linux/signal.h 1433 workaround if they cannot be used together. 1434 1435 Reported-by: Elliott Hughes <enh (a] google.com> 1436 Closes: https://github.com/strace/strace/issues/72 1437 1438 2018-06-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1439 1440 xlat: add AUDIT_INTEGRITY_EVM_XATTR to nl_audit_types. 1441 * xlat/nl_audit_types.in (AUDIT_INTEGRITY_EVM_XATTR): New constant, 1442 introduced by Linux commit v4.18-rc1~100^2~9. 1443 1444 xlat: add UDP_SEGMENT to sock_udp_options. 1445 * xlat/sock_udp_options.in (UDP_SEGMENT): New constant, introduced by 1446 Linux commit v4.18-rc1~114^2~377^2~8. 1447 1448 2018-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 1449 1450 Remove redundant range initializers in syscallent files. 1451 * linux/aarch64/syscallent.h: Remove redundant range initializers. 1452 * linux/x32/syscallent.h: Likewise. 1453 1454 2018-06-17 Chen Jingpiao <chenjingpiao (a] gmail.com> 1455 1456 x32: move rseq syscall entry to a suitable place. 1457 As rseq syscall is not x32-specific, move it after the previous one 1458 that is not x32-specific. Fix the unused syscall number range. 1459 1460 * linux/x32/syscallent.h ([334]): Move it after [333]. 1461 ([335 ... 511]): Update the range. 1462 1463 2018-06-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1464 1465 aio: make iocb array output more strucutred. 1466 * aio.c (print_iocb): Print curly brackets. 1467 (print_iocbp): Do not print curly brackets. 1468 * tests/aio.c: Update expected output. 1469 1470 aio: print IOCB_CMD_* using xlat. 1471 * xlat/aio_cmds.in: New file. 1472 * aio.c (tprint_lio_opcode): Change array of structs "cmds" to array of 1473 enums "subs", use printxval_indexn_ex for printing cmd, return sub type 1474 using subs array. 1475 1476 xlat/sock_tcp_options.in: add #value_indexed. 1477 * xlat/sock_tcp_options.in: Add #value_indexed, provide fallback 1478 definitions. 1479 * net.c (print_sockopt_fd_level_name) <case SOL_TCP>: Use 1480 printxval_index instead of printxval. 1481 1482 xlat/sock_tcp_options.in: update. 1483 * xlat/sock_tcp_options.in (TCP_ZEROCOPY_RECEIVE): New constant, 1484 introduced by Linux commit v4.18-rc1~114^2~351^2~1. 1485 (TCP_INQ): New constant, introduced by Linux commit v4.18-rc1~114^2~330. 1486 1487 xlat/sigtrap_codes.in: add TRAP_UNK. 1488 * xlat/sigtrap_codes.in (TRAP_UNK): New constant, introduced by Linux 1489 commit v4.17-rc1-15-gdb78e6a. 1490 1491 2018-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 1492 1493 Post-release administrivia. 1494 * NEWS: Add a header line for the next release. 1495 * debian/changelog.in: Add a changelog entry for 4.23-1. 1496 * strace.spec.in: Likewise. 1497 1498 2018-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 1499 1500 Prepare for 4.23 release. 1501 * NEWS: Update for 4.23 release. 1502 1503 Update copyright headers. 1504 Headers updated automatically using maint/update_copyright_years.sh 1505 script. 1506 1507 tests: add missing copyright headers. 1508 * tests/prctl-spec-inject.test: Add copyright header. 1509 * tests/qualify_personality.sh: Likewise. 1510 1511 maint: document release procedure. 1512 * maint/README-release: New file. 1513 * maint/gen-release-notes.sh: Likewise. 1514 * maint/gen-release-github.sh: Likewise. 1515 * maint/gen-release-gitlab.sh: Likewise. 1516 1517 maint: prepend contributor names in tag messages with an asterisk. 1518 * maint/gen-tag-message.sh: Prepend every line of 1519 gen-contributors-list.sh output with an asterisk. 1520 1521 2018-06-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1522 1523 Update NEWS. 1524 1525 2018-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 1526 1527 Wire up rseq syscall. 1528 This new syscall was introduced by Linux commit v4.17-1308-gd7822b1. 1529 1530 * linux/dummy.h (sys_rseq): New macro. 1531 * linux/arm/syscallent.h (398): Add rseq entry. 1532 * linux/i386/syscallent.h (386): Likewise. 1533 * linux/powerpc/syscallent.h (387): Likewise. 1534 * linux/powerpc64/syscallent.h (387): Likewise. 1535 * linux/x32/syscallent.h (334): Likewise. 1536 * linux/x86_64/syscallent.h (334): Likewise. 1537 1538 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1539 1540 tests: check decoding of io_pgetevents syscall. 1541 * configure.ac (AC_CHECK_TYPES): Check for struct __aio_sigset 1542 in <linux/aio_abi.h>. 1543 * tests/aio_pgetevents.c: New file. 1544 * tests/.gitignore: Add aio_pgetevents. 1545 * tests/pure_executables.list: Likewise. 1546 * tests/gen_tests.in (aio_pgetevents): New test. 1547 1548 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1549 1550 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1551 1552 Implement io_pgetevents syscall decoding. 1553 Introduced by Linux commit v4.17-rc3-7-g7a074e9. 1554 1555 * print_aio_sigset.c: New file. 1556 * Makefile.am (strace_SOURCES): Add it. 1557 * aio.c (print_io_getevents): Rename from SYS_FUNC(io_getevents), add 1558 has_usig flag, print user sigset on exiting if has_usig is set to true. 1559 (SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): New functions, 1560 wrappers for print_io_getevents. 1561 * linux/32/syscallent.h ([292]): Wire up io_pgetevents. 1562 * linux/64/syscallent.h ([292]): Likewise. 1563 * linux/i386/syscallent.h ([385]): Likewise. 1564 * linux/x32/syscallent.h ([333]): Likewise. 1565 * linux/x86_64/syscallent.h ([333]): Likewise. 1566 * NEWS: Mention this improvement. 1567 1568 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1569 1570 2018-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 1571 1572 travis: re-enable testing with the latest mainline kernel headers. 1573 As <linux/signal.h> is out of the game now, the Linux commit 1574 v4.17-rc3-7-g7a074e9 should not cause harm anymore, so let's enable 1575 testing with the latest mainline kernel headers again. 1576 1577 * .travis.yml (matrix): Do not specify KBRANCH for KHEADERS=torvalds/linux. 1578 1579 2018-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 1580 1581 Workaround incompatibility between <linux/signal.h> and libc headers. 1582 Override <linux/signal.h> with <signal.h> so that those few linux 1583 headers that include <linux/signal.h> could be included along with libc 1584 headers. 1585 1586 * linux/linux/signal.h: New file. 1587 * Makefile.am (strace_SOURCES): Add it. 1588 1589 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1590 1591 tests: add personality specification syntax checks. 1592 * tests/options-syntax.test: Add personality specification syntax 1593 checks. 1594 1595 tests: add basic checks for personality designation support. 1596 * tests/qualify_personality.sh: New file. 1597 * tests/qualify_personality_empty.in: Likewise. 1598 * tests/trace_personality_32.in: Likewise. 1599 * tests/trace_personality_64.in: Likewise. 1600 * tests/trace_personality_regex_32.in: Likewise. 1601 * tests/trace_personality_regex_64.in: Likewise. 1602 * tests/trace_personality_regex_x32.in: Likewise. 1603 * tests/trace_personality_x32.in: Likewise. 1604 * tests/Makefile.am (EXTRA_DIST): Add them. 1605 * tests/gen_tests.in (trace_personality_32, trace_personality_64, 1606 trace_personality_x32, trace_personality_regex_32, 1607 trace_personality_regex_64, trace_personality_regex_x32): New tests. 1608 1609 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1610 1611 Add support for personality designation in regex qualifications. 1612 * basic_filters.c (qualify_syscall_regex): Copy syscall name 1613 to a temporary buffer, append the personality designation to it, 1614 and check it against regular expression if the syscall name 1615 hasn't been matched already. 1616 1617 References: https://github.com/strace/strace/issues/35 1618 1619 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1620 1621 Add support for personality designation in syscall qualifications. 1622 * syscall.c (personality_designators): New array. 1623 * defs.h (personality_designators): New declaration. 1624 * basic_filters.c (qualify_syscall_separate_personality, 1625 qualify_syscall_number_personality): New functions. 1626 (qualify_syscall_number): Use qualify_syscall_separate_personality for 1627 checking for a personality specification, call 1628 qualify_syscall_number_personality for setting number set for specific 1629 personality. 1630 (qualify_syscall_name_personality): New function. 1631 (qualify_syscall_name): Use qualify_syscall_separate_personality for 1632 checking for a personality specification, call 1633 qualify_syscall_name_personality for setting number set for specific 1634 personality. 1635 * strace.1.in (.SS Filtering): Document it. 1636 * NEWS: Mention it. 1637 1638 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1639 Closes: https://github.com/strace/strace/issues/35 1640 1641 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1642 1643 tests: add basic checks for inject=SET:syscall= expression syntax. 1644 * tests/qual_fault-syscall.test: New test. 1645 * tests/qual_inject-error-signal-syscall.test: Likewise. 1646 * tests/qual_inject-retval-syscall.test: Likewise. 1647 * tests/qual_inject-signal-syscall.test: Likewise. 1648 * tests/Makefile.am (MISC_TESTS): Add them. 1649 * tests/qual_fault-syntax.test: Add checks for inject=SET:syscall= 1650 expression syntax. 1651 * tests/qual_inject-syntax.test: Likewise. 1652 * tests/qual_fault.test: Append $suffix to -e fault arguments, override 1653 $NAME with $name_override if the latter is set. 1654 * tests/qual_inject-error-signal.test: Append $suffix to -e inject 1655 arguments, override $NAME with $name_override if the latter is set. 1656 * tests/qual_inject-retval.test: Likewise. 1657 * tests/qual_inject-signal.test: Likewise. 1658 1659 2018-06-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1660 1661 Implement injection of syscalls with no side effects as an alternative to -1 1662 * defs.h (INJECT_F_SYSCALL, INJECT_ACTION_FLAGS, TCB_TAMPERED_NO_FAIL, 1663 syscall_tampered_nofail): New macros. 1664 (inject_data): Add scno field. 1665 * filter_qualify.c (struct inject_personality_data): New type. 1666 (parse_inject_token): Add "pdata" argument, parse "syscall=" option. 1667 (parse_inject_expression): Add "pdata" argument, forward it to 1668 parse_inject_token. 1669 (qualify_inject_common) <pdata>: New variable array, pass it to 1670 parse_inject_expression, copy it into inject_vec. 1671 * syscall.c (tamper_with_syscall_entering): Inject the specified syscall 1672 if INJECT_F_SYSCALL is set. 1673 (tamper_with_syscall_exiting): Update the check for a failed syscall 1674 injection. 1675 (get_syscall_result): Update get_error invocation. 1676 * strace.1.in: Document new syscall injection expression. 1677 * NEWS: Mention it. 1678 1679 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1680 Closes: https://github.com/strace/strace/issues/26 1681 1682 2018-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 1683 1684 ia64: remove legacy i386 entries from the syscall entry table. 1685 Remove the last piece of IA-32 mode support. Besides being obsolete, 1686 these bogus syscall entries cause problems with syscall name resolution. 1687 1688 * linux/ia64/syscallent.h [CST > 0]: Remove. 1689 1690 Complements: v4.21~17 "linux/ia64: remove IA-32 mode support" 1691 1692 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1693 1694 linux: set error flags in arch_set_error on POWER and Alpha. 1695 * alpha/set_error.c (arch_set_error): Set alpha_r3 to 1, update tracee's 1696 REG_A3. 1697 * powerpc/set_error.c (arch_set_error): Set bit 28 in CCR register, 1698 update tracee's PT_CCR. 1699 1700 Fixes: v4.15~126 "Implement arch specific methods of changing syscall number and error code" 1701 1702 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1703 1704 tests: check decoding of IFLA_LINKINFO netlink attribute. 1705 * tests/nlattr_ifla_linkinfo.c: New file. 1706 * tests/pure_executables.list: Add nlattr_ifla_linkinfo. 1707 * tests/.gitignore: Likewise. 1708 * tests/gen_tests.in (nlattr_ifla_linkinfo): New test. 1709 1710 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1711 1712 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1713 1714 tests: add print_quoted_stringn to print string with a size limit. 1715 This is similar to print_quoted_cstring, but not quite the same. 1716 1717 * tests/print_quoted_string.c (print_quoted_stringn): New function. 1718 * tests/tests.h (print_quoted_stringn): New declaration. 1719 1720 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1721 1722 tests: add fallback_func argument to TEST_NESTED_NLATTR_OBJECT_EX_ 1723 * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_): Add fallback_func 1724 argument, call it instead of print_quoted_hex. 1725 (TEST_NESTED_NLATTR_OBJECT_EX, TEST_NESTED_NLATTR_OBJECT): Specify 1726 print_quoted_hex as a fallback_func. 1727 * tests/nlattr_ifla_af_spec.c: Specify print_quoted_hex as 1728 a fallback_func in TEST_NESTED_NLATTR_OBJECT_EX_ calls. 1729 1730 tests/test_nlattr.h: add ability to provide additional nlattr payload. 1731 * tests/test_nlattr.h (print_nlattr): Add add_data argument, print 1732 opening square bracket if add_data is set to true. 1733 (TEST_NLATTR_EX_): Rename from TEST_NLATTR_, add nla_total_len_ 1734 argument, use it for msg_len calculation, print square brackets 1735 if nla_total_len_ is greater than nla_data_len_. 1736 (TEST_NLATTR_): New macro, a wrapper for TEST_NLATTR_EX_. 1737 1738 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1739 1740 rtnl_link: decode struct ifla_bridge_id unconditionally. 1741 Since it is relatively simple. 1742 1743 * rtnl_link.c (decode_ifla_bridge_id): Provide struct definition for 1744 the id variable. 1745 [!HAVE_STRUCT_IFLA_BRIDGE_ID] (decode_ifla_bridge_id): Decode struct 1746 ifla_bridge_id. 1747 1748 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1749 1750 nlattr: specify size for ethernet protocol. 1751 Otherwise it tries to decode payload of size 1, which makes little 1752 sense. 1753 1754 * nlattr.c (decode_nla_ether_proto) <opts>: Specify size field. 1755 1756 Fixes: v4.22-321-gfd0cd65 "nlattr: add ethernet protocol decoder" 1757 1758 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1759 1760 rtnl_link: use ARRSZ_PAIR where appropriate. 1761 It reduces code duplication somewhat and allows avoiding errors like 1762 the one fixed in the previous commit. 1763 1764 * rtnl_link.c (decode_ifla_protinfo, decode_nla_linkinfo_data_bridge, 1765 decode_nla_linkinfo_data_tun, decode_ifla_linkinfo, decode_ifla_port, 1766 decode_ifla_vf_ports, decode_ifla_xdp, 1767 DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use ARRSZ_PAIR in 1768 decode_nlattr call arguments. 1769 1770 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1771 1772 rtnl_link: fix incorrect variable names in ARRAY_SIZE arguments. 1773 * rtnl_link.c (decode_nla_linkinfo_data_bridge): Change 1774 rtnl_ifla_info_data_bridge_attrs to ifla_info_data_bridge_nla_decoders 1775 in ARRAY_SIZE call. 1776 (decode_nla_linkinfo_data_tun): Change rtnl_ifla_info_data_tun_attrs 1777 to ifla_info_data_tun_nla_decoders in ARRAY_SIZE call. 1778 1779 Fixes: v4.22-328-g1e6d5a8 "rtnl_link: implement IFLA_INFO_DATA for bridges" 1780 Fixes: v4.22-329-g4eab3a4 "rtnl_link: implement IFLA_INFO_DATA for tun devices" 1781 1782 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1783 1784 mips: add missing pure flag to syscall entries. 1785 * linux/mips/syscallent-n32.h ([6038], [6100], [6102], [6105], [6106], 1786 [6108], [6109], [6178]): Add pure flag to getpid, getuid, getgid, geteuid, 1787 getegid, getpgid, getpgrp, and gttid syscall descriptors. 1788 * linux/mips/syscallent-n64.h ([5038], [5100], [5102], [5105], [5106], 1789 [5108], [5109], [5178]): Likewise. 1790 * linux/mips/syscallent-o32.h ([4020], [4024], [4047], [4049], [4050], 1791 [4064], [4065], [4222]): Likewise. 1792 1793 Complements: v4.21~29 "Add pure syscall flag" 1794 1795 2018-06-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1796 1797 mips: add missing "never fails" flag to getpgrp syscall entries. 1798 * linux/mips/syscallent-n32.h ([6109]): Add NF flag. 1799 * linux/mips/syscallent-n64.h ([5109]): Likewise. 1800 * linux/mips/syscallent-o32.h ([4065]): Likewise. 1801 1802 Complements: v4.21~46 "Add SYSCALL_NEVER_FAILS flag to getpgrp" 1803 1804 2018-06-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1805 1806 Update NEWS. 1807 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1808 1809 xlat: describe IPV4_DEVCONF_* weirdness. 1810 * xlat/inet_devconf_indices.in: Add a comment about fallback definitions. 1811 1812 2018-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 1813 1814 configure.ac: fix the check for struct tc_sizespec on old kernel headers 1815 * configure.ac (AC_CHECK_TYPES): Include <linux/types.h> before 1816 <linux/pkt_sched.h> to check for struct tc_sizespec on linux kernel 1817 headers without v2.6.29-rc4~77^2~26 fix. 1818 1819 2018-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 1820 1821 travis: use kernel headers from v4.17. 1822 There is too much noise when using unreleased kernel uapi. 1823 1824 * ci/install-dependencies.sh (clone_repo): Add optional "branch" 1825 argument, pass it to "git clone". 1826 ($KHEADERS): Pass $KBRANCH as branch argument of clone_repo. 1827 * .travis.yml (matrix): Specify KBRANCH=v4.17 for 1828 KHEADERS=torvalds/linux. 1829 1830 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1831 1832 tests: check decoding of IFLA_AF_SPEC netlink attribute. 1833 * configure.ac (AC_CHECK_TYPES): Check for struct ifla_cacheinfo in 1834 <linux/rtnetlink.h> 1835 (AC_CHECK_DECLS): Check for IFLA_AF_SPEC in <linux/rtnetlink.h>. 1836 * tests/nlattr_ifla_af_spec.c: New file. 1837 * tests/pure_executables.list: Add nlattr_ifla_af_spec. 1838 * tests/.gitignore: Likewise. 1839 * tests/gen_tests.in (nlattr_ifla_af_spec): New test. 1840 1841 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1842 1843 tests: add TEST_NESTED_NLATTR_ARRAY_EX to test_nlattr.h. 1844 An ability to specify custom depth is going to be needed later to check 1845 IFLA_AF_SPEC decoding. 1846 1847 * configure.ac (AC_CHECK_DECLS): Check for TCA_STAB_DATA in 1848 <linux/pkt_sched.h>. 1849 * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY_EX): Rename from 1850 TEST_NESTED_NLATTR_ARRAY, add depth_ argument, perform padding and 1851 output accordingly. 1852 (TEST_NESTED_NLATTR_ARRAY): New macro, a thin wrapper around 1853 TEST_NESTED_NLATTR_ARRAY_EX. 1854 * tests/nlattr_tca_stab.c [!HAVE_DECL_TCA_STAB_DATA] (TCA_STAB_DATA): 1855 New enumeration declaration. 1856 1857 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1858 1859 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1860 1861 tests: pass index to print_elem_ callback in TEST_NLATTR_NESTED_ARRAY. 1862 * tests/test_nlattr.h (TEST_NLATTR_NESTED_ARRAY): Pass array index 1863 to the print_elem_ callback. 1864 * tests/nlattr_tca_stab.c (print_uint16): Add index argument. 1865 1866 tests: move common ifinfomsg boilerplate into a separate header. 1867 * configure.ac (AC_CHECK_DECLS): Check for IFLA_PORT_SELF, IFLA_PROTINFO, and 1868 IFLA_XDP in <linux/rtnetlink.h>. 1869 * tests/nlattr_ifla.h: New file. 1870 * tests/Makefile.am (EXTRA_DIST): Add it. 1871 * tests/nlattr_ifla_brport.c [!HAVE_DECL_IFLA_PROTINFO] (IFLA_PROTINFO): 1872 New declaration. 1873 (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. 1874 (IFLA_ATTR): Define to IFLA_PROTINFO. 1875 Include nlattr_ifla.h. 1876 * tests/nlattr_ifla_port.c [!HAVE_DECL_IFLA_PORT_SELF] (IFLA_PORT_SELF): 1877 New declaration. 1878 (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. 1879 (IFLA_ATTR): Define to IFLA_PORT_SELF. 1880 Include nlattr_ifla.h. 1881 * tests/nlattr_ifla_xdp.c 1882 * tests/nlattr_ifla_xdp.c [!HAVE_DECL_IFLA_XDP] (IFLA_XDP): New 1883 declaration. 1884 (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. 1885 (IFLA_ATTR): Define to IFLA_XDP. 1886 Include nlattr_ifla.h. 1887 1888 rtnl_link: implement IFLA_INFO_DATA for tun devices. 1889 * xlat/rtnl_ifla_info_data_tun_attrs.in: New file. 1890 * xlat/tun_device_types.in: Likewise. 1891 * rtnl_link.c: Include xlat/rtnl_ifla_info_data_tun_attrs.h and 1892 xlat/tun_device_types.h. 1893 (decode_nla_tun_type, decode_nla_linkinfo_data_tun): New functions. 1894 (ifla_info_data_tun_nla_decoders): New decoder dispatcher table. 1895 (decode_nla_linkinfo_data): Use decode_nla_linkinfo_data_tun if kind 1896 is 1897 "tun". 1898 1899 rtnl_link: implement IFLA_INFO_DATA for bridges. 1900 * xlat/rtnl_ifla_info_data_bridge_attrs.in: New file. 1901 * rtnl_link.c: Include xlat/rtnl_ifla_info_data_bridge_attrs.h. 1902 (ifla_info_data_bridge_nla_decoders): New decoder dispatcher table. 1903 (decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data): New 1904 functions. 1905 (ifla_linkinfo_nla_decoders) <IFLA_INFO_DATA>: Use 1906 decode_nla_linkinfo_data as a decoder. 1907 1908 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1909 1910 rtnl_link: implement IFLA_INFO_XSTATS decoding. 1911 So far, only CAN provides it. 1912 1913 * rtnl_link.c (decode_nla_linkinfo_xstats_can, 1914 decode_nla_linkinfo_xstats): New function. 1915 (ifla_linkinfo_nla_decoders) <IFLA_INFO_XSTATS>: Use 1916 decode_nla_linkinfo_xstats as a decoder. 1917 1918 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1919 1920 rtnl_link: add basic IFLA_INFO_* handling. 1921 Dispatch for IFLA_INFO_* attributes should be performed based on the 1922 string provided in a IFLA_INFO_KIND attribute. 1923 1924 * nlattr.h (struct ifla_linkinfo_ctx): New type definition. 1925 * rtnl_link.c (decode_nla_linkinfo_kind): New function. 1926 (ifla_linkinfo_nla_decoders) <IFLA_INFO_KIND>: Use 1927 decode_nla_linkinfo_kind as decoder. 1928 (decode_ifla_linkinfo): Add struct ifla_linkinfo_ctx context, pass it to 1929 the decode_nlattr call as opaque data. 1930 1931 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1932 1933 rtnl_link: decode IFLA_AF_SPEC. 1934 * xlat/in6_addr_gen_mode.in: New file. 1935 * xlat/inet6_devconf_indices.in: Likewise. 1936 * xlat/inet6_if_flags.in: Likewise. 1937 * xlat/inet_devconf_indices.in: Likewise. 1938 * xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise. 1939 * xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise. 1940 * xlat/snmp_icmp6_stats.in: Likewise. 1941 * xlat/snmp_ip_stats.in: Likewise. 1942 * rtnl_link.c: Include netinet/in.h, xlat/in6_addr_gen_mode.h, 1943 xlat/inet_devconf_indices.h, xlat/inet6_devconf_indices.h, 1944 xlat/inet6_if_flags.h, xlat/rtnl_ifla_af_spec_inet_attrs.h, 1945 xlat/rtnl_ifla_af_spec_inet6_attrs.h, xlat/snmp_icmp6_stats.h, 1946 and xlat/snmp_ip_stats.h. 1947 (decode_ifla_inet_conf, decode_ifla_inet6_flags, 1948 decode_ifla_inet6_conf, decode_ifla_inet6_stats, 1949 decode_ifla_inet6_cacheinfo, decode_ifla_inet6_icmp6_stats, 1950 decode_ifla_inet6_token, decode_ifla_inet6_agm, decode_ifla_af, 1951 decode_ifla_af_spec): New functions. 1952 (ifla_inet_nla_decoders, ifla_inet6_nla_decoders, 1953 nla_decoder_table_desc): New static constant variables. 1954 (ifinfomsg_nla_decoders) <[IFLA_AF_SPEC]>: Change value from NULL to 1955 decode_ifla_af_spec. 1956 1957 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1958 1959 nlattr: add size check to decode_nla_xval and decode_nla_flags. 1960 If the field size is known, do not print as valid numbers those 1961 attributes that are too short, and ignore extra data. 1962 1963 This change puts xval/flags printing in line with the reset of attribute 1964 decoders. 1965 1966 * nlattr.h (struct decode_nla_xlat_opts): Add size field. 1967 * nlattr.c (decode_nla_xval, decode_nla_flags): Check that len is at 1968 least opts->size, limit len to opts->size. 1969 (decode_nla_ip_proto): Specify size of 1. 1970 1971 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 1972 1973 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1974 1975 nlattr: add UID/GID netlink attribute decoders. 1976 * nlattr.h (DECL_NLA(uid), DECL_NLA(gid)): New declarations. 1977 * nlattr.c (decode_nla_uid, decode_nla_gid): New functions. 1978 1979 nlattr: add unsigned int decoders that print in hex form. 1980 * nlattr.h (DECL_NLA(x8), DECL_NLA(x16), DECL_NLA(x32), DECL_NLA(x64)): 1981 New declarations. 1982 * nlattr.c (DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8), 1983 DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16), 1984 DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32), 1985 DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64)): New decoders. 1986 1987 nlattr: add ethernet protocol decoder. 1988 * nlattr.h (DECL_NLA(ether_proto)): New declaration. 1989 * nlattr.c (process_host_order, decode_nla_ether_proto): New functions. 1990 1991 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 1992 1993 nlattr: add value processing support for xlat/flags nlattr decoders. 1994 Needed for upcoming decoder of ethernet proto which is stored in the 1995 host order and has to be converted to the network order before printing 1996 as an xval constant. This change also adds ability to provide 1997 prefix/suffix in order to enclose the printed value in something that 1998 describes the performed conversion. 1999 2000 * nlattr.h (struct decode_nla_xlat_opts): Add prefix, suffix, and 2001 process_fn fields. 2002 * nlattr.c (decode_nla_xval, decode_nla_flags): Handle process_fn, 2003 prefix, snd uffix parameters. 2004 2005 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2006 2007 nlattr: introduce decode_nla_flags. 2008 Similar to decode_nla_xval. 2009 2010 * nlattr.c (decode_nla_flags): New function. 2011 * nlattr.h: (DECL_NLA(flags)): New declaration. 2012 2013 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2014 2015 nlattr: add ability to pass nla_type to decoder in decode_nlattr. 2016 As of now, it's impossible to introduce a dispatching nlattr decoder 2017 that performs actions based on the type of the message, so let's use 2018 a combination of zero decoder list size and non-zero decoder pointer 2019 for this. 2020 2021 This is going to be used later in IFLA_AF_SPEC decoding. 2022 2023 * nlattr.c (decode_nlattr_with_data): Handle zero size and non-NULL 2024 decoders in a special way. 2025 (decode_nlattr): Add an error message about ignoring of opaque_data 2026 argument when zero size and non-NULL decoders are provided. 2027 * nlattr.h (decode_nlattr): Add a comment about the new special case. 2028 2029 2018-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 2030 2031 tests: use STRINGIFY instead of _STR. 2032 Remove _STR which is essentially the same as STRINGIFY but from 2033 the namespace where we should not introduce new identifiers. 2034 2035 * tests/tests.h (_STR): Remove. 2036 * tests/add_key.c (main): Replace _STR with STRINGIFY. 2037 * tests/keyctl.c (XARG_STR): Likewise. 2038 * tests/request_key.c (main): Likewise. 2039 2040 2018-06-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2041 2042 tests: check decoding of IFLA_EVENT netlink attribute. 2043 * tests/nlattr_ifinfomsg.c (main): Add a check for IFLA_EVENT attribute 2044 decoding. 2045 2046 2018-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 2047 2048 xlat: handle xlat constants that are not identifiers. 2049 Extend xlat generator to support such input lines as 2050 IPV4_DEVCONF_FORWARDING-1 0 2051 2052 This is going to be used later in IFLA_AF_SPEC decoding. 2053 2054 * xlat/gen.sh (cond_def): If the xlat value is not an identifier name, 2055 extract an identifier name from the beginning of xlat value. 2056 2057 2018-06-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2058 2059 xlat.c: handle NULL xlat in lookup routines as incremental search. 2060 This is going to be used later in IFLA_AF_SPEC decoding. 2061 2062 * xlat.c (xlookup): Add static variable pos, store xlat there when it is 2063 non-NULL, use pos for lookup. 2064 (xlat_search, xlat_idx): Add static variables pos and memb_left, store 2065 xlat and nmemb there when xlat is non-NULL, use them for lookup. 2066 (printxvals_ex): Store the last non-NULL xlat in static variable "last". 2067 If the first xlat argument is NULL, use "last" instead. 2068 2069 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2070 2071 2018-06-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2072 2073 xlat.c: cleanup printxvals_ex a bit. 2074 * xlat.c (printxvals_ex): Change "str" variable visibility to the whole 2075 function, jump to va_end instead of duplicating call and return, return 2076 !!str. 2077 2078 Leverage the fact that inet_protocols xlat is sorted. 2079 * defs.h (inet_protocols): Move up, add description. 2080 (inet_protocols_size): New declaration. 2081 * net.c (inet_protocols_size): New constant variable. 2082 * nlattr.c (decode_nla_ip_proto): Specify xlat_size, set xt to XT_SORTED. 2083 2084 2018-06-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2085 2086 Print arp_hardware_types as a sorted xlat. 2087 * rtnl_link.c (DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use 2088 PRINT_FIELD_XVAL_SORTED_SIZED instead of PRINT_FIELD_XVAL for 2089 arp_hardware_types. 2090 * sock.c (print_ifreq): Likewise. 2091 2092 Provide a value for arp_hardware_types_size array. 2093 * defs.h (arp_hardware_types_size): New declaration. 2094 * sockaddr.c (arp_hardware_types_size): New variable. 2095 2096 2018-06-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2097 2098 print_fields.h: introduce PRINT_FIELD_XVAL_SORTED_SIZED. 2099 For those cases when array definition is not readily available 2100 and should be provided separately. 2101 2102 * print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED): New macro. 2103 2104 2018-06-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2105 2106 tests/opipe.test: remove unneeded run_prog call. 2107 There is no need to invoke grep using run_prog. 2108 2109 * tests/opipe.test: Remove run_prog decoration for the grep invocation. 2110 2111 2018-06-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2112 2113 tests: check BPF_OBJ_GET_INFO_BY_FD decoding. 2114 * tests/bpf-obj_get_info_by_fd-prog-v.c: New file. 2115 * tests/bpf-obj_get_info_by_fd-prog.c: Likewise. 2116 * tests/bpf-obj_get_info_by_fd-v.c: Likewise. 2117 * tests/bpf-obj_get_info_by_fd.c: Likewise. 2118 * configure.ac (AC_CHECK_HEADERS): Check for struct bpf_insn, 2119 struct bpf_map_info, and struct bpf_prog_info. 2120 * tests/pure_executables.list: Add bpf-obj_get_info_by_fd, 2121 bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, and 2122 bpf-obj_get_info_by_fd-prog-v. 2123 * tests/.gitignore: Likewise. 2124 * tests/gen_tests.in (bpf-obj_get_info_by_fd, 2125 bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, 2126 bpf-obj_get_info_by_fd-prog-v): New tests. 2127 2128 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2129 2130 2018-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 2131 2132 bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder further. 2133 * bpf.c (print_ebpf_prog): Remove "decode" argument, all users updated. 2134 (print_bpf_prog_info): Use the minimum of xlated_prog_len values on 2135 entering and exiting syscall as the size of xlated_prog_insns array 2136 to be decoded. Likewise, use the minimum of nr_map_ids values on entering 2137 and exiting syscall as the size of map_ids array to be decoded. 2138 2139 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2140 2141 bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder. 2142 * bpf.c (print_bpf_map_info): Print only those fields that are 2143 present in the structure, as it has been growing over time. 2144 (print_bpf_prog_info): Likewise. Print map_ids field as an array 2145 of uint32_t instead of uint64_t; print "name" field. 2146 2147 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2148 2149 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2150 2151 bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder. 2152 As it is needed for proper info_len printing on exiting. 2153 2154 * bpf.c (print_bpf_obj_info_fn): Change return type to void, add "saved" 2155 argument. 2156 (struct obj_get_info_saved): New type definition. 2157 (print_bpf_map_info, print_bpf_prog_info): Change return type to void, 2158 add "saved" argument, do not handle private tcb data allocation and 2159 obtainment. 2160 (print_bpf_obj_info_addr): Change return type to void, add tcb argument, 2161 print the address only on exiting. 2162 (print_bpf_obj_info): Change return type to void, add "saved" argument. 2163 (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Handle private data 2164 allocation/saving/restoring, use it for storing/printing info_len field. 2165 2166 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2167 2168 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2169 2170 bpf: print log_buf field as a string. 2171 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print log_buf field 2172 as a string. 2173 * tests/bpf.c: Update expected output. 2174 2175 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2176 2177 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2178 2179 bpf: print xlated_prog_insns only when xlated_prog_len had not been 0. 2180 If xlated_prog_len is zero on entering syscall and non-zero on exiting, 2181 the program itself is not written into xlated_prog_insns. 2182 2183 * bpf.c (print_ebpf_prog): Add decode argument, print the address only 2184 if decode is false. 2185 (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Specify decode == true argument 2186 to print_ebpf_prog. 2187 (print_bpf_prog_info): Specify saved xlated_prog_len as decode argument 2188 to print_ebpf_prog. 2189 2190 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2191 2192 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2193 2194 bpf: move print_big_u64_addr inside print_ebpf_prog. 2195 * bpf.c (print_ebpf_prog): Add static qualifier. Change the type 2196 of "addr" argument from kernel_ulong_t to uint64_t, print it using 2197 print_big_u64_addr. 2198 (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD), print_bpf_prog_info): Do not call 2199 print_big_u64_addr before print_ebpf_prog. 2200 2201 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2202 2203 2018-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 2204 2205 bpf_attr.h: add ATTRIBUTE_ALIGNED(8) to all fields of type uint64_t. 2206 Our policy is that all fields of type uint64_t in this header file 2207 must have this attribute. 2208 2209 This shouldn't cause any contradictions with <linux/bpf.h> 2210 unless the latter is buggy. 2211 2212 By word "buggy" I mean containing such changes as Linux kernel commit 2213 v4.16-rc1~123^2~109^2~5^2~4. 2214 2215 * bpf_attr.h (struct BPF_MAP_UPDATE_ELEM_struct): Add 2216 ATTRIBUTE_ALIGNED(8) to "flags" field. 2217 (struct bpf_prog_info_struct): Add ATTRIBUTE_ALIGNED(8) to "load_time" 2218 field. 2219 2220 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2221 2222 tests: cast printf arguments to short when %h format qualifier is used. 2223 Reported by clang. 2224 2225 * tests/mknod.c (main): Cast printf argument for %#03ho format to short. 2226 * tests/mknodat.c (main): Likewise. 2227 * tests/net-sockaddr.c (main): Cast printf argument for %hu format 2228 to short. 2229 * tests/semop.c (main): Likewise. 2230 2231 2018-06-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2232 2233 xlat/evdev_keycode.in: remove constants with duplicating values. 2234 Those are used for describing input device category and not specific 2235 button. 2236 2237 Reported by clang. 2238 2239 * xlat/evdev_keycode.in (BTN_MOUSE, BTN_JOYSTICK, BTN_GAMEPAD, BTN_DIGI, 2240 BTN_WHEEL, BTN_TRIGGER_HAPPY): Remove. 2241 2242 2018-06-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2243 2244 configure.ac: include <sys/socket.h> before <linux/rtnetlink.h> 2245 This is needed for old Linux UAPI headers that do no contain commit 2246 v3.1-rc2~19^2~29. 2247 2248 * configure.ac: Include <sys/socket.h> before <linux/rtnetlink.h> 2249 in AC_CHECK_* invocations. 2250 2251 2018-06-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2252 2253 configure.ac: check for linux/rtnetlink.h instead of linux/if_link.h for declarations 2254 Historically, type definitions and declarations related to netlink route 2255 interface attributes were in linux/rtnetlink.h, later they were moved 2256 elsewhere (first linux/if.h, then linux/if_link.h) with the inclusion 2257 of the corresponding header file in linux/rtnetlink.h. 2258 2259 * configure.ac: Use <linux/rtnetlink.h> instead of <linux/if_link.h> 2260 in checks for interface netlink attributes-related declarations 2261 and definitions. 2262 2263 2018-06-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2264 2265 m4: move the gawk script from m4/gen_bpf_attr_m4.sh into a separate file 2266 As it turns out, old versions of gawk do not support -e option. 2267 2268 * m4/gen_bpf_attr_m4.sh: Move the gawk script ... 2269 * m4/gen_bpf_attr_m4.awk: ... here. 2270 2271 2018-06-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2272 2273 s390: wire up kexec_file_load syscall. 2274 * linux/s390/syscallent.h ([381]): Add kexec_file_load syscall. 2275 * linux/s390/syscallent.h ([381]): Likewise. 2276 2277 2018-06-01 Zhibin Li <08826794brmt (a] gmail.com> 2278 2279 tests: check short read of struct flock/flock64. 2280 * tests/fcntl-common.c (test_flock_einval): Check short read 2281 of struct flock. 2282 (test_flock64_einval): Check short read of struct flock64. 2283 2284 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2285 2286 tests: extend struct flock/flock64 decoding checks. 2287 * tests/fcntl-common.c (test_flock_einval, test_flock): Create 2288 struct_kernel_flock object using tail_alloc. 2289 (test_flock64_einval): Create struct_kernel_flock64 object using 2290 tail_alloc. 2291 * tests/fcntl64.c (test_flock64_lk64): Likewise. 2292 2293 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2294 2295 tests: extend F_OFD_* decoding checks. 2296 Check that non-faulty F_OFD_* fcntl operations are decoded properly. 2297 2298 * tests/fcntl-common.c: Include <string.h>. 2299 (test_flock64_ofd): New function. 2300 (test_flock64): Invoke it, remove [F_OFD_SETLK]. 2301 2302 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2303 2304 tests/fcntl-common.c: define and initialize errstr. 2305 Initialize errstr inside invoke_test_syscall so that its users 2306 won't have to go into trouble of caring about clobbering errno. 2307 2308 * tests/fcntl-common.c (errstr): New variable. 2309 (invoke_test_syscall): Initialize it. 2310 (test_flock_einval, test_flock64_einval, test_flock, 2311 test_f_owner_ex_type_pid): Use it. 2312 * tests/fcntl.c (test_flock64_undecoded): Likewise. 2313 * tests/fcntl64.c (test_flock64_lk64): Likewise. 2314 2315 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2316 2317 tests/fcntl-common.c: add fd argument to invoke_test_syscall. 2318 Extend invoke_test_syscall for later use with different file 2319 descriptors. 2320 2321 * tests/fcntl-common.c (invoke_test_syscall): Add fd argument, pass it 2322 to TEST_SYSCALL_NR syscall. All users updated. 2323 2324 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2325 2326 tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c. 2327 This change enables F_OFD_SETLK* tests for fcntl as well. 2328 2329 * tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64. 2330 [F_OFD_SETLK]: Remove. 2331 (test_flock64_einval): Move ... 2332 * tests/fcntl-common.c: ... here. 2333 (test_flock64_lk64): New protype. 2334 (test_flock64_einval, test_flock64): New functions. 2335 * tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded. 2336 (TEST_FLOCK64_UNDECODED): New macro. 2337 (test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL 2338 with TEST_FLOCK64_UNDECODED. 2339 2340 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2341 2342 tests: move F_OWNER_* tests to fcntl-common.c. 2343 This change enables F_OWNER_* tests for fcntl64 as well. 2344 2345 * tests/fcntl.c: Move main, [TEST_FLOCK64_EINVAL], 2346 and [TEST_F_OWNER_EX] ... 2347 * tests/fcntl-common.c: ... here. 2348 (test_flock64): New prototype. 2349 * tests/fcntl64.c (main): Remove. 2350 2351 2018-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 2352 2353 tests: rename struct_flock.c to fcntl-common.c. 2354 It is not limited to struct flock, more fcntl tests are going to land 2355 in this file. 2356 2357 * tests/struct_flock.c: Rename to fcntl-common.c. 2358 * tests/Makefile.am (EXTRA_DIST): Rename struct_flock.c 2359 to fcntl-common.c. 2360 * tests/fcntl.c: Likewise. 2361 * tests/fcntl64.c: Likewise. 2362 2363 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2364 2365 tests: check decoding of new FRA_* netlink attributes. 2366 * configure.ac (AC_CHECK_TYPES): Check for struct fib_rule_port_range 2367 in <linux/fib_rules.h>. 2368 * tests/nlattr_fib_rule_hdr.c: Include <linux/in.h>. 2369 (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, FRA_DPORT_RANGE): New 2370 macro constants. 2371 [!HAVE_STRUCT_FIB_RULE_PORT_RANGE] (struct fib_rule_port_range): New 2372 type. 2373 (main): Check decoding of new FRA_* netlink attributes. 2374 2375 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2376 2377 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2378 2379 rtnl_rule: decode new FRA_* attributes. 2380 * nlattr.h (DECL_NLA(ip_proto), DECL_NLA(rt_proto)): New declarations. 2381 * nlattr.c (decode_nla_ip_proto): New function. 2382 * rtnl_route.c (decode_nla_rt_proto): Likewise. 2383 * rtnl_rule.c (decode_rule_port_rang): Likewise. 2384 (fib_rule_hdr_nla_decoders) <[FRA_PROTOCOL]>: New attribute, introduced 2385 by Linux commit v4.17-rc1~148^2~371. 2386 (fib_rule_hdr_nla_decoders) <[FRA_IP_PROTO], [FRA_SPORT_RANGE], 2387 [FRA_DPORT_RANGE]>: New attributes, introduced by Linux commit 2388 v4.17-rc1~148^2~328^2~4. 2389 * xlat/rtnl_rule_attrs.in (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, 2390 FRA_DPORT_RANGE): New constants. 2391 2392 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2393 2394 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2395 2396 nlattr: introduce decode_nla_xval helper. 2397 * nlattr.c (decode_nla_xval): New function. 2398 * nlattr.h: Include "xlat.h". 2399 (struct decode_nla_xlat_opts): New type. 2400 (DECL_NLA(xval)): New declaration. 2401 2402 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2403 2404 2018-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 2405 2406 Move definitions of xlat_type and xlat_style from defs.h to xlat.h. 2407 * defs.h (enum xlat_type, enum xlat_style, XLAT_STYLE_FORMAT_SHIFT, 2408 XLAT_STYLE_VERBOSITY_MASK, XLAT_STYLE_FORMAT_MASK, XLAT_STYLE_SPEC_BITS, 2409 XLAT_STYLE_MASK): Move ... 2410 * xlat.h: ... here. 2411 2412 travis: switch from gcc-7 to gcc-8. 2413 * .travis.yml (matrix): Change gcc-7 to gcc-8. 2414 2415 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2416 2417 tests: use syscall() for ioctl() calls with oversized arguments. 2418 * tests/ioctl_inotify.c (sys_ioctl): New function. 2419 (main): Use sys_ioctl for ioctl calls with oversized arguments. 2420 * tests/ioctl_loop.c: Likewise. 2421 * tests/ioctl_perf.c: Likewise. 2422 2423 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2424 2425 print_ifindex: respect xlat style settings. 2426 Print interface indices according to the preferred xlat style settings. 2427 2428 * print_ifindex.c (INI_PFX, INI_SFX): New helper macros. 2429 [HAVE_IF_INDEXTONAME] (get_ifname): New function. 2430 [HAVE_IF_INDEXTONAME] (print_ifindex): Implement as a wrapper around 2431 get_ifname and print_xlat_ex. 2432 2433 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2434 2435 tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY, take 2 2436 The old code works only when an array contains exactly two items. 2437 2438 * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address 2439 for the case of incomplete read. 2440 2441 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2442 2443 nlattr: print index names in netlink meminfo array. 2444 * xlat/netlink_sk_meminfo_indices.in: New file. 2445 * nlattr.c: Include xlat/netlink_sk_meminfo_indices.h. 2446 (decode_nla_meminfo): Use print_array_ex, pass 2447 netlink_sk_meminfo_indices as index xlat table. 2448 * tests/nlattr_inet_diag_msg.c: Update expected output. 2449 2450 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2451 2452 Introduce ARRSZ_PAIR macro. 2453 A shorthand similar to ARG_STR in its purpose: it provides and ability 2454 to pass an array an its size without variable name duplication. 2455 2456 * macros.h (ARRSZ_PAIR): New macro. 2457 2458 2018-05-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2459 2460 print_array: add support for printing array indices. 2461 * defs.h (XLAT_STYLE_SPEC_BITS, XLAT_STYLE_MASK): New macro constants. 2462 (tfetch_mem_fn, print_fn): New typedefs. 2463 (enum print_array_flag_bits, enum print_array_flags): New enumerations. 2464 (print_array_ex): Rename from print_array, add flags, index_xlat, 2465 index_xlat_size, and index_dflt arguments. 2466 (print_array): New static inline function, a thin wrapper around 2467 print_array_ex. 2468 util.c: Include "xlat.h". 2469 (print_array): Rename to print_array_ex, add flags, index_xlat, 2470 index_xlat_size, and index_dflt arguments. Print array indices 2471 according to the style settings specified by flags if PAF_PRINT_INDICES 2472 is set. 2473 2474 2018-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 2475 2476 Enhance printing of unfetchable object addresses in sequences and arrays 2477 * btrfs.c (btrfs_print_tree_search): Print the address of unfetchable 2478 object inside the sequence using printaddr_comment. 2479 * msghdr.c (decode_msg_control): Likewise. 2480 * execve.c (printargv): Print the address of unfetchable object inside 2481 the array using printaddr_comment. 2482 * netlink.c (fetch_nlmsghdr): Add in_array argument. When in_array 2483 is true, print the address of unfetchable object using 2484 printaddr_comment. 2485 * nlattr.c (fetch_nlattr): Likewise. 2486 * tests/execve.c (main): Update expected output. 2487 * tests/execveat.c (main): Likewise. 2488 * tests/msg_control.c (test_scm_rights1, test_scm_rights2, 2489 test_scm_security): Likewise. 2490 * tests/netlink_protocol.c (send_query): Likewise. 2491 * tests/nlattr.c (test_nlattr): Likewise. 2492 2493 2018-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 2494 2495 print_array: enhance printing of unfetchable object addresses. 2496 When umoven_func invocation fails to fetch data, it prints the faulty 2497 address. If this happens to a subsequent umoven_func invocation, 2498 the printed address may be undistinguishable from a valid data printed 2499 by print_func, e.g. when the data is printed in a numeric form like 2500 [0x1, 0x2, 0x3, 0xdefaced]. 2501 2502 Fix this source of confusion by moving the printing of the faulty 2503 address from umoven_func to print_array itself. This change renames 2504 umoven_func to tfetch_mem_func and changes its semantics, so that 2505 - tfetch_mem_func never prints anything; 2506 - tfetch_mem_func returns true if the fetch succeeded, 2507 and false otherwise. 2508 2509 * defs.h (print_array): Replace umoven_func argument with 2510 tfetch_mem_func. 2511 * util.c (print_array): Replace umoven_func argument with 2512 tfetch_mem_func, document expected tfetch_mem_func return value 2513 semantics. When tfetch_mem_func returns false, print either addr 2514 or "... /* addr */" depending on the context (inside the array or not). 2515 * bpf.c (print_ebpf_prog, print_bpf_prog_info, 2516 BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr 2517 argument of print_array with tfetch_mem. 2518 * bpf_filter.c (print_bpf_fprog): Likewise. 2519 * btrfs.c (btrfs_print_logical_ino_container, 2520 btrfs_print_ino_path_container, btrfs_print_qgroup_inherit, 2521 btrfs_ioctl): Likewise. 2522 * dm.c (dm_decode_dm_target_deps): Likewise. 2523 * epoll.c (epoll_wait_common): Likewise. 2524 * file_ioctl.c (file_ioctl): Likewise. 2525 * ipc_sem.c (tprint_sembuf_array): Likewise. 2526 * kexec.c (print_kexec_segments): Likewise. 2527 * mem.c (SYS_FUNC(subpage_prot)): Likewise. 2528 * net.c (print_getsockopt): Likewise. 2529 * netlink.c (decode_nlmsgerr_attr_cookie): Likewise. 2530 * netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise. 2531 * netlink_packet_diag.c (decode_packet_diag_mclist): Likewise. 2532 * netlink_unix_diag.c (decode_unix_diag_inode): Likewise. 2533 * nlattr.c (decode_nla_meminfo): Likewise. 2534 * numa.c (print_nodemask, SYS_FUNC(move_pages), 2535 * perf_ioctl.c (perf_ioctl_query_bpf): Likewise. 2536 * poll.c (decode_poll_entering): Likewise. 2537 * printsiginfo.c (print_siginfo_array): Likewise. 2538 * rtnl_tc.c (decode_tca_stab_data): Likewise. 2539 * sock.c (decode_ifconf): Likewise. 2540 * uid.c (print_groups): Likewise. 2541 * io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace 2542 umoven_or_printaddr argument of print_array with tfetch_mem. 2543 (tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror 2544 with tfetch_mem_ignore_syserror. 2545 * v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument 2546 of print_array with tfetch_mem. 2547 (print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror 2548 with tfetch_mem_ignore_syserror. 2549 * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename 2550 to fetch_struct_mmsghdr_for_print, do not print address, return bool. 2551 (decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr 2552 with fetch_struct_mmsghdr_for_print. 2553 * tests/aio.c (main): Update expected output. 2554 * tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise. 2555 * tests/ioctl_perf-success.c (main): Likewise. 2556 * tests/ioctl_v4l2.c (main): Update expected output. 2557 * tests/kexec_load.c (main): Likewise. 2558 * tests/mmsg_name.c (test_mmsg_name): Update expected output. 2559 * tests/move_pages.c (print_page_array, print_node_array): Likewise. 2560 * tests/poll.c (print_pollfd_array_entering): Likewise. 2561 * tests/preadv-pwritev.c (main): Likewise. 2562 * tests/preadv2-pwritev2.c (dumpio): Likewise. 2563 * tests/process_vm_readv_writev.c (print_iov): Likewise. 2564 * tests/pwritev.c (print_iovec): Likewise. 2565 * tests/readv.c (main): Likewise. 2566 * tests/seccomp-filter-v.c 2567 * tests/semop.c (main): Likewise. 2568 * tests/set_mempolicy.c (print_nodes): Likewise. 2569 * tests/setgroups.c (main): Likewise. 2570 * tests/test_nlattr.h (print_nlattr) Likewise. 2571 2572 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 2573 2574 2018-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 2575 2576 Introduce tfetch_* family of functions and macros. 2577 These new functions are going to be used instead of umove_or_printaddr* 2578 as umoven_func argument of print_array. 2579 2580 * defs.h (tfetch_mem64, tfetch_mem64_ignore_syserror): New 2581 function prototypes. 2582 (tfetch_mem, tfetch_mem_ignore_syserror): New static inline 2583 wrappers. 2584 (tfetch_obj): New macro wrapper around tfetch_mem. 2585 * util.c (tfetch_mem64, tfetch_mem64_ignore_syserror): New 2586 functions. 2587 (umoven_or_printaddr64, umoven_or_printaddr64_ignore_syserror): Use 2588 them. 2589 2590 2018-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 2591 2592 Introduce printaddr_comment. 2593 * defs.h (printaddr_comment): New static inline wrapper around 2594 tprintf_comment. 2595 2596 Turn printaddr into a thin wrapper around printaddr64. 2597 * util.c (printaddr): Move ... 2598 * defs.h: ... here, add "static inline" qualifiers. 2599 2600 2018-05-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2601 2602 defs.h: add comments about umove* return values. 2603 * defs.h (umoven, umoven_or_printaddr64, 2604 umoven_or_printaddr64_ignore_syserror, umovestr): Add comments about 2605 return values. 2606 2607 2018-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 2608 2609 tests: use TAIL_ALLOC_OBJECT_CONST_PTR where appropriate. 2610 * tests/kcmp.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR. 2611 * tests/modify_ldt.c (main): Likewise. 2612 * tests/netlink_protocol.c (send_query): Likewise. 2613 * tests/ptrace.c (test_peeksiginfo, main): Likewise. 2614 * tests/s390_guarded_storage.c (main): Likewise. 2615 * tests/s390_sthyi.c (main): Likewise. 2616 * tests/xet_thread_area_x86.c (main): Likewise. 2617 2618 2018-05-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2619 2620 bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command. 2621 * bpf_attr.h [!BPF_TAG_SIZE] (BPF_TAG_SIZE): Define. 2622 [BPF_TAG_SIZE]: Check that BPF_TAG_SIZE is 8. 2623 (struct bpf_map_info_struct, struct bpf_prog_info_struct): New 2624 structures. 2625 (bpf_map_info_struct_size, expected_bpf_map_info_struct_size, 2626 bpf_prog_info_struct_size, expected_bpf_prog_info_struct_size): New 2627 macro constants. 2628 * bpf.c (print_bpf_obj_info_fn): New type. 2629 (print_bpf_map_info, print_bpf_prog_info, fetch_bpf_obj_info, 2630 print_bpf_obj_info_addr, print_bpf_obj_info): New functions. 2631 (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Print bpf_fd and info_len 2632 fields only on entering, call print_bpf_obj_info for printing info field. 2633 * tests/bpf.c (BPF_OBJ_GET_INFO_BY_FD_checks): Print info field 2634 as a pointer. 2635 2636 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2637 2638 2018-05-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2639 2640 bpf: add support for checking structures outside union bpf_attr. 2641 struct bpf_prog_info and bpf_map_info need essentially the same handling 2642 as union bpf_attr. 2643 2644 * gen_bpf_attr_check.sh: Derive type_name from $struct if it doesn't 2645 start with "BPF_", derive TYPE_NAME from type_name, use them in code 2646 generation. 2647 * m4/gen_bpf_attr_m4.sh: Rewrite parsing/generation code into awk, 2648 add support for structures outside union bpf_attr. 2649 2650 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2651 2652 2018-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 2653 2654 bpf: remove bpf_priv_data. 2655 As various bpf commands need different data to save between entering 2656 and exiting of the syscall, do not emulate union bpf_attr approach. 2657 2658 * bpf.c (struct bpf_priv_data): Remove. 2659 (DECL_BPF_CMD_DECODER): Remove "struct bpf_priv_data *" argument. 2660 (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use set_tcb_priv_ulong 2661 and get_tcb_priv_ulong to keep bpf_attr.query.prog_cnt field. 2662 (SYS_FUNC(bpf)): Remove priv variable, do not initialize it, 2663 and do not pass it to bpf_cmd_decoders. 2664 2665 2018-05-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2666 2667 tests: add union bpf_attr.query.prog_ids field decoding checks. 2668 * tests/bpf-success-v.c: New file. 2669 * tests/bpf-success.c: Likewise. 2670 * tests/bpf-success-v.test: New test. 2671 * tests/bpf-success.test: Likewise. 2672 * tests/.gitignore: Add bpf-success and bpf-success-v. 2673 * tests/Makefile.am (check_PROGRAMS): Likewise. 2674 (DECODER_TESTS): Add bpf-success.test and bpf-success-v.test. 2675 * tests/bpf.c [INJECT_RETVAL] (sys_bpf): Check that retuned value 2676 is equivalent to the injected one; append "(INJECTED)" string to errstr. 2677 (prog_load_ids, prog_load_ids_ptr): New variables. 2678 (init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4, 2679 init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5): New functions. 2680 (BPF_PROG_QUERY_checks): Drop "const" qualifier, add new checks. 2681 2682 bpf: BPF_PROG_QUERY bpf_attr.query.prog_ids printing fixes. 2683 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use 2684 print_uint32_array_member instead of print_uint64_array_member for 2685 printing prog_ids elements (and change the type of prog_id_buf from 2686 uint64_t to uint32_t), as they are 32-bit; use common trick with 2687 print_big_u64_addr for handling possible ambiguity with prog_ids 2688 address. 2689 * tests/bpf.c (BIG_ADDR_MAYBE): New macro. 2690 (BPF_PROG_QUERY_checks): Update expected output. 2691 2692 bpf: add support for instruction decoding. 2693 * xlat/ebpf_regs.in: New file. 2694 * bpf.c (struct ebpf_insn, struct ebpf_insns_data): New type definitions. 2695 (print_ebpf_insn, print_ebpf_prog): New functions. 2696 (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Use them. 2697 2698 2018-05-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2699 2700 tests: check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls 2701 As these have some argument output on the exit path. 2702 2703 * tests/ioctl_perf-success.c: New file. 2704 * tests/ioctl_perf-success.test: New test. 2705 * tests/Makefile.am (DECODER_TESTS): Add it. 2706 (check_PROGRAMS): Add ioctl_perf-success. 2707 * tests/.gitignore: Likewise. 2708 * tests/ioctl_perf.c: Remove TODO. 2709 2710 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2711 2712 2018-05-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2713 2714 Implement PERF_EVENT_IOC_* decoding. 2715 * perf.c (fetch_perf_event_attr, print_perf_event_attr): Remove "static" 2716 qualifier. 2717 * defs.h (fetch_perf_event_attr, print_perf_event_attr): New 2718 declarations. 2719 * perf_event_struct.h (struct perf_event_query_bpf): New type 2720 definition. 2721 * perf_ioctl.c: New file. 2722 * Makefile.am (strace_SOURCES): Add it. 2723 * xlat/perf_ioctl_cmds.in: New file. 2724 * xlat/perf_ioctl_flags.in: Likewise. 2725 * ioctl.c (ioctl_decode) <case '$'>: Call perf_ioctl. 2726 * tests/gen_tests.in (ioctl_perf): New test. 2727 * tests/ioctl_perf.c: New file. 2728 * tests/pure_executables.list: ioctl_perf. 2729 * tests/.gitignore: Likewise. 2730 2731 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 2732 2733 2018-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 2734 2735 tests: fix ipc_msgbuf.test. 2736 * tests/ipc_msgbuf.test: Fix -a argument. 2737 2738 2018-05-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2739 2740 xlat: update IPPROTO_* constants. 2741 * xlat/inet_protocols.in (IPPROTO_GGP, IPPROTO_HELLO, IPPROTO_ND): 2742 Remove, not defined in Linux. 2743 (IPPROTO_BEETPH): New constant, introduced by Linux commit 2744 v2.6.19-rc1~33^2. 2745 (IPPROTO_L2TP): New constant, introduced by Linux commit 2746 v2.6.35-rc1~473^2~594. 2747 (IPPROTO_MH): New constant, introduced by Linux commit 2748 v2.6.19-rc1~1272^2~157. 2749 Add default values to constants, sort the file. 2750 2751 xlat: add fallback definitions to RTPROT_* constants. 2752 * xlat/routing_protocols.in: Add default values to constants. 2753 2754 xlat: add SECCOMP_FILTER_FLAG_SPEC_ALLOW. 2755 * xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_SPEC_ALLOW): New 2756 constant, introduced by Linux commit v4.17-rc3-24-g00a02d0. 2757 * tests/seccomp-filter.c: Update expected output. 2758 * tests/seccomp-filter-v.c: Likewise. 2759 2760 prctl: add PR_GET_SPECULATION_CTRL/PR_SET_SPECULATION_CTRL decoding. 2761 * xlat/pr_spec_cmds.in: New fille. 2762 * xlat/pr_spec_get_store_bypass_flags.in: Likewise. 2763 * xlat/pr_spec_set_store_bypass_flags.in: Likewise. 2764 * xlat/prctl_options.in (PR_GET_SPECULATION_CTRL, 2765 PR_SET_SPECULATION_CTRL): New constants, introduced by Linux commit 2766 v4.17-rc3-15-gb617cfc. 2767 * prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL, 2768 case PR_SET_SPECULATION_CTRL>: Implement decoding of new prctl options. 2769 * tests/Makefile.am (check_PROGRAMS): Add prctl-spec-inject. 2770 (DECODER_TESTS): Add prctl-spec-inject.test. 2771 * tests/prctl-spec-inject.c: New file. 2772 * tests/prctl-spec-inject.test: New test. 2773 * tests/.gitignore: Add prctl-spec-inject. 2774 2775 tests: add keyctl variants with different xlat verbosity levels. 2776 * tests/keyctl-Xabbrev.c: New file. 2777 * tests/keyctl-Xraw.c: Likewise. 2778 * tests/keyctl-Xverbose.c: Likewise. 2779 * tests/keyctl.c (XARG_STR): New macro. 2780 (do_keyctl): Print command in accordance with XLAT_RAW/XLAT_VERBOSE settings. 2781 (main): Update expected output. 2782 * tests/pure_executables.list: Add keyctl-Xabbrev, keyctl-Xraw, 2783 and keyctl-Xverbose. 2784 * tests/.gitignore: Likewise. 2785 * tests/gen_tests.in (keyctl-Xabbrev, keyctl-Xraw, keyctl-Xverbose): New 2786 tests. 2787 2788 keyctl: print KEYCTL_SET_REQKEY_KEYRING argument as an integer. 2789 * xlat/key_reqkeys.in: Add #val_type int. 2790 * keyctl.c (SYS_FUNC(keyctl)) <case KEYCTL_SET_REQKEY_KEYRING>: Print 2791 arg2 as an integer. 2792 * tests/keyctl.c: Update expected output. 2793 2794 keyctl: respect xlat style when printing errno. 2795 * keyctl.c (keyctl_reject_key): Use print_xlat_ex for printing error 2796 argument. 2797 2798 2018-05-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2799 2800 syscall.c: unify error value printing. 2801 There's little reason not to decode error code for syscalls printed in 2802 raw; moreover, it creates inconsistencies for unknown syscall printing. 2803 2804 Another issue was with error numbers unknown to strace: previously, they 2805 were printed as "... = -1 1234 (Unknown error 1234)" which looked kinda 2806 weird. 2807 2808 * syscall.c (print_err_ret): New function. 2809 (syscall_exiting_trace): Remove u_error variable, use tcp->u_error 2810 instead. Remove u_error_str variable. 2811 (syscall_exiting_trace) <if (raw(tcp))>: Call print_err_ret if u_error 2812 is non-zero. 2813 (syscall_exiting_trace) <if (!(sys_res & RVAL_NONE) && tcp->u_error)>: 2814 Use print_err_ret for default error printing. 2815 * tests/nsyscalls.c [!LINUX_MIPSO32] (test_syscall): Update expected 2816 output. 2817 * tests/qual_fault.c (invoke) <if (is_raw)>: Likewise. 2818 * strace.1.in (.SH DESCIPTION): Update unknown syscall example. 2819 2820 2018-05-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2821 2822 ioctl: implement INOTIFY_IOC_SETNEXTWD decoding. 2823 * inotify_ioctl.c: New file. 2824 * Makefile.am (strace_SOURCES): Add it. 2825 * defs.h (DECL_IOCTL(inotify)): New declaration. 2826 * ioctl.c (ioctl_decode) <case 'I'>: Call inotify_ioctl. 2827 * tests/ioctl_inotify.c: New file. 2828 * tests/.gitignore: Add ioctl_inotify. 2829 * tests/pure_executables.list: Likewise. 2830 * tests/gen_tests.in (ioctl_inotify): New test. 2831 2832 tests/test_nlattr.h: avoid testing cropped objects of size 1. 2833 * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_): Check 2834 "len < sizeof(obj_)" case only if "sizeof(obj_) > 1". 2835 2836 tests: pass index to print_elem_ callback in TEST_NLATTR_ARRAY. 2837 * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Pass array index to the 2838 print_elem_ callback. 2839 * tests/nlattr_inet_diag_msg.c (print_uint): Add index argument. 2840 * tests/nlattr_netlink_diag_msg.c (print_xlong): Likewise. 2841 * tests/nlattr_packet_diag_msg.c (print_packet_diag_mclist, 2842 print_sock_filter): Likewise. 2843 * tests/nlattr_unix_diag_msg.c (print_uint): Likewise. 2844 2845 2018-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 2846 2847 tests: further cleanup bpf big address checks. 2848 Replace BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT with BIG_ADDR(). 2849 2850 * tests/bpf.c (BIG_ADDR): New macro. 2851 (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): Remove. 2852 (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, 2853 BPF_RAW_TRACEPOINT_OPEN_checks): Use BIG_ADDR() instead of 2854 BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT. 2855 2856 2018-05-23 Dmitry V. Levin <ldv (a] altlinux.org> 2857 2858 tests: cleanup bpf big address checks. 2859 Introduce BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT to reduce redundancy. 2860 2861 * tests/bpf.c (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): New macros. 2862 (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, 2863 BPF_RAW_TRACEPOINT_OPEN_checks): Use them. 2864 2865 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2866 2867 bpf: add support for BPF_RAW_TRACEPOINT_OPEN command decoding. 2868 * bpf_attr.h (struct BPF_RAW_TRACEPOINT_OPEN_struct): New type 2869 definition. 2870 (BPF_RAW_TRACEPOINT_OPEN_struct_size, 2871 expected_BPF_RAW_TRACEPOINT_OPEN_struct_size): New macros. 2872 * xlat/bpf_commands.in (BPF_RAW_TRACEPOINT_OPEN): New constant, 2873 introduced by Linux commit v4.17-rc1~148^2~19^2~4^2~3. 2874 * xlat/bpf_prog_types.in (BPF_PROG_TYPE_RAW_TRACEPOINT): Likewise. 2875 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)): New bpf 2876 command decoder. 2877 (SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Add 2878 BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN). 2879 * tests/bpf.c (union bpf_attr_data): Add 2880 BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN). 2881 (BPF_PROG_LOAD_checks): Update. 2882 (init_BPF_RAW_TRACEPOINT_attr2): New function. 2883 (BPF_RAW_TRACEPOINT_OPEN_checks): New checks array. 2884 (main) <checks>: Add CHK(BPF_RAW_TRACEPOINT_OPEN). 2885 2886 bpf: add support for decoding struct bpf_attr.expected_attach_type field 2887 * bpf_attr.h (struct BPF_PROG_LOAD_struct): Add expected_attach_type 2888 field. 2889 (BPF_PROG_LOAD_struct_size): Update to offsetofend of 2890 expected_attach_type field. 2891 (expected_BPF_PROG_LOAD_struct_size): Update to 72. 2892 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode 2893 expected_attach_type field. 2894 * tests/bpf.c: Update expected output. 2895 2896 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2897 2898 nlattr: do not assume that SK_MEMINFO_VARS is constant. 2899 SK_MEMINFO_VARS changes over time (as it was in Linux commit 2900 v4.7-rc1~154^2~354^2~4, for example), so we cannot use it 2901 for sanity checks. 2902 2903 * nlattr.c (print_meminfo): Remove. 2904 (decode_nla_meminfo): Use generic print_uint32_array_member element 2905 printer callback. 2906 * tests/nlattr_inet_diag_msg.c (main): Update expected output. 2907 2908 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2909 2910 Introduce print_uint32_array_member helper function. 2911 Analogous to print_int32_array_member, this helper is going to be used 2912 in various decoders, including BPF_PROG_QUERY, PERF_EVENT_IOC_*, 2913 and netlink meminfo. 2914 2915 * defs.h (print_uint32_array_member): New declaration. 2916 * util.c (print_uint32_array_member): New function. 2917 2918 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2919 2920 Introduce print_int32_array_member helper function. 2921 Analogous to print_uint64_array_member, this helper is going to be used 2922 for IFLA_AF_SPEC decoding. 2923 2924 * defs.h (print_int32_array_member): New declaration. 2925 * util.c (print_int32_array_member): New function. 2926 2927 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2928 2929 defs.h: move print_uint64_array_member and print_array declarations down 2930 In preparation for the forthcoming changes. 2931 2932 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2933 2934 tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY. 2935 The old code works only when an array contains exactly two items. 2936 2937 * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address 2938 for the case of incomplete read. 2939 2940 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2941 2942 sockaddr: add support for sockaddr_l2 without l2_bdaddr_type. 2943 Apparently, struct sockaddr_l2 changed over time: the l2_bdaddr_type 2944 field was added only by commit v3.5-rc1~35^2~3^2~18^2^2~39. 2945 2946 * configure.ac (AC_CHECK_HEADERS): Move bluetooth/bluetooth.h check into 2947 a separate check. 2948 (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): New check, also checks for 2949 struct sockaddr_l2.l2_bdaddr_type member in case of success. 2950 * sockaddr.c (print_sockaddr_data_bt) <case offsetof(struct sockaddr_l2, 2951 l2_bdaddr_type)>: Add to sizeof(struct sockaddr_l2) case. Print 2952 l2_bdaddr_type field only if the provided sockaddr is big enough. 2953 * tests/net-sockaddr.c (check_l2): Put l2_bdaddr_type usage/printing 2954 under HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE ifdef, add a check for the 2955 sockaddr_l2 structure without the l2_bdaddr_type field. 2956 2957 2018-05-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 2958 2959 sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR. 2960 And make the output more structured. 2961 2962 * sock.c: Include xlat/arp_hardware_types.h in XLAT_MACROS_ONLY mode. 2963 (print_ifreq) <case SIOCSIFHWADDR, case SIOCGIFHWADDR>: Introduce 2964 hwaddr_sizes array, print ifr_hwaddr.sa_family, print ifr_hwaddr.sa_data 2965 using hwaddr_sizes and PRINT_FIELD_MAC_SZ. 2966 2967 2018-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 2968 2969 Simplify errnoent and signalent. 2970 Remove personality support for errnoent and signalent as 2971 there is nothing personality-specific in these files. 2972 2973 * linux/aarch64/errnoent1.h: Remove. 2974 * linux/aarch64/signalent1.h: Likewise. 2975 * linux/powerpc64/errnoent1.h: Likewise. 2976 * linux/powerpc64/signalent1.h: Likewise. 2977 * linux/riscv/errnoent1.h: Likewise. 2978 * linux/riscv/signalent1.h: Likewise. 2979 * linux/s390x/errnoent1.h: Likewise. 2980 * linux/s390x/signalent1.h: Likewise. 2981 * linux/sparc64/errnoent1.h: Likewise. 2982 * linux/sparc64/signalent1.h: Likewise. 2983 * linux/tile/errnoent1.h: Likewise. 2984 * linux/tile/signalent1.h: Likewise. 2985 * linux/x32/errnoent1.h: Likewise. 2986 * linux/x32/signalent1.h: Likewise. 2987 * linux/x86_64/errnoent1.h: Likewise. 2988 * linux/x86_64/errnoent2.h: Likewise. 2989 * linux/x86_64/signalent1.h: Likewise. 2990 * linux/x86_64/signalent2.h: Likewise. 2991 * Makefile.am (EXTRA_DIST): Remove them. 2992 * defs.h (errnoent0): Rename to errnoent. 2993 (signalent0): Rename signalent. 2994 (nerrnos, nsignals): Change to const variables unconditionally. 2995 * syscall.c (errnoent0): Rename to errnoent. 2996 (signalent0): Rename signalent. 2997 (nerrnos, nsignals): Change to const variables unconditionally. 2998 (nerrnos0, nsignals0): Remove. 2999 [SUPPORTED_PERSONALITIES > 1] (errnoent1, signalent1, nerrnos1, 3000 nsignals1): Remove. 3001 [SUPPORTED_PERSONALITIES > 2] (errnoent2, signalent2, nerrnos2, 3002 nsignals2): Likewise. 3003 (set_personality): Do not assign errnoent, signalent, nerrnos, 3004 and nsignals. 3005 3006 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3007 3008 strace.1.in: mention -Xraw in -eraw description. 3009 * strace.1.in (\fB\-e\ raw\fR=\,\fIset\fR): Mention -X raw. 3010 3011 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3012 3013 strace.1.in: display -k option description only if it is enabled. 3014 Leverage the fact that manpage is generated and add condition statements 3015 around mentions of -k option. 3016 3017 * strace.1.in (.SH SYNOPSIS): Put option list inside an 3018 ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind_opt ... .end_unwind_opt" 3019 condition; add a second list of options without -k and put it inside 3020 ".if '@ENABLE_STACKTRACE_FALSE@'#' .ig end_no_unwind_opt ... .end_no_unwind_opt" 3021 condition. 3022 (.SS Output format) <-k>: Put it inside 3023 ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind ... .end_unwind" 3024 condition, remove the mention of --enable-stacktrace configuration 3025 option requirement. 3026 3027 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3028 3029 strace.1.in: format a reference to "open" syscall using bold font. 3030 * strace.1.in (.SH DESCRIPTION): Format a reference to "open" syscall 3031 using bold font. 3032 3033 tests/qual_fault.test: add -efu arguments to the interpreter. 3034 * tests/qual_fault.test (#!/bin/sh): Add -efu arguments. 3035 3036 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3037 3038 tests/qual_fault.test: swap expected/output files in match_diff calls. 3039 match_diff expects the first argument as strace output and the second 3040 argument as expected output. 3041 3042 * tests/qual_fault.test (check_fault_injection): Swap arguments 3043 in match_diff calls. 3044 3045 2018-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 3046 3047 defs.h: convert some macro wrappers into static inline functions. 3048 * defs.h (pathtrace_select, pathtrace_match, printxval_searchn, 3049 printxval_indexn, sprintxval, sprintflags, printnum_slong, 3050 printnum_ulong, printnum_ptr, printnum_kptr): Convert macro wrappers 3051 into static inline functions. 3052 3053 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3054 3055 xlat: add support for xlat_styles in printxval_dispatch. 3056 * defs.h (printxval_dispatch_ex): Rename from printxval_dispatch, add 3057 style argument. 3058 (printxval_dispatch): New static inline function, a thin wrapper around 3059 printxval_dispatch_ex. 3060 * xlat.c (printxval_dispatch): Rename to printxval_dispatch_ex, add 3061 style argument, handle it. 3062 3063 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3064 3065 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3066 3067 Make printxval_dispatch publicly available. 3068 * evdev.c (enum xlat_type, printxval_dispatch): Move elsewhere. 3069 * defs.h (enum_xlat_type): Move from evdev.c. 3070 (printxval_dispatch): New declaration. 3071 * xlat.c (printxval_dispatch): Move from evdev.c, drop static qualifier. 3072 3073 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3074 3075 Revert "evdev: remove XT_NORMAL" 3076 This reverts commit cc52da10c6f13feba577a83088f34916c6350165 3077 in preparation for printxval_dispatch generalisation. 3078 3079 * evdev.c (enum xlat_type): Add XT_NORMAL back. 3080 (printxval_dispatch): Handle XT_NORMAL again. 3081 3082 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3083 3084 defs.h: introduce is_bigendian macro. 3085 This macro is going to be used in inline checks. 3086 3087 * defs.h (is_bigendian): New macro constant. 3088 3089 2018-05-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3090 3091 util.c: make memory allocation error messages more informative. 3092 As those are pretty unusual, let's add some additional information 3093 that can be reported by users. 3094 3095 * util.c (print_quoted_string_ex, dumpstr): Add reasons for memory 3096 allocation errors. 3097 (sizeof_iov): Change type from size_t to unsigned int. 3098 (dumpiov_upto): Rewrite size initialisation similarly to the way it's 3099 done in print_quoted_string_ex, add reasons for memory allocation errors. 3100 3101 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3102 3103 2018-05-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3104 3105 strace.1.in: fix -A description. 3106 * strace.1.in (.SS Output format) <-A>: Add missing .B. 3107 3108 strace.1.in: document x32 64-bit syscall peculiarity. 3109 * strace.1.in (.SH NOTES): Document "#64" suffix for 64-bit syscalls on 3110 x32. 3111 3112 2018-05-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3113 3114 linux/x32/syscallent.h: change 64-bit syscall designation. 3115 The current way of designation of 64-bit specific syscalls in x32 3116 personality not only conflicts with fault injection specification 3117 syntax, but also makes it impossible to specify such syscalls at all 3118 (since everything that starts from a digit is considered a syscall 3119 number specification). So, let's change prefix to suffix and use 3120 octothorpe instead of colon as a separator. 3121 3122 * linux/x32/syscallent.h (13, 15, 16, 19, 20, 45, 46, 47, 54, 55, 59, 3123 101, 127, 128. 129, 131, 134, 156, 174, 177, 178, 180, 205, 206, 209, 3124 211, 214, 215, 222, 236, 244, 246, 247, 273, 274, 278, 279, 295, 296, 3125 297, 299, 307, 310, 311, 32, 327, 328): Change "64:" prefix to "#64" 3126 suffix in syscall name. 3127 3128 Closes: https://github.com/strace/strace/issues/36 3129 3130 2018-05-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3131 3132 xlat: add BPF_PROG_TYPE_SK_MSG. 3133 * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_MSG): New constant, 3134 introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13. 3135 * tests/bpf.c (BPF_PROG_LOAD_checks): Update expected output. 3136 3137 xlat: update bpf_attach_type constants. 3138 * xlat/bpf_attach_type.in (BPF_SK_MSG_VERDICT): New constant, 3139 introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13. 3140 (BPF_CGROUP_INET4_BIND, BPF_CGROUP_INET6_BIND): New constants, 3141 introduced by Linux commit v4.17-rc1~148^2~19^2^2~6. 3142 (BPF_CGROUP_INET4_CONNECT, BPF_CGROUP_INET6_CONNECT): New constants, 3143 introduced by Linux commit v4.17-rc1~148^2~19^2^2~3. 3144 (BPF_CGROUP_INET4_POST_BIND, BPF_CGROUP_INET6_POST_BIND): New constants, 3145 introduced by Linux commit v4.17-rc1~148^2~19^2^2~1. 3146 * tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output. 3147 3148 2018-05-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3149 3150 xlat/sock_rds_options.in: make it sorted. 3151 Define SO_TIMESTAMP twice, for PA-RISC and all the other architectures. 3152 3153 * xlat/sock_rds_options.in [!__hppa__] (SO_TIMESTAMP): Define to 29. 3154 [__hppa__] (SO_TIMESTAMP): Define to 0x4012. 3155 * net.c (print_sockopt_fd_level_name) <case SOL_RDS>: Use 3156 printxval_search instead of printxval. 3157 3158 2018-05-17 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 3159 3160 Update ioctl entries from linux v4.17. 3161 * linux/32/ioctls_inc_align16.h: Update from linux v4.17-rc5 3162 using ioctls_gen.sh. 3163 * linux/32/ioctls_inc_align32.h: Likewise. 3164 * linux/32/ioctls_inc_align64.h: Likewise. 3165 * linux/64/ioctls_inc.h: Likewise. 3166 * linux/x32/ioctls_inc0.h: Likewise. 3167 * linux/i386/ioctls_arch0.h: Likewise. 3168 * linux/x86_64/ioctls_arch0.h: Likewise. 3169 * NEWS: Mention this. 3170 3171 maint: update for linux 4.17-rc5. 3172 * maint/ioctls_sym.sh: (x86_list): Add KVM_HYPERV_EVENTFD. 3173 3174 2018-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 3175 3176 bpf: use indexed lookups where appropriate. 3177 * xlat/bpf_attach_type.in: Add "#value_indexed" directive. 3178 * xlat/bpf_class.in: Likewise. 3179 * xlat/bpf_map_types.in: Likewise. 3180 * xlat/bpf_map_update_elem_flags.in: Likewise. 3181 * xlat/bpf_prog_types.in: Likewise. 3182 * xlat/ebpf_class.in: Likewise. 3183 * bpf_filter.c (print_bpf_filter_code): Use printxval_index 3184 instead of printxval for decoding bpf_class and ebpf_class. 3185 * print_fields.h (PRINT_FIELD_XVAL_INDEX): New macro. 3186 * bpf.c: Use it instead of PRINT_FIELD_XVAL for decoding bpf_attach_type, 3187 bpf_map_types, bpf_map_update_elem_flags, and bpf_prog_types. 3188 3189 2018-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 3190 3191 bpf: use printxval_index lookup instead of printxval. 3192 * xlat/bpf_commands.in: Add "#value_indexed" directive. 3193 * bpf.c (SYS_FUNC(bpf)): Use printxval_index instead of printxval. 3194 3195 time: use indexed lookups. 3196 * defs.h (xlat_idx): New prototype. 3197 * xlat.c (xlat_idx): Remove static qualifier. 3198 * time.c (do_adjtimex): Use xlat_idx instead of xlookup. 3199 (SYS_FUNC(getitimer), SYS_FUNC(setitimer)): Use printxval_index 3200 instead of printxval. 3201 [ALPHA] (SYS_FUNC(osf_getitimer), SYS_FUNC(osf_setitimer)): Likewise. 3202 (printclockname) [CLOCKID_TO_FD]: Likewise. 3203 * xlat/adjtimex_state.in: Add "#value_indexed" directive. 3204 * xlat/clocknames.in: Likewise. 3205 * xlat/cpuclocknames.in: Add "#value_indexed" directive, add default 3206 values to constants. 3207 * xlat/itimer_which.in: Likewise. 3208 3209 2018-05-15 Andre McCurdy <armccurdy (a] gmail.com> 3210 3211 linux/arm/raw_syscall.h: avoid r7 specified register variables with Thumb 3212 If Thumb code is being generated and frame pointers are enabled, the 3213 Thumb frame pointer in r7 clashes with any local variable which may 3214 need to be assigned to r7 (e.g. the syscall NR when making a raw 3215 syscall). 3216 3217 With gcc, the double use of r7 results in a build error, e.g. 3218 3219 strace-4.22/tests/inject-nf.c:86:1: error: r7 cannot be used in asm here 3220 3221 With clang, the double use of r7 can result in the compiler silently 3222 generating broken code which crashes at run time due to frame pointer 3223 corruption: 3224 3225 https://bugs.llvm.org/show_bug.cgi?id=34165 3226 3227 In most cases the problem isn't visible as frame pointers will be 3228 disabled automatically due to optimisation level. However to handle 3229 cases where frame pointers are enabled (e.g. when CFLAGS etc are set 3230 to support a debug build, etc) provide a version of raw_syscall_0 3231 which manually saves and restores the frame pointer value in r7 3232 to a temporary register before setting up the syscall NR in r7 3233 and invoking the syscall. 3234 3235 * linux/arm/raw_syscall.h (raw_syscall_0) [__thumb__]: Provide 3236 an alternative version. 3237 3238 2018-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 3239 3240 sockaddr: use printxval_index lookup instead of printxval. 3241 * xlat/addrfams.in: Add "#value_indexed" directive. 3242 * xlat/af_packet_types.in: Likewise. 3243 * xlat/hci_channels.in: Likewise. 3244 * sockaddr.c (print_sockaddr_data_bt, print_sockaddr, 3245 * print_sockaddr_data_ll): Use printxval_index instead of printxval. 3246 3247 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3248 3249 sockaddr: use printxval_search for ARPHRD_* constants. 3250 This xlat table is quite big. 3251 3252 * sockaddr.c (print_sockaddr_data_ll): Replace printxval call with 3253 printxval_search for printing of struct sockaddr_ll.sll_hatype field. 3254 3255 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3256 3257 Add a common MAC address printing routine. 3258 * print_mac.c: New file. 3259 * Makefile.am (strace_SOURCES): Add it. 3260 * defs.h (sprint_mac_addr): New declaration. 3261 (print_mac_addr): New function, a thin wrapper around sprint_mac_addr. 3262 * print_fields.h (PRINT_FIELD_MAC, PRINT_FIELD_MAC_SZ): New macros. 3263 * rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_MAC for bridge 3264 address printing. 3265 * sock.c (print_ifreq) <case SIOCGIFHWADDR>: Use print_mac_addr for 3266 ifr_hwaddr printing. 3267 * sockaddr.c (print_sockaddr_data_bt): Use print_mac_addr for 3268 {sco,rc,l2}_bdaddr field printing. 3269 3270 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3271 3272 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3273 3274 sockaddr: decode Bluetooth L2 CID values. 3275 * xlat/bluetooth_l2_cid.in: New file. 3276 * sockaddr.c: Include xlat/bluetooth_l2_cid.h. 3277 (print_bluetooth_l2_cid): New function. 3278 (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_cid 3279 field. 3280 * tests/net-sockaddr.c (check_l2): Update expected output. 3281 3282 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3283 3284 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3285 3286 sockaddr: decode Bluetooth L2 PSM values. 3287 * xlat/bluetooth_l2_psm.in: New file. 3288 * sockaddr.c: Include xlat/bluetooth_l2_psm.h. 3289 (print_bluetooth_l2_psm): New function. 3290 (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_psm 3291 field. 3292 * tests/net-sockaddr.c (check_l2): Update expected output. 3293 3294 sockaddr: decode bluetooth address type names. 3295 * xlat/bdaddr_types.in: New file. 3296 * sockaddr.c: Include xlat/bdaddr_types.h. 3297 (print_sockaddr_data_bt): Decode struct sockaddr_l2.l2_bdaddr_type field 3298 using constants from bdaddr_types xlat. 3299 * tests/net-sockaddr.c (check_l2): Check decoding 3300 of struct sockaddr_l2.l2_bdaddr_type field. 3301 3302 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3303 3304 sockaddr: decode Bluetooth socket address unconditionally. 3305 * sockaddr.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include 3306 bluetooth/bluetooth.h, bluetooth/hci.h, bluetooth/l2cap.h, 3307 bluetooth/rfcomm.h, and bluetooth/sco.h. 3308 [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include xlat/hci_channels.h. 3309 (btohs): New function. 3310 (print_sockaddr_data_bt): Define unconditionally, add definitions 3311 of struct sockaddr_hci, struct bdaddr, struct sockaddr_sco, 3312 struct sockaddr_rc, and struct sockaddr_l2. 3313 (sa_printers) <AF_BLUETOOTH>: Define unconditionally. 3314 3315 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3316 3317 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3318 3319 Avoid using print_array as a local variable name. 3320 We have a function with the same name. 3321 3322 * netlink.c (decode_netlink) <print_array>: Rename to is_array, all 3323 users updated. 3324 * nlattr.c (decode_nlattr) <print_array>: Likewise. 3325 3326 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3327 3328 2018-05-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3329 3330 xlat: update MSG_* constants. 3331 Sync them with kernel's include/linux/socket.h, since syscalls perform 3332 almost no checks for incorrect flags. 3333 3334 * xlat/msg_flags.in (MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC, 3335 MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR, MSG_WAITALL, MSG_FIN, 3336 MSG_SYN, MSG_CONFIRM, MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE, 3337 MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC): Add default values 3338 to all constants. 3339 (MSG_SENDPAGE_NOTLAST, MSG_NO_SHARED_FRAGS): New constants. It is 3340 an internal one, but, apparently, nothing prohibits passing it 3341 to the kernel. 3342 (MSG_CMSG_COMPAT): New constant. Override the value provided 3343 by system headers. 3344 (MSG_EOF): Commented out, as it is a synonym for MSG_FIN. 3345 3346 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3347 3348 2018-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 3349 3350 socketutils: use exact match of unix domain sockets on fresh kernels. 3351 * socketutils.c (unix_send_query): Do not add NLM_F_DUMP to nlmsg_flags 3352 when kernel version is 4.4.4 or later, initialize udiag_cookie 3353 unconditionally. 3354 3355 Complements: v4.12~536 ("Change unix_diag requests back to use full dump instead of exact match") 3356 3357 2018-05-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3358 3359 socketutils: do not request NDIAG_SHOW_MEMINFO. 3360 This information is not used and it looks like it negatively affects 3361 ability to find the socket under high load. 3362 3363 * socketutils.c (netlink_send_query) <req>: Remove NDIAG_SHOW_MEMINFO 3364 flag from netlink_diag_req.ndiag_show field. 3365 * tests/netlink_netlink_diag.c (send_query) <req>: Likewise. 3366 3367 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3368 3369 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3370 3371 tests: introduce midtail_alloc and use it in netlink tests. 3372 netlink tests happen to access memory located before the tail_malloc'ed 3373 pointers, a practice that doesn't go well with the latest compilers 3374 because tail_malloc is marked with ATTRIBUTE_MALLOC. 3375 For example, glibc in -D_FORTIFY_SOURCE=2 mode and gcc 8 with 3376 -Warray-bounds enabled complain about negative offsets out of bounds. 3377 Fix this issue by introducing midtail_alloc. 3378 3379 * tests/tests.h (midtail_alloc): New macro. 3380 * tests/netlink_crypto.c: Use it instead of tail_malloc for nlh0 allocation. 3381 * tests/netlink_netfilter.c: Likewise. 3382 * tests/netlink_protocol.c: Likewise. 3383 * tests/netlink_route.c: Likewise. 3384 * tests/netlink_selinux.c: Likewise. 3385 * tests/netlink_sock_diag.c: Likewise. 3386 * tests/nlattr_br_port_msg.c: Likewise. 3387 * tests/nlattr_crypto_user_alg.c: Likewise. 3388 * tests/nlattr_dcbmsg.c: Likewise. 3389 * tests/nlattr_fib_rule_hdr.c: Likewise. 3390 * tests/nlattr_ifaddrlblmsg.c: Likewise. 3391 * tests/nlattr_ifaddrmsg.c: Likewise. 3392 * tests/nlattr_ifinfomsg.c: Likewise. 3393 * tests/nlattr_ifla_brport.c: Likewise. 3394 * tests/nlattr_ifla_port.c: Likewise. 3395 * tests/nlattr_ifla_xdp.c: Likewise. 3396 * tests/nlattr_inet_diag_msg.c: Likewise. 3397 * tests/nlattr_inet_diag_req_compat.c: Likewise. 3398 * tests/nlattr_inet_diag_req_v2.c: Likewise. 3399 * tests/nlattr_mdba_mdb_entry.c: Likewise. 3400 * tests/nlattr_mdba_router_port.c: Likewise. 3401 * tests/nlattr_ndmsg.c: Likewise. 3402 * tests/nlattr_ndtmsg.c: Likewise. 3403 * tests/nlattr_netconfmsg.c: Likewise. 3404 * tests/nlattr_netlink_diag_msg.c: Likewise. 3405 * tests/nlattr_nlmsgerr.c: Likewise. 3406 * tests/nlattr_packet_diag_msg.c: Likewise. 3407 * tests/nlattr_rtgenmsg.c: Likewise. 3408 * tests/nlattr_rtmsg.c: Likewise. 3409 * tests/nlattr_smc_diag_msg.c: Likewise. 3410 * tests/nlattr_tc_stats.c: Likewise. 3411 * tests/nlattr_tca_stab.c: Likewise. 3412 * tests/nlattr_tcamsg.c: Likewise. 3413 * tests/nlattr_tcmsg.c: Likewise. 3414 * tests/nlattr_unix_diag_msg.c: Likewise. 3415 3416 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3417 3418 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3419 3420 Use MIN where appropriate. 3421 * netlink.c (decode_nlmsghdr_with_payload): Use MIN. 3422 * netlink_packet_diag.c (print_packet_diag_mclist): Likewise. 3423 * nlattr.c (decode_nlattr_with_data): Likewise. 3424 * rtnl_route.c (decode_rta_multipath): Likewise. 3425 3426 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3427 3428 xlat: add fallback definitions to {msg,sem,shm}ctl command constants. 3429 * xlat/msgctl_flags.in: Add default values to all constants, reorder 3430 to make them sorted by value. 3431 * xlat/semctl_flags.in: Likewise. 3432 * xlat/shmctl_flags.in: Likewise. 3433 3434 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3435 3436 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3437 3438 xlat: add MSG_STAT_ANY. 3439 * xlat/msgctl_flags.in (MSG_STAT_ANY): New constant, introduced 3440 by Linux commit v4.17-rc1~52^2~21. 3441 * tests/ipc_msg.c: Check it. 3442 3443 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3444 3445 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3446 3447 xlat: add SEM_STAT_ANY. 3448 * xlat/semctl_flags.in (SEM_STAT_ANY): New constant, introduced 3449 by Linux commit v4.17-rc1~52^2~22. 3450 * tests/ipc_sem.c: Check it. 3451 3452 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3453 3454 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3455 3456 xlat: add SHM_STAT_ANY. 3457 * xlat/shmctl_flags.in (SHM_STAT_ANY): New constant, introduced 3458 by Linux commit v4.17-rc1~52^2~23. 3459 * tests/ipc_shm.c: Check it. 3460 3461 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3462 3463 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3464 3465 net: print SO_GET_FILTER in getsockopt. 3466 SO_ATTACH_FILTER and SO_GET_FILTER have the same value; the former 3467 constant is intended for use in setsockopt, and the latter is for 3468 getsockopt. Handle that the same way as similar SOL_IP/SOL_IPV6 socket 3469 options are handled. 3470 3471 * xlat/getsock_options.in: New file. 3472 * xlat/setsock_options.in: Likewise. 3473 * xlat/sockoptions.in (SO_ATTACH_FILTER): Move to 3474 xlat/setsock_options.in. 3475 * net.c: Include "xlat/setsock_options.h" and "xlat/getsock_options.h". 3476 (print_sockopt_fd_level_name) <case SOL_SOCKET>: Use 3477 getsock_options or setsock_options as auxiliary xlats based on the value 3478 of is_getsockopt flag. 3479 * tests/sock_filter-v.c: Update expected output. 3480 3481 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3482 3483 2018-05-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3484 3485 tests: add sock_filtrer-v variants with different xlat verbosity levels. 3486 * tests/sock_filter-v-Xabbrev.c: New file. 3487 * tests/sock_filter-v-Xraw.c: Likewise. 3488 * tests/sock_filter-v-Xverbose.c: Likewise. 3489 * tests/sock_filter-v.c (PRINT_STMT_SYM, PRINT_STMT_SYM_, 3490 PRINT_STMT_VAL, PRINT_STMT_VAL_, PRINT_JUMP_): Remove. 3491 (HEX_FMT, XLAT_FMT, XLAT_ARGS, PRINT_STMT): New macros. 3492 (PRINT_JUMP): Rewrite. 3493 (print_filter): Rewrite using PRINT_STMT and new PRINT_JUMP. 3494 (main): Print SOL_SOCKET, SO_ATTACH_FILTER, and SO_ATTACH_REUSEPORT_CBPF 3495 using XLAT_FMT/XLAT_ARGS macros. 3496 * tests/pure_executables.list: Add sock_filter-v-Xabbrev, 3497 sock_filter-v-Xraw, and sock_filter-v-Xverbose. 3498 * tests/.gitignore: Likewise. 3499 * tests/gen_tests.in (sock_filter-v-Xabbrev, sock_filter-v-Xraw, 3500 sock_filter-v-Xverbose): New tests. 3501 3502 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3503 3504 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3505 3506 defs.h: fix ethernet_protocols comment. 3507 Starting with commit v4.22~109, sorted xlat tables are terminated 3508 with XLAT_END. 3509 3510 * defs.h (ethernet_protocols): Remove the "unterminated" part from 3511 description. 3512 3513 2018-05-08 Dmitry V. Levin <ldv (a] altlinux.org> 3514 3515 xlat: rename *sock*options xlat tables. 3516 Such names as sockrxrpcoptions are incomprehensible. 3517 3518 * xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in. 3519 * xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in. 3520 * xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in. 3521 * xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in. 3522 * xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in. 3523 * xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in. 3524 * xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in. 3525 * xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in. 3526 * xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in. 3527 * xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in. 3528 * xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in. 3529 * xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in. 3530 * xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in. 3531 * xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in. 3532 * xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in. 3533 * xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in. 3534 * xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in. 3535 * xlat/sockoptions.in: Rename to xlat/sock_options.in. 3536 * xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in. 3537 * xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in. 3538 * xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in. 3539 * xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in. 3540 * xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in. 3541 * xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in. 3542 * xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in. 3543 * xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in. 3544 * xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in. 3545 * xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in. 3546 * xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in. 3547 * net.c: Update. 3548 3549 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3550 3551 net: decode more SOL_* socket options. 3552 * xlat/sockalgoptions.in: New file. 3553 * xlat/sockbluetoothoptions.in: Likewise. 3554 * xlat/sockcaifoptions.in: Likewise. 3555 * xlat/sockdccpoptions.in: Likewise. 3556 * xlat/sockiucvoptions.in: Likewise. 3557 * xlat/sockkcmoptions.in: Likewise. 3558 * xlat/sockllcoptions.in: Likewise. 3559 * xlat/socknfcllcpoptions.in: Likewise. 3560 * xlat/sockpnpoptions.in: Likewise. 3561 * xlat/sockpppol2tpoptions.in: Likewise. 3562 * xlat/sockrdsoptions.in: Likewises. 3563 * xlat/sockrxrpcoptions.in: Likewise. 3564 * xlat/socktipcoptions.in: Likewise. 3565 * xlat/socktlsoptions.in: Likewise. 3566 * xlat/sockudpoptions.in: Likewise. 3567 * net.c: Include "xlat/sockalgoptions.h", "xlat/sockbluetoothoptions.h", 3568 "xlat/sockcaifoptions.h", "xlat/sockdccpoptions.h", 3569 "xlat/sockiucvoptions.h", "xlat/sockkcmoptions.h", 3570 "xlat/sockllcoptions.h", "xlat/socknfcllcpoptions.h", 3571 "xlat/sockpnpoptions.h", "xlat/sockpppol2tpoptions.h", 3572 "xlat/sockrdsoptions.h", "xlat/sockrxrpcoptions.h", 3573 "xlat/socktipcoptions.h", "xlat/socktlsoptions.h", 3574 and "xlat/sockudpoptions.h". 3575 (print_sockopt_fd_level_name): Decode SOL_UDP, SOL_IRDA, SOL_LLC, 3576 SOL_DCCP, SOL_TIPC, SOL_RXRPC, SOL_PPPOL2TP, SOL_BLUETOOTH, SOL_PNPIPE, 3577 SOL_RDS, SOL_IUCV, SOL_CAIF, SOL_ALG, SOL_NFC, SOL_KCM, and SOL_TLS 3578 socket option names. 3579 3580 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3581 3582 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3583 3584 net: decode more AF_* protocol names. 3585 * xlat/caif_protocols.in: New file. 3586 * xlat/can_protocols.in: Likewise. 3587 * xlat/irda_protocols.in: Likewise. 3588 * xlat/isdn_protocols.in: Likewise. 3589 * xlat/kcm_protocols.in: Likewise. 3590 * xlat/nfc_protocols.in: Likewise. 3591 * xlat/phonet_protocols.in: Likewise. 3592 * xlat/smc_protocols.in: Likewise. 3593 * net.c: Include "xlat/irda_protocols.h", "xlat/can_protocols.h", 3594 "xlat/isdn_protocols.h", "xlat/phonet_protocols.h", 3595 "xlat/caif_protocols.h", "xlat/nfc_protocols.h", 3596 "xlat/kcm_protocols.h", and "xlat/smc_protocols.h". 3597 (SYS_FUNC(socket)): Decode AF_IRDA, AF_CAN, AF_RXRPC, AF_ISDN, 3598 AF_PHONET, AF_CAIF, AF_NFC, AF_KCM, and AF_SMC protocol names. 3599 3600 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3601 3602 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3603 3604 Remove some duplicate fallback definitions. 3605 There is no need to provide duplicate fallback definitions anymore, 3606 inclusion of the appropriate xlat header in XLAT_MACROS_ONLY mode 3607 does the right thing. 3608 3609 * btrfs.c [!BTRFS_FIRST_FREE_OBJECTID] (BTRFS_FIRST_FREE_OBJECTID): 3610 Remove, a fallback definition is already provided by included 3611 "xlat/btrfs_tree_objectids.h". 3612 * net.c: Include "xlat/addrfams.h" in XLAT_MACROS_ONLY mode. 3613 [!AF_BLUETOOTH] (AF_BLUETOOTH): Remove. 3614 * syscall.c: Include "xlat/nt_descriptor_types.h" in XLAT_MACROS_ONLY 3615 mode. 3616 [!NT_PRSTATUS] (NT_PRSTATUS): Remove. 3617 3618 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3619 3620 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3621 3622 xlat/gen.sh: introduce XLAT_MACROS_ONLY macro. 3623 Sometimes we need just fallback definitions and nothing else. 3624 This change adds an interface of skipping xlat table prototypes 3625 and definitions. 3626 3627 * xlat/gen.sh (gen_header): Place xlat table prototype or definition 3628 under "#ifndef XLAT_MACROS_ONLY" guard. 3629 3630 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3631 3632 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3633 3634 rtnl_link: print IFLA_NEW_IFINDEX using decode_nla_ifindex. 3635 As it is an interface index. 3636 3637 * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_NEW_IFINDEX]>: Change 3638 the value from decode_nla_s32 to decode_nla_ifindex. 3639 3640 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3641 3642 ci: install libbluetooth-dev. 3643 * ci/install-dependencies.sh (common_packages): Add libbluetooth-dev. 3644 3645 xlat: provide fallback definitions for HCI_CHANNEL_* constants. 3646 * xlat/hci_channels.in: Provide fallback definitions. 3647 3648 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3649 3650 s390: simplify s390_runtime_instr command printing. 3651 As the header with command definitions is now a part of UAPI (since 3652 Linux commit v4.16-rc1~21^2~11), there's no need for a very special 3653 printing routine for command names. 3654 3655 * s390.c (SYS_FUNC(s390_runtime_instr)): Use printxval_d to print 3656 the command argument. 3657 * tests/s390_runtime_instr.c: Update expected output. 3658 3659 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3660 3661 tests/init.sh: add run_prog_match_grep. 3662 * tests/init.sh (run_prog_match_grep): New function, similar 3663 to run_prog_match_diff. 3664 3665 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3666 3667 tests: add so_peercred variants with different xlat verbosity levels. 3668 * tests/so_peercred-Xabbrev.c: New file. 3669 * tests/so_peercred-Xraw.c: Likewise. 3670 * tests/so_peercred-Xverbose.c: Likewise. 3671 * tests/pure_executables.list: Add so_peercred-Xabbrev, 3672 so_peercred-Xraw, and so_peercred-Xverbose. 3673 * tests/.gitignore: Likewise. 3674 * tests/so_peercred.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. 3675 * tests/gen_tests.in (so_peercred-Xabbrev, so_peercred-Xraw, 3676 so_peercred-Xverbose): New tests. 3677 3678 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3679 3680 2018-05-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3681 3682 tests: add personality variants with different xlat verbosity levels. 3683 * tests/personality-Xabbrev.c: New file. 3684 * tests/personality-Xraw.c: Likewise. 3685 * tests/personality-Xverbose.c: Likewise. 3686 * tests/pure_executables.list: Add personality-Xabbrev, 3687 personality-Xraw, and personality-Xverbose. 3688 * tests/.gitignore: Likewise. 3689 * tests/personality.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. 3690 * tests/personality.test: Add support for accepting test arguments. 3691 * tests/gen_tests.in (personality-Xabbrev, personality-Xraw, 3692 personality-Xverbose): New tests. 3693 3694 tests: add fanotify_mark variants with different xlat verbosity levels. 3695 * tests/fanotify_mark-Xabbrev.c: New file. 3696 * tests/fanotify_mark-Xraw.c: Likewise. 3697 * tests/fanotify_mark-Xverbose.c: Likewise. 3698 * tests/pure_executables.list: Add fanotify_mark-Xabbev, 3699 fanotify_mark-Xraw, and fanotify_mark-Xverbose. 3700 * tests/.gitignore: Likewise. 3701 * tests/fanotify_mark.c: Add handling of XLAT_RAW and XLAT_VERBOSE 3702 flags. 3703 * tests/gen_tests.in (fanotify_mark-Xabbev, fanotify_mark-Xraw, 3704 fanotify_mark-Xverbose): New tests. 3705 3706 2018-05-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3707 3708 xlat: provide fallback definitions for IFF_* constants. 3709 * xlat/iffflags.in: Provide fallback definitions. Mention that 3710 the array is sorted. 3711 3712 xlat: update IFF_* constants. 3713 * xlat/iffflags.in (IFF_DYNAMIC): New constant, had been introduced 3714 before the current git repository was conceived. 3715 (IFF_LOWER_UP, IFF_DORMANT): New constants, introduced by Linux commit 3716 v2.6.17-rc1~1175^2~206. 3717 (IFF_ECHO): New constant, introduced by Linux commit 3718 v2.6.25-rc1~1162^2~1415. 3719 3720 xlat: provide fallback definitions for ARPHRD_* constants. 3721 * xlat/arp_hardware_types.in: Provide fallback definitions, sort. 3722 3723 tests: add more v4l2 checks. 3724 * tests/ioctl_v4l2.c (main): Add more VIDIOC_S_EXT_CTRLS checks. 3725 3726 tests: add variants of IPC tests with different xlat verbosity levels. 3727 * tests/.gitignore: Add ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose, 3728 ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose, 3729 ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev, 3730 ipc_shm-Xraw, and ipc_shm-Xverbose. 3731 * tests/pure_executables.list: Likewise. 3732 * tests/gen_tests.in (ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose, 3733 ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose, 3734 ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev, 3735 ipc_shm-Xraw, ipc_shm-Xverbose): New tests. 3736 * tests/ipc_msg-Xabbrev.c: New file. 3737 * tests/ipc_msg-Xraw.c: Likewise. 3738 * tests/ipc_msg-Xverbose.c: Likewise. 3739 * tests/ipc_msgbuf-Xabbrev.c: Likewise. 3740 * tests/ipc_msgbuf-Xraw.c: Likewise. 3741 * tests/ipc_msgbuf-Xverbose.c: Likewise. 3742 * tests/ipc_sem-Xabbrev.c: Likewise. 3743 * tests/ipc_sem-Xraw.c: Likewise. 3744 * tests/ipc_sem-Xverbose.c: Likewise. 3745 * tests/ipc_shm-Xabbrev.c: Likewise. 3746 * tests/ipc_shm-Xraw.c: Likewise. 3747 * tests/ipc_shm-Xverbose.c: Likewise. 3748 * tests/ipc.sh: Add support for accepting test arguments. 3749 * tests/ipc_msgbuf.test: Likewise. 3750 * tests/ipc_msg.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. 3751 * tests/ipc_msgbuf.c: Likewise. 3752 * tests/ipc_sem.c: Likewise. 3753 * tests/ipc_shm.c: Likewise. 3754 3755 tests: make ipc tests a bit more strict. 3756 * tests/gen_tests.in (ipc_msg, ipc_sem, ipc_shm): Add -a option. 3757 * tests/ipc_msg.c: Replace " +" with " " in expected output. 3758 * tests/ipc_sem.c: Likewise. 3759 * tests/ipc_shm.c: Likewise. 3760 3761 ipc_shm: print SHM_HUGE_SHIFT using print_xlat_u. 3762 * ipc_shm.c (SYS_FUNC(shmget)): Print SHM_HUGE_SHIFT using print_xlat_u. 3763 3764 tests: check all bits of mtype in ipc_msgbuf test. 3765 * tests/ipc_msgbuf.c: Include <unistd.h> and <asm/unistd.h>. 3766 (sys_msgrcv): New function. 3767 (msgrcv): Use it instead of msgrcv. Add bits to mtype, 3768 check for -mtype in msgrcv. 3769 3770 tests: print expected output by ipc_msgbuf test itself. 3771 * tests/ipc_msgbuf.expected: Remove. 3772 * tests/Makefile.am (EXTRA_DIST): Remove tests/ipc_msgbuf.expected. 3773 * tests/ipc_msgbuf.c: Add expected output. 3774 * tests/ipc_msgbuf.test: Add -a31. Redirect output to $EXP. Call 3775 match_grep with $LOG and $EXP arguments. 3776 3777 2018-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 3778 3779 xlat: provide fallback definitions for SKF_*_OFF constants. 3780 * xlat/skf_off.in: New file. 3781 * bpf_sock_filter.c: Include "xlat/skf_off.h". 3782 3783 xlat: provide fallback definitions for BPF_* constants. 3784 * xlat/bpf_class.in: Add default values for constants. 3785 * xlat/bpf_miscop.in: Likewise. 3786 * xlat/bpf_mode.in: Likewise. 3787 * xlat/bpf_op_alu.in: Likewise. 3788 * xlat/bpf_op_jmp.in: Likewise. 3789 * xlat/bpf_rval.in: Likewise. 3790 * xlat/bpf_size.in: Likewise. 3791 * xlat/bpf_src.in: Likewise. 3792 3793 2018-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 3794 3795 xlat: fix F_* fallback definitions on mips64. 3796 * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [__mips64]: Fix 3797 default values. 3798 3799 Fixes: v4.22-122-gfa8f486 ("xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc") 3800 3801 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3802 3803 xlat: add fallback definitions to SO_* constants. 3804 Regenerate xlat/sockoptions.in using the following script: 3805 3806 sed -n 's/^\(SO_[^[:space:]]*\).*/\1/p' xlat/sockoptions.in | 3807 uniq | 3808 while read name; do 3809 sed -rn 's/#define[[:space:]]+('"$name"')[[:space:]]+([[:digit:]]+)$/\2\t\1/p' \ 3810 /path/to/linux/include/uapi/asm-generic/socket.h 3811 done | 3812 sort -n | 3813 while read def name; do 3814 grep -EH '#define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \ 3815 /path/to/linux/arch/*/include/uapi/asm/socket.h | 3816 sed -rn 's|^[^#]*/arch/([^/]+)/include/uapi/asm/socket\.h:#define[[:space:]]+'"$name"'[[:space:]]+([^[:space:]]+)([[:space:]].*)?$|\1\t\2|p' | 3817 sed s/parisc/hppa/ |sort | 3818 awk -vname="$name" -vdef="$def" ' 3819 { 3820 i=strtonum($2) 3821 if (i == def) next 3822 if (a[i]) 3823 a[i]=a[i] " || defined __" $1 "__" 3824 else 3825 a[i]="defined __" $1 "__" 3826 } 3827 END { 3828 iftext="#if" 3829 for (i in a) { 3830 printf("%s %s\n%s %u\n",iftext,a[i],name,i) 3831 iftext="#elif" 3832 } 3833 if (iftext != "#if") 3834 print "#else" 3835 printf("%s %s\n", name, def) 3836 if (iftext == "#if") 3837 print "" 3838 else 3839 print "#endif\n" 3840 }' 3841 done 3842 3843 * xlat/sockoptions.in: Add fallback definitions. 3844 3845 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 3846 3847 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3848 3849 xlat: remove socket options with duplicate names. 3850 * xlat/sockoptions.in (SO_GET_FILTER): Remove as it is defined 3851 to SO_ATTACH_FILTER. 3852 (SO_DETACH_BPF): Remove as it is defined to SO_DETACH_FILTER. 3853 3854 xlat: remove socket options that do not exist in Linux. 3855 * xlat/sockoptions.in (SO_ALLRAW, SO_ICS, SO_IMASOCKET, SO_LISTENING, 3856 SO_MGMT, SO_ORDREL, SO_PARALLELSVR, SO_PROTOTYPE, SO_RDWRSO_SEMA, 3857 SO_USELOOPBACK): Remove. 3858 3859 xlat: treat socketlayers as a sorted array. 3860 * xlat/socketlayers.in: Add a comment that the xlat is sorted. 3861 * net.c (print_sockopt_fd_level_name): Use printxval_search 3862 instead of printxval for decoding socket layer name. 3863 3864 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3865 3866 net: decode Bluetooth protocol names unconditionally. 3867 As we have all BTPROTO_* constant definitions now, there is no need 3868 to rely on bluetooth.h header anymore. 3869 3870 * net.c (AF_BLUETOOTH): Provide a fallback definition. 3871 [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include <bluetooth/bluetooth.h>. 3872 [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h". 3873 [!HAVE_BLUETOOTH_BLUETOOTH_H] (decode_sockbuf): Decode AF_BLUETOOTH. 3874 (decode_sockbuf) <case AF_BLUETOOTH>: Use printxval_index. 3875 * xlat/bt_protocols.in: Add "#value_indexed" directive. 3876 3877 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3878 3879 xlat/gen.sh: invoke the shell interpreter with -e -u options. 3880 * xlat/gen.sh: Change interpreter from "/bin/sh" to "/bin/sh -eu". 3881 3882 xlat: update FPE_* constants. 3883 * xlat/sigfpe_codes.in (FPE_FLTUNK): New constant, introduced by Linux 3884 commit v4.17-rc1~107^2~2. 3885 (FPE_CONDTRAP): New constant, introduced by Linux commit 3886 v4.17-rc1~31^2~3. 3887 3888 xlat: add MAP_FIXED_NOREPLACE. 3889 * xlat/mmap_flags.in (MAP_FIXED_NOREPLACE): New constant, introduced 3890 by Linux commit v4.17-rc1~52^2~14. 3891 3892 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3893 3894 xlat: provide fallback definitions for BTPROTO_* constants. 3895 As they are architecture-independent. 3896 3897 * xlat/bt_protocols.in: Add values to constants. 3898 3899 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3900 3901 xlat: add NETLINK_SMC. 3902 * xlat/netlink_protocols.in (NETLINK_SMC): New constant, introduced 3903 by Linux commit v4.11-rc1~94^2~43^2. 3904 3905 xlat: provide fallback definitions for V4L2_CID_* constants. 3906 * xlat/v4l2_control_id_bases.in: New file with fallback definitions. 3907 * xlat/v4l2_control_ids.in: Add fallback definitions. 3908 * v4l2.c: Reorder includes, include "xlat/v4l2_control_id_bases.h", 3909 remove legacy V4L2_CID_* constant definitions. 3910 3911 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3912 3913 xlat: update V4L2_CID_* constants. 3914 Synchronise v4l2_control_ids list with the one provided by kernel's 3915 include/uapi/linux/v4l2-controls.h. A few notes: 3916 - V4L2_CID_CHROMA_GAIN and V4L2_CID_COLORFX_CBCR moved in accordance 3917 with their position/values. 3918 - V4L2_CID_WHITENESS is removed as it has the same value as 3919 V4L2_CID_GAMMA. 3920 - V4L2_CID_PRIVATE_BASE is removed. 3921 - V4L2_CID_HCENTER and V4L2_CID_VCENTER that were removed by Linux 3922 commit v3.9-rc1~93^2~237, are retained for historical reasons. 3923 3924 * xlat/v4l2_control_ids.in: Update. 3925 3926 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3927 3928 xlat: provide fallback definitions for V4L2_CTRL_CLASS_* constants. 3929 As those are architecture-independant. Also note that the xlat 3930 is sorted. 3931 3932 * xlat/v4l2_control_classes.in: Add values. 3933 3934 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3935 3936 xlat: update V4L2_CTRL_CLASS_* constants. 3937 * xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_DV): New constant, 3938 introduced by Linux commit v3.7-rc1~101^2^2~322. 3939 (V4L2_CTRL_CLASS_RF_TUNER): New constant, introduced by Linux commit 3940 v3.15-rc1~85^2~192. 3941 (V4L2_CTRL_CLASS_DETECT): New constant, introduced by Linux commit 3942 v3.17-rc1~112^2~340. 3943 3944 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3945 3946 xlat: update BPF_F_* constants. 3947 Apparently, BPF_F_RDONLY and BPF_F_WRONLY are also used in map_flags. 3948 Moreover, set of flags depends on the type of map, but let's leave that 3949 for another day. 3950 3951 * xlat/bpf_map_flags.in (BPF_F_RDONLY, BPF_F_WRONLY): New constants. 3952 (BPF_F_STACK_BUILD_ID): New constant, introduced by Linux commit 3953 v4.17-rc1~148^2~156^2~3^2~1. 3954 * xlat/bpf_map_flags.in: Update expected output. 3955 3956 2018-05-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 3957 3958 xlat: add V4L2_PIX_FMT_HEVC. 3959 * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_HEVC): New constant, introduced 3960 by Linux commit v4.17-rc1~143^2~60. 3961 3962 xlat: add ETH_P_PREAUTH. 3963 * xlat/ethernet_protocols.in (ETH_P_PREAUTH): New constant, introduced 3964 by Linux commit v4.17-rc1~148^2~379^2~3. 3965 3966 xlat: update SCTP_* constants. 3967 * xlat/socksctpoptions.in (SCTP_AUTH_DEACTIVATE_KEY): New constant, 3968 introduced by Linux commit v4.17-rc1~148^2~191^2~2. 3969 (SCTP_SENDMSG_CONNECT): New constant, introduced by Linux commit 3970 v4.17-rc1~96^2~9. 3971 3972 xlat: add SPARC ADI-related SIGSEGV codes. 3973 * xlat/sigsegv_codes.in (SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR): New 3974 constants, introduced by Linux commit v4.17-rc1~147^2~4^2~10. 3975 3976 xlat: add PROT_ADI. 3977 * xlat/mmap_prot.in (PROT_ADI): New constant, introduced by Linux commit 3978 v4.17-rc1~147^2~4^2~1. 3979 3980 2018-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 3981 3982 build: rewrite libdw detection without pkg-config. 3983 pkg-config expected to be more convenient way to configure libdw, 3984 but in practice it appeared to be less portable than good old 3985 AC_CHECK_HEADERS and AC_CHECK_LIB. 3986 3987 * ci/install-dependencies.sh (common_packages): Remove pkg-config. 3988 (STACKTRACE == "libdw"): Do not install libz-dev and liblzma-dev. 3989 * debian/control (Build-Depends): Remove pkg-config. 3990 * m4/st_libdw.m4 (st_ARG_LIBDW, st_LIBDW): Rewrite without pkg-config. 3991 3992 2018-05-04 Dmitry V. Levin <ldv (a] altlinux.org> 3993 3994 ci: add more variants of unwinder to test matrices. 3995 Check x86_64 builds with libdw, with libunwind, and without stacktrace. 3996 As Travis CI doesn't provide a suitable libdw, do not test libdw there. 3997 3998 * ci/install-dependencies.sh (common_packages): Remove libdw-dev. 3999 Install libdw-dev or libunwind8-dev depending on $STACKTRACE. 4000 * ci/run-build-and-tests.sh: Specify --with-libdw=yes, 4001 --with-libunwind=yes, or --without-stacktrace depending on $STACKTRACE. 4002 * .gitlab-ci.yml (gcc-x86_64): Rename to gcc-x86_64-libdw, 4003 add STACKTRACE=libdw. 4004 (gcc-x86): Rename to gcc-x86-nounwind, add STACKTRACE=no. 4005 (clang-x86_64): Rename to clang-x86_64-libdw, add STACKTRACE=libdw. 4006 (clang-x86): Rename to clang-x86-nounwind, add STACKTRACE=no. 4007 (gcc-x86_64-libunwind, gcc-x86_64-nounwind, gcc-x86-nounwind, 4008 clang-x86_64-libunwind, clang-x86_64-nounwind, clang-x86-nounwind): 4009 New test matrix entries. 4010 * .travis.yml: Add STACKTRACE=libunwind to all x86_64 test matrix 4011 entries except musl-gcc, add STACKTRACE=no to other matrix entries, 4012 add test matrix entries with STACKTRACE=no variants on x86_64. 4013 4014 2018-05-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4015 4016 xlat: update af_packet_types. 4017 * xlat/af_packet_types.in: Add values. 4018 (PACKET_USER, PACKET_KERNEL): New constants, introduced by Linux commit 4019 v3.14-rc1~94^2~349. 4020 4021 xlat: add values to adjtimex_state, adjtimex_status, advise xlats. 4022 * xlat/adjtimex_state.in: Add values. 4023 * xlat/adjtimex_status.in: Likewise. 4024 * xlat/advise.in: Likewise. 4025 4026 xlat: update adjtimex_modes. 4027 * xlat/adjtimex_modes.in: Add values to constants. 4028 (0): Remove. 4029 (ADJ_OFFSET_SS_READ): Move to the first place. 4030 (ADJ_OFFSET_SINGLESHOT): Move to the second place. 4031 4032 2018-05-04 Dmitry V. Levin <ldv (a] altlinux.org> 4033 4034 mmap_cache: do not activate unless requested. 4035 Do not call mmap_cache functions until mmap_cache_enable is invoked. 4036 Change struct mmap_cache_t into a proxy structure, move all mmap_cache 4037 data from struct tcb inside this new structure. 4038 4039 * Makefile.am (strace_SOURCES): Move mmap_cache.c and mmap_cache.h 4040 to libstrace_a_SOURCES. 4041 * defs.h (struct tcb): Remove mmap_cache_size and mmap_cache_generation 4042 * fields. 4043 * mmap_cache.h (struct mmap_cache_t): Rename 4044 to struct mmap_cache_entry_t, create a new struct mmap_cache_t, 4045 all users updated. 4046 (mmap_cache_delete): Remove. 4047 * mmap_cache.c (mmap_cache_delete): Rename to delete_mmap_cache, 4048 add static qualifier. 4049 (build_mmap_cache): Merge into mmap_cache_rebuild_if_invalid. 4050 * strace.c (droptcb): Replace mmap_cache_delete invocation 4051 with tcp->mmap_cache->free_fn. 4052 4053 2018-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 4054 4055 mmap_cache: remove mmap_cache_is_enabled. 4056 This function is no longer used and could be removed. 4057 4058 * mmap_cache.c (mmap_cache_is_enabled): Remove. 4059 * mmap_cache.h: Likewise. 4060 4061 2018-05-03 Masatake YAMATO <yamato (a] redhat.com> 4062 4063 unwind-libdw: use the mmap_notify subsystem. 4064 The unwind subsystem uses the mmap_cache subsystem even it uses 4065 unwind-libdw as backend. unwind-libdw doesn't need the full set of the 4066 mmap_cache subsystem; libdw has a feature for caching a memory 4067 mapping. 4068 4069 This commit does three things. 4070 4071 (1) Make the unwind subsystem not use the mmap_cache subsystem. 4072 The unwind subsystem never concern the memory mapping of the target. 4073 It becomes a thin layer. 4074 4075 (2) Make unwind-libunwind use the mmap_cache subsystem directly. 4076 4077 (3) Make unwind-libdw use the mmap_notify subsystem to know when it 4078 should call dwfl_linux_proc_report/dwfl_report_end for updating the 4079 cache. 4080 4081 Here is a subsystem structure that this patch 4082 introduces: 4083 4084 +-------------------------------------+ 4085 | unwind subsys | 4086 +------------------+------------------+ 4087 | unwind-libunwind | unwind-libdw | 4088 +------------------+------------------+ 4089 | mmap_cache | | 4090 +------------------+ | 4091 | mmap_notify | 4092 +-------------------------------------+ 4093 | syscall | 4094 +-------------------------------------+ 4095 mmap/munmap/mprotect/brk... 4096 4097 * unwind.c: Don't include "mmap_cache.h". 4098 (unwind_init): Don't call mmap_cache_enable. 4099 (unwind_tcb_print, unwind_tcb_capture): Don't call mmap_cache related 4100 functions, just invoke unwinder.tcb_walk. 4101 * unwind.h (struct unwind_unwinder_t): Remove tcb_flush_cache field. 4102 4103 * unwind-libdw.c: Include "mmap_notify.h" instead of "mmap_cache.h". 4104 (struct ctx): Add last_proc_updating field to record the generation 4105 of memory mapping that is cached by dwfl_linux_proc_report 4106 and dwfl_report_end. 4107 (mapping_generation): A variable counting how many times the memory 4108 mapping of targets has been changed. 4109 (updating_mapping_generation): New utility function for updating 4110 mapping_generation. 4111 (init): New function for registering updating_mapping_generation 4112 in the mmap_notify subsystem as a callback function. 4113 (tcb_init): Initialize ctx::last_proc_updating. 4114 (tcb_flush_cache): Rename to flush_cache_maybe. Rebuild the cache data 4115 only if the data is stale. 4116 (tcb_walk): Call flush_cache_maybe for avoiding referring staled cache data. 4117 (unwinder): Set init function, remove tcb_flush_cache field. 4118 * unwind-libunwind.c (init): Enable the mmap_cache subsystem. 4119 (tcb_walk): Call mmap_cache_rebuild_if_invalid and unw_flush_cache for 4120 updating the cache of the memory mapping before walking the stack. 4121 (tcb_walk): Rename to walk. 4122 (unwinder): Remove tcb_flush_cache field. 4123 4124 2018-05-03 Masatake YAMATO <yamato (a] redhat.com> 4125 4126 unwind-libdw: introduce indirect data structure for storing unwinding context 4127 unwind-libdw uses Dwfl as the data structure for storing unwinding 4128 context. It is raw data that come from libdw. 4129 4130 This commit introduces "struct ctx" file local data type for allowing 4131 unwind-libdw to attach strace side data to the unwinding context. 4132 4133 * unwind-libdw.c (struct ctx): New struct definition. 4134 (tcb_init, tcb_fin, tcb_walk, tcb_flush_cache): Use struct ctx instead 4135 of Dwfl directly. 4136 4137 2018-05-03 Masatake YAMATO <yamato (a] redhat.com> 4138 4139 mmap_notify: rename the macro for tracking memory mapping. 4140 * sysent.h (STACKTRACE_INVALIDATE_CACHE): Rename to 4141 MEMORY_MAPPING_CHANGE. All users updated. 4142 4143 mmap_cache: use the mmap_notify subsystem. 4144 * mmap_cache.c: Include mmap_notify.h. 4145 (mmap_cache_enable): Call mmap_notify_register_client to use 4146 the mmap_notify subsystem, mmap_cache_invalidate is specified 4147 to handle the change of memory mapping. 4148 (mmap_cache_invalidate): Add static qualifier. 4149 * mmap_cache.h (mmap_cache_invalidate): Remove. 4150 * syscall.c: Include mmap_notify.h instead of mmap_cache.h. 4151 (syscall_exiting_decode): Call mmap_notify_report instead 4152 of mmap_cache_invalidate. 4153 4154 2018-05-03 Masatake YAMATO <yamato (a] redhat.com> 4155 4156 mmap_notify: new subsystem for tracking the changes of memory mappings. 4157 This subsystem is a spin-off of the mmap_cache subsystem. 4158 4159 The mmap_cache subsystem had two features: (1) tracking the change 4160 of memory mapping, and (2) maintaining the cache of memory mapping. 4161 4162 mmap_notify is a subsystem specialized to provide feature (2). 4163 unwind-libdw itself has the feature (1). It needs only (2). 4164 4165 * mmap_notify.h: New file. 4166 * mmap_notify.c: Likewise. 4167 * Makefile.am (strace_SOURCES): Add them. 4168 4169 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4170 4171 btrfs: add missing braces. 4172 Reported by Coverity. 4173 4174 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case 4175 BTRFS_IOC_TREE_SEARCH_V2>: Add missing braces. 4176 4177 Fixes: v4.22-76-gf766447 "btrfs: use PRINT_FIELD_*" 4178 4179 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4180 4181 strace.c: check return code of never failing fcntl call. 4182 Because the kernel cannot be trusted. 4183 4184 * strace.c (set_cloexec_flag): Call perror_msg_and_die if fcntl(F_SETFD) 4185 has failed. 4186 4187 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4188 4189 sock: use error_func_msg for printing function name. 4190 * sock.c (decode_ifconf): Use error_func_msg instead of error_msg with 4191 manual function name printing. 4192 4193 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4194 4195 util.c: add len sanity checks to dumpstr. 4196 Reported by clang. 4197 4198 * util.c (dumpstr): Check that len is sane. 4199 4200 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4201 4202 mmap_cache: fool-proofing build_mmap_cache. 4203 Let's try to handle better the situation when build_mmap_cache is called 4204 without mmap_cache/mmap_cache_size being reset prior to the call. 4205 4206 Reported by Coverity scan. 4207 4208 * mmap_cache.c (build_mmap_cache): Set cache_head to tcp->mmap_cache. 4209 Reset tcp->mmap_cache_size to 0. 4210 4211 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4212 4213 error_prints: add missing va_end() calls. 4214 These missing va_end() calls are followed by die() calls that never 4215 return, so the only practical effect of this change is appeasement 4216 of code checking tools. 4217 4218 Reported by cppcheck. 4219 4220 * error_prints.c (error_msg_and_die, error_msg_and_help, 4221 perror_msg_and_die): Add va_end(). 4222 4223 2018-05-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4224 4225 mem: handle potential error from sysconf(_SC_PAGESIZE) 4226 Reported by Coverity scan. 4227 4228 * mem.c (get_pagesize): Handle the case when sysconf(_SC_PAGESIZE) 4229 returns an error. 4230 4231 2018-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 4232 4233 xlat: merge fcntl64cmds into fcntlcmds. 4234 Since we don't have to workaround old F_[GS]ETOWN_EX == F_[SG]ETLK64 4235 kernel bug any longer, there is a room for cleanup. 4236 4237 * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64): Add from 4238 xlat/fcntl64cmds.in. 4239 * xlat/fcntl64cmds.in: Remove. 4240 * fcntl.c: Do not include "xlat/fcntl64cmds.h". 4241 (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Do not use fcntl64cmds, call 4242 printxval instead of printxvals. 4243 4244 2018-05-03 Zhibin Li <08826794brmt (a] gmail.com> 4245 4246 tests: check decoding of F_GETOWN_EX and F_SETOWN_EX fcntl commands. 4247 * tests/fcntl.c (TEST_F_OWNER_EX): New macro. 4248 [TEST_F_OWNER_EX]: Include "f_owner_ex.h". 4249 [TEST_F_OWNER_EX] (test_f_owner_ex_type_pid, 4250 test_f_owner_ex_umove_or_printaddr, test_f_owner_ex): New functions. 4251 (main) [TEST_F_OWNER_EX]: Use test_f_owner_ex. 4252 4253 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4254 4255 2018-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 4256 4257 Introduce f_owner_ex.h. 4258 Some headers define struct f_owner_ex, some struct __kernel_f_owner_ex, 4259 we have to support both variants. 4260 4261 * configure.ac (AC_CHECK_TYPES): Check for "struct f_owner_ex" 4262 and "struct __kernel_f_owner_ex" in <linux/fcntl.h>. 4263 * f_owner_ex.h: New file. 4264 * Makefile.am (strace_SOURCES): Add it. 4265 4266 2018-05-02 Masatake YAMATO <yamato (a] redhat.com> 4267 4268 tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentry. 4269 Since Linux 4.16, kernel appends the cpuid as suffix to the entry 4270 for a kvm vcpu in /proc/$pid/fd like: 4271 4272 anon_inode:kvm-vcpu:0 4273 4274 That was 4275 4276 anon_inode:kvm-vcpu 4277 4278 This kernel change causes the test case failure on newer kernels. 4279 Update the test to deal with the new name as well as the old one. 4280 4281 * tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2). 4282 (vcpu_dev_should_have_cpuid): New function for detecting whether 4283 a proc entry for given fd has the cpuid suffix or not. 4284 (main): Trim vcpu_dev to remove the cpuid suffix if needed. 4285 (vcpu_dev): Remove const modifier. 4286 4287 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4288 4289 xlat: check that system definitions match fallback definitions. 4290 For each constant that is accompanied by a fallback definition, 4291 generate a sanity check that the definition provided by system headers 4292 matches the fallback definition. 4293 4294 * gcc_compat.h (DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE, 4295 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE): New macros. 4296 * xlat/gen.sh (cond_def): Generate a code that checks the system 4297 definition against the default. 4298 (gen_header): Generate a code that includes "gcc_compat.h" and 4299 "static_assert.h". 4300 4301 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 4302 4303 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4304 4305 xlat: override values of F_SETOWN_EX and F_GETOWN_EX constants. 4306 Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX 4307 and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix 4308 the conflict with F_GETLK64 and F_SETLK64 constants. 4309 4310 Looks like the best way to handle this situation is to pretend that 4311 old values of F_SETOWN_EX and F_GETOWN_EX didn't exist. 4312 4313 * xlat/fcntlcmds.in (F_SETOWN_EX, F_GETOWN_EX): Undefine. 4314 4315 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4316 4317 xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc. 4318 * xlat/fcntlcmds.in (F_GETLK, F_SETLK, F_SETLKW, F_SETOWN, F_GETOWN, 4319 F_SETSIG, F_GETSIG) [alpha || hppa || mips || sparc]: Fix definitions. 4320 * xlat/fcntl64cmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [hppa || mips]: 4321 Likewise. 4322 4323 xlat: fix SI_* fallback definitions on mips. 4324 * xlat/siginfo_codes.in [mips] (SI_ASYNCIO, SI_TIMER, SI_MESGQ): Define 4325 to -2, -3, and -4, respectively. 4326 4327 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4328 4329 xlat: override values of KEY_RFKILL and KEY_BRIGHTNESS_MIN constants. 4330 KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel 4331 commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively. 4332 Apparently, RHEL6 introduced an alternative KEY_RFKILL constant 4333 with the same value as upstream KEY_NUMERIC_A. 4334 4335 KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced 4336 by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7. 4337 Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant 4338 with the same value as upstream KEY_BRIGHTNESS_MAX. 4339 4340 Downstream vendors are *not* allowed to do this. 4341 Ignore the system value of KEY_RFKILL and KEY_BRIGHTNESS_MIN. 4342 4343 * xlat/evdev_keycode.in (KEY_RFKILL, KEY_BRIGHTNESS_MIN): Undefine. 4344 4345 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4346 4347 xlat: override the value of KEY_DATA constant. 4348 Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA 4349 constant introduced by commit v4.7-rc6~32^2~6^2 because the old value 4350 was already used by KEY_FASTREVERSE. 4351 4352 Looks like the best way to handle this situation is to pretend that 4353 the old value of KEY_DATA didn't exist. 4354 4355 * xlat/evdev_keycode.in (KEY_DATA): Undefine. 4356 4357 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4358 4359 xlat: override the value of AUDIT_FEATURE_CHANGE constant. 4360 Linux kernel commit v3.15-rc1~18^2~1 has changed the value 4361 of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20 4362 which is of course an ABI breakage that affected 3.13 and 3.14 kernel 4363 releases as well as their LTS derivatives. 4364 4365 Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value 4366 of AUDIT_FEATURE_CHANGE was ignored by userspace because of the 4367 established convention how netlink messages for the audit system 4368 are divided into blocks. 4369 4370 Looks like the best way to handle this situation is to pretend that 4371 the old value of AUDIT_FEATURE_CHANGE didn't exist. 4372 4373 * xlat/nl_audit_types.in (AUDIT_FEATURE_CHANGE): Undefine. 4374 4375 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 4376 4377 2018-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 4378 4379 xlat: fix MCL_* fallback definitions on alpha, ppc, ppc64, and sparc. 4380 On these architectures, MCL_* constants are different. 4381 4382 * xlat/socketlayers.in [__alpha__ || __powerpc__ || __powerpc64__ 4383 || __sparc__] (MCL_CURRENT, MCL_FUTURE, MCL_ONFAULT): Define to 0x2000, 4384 0x4000, and 0x8000, respectively. 4385 4386 2018-04-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4387 4388 xlat: fix SOL_SOCKET fallback definition on alpha, hppa, mips, and sparc 4389 On these architectures, SOL_SOCKET is 0xffff and not 1. 4390 4391 * xlat/socketlayers.in [__alpha__ || __hppa__ || __mips__ || __sparc__] 4392 (SOL_SOCKET): Define to 0xffff. 4393 4394 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4395 4396 2018-04-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4397 4398 tests: add more mount checks. 4399 * tests/gen_tests.in (mount, mount-Xabbrev, mount-Xraw, mount-Xverbose): 4400 Add -a33 option. 4401 * tests/mount.c: Check printing of flags and pointers. 4402 4403 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4404 4405 2018-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 4406 4407 tests: use sprintrc in mount test. 4408 * tests/mount.c (main): Use sprintrc. 4409 4410 2018-04-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4411 4412 tests: add mount variants with different xlat verbosity levels. 4413 * tests/mount-Xabbrev.c: New file. 4414 * tests/mount-Xraw.c: Likewise. 4415 * tests/mount-Xverbose.c: Likewise. 4416 * tests/mount.c: Add handling of XLAT_RAW and XLAT_VERBOSE macros. 4417 * tests/pure_executables.list: Add mount-Xabbrev, mount-Xraw, 4418 and mount-Xverbose. 4419 * tests/.gitignore: Likewise. 4420 * tests/gen_tests.in (mount-Xabbrev, mount-Xraw, mount-Xverbose): New 4421 tests. 4422 4423 tests: add old_mmap variants with different xlat verbosity levels. 4424 * tests/old_mmap-Xabbrev.c: New file. 4425 * tests/old_mmap-Xraw.c: Likewise. 4426 * tests/old_mmap-Xverbose.c: Likewise. 4427 * tests/old_mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE 4428 macros. 4429 * tests/pure_executables.list: Add old_mmap-Xabbrev, old_mmap-Xraw, 4430 and old_mmap-Xverbose. 4431 * tests/.gitignore: Likewise. 4432 * tests/gen_tests.in (old_mmap-Xabbrev, old_mmap-Xraw, 4433 old_mmap-Xverbose): New tests. 4434 4435 2018-04-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4436 4437 tests: add mmap/mmap64 variants different xlat verbosity levels. 4438 * tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define. 4439 [!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise. 4440 * tests/mmap-Xabbrev.c: New file. 4441 * tests/mmap-Xraw.c: Likewise. 4442 * tests/mmap-Xverbose.c: Likewise. 4443 * tests/mmap64-Xabbrev.c: Likewise. 4444 * tests/mmap64-Xraw.c: Likewise. 4445 * tests/mmap64-Xverbose.c: Likewise. 4446 * tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros. 4447 * tests/mmap.test: Add handling of optional test arguments that set 4448 alignment and xlat verbosity options. 4449 * tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS, 4450 mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS. 4451 * tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw, 4452 mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose. 4453 * tests/.gitignore: Likewise. 4454 * tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose, 4455 mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests. 4456 4457 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4458 4459 2018-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 4460 4461 Fix fallback definition of MSG_ZEROCOPY. 4462 * xlat/msg_flags.in (MSG_ZEROCOPY): Set fallback definition to 0x4000000. 4463 4464 Fixes: v4.21~316 ("Update MSG_* constants") 4465 4466 2018-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 4467 4468 build: try to use _Static_assert if static_assert is not available. 4469 * configure.ac: Check for _Static_assert if static_assert 4470 is not available. 4471 * static_assert.h [!HAVE_STATIC_ASSERT && HAVE__STATIC_ASSERT] 4472 (static_assert): Define to _Static_assert. 4473 4474 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4475 4476 printmode: add xlat style support to print_symbolic_mode_t. 4477 * printmode.c (print_symbolic_mode_t): Set ifmt to an empty string, 4478 print raw and decoded values based on current xlat_verbosity setting. 4479 4480 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4481 4482 evdev: remove XT_NORMAL. 4483 It is no longer used. 4484 4485 * evdev.c (enum xlat_type) <XT_NORMAL>: Remove. 4486 (printxval_dispatch) <case XT_NORMAL>: Remove. 4487 4488 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4489 4490 Switch to use of value-indexed xlats for evdev constants. 4491 * xlat/evdev_abs.in: Add "#value_indexed" directive. 4492 * xlat/evdev_autorepeat.in: Likewise. 4493 * xlat/evdev_ff_status.in: Likewise. 4494 * xlat/evdev_keycode.in: Likewise. 4495 * xlat/evdev_leds.in: Likewise. 4496 * xlat/evdev_misc.in: Likewise. 4497 * xlat/evdev_prop.in: Likewise. 4498 * xlat/evdev_relative_axes.in: Likewise. 4499 * xlat/evdev_snd.in: Likewise. 4500 * xlat/evdev_switch.in: Likewise. 4501 * xlat/evdev_sync.in: Likewise. 4502 * xlat/evdev_ff_types.in: Add a comment about sorting. 4503 * evdev.c (keycode_ioctl, keycode_V2_ioctl): Use printxval_index 4504 instead of printxval. 4505 (bit_ioctl): Use XT_SORTED for evdev_ff_types, use XT_INDEXED 4506 for other xlats. 4507 (evdev_read_ioctl): Use XT_INDEXED for all xlats. 4508 * ioctl.c (evdev_decode_number): Use printxval_indexn instead of 4509 printxval for evdev_abs. 4510 4511 evdev: support various types of xlats in decode_bitset. 4512 * evdev.c (enum xlat_type): New enumeration. 4513 (printxval_dispatch): New function. 4514 (decode_bitset_): Rename from decode_bitset, add decode_nr_size 4515 and xt arguments, call printxval_dispatch instead of printxval. 4516 (decode_bitset): Add a decode_bitset_ wrapper that derives 4517 decode_nr_size from the ARRAY_SIZE of decode_nr. 4518 (bit_ioctl, evdev_read_ioctl): Update decode_bitset calls. 4519 4520 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4521 4522 Move xlat/evdev_abs.h inclusion from ioctl.c to evdev.c. 4523 Also introduce evdev_abs_size constant, which will be needed later. 4524 4525 * defs.h (evdev_abs_size): New declaration. 4526 * ioctl.c: Move xlat/evdev_abs.h inclusion ... 4527 * evdev.c: ... here. 4528 (evdev_abs_size): New constant variable. 4529 4530 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4531 4532 Add support for value-indexed xlats. 4533 There are quite a few xlats that start from 0 and not too sparse, 4534 we can push the search time for them down to O(1). 4535 4536 * defs.h (printxval_indexn_ex): New declaration. 4537 (printxval_indexn, printxval_index, printxval_index_ex): New macros. 4538 * xlat.c (printxval_sized): Rename from printxval_searchn_ex, 4539 add fn argument, call it instead of xlat_search. 4540 (printxval_searchn_ex): Implement as a thin wrapper around 4541 printxval_sized using xlat_search as a search function. 4542 (xlat_idx): New function. 4543 (printxval_indexn_ex): New function, a thin wrapper around 4544 printxval_sized using xlat_idx as a search function. 4545 * xlat/gen.sh: Add support for "#value_indexed" directive. 4546 4547 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4548 4549 socketcall: use printxval_d for printing call argument. 4550 * socketcall.c (SYS_FUNC(socketcall)): Use printxval_d instead of manual 4551 call argument decoding. 4552 4553 signal: use print_xlat_ex in print_sa_handler. 4554 * signal.c (print_sa_handler): Call print_xlat_ex instead of tprints 4555 in order to respect current xlat style setting. 4556 4557 s390: use printxvals_ex for command printing in s390_runtime_instr. 4558 * s390.c (SYS_FUNC(s390_runtime_instr)): Replace manual command argument 4559 decoding with a printxvals_ex call. 4560 4561 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4562 4563 printsiginfo: use print_xlat_ex in print_si_code. 4564 In order to respect current xlat style setting. 4565 4566 * printsiginfo.c (print_si_code): Use print_xlat_ex instead of manual 4567 string/value printing. 4568 4569 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4570 4571 open: use print_xlat_ex for printing open modes. 4572 In order to respect xlat style setting. 4573 4574 * open.c (tprint_open_modes): Use print_xlat_ex instead of 4575 tprint_open_modes. 4576 4577 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4578 4579 netlink: use print_xlat_ex in decode_nlmsg_type_netfilter. 4580 In order to respect current xlat style setting. 4581 4582 * netlink.c (decode_nlmsg_type_netfilter): Use print_xlat_ex 4583 instead of tprints. 4584 4585 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4586 4587 net: use print_xlat_ex in tprint_sock_type. 4588 In order to respect current xlat style setting. 4589 4590 * next.c (tprint_sock_type): Use print_xlat_ex instead of tprints 4591 for socket type printing. 4592 4593 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4594 4595 keyctl: use printxval_d for printing keyring serial number. 4596 * keyctl.c (print_keyring_serial_number): Use printxval_d instead of 4597 looking up and printing xlat value manually. 4598 * xlat/key_spec.in: Add "#val_type int" so the xlat values have sign 4599 bit propagated. 4600 4601 ipc: use printxval_u instead of manual xlat value printing. 4602 * ipc.c (SYS_FUNC(ipc)): Decode call argument using printxval_u. 4603 4604 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4605 4606 ioprio: use sprintxval instead of xlookup and string/value printing. 4607 In order to respect current xlat style. 4608 4609 * ioprio.c (sprint_ioprio): Use sprintxval for producing string 4610 representation of ioprio class, use the produced string representation 4611 in resulting xsprintf. 4612 4613 2018-04-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4614 4615 xlat: handle NULL str in print_xlat_ex. 4616 It allows to use the following code pattern: 4617 4618 print_xlat_ex(val, xlookup(xlat, val), XLAT_STYLE_FMT_D); 4619 4620 * xlat.c (print_xlat_ex): Handle str being NULL: print val instead. 4621 4622 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4623 4624 2018-04-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4625 4626 strace.1.in: fix typo (Ronald -> Roland) 4627 A very unfortunate one, though. 4628 4629 NEWS: mention that -X option addresses Debian bug #692915. 4630 4631 2018-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4632 4633 ioctl: do not include linux/input.h. 4634 All the ABS_* and EV_* values are now available internally, 4635 there's no need to include the header. 4636 4637 * ioctl.c [HAVE_LINUX_INPUT_H]: Do not include linux/input.h. 4638 4639 2018-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4640 4641 tests: add more evdev ioctl checks. 4642 tests/ioctl_evdev.c (TEST_NULL_ARG_EX): Rename from TEST_NULL_ARG, add 4643 str argument, print it instead of #cmd. 4644 (TEST_NULL_ARG): Implement as a TEST_NULL_ARG_EX wrapper. 4645 (main): Add checks for EVIOCSABS and EVIOCGBIT ioctls. 4646 4647 evdev: decode EV_SW unconditionally. 4648 * evdev.c (bit_ioctl): Remove [EV_SW] check. 4649 * tests/ioctl_evdev.c [!EV_SW] (EV_SW): Define. 4650 (main): Remove [EV_SW] check. 4651 4652 2018-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4653 4654 xlat: provide fallback definitions for arch-independent evdev constants. 4655 * xlat/evdev_abs.in: Add constant values. 4656 * xlat/evdev_autorepeat.in: Likewise. 4657 * xlat/evdev_ev.in: Likewise. 4658 * xlat/evdev_ff_status.in: Likewise. 4659 * xlat/evdev_ff_types.in: Likewise. 4660 * xlat/evdev_leds.in: Likewise. 4661 * xlat/evdev_misc.in: Likewise. 4662 * xlat/evdev_prop.in: Likewise. 4663 * xlat/evdev_relative_axes.in: Likewise. 4664 * xlat/evdev_snd.in: Likewise. 4665 * xlat/evdev_switch.in: Likewise. 4666 * xlat/evdev_sync.in: Likewise. 4667 4668 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4669 4670 2018-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4671 4672 xlat/evdev_switch.in: update. 4673 * xlat/evdev_switch.in (SW_RADIO): Remove, as it was renamed to 4674 SW_RFKILL_ALL and marked as deprecated by Linux commit v2.6.26-rc5~32^2. 4675 (SW_PEN_INSERTED): New constant, was added by Linux commit v4.7~11^2~7. 4676 4677 2018-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4678 4679 util.c: make "Out of memory" messages a bit more informative. 4680 Since these are emitted in multiple places and are not expected during 4681 any normal operation, it makes sense to report the caller name. 4682 4683 * util.c (print_quoted_string_ex, print_quoted_string_ex, dumpiov_upto, 4684 dumpstr): Replace error_msg with error_func_msg. 4685 4686 2018-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4687 4688 ci: reorder travis jobs. 4689 Run coverage check first as it is the longest one. 4690 4691 * .travis.yml (matrix): Reorder. 4692 4693 2018-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4694 4695 xlat: add MS_SUBMOUNT constant. 4696 * xlat/mount_flags.in (MS_SUBMOUNT): New constant, introduced 4697 by Linux commit v4.11-rc1~82^2~7. 4698 4699 2018-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4700 4701 fcntl: replace combinations of xlookup and printxval with printxvals. 4702 After all, that's what printxvals for. 4703 4704 * fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for 4705 printing value with multiple xlat tables as constant sources. 4706 4707 2018-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4708 4709 Move xlat_verbose and xlat_format from xlat.c to defs.h. 4710 As it will be used elsewhere. 4711 4712 * xlat.c (xlat_verbose, xlat_format): Move... 4713 * defs.h: ...here. 4714 4715 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4716 4717 btrfs: use printxval_u for error types printing. 4718 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case 4719 BTRFS_IOC_GET_DEV_STATS>: Use printxval_u for error type printing. 4720 * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output. 4721 4722 btrfs: print device IDs using PRINT_FIELD_DEV. 4723 * btrfs.c (btrfs_print_balance_args): Print devid field using 4724 PRINT_FIELD_DEV. 4725 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_INFO, 4726 case BTRFS_IOC_GET_DEV_STATS, case BTRFS_IOC_SCRUB, 4727 case BTRFS_IOC_SCRUB_PROGRESS>: Likewise. 4728 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print 4729 start.srcdevid field using PRINT_FIELD_DEV. 4730 * tests/btrfs.c: Update expected output. 4731 4732 btrfs: print cont_reading_from_srcdev_mode as xlat. 4733 * xlat/btrfs_cont_reading_from_srcdev_mode.in: New file. 4734 * btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h". 4735 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_DEV_REPLACE>: Print 4736 named values for the 4737 struct btrfs_ioctl_dev_replace_args.start.cont_reading_from_srcdev_mode 4738 field. 4739 * tests/btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h". 4740 (btrfs_test_dev_replace_ioctl): Update expected output. 4741 4742 btrfs: use PRINT_FIELD_* 4743 * btrfs.c (btrfs_print_balance_args, btrfs_print_balance, 4744 btrfs_print_features, btrfs_print_qgroup_limit, 4745 btrfs_print_data_container_header, 4746 print_btrfs_data_container_logical_ino, btrfs_print_qgroup_inherit, 4747 btrfs_print_tree_search, print_btrfs_ioctl_space_info, btrfs_ioctl): 4748 Use PRINT_FIELD_* macros for printing structure fields. 4749 4750 btrfs: make BTRFS_IOC_GET_DEV_STATS error statistics output more structured 4751 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case 4752 BTRFS_IOC_GET_DEV_STATS>: Print array index in square brackets before 4753 the value in order to avoid confusion. 4754 * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output. 4755 4756 ioctl: print ioctl number in accordance with xlat verbosity setting. 4757 * ioctl.c (SYS_FUNC(ioctl)): Print ioctl command name in accordance 4758 with the current xlat_verbosity setting. 4759 * tests/btrfs.c (sprint_xlat_): New function. 4760 (ioc): New macro, a wrapper for sprint_xlat_. 4761 Update expected output. 4762 4763 file_ioctl: make abbreviated output more structured. 4764 * file_ioctl.c (file_ioctl): Print fm_extents field name only in case 4765 of non-abbreviated output. 4766 * tests/btrfs.c (btrfs_test_ino_path_ioctls): Update expected output. 4767 4768 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4769 4770 btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args. 4771 For some reason, he decoder of BTRFS_IOC_QUOTA_CTL command didn't print 4772 opening curly brace and field name, only the closing curly brace. 4773 4774 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_QUOTA_CTL>: 4775 Print "{cmd=". 4776 * tests/btrfs.c (btrfs_test_quota_ctl_ioctl): Update expected output. 4777 4778 Fixes: v4.12~100 "ioctl: add decoding support for btrfs ioctls" 4779 4780 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4781 4782 btrfs: consistently use PRINT_FIELD_U64. 4783 * btrfs.c (print_u64, print_member_u64, print_key_value_internal, 4784 print_key_value): Remove. 4785 (btrfs_print_balance_args): Use PRINT_FIELD_U64 instead of 4786 print_member_u64. 4787 (btrfs_print_tree_search): Use PRINT_FIELD_U64 instead of 4788 print_key_value. 4789 (MPERS_PRINTER_DECL(btrfs_ioctl)): Use PRINT_FIELD_U64 instead of manual 4790 UINT64_MAX printing. 4791 * tests/btrfs.c: Update expected output in order to account fields that 4792 are now affected by xlat_verbosity setting. 4793 4794 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4795 4796 btrfs: print {min,max}_{offset,transid} unconditionally. 4797 As it looks like there's no reason to skip their printing. 4798 4799 * btrfs.c (print_key_value_internal): Do not check value argument 4800 for holding non-zero value. 4801 * tests/btrfs.c (btrfs_print_search_key): Update expected output. 4802 4803 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4804 4805 tests/btrfs.c: accept possible failure of BTRFS_IOC_BALANCE_V2. 4806 BTRFS_IOC_BALANCE_V2 ioctl might fail sometimes (for example, if it 4807 decides that it doesn't have enough free space). 4808 4809 * tests/btrfs.c (btrfs_test_balance_ioctls): Print expected output for 4810 the BTRFS_IOC_BALANCE_V2 call based on its return code. 4811 4812 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4813 4814 tests/btrfs.c: support volumes with mixed data/metadata in BTRFS_IOC_BALANCE_V2 4815 For these volumes, pend/vend should be the same for data and meta. 4816 4817 * tests/btrfs.c (btrfs_test_balance_ioctls): Set args.meta.pend and 4818 args.meta.vend to the same values as args.data.pend and args.data.vend, 4819 respectively. 4820 4821 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4822 4823 tests/btrfs.c: check BTRFS_IOC_SUBVOL_CREATE_V2 result. 4824 Otherwise the subsequent openat call fails with a cryptic message. 4825 4826 * tests/btrfs.c (btrfs_test_subvol_ioctls): Check return code of the 4827 BTRFS_IOC_SUBVOL_CREATE_V2 ioctl call that is supposed to be successful. 4828 4829 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4830 4831 tests/btrfs.c: add pid suffix to the created directory, remove it on exit 4832 If multiple tests are running simultaneously in the same directory, 4833 conflicts (and test failures) may happen. 4834 4835 * tests/btrfs.c (path, dir_name_fmt, dir_name): New variables. 4836 (btrfs_test_ino_path_ioctls): Use dir_name for printing directory name. 4837 (rm_test_dir): New function. 4838 (main): Generate dir_name, use it instead of fixed name, add rm_test_dir 4839 as an atexit handler. 4840 4841 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4842 4843 btrfs: duplicate printing of opening braces on entering/exiting. 4844 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)): Print opening bracket 4845 on entering and exiting separately. 4846 4847 btrfs: refactor timespec printing into print_btrfs_timespec. 4848 * btrfs.c (print_btrfs_timespec): New function. 4849 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SET_RECEIVED_SUBVOL>: 4850 Use print_btrfs_timespec for printing stime and rtime fields. 4851 * tests/btrfs.c (btrfs_test_set_received_subvol_ioctl): Update expected 4852 output. 4853 4854 btrfs: print abbreviations and field names more consistently. 4855 * btrfs.c (btrfs_print_data_container_header): Do not print ", val=". 4856 (btrfs_print_ino_path_container): Print val field name only in case 4857 of non-abbreviated output. 4858 (btrfs_print_qgroup_inherit): Print qgroups field name only in case 4859 of non-abbreviated output. 4860 (btrfs_print_tree_search): Print buf field name only in case 4861 of non-abbreviated output. 4862 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SEND>: Print 4863 clone_sources field name only in case of non-abbreviated output. 4864 (MPERS_PRINTER_DECL(btrfs_ioctl)) <case BTRFS_IOC_SPACE_INFO>: Print 4865 spaces field name only in case of non-abbreviated output. 4866 * tests/btrfs.c: Update expected output. 4867 4868 btrfs: move printing of the field name inside btrfs_print_qgroup_limit. 4869 * btrfs.c (btrfs_print_qgroup_limit): Print ", lim=". 4870 (btrfs_print_qgroup_inherit, MPERS_PRINTER_DECL(btrfs_ioctl)): Do not 4871 print ", lim=" before btrfs_print_qgroup_limit call. 4872 4873 btrfs: convert btrfs_print_{objectid,key_type} to PRINT_FIELD_XVAL_U. 4874 * btrfs.c (btrfs_print_key_type, btrfs_print_objectid): Convert into 4875 thin wrappers around PRINT_FIELD_XVAL_U. 4876 (btrfs_print_data_container_header, btrfs_print_tree_search, 4877 MPERS_PRINTER_DECL(btrfs_ioctl)): Update calls to btrfs_print_key_type 4878 and btrfs_print_objectid in accordance with the new calling convention. 4879 (print_objectid_callback): Use printxvals_ex directly instead of 4880 btrfs_print_objectid call. 4881 * tests/btrfs.c (btrfs_print_objectid, btrfs_print_key_type): Update 4882 expected output. 4883 4884 tests: add btrfs tests with verbose xlat decoding. 4885 * tests/btrfs-X.test: New test. 4886 * tests/btrfs-vX.test: Likewise. 4887 * tests/btrfs-vwX.test: Likewise. 4888 * tests/btrfs-wX.test: Likewise. 4889 * tests/Makefile.am (DECODER_TESTS): Add them. 4890 * tests/btrfs.c (verbose_xlat): New static variable. 4891 (prfl_btrfs, prxval_btrfs): New function. 4892 (btrfs_print_qgroup_inherit, btrfs_print_vol_args_v2, 4893 btrfs_print_balance_args, btrfs_test_balance_ioctls, 4894 btrfs_test_clone_ioctls, btrfs_test_defrag_ioctls, 4895 btrfs_test_space_info_ioctl, btrfs_print_defrag_range_args, 4896 btrfs_test_scrub_ioctls, btrfs_test_ino_path_ioctls, 4897 btrfs_test_send_ioctl, btrfs_test_send_ioctl, 4898 btrfs_test_quota_ctl_ioctl, btrfs_test_get_dev_stats_ioctl, 4899 btrfs_test_get_dev_stats_ioctl, btrfs_test_dev_replace_ioctl, 4900 btrfs_test_dev_replace_ioctl, btrfs_print_features): Use prfl_btrfs and 4901 prxval_btrfs instead of printflags and printxval, respectively. 4902 (btrfs_test_balance_ioctls, btrfs_test_ino_path_ioctls, 4903 btrfs_test_quota_ctl_ioctl, btrfs_test_dev_replace_ioctl, 4904 btrfs_test_dev_replace_ioctl): Update expected output based on 4905 verbose_xlat setting. 4906 (btrfs_print_defrag_range_args): Add compress_type_known arg, pass it 4907 to prxval_btrfs. 4908 (main): Handle -X option. 4909 4910 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4911 4912 tests: check -X option syntax. 4913 * tests/options-syntax.test: Add checks for -X option with invalid 4914 arguments. 4915 4916 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4917 4918 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4919 4920 Add user interface for configuring xlat output style. 4921 * strace.c (init): Handle -X option, set xlat_verbosity 4922 according to -X argument. 4923 * strace.1.in: Document -X option. 4924 * NEWS: Mention it. 4925 4926 Closes: https://github.com/strace/strace/issues/27 4927 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 4928 4929 2018-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 4930 4931 bpf: print fields that interpreted as pointers using printaddr64. 4932 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM), 4933 BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)): Print key and value 4934 fields using PRINT_FIELD_ADDR64. 4935 (BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)): Print key field using 4936 PRINT_FIELD_ADDR64. 4937 (BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)): Print key and next_key 4938 field using PRINT_FIELD_ADDR64. 4939 (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print insns and log_buf fields 4940 using PRINT_FIELD_ADDR64. 4941 (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Print data_in and data_out 4942 fields using PRINT_FIELD_ADDR64. 4943 * tests/bpf.c: Update expected output. 4944 4945 2018-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 4946 4947 build: make it even more reproducible. 4948 * Makefile.am (today): Consistently print the UTC date in C locale. 4949 * configure.ac (RPM_CHANGELOGTIME, DEB_CHANGELOGTIME): Likewise. 4950 * maint/update_copyright_years.sh: Likewise. 4951 * copyright-year-gen: Likewise. When $SOURCE_DATE_EPOCH is non-empty, 4952 use it as fallback date before the current system date. 4953 4954 References: https://github.com/strace/strace/pull/68 4955 4956 2018-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 4957 4958 unwind: move unwind_tcb_init invocation to after_successful_attach. 4959 There is no need to call unwind_tcb_init before the tracee is attached. 4960 4961 * strace.c (alloctcb) [ENABLE_STACKTRACE]: Move unwind_tcb_init 4962 invocation ... 4963 (after_successful_attach) [ENABLE_STACKTRACE]: ... here. 4964 (init) [ENABLE_STACKTRACE]: Remove unwind_tcb_init invocation loop. 4965 * unwind.c (unwind_tcb_fin): Skip if tcp->unwind_queue is NULL. 4966 4967 2018-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 4968 4969 strace: move setting of post-attach flags inside after_successful_attach 4970 * strace.c (after_successful_attach): Add "flags" argument. 4971 Set TCB_ATTACHED, TCB_STARTUP, and "flags" in tcp->flags. 4972 All users updated. 4973 4974 2018-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 4975 4976 strace: rename newoutf to after_successful_attach. 4977 This function is going to be used for other things that have to be done 4978 right after a successful attach, hence the rename. 4979 4980 * strace.c (newoutf): Rename to after_successful_attach, 4981 all users updated. 4982 4983 2018-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 4984 4985 unwind: remove stray newline in error diagnostics. 4986 * unwind-libdw.c (tcb_init): Do not pass trailing "\n" to error_msg 4987 as the latter prints newline itself. 4988 4989 2018-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 4990 4991 build: make it more reproducible. 4992 * file-date-gen: Consistently print the UTC date in C locale. 4993 When $SOURCE_DATE_EPOCH is non-empty, use it as fallback date 4994 before the current system date. 4995 4996 Reported-by: Chris Lamb <lamby (a] debian.org> 4997 Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896016 4998 Closes: https://github.com/strace/strace/pull/68 4999 5000 2018-04-19 Masatake YAMATO <yamato (a] redhat.com> 5001 5002 unwind: initialize unwind context only if given tcb is initialized. 5003 With libdw based unwinder, following warnings are reported 5004 when -p is passed before -k: 5005 5006 $ ./strace -p 1 -k 5007 ... 5008 ./strace: dwfl_linux_proc_attach returned an error for process 0: No such file or directory 5009 ... 5010 5011 It seems that commit 54c7792b, "Fix libunwind segfault when -p is 5012 passed before -k" doesn't fix the original issue. 5013 5014 * strace.c (init) [ENABLE_STACKTRACE]: Initialize unwind context only 5015 if given tcb is initialized. 5016 5017 2018-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 5018 5019 bpf: harmonize length checks. 5020 The rest of the decoder uses offsetof to check the length. 5021 5022 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN), 5023 BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID), 5024 BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID), 5025 BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Use offsetof instead 5026 of offsetofend. 5027 5028 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5029 5030 bpf: add support for map_name and map_ifindex fields in BPF_MAP_CREATE. 5031 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode map_name 5032 and map_ifindex fields that were added in Linux commits 5033 v4.15-rc1~84^2~605^2~3 and v4.16-rc1~123^2~145^2~5^2~8, respectively. 5034 * bpf_attr.h (struct BPF_MAP_CREATE_struct): Add map_name 5035 and map_ifindex fields. 5036 * tests/bpf.c (init_BPF_MAP_CREATE_attr7): New function. 5037 (BPF_MAP_CREATE_checks): Remove const qualifier, add two more checks. 5038 5039 bpf: improve handling of various sizes of BPF_MAP_CREATE attributes. 5040 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Skip printing 5041 the rest of the structure if len is less than the offset of the end 5042 of max_entries, map_flags, or inner_map_fd field. 5043 * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks. 5044 5045 tests: add checks for bpf BPF_MAP_CREATE arguments. 5046 * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks. 5047 5048 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5049 5050 bpf: print numa_node using xlat. 5051 As the value of -1 has a special meaning. The issue is complicated 5052 by the fact that this constant is not exported by UAPI. 5053 5054 * xlat/numa_node.in: New file. 5055 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Print numa_node field 5056 using printxvals_ex with a special xlat style. 5057 5058 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5059 5060 btrfs: use umove_or_printaddr_ignore_syserror instead of u_error mangling 5061 * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case 5062 BTRFS_IOC_TREE_SEARCH_V2>: Use umove_or_printaddr_ignore_syserror 5063 instead of tcp->u_error mangling around umove_or_printaddr call. 5064 5065 defs.h: introduce umove_or_printaddr{,64}_ignore_syserror wrappers. 5066 * defs.h (umove_or_printaddr64_ignore_syserror): New macro, a thin 5067 wrapper around umoven_or_printaddr64_ignore_syserror. 5068 (umove_or_printaddr_ignore_syserror): New macro, a thin wrapper around 5069 umoven_or_printaddr_ignore_syserror. 5070 5071 print_fields.h: add PRINT_FIELD_XVAL_U for printing xlat in %u format. 5072 * print_fields.h (PRINT_FIELD_XVAL_U): New macro. 5073 5074 print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling 5075 * print_fields.h (PRINT_FIELD_U64): New macro. 5076 5077 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5078 5079 bpf_sock_filter: use print_xlat32. 5080 We can't simply use print_xlat here due to the way those SKF_*_OFF 5081 constants are defined. 5082 5083 * bpf_sock_filter.c (print_sock_filter_k): Use print_xlat32 for printing 5084 SKF_AD_OFF, SKF_NET_OFF, and SKF_LL_OFF named constants. 5085 5086 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5087 5088 defs.h: add print_xlat32 macro. 5089 For those cases where inadvertent sign extension is possible. 5090 5091 * defs.h (print_xlat32): New macro, a wrapper for print_xlat_ex. 5092 5093 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5094 5095 open: use print_xlat_d in print_dirfd. 5096 * open.c (print_dirfd): Use print_xlat_d for printing AT_FDCWD named 5097 constant. 5098 5099 fanotify: use print_xlat_d. 5100 * fanotify.c (SYS_FUNC(fanotify_mark)): Use print_xlat_d for printing 5101 FAN_NOFD named constant. 5102 5103 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5104 5105 Add print_xlat_u and print_xlat_d shorthands. 5106 Add variants of print_xlat with various value printing formats. 5107 5108 * defs.h (print_xlat_u, print_xlat_d): New macro, a wrapper for 5109 print_xlat_ex. 5110 5111 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5112 5113 xlat: introduce XLAT_STYLE_FMT_D. 5114 As there are some possible users for it, apparently. 5115 5116 * defs.h (XLAT_STYLE_FORMAT_MASK): Update the value in order to 5117 accommodate XLAT_STYLE_FMT_D. 5118 (enum xlat_style) <XLAT_STYLE_FMT_D>: New enumeration entity. 5119 (printxval64_d, printxval_d): New function, a shorthand for 5120 printxvals_ex with a single xlat and XLAT_STYLE_FMT_D xlat style. 5121 * xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_D. 5122 5123 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5124 5125 defs.h: add shorthands for printing xval with XLAT_STYLE_FMT_U. 5126 * defs.h (printxval_u, printxval64_u): New function, a shorthand for 5127 printxvals_ex with a single xlat and XLAT_STYLE_FMT_U as a style. 5128 5129 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5130 5131 Add support for various xlat formats. 5132 Since xlat printing routines now have a notion of "style" that should be 5133 used for printing xlat values, we can also employ this argument for 5134 passing information about number printing format (unsigned decimal 5135 or hexadecimal, so far). 5136 5137 * defs.h (XLAT_STYLE_FORMAT_SHIFT, XLAT_STYLE_FORMAT_MASK): New macro 5138 constant. 5139 (enum xlat_style) <XLAT_STYLE_FMT_X, XLAT_STYLE_FMT_U>: New enumeration 5140 entities. 5141 * xlat.c (xlat_verbose, xlat_format): New macro for checking specific 5142 aspect of style argument. 5143 (get_xlat_style): Use xlat_verbose for checking xlat verbosity style. 5144 (sprint_xlat_val, print_xlat_val): New function, for easing printing 5145 raw constant number with respect to printing format style. 5146 (printxvals_ex, sprintxval_ex, printxval_searchn_ex, 5147 printxval_searchn_ex, sprintflags_ex, printflags_ex, print_xlat_ex): 5148 Use xlat_verbose macro for xlat verbosity style checks. Use 5149 print_xlat_val instead of direct raw xlat value printing. 5150 5151 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5152 5153 v4l2: use print_xlat in print_v4l2_queryctrl. 5154 * v4la.c (print_v4l2_queryctrl): Use print_xlat for printing 5155 V4L2_CTRL_FLAG_NEXT_CTRL named constant. 5156 5157 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5158 5159 prctl: use print_xlat_ex to print PR_SET_PTRACER_ANY. 5160 We cannot simply use print_xlat as PR_SET_PTRACER_ANY is defined 5161 differently in kernel headers. 5162 5163 * prctl.c (SYS_FUNC(prctl)) <case PR_SET_PTRACER>: Use print_xlat_ex 5164 for printing PR_SET_PTRACER_ANY named constant. 5165 5166 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5167 5168 nlattr: use print_xlat. 5169 * nlattr.c (print_nlattr): Use print_xlat for printing NLA_F_NESTED and 5170 NLA_F_NET_BYTEORDER named constants. 5171 5172 ipc_defs.h: use print_xlat. 5173 * ipc_defs.h (PRINTCTL): Use print_xlat for printing IPC_64 named 5174 constant. 5175 5176 futex: use print_xlat. 5177 * futex.c [!FUTEX_OP_OPARG_SHIFT] (FUTEX_OP_OPARG_SHIFT): New macro 5178 constant. 5179 (SYS_FUNC(futex)): Use print_xlat for printing FUTEX_OP_OPARG_SHIFT 5180 named constant. 5181 5182 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5183 5184 ipc: use printxval for printing key. 5185 Convert explicit constant printing logic into a printxval call in order 5186 to account for xlat style setting. 5187 5188 * defs.h (ipc_private): New xlat array declaration. 5189 * ipc_msg.c (SYS_FUNC(msgget)): Use printxval for printing IPC_PRIVATE. 5190 * ipc_sem.c (SYS_FUNC(semtimedop)): Likewise. 5191 * ipc_shm.c (SYS_FUNC(shmget)): Likewise. 5192 * xlat/ipc_private.in: New file. 5193 5194 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5195 5196 mount: use print_xlat for printing MS_MGC_VAL. 5197 * mount.c (SYS_FUNC(mount)): Use print_xlat for printing MS_MGC_VAL 5198 named constant. 5199 5200 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5201 5202 Introduce print_xlat and print_xlat_ex. 5203 print_xlat_ex prints a named constant in accordance with xlat style 5204 provided, print_xlat is a thin wrapper around print_xlat_ex that passes 5205 stringified constant name as a string and XLAT_STYLE_DEFAULT as a style. 5206 5207 * defs.h (print_xlat_ex): New function prototype. 5208 (print_xlat): New macro, a thin wrapper around print_xlat_ex. 5209 * xlat.c (print_xlat_ex): New function. 5210 5211 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5212 5213 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5214 5215 Introduce XLAT_STYLE_DEFAULT. 5216 This will be needed later, with the introduction of user-configurable 5217 xlat style setting (stored in xlat_verbosity variable). 5218 5219 * defs.h (XLAT_STYLE_VERBOSITY_MASK): New macro constant. 5220 (enum xlat_style) <XLAT_STYLE_DEFAULT>: New enumeration entity. 5221 (xlat_verbosity): New external declaration. 5222 (printxvals, printxval_searchn, printxval_search_ex, sprintxval, 5223 sprintflags, printflags64): Use XLAT_STYLE_DEFAULT instead of 5224 XLAT_STYLE_ABBREV. 5225 * strace.c (xlat_verbosity): New variable. 5226 * xlat.c (get_xlat_style): New function. 5227 (printxvals_ex, sprintxval_ex, printxval_searchn_ex, sprintflags_ex, 5228 printflags_ex): Use it. 5229 5230 2018-04-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5231 5232 Introduce xlat verbosity styles. 5233 * defs.h (printxvals_ex): Rename from printxvals, add style argument. 5234 (enum xlat_style): New enumeration. 5235 (printxvals): New macro, a wrapper for printxvals_ex. 5236 (printxval_searchn_ex): Rename from printxval_searchn, add style 5237 argument. 5238 (printxval_searchn): New macro, a wrapper for printxval_searchn_ex. 5239 (printxval_search_ex): New macro, a wrapper for printxval_searchn_ex. 5240 (sprintxval_ex): Rename from sprintxval, add style argument. 5241 (sprintxval): New macro, a wrapper for sprintxval_ex. 5242 (printflags_ex): Add style argument. 5243 (sprintflags_ex): Rename from sprintflags, add style argument. 5244 (sprintflags): New macro, a wrapper for sprintflags_ex. 5245 (printflags64): Pass XLAT_STYLE_ABBREV as a style in printflags_ex call. 5246 * netlink.c (decode_nlmsg_flags): Pass XLAT_STYLE_ABBREV as a style in 5247 printflags_ex call. 5248 * xlat.c (printxvals_ex): Rename from printxvals, add style argument, 5249 handle it. 5250 (sprintxval_ex): Rename from sprintxval, add style argument, handle it. 5251 (printxval_searchn_ex): Rename from printxval_searchn, add style 5252 argument, handle it. 5253 (sprintflags_ex): Rename from sprintflags, add style argument, 5254 handle it. 5255 (printflags_ex): Add style argument, handle it. 5256 5257 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5258 References: https://github.com/strace/strace/issues/27 5259 5260 2018-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 5261 5262 tests: robustify signal delivery test against kernel bugs. 5263 Recent kernel siginfo changes, namely, v4.14-rc1~60^2^2~1, 5264 v4.16-rc1~159^2~37, and v4.16-rc1~159^2~39, introduced ABI regressions 5265 that render the whole siginfo interface unreliable. 5266 5267 Looks like the kernel side is not eager to fix the breakage, 5268 so here is a workaround. 5269 5270 * tests/signal_receive.c (s_sig, s_code, s_pid, s_uid): New volatile 5271 variables. 5272 (handler): Add siginfo_t parameter, save siginfo_t fields. 5273 (sig_print): Remove. 5274 (main): Rewrite. Use variables saved by handler to print expected 5275 siginfo output. Print diagnostics in case of siginfo mismatch. 5276 * strace.spec.in (%check): Extract the diagnostics. 5277 5278 Closes: https://github.com/strace/strace/issues/21 5279 5280 2018-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 5281 5282 Lift experimental status from stack tracing feature. 5283 * strace.1.in (.SH OPTIONS) <.B \-k>: Remove " (experimental)". 5284 * strace.c (usage) [ENABLE_STACKTRACE]: Likewise. 5285 5286 2018-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 5287 5288 Enable stack tracing in packages on all architectures. 5289 The stack tracing feature used to be enabled in packages on x86_64 only. 5290 This change enables -k option on all architectures. 5291 5292 * debian/control (Build-Depends) [!amd64]: Add pkg-config, libdw-dev, 5293 and libiberty-dev. 5294 * strace.spec.in (BuildRequires) [!x86_64]: Add 5295 %buildrequires_stacktrace. 5296 5297 2018-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 5298 5299 Use libdw-based unwinder in ci and packages. 5300 * ci/install-dependencies.sh (common_packages): Add pkg-config, 5301 replace libunwind8-dev with libdw-dev. 5302 * debian/control (Build-Depends) [amd64]: Add pkg-config, 5303 replace libunwind-dev with libdw-dev. 5304 * debian/rules (build-udeb/Makefile): Replace --without-libunwind 5305 with --without-stacktrace. 5306 * strace.spec.in (buildrequires_libunwind_devel): Rename 5307 to buildrequires_stacktrace, replace libunwind-devel with 5308 either elfutils-devel or libdw-devel. 5309 5310 tests: skip -k tests on unsupported architectures. 5311 * tests/strace-k.test: When actual strace -k output doesn't match the 5312 expected output because of limited architecture support, skip the test 5313 on architectures that are not currently supported by libdw. 5314 5315 2018-04-11 Masatake YAMATO <yamato (a] redhat.com> 5316 5317 unwind: add libdw as an unwinder. 5318 Implement alternative libdw-based unwinder for stack tracing. 5319 Add --with-libdw configure option to control whether libdw can be used 5320 as an unwinder. 5321 5322 * m4/st_libdw.m4: New file. 5323 * m4/st_stacktrace.m4 (st_STACKTRACE): Invoke st_ARG_LIBDW and st_LIBDW, 5324 check for mutually exclusive configure options, 5325 (AM_CONDITIONAL): Add USE_LIBDW. 5326 * unwind-libdw.c: New file. 5327 * Makefile.am [USE_LIBDW] (strace_SOURCES): Append unwind-libdw.c. 5328 [USE_LIBDW] (strace_CPPFLAGS): Append $(libdw_CPPFLAGS). 5329 [USE_LIBDW] (strace_CFLAGS): Append $(libdw_CFLAGS). 5330 [USE_LIBDW] (strace_LDFLAGS): Append $(libdw_LDFLAGS). 5331 [USE_LIBDW] (strace_LDADD): Append $(libdw_LIBS). 5332 * NEWS: Mention this improvement. 5333 5334 Closes: https://github.com/strace/strace/issues/12 5335 Closes: https://github.com/strace/strace/issues/13 5336 Co-Authored-by: Mark Wielaard <mjw (a] redhat.com> 5337 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5338 5339 2018-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 5340 5341 tests: check corner cases of udev_monitor_netlink_header decoding. 5342 * tests/netlink_kobject_uevent.c (test_nlmsg_type_kernel): Create 5343 a tail-allocated udev_monitor_netlink_header object and pass it 5344 to sys_send. 5345 (test_nlmsg_type_udev): Likewise. Check decoding of 5346 udev_monitor_netlink_header object that ends in unmapped memory region. 5347 5348 2018-04-11 Harsha Sharma <harshasharmaiitr (a] gmail.com> 5349 5350 tests: check decoding of udev_monitor_netlink_header. 5351 * tests/netlink_kobject_uevent.c: Include <string.h>, <arpa/inet.h>, 5352 and "netlink_kobject_uevent.h". 5353 (test_nlmsg_type_udev, test_nlmsg_type_kernel): New functions. 5354 (main): Use them. 5355 5356 2018-04-11 Harsha Sharma <harshasharmaiitr (a] gmail.com> 5357 5358 netlink: decode libudev netlink header. 5359 * defs.h (decode_netlink_kobject_uevent): New prototype. 5360 * netlink.c (decode_netlink): Decode family kobject_uevent. 5361 * netlink_kobject_uevent.h: New file. 5362 * netlink_kobject_uevent.c: Likewise. 5363 * Makefile.am (strace_SOURCES): Add them. 5364 5365 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5366 5367 2018-04-11 Harsha Sharma <harshasharmaiitr (a] gmail.com> 5368 5369 tests: check basic decoding of PTP_* ioctl commands. 5370 * tests/ioctl_ptp.c: New file. 5371 * tests/gen_tests.in (ioctl_ptp): New entry. 5372 * tests/pure_executables.list: Add ioctl_ptp. 5373 * tests/.gitignore: Likewise. 5374 5375 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5376 5377 2018-04-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5378 5379 bpf: decode BPF_PROG_QUERY command. 5380 BPF_PROG_QUERY was introduced in Linux commit v4.15-rc1~84^2~558^2~6. 5381 5382 * xlat/bpf_commands.in (BPF_PROG_QUERY): New constant. 5383 * xlat/bpf_query_flags.in: New file. 5384 * bpf.c: Include it. 5385 (DECL_BPF_CMD_DECODER): Add priv argument for passing tcb private data. 5386 (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): New function. 5387 (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Add BPF_PROG_QUERY entry. 5388 (SYS_FUNC(bpf)): Fetch buf on entering and exiting, pass buf on exiting, 5389 retrieve private data on exiting, pass it to decoder as well, explicitly 5390 rework rc handling logic for size argument printing. 5391 * bpf_attr.h (struct BPF_PROG_QUERY_struct): New structure declaration. 5392 (BPF_PROG_QUERY_struct_size, expected_BPF_PROG_QUERY_struct_size): New 5393 macro. 5394 * tests/bpf.c: Add checks for BPF_PROG_QUERY command. 5395 5396 2018-04-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5397 5398 Make print_uint64 from btrfs.c globally available. 5399 And rename it to print_uint64_array_member to make the name sensible 5400 without additional context. 5401 5402 * defs.h (print_uint64_array_member): New function prototype. 5403 * btrfs.c (print_uint64): Move... 5404 * util.c (print_uint64_array_member): ...here, drop "static" qualifier. 5405 5406 2018-04-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5407 5408 Introduce umoven_or_printaddr64* functions. 5409 Counterparts for umoven_or_printaddr/umoven_or_printaddr_ignore_syserror 5410 that always print 64 bits of addr (as this is needed in bpf and btrfs 5411 decoders). 5412 5413 * util.c (umoven_or_printaddr64): Rename from umoven_or_printaddr, 5414 change addr argument type to uint64_t, call printaddr64 instead of 5415 printaddr. 5416 (umoven_or_printaddr64_ignore_syserror): Rename from 5417 umoven_or_printaddr_ignore_syserror, change addr argument type to 5418 uint64_t, call printaddr64 instead of printaddr. 5419 * defs.h (umoven_or_printaddr64): Rename from umoven_or_printaddr, 5420 change addr argument type to uint64_t. 5421 (umoven_or_printaddr64_ignore_syserror): Rename from 5422 umoven_or_printaddr_ignore_syserror, change addr argument type to 5423 uint64_t. 5424 (umove_or_printaddr64): New macro, a wrapper for umoven_or_printaddr64. 5425 (umoven_or_printaddr): New function, a wrapper for 5426 umoven_or_printaddr64. 5427 (umoven_or_printaddr_ignore_syserror): New function, a wrapper for 5428 umoven_or_printaddr64_ignore_syserror. 5429 5430 2018-04-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5431 5432 bpf_filter.c: add support for decoding eBPF instruction codes. 5433 * bpf_filter.c (print_bpf_filter_code): Add extended argument, remove 5434 static qualifier. Add support for decoding eBPF instruction code. 5435 * defs.h (print_bpf_filter_code): New declaration. 5436 * xlat/ebpf_class.in: New file. 5437 * xlat/ebpf_mode.in: Likewise. 5438 * xlat/ebpf_op_alu.in: Likewise. 5439 * xlat/ebpf_op_jmp.in: Likewise. 5440 * xlat/ebpf_size.in: Likewise. 5441 5442 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5443 5444 2018-04-08 Dmitry V. Levin <ldv (a] altlinux.org> 5445 5446 unwind: prepare configure subsystem for alternative unwinders. 5447 Introduce --enable-stacktrace configure option to control whether 5448 -k option support is compiled in, --with-libunwind option remains 5449 available to control whether libunwind can be used as an unwinder. 5450 5451 * m4/st_demangle.m4: New file. 5452 * m4/st_libunwind.m4: Likewise. 5453 * m4/st_stacktrace.m4: Likewise. 5454 * configure.ac: Replace all libunwind and libiberty checks 5455 with a single st_STACKTRACE invocation. 5456 * Makefile.am: Conditionalize checks for USE_LIBUNWIND and USE_DEMANGLE 5457 on ENABLE_STACKTRACE. 5458 [ENABLE_STACKTRACE] (strace_SOURCES): Append unwind.c and unwind.h. 5459 * strace.1.in: Replace libunwind with an unwinder-agnostic wording. 5460 * defs.h: Replace USE_LIBUNWIND with ENABLE_STACKTRACE. 5461 * strace.c: Likewise. 5462 (print_version): Print stack-trace instead of stack-unwind. 5463 * syscall.c: Replace USE_LIBUNWIND with ENABLE_STACKTRACE. 5464 * tests/Makefile.am: Likewise. Replace LIBUNWIND_TESTS 5465 with STACKTRACE_TESTS. 5466 * tests/strace-V.test: Update expected output. 5467 5468 2018-04-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5469 5470 bpf: implement decoding of prog_name and prog_ifindex fields. 5471 * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Add support for decoding 5472 of prog_name (introduced in Linux commit v4.15-rc1~84^2~605^2~4) and 5473 prog_ifindex (introduced as prog_target_ifindex in v4.15-rc1~84^2~127^2~13, 5474 renamed in v4.15-rc1~15^2~5^2~3^2~7). 5475 * bpf_attr.h [!BPF_OBJ_NAME_LEN] (BPF_OBJ_NAME_LEN): New macro constant. 5476 [BPF_OBJ_NAME_LEN]: Check that BPF_OBJ_NAME_LEN is equal to 16. 5477 (struct BPF_PROG_LOAD_struct): Add prog_name and prog_ifindex fields. 5478 (BPF_PROG_LOAD_struct_size, expected_BPF_PROG_LOAD_struct_size): Update. 5479 * tests/bpf.c (init_BPF_PROG_LOAD_attr): Rename 5480 to init_BPF_PROG_LOAD_attr3. 5481 (print_BPF_PROG_LOAD_attr): Rename to print_BPF_PROG_LOAD_attr3. 5482 (init_BPF_PROG_LOAD_attr4, print_BPF_PROG_LOAD_attr4): New functions. 5483 (BPF_PROG_LOAD_checks): Check new decoding features. 5484 5485 2018-04-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5486 5487 bpf: add support for array fields. 5488 * gen_bpf_attr_check.sh: Ignore field array size definition. 5489 * m4/gen_bpf_attr_m4.sh (filter_entries): Likewise. 5490 5491 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5492 5493 2018-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 5494 5495 tests: robustify strace -k tests. 5496 Allow __getpid as an alternative name for getpid, 5497 allow __kernel_vsyscall after getpid. 5498 5499 * tests/strace-k.expected: New file. 5500 * tests/strace-k-demangle.expected: Likewise. 5501 * tests/Makefile.am (EXTRA_DIST): Add them. 5502 * tests/strace-k-demangle.test (expected): Remove. 5503 * tests/strace-k.test: Likewise. Use grep to check the output. 5504 5505 2018-04-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5506 5507 ipc_msg: sign extend msgtyp in m32 personality. 5508 msgtyp has to be treated as a signed type all the way from fetching 5509 to printing. 5510 5511 * ipc_msg.c (fetch_msgrcv_args): Sign extend msgtyp when fetching. 5512 5513 2018-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 5514 5515 strace.spec.in: update Source URL. 5516 * strace.spec.in (Source): Change to https://strace.io/files/. 5517 5518 debian: enable mpers support for ppc64el and s390x. 5519 * debian/control (Build-Depends) [ppc64el, s390x]: Add gcc-multilib. 5520 5521 Post-release administrivia. 5522 * NEWS: Add a header line for the next release. 5523 * debian/changelog.in: Add a changelog entry for 4.22-1. 5524 * strace.spec.in: Likewise. 5525 5526 Prepare for 4.22 release. 5527 * NEWS: Update for 4.22 release. 5528 5529 Update copyright headers. 5530 Headers updated automatically using maint/update_copyright_years.sh 5531 script. 5532 5533 2018-04-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5534 5535 Update NEWS. 5536 5537 2018-04-05 Masatake YAMATO <yamato (a] redhat.com> 5538 5539 unwind: split unwind code into front-end and back-end. 5540 This opens the way for alternative unwinder back-ends. 5541 5542 * unwind.h: New file, defines the unwinder back-end interface. 5543 * unwind.c: Move all libunwind related code ... 5544 * unwind-libunwind.c: ... here. 5545 * Makefile.am [USE_LIBUNWIND] (strace_SOURCES): Add unwind.h 5546 and unwind-libunwind.c. 5547 5548 2018-04-05 Masatake YAMATO <yamato (a] redhat.com> 5549 5550 unwind: rename public functions in an object-oriented fashion. 5551 This change renames functions exported to strace core part from unwind 5552 subsystem. 5553 5554 The new names imply that unwind subsystem exports two types of 5555 functions. One is for manipulating back-end itself, "unwind_" prefix 5556 is used for this type. Another is for manipulating back-end private data 5557 structure (unwind_ctx) attached to tcb, "unwind_tcb_" is used for this 5558 type. 5559 5560 This naming should help people to understand unwind subsystem 5561 and the relation between unwind subsystem and back-ends. 5562 5563 * defs.h (unwind_print_stacktrace): Rename to unwind_tcb_print. 5564 (unwind_capture_stacktrace): Rename to unwind_tcb_capture. 5565 * unwind.c: Ditto. 5566 * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use 5567 new names. 5568 5569 2018-04-05 Masatake YAMATO <yamato (a] redhat.com> 5570 5571 unwind: add unwind_ prefix to struct tcb.queue field and its type. 5572 The names given to struct tcb.queue field and its type are too common, 5573 this may cause conflicts in the future if new fields are added 5574 to struct tcb. 5575 5576 * defs.h (struct tcb): Rename queue field to unwind_queue, 5577 rename its type queue_t to unwind_queue_t. 5578 * unwind.c (struct unwind_queue_t): Rename to unwind_queue_t. 5579 All users updated. 5580 5581 2018-04-05 Masatake YAMATO <yamato (a] redhat.com> 5582 5583 unwind: make the field type of struct tcb independent from libunwind. 5584 Narrowing the area where the code refers to names associated with 5585 libunwind is needed to utilize libdw of elfutils as an alternative 5586 unwinder. 5587 5588 * defs.h (struct tcb): Rename libunwind_ui field to unwind_ctx, change 5589 its type to "void *". 5590 * unwind.c (unwind_tcb_init, unwind_tcb_fin, stracetrace_walk): Reflect 5591 * the above field renaming. 5592 5593 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5594 5595 tests: robustify options-syntax.test against ash. 5596 * tests/options-syntax.test: Do not assume that shell provides $UID, 5597 use "id -u" if it doesn't. 5598 5599 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5600 5601 strace.c: add support for opening output file in append mode. 5602 * strace.c (open_append): New variable. 5603 (init): Handle -A option. 5604 (strace_fopen): Open file in "a" mode if open_append is set to true. 5605 * strace.1.in: Document this. 5606 * NEWS: Mention this. 5607 5608 Suggested-by: Philipp Marek <philipp.marek (a] emerion.com> 5609 Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528488 5610 5611 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5612 5613 strace.c: support simultaneous usage of -r and -t options. 5614 * strace.c (init): Do not set tflag when rflag is set. 5615 (printleader): Handle rflag and tflag separately. 5616 * strace.1.in (.SH OPTIONS): Add a note about differences between 5617 the monotonic clock time and the wall clock time. 5618 * tests/options-syntax.test: Remove the check for 5619 "-tt has no effect with -r" warning. 5620 * NEWS: Mention this. 5621 5622 Suggested-by: Josh Triplett <josh (a] freedesktop.org> 5623 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5624 Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466195 5625 5626 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5627 5628 syscall.c: dump write I/O even if error is returned. 5629 It makes sense to try to dump the argument of write syscalls as they can 5630 be readily available despite the fact that error has been returned. 5631 5632 * syscall.c (dumpio): Move check for syserror and check for fd in 5633 read_set to the end of the function. 5634 * tests/read-write.c: Add a check for this behaviour. 5635 * tests/pread64-pwrite64.c: Update expected output. 5636 * NEWS: Mention this. 5637 5638 Suggested-by: J. Bruce Fields <bfields (a] fieldses.org> 5639 Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=436284 5640 5641 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5642 5643 strace: handle possible NULL from localtime() call. 5644 * strace.c (printleader): Print raw tv_sec value if localtime() returned 5645 NULL. 5646 * tests/localtime.c: New file. 5647 * tests/localtime.test: New test. 5648 * tests/Makefile.am (check_PROGRAMS): Add localtime. 5649 (MISC_TESTS): Add localtime.test. 5650 (localtime_LDADD): New variable. 5651 * tests/.gitignore: Add localtime. 5652 * ci/install-dependencies.sh (common_packages): Add faketime. 5653 5654 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5655 Closes: https://github.com/strace/strace/issues/42 5656 5657 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5658 5659 Return RVAL_STR unconditionally. 5660 There is no reason to check for auxstr being non-NULL 5661 because syscall_exiting_trace already does the check. 5662 5663 * sched.c (SYS_FUNC(sched_getscheduler)): Do not check tcp->auxstr, 5664 return RVAL_STR unconditionally. 5665 * time.c (do_adjtimex): Likewise. 5666 5667 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5668 5669 dist/README: s/linux/Linux/ 5670 * dist/README: Replace "linux" with "Linux". 5671 5672 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5673 5674 strace.1.in: fix formatting of -e trace class descriptions. 5675 Use .TP instead .PP as it is ought to be. 5676 5677 * strace.1.in (.SS Filtering): Use .TP instead .PP as it is ought to be. 5678 5679 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5680 5681 nlattr: check NLA_TYPE_MASK at compile time. 5682 * nlattr.c: Include "static_assert.h" 5683 (print_nlattr): Check the expectations about NLA_TYPE_MASK. 5684 5685 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5686 5687 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5688 5689 bpf: add a comment about bpf_attr decoding. 5690 * bpf.c: Add comment. 5691 5692 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5693 5694 tests: check decoding of bpf_attr of size 1. 5695 * tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry. 5696 5697 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5698 5699 bpf: use print_big_u64_addr. 5700 Since pointers stored in the bpf_attr union are 64-bit regardless 5701 of architecture bitness. 5702 5703 * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Call print_big_u64_addr 5704 for attr.license. 5705 (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Call print_big_u64_addr 5706 for attr.pathname. 5707 * tests/bpf.c (BPF_OBJ_PIN_checks): Check it. 5708 5709 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5710 5711 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5712 5713 bpf: add support for file mode flags. 5714 These were introduced by Linux commit v4.15-rc1~84^2~384^2~4. 5715 5716 * bpf_attr.h (struct BPF_OBJ_PIN_struct): Add file_flags field. 5717 (struct BPF_PROG_GET_NEXT_ID_struct, struct BPF_PROG_GET_FD_BY_ID_struct, 5718 struct BPF_MAP_GET_FD_BY_ID_struct): Add open_flags field. 5719 (BPF_OBJ_PIN_struct_size, expected_BPF_OBJ_PIN_struct_size, 5720 expected_BPF_PROG_GET_NEXT_ID_struct_size, 5721 expected_BPF_PROG_GET_FD_BY_ID_struct_size, 5722 expected_BPF_MAP_GET_FD_BY_ID_struct_size): Update. 5723 * bpf.c (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Check the length, skip 5724 printing the rest of attributes if it is less than offset of the 5725 end of the bpf_fd field, print file_flags field otherwise. 5726 (DEF_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID), 5727 DEF_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID), 5728 DEF_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Check the length, skip 5729 printing the rest of attributes if it is less than offset of the 5730 end of the next_id field, print open_flags field otherwise. 5731 * xlat/bpf_file_mode_flags.in: New file. 5732 * tests/bpf.c (BPF_OBJ_PIN_checks, BPF_PROG_GET_NEXT_ID_checks, 5733 BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks): Check it. 5734 5735 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5736 5737 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5738 5739 tests: refactor bpf test. 5740 The aim of this change is to introduce an ability to perform multiple 5741 checks for a specific bpf command. In order to achieve so, all the 5742 related data is stored in check descriptor, and test_bpf iterates over 5743 it. There are also some provisions made in regard to future changes 5744 (specifically, the way bpf_attr_data union is defined). 5745 5746 * tests/bpf.c (print_bpf_attr): New function, a wrapper around 5747 struct bpf_check.printer. 5748 (test_bpf_): Rename to... 5749 (test_bpf): ...this. Replace arguments with struct bpf_check pointer. 5750 Iterate over possible attribute variants. Account for changes in 5751 attribute initialisation routine: provide a pointer to locally defined 5752 union bpf_attr_data and perform memcpy afterwards. Initialise memory 5753 from data each time before a bpf call. 5754 (TEST_BPF, DEF_*, init_*, print_*): Remove. 5755 (init_BPF_PROG_LOAD_attr, print_BPF_PROG_LOAD_attr, 5756 init_BPF_OBJ_PIN_attr): New functions. 5757 (license, pathname): New variables. 5758 (BPF_MAP_CREATE_checks, BPF_MAP_LOOKUP_ELEM_checks, 5759 BPF_MAP_UPDATE_ELEM_checks, BPF_MAP_DELETE_ELEM_checks, 5760 BPF_MAP_GET_NEXT_KEY_checks, BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, 5761 BPF_PROG_ATTACH_checks, BPF_PROG_DETACH_checks, 5762 BPF_PROG_TEST_RUN_checks, BPF_PROG_GET_NEXT_ID_checks, 5763 BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks, 5764 BPF_OBJ_GET_INFO_BY_FD_checks): New arrays. 5765 (BPF_OBJ_GET_checks, BPF_MAP_GET_NEXT_ID_checks): New macros. 5766 (CHK): New macro, a shorthand for initialising array of struct bpf_check. 5767 (main): New static constant checks, iterate over checks and run test_bpf 5768 with each element. 5769 5770 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5771 5772 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5773 5774 print_fields.h: introduce PRINT_FIELD_ADDR and PRINT_FIELD_ADDR64 macros 5775 * print_fields.h (PRINT_FIELD_ADDR, PRINT_FIELD_ADDR64): New macro. 5776 5777 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5778 5779 print_fields.h: introduce PRINT_FIELD_CSTRING_SZ macro. 5780 A variant of PRINT_FIELD_CSTRING with an ability to pass string size 5781 explicitly. 5782 5783 * print_fields.h (PRINT_FIELD_CSTRING_SZ): New macro. 5784 5785 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5786 5787 print_fields.h: check whether passed field is an array in PRINT_FIELD_CSTRING 5788 * print_fields.h (PRINT_FIELD_CSTRING): Add MUST_BE_ARRAY to the size 5789 value in order to check whether (where_).field_ is an array in compile 5790 time. 5791 5792 print_fields.h: whitespace fix in PRINT_FIELD_HEX_ARRAY. 5793 5794 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5795 5796 bpf_attr: add more size checks. 5797 * bpf_attr.h: Add expected sizes of structures. 5798 * gen_bpf_attr_check.sh: Check them. 5799 5800 tests: check bpf syscall decoder unconditionally. 5801 * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Check for 5802 struct bpf_insn. 5803 * tests/bpf.c: Remove the test guard, include "scno.h", "bpf_attr.h", 5804 "xlat.h", and "xlat/bpf_commands.h". Conditionalize inclusion of 5805 <linux/bpf.h> on HAVE_LINUX_BPF_H. Remove all HAVE_UNION_* checks. 5806 (BPF_ATTR_DATA_FIELD): New macro. 5807 (bpf_attr_data): New union. Note that it is larger than modern 5808 union bpf_attr, this allows more checks to be implemented in the future. 5809 (sizeof_attr, test_bpf_): Replace union bpf_attr with 5810 union bpf_attr_data. 5811 (DEF_BPF_INIT_FIRST): Replace union bpf_attr with the corresponding 5812 structure. 5813 (init_BPF_MAP_CREATE_attr): Replace union bpf_attr with 5814 struct BPF_MAP_CREATE_struct. 5815 (init_BPF_MAP_LOOKUP_ELEM_attr): Replace union bpf_attr with 5816 struct BPF_MAP_LOOKUP_ELEM_struct. 5817 (init_BPF_MAP_UPDATE_ELEM_attr): Replace union bpf_attr with 5818 struct BPF_MAP_UPDATE_ELEM_struct. 5819 (init_BPF_MAP_DELETE_ELEM_attr): Replace union bpf_attr with 5820 struct BPF_MAP_DELETE_ELEM_struct. 5821 (init_BPF_MAP_GET_NEXT_KEY_attr): Replace union bpf_attr with 5822 struct BPF_MAP_GET_NEXT_KEY_struct. 5823 (init_BPF_PROG_LOAD_attr): Replace union bpf_attr with 5824 struct BPF_PROG_LOAD_struct. 5825 (init_BPF_OBJ_PIN_attr): Replace union bpf_attr with 5826 struct BPF_OBJ_PIN_struct. 5827 (init_BPF_PROG_ATTACH_attr): Replace union bpf_attr with 5828 struct BPF_PROG_ATTACH_struct. 5829 (init_BPF_PROG_DETACH_attr): Replace union bpf_attr with 5830 struct BPF_PROG_DETACH_struct. 5831 (init_BPF_PROG_GET_NEXT_ID_attr): Replace union bpf_attr with 5832 struct BPF_PROG_GET_NEXT_ID_struct. 5833 (sample_BPF_PROG_TEST_RUN_attr): Change type from union bpf_attr to 5834 struct BPF_PROG_TEST_RUN_struct, all users updated. 5835 (sample_BPF_OBJ_GET_INFO_BY_FD_attr): Change type from union bpf_attr 5836 to struct BPF_OBJ_GET_INFO_BY_FD_struct, all users updated. 5837 5838 Check that structures defined by bpf_attr.h match system union bpf_attr. 5839 * gen_bpf_attr_check.sh: New file. 5840 * Makefile.am (EXTRA_DIST): Add it. 5841 (strace_SOURCES_check): New variable. 5842 (strace_SOURCES): Add $(strace_SOURCES_check). 5843 (BUILT_SOURCES, CLEANFILES): Add bpf_attr_check.c. 5844 (bpf_attr_check.c): New rule. 5845 (sys_func_h_sources): New variable. 5846 (sys_func.h): Use it instead of strace_SOURCES_c. 5847 * .gitignore: Add /bpf_attr_check.c. 5848 5849 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5850 5851 build: generate all union bpf_attr checks automatically. 5852 Rather than list by hand some members of union bpf_attr that we check 5853 for availability, automatically list all members of union bpf_attr we 5854 are aware of. 5855 5856 * m4/gen_bpf_attr_m4.sh: New file. 5857 * bootstrap: Invoke it. 5858 * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Use st_BPF_ATTR. 5859 * m4/.gitignore: New file. 5860 5861 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5862 5863 bpf: move definitions of bpf_attr structures to separate header file. 5864 This also unifies decoders of bpf commands by moving common code 5865 to new macros. 5866 5867 * bpf_attr.h: New file. 5868 * Makefile.am (strace_SOURCES): Add it. 5869 * bpf.c: Include it. 5870 (DEF_BPF_CMD_DECODER): Rename to BEGIN_BPF_CMD_DECODER, add code common 5871 to all decoders. All users updated. 5872 (END_BPF_CMD_DECODER): New macro, add its invocation to all users 5873 of BEGIN_BPF_CMD_DECODER macro. 5874 5875 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5876 5877 Introduce print_big_u64_addr. 5878 This is needed at least for bpf, btrfs, and sg_io, as 32-bit tracer 5879 cannot figure out whether the kernel is 32-bit or 64-bit, 5880 and its behaviour differs when it handles u64 as a pointer. 5881 5882 * linux/arch_defs_.h [!CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL] 5883 (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): New definition, default to 0. 5884 * linux/arm/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5885 Define to 1. 5886 * linux/i386/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5887 Likewise. 5888 * linux/mips/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5889 Likewise. 5890 * linux/powerpc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5891 Likewise. 5892 * linux/riscv/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5893 Likewise. 5894 * linux/s390/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5895 Likewise. 5896 * linux/sparc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5897 Likewise. 5898 * linux/tile/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): 5899 Likewise. 5900 * defs.h (print_big_u64_addr): New function. 5901 5902 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 5903 5904 2018-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5905 5906 defs.h: introduce max_addr and max_kaddr macros. 5907 In order to check an address against maximum addr/kaddr value 5908 for the current personality. 5909 5910 * degs.h (max_addr, max_kaddr): New macros. 5911 5912 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5913 5914 Introduce static_assert. 5915 We are going to use static_assert provided by <assert.h> or, 5916 if it doesn't work, our cheap imitation that doesn't display 5917 the message specified as the second argument of static_assert. 5918 5919 * configure.ac (AC_CACHE_CHECK): Check for static_assert in <assert.h>, 5920 define HAVE_STATIC_ASSERT if it is available. 5921 * static_assert.h: New file. 5922 * Makefile.am (strace_SOURCES): Add it. 5923 5924 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5925 5926 tests: forward SIZEOF_KERNEL_LONG_T and SIZEOF_LONG to C preprocessor. 5927 * tests/Makefile.am (AM_CPPFLAGS): Forward SIZEOF_KERNEL_LONG_T 5928 and SIZEOF_LONG as TESTS_SIZEOF_KERNEL_LONG_T and TESTS_SIZEOF_LONG. 5929 * tests/tests.h [TESTS_SIZEOF_KERNEL_LONG_T] (SIZEOF_KERNEL_LONG_T): 5930 Redefine to TESTS_SIZEOF_KERNEL_LONG_T. 5931 [TESTS_SIZEOF_LONG] (SIZEOF_LONG): Redefine to TESTS_SIZEOF_LONG. 5932 5933 Complements: v4.21~5 ("Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests") 5934 5935 2018-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 5936 5937 tests/tests.h: fix indentation. 5938 5939 tests: fix potential errno clobbering in netlink_kobject_uevent.test. 5940 * tests/netlink_kobject_uevent.c (errstr): New variable. 5941 (sys_send): New function. 5942 (main): Use them. 5943 5944 2018-04-03 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 5945 5946 Restore kvm ioctl definitions for aarch64 and mips architectures. 5947 * maint/ioctls_sym.sh: Add aarch64 and mips architectures to the list 5948 of kvm-capable architectures. 5949 * linux/aarch64/ioctls_arch0.h: Regenerate. 5950 * linux/mips/ioctls_arch0.h: Regenerate. 5951 5952 Fixes: v4.15~92 ("Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h") 5953 5954 2018-04-03 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 5955 5956 Update ioctl entries from linux v4.16. 5957 * linux/32/ioctls_inc_align16.h: Update from linux v4.16 5958 using ioctls_gen.sh. 5959 * linux/32/ioctls_inc_align32.h: Likewise. 5960 * linux/32/ioctls_inc_align64.h: Likewise. 5961 * linux/64/ioctls_inc.h: Likewise. 5962 * linux/x32/ioctls_inc0.h: Likewise. 5963 * linux/arm/ioctls_arch0.h: Likewise. 5964 * linux/i386/ioctls_arch0.h: Likewise. 5965 * linux/powerpc/ioctls_arch0.h: Likewise. 5966 * linux/s390/ioctls_arch0.h: Likewise. 5967 * linux/s390x/ioctls_arch0.h: Likewise. 5968 * linux/x86_64/ioctls_arch0.h: Likewise. 5969 * NEWS: Mention this. 5970 5971 maint: update for linux 4.16. 5972 * maint/ioctls_sym.sh: Add workaround for linux/ndctl.h file. 5973 Update workaround for media/v4l2-common.h file. 5974 (x86_list): Add KVM_GET_MSR_FEATURE_INDEX_LIST. 5975 5976 2018-04-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5977 5978 util.c: amend sprinttime_ex description a bit. 5979 * util.c (sprinttime_ex): Document return value. 5980 5981 tests/bpf.c: add a check for NULL bpf_attr pointer. 5982 * tests/bpf.c (main): Add a check with 0 passed in the third argument. 5983 5984 2018-04-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5985 5986 bpf: print byte range for extra data. 5987 As it could be not entirely clear what bytes are printed. 5988 5989 * bpf.c (decode_attr_extra_data): Print a comment about the byte range 5990 to be printed. 5991 * tests/bpf.c: Update expected output. 5992 5993 2018-04-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 5994 5995 Remove addflags. 5996 It has only single user and implementation of xlat styles for it would 5997 lead to lots of code duplication. 5998 5999 * defs.h (addflags): Remove declaration. 6000 * mem.c (print_mmap_flags): Convert addflags call into printflags64 with 6001 non-zeroeness flags check. 6002 * xlat.c (addflags): Remove. 6003 6004 2018-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 6005 6006 Add i18n support. 6007 Let's make a step towards the growing strace userbase all around 6008 the world and translate something to the language of their choice. 6009 6010 This change enables translation of error messages corresponding 6011 to errno codes, making it consistent with error diagnostics of other 6012 i18n-aware tools, e.g. 6013 6014 $ LANG=es_ES strace -qq -a38 -P /missing unlink /missing 6015 unlink("/missing") = -1 ENOENT (No existe el fichero o el directorio) 6016 unlink: no se puede deshacer el enlace '/missing': No existe el fichero o el directorio 6017 6018 * strace.c: Include <locale.h>. 6019 (main): Invoke setlocale. 6020 * tests/init.sh: Export LC_ALL=C. 6021 * NEWS: Mention this enhancement. 6022 6023 2018-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 6024 6025 Remove RVAL_PRINT_ERR_VAL. 6026 * defs.h (RVAL_PRINT_ERR_VAL): Remove. 6027 * ldt.c (SYS_FUNC(modify_ldt)): Return 0. 6028 * syscall.c (syscall_exiting_trace): When printing an error, 6029 always print struct tcb.u_rval as if RVAL_PRINT_ERR_VAL was set. 6030 6031 2018-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 6032 6033 Treat RVAL_DECIMAL the same way as RVAL_UDECIMAL. 6034 Assuming that syscalls may return negative values only as error codes, 6035 always print non-error syscall return codes as unsigned. 6036 6037 * defs.h (RVAL_UDECIMAL): Remove. 6038 (RVAL_DECIMAL): Rename to RVAL_UDECIMAL. 6039 * syscall.c (syscall_exiting_trace) <case RVAL_DECIMAL>: Remove. 6040 * clone.c (SYS_FUNC(fork)): Remove RVAL_UDECIMAL. 6041 * lseek.c (SYS_FUNC(lseek)): Likewise. 6042 * prctl.c (SYS_FUNC(prctl)): Likewise. 6043 * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Likewise. 6044 * times.c (SYS_FUNC(times)): Always return 0. 6045 * tests/inject-nf.c (main): Update expected output. 6046 6047 2018-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 6048 6049 tests: check handling of some invalid delay injection parameters. 6050 * tests/qual_inject-syntax.test: Check for negative delay injection 6051 parameters. Check for overriding delay injection parameters. 6052 6053 2018-03-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6054 6055 Implement injection of negative return values. 6056 Extend the range of injected return value to the maximum, print warnings 6057 if negative injection value can be clipped in compat personality or can 6058 inadvertently turn into a fault injection. 6059 6060 * defs.h (INJECT_F_ERROR): New macro. 6061 * filter_qualify.c (parse_inject_token): Revert type of intval local 6062 variable back to int, check INJECT_F_ERROR along with INJECT_F_RETVAL, 6063 use strtoull to parse retval argument, print warnings in case of retval 6064 clipping and inadvertent fault injection. 6065 (qualify_inject_common): Set INJECT_F_ERROR instead of INJECT_F_RETVAL. 6066 * syscall.c (tamper_with_syscall_exiting): Check inject_data.flags 6067 to determine whether a fault injection or retval injection has to be 6068 performed. 6069 (syscall_exiting_trace) <case RVAL_DECIMAL>: Explicitly print 6070 tcp->u_rval as int if current_klongsize < sizeof(tcp->u_rval). 6071 * tests/inject-nf.c (main): Update. 6072 * tests/inject-nf.test: Test injection of negative return values. 6073 * tests/qual_inject-syntax.test: Remove retval=-1 check as it is now 6074 allowed, add checks for invalid retval parameters. 6075 6076 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6077 6078 2018-03-28 Dmitry V. Levin <ldv (a] altlinux.org> 6079 6080 arch_defs.h: fix typo in comment. 6081 6082 Move delay interface from defs.h to delay.h. 6083 * defs.h (alloc_delay_data, fill_delay_data, is_delay_timer_armed, 6084 delay_timer_expired, arm_delay_timer, delay_tcb): Move... 6085 * delay.h: ... to new file. 6086 * Makefile.am (strace_SOURCES): Add it. 6087 * filter_qualify.c: Include it. 6088 * strace.c: Likewise. 6089 * syscall.c: Likewise. 6090 6091 2018-03-28 Dmitry V. Levin <ldv (a] altlinux.org> 6092 6093 Turn struct inject_data.rval into an index. 6094 Add one level of indirection to decrease the size of struct inject_data 6095 as hundreds of these structures are created for each process when 6096 injection mechanism is activated. 6097 6098 * retval.h: New file. 6099 * retval.c: Likewise. 6100 * Makefile.am (strace_SOURCES): Add them. 6101 * defs.h (struct inject_data): Replace rval field with rval_idx. 6102 * filter_qualify.c: Include "retval.h". 6103 (parse_inject_token, qualify_inject_common): Initialize 6104 struct inject_data.rval_idx using retval_new. 6105 * syscall.c: Include "retval.h". 6106 (tamper_with_syscall_exiting): Obtain the value that has to be injected 6107 using retval_get. 6108 6109 2018-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 6110 6111 defs.h: update comment. 6112 * defs.h (struct inject_data): Update comment about flags. 6113 6114 Complements: v4.21-108-gba8e768 ("Implement delay injection") 6115 6116 2018-03-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6117 6118 xlat: cleanup mmap_flags.in. 6119 * xlat/mmap_flags.in (_MAP_NEW): Remove SunOS-specific comment, add 6120 a comment that this is a SPARC-specific constant (from 6121 arch/sparc/include/uapi/asm/mman.h). 6122 (MAP_GROWSUP): IA-64-specific constant (from 6123 arch/ia64/include/uapi/asm/mman.h). 6124 (MAP_INHERIT): Add a comment that this is a SPARC-specific constant 6125 (from arch/sparc/include/uapi/asm/mman.h). 6126 (_MAP_INHERIT): Add a comment that this is an Alpha-specific constant 6127 (from arch/alpha/include/uapi/asm/mman.h). 6128 (MAP_ANON): Remove, FreeBSD-specific constant. 6129 (MAP_HASSEMAPHORE): Rename to... 6130 (_MAP_HASSEMAPHORE): ...this, add a comment that this is an 6131 Alpha-specific constant (from arch/alpha/include/uapi/asm/mman.h). 6132 (MAP_NOSYNC, MAP_NOCORE): Remove. 6133 (MAP_AUTOGROW, MAP_AUTORSRV, MAP_LOCAL): Add a comment that this is 6134 an architecture-specific constant (from 6135 arch/mips/include/uapi/asm/mman.h, arch/xtensa/include/uapi/asm/mman.h). 6136 (_MAP_UNALIGNED): Add a comment that this is an Alpha-specific constant 6137 (from arch/alpha/include/uapi/asm/mman.h). 6138 6139 2018-03-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6140 6141 tests: check decoding of kern_features syscall. 6142 * tests/kern_features.c: New file. 6143 * tests/kern_features-fault.test: New test. 6144 * tests/gen_tests.in (kern_features): New entry. 6145 * tests/Makefile.am (DECODER_TESTS): Add kern_features-fault.test. 6146 * tests/pure_executables.list: Add kern_features. 6147 * tests/.gitignore: Likewise. 6148 6149 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6150 6151 2018-03-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6152 6153 sparc, sparc64: implement kern_features decoder. 6154 * sparc.c: New file. 6155 * Makefile.am (EXTRA_DIST): Add it. 6156 * linux/sparc/syscallent.h ([340]): Remove NF flag, set kern_features 6157 decoder. 6158 * linux/sparc64/syscallent.h ([340]): Likewise. 6159 * xlat/sparc_kern_features.in: New file. 6160 * NEWS: Mention this enhancement. 6161 6162 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6163 6164 2018-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 6165 6166 evdev: move mpers-specific parsers to a separate file. 6167 This change reduces binary code duplication on mpers platforms 6168 and prepares evdev parsers to use printxval_bsearch. 6169 6170 * defs.h (evdev_ioctl, print_evdev_ff_type): New prototypes. 6171 * evdev.c (evdev_ioctl): Un-mpersify. 6172 (evdev_write_ioctl) Remove EVIOCSFF case, forward default case 6173 to evdev_write_ioctl_mpers. 6174 (decode_envelope, ff_effect_ioctl): Move to... 6175 * evdev_mpers.c: ... new file. 6176 * Makefile.am (strace_SOURCES): Add evdev_mpers.c. 6177 6178 2018-03-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6179 6180 ci: install libunwind8-dev. 6181 While in debian/control we use libunwind-dev in Build-Depends, in case 6182 of ci we have to be more conservative and use the name portable across 6183 different ci implementations. 6184 6185 * ci/install-dependencies.sh (common_packages): Add libunwind8-dev. 6186 6187 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6188 6189 2018-03-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6190 6191 tests: check injection of return values into a "never fails" syscall. 6192 * tests/inject-nf.c: New file. 6193 * tests/inject-nf.test: New test. 6194 * tests/.gitignore: Add inject-nf. 6195 * tests/Makefile.am (check_PROGRAMS): Likewise. 6196 (MISC_TESTS): Add inject-nf.test. 6197 6198 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6199 6200 2018-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 6201 6202 Introduce raw syscall invocation wrappers. 6203 Unfortunately, syscall(3) provided by libc is too smart 6204 for some of our needs. 6205 6206 * linux/raw_syscall.h: New file. 6207 * linux/aarch64/raw_syscall.h: Likewise. 6208 * linux/alpha/raw_syscall.h: Likewise. 6209 * linux/arc/raw_syscall.h: Likewise. 6210 * linux/arm/raw_syscall.h: Likewise. 6211 * linux/avr32/raw_syscall.h: Likewise. 6212 * linux/bfin/raw_syscall.h: Likewise. 6213 * linux/hppa/raw_syscall.h: Likewise. 6214 * linux/i386/raw_syscall.h: Likewise. 6215 * linux/ia64/raw_syscall.h: Likewise. 6216 * linux/m68k/raw_syscall.h: Likewise. 6217 * linux/metag/raw_syscall.h: Likewise. 6218 * linux/microblaze/raw_syscall.h: Likewise. 6219 * linux/mips/raw_syscall.h: Likewise. 6220 * linux/nios2/raw_syscall.h: Likewise. 6221 * linux/or1k/raw_syscall.h: Likewise. 6222 * linux/powerpc/raw_syscall.h: Likewise. 6223 * linux/powerpc64/raw_syscall.h: Likewise. 6224 * linux/riscv/raw_syscall.h: Likewise. 6225 * linux/s390/raw_syscall.h: Likewise. 6226 * linux/s390x/raw_syscall.h: Likewise. 6227 * linux/sh/raw_syscall.h: Likewise. 6228 * linux/sh64/raw_syscall.h: Likewise. 6229 * linux/sparc/raw_syscall.h: Likewise. 6230 * linux/sparc64/raw_syscall.h: Likewise. 6231 * linux/tile/raw_syscall.h: Likewise. 6232 * linux/x32/raw_syscall.h: Likewise. 6233 * linux/x86_64/raw_syscall.h: Likewise. 6234 * linux/xtensa/raw_syscall.h: Likewise. 6235 * Makefile.am (EXTRA_DIST): Add them. 6236 6237 2018-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 6238 6239 tests: fix potentially unbound variable in kernel_version_code. 6240 Fix the following use case: 6241 6242 $ sh -uc '. tests/init.sh; kernel_version_code 4.5' 6243 tests/init.sh: line 242: 3: unbound variable 6244 6245 * tests/init.sh (kernel_version_code): Fix potentially unbound variable. 6246 6247 2018-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 6248 6249 strace: further optimize unblocking of the delay signal handler. 6250 Do not unblock the delay signal handler unless the delay timer is armed. 6251 6252 * defs.h (is_delay_timer_created): Remove. 6253 (is_delay_timer_armed, delay_timer_expired): New prototypes. 6254 * delay.c (delay_timer_is_armed): New static variable. 6255 (is_delay_timer_created): Add static qualifier. 6256 (is_delay_timer_armed, delay_timer_expired): New functions. 6257 (arm_delay_timer): Set delay_timer_is_armed. 6258 * strace.c (next_event): Use is_delay_timer_armed instead of 6259 is_delay_timer_created to check whether the delay signal handler 6260 has to be unblocked. 6261 (timer_sighandler): Invoke delay_timer_expired. 6262 6263 2018-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 6264 6265 strace: rewrite restart error handling without sigsetjmp/siglongjmp. 6266 Further simplify and optimize error handling of the delay signal handler 6267 by replacing sigsetjmp/siglongjmp mechanism with an error flag. 6268 6269 * strace.c: Do not include <setjmp.h>. 6270 (restart_failed): New volatile variable. 6271 (timer_jmp_buf): Remove. 6272 (next_event): Cache is_delay_timer_created() return value, 6273 remove sigsetjmp invocation, check restart_failed instead. 6274 (timer_sighandler): Replace siglongjmp with setting restart_failed. 6275 6276 2018-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 6277 6278 strace: do not call sigsetjmp without a delay timer. 6279 As sigsetjmp costs a syscall, do not call it unless a delay timer 6280 is already created and its signal handler is going to be unblocked. 6281 6282 * strace.c (next_event): Move sigsetjmp invocation under 6283 is_delay_timer_created() condition. 6284 6285 Optimizes: v4.21-108-gba8e768 ("Implement delay injection") 6286 6287 2018-03-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6288 6289 tests/bpf.c: convert TEST_BPF_ macro to a function. 6290 As it looks like there's no compelling reason to keep it as a macro and 6291 leaving it so quite complicates modification of the routine and makes 6292 them error-prone. 6293 6294 * tests/bpf.c (TEST_BPF_): Convert it to... 6295 (test_bpf): ...this. Rename cmd_ to cmd, cmd_str_ to cmd_str, 6296 init_first_ to init_first, print_first_ to print_first, init_attr_ 6297 to init_attr, print_attr_ to print_attr. 6298 (TEST_BPF): Call test_bpf_ instead of TEST_BPF_. 6299 6300 2018-03-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6301 6302 tests: btrfs.c whitespace cleanup. 6303 * tests/btrfs.c: Add spaces after PRI* format specifiers. 6304 6305 2018-03-22 Elvira Khabirova <lineprinter (a] altlinux.org> 6306 6307 tests: check delay injection. 6308 * tests/delay.c: New file. 6309 * tests/delay.test: New test. 6310 * tests/.gitignore: Add delay. 6311 * tests/Makefile.am (check_PROGRAMS): Likewise. 6312 (delay_LDADD): New variable. 6313 (MISC_TESTS): Add delay.test. 6314 6315 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6316 6317 2018-03-22 Elvira Khabirova <lineprinter (a] altlinux.org> 6318 6319 Implement delay injection. 6320 Add -e inject=SET:delay_enter= and -e inject=SET:delay_exit= options. 6321 6322 * configure.ac (AC_SEARCH_LIBS): Check for timer_create -lrt. 6323 * delay.c: New file. 6324 * Makefile.am (strace_SOURCES): Add it. 6325 (strace_LDADD): Add $(timer_LIBS). 6326 * defs.h (INJECT_F_DELAY_ENTER, INJECT_F_DELAY_EXIT, 6327 TCB_INJECT_DELAY_EXIT, TCB_DELAYED, inject_delay_exit, syscall_delayed): 6328 New macros. 6329 (alloc_delay_data, fill_delay_data, is_delay_timer_created, 6330 arm_delay_timer, delay_tcb): New prototypes. 6331 (struct inject_data): Replace reserved field with delay_idx. 6332 (struct tcb): Add delay_expiration_time field. 6333 * filter_qualify.c (parse_delay_token): New function. 6334 (parse_inject_token): Use it. 6335 (qualify_inject_common): Initialize struct inject_opts.data.delay_idx. 6336 * strace.c: Include <setjmp.h> 6337 (timer_jmp_buf, timer_set): New static variables. 6338 (timer_sighandler, restart_delayed_tcb, restart_delayed_tcbs): New 6339 functions. 6340 (init): Block SIGALRM, set SIGALRM handler. 6341 (dispatch_event): Do not restart delayed syscalls. 6342 (next_event): Unblock SIGALRM during wait4 invocation. 6343 * syscall.c (tamper_with_syscall_entering): Arm delay timer if 6344 INJECT_F_DELAY_ENTER injection flag is set, set TCB_INJECT_DELAY_EXIT 6345 flag if INJECT_F_DELAY_EXIT injection flag is set. 6346 tamper_with_syscall_exiting): Arm delay timer if inject_delay_exit. 6347 (syscall_exiting_trace): Call tamper_with_syscall_exiting in case of 6348 inject_delay_exit. 6349 (syscall_exiting_finish): Clear TCB_INJECT_DELAY_EXIT flag. 6350 * strace.1.in: Document delay injection. 6351 * NEWS: Mention this improvement. 6352 6353 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6354 6355 2018-03-22 Dmitry V. Levin <ldv (a] altlinux.org> 6356 6357 Do not block handled signals in interactive mode. 6358 Let these signals be handled asynchronously as they are acted on 6359 only when waiting for process state changes. 6360 6361 * strace.c (start_set, blocked_set): Remove. 6362 (set_sighandler): Do not update blocked_set. 6363 (startup_attach, init, next_event): Remove all sigprocmask calls. 6364 6365 2018-03-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6366 6367 bpf: improve handling of various sizes of bpf_prog_attr structure. 6368 As program attributes have been added gradually over kernel versions, 6369 attribute size less than expected should be printed accordingly. 6370 6371 * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Do not print structure 6372 fields if their size is less than the initially introduced (in Linux 6373 commit v3.18-rc1~52^2~1^2~7) version. Print fields of union bpf_attr 6374 introduced in various kernel versions when the length is big enough 6375 (new fields were introduced in Linux commits v3.18-rc1~52^2~1^2~4, 6376 v4.1-rc1~84^2~50, and v4.12-rc2~34^2~29^2~2). 6377 * tests/bpf.c (print_BPF_PROG_LOAD_first): Update expected output. 6378 6379 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6380 6381 2018-03-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6382 6383 btrfs: print struct btrfs_ioctl_logical_ino_args.reserved if non-zero. 6384 * btrfs.c (btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print 6385 struct btrfs_ioctl_logical_ino_args.reserved field if it is not zero. 6386 * tests/btrfs.c (btrfs_test_ino_path_ioctls): Check it. 6387 6388 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6389 6390 2018-03-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6391 6392 Move is_filled and IS_ZERO to macros.h, rename IS_ZERO to IS_ARRAY_ZERO. 6393 * s390.c: Replace all IS_ZERO invocations with IS_ARRAY_ZERO. 6394 (is_filled, IS_ZERO): Move... 6395 * macros.h: ...here. 6396 (is_filled): Add inline qualifier, add const qualifier to ptr. 6397 (IS_ZERO): Rename to IS_ARRAY_ZERO, cast arr_ to "const char *". 6398 6399 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6400 6401 2018-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 6402 6403 mpers.m4: enhance workaround for missing gnu/stubs-*.h files. 6404 Make generated empty gnu stub files available for mpers_test.sh check. 6405 6406 * m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS for mpers_test.sh 6407 invocation. 6408 6409 Complements: v4.11~223 ("mpers.m4: workaround missing gnu/stubs-*.h files") 6410 6411 2018-03-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6412 6413 README.md: add references to binary strace packages. 6414 * README.md: Add references to binary strace packages in OBS, 6415 Fedora rawhide, and Sisyphus. 6416 6417 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6418 6419 2018-03-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6420 6421 INSTALL-git.md: enhance phrasing. 6422 * INSTALL-git.md: Enhance phrasing. 6423 6424 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6425 6426 2018-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 6427 6428 bootstrap: distribute README. 6429 * bootstrap: Install README before invoking autoreconf to get README 6430 included into distributed tarball. 6431 6432 Fixes: v4.21-93-g4bb8454 ("Move README to dist subdirectory") 6433 6434 2018-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 6435 6436 Replace struct timeval with struct timespec in time measurements. 6437 This is required to implement more precise time measurements. 6438 6439 * Makefile.am (strace_LDADD): Add $(clock_LIBS). 6440 * defs.h (struct tcb): Change the type of stime, dtime, and etime fields 6441 from struct timeval to struct timespec, all users updated. 6442 (syscall_exiting_decode, syscall_exiting_trace, count_syscall): Change 6443 the type of "struct timeval *" argument to "struct timespec *", all 6444 users updated. 6445 (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): Rename to 6446 ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul. Change 6447 the type of all "struct timeval *" arguments to "struct timespec *", 6448 all users updated. 6449 * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): 6450 Rename to ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul. 6451 Change the type of all "struct timeval *" arguments to "struct timespec *". 6452 * count.c (struct call_counts): Change the type of "time" field 6453 from struct timeval to struct timespec, all users updated. 6454 (overhead): Change type from struct timeval to struct timespec, all 6455 users updated. 6456 (count_syscall): Change the type of "struct timeval *" argument to 6457 "struct timespec *". 6458 * strace.c (printleader): Change the type of struct timeval variables 6459 to struct timespec, call clock_gettime instead of gettimeofday. 6460 (next_event, trace_syscall): Change the type of struct timeval variables 6461 to struct timespec. 6462 * syscall.c (syscall_entering_finish, syscall_exiting_decode): Call 6463 clock_gettime instead of gettimeofday. 6464 6465 2018-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 6466 6467 Fix -O option handling. 6468 Fast syscalls usually take less than a microsecond of system cpu time 6469 nowadays, making -O option almost useless. 6470 6471 * count.c (call_summary_pers): Avoid negative time counts. 6472 * tests/count.test: Check it. 6473 * NEWS: Mention it. 6474 6475 2018-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 6476 6477 count: cleanup count_syscall. 6478 * count.c (shortest): Remove. 6479 (overhead): Initialize to zero. 6480 (call_summary_pers): Remove shortest handling. 6481 (count_syscall): Remove dead code. The remaining code does the same 6482 wrong calculations as before the change, though. 6483 6484 printleader: cleanup tflag handling. 6485 * strace.c (printleader): Move declarations of variables closer 6486 to their first use. 6487 6488 2018-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 6489 6490 Move install.texi to maint subdirectory. 6491 This file comes from GNU Autoconf and is used to generate INSTALL file. 6492 6493 * install.texi: Move... 6494 * maint/install.texi: ...here. 6495 6496 2018-03-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6497 6498 doc: update commit requirements. 6499 * README-hacking (Requirements): Enhance phrasing. 6500 (Commit log requirements): Rename to "Commit requirements", 6501 describe "absence of whitespace errors" requirement, add references 6502 to the Linux kernel coding style and scripts/checkpatch.pl script. 6503 6504 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6505 6506 2018-03-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6507 6508 Move README to dist subdirectory. 6509 README was originally written for users of distribution tarballs. 6510 Nowadays it appears to be confusing for those who build strace 6511 using a GIT version of strace source code. 6512 6513 * README: Move... 6514 * dist/README: ...here. 6515 * bootstrap: Copy README from dist subdirectory to the toplevel 6516 directory after successful autoreconf. 6517 6518 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6519 References: https://github.com/strace/strace/issues/56 6520 6521 2018-03-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6522 6523 README: synchronise with README.md. 6524 * README: Extend description, reference COPYING. 6525 6526 2018-03-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6527 6528 poll.c: remove special INFTIM handling. 6529 On Linux, poll syscall interprets any negative timeout value as an 6530 infinite timeout, so no need to handle BSD-specific INFTIM. 6531 6532 * poll.c (SYS_FUNC(poll)): Remove INFTIM handling. 6533 6534 2018-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 6535 6536 build: do not hardcode -lrt. 6537 Depending on libc implementation, various -lrt functions can be 6538 implemented either in -lc or in -lrt. For example, starting with 6539 glibc-2.17 the clock_* suite of functions is available directly in -lc. 6540 6541 Check whether clock_* and mq_* suites of functions are provided 6542 by -lrt or by the main C library, do not link with -lrt unnecessarily. 6543 6544 This change affects only tests yet, but this is going to be 6545 more important as soon as strace starts using clock_gettime. 6546 6547 * configure.ac (AC_SEARCH_LIBS): Check for clock_gettime and mq_open 6548 in -lrt. 6549 (AC_SUBST): Add clock_LIBS and mq_LIBS. 6550 * tests/Makefile.am (mq_LDADD): Replace -lrt with $(mq_LIBS). 6551 (threads_execve_LDADD, times_LDADD): Replace -lrt with $(clock_LIBS). 6552 6553 2018-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 6554 6555 tests: do not link with -lrt unnecessarily. 6556 * tests/Makefile.am (attach_f_p_LDADD): Remove -lrt. 6557 (clock_xettime_LDADD, mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, 6558 mq_sendrecv_write_LDADD): Remove. 6559 6560 2018-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 6561 6562 Optimize pid2tcb. 6563 Introduce an internal cache of pid2tcb translations. 6564 This can save more than 80% of CPU user time spent by strace. 6565 6566 Tested using the following setup: 6567 6568 #include <unistd.h> 6569 #include <sys/stat.h> 6570 #include <sys/wait.h> 6571 int main() 6572 { 6573 int i; 6574 sleep(1); 6575 for (i = 1; i < 1000; ++i) { 6576 pid_t pid = fork(); 6577 if (pid < 0) 6578 return 2; 6579 if (pid) 6580 return wait(&i) != pid || i; 6581 } 6582 sleep(1); 6583 for (i = 0; i < 10000000; ++i) 6584 umask(0777); 6585 return 0; 6586 } 6587 6588 old$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \ 6589 while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \ 6590 time -f '%Uuser %Ssystem %eelapsed %PCPU' \ 6591 ../strace -qq -enone -esignal=none -f -p $! 6592 5.51user 104.90system 122.45elapsed 90%CPU 6593 6594 new$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \ 6595 while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \ 6596 time -f '%Uuser %Ssystem %eelapsed %PCPU' \ 6597 ../strace -qq -enone -esignal=none -f -p $! 6598 1.29user 102.78system 114.97elapsed 90%CPU 6599 6600 2018-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 6601 6602 Enable USE_SEIZE code unconditionally. 6603 It is by no means an experimental code. 6604 6605 * defs.h (USE_SEIZE): Remove. 6606 * strace.c [!USE_SEIZE]: Remove. 6607 6608 2018-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 6609 6610 ci: clone musl from the local server. 6611 Assume that strace project on the local server contains an appropriate 6612 musl repository, use this repository instead of hardcoded github 6613 location. 6614 6615 * ci/install-dependencies.sh (clone_repo): Use local server by default. 6616 (musl-gcc): Un-hardcode the location of musl repository. 6617 6618 2018-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 6619 6620 ci: refactor cloning of additional repositories. 6621 * ci/install-dependencies.sh (clone_repo): New function. 6622 Use it instead of direct invocations of git clone. 6623 6624 ci: extend error diagnostics when configure invocation fails. 6625 * ci/run-build-and-tests.sh: Include $CC -dumpspecs output in addition 6626 to config.log when ./configure fails. 6627 6628 ci: rename travis-build.sh and travis-install.sh scripts. 6629 * travis-build.sh: Rename to ci/run-build-and-tests.sh, all callers 6630 updated. 6631 * travis-install.sh: Rename to ci/install-dependencies.sh, all callers 6632 updated. 6633 6634 tests: extend ioctl.test libc protection to -y output. 6635 * tests/ioctl.test: Extend the filter of ioctl calls with standard 6636 descriptor arguments to -y output. 6637 6638 2018-03-12 Harsha Sharma <harshasharmaiitr (a] gmail.com> 6639 6640 ptp.c: print field names and use macros form print_fields.h. 6641 * ptp.c: Include "print_fields.h". 6642 (ptp_ioctl): Print field names with field values for PTP_PEROUT_REQUEST, 6643 use macros from print_fields.h. 6644 6645 2018-03-11 Chen Jingpiao <chenjingpiao (a] gmail.com> 6646 6647 tests: add check for decoding of netfilter subsystem. 6648 * tests/netlink_netfilter.c(test_nfgenmsg): Add check for decoding 6649 of netfilter subsystem. 6650 6651 nfnetlink: introduce generic netfilter subsystem decoder. 6652 * netlink_netfilter.c: Include "nlattr.h". 6653 (decode_netlink_netfilter): Call decode_nlattr. 6654 6655 2018-03-11 Chen Jingpiao <chenjingpiao (a] gmail.com> 6656 6657 Move nl_netfilter_msg_types definition from netlink.c to netlink_netfilter.c 6658 The side effect of #include "xlat/nl_netfilter_msg_types.h" is 6659 NFNL_MSG_BATCH_* constants properly defined in that header file. 6660 While netlink.c does not use these constants itself, 6661 netlink_netfilter.c is going to need them soon. 6662 6663 * defs.h (nl_netfilter_msg_types): New xlat prototype. 6664 * netlink.c: Move inclusion of "xlat/nl_netfilter_msg_types.h" ... 6665 * netlink_netfilter.c: ... here. 6666 6667 2018-03-11 Chen Jingpiao <chenjingpiao (a] gmail.com> 6668 6669 tests: add check for NETLINK_NETFILTER parser. 6670 * tests/netlink_netfilter.c: Include <netinet/in.h>, <arpa/inet.h> 6671 and <linux/netfilter/nf_tables.h>. 6672 Replace "netlink.h" with "test_netlink.h". 6673 (NFNL_SUBSYS_NFTABLES, NFT_MSG_NEWTABLE): New macros. 6674 (test_nlmsg_done, test_nfgenmsg): New functions. 6675 (main): Use them. 6676 6677 netlink: introduce NETLINK_NETFILTER parser. 6678 * netlink_netfilter.c: New file. 6679 * Makefile.am (strace_SOURCES): Add it. 6680 * defs.h (decode_netlink_netfilter): New prototype. 6681 * netlink.c (netlink_decoders): Add NETLINK_NETFILTER. 6682 * xlat/netfilter_versions.in: New file. 6683 6684 2018-03-11 Chen Jingpiao <chenjingpiao (a] gmail.com> 6685 6686 xlat: remove NFNL_SUBSYS_COUNT constant. 6687 NFNL_SUBSYS_COUNT is not a symbol with some constant value, it changes 6688 with time, just print it as an unrecognized number. 6689 6690 * xlat/nl_netfilter_subsys_ids.in (NFNL_SUBSYS_COUNT): Remove. 6691 6692 2018-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 6693 6694 inject_data: make room for more injection features. 6695 * defs.h (struct inject_data): Squeeze flags and signo fields from 6696 uint16_t to uint8_t to make room for more injection features. 6697 6698 2018-03-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6699 6700 xlat: sort v4l2_pix_fmts.in and v4l2_sdr_fmts.in. 6701 * xlat/v4l2_pix_fmts.in: Sort by value, add a comment about sorting. 6702 * xlat/v4l2_sdr_fmts.in: Likewise. 6703 6704 2018-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 6705 6706 xlat: add comments to all sorted xlat files. 6707 Add a short comment describing the method used to sort entries. 6708 6709 * xlat/ethernet_protocols.in: Update the comment about sorting. 6710 * xlat/fsmagic.in: Likewise. 6711 * xlat/evdev_keycode.in: Add a comment about sorting. 6712 * xlat/hw_breakpoint_type.in: Likewise. 6713 * xlat/perf_hw_cache_id.in: Likewise. 6714 * xlat/perf_hw_cache_op_id.in: Likewise. 6715 * xlat/perf_hw_cache_op_result_id.in: Likewise. 6716 * xlat/perf_hw_id.in: Likewise. 6717 * xlat/perf_sw_ids.in: Likewise. 6718 * xlat/perf_type_id.in: Likewise. 6719 6720 2018-03-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6721 6722 bpf: remove page size caching. 6723 get_pagesize() has a static cache anyway, no need to duplicate it. 6724 6725 * bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its 6726 initialisation, use get_pagesize() as the size of buf directly. 6727 6728 2018-03-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6729 6730 bpf_filter: fix indentation of the switch clause. 6731 * bpf_filter.c (print_bpf_filter_code): Fix switch clause indentation. 6732 6733 2018-03-08 Dmitry V. Levin <ldv (a] altlinux.org> 6734 6735 xlat: provide fallback definitions for arch-independent mmap flags. 6736 This is important for recently introduced MAP_SHARED_VALIDATE flag. 6737 6738 * xlat/mmap_flags.in (MAP_SHARED, MAP_PRIVATE, MAP_SHARED_VALIDATE): 6739 Add constant values. 6740 6741 Fixes: v4.21-67-g8c209d1 ("tests: fix remap_file_pages.test breakage on hppa") 6742 6743 2018-03-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6744 6745 bpf: print kern_version in the form of KERNEL_VERSION macro. 6746 * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print 6747 union bpf_attr.kern_version in the form of KERNEL_VERSION macro call. 6748 * tests/bpf.c: Update expected output. 6749 6750 2018-03-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6751 6752 tests: fix remap_file_pages.test breakage on hppa. 6753 Apparently, hppa is the only architecture that has MAP_TYPE 6754 defined to 0x3 instead of 0xf, and the tests hit that corner case. 6755 6756 * tests/remap_file_pages.c (main) [MAP_HUGETLB]: Print the value 6757 of mapping type depending on the architecture (MAP_SHARED_VALIDATE 6758 for hppa and unknown value for other architectures). 6759 6760 Fixes: v4.21~59 ("xlat: update MAP_* constants") 6761 6762 2018-03-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6763 6764 Sort Ethernet protocols xlat. 6765 * defs.h (ethernet_protocols_size): New declaration. 6766 * netlink_packet_diag.c (decode_packet_diag_req): Use 6767 printxval_searchnn to print Ethernet protocols. 6768 * sockaddr.c (ethernet_protocols_size): New constant, item count 6769 in ethernet_protocols array. 6770 (print_sockaddr_data_ll): Use printxval_search instead of 6771 printxval to print Ethernet protocols. 6772 * xlat/ethernet_protocols.in: Sort it by value, add comment 6773 about the fact. 6774 6775 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6776 6777 2018-03-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6778 6779 Change sorted arrays to be terminated with XLAT_END like unsorted arrays 6780 It is quite unwieldy to have this distinction between sorted and 6781 unsorted arrays when we can just decrement the size in a wrapper. 6782 6783 * defs.h (printxval_search): Decrement array size. 6784 * xlat/fsmagic.in (#unterminated): Remove. 6785 * xlat/hw_breakpoint_type.in (#unterminated): Remove. 6786 * xlat/perf_hw_cache_id.in (#unterminated): Remove. 6787 * xlat/perf_hw_cache_op_id.in (#unterminated): Remove. 6788 * xlat/perf_hw_cache_op_result_id.in (#unterminated): Remove. 6789 * xlat/perf_hw_id.in (#unterminated): Remove. 6790 * xlat/perf_sw_ids.in (#unterminated): Remove. 6791 * xlat/perf_type_id.in (#unterminated): Remove. 6792 * xlat/gen.sh (gen_header): Remove #unterminated support. 6793 6794 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6795 6796 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6797 6798 strace.1.in: add a note about tracing of scripts without shebang. 6799 * strace.1.in (.SH NOTES): Note that tracing of scripts without shebang 6800 won't work. 6801 6802 Reported-by: Mike Parker 6803 Closes: https://github.com/strace/strace/issues/46 6804 6805 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6806 6807 strace.1.in: mention that -c suppresses regular output. 6808 As the note that -C makes strace "also print regular output" can be 6809 easily overlooked. 6810 6811 * strace.1.in (.SS Statistics) <.TP .B \-c>: Mention that -c supresses 6812 regular output. 6813 6814 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6815 6816 errnoent.h: add ERECALLCONFLICT. 6817 * linux/errnoent.h ([530]): Add ERECALLCONFLICT error introduced by 6818 Linux commit v4.7-rc1~40^2~6. 6819 * linux/alpha/errnoent.h ([530]): Likewise. 6820 * linux/hppa/errnoent.h ([530]): Likewise. 6821 * linux/mips/errnoent.h ([530]): Likewise. 6822 * linux/sparc/errnoent.h ([530]): Likewise. 6823 6824 xlat: add BPF_F_ALLOW_MULTI constant. 6825 * xlat/bpf_attach_flags.in (BPF_F_ALLOW_MULTI): New constant, introduced 6826 by Linux commit v4.15-rc1~84^2~558^2~7. 6827 6828 xlat: add BPF_MAP_TYPE_CPUMAP constant. 6829 * xlat/bpf_map_types.in (BPF_MAP_TYPE_CPUMAP): New constant, introduced 6830 by Linux commit v4.15-rc1~84^2~427^2~4. 6831 6832 tests/test_printstrn.c: do not declare i again. 6833 6834 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6835 6836 tests/s390_sthyi.c: make utility functions inline. 6837 When built with --enable-gcc-Werror, s390_sthyi test build fails 6838 with the following error: 6839 6840 s390_sthyi.c:63:1: error: print_u8 defined but not used [-Werror=unused-function] 6841 print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) 6842 ^~~~~~~~ 6843 6844 Apparently, after some back and forth, all occurrences of printing u8 6845 values landed under verbose printing, so this function is no longer 6846 used in non-verbose mode. Let's avoid this in the future by inlining 6847 all the utility functions in this test. 6848 6849 * tests/s390_sthyi.c (print_0x8, print_u8, print_u16, print_x32, 6850 print_weight, ebcdic2ascii, is_empty, print_ebcdic): Add inline 6851 qualifier. 6852 [!VERBOSE] (is_empty): Remove "# if VERBOSE" guard. 6853 6854 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6855 6856 btrfs: print struct btrfs_ioctl_logical_ino_args.flags field. 6857 The field has been introduced in Linux commit v4.15-rc1~135^2~17. 6858 6859 * btrfs.c: Implement decoding of 6860 struct btrfs_ioctl_logical_ino_args.flags field. 6861 * configure.ac: Check for struct btrfs_ioctl_logical_ino_args.flags 6862 presence in linux/btrfs.h. 6863 * tests/btrfs.c: Update expected output, add additional checks. 6864 * xlat/btrfs_logical_ino_args_flags.in: New file. 6865 6866 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6867 6868 btrfs.c: print __u64 fields with pointer semantics using printaddr64. 6869 * btrfs.c (btrfs_ioctl) <case BTRFS_IOC_INO_PATHS>: Print fspath field 6870 with printaddr64. 6871 (btrfs_ioctl) <case BTRFS_IOC_LOGICAL_INO>: Print inodes field with 6872 printaddr64. 6873 * tests/btrfs.c: Add checks for NULL in fspath and inodes fields. 6874 * NEWS: Mention it. 6875 6876 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6877 6878 util.c: introduce printaddr64. 6879 Sometimes, 64-bit value is expected to be interpreted as an address 6880 (in BTRFS ioctl interface, for example). 6881 6882 * defs.h (printaddr64): New declaration. 6883 * util.c (printaddr64): Rename from printaddr, change argument type 6884 to uint64_t. 6885 (printaddr): Turn into a thin wrapper around printaddr64. 6886 (printnum_addr_int, printnum_addr_int64): Use printaddr64 instead of 6887 printaddr. printnum_addr_int64 is not used outside the cases where 6888 kernel_long is less or equal than 64 bit currently, so this change 6889 should be safe. 6890 6891 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6892 6893 prctl: add decoding of PR_SVE_SET_VL and PR_SVE_GET_VL commands. 6894 These commands were introduced in Linux commit v4.15-rc1~110^2~9. 6895 6896 * xlat/pr_sve_vl_flags.in: New file. 6897 * xlat/prctl_options.in: Likewise. 6898 * prctl.c: Include "xstring.h" and "xlat/pr_sve_vl_flags.h". 6899 [!PR_SVE_VL_LEN_MASK] (PR_SVE_VL_LEN_MASK): New macro constant. 6900 (sprint_sve_val): New function. 6901 (SYS_FUNC(prctl)): Add decoding for PR_SVE_GET_VL and PR_SVE_SET_VL 6902 commands. 6903 * NEWS: Mention it. 6904 6905 2018-03-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6906 6907 Implement PTRACE_SECCOMP_GET_METADATA ptrace request decoding. 6908 * defs.h (seccomp_filter_flags): New declaration. 6909 * process.c (SYS_FUNC(ptrace)): Implement PTRACE_SECCOMP_GET_METADATA 6910 request decoding. 6911 * ptrace.h [!PTRACE_SECCOMP_GET_METADATA] (PTRACE_SECCOMP_GET_METADATA): 6912 New macro constant. 6913 * xlat/ptrace_cmds.in (PTRACE_SECCOMP_GET_METADATA): New constant. 6914 * tests/ptrace.c (main): Add some checks for PTRACE_SECCOMP_GET_METADATA 6915 request decoding. 6916 * NEWS: Mention it. 6917 6918 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 6919 6920 2018-03-06 Dmitry V. Levin <ldv (a] altlinux.org> 6921 6922 build: prepare for -Wimplicit-fallthrough=5. 6923 * gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro. 6924 * block.c (block_ioctl): Use it instead of "fall through" comment. 6925 * btrfs.c (btrfs_ioctl): Likewise. 6926 * loop.c (loop_ioctl): Likewise. 6927 * mtd.c (mtd_ioctl): Likewise. 6928 * rtc.c (rtc_ioctl): Likewise. 6929 * v4l2.c (v4l2_ioctl): Likewise. 6930 * dm.c (dm_decode_values): Likewise. 6931 * process.c (SYS_FUNC(ptrace)): Likewise. 6932 * quota.c (decode_cmd_data): Likewise. 6933 * ucopy.c (umovestr): Likewise. 6934 * unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)): 6935 Likewise. 6936 * term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH. 6937 * ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise. 6938 * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5. 6939 * tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement 6940 without implicit fallthrough. 6941 6942 2018-03-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6943 6944 xlat: add eBPF-based device controller constants. 6945 Add new BPF_PROG_TYPE_CGROUP_DEVICE eBPF program type and new 6946 BPF_CGROUP_DEVICE eBPF program attach type, added in Linux commit 6947 v4.15-rc1~84^2~120^2~2. 6948 6949 * xlat/bpf_attach_type.in (BPF_CGROUP_DEVICE): New constant. 6950 * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_DEVICE): Likewise. 6951 * NEWS: Mention it. 6952 6953 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6954 6955 xlat: provide fallback definitions for input event constants. 6956 Values added using the following pair of commands: 6957 6958 $ cat xlat/evdev_keycode.in | 6959 while read r; do [ -n "$r" ] && 6960 sed -rn 's/^#define[[:space:]]+('$r'[[:space:]]+[^[:space:]]+).*/\1/p' \ 6961 ~/dev/linux/include/uapi/linux/input-event-codes.h || echo; 6962 done > xlat/evdev_keycode.in.new 6963 $ sort -s -n -k1,1 \ 6964 <(awk '{if (NF>1) {last = strtonum($2)}; printf("%d %s\n", last, $0)}' \ 6965 xlat/evdev_keycode.in.new) \ 6966 | sed 's/^[0-9]* //' > xlat/evdev_keycode.in 6967 6968 It also verifies that the values are sorted and bsearch-ready. 6969 6970 * xlat/evdev_keycode.in: Add constant values. 6971 6972 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6973 6974 xlat: update the list of input event constants. 6975 Remove some duplicating definitions and add the new ones. 6976 6977 * xlat/evdev_keycode.in (KEY_HANGUEL): Remove, an alternative name for 6978 KEY_HANGEUL. 6979 (KEY_DIRECTION): Remove, an alternative name for KEY_ROTATE_DISPLAY. 6980 (KEY_BRIGHTNESS_ZERO): Remove, an alternative name for 6981 KEY_BRIGHTNESS_AUTO. 6982 (KEY_WIMAX): Remove, an alternative name for KEY_WWAN. 6983 (BTN_A): Remove, an alternative name for BTN_SOUTH. 6984 (BTN_B): Remove, an alternative name for BTN_EAST. 6985 (BTN_X): Remove, an alternative name for BTN_NORTH. 6986 (BTN_Y): Remove, an alternative name for BTN_WEST. 6987 (BTN_STYLUS3): New constant, added in Linux commit v4.15-rc1~114^2^2~1. 6988 (KEY_BRIGHTNESS_TOGGLE): Remove, an alternative name for 6989 KEY_DISPLAYTOGGLE. 6990 (KEY_ROTATE_LOCK_TOGGLE): New constant, added in Linux commit 6991 v4.16-rc1~54^2~67. 6992 (KEY_DATA): New constant, added in Linux commit v4.9-rc8~12^2. 6993 (KEY_ONSCREEN_KEYBOARD): New constant, added in Linux commit 6994 v4.12-rc1~126^2~2^12~5. 6995 * NEWS: Mention it. 6996 6997 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 6998 6999 xlat: provide fallback definitions for SCTP socket option constants. 7000 Values for SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, 7001 SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD are reconstructed 7002 from Linux commit v2.6.33-rc1~388^2~167^2~7. 7003 7004 xlat/socksctpoptions.in: Add constant values. 7005 7006 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7007 7008 xlat: update the list of SCTP socket option constants. 7009 * xlat/socksctpoptions.in (SCTP_DELAYED_ACK): Rename to... 7010 (SCTP_DELAYED_SACK): ...this, per Linux commit v2.6.38-rc2~33^2. 7011 (SCTP_SOCKOPT_PEELOFF_FLAGS): New constant, introduced in Linux commit 7012 v4.13-rc1~157^2~39. 7013 (SCTP_STREAM_SCHEDULER): New constant, introduced in Linux commit 7014 v4.15-rc1~84^2~567^2~3. 7015 (SCTP_STREAM_SCHEDULER_VALUE): New constant, introduced in Linux commit 7016 v4.15-rc1~84^2~567^2~2. 7017 (SCTP_INTERLEAVING_SUPPORTED): New constant, introduced in Linux commit 7018 v4.16-rc1~123^2~384^2~11. 7019 * NEWS: Mention it. 7020 7021 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7022 7023 xlat: provide fallback definitions for Ethernet protocol constants. 7024 As those are not architecture-specific. 7025 7026 * xlat/ethernet_protocols.in: Add values to constants. 7027 7028 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7029 7030 xlat: update the list of Ethernet protocol constants. 7031 * xlat/ethernet_protocols.in (ETH_P_ERSPAN2): New constant, introduced 7032 in Linux commit v4.16-rc1~123^2~355^2~2. 7033 (ETH_P_IBOE): New constant, introduced in commit v4.11-rc1~73^2~74. 7034 * NEWS: Mention it. 7035 7036 v4l2: print known pixel/SDR formats. 7037 * xlat/v4l2_pix_fmts.in: New file. 7038 * xlat/v4l2_sdr_fmts.in: Likewise. 7039 * v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): New macro. 7040 (print_pixelformat): Add xlat parameter, print constant name 7041 as a comment if it has been found in xlat. 7042 (print_v4l2_fmtdesc, print_v4l2_frmivalenum): Pass v4l2_pix_fmts 7043 to print_pixelformat. 7044 (print_v4l2_format_fmt) <case V4L2_BUF_TYPE_VIDEO_CAPTURE, case 7045 V4L2_BUF_TYPE_VIDEO_OUTPUT, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, 7046 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, case V4L2_BUF_TYPE_VBI_CAPTURE, 7047 case V4L2_BUF_TYPE_VBI_OUTPUT>: Pass v4l2_pix_fmts to print_pixelformat. 7048 (print_v4l2_format_fmt) <case V4L2_BUF_TYPE_SDR_OUTPUT, case 7049 V4L2_BUF_TYPE_SDR_CAPTURE>: Pass v4l2_sdr_fmts to print_pixelformat. 7050 * tests/v4l2.c: Test it, update expected output. 7051 * NEWS: Mention it. 7052 7053 2018-03-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7054 7055 v4l2: v4l2_fourcc is endianness-agnostic. 7056 v4l2_fourcc(a, b, c, d) is defined as (a | (b << 8) | (c << 16) | (d << 24) 7057 regardless of endianness (no mnemonic on big-endian architectures), 7058 so we don't need special handling for WORDS_BIGENDIAN both in decoder 7059 and in the test. 7060 7061 * v4l2.c (print_pixelformat): Change initialisation to a simple 7062 assignment of character array. 7063 * tests/ioctl_v4l2.c [WORDS_BIGENDIAN]: Remove. 7064 * NEWS: Mention this fix. 7065 7066 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7067 Fixes: v4.10~371 "Implement Video4Linux video-input ioctls decoder" 7068 7069 2018-03-01 Dmitry V. Levin <ldv (a] altlinux.org> 7070 7071 tests: do not include <stdbool.h> in files that include "tests.h" 7072 Starting with commit v4.21-37-g4f63bc70ca95012d72e288fc3c1eeb3ba26068a4, 7073 <stdbool.h> is included by tests.h, so all tests that already include 7074 "tests.h" do not need to include <stdbool.h>. 7075 7076 * tests/btrfs.c: Do not include <stdbool.h>. 7077 * tests/file_handle.c: Likewise. 7078 * tests/futex.c: Likewise. 7079 * tests/ioctl_dm.c: Likewise. 7080 * tests/ioctl_loop.c: Likewise. 7081 * tests/ioctl_sock_gifconf.c: Likewise. 7082 * tests/keyctl.c: Likewise. 7083 * tests/mq_sendrecv.c: Likewise. 7084 * tests/perf_event_open.c: Likewise. 7085 * tests/s390_guarded_storage.c: Likewise. 7086 * tests/s390_pci_mmio_read_write.c: Likewise. 7087 * tests/s390_sthyi.c: Likewise. 7088 * tests/xet_thread_area_x86.c: Likewise. 7089 7090 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7091 7092 tests: check printing of block/char device numbers in -yy mode. 7093 * tests/dev-yy.c: New file. 7094 * tests/pure_executables.list: Add dev-yy. 7095 * tests/.gitignore: Likewise. 7096 * tests/gen_tests.in (dev-yy): New test. 7097 7098 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7099 7100 printfd: print character/block device number in -yy mode. 7101 * util.c: Include <sys/stat.h>, <sys/sysmacros.h>, 7102 and "largefile_wrappers.h". 7103 (printsocket, printdev): New functions. 7104 (printfd): Move socket matching/printing logic to printsocket. Check 7105 also for printdev. Escape opening angle bracket in addition to closing angle 7106 bracket as it can show up as a separator in printdev. 7107 * tests/fsync-y.c: Update expected output. 7108 * strace.1.in: Mention this. 7109 * NEWS: Likewise. 7110 7111 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7112 7113 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7114 7115 util.c: escape closing angle bracket in printfd. 7116 * util.c (printfd): Use print_quoted_string_ex instead of 7117 print_quoted_string, specify ">" as escape_chars argument. 7118 * tests/fsync-y.c (main): Update expected output. 7119 * NEWS: Mention it. 7120 7121 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7122 7123 util.c: add support for additional escape characters in string_quote. 7124 Quotes are not always used to denote string limits; printfd uses angle 7125 brackets for that, for example. As result, mechanism for supplying 7126 set of additional characters in order to avoid ambiguities regarding 7127 the end of the quoted string is needed. 7128 7129 * defs.h (string_quote): Add escape_chars parameter. 7130 (print_quoted_string_ex): New function prototype. 7131 * util.c (string_quote): Add escape_chars parameter. 7132 (print_quoted_string_ex): Rename from print_quoted_string, add 7133 escape_chars parameter, pass it to string_quote call. 7134 (print_quoted_string): Turn into a thin wrapper around 7135 print_quoted_string_ex. 7136 (printstr_ex): Pass NULL as escape_chars argument of string_quote call. 7137 * socketutils.c (unix_parse_response): Pass NULL as escape_chars 7138 argument of string_quote call. 7139 * tests/print_quoted_string.c (print_octal): New function. 7140 print_quoted_memory_ex): Use it. Add escape_chars parameter. 7141 (print_quoted_memory): Pass NULL as escape_chars argument 7142 of print_quoted_memory_ex call. 7143 * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): Add 7144 escape_chars parameter. 7145 * tests/fsync-y.c: Pass NULL as escape_chars argument of 7146 print_quoted_string_ex call. 7147 7148 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7149 7150 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7151 7152 tests: check file name printing in strace -y mode. 7153 * tests/fsync-y.c: New file. 7154 * tests/.gitignore: Add fsync-y. 7155 * tests/Makefile.am (check_PROGRAMS): Likewise. 7156 * tests/gen_tests.in (fsync-y): New test. 7157 7158 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7159 7160 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7161 7162 tests: add print_quoted_string_ex and print_quoted_memory_ex functions. 7163 * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): New 7164 declarations. 7165 * tests/print_quoted_string.c (print_quoted_string_ex): New function, 7166 a thin wrapper around print_quoted_memory_ex wrapper. 7167 (print_quoted_memory_ex): Rename from print_quoted_memory, add quote 7168 argument. 7169 (print_quoted_memory): Turn into a thin wrapper around 7170 print_quoted_memory_ex. 7171 7172 tests: check escaping in string printing. 7173 * tests/test_printstrn.c (test_print_memory): New function. 7174 (test_printstrn): Use it. 7175 7176 Do not go full octal if the next char is '8' or '9' 7177 * util.c (string_quote): Change the upper limit for the next character 7178 in unabbreviated octal printing from '9' to '7'. 7179 * tests/print_quoted_string.c (print_quoted_memory): Likewise. 7180 7181 tests: fix abbreviated octal escape check in print_quoted_memory. 7182 * tests/print_quoted_string.c (print_quoted_memory): Check the next 7183 character after octal-escaped one instead of the first one in the 7184 string. 7185 7186 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7187 7188 util.c: reduce indentation in non-hexadecimal case in string_quote. 7189 As it is already too deep there. 7190 7191 * util.c (string_quote): Add string_ended label, jump there 7192 after the loop in "if (usehex)" case. 7193 7194 2018-03-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7195 7196 util.c: fix switch statement indentation in string_quote. 7197 While we are here, let's also remove unnecessary break statement 7198 in the default case. 7199 7200 2018-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 7201 7202 Replace fopen_for_input and fopen_for_output with fopen_stream. 7203 * largefile_wrappers.h (fopen_for_input, fopen_for_output): Replace 7204 with fopen_stream. 7205 * mmap_cache.c (fopen_for_input) Likewise. 7206 * strace.c (fopen_for_output): Likewise. 7207 7208 2018-02-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7209 7210 Update the list of INET_DIAG_BC_* operators. 7211 * linux/inet_diag.h (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New 7212 enumeration items introduced by linux kernel commit v4.16-rc1~123^2~259. 7213 * xlat/inet_diag_bytecodes.in (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New 7214 constants. 7215 * NEWS: Mention it. 7216 7217 xlat: update the list of SCHED_FLAG_* constants. 7218 * xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New 7219 constants introduced by linux kernel commits v4.13-rc1~205^2~27 and 7220 v4.16-rc1~164^2~8, respectively. 7221 (SCHED_FLAG_RESET_ON_FORK): Add constant value. 7222 * tests/sched_xetattr.c: Update expected output. 7223 * NEWS: Mention it. 7224 7225 xlat: provide fallback definitions for arch-independent poll event flags 7226 * xlat/pollflags.in (POLLIN, POLLPRI, POLLOUT, POLLRDNORM, POLLRDBAND, 7227 POLLERR, POLLHUP, POLLNVAL, POLL_BUSY_LOOP): Add constant values. 7228 7229 2018-02-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7230 7231 xlat: update the list of poll event flags. 7232 POLL_BUSY_LOOP was introduced by linux kernel commit v3.11-rc1~64^2~129 7233 as POLL_LL and then renamed in v3.11-rc1~64^2~9. POLLRDHUP was 7234 introduced by linux kernel commit v2.6.17-rc1~796. POLLMSG and 7235 POLLREMOVE predate git repository. POLLFREE was introduced by linux 7236 kernel commit v3.3-rc5~8 for internal use only. 7237 7238 * xlat/pollflags.in (POLLMSG, POLLREMOVE, POLLRDHUP, POLL_BUSY_LOOP): 7239 New constants. 7240 * NEWS: Mention it. 7241 7242 2018-02-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7243 7244 xlat: add arch-specific si_codes constants. 7245 Based on Linux commits v4.16-rc1~159^2~17, v4.16-rc1~159^2~16, 7246 v4.16-rc1~159^2~15, and v4.16-rc1~159^2~14. 7247 7248 * xlat/sigbus_codes.in (BUS_OPFETCH): New constant. 7249 * xlat/sigfpe_codes.in (FPE_MDAOVF, __FPE_DECOVF, __FPE_DECDIV, 7250 __FPE_DECERR, __FPE_INVASC, __FPE_INVDEC): New constants. 7251 * xlat/sigill_codes.in (ILL_ILLPARAOP, ILL_ILLEXCPT, ILL_CPLB_VI, 7252 ILL_CPLB_MISS, ILL_CPLB_MULHIT, ILL_DBLFLT, ILL_HARDWALL, ILL_BADIADDR, 7253 __ILL_BREAK, __ILL_BNDMOD): Likewise. 7254 * xlat/sigsegv_codes.in (SEGV_STACKFLOW, __SEGV_PSTKOVF): Likewise. 7255 * xlat/sigtrap_codes.in (TRAP_STEP, TRAP_TRACEFLOW, TRAP_WATCHPT, 7256 TRAP_ILLTRAP): Likewise. 7257 * NEWS: Mention it. 7258 7259 2018-02-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7260 7261 rtnl_tc: support new TCA_* attributes. 7262 * xlat/rtnl_tc_attrs.in (TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK, 7263 TCA_EGRESS_BLOCK): New constants introduced by linux kernel commits 7264 v4.15-rc4~13^2~5^2~2 and v4.16-rc1~123^2~139^2~5. 7265 * rtnl_tc.c (tcmsg_nla_decoders) <TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK, 7266 TCA_EGRESS_BLOCK>: New items. 7267 7268 rtnl_link: add decoding of new IFLA_* attributes. 7269 * xlat/rtnl_link_attrs.in (IFLA_NEW_NETNSID, IFLA_IF_NETNSID, 7270 IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT, IFLA_NEW_IFINDEX): New 7271 constants introduced by linux kernel commits v4.15-rc1~84^2~557, 7272 v4.15-rc1~84^2~133^2, v4.16-rc1~123^2~91, and v4.16-rc1~123^2~24^2. 7273 * rtnl_link.c (ifinfomsg_nla_decoders) <IFLA_NEW_NETNSID, 7274 IFLA_IF_NETNSID, IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT, 7275 IFLA_NEW_IFINDEX>: New items. 7276 7277 rtnl_link: implement IFLA_EVENT_* decoding. 7278 * rtnl_link.c (decode_ifla_event): New function. 7279 (ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it. 7280 * xlat/rtnl_ifla_events.in: New file. 7281 * NEWS: Mention it. 7282 7283 xlat: update the list of RWF_* constants. 7284 * xlat/rwf_flags.in (RWF_APPEND): New constant introduced by linux 7285 kernel commit v4.16-rc1~145^2~7. 7286 * NEWS: Mention it. 7287 7288 tests: check decoding of ip6:port pairs associated with socket descriptors 7289 * tests/net-yy-inet.c: Generalise test. 7290 * tests/net-yy-inet6.c: New file. 7291 * tests/pure_executables.list: Add net-yy-inet6. 7292 * tests/.gitignore: Likewise. 7293 * tests/gen_tests.in (net-yy-inet6): New entry. 7294 7295 2018-02-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7296 7297 Print IPv6 addresses in brackets. 7298 Follow a common practice for printing address:port pair to distinguish 7299 address parts delimiter from address/port delimiter. 7300 7301 * socketutils.c (inet_parse_response) <ob, cb>: New variables, 7302 initialise them to open/closing brackets or empty strings based 7303 on address family. 7304 (inet_parse_response): Print ob and cb around src_buf and dst_buf. 7305 * NEWS: Mention this improvement. 7306 7307 2018-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 7308 7309 strace.spec.in: add gcc to build requirements. 7310 There are rumors in circulation that some rpm-based distributions 7311 are going to exclude gcc from their default build environments. 7312 Workaround this policy silliness by adding gcc to build requirements. 7313 7314 * strace.spec.in (BuildRequires): Add gcc. 7315 7316 2018-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 7317 7318 Move definitions of fopen_for_input to largefile_wrappers.h. 7319 * largefile_wrappers.h (fopen_for_input): Define along with 7320 fopen_for_output. 7321 * mmap_cache.c: Include "largefile_wrappers.h". 7322 (fopen_for_input): Remove. 7323 7324 2018-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 7325 7326 Introduce mmap_cache.h. 7327 Let's avoid bloating defs.h and introduce a separate header for 7328 mmap_cache. 7329 7330 * defs.h (struct mmap_cache_t, enum mmap_cache_protection, 7331 enum mmap_cache_rebuild_result, mmap_cache_enable, mmap_cache_is_enabled, 7332 mmap_cache_invalidate, mmap_cache_delete, mmap_cache_rebuild_if_invalid, 7333 mmap_cache_search): Move ... 7334 * mmap_cache.h: ... to this new file. 7335 * Makefile.am (strace_SOURCES): Add mmap_cache.h. 7336 * mmap_cache.c: Include mmap_cache.h. 7337 * strace.c: Likewise. 7338 * syscall.c: Likewise. 7339 * unwind.c: Likewise. 7340 7341 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7342 7343 mmap_cache: record device major and minor numbers. 7344 * defs.h (struct mmap_cache_t): Add major and minor fields. 7345 * mmap_cache.c (build_mmap_cache): Record device major and minor numbers. 7346 7347 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7348 7349 mmap_cache: add function to enable mmap_cache. 7350 mmap_cache was enabled indirectly via unwind feature. As now mmap_cache 7351 can be used by other part of strace, a way to enable mmap_cache directly 7352 is needed. 7353 7354 * defs.h (mmap_cache_enable, mmap_cache_is_enabled): New function 7355 prototypes. 7356 * mmap_cache.c (use_mmap_cache): New file local variable. 7357 (mmap_cache_enable, mmap_cache_is_enabled): New functions. 7358 * syscall.c (syscall_exiting_decode): Use mmap_cache_is_enabled() 7359 instead of stack_trace_enabled. 7360 * unwind.c (unwind_init): Invoke mmap_cache_enable. 7361 7362 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7363 7364 mmap_cache, unwind: lift up mmap_cache_delete invocation from unwind.c. 7365 mmap_cache_delete function used to be called by destructor of unwind 7366 related code. Now that other parts can use mmap cache, 7367 mmap_cache_delete is called separately from unwind_tcb_fin. 7368 7369 * unwind.c (unwind_tcb_fin): Move mmap_cache_delete invocation ... 7370 * strace.c (droptcb): ... here. 7371 7372 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7373 7374 mmap_cache: record protection bits. 7375 To make mmap_cache reusable, records protection bits of mmap entries. 7376 7377 * defs.h (mmap_cache_protection): New enum. 7378 * mmap_cache.c (build_mmpa_cache): Don't ignore entries that are not 7379 executable, just record the protection bits here. 7380 * unwind.c (print_stack_frame): Ignore entries that are not executable. 7381 7382 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7383 7384 mmap_cache: move code for searching a mmap cache from unwind. 7385 print_stack_frame function in unwind.c searches a mmap entry in mmap 7386 cache. The found entry is then used for unwinding. However, a function 7387 searching for a mmap entry may be useful for other purposes than 7388 unwinding. 7389 7390 This change re-factors the function; code for searching an entry is 7391 now defined as a stand-alone function named mmap_cache_search. 7392 7393 * defs.h (mmap_cache_search): New function prototype. 7394 print_stack_frame. 7395 * mmap_cached.c (mmap_cache_search): New function derived from 7396 print_stack_frame. 7397 * unwind.c (print_stack_frame): Use it. 7398 7399 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7400 7401 mmap_cache: new subsystem derived from unwind.c. 7402 For making mmap cache code reusable from other areas in strace than 7403 unwind, mmap cache related code and unwind related code should be 7404 separated. 7405 7406 This change moves the most of mmap cache code from unwind.c 7407 to mmap_cache.c, a new file. 7408 7409 * unwind.c: Move mmap_cache implementation ... 7410 * mmap_cache.c: ... to this new file. 7411 * Makefile.am (strace_SOURCES): add mmap_cache.c. 7412 * defs.h (struct tcb): Move mmap_cache, mmap_cache_size, and 7413 mmap_cache_generation fields out of [USE_LIBUNWIND] condition. 7414 (mmap_cache_invalidate, mmap_cache_delete, 7415 mmap_cache_rebuild_if_invalid): New function prototypes. 7416 (struct mmap_cache_t, enum mmap_cache_rebuild_result): Move from 7417 unwind.c. 7418 * syscall.c (syscall_exiting_decode): Replace unwind_cache_invalidate 7419 with mmap_cache_invalidate. 7420 7421 2018-02-26 Masatake YAMATO <yamato (a] redhat.com> 7422 7423 unwind: lift up unw_flush_cache from mmap cache management code. 7424 For making mmap cache code reusable from other areas in strace 7425 than unwind, mmap cache related code and unwind related code 7426 should be separated. 7427 7428 This change is one of the steps for the separation. It moves 7429 unw_flush_cache function call from the core of mmap cache code 7430 to upper level code. 7431 7432 * unwind.c (mmap_cache_rebuild_result): New enum. 7433 (rebuild_cache_if_invalid): Return MMAP_CACHE_REBUILD_* instead of 7434 a bool value. 7435 (build_mmap_cache): Don't call unw_flush_cache here. 7436 (unwind_print_stacktrace, unwind_capture_stacktrace): Call 7437 unw_flush_cache here instead. 7438 7439 2018-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 7440 7441 debian: sync with 4.21-1 package. 7442 Versioned dependency on debhelper is not updated for backwards 7443 compatibility. 7444 7445 * debian/changelog.in: Fix ancient changelog entries. 7446 * debian/control (Build-Depends): Add dependency on libbluetooth-dev. 7447 (Standards-Version): Update to 4.1.3. 7448 (Vcs-Git, Vcs-Browser): Move from alioth to salsa.d.o. 7449 (strace, strace-udeb) <Architecture>: Change to linux-any. 7450 (strace64, strace-udeb) <Priority>: Change to optional. 7451 * debian/rules: Use /usr/share/dpkg/architecture.mk instead of manually 7452 setting build variables. 7453 (configure): New target. 7454 (build/Makefile, build-udeb/Makefile, build64/Makefile): Depend on it. 7455 (binary-arch): Use build64/strace.1 for strace64 subpackage. 7456 * debian/strace.manpages: Add build/ prefix. 7457 * debian/strace64.manpages: Add build64/ prefix. 7458 7459 2018-02-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7460 7461 m4/mpers.m4: fix mpers name in comments added to config.h. 7462 * m4/mpers.m4 (st_MPERS_STRUCT_STAT): Use mpers_name instead of 7463 MPERS_NAME in comments generated by AC_DEFINE. 7464 7465 Fixes: v4.14~169 ("mpers.m4: check for struct stat64, struct stat, and their members") 7466 7467 2018-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 7468 7469 mpers.awk: use stdint.h instead of inttypes.h. 7470 As <inttypes.h> is included in files generated by mpers.awk to obtain 7471 definitions of uintNN_t types provided by <stdint.h>, replace the former 7472 header with the latter. 7473 7474 * mpers.awk: Use <stdint.h> instead of <inttypes.h>. 7475 * mpers_test.sh: Update expected output. 7476 7477 2018-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 7478 7479 Wipe out references to defunct sourceforge. 7480 The old location of strace-devel mailing list is defunct, it used to 7481 lose email messages and sometimes did not deliver any mails for days. 7482 7483 The mailing list has been moved to strace-devel (a] lists.strace.io. 7484 7485 * CREDITS.in: Update the mailing list address. 7486 (Zhang Le): Update email address. 7487 * README: Update the mailing list address. 7488 * README.md: Likewise. 7489 * configure.ac (AC_INIT): Likewise. 7490 * strace.1.in (.SH REPORTING BUGS): Likewise. 7491 * strace-log-merge.1.in (.SH REPORTING BUGS): Likewise. 7492 * sched.c (SYS_FUNC(sched_getattr)): Update the mailing list reference. 7493 * tests/scno_tampering.sh: Likewise. 7494 * qemu_multiarch_testing/README: Update git repository address. 7495 * NEWS: Mention the change of the mailing list address. 7496 7497 Closes: https://github.com/strace/strace/issues/38 7498 7499 2018-02-21 Dmitry V. Levin <ldv (a] altlinux.org> 7500 7501 m68k: fix build. 7502 When <sys/reg.h> is included after <linux/ptrace.h>, the build fails 7503 on m68k with the following diagnostics: 7504 7505 In file included from /usr/include/linux/ptrace.h:101:0, 7506 from ptrace.h:51, 7507 from sigreturn.c:2: 7508 /usr/include/m68k-linux-gnu/sys/reg.h:26:3: error: expected identifier 7509 before numeric constant 7510 PT_D1 = 0, 7511 ^ 7512 7513 Apparently, the only architecture where strace needs definitions 7514 provided by <sys/reg.h> is x86_64, other three (m68k, tile, and x86) 7515 are fine with definitions already provided by <linux/ptrace.h>. 7516 7517 Fix the issue by getting rid of <sys/reg.h> and defining necessary 7518 macros in linux/x86_64/arch_regs.h file. 7519 7520 * configure.ac (AC_CHECK_HEADERS): Remove sys/reg.h. 7521 * regs.h: Do not include <sys/reg.h>. 7522 * linux/x86_64/arch_regs.h (R15, R14, R13, R12, RBP, RBX, R11, R10, 7523 R9, R8, RAX, RCX, RDX, RSI, RDI, ORIG_RAX, RIP, CS, EFLAGS, RSP, SS, 7524 FS_BASE, GS_BASE, DS, ES, FS, GS): New macros. 7525 * NEWS: Mention this fix. 7526 7527 Fixes: v4.21~21 ("Include <sys/ptrace.h> early") 7528 7529 2018-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 7530 7531 Demote sourceforge.net. 7532 https://sourceforge.net/p/strace/code/ is defunct: it doesn't accept 7533 new commits for too long. 7534 Likewise, https://sourceforge.net/projects/strace/files/ doesn't accept 7535 new files for too long. 7536 7537 * README.md: Remove sourceforge.net URL. 7538 * debian/copyright: Replace the sourceforge.net based strace project URL 7539 with a github based one. 7540 * strace.spec.in (Source): Likewise. 7541 7542 2018-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 7543 7544 Update copyright headers. 7545 * COPYING: Update copyright year number range. 7546 * debian/copyright: Sync with COPYING. 7547 7548 2018-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 7549 7550 Post-release administrivia. 7551 * NEWS: Add a header line for the next release. 7552 * debian/changelog.in: Add a changelog entry for 4.21-1. 7553 * strace.spec.in: Likewise. 7554 7555 2018-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 7556 7557 Prepare for 4.21 release. 7558 * NEWS: Update for 4.21 release. 7559 7560 2018-02-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7561 7562 tests/s390_sthyi.c: skip the test if s390_sthyi returns an error. 7563 tests/s390_sthyi.c (main): replace error_msg_and_fail with 7564 error_msg_and_skip if rc is non-zero. 7565 7566 2018-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 7567 7568 Update copyright headers. 7569 Headers updated automatically using maint/update_copyright_years.sh 7570 script. 7571 7572 2018-02-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7573 7574 Remove old and unused maintenance scripts. 7575 Firewell, last witnesses of bygone era. 7576 7577 * linux/sparc/gen.pl: Remove. 7578 * linux/x86_64/gentab.pl: Likewise. 7579 * xlate.el: Likewise. 7580 * Makefile.am (EXTRA_DIST): Remove them. 7581 7582 Suggested-by: Elvira Khabirova <lineprinter (a] altlinux.org> 7583 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7584 7585 2018-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 7586 7587 Consistently use MAX_ERRNO_VALUE. 7588 * filter_qualify.c (parse_inject_token): Replace 4095 7589 with MAX_ERRNO_VALUE. 7590 * negated_errno.h (is_negated_errno): Likewise. Remove redundant 7591 comment. 7592 7593 Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests. 7594 * configure.ac (AC_SUBST): Add SIZEOF_LONG and SIZEOF_KERNEL_LONG_T. 7595 * tests/Makefile.am (SIZEOF_LONG, SIZEOF_KERNEL_LONG_T): New variables. 7596 (AM_TEST_LOG_FLAGS): Pass them. 7597 * bootstrap: Substitute them. 7598 7599 2018-02-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7600 7601 tests: avoid ioctl_kvm_run test failure when built with gcc -O0. 7602 When built with -O0, gcc (rightfully) generates function prologue, which 7603 results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO. 7604 It could be possible to avoid such problems by "naked" attribute but, 7605 unfortunately, the latter is not available on x86 with older GCC. 7606 A trick suggested in [1] is used instead: assembly is moved 7607 to the global scope. 7608 7609 [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3 7610 7611 * tests/ioctl_kvm_run.c (code): Remove function. 7612 Add globally scoped __asm__ with the function code and its size. 7613 (code, code_size): New extern symbols declarations. 7614 (run_kvm): Remove code_size definition and initialization. 7615 7616 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7617 7618 2018-02-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7619 7620 tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnostics. 7621 As it has proven itself useful. 7622 7623 * tests/ioctl_kvm_run.c (run_kvm) <case KVM_EXIT_MMIO:>: Fail 7624 on unexpected KVM_EXIT_MMIO, providing relevant diagnostics. 7625 7626 2018-02-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7627 7628 tests: add compatibility layer for accept call. 7629 Recent glibc (since version 2.26) uses accept4 syscall for implementing 7630 accept call on sparc. Unfortunately, it's impossible to simply fall 7631 back on raw syscall as it had not been wired up until linux commit 7632 v4.4-rc8~4^2~1. 7633 7634 * tests/accept_compat.h: New file. 7635 * tests/Makefile.am (EXTRA_DIST): Add it. 7636 * tests/net-y-unix.c: Include accept_compat.h, use do_accept() 7637 instead of accept() calls. 7638 * tests/net-yy-inet.c: Likewise. 7639 * tests/net-yy-unix.c: Likewise. 7640 * tests/net.expected: Allow accept4. 7641 7642 2018-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 7643 7644 debian: build strace-udeb separately. 7645 * debian/rules (extra_build_targets): Add build-udeb-stamp. 7646 (build-udeb/Makefile): New rule. 7647 (clean): Remove build-udeb. 7648 * debian/strace-udeb.install: Update. 7649 7650 Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826223 7651 7652 2018-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 7653 7654 Enable symbol demangling in deb- and rpm-driven builds. 7655 * debian/control (Build-Depends) [amd64]: Add libiberty-dev. 7656 * strace.spec.in (buildrequires_libunwind_devel): Add binutils-devel. 7657 7658 2018-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 7659 7660 debian: re-enable -k option on x86_64. 7661 This partially reverts commit v4.13~177. 7662 7663 * debian/control (Build-Depends) [amd64]: Add libunwind-dev. 7664 7665 2018-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 7666 7667 Add "strace -V" output to build log. 7668 * strace.spec.in (%check): Print "strace -V" output before 7669 running the test suite. 7670 * debian/rules (%-stamp): Likewise. 7671 7672 2018-02-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7673 7674 xlat: update NT_* constants. 7675 * xlat/nt_descriptor_types.in (NT_PPC_PKEY): New constant introduced 7676 by linux kernel commit v4.16-rc1~93^2~72. 7677 7678 Update the list of PKEY_* constants. 7679 * xlat/pkey_access.in (PKEY_DISABLE_EXECUTE): New constant introduced 7680 by linux kernel commit v4.16-rc1~93^2~85. 7681 * tests/pkey_alloc.c: Update expected output. 7682 * NEWS: Mention it. 7683 7684 powerpc, powerpc64: wire up pkey_* syscalls. 7685 * linux/powerpc/syscallent.h [384..386]: Add pkey_alloc, 7686 pkey_free, and pkey_mprotect syscalls introduced by linux kernel 7687 commits v4.16-rc1~93^2~70 and v4.16-rc1~93^2~69, respectively. 7688 * linux/powerpc64/syscallent.h: Likewise. 7689 * NEWS: Mention it. 7690 7691 Update NEWS. 7692 7693 2018-02-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7694 7695 linux/ia64: remove IA-32 mode support. 7696 There is no compat support in strace and there are no systems 7697 within reach that would allow to test it. 7698 7699 * linux/ia64/arch_regs.c (IA64_PSR_IS, ia64_ia32mode): Remove. 7700 * linux/ia64/get_error.c (get_error): Remove ia64_ia32mode branch. 7701 * linux/ia64/get_scno.c (arch_get_scno): Likewise. 7702 * linux/ia64/get_syscall_args.c (get_syscall_args): Likewise. 7703 * linux/ia64/set_error.c (arch_set_error, arch_set_success): Likewise. 7704 * linux/ia64/set_scno.c (arch_set_scno): Likewise. 7705 7706 2018-02-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7707 7708 syscall.c: parse return code second time after injecting. 7709 In order to have the same view as tracee has, with regards to 7710 "never fail" syscalls. 7711 7712 * syscall.c (tamper_with_syscall_exiting): Call get_error after the 7713 return value tampering to re-initialise u_rval and u_error fields 7714 of struct tcb. 7715 7716 2018-02-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7717 7718 sparc: mark as an architecture that has a dedicated error register. 7719 * linux/sparc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro, 7720 define to 1. 7721 7722 strace.1.in: ffix. 7723 7724 2018-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 7725 7726 Include <sys/ptrace.h> early. 7727 Include "ptrace.h" before any header that can include <signal.h> 7728 because on some architectures the latter may include <asm/sigcontext.h> 7729 which in turn may include <asm/ptrace.h> with potentially devastating 7730 effect on <sys/ptrace.h>. 7731 7732 * process.c: Include "ptrace.h" before "regs.h". 7733 * rt_sigframe.c: Likewise. 7734 * sigreturn.c: Include "ptrace.h" before "nsig.h". 7735 * syscall.c: Likewise. 7736 * wait.c: Include "ptrace.h" before <sys/wait.h>. 7737 * strace.c: Include "ptrace.h" before <signal.h>. 7738 * tests/ptrace.c: Likewise. 7739 * tests/test_ucopy.c: Include <sys/ptrace.h> before <signal.h>. 7740 7741 2018-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 7742 7743 Include <limits.h> instead of <sys/param.h> 7744 Do not include <sys/param.h> unnecessarily as it includes <signal.h>. 7745 7746 * pathtrace.c: Include <limits.h> instead of <sys/param.h>. 7747 * strace.c: Likewise. 7748 * syscall.c: Likewise. 7749 * util.c: Likewise. 7750 * tests/getcwd.c: Likewise. 7751 * tests/group_req.c: Likewise. 7752 * tests/inode_of_sockfd.c: Likewise. 7753 * tests/ip_mreq.c: Likewise. 7754 * tests/printpath-umovestr.c: Likewise. 7755 * tests/qual_fault.c: Likewise. 7756 * tests/test_printpath.c: Likewise. 7757 * tests/umovestr3.c: Likewise. 7758 * tests/net-y-unix.c: Do not include <sys/param.h>. 7759 * tests/net-yy-unix.c: Likewise. 7760 7761 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7762 7763 basic_filters.c: introduce scno_by_name. 7764 As it will be used elsewhere. 7765 7766 * basic_filters.c (scno_by_name): New function. 7767 (qualify_syscall_name): Use it. 7768 * defs.h (scno_by_name): New declaration. 7769 7770 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7771 7772 xstring.h: rephrase xappendstr description a bit. 7773 7774 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7775 7776 xlat.c: return NULL in sprintflags if there are no flags. 7777 Otherwise the auxstr is rather ugly at times. 7778 7779 * xlat.c (sprintflags): Return NULL if no flags were printed. 7780 7781 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7782 7783 Change type of injected rval to kernel_long_t. 7784 * defs.h (struct inject_data): Change type of rval field to 7785 kernel_ulong_t. 7786 * filter_qualify.c (parse_inject_token): Use string_to_kulong instead of 7787 string_to_uint for rval parsing. Warn if retval is clipped in compat 7788 personality. 7789 7790 Mark architectures that indicate syscall error in a dedicated register. 7791 * linux/alpha/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro, 7792 define to 1. 7793 * linux/ia64/arch_defs_.h: Likewise. 7794 * linux/mips/arch_defs_.h: Likewise. 7795 * linux/powerpc/arch_defs_.h: Likewise. 7796 * linux/powerpc64/arch_defs_.h: Likewise. 7797 * linux/sparc64/arch_defs_.h: Likewise. 7798 * linux/arch_defs_.h [!HAVE_ARCH_DEDICATED_ERR_REG] 7799 (HAVE_ARCH_DEDICATED_ERR_REG): New macro, define to 0. 7800 * linux/nios2/arch_defs_.h: New file. 7801 * Makefile.am (EXTRA_DIST): Add it. 7802 7803 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7804 7805 Make string_to_uint_ex more universal. 7806 And add support for reading of various types. 7807 7808 * string_to_uint.c (string_to_uint_ex): Change to work with long long. 7809 (string_to_uint): Move it... 7810 * string_to_uint.h (string_to_uint): ...here. 7811 (string_to_uint_upto): Accept long long as max_val, return long long. 7812 (string_to_ulong, string_to_kulong, string_to_ulonglong): New functions, 7813 for completeness. 7814 7815 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 7816 7817 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7818 7819 Add pure syscall flag. 7820 * basic_filters.c (lookup_class) <syscall_class>: Add "%pure" for 7821 TRACE_PURE. 7822 * sysent.h (TRACE_PURE): New syscall flag. 7823 * sysent_shorthand_defs.h (PU): New shorthand macro. 7824 * linux/32/syscallent.h ([172], [173], [174], [175], [176], [177], 7825 [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid, 7826 getegid, gettid syscalls. 7827 * linux/64/syscallent.h ([172], [173], [174], [175], [176], [177], 7828 [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid, 7829 getegid, gettid syscalls. 7830 * linux/aarch64/syscallent.h ([1060]): Add PU flag to getpgrp syscalls. 7831 * linux/alpha/syscallent.h ([20], [24], [47], [63], [64], [89], 7832 [378]): Add PU flag to getxpid, getxuid, getxgid, getpgrp, getpagesize, 7833 getdtablesize, gettid syscalls. 7834 * linux/arc/syscallent.h ([246]): Add PU flag to arc_gettls syscalls. 7835 * linux/arm/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7836 [199], [200], [201], [202], [224], [ARM_FIRST_SHUFFLED_SYSCALL+1+6]): 7837 Add PU flag to getpid, getuid, getgid, geteuid, getegid, getppid, 7838 getpgrp, getuid32, getgid32, geteuid32, getegid32, gettid, get_tls 7839 syscalls. 7840 * linux/avr32/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7841 [176]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7842 getppid, getpgrp, gettid syscalls. 7843 * linux/bfin/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7844 [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, 7845 getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7846 geteuid32, getegid32, gettid syscalls. 7847 * linux/hppa/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7848 [206]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7849 getppid, getpgrp, gettid syscalls. 7850 * linux/i386/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7851 [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, 7852 getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7853 geteuid32, getegid32, gettid syscalls. 7854 * linux/ia64/syscallent.h ([1041], [1042], [1046], [1047], [1062], 7855 [1063], [1105], [1171]): Add PU flag to getpid, getppid, getuid, 7856 geteuid, getgid, getegid, gettid, getpagesize syscalls. 7857 * linux/m68k/syscallent.h ([20], [24], [47], [49], [50], [64], 7858 [65], [166], [199], [200], [201], [202], [221], [333]): Add PU flag 7859 to getpid, getuid, getgid, geteuid, getegid, getppid, getpgrp, 7860 getpagesize, getuid32, getgid32, geteuid32, getegid32, gettid, 7861 get_thread_area syscalls. 7862 * linux/metag/syscallent.h ([248]): Add PU flag to metag_get_tls 7863 syscalls. 7864 * linux/microblaze/syscallent.h ([20], [24], [47], [49], [50], [64], 7865 [65], [199], [200], [201], [202], [224]): Add PU flag to getpid, 7866 getuid, getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7867 geteuid32, getegid32, gettid syscalls. 7868 * linux/powerpc64/syscallent.h ([20], [24], [47], [49], [50], [64], 7869 [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7870 getppid, getpgrp, gettid syscalls. 7871 * linux/powerpc/syscallent.h ([20], [24], [47], [49], [50], [64], 7872 [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7873 getppid, getpgrp, gettid syscalls. 7874 * linux/s390/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7875 [199], [200], [201], [202], [236]): Add PU flag to getpid, getuid, 7876 getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7877 geteuid32, getegid32, gettid syscalls. 7878 * linux/s390x/syscallent.h ([20], [64], [65], [199], [200], [201], 7879 [202], [236]): Add PU flag to getpid, getppid, getpgrp, getuid, 7880 getgid, geteuid, getegid, gettid syscalls. 7881 * linux/sh64/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7882 [199], [200], [201], [202], [252]): Add PU flag to getpid, getuid, 7883 getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7884 geteuid32, getegid32, gettid syscalls. 7885 * linux/sh/syscallent.h ([20], [24], [47], [49], [50], [64], [65], 7886 [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, 7887 getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, 7888 geteuid32, getegid32, gettid syscalls. 7889 * linux/sparc64/syscallent.h ([20], [24], [47], [49], [50], [64], [81], 7890 [143], [197], [340]): Add PU flag to getpid, getuid, getgid, geteuid, 7891 getegid, getpagesize, getpgrp, gettid, getppid, kern_features syscalls. 7892 * linux/sparc/syscallent.h ([20], [24], [44], [47], [49], [50], [53], 7893 [64], [69], [70], [81], [143], [197], [340]): Add PU flag to getpid, 7894 getuid, getuid32, getgid, geteuid, getegid, getgid32, getpagesize, 7895 geteuid32, getegid32, getpgrp, gettid, getppid, kern_features syscalls. 7896 * linux/x32/syscallent.h ([39], [102], [104], [107], [108], [110], 7897 [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7898 getppid, getpgrp, gettid syscalls. 7899 * linux/x86_64/syscallent.h ([39], [102], [104], [107], [108], [110], 7900 [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, 7901 getppid, getpgrp, gettid syscalls. 7902 * linux/xtensa/syscallent.h ([120], [127], [137], [139], [140], [141], 7903 [150], [151]): Add PU flag to getpid, gettid, getuid, getgid, geteuid, 7904 getegid, getppid, getpgrp syscalls. 7905 * strace.1.in (.SS Filtering): Document it. 7906 * NEWS: Mention it. 7907 7908 syscall.c: warn if tampering failed. 7909 7910 syscall.c: set errno if syscall is tampered. 7911 7912 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7913 7914 tests/nsyscall-d.test: swap exp and log in diff calls. 7915 In line with the rest of the tests. 7916 7917 * tests/nsyscalls-d.test: swap arguments of match_diff calls. 7918 7919 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7920 7921 linux/arm/get_scno.c: use debug_msg. 7922 * linux/arm/get_scno.c (arch_get_scno): replace if (debug_flag) { 7923 error_msg() } with debug_msg() call. 7924 7925 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7926 7927 Do not shuffle scno inside syscall_name. 7928 This makes interface a bit irregular otherwise. 7929 7930 * defs.h (syscall_name): Clarify description. 7931 * syscall.c (syscall_name): Do not call shuffle_scno. 7932 * printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno. 7933 7934 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7935 7936 Handle very special __ARM_NR_-prefixed syscalls. 7937 * linux/aarch64/nr_prefix.c: New file. 7938 * linux/arm/nr_prefix.c: Likewise. 7939 * linux/nr_prefix.c: Likewise. 7940 * Makefile.am (EXTRA_DIST): Add them. 7941 * printsiginfo.c: Include nr_prefix.c 7942 (print_si_info): Use nr_prefix. 7943 7944 Make shuffle_scno globally available. 7945 * syscall.c (shuffle_scno): Move the declaration... 7946 * defs.h (shuffle_scno): ...here. Remove static qualifier. 7947 * linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier. 7948 * linux/arm/shuffle_scno.c: Likewise. 7949 * linux/shuffle_scno.c: Likewise. 7950 * linux/x32/shuffle_scno.c: Likewise. 7951 * linux/x86_64/shuffle_scno.c: Likewise. 7952 7953 2018-02-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7954 7955 syscall.c: use shuffle_scno in syscall_name. 7956 syscall_name() is used only in printsiginfo.c:print_si_info currently, 7957 and is supplied with raw syscall number (that's why it has this ugly 7958 __X32_SYSCALL_BIT hack). But since it handled only __X32_SYSCALL_BIT and 7959 not shuffle_scno(), it was broken on ARM. Let's replace it with shuffle_scno 7960 call, as it handles both the case of shuffled ARM syscalls and the 7961 __X32_SYSCALL_BIT. 7962 7963 * syscall.c (syscall_name): Call shuffle_scno instead of custom 7964 __X32_SYSCALL_BIT handling. 7965 7966 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7967 7968 Use shuffle_scno for x32 syscall numbers. 7969 This changes behaviour of printing of unknown syscall. 7970 7971 * linux/x32/shuffle_scno.c: New file. 7972 * linux/x86_64/shuffle_scno.c: Likewise. 7973 * Makefile.am (EXTRA_DIST): Add them. 7974 * linux/x86_64/get_scno.c (arch_get_scno): Do not clear 7975 __X32_SYSCALL_BIT. 7976 * tests/nsyscalls.c: Update expected output. 7977 7978 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7979 7980 Move shuffle_scno() invocation to get_scno. 7981 * linux/aarch64/get_scno.c (arch_get_scno): Remove shuffle_scno call. 7982 * linux/arm/get_scno.c (arch_get_scno): Remove shuffle_scno calls. 7983 * syscall.c (get_scno): Call shuffle_scno after arch_get_scno. 7984 7985 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 7986 7987 Move shuffle_scno to arch-specific file. 7988 While we are here, let's fix AArch64 by limiting scno shuffling 7989 to compat personality only. 7990 7991 * syscall.c: Include shuffle_scno.c. 7992 (shuffle_scno): Move it to a... 7993 * linux/arm/shuffle_scno.c: New file. 7994 * linux/aarch64/shuffle_scno.c: New file, define arm's shuffle_scno 7995 as arm_shuffle_scno and call it only for personality 1. 7996 * linux/shuffle_scno.c: New file, fallback trivial shuffle_scno 7997 definition. 7998 * Makefile.am (EXTRA_DIST): Add them. 7999 8000 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8001 8002 Print unknown syscall number in hexadecimal. 8003 * syscall.c (struct sysent_buf): Update buf field size. 8004 (get_scno): Print unknown syscall number in hexadecimal form. 8005 * tests/nsyscalls.c: Update expected output. 8006 * strace.1.in: Document it. 8007 * NEWS: Mention it. 8008 8009 tests/accept.c: call accept syscall directly, if available. 8010 * tests/accept.c [__NR_accept && !TEST_SYSCALL_NAME]: Define a wrapper that 8011 calls accept directly. 8012 * tests/sockname.c [TEST_SYSCALL_STR]: Do not define TEST_SYSCALL_STR. 8013 8014 printsiginfo.c: add a comment about personality detection for SIGSYS. 8015 Looks like it is not necessary, after all. 8016 8017 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8018 8019 linux/x86_64/set_error.c: update eax for compat personality. 8020 Since this is where get_error gets the return value from in the compat case. 8021 8022 linux/x86_64/set_error.c (set_error, set_success): Update i386_regs.eax 8023 if tracee is in compat personality. 8024 8025 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8026 8027 Mark various arch-specific syscalls with SYSCALL_NEVER_FAILS. 8028 * linux/alpha/syscallent.h (getpagesize, getdtablesize): Add NF flag. 8029 * linux/arc/syscallent.h (arc_gettls): Likewise. 8030 * linux/arm/syscallent.h (get_tls): Likewise. 8031 * linux/ia64/syscallent.h (getpagesize): Likewise. 8032 * linux/m68k/syscallent.h (getpagesize, get_thread_area): Likewise. 8033 * linux/sparc/syscallent.h (getpagesize): Likewise. 8034 * linux/sparc64/syscallent.h (getpagesize): Likewise. 8035 8036 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8037 8038 Add SYSCALL_NEVER_FAILS flag to getpgrp. 8039 As glibc, at least, treats it this way. 8040 8041 * linux/aarch64/syscallent.h (getpgrp): Add NF flag. 8042 * linux/alpha/syscallent.h: Likewise. 8043 * linux/arm/syscallent.h: Likewise. 8044 * linux/avr32/syscallent.h: Likewise. 8045 * linux/bfin/syscallent.h: Likewise. 8046 * linux/hppa/syscallent.h: Likewise. 8047 * linux/i386/syscallent.h: Likewise. 8048 * linux/m68k/syscallent.h: Likewise. 8049 * linux/microblaze/syscallent.h: Likewise. 8050 * linux/powerpc/syscallent.h: Likewise. 8051 * linux/powerpc64/syscallent.h: Likewise. 8052 * linux/s390/syscallent.h: Likewise. 8053 * linux/s390x/syscallent.h: Likewise. 8054 * linux/sh/syscallent.h: Likewise. 8055 * linux/sh64/syscallent.h: Likewise. 8056 * linux/sparc/syscallent.h: Likewise. 8057 * linux/sparc64/syscallent.h: Likewise. 8058 * linux/x32/syscallent.h: Likewise. 8059 * linux/x86_64/syscallent.h: Likewise. 8060 * linux/xtensa/syscallent.h: Likewise. 8061 8062 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8063 8064 linux/x86_64/get_error.c: do not sign-extend if no error happened. 8065 8066 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8067 8068 tests/membarrier.c: fix expected output on nohz_full systems. 8069 If nohz_full is enabled, MEMBARRIER_CMD_GLOBAL is not available. 8070 8071 * tests/membarrier.c: check availability of MEMBARRIER_CMD_GLOBAL 8072 separately. 8073 8074 2018-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8075 8076 Update MEMBARRIER_CMD_* constants. 8077 * xlat/membarrier_cmds.in: Add new constants, rename 8078 MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL. 8079 * NEWS: Mention this. 8080 * tests/membarrier.c (main): Update expected output. 8081 8082 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 8083 8084 2018-02-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8085 8086 perf.c: print group_fd argument of perf_event_open syscall as fd. 8087 * perf.c (SYS_FUNC(perf_event_open)): Print 4th argument using printfd. 8088 8089 syscall.c: print higher bits of syscall return value on x32 personality. 8090 * syscall.c (syscall_exiting_trace): Check for current_klongsize instead 8091 of current_wordsize to determine the size of tcp->u_rval. 8092 8093 strace.1.in: history update. 8094 strace.1.in (.SH HISTORY): Some amendments based on 8095 https://github.com/strace/strace-talks/blob/master/2012-ossdevconf-obninsk-strace_from_upstream_PoV/ossdevconf_2012-slides-strace_from_upstream_PoV.tex 8096 8097 strace.1.in: minor changes. 8098 * strace.1.in (.SH DESCRIPTION): s/a passion/passion/, 8099 s/Here the/Here, the/, s/Where traditional/Where the traditional/, 8100 s/output has proven/output is proven/, s/In all cases/In most cases,/ 8101 embolden st_mode, lstat, SIGCHLD, and SIGTTOU mentions, 8102 s/In some cases /In some cases, / 8103 (.SS Output format) <-o>: de-italicize dot in "filename.pid", convert 8104 the sentence's voice to passive, some other rephrasing. Mention 8105 incompatibility of output piping with -ff mode. 8106 (.SS Output options) <-t>: s/time of day/wall clock time/. 8107 (.SS Statistics) <-c>: Remove "on Linux" mention, -F option mention. 8108 8109 README.md: add information about git repository location. 8110 * README.md: Mention URLs for SourceForge, GitHub, and GitLab 8111 repositories. 8112 8113 2018-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 8114 8115 tests: rewrite net-accept-connect.c without strncpy. 8116 gcc8 -Wall -Werror rejects our method of struct sockaddr_un.sun_path 8117 initialization because the field lacks __nonstring__ attribute. 8118 8119 As we calculate the length of the string being copied anyway, 8120 workaround this gcc+glibc bug by changing the code to use this 8121 pre-calculated length and get rid of strncpy completely. 8122 8123 * tests/net-accept-connect.c (main): Use memcpy to initialize sun_path. 8124 8125 2018-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 8126 8127 Use kernel's fcntl.h header instead of libc's for open_mode_flags. 8128 As definitions of O_* macros provided by various libc implementations 8129 are usually less reliable than those provided by kernel headers, switch 8130 to use kernel's fcntl.h header. 8131 8132 * open.c: Include <asm/fcntl.h> instead of <fcntl.h>. Remove 8133 O_LARGEFILE fallback definitions assuming that the kernel headers 8134 provide them. 8135 * xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC. Add O_TMPFILE 8136 and __O_TMPFILE before O_DIRECTORY. Remove "O_TMPFILE & ~O_DIRECTORY". 8137 * tests/open.c: Include <asm/fcntl.h> instead of <fcntl.h>. Remove 8138 workarounds for libc O_TMPFILE implementations. 8139 * tests/openat.c: Include <asm/fcntl.h> instead of <fcntl.h>. 8140 (test_mode_flag): New function. 8141 (main): Use it to check decoding of all access modes and file flags. 8142 * tests/gen_tests.in (openat): Add -a option. 8143 8144 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 8145 8146 2018-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 8147 8148 xlat: update TCP_* constants. 8149 * xlat/socktcpoptions.in: Add TCP_FASTOPEN_KEY and 8150 TCP_FASTOPEN_NO_COOKIE introduced by linux kernel commits 8151 v4.15-rc1~84^2~387 and v4.15-rc1~84^2~339, respectively. 8152 * NEWS: Mention this. 8153 8154 xlat: update IPV6_* constants. 8155 * xlat/sockipv6options.in: Add IPV6_FREEBIND introduced by linux kernel 8156 commit v4.15-rc1~84^2~601. 8157 * NEWS: Mention this. 8158 8159 xlat: update MAP_* constants. 8160 * xlat/mmap_flags.in: Add MAP_SHARED_VALIDATE and MAP_SYNC introduced 8161 by linux kernel commits v4.15-rc1~71^2^2~23 and v4.15-rc1~71^2^2~12, 8162 respectively. 8163 * NEWS: Mention this. 8164 8165 2018-02-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8166 8167 tests: avoid triggering -Wstringop-truncation in ioctl_dm.c. 8168 * tests/ioctl_dm.c: Replace strncpy calls with memcpy as the character 8169 arrays being copied are not C strings. 8170 8171 Makefile.am: minor EXTRA_DIST formatting changes. 8172 8173 Move large file-related wrappers to a separate header. 8174 * strace.c [_LARGEFILE64_SOURCE]: Move the definitions under it to a... 8175 * largefile_wrappers.h: ... new file. 8176 * Makefile.am (strace_SOURCES): Add it. 8177 8178 2018-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 8179 8180 strace.1: fix wording about setuid installation. 8181 * strace.1.in (SETUID INSTALLATION): Fix wording. 8182 8183 Closes: https://github.com/strace/strace/issues/24 8184 8185 2018-01-29 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 8186 8187 Add KVM_PPC_GET_CPU_CHAR ioctl definition from linux v4.15. 8188 * linux/powerpc/ioctls_arch0.h: Update from linux v4.15 8189 using ioctls_gen.sh. 8190 8191 2018-01-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8192 8193 Update NEWS. 8194 8195 tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders. 8196 * tests/s390_pci_mmio_read_write.c: New file. 8197 * tests/.gitignore: Add s390_pci_mmio_read_write. 8198 * tests/pure_executables.list: Likewise. 8199 * tests/gen_tests.in (s390_pci_mmio_read_write): New test. 8200 8201 Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders. 8202 * linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write. 8203 ([353]): Change decoder to s390_pci_mmio_read. 8204 * linux/s390x/syscallent.h: Likewise. 8205 * s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)): 8206 New function. 8207 8208 tests: check s390_runtime_instr system call decoder. 8209 * tests/s390_runtime_instr.c: New file. 8210 * tests/.gitignore: Add s390_runtime_instr. 8211 * tests/pure_executables.list: Likewise. 8212 * tests/gen_tests.in (s390_runtime_instr): New test. 8213 8214 Introduce s390_runtime_instr system call decoder. 8215 * linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr. 8216 * linux/s390x/syscallent.h: Likewise. 8217 * s390.c (SYS_FUNC(s390_runtime_instr)): New function. 8218 * xlat/s390_runtime_instr_commands.in: New file. 8219 8220 tests: check s390_guarded_storage system call decoder. 8221 * configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h. 8222 * tests/s390_guarded_storage-v.c: New file. 8223 * tests/s390_guarded_storage.c: Likewise. 8224 * tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v. 8225 * tests/pure_executables.list: Likewise. 8226 * tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v): 8227 New tests. 8228 8229 Introduce s390_guarded_storage system call decoder. 8230 * linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage. 8231 * linux/s390x/syscallent.h: Likewise. 8232 * s390.c (struct guard_storage_control_block, 8233 struct guard_storage_event_parameter_list): New structure type 8234 definition. 8235 (guard_storage_print_gsepl, guard_storage_print_gscb, 8236 SYS_FUNC(s390_guarded_storage)): New function. 8237 (DIV_ROUND_UP): New macro. 8238 * xlat/s390_guarded_storage_commands.in: New file. 8239 8240 tests: check s390_sthyi system call decoder. 8241 * configure.ac (AC_CHECK_FUNCS): Add iconv_open. 8242 (AC_CHECK_HEADERS): Add iconv.h. 8243 * tests/s390_sthyi-v.c: New file. 8244 * tests/s390_sthyi.c: Likewise. 8245 * tests/.gitignore: Add s390_sthyi, s390_sthyi-v. 8246 * tests/pure_executables.list: Likewise. 8247 * tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests. 8248 8249 Introduce s390_sthyi system call decoder. 8250 * s390.c: New file. 8251 * Makefile.am (strace_SOURCES): Add it. 8252 * linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi. 8253 * linux/s390x/syscallent.h: Likewise. 8254 * xlat/s390_sthyi_function_codes.in: New file. 8255 8256 print_fields.h: add macro to print hexadecimal array field. 8257 * print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target 8258 array with QUOTE_FORCE_HEX. 8259 8260 2018-01-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8261 8262 Add print_quoted_string flag to generate comment. 8263 Because there are never enough print_quoted_string flags. 8264 8265 * defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant. 8266 * util.c (string_quote): Emit " /* " in the beginning and " */" in the 8267 end if QUOTE_EMIT_COMMENT is passed. 8268 (print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is 8269 passed. 8270 8271 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8272 8273 tests: make ioctl.test more flexible, use it for the rest of ioctl tests 8274 As the remaining non-generated ioctl tests differ from ioctl.test only 8275 in strace options, and since gen_tests.sh can pass arguments to sourced 8276 tests, replace the remaining non-generated ioctl tests with invocations 8277 of ioctl.test with appropriate parameters. 8278 8279 * tests/ioctl.test: Pass script arguments to the strace invocation. 8280 * tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9. 8281 (ioctl_dm-v): New entry, invoke ioctl.test with -v -s9. 8282 (ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y. 8283 (ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none. 8284 (ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none. 8285 (ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1. 8286 (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test 8287 with -v option instead of ioctl-v.sh. 8288 * tests/ioctl_dm-v.test: Remove. 8289 * tests/ioctl_dm.test: Likewise. 8290 * tests/ioctl_kvm_run.test: Likewise. 8291 * tests/ioctl_loop-nv.test: Likewise. 8292 * tests/ioctl_nsfs.test: Likewise. 8293 * tests/ioctl_sock_gifconf.test: Likewise. 8294 * tests/ioctl-v.sh: Likewise. 8295 * tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them. 8296 8297 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8298 8299 tests/gen_tests.sh: enable passing arguments to sourced tests. 8300 * tests/gen_tests.sh: Read first argument separately, put it in $arg0, 8301 and the rest of the arguments in $args. 8302 (case "$arg0" in) <+*)>: Set command line to $args and source $arg0. 8303 8304 xlat/gen.sh: add some rudimentary support for comments. 8305 * xlat/gen.sh: Trim parts of the string abbreviated in "/*" and "*/" 8306 8307 configure.ac: sort architectures in lexicographical order. 8308 * configure.ac (case "$host_cpu"): sort architectures in alphabetical 8309 order. 8310 8311 2018-01-25 Dmitry V. Levin <ldv (a] altlinux.org> 8312 8313 Drop non-functional CRIS architecture support. 8314 From the very first commit when CRIS architecture support was introduced 8315 and up to this comment that ends the agony of this non-functional code, 8316 this support was incomplete and could never be compiled. 8317 8318 * Makefile.am (EXTRA_DIST): Remove linux/crisv*. 8319 * clone.c: Remove CRISV* checks. 8320 * configure.ac ($host_cpu == cris*): Remove. 8321 * linux/crisv10: Remove. 8322 * linux/crisv32: Likewise. 8323 8324 Fixes: v4.5.18-77-gea0e6e8 ("CRIS support by Hinko Kocevar ...") 8325 8326 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8327 8328 Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83. 8329 * futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions. 8330 (main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit 8331 being set, check that the existing behaviour preserved with VALP/VAL2P 8332 where higher bit is unset. 8333 8334 tests/futex.c: improve error diagnostics. 8335 * tests/futex.c (futex_error): Add func and line arguments, print them. 8336 (CHECK_FUTEX_GENERIC): Pass __func__ and __LINE__ to futex_error. 8337 8338 Add syscall entry for ARM-specific get_tls syscall. 8339 * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+6]): New entry. 8340 (ARM_LAST_SPECIAL_SYSCALL): Update to 6. 8341 * NEWS: Mention it. 8342 8343 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8344 8345 Fix syscall descriptions for ARM-specific system calls. 8346 Based on an analysis of arm_syscall in arch/arm/kernel/traps.c. 8347 8348 * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+2]): Update 8349 argument number, add TM flag. 8350 ([ARM_FIRST_SHUFFLED_SYSCALL+1+1], [ARM_FIRST_SHUFFLED_SYSCALL+1+3], 8351 [ARM_FIRST_SHUFFLED_SYSCALL+1+4], [ARM_FIRST_SHUFFLED_SYSCALL+1+5]): 8352 Update argument number. 8353 8354 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8355 8356 tests: check riscv_flush_icache syscall decoder. 8357 * tests/riscv_flush_icache.c: New file. 8358 * tests/.gitignore: Add riscv_flush_icache. 8359 * tests/gen_tests.in: Likewise. 8360 * tests/pure_executables.list: Likewise. 8361 8362 Implement decoding of riscv_flush_icache syscall. 8363 * linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry. 8364 * riscv.c: New file. 8365 * Makefile.am (strace_SOURCES): Add it. 8366 * xlat/riscv_flush_icache_flags.in: New file. 8367 * NEWS: Mention it. 8368 8369 2018-01-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8370 8371 Workaround stray PTRACE_EVENT_EXEC. 8372 We (apparently) had a long-standing test failure inside strace-ff.test 8373 with the symptom that it misses exit_group call. As it turned out, it 8374 was PTRACE_EVENT_EXEC followed by execve syscall exiting stop. That 8375 behaviour indeed screwed all the syscall state tracking for the tracee. 8376 Let's try to patch it up by calling trace_syscall when we receive 8377 PTRACE_EVENT_EXEC outside syscall. 8378 8379 * defs.h (TCB_RECOVERING): New tcb flag. 8380 * strace.c (dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke 8381 trace_syscall with TCB_RECOVERING flag being set for the current_tcp 8382 if the tracee is not on exiting syscall. 8383 * syscall.c (get_scno): Set QUAL_RAW if we are recovering. 8384 (tamper_with_syscall_entering): Do not perform actual tampering during 8385 recovery as it's already too late. 8386 * NEWS: Mention it. 8387 8388 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 8389 8390 2018-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 8391 8392 tests: robustify set_ptracer_any. 8393 * tests/set_ptracer_any.c (main) [HAVE_PRCTL]: Provide fallback 8394 definitions for PR_SET_PTRACER and PR_SET_PTRACER_ANY constants, 8395 set all unused prctl arguments to 0. 8396 8397 2018-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 8398 8399 ia64: do not bail out in get_syscall_args if umove fails with EPERM. 8400 If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, 8401 both PTRACE_PEEKDATA and process_vm_readv become unavailable when the 8402 process dumpable flag is cleared, on ia64 this results to all syscall 8403 arguments being unavailable. 8404 8405 Recognize this situation and do not treat it as get_syscall_args error 8406 because the latter leaves the tracee in a ptrace stop. 8407 8408 This condition used to be triggered by prctl-dumpable test that caused 8409 strace to hang indefinitely. 8410 8411 * linux/ia64/get_syscall_args.c (get_syscall_args): Do not bail out 8412 if umove fails. 8413 * tests/prctl-dumpable.c [__ia64__]: Skip the test. 8414 8415 2018-01-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8416 8417 strace.c: reset printing_tcp on print_event_exit. 8418 print_event_exit should have printing_tcp setup analogous to printleader and 8419 syscall_exit_trace before printing its part, otherwise it spuriously resets 8420 curcol in line_ended for the stale printing_tcp if followfork == 2. 8421 8422 * strace.c (print_event_exit): Set printing_tcp to tcp before printing 8423 exiting event line and calling line_ended. 8424 8425 2018-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 8426 8427 tests: check path tracing of old select syscall. 8428 * tests/xselect.c [xselect] (xselect): Turn into prototype. 8429 * tests/oldselect-P.c: New file. 8430 * tests/oldselect-efault-P.c: Likewise. 8431 * tests/oldselect-efault.c: Likewise. 8432 * tests/oldselect.c: Use xselect.c 8433 * tests/pure_executables.list: Add oldselect-efault. 8434 * tests/gen_tests.in (oldselect, oldselect-P, oldselect-efault, 8435 oldselect-efault-P): New entries. 8436 * tests/oldselect.expected: Remove. 8437 * tests/oldselect.test: Remove. 8438 * tests/Makefile.am (check_PROGRAMS): Add oldselect-P 8439 and oldselect-efault-P. 8440 (DECODER_TESTS): Remove oldselect.test. 8441 (EXTRA_DIST): Remove oldselect.expected. 8442 * tests/.gitignore: Add oldselect-P, oldselect-efault, 8443 and oldselect-efault-P. 8444 8445 tests: check path tracing of select/_newselect syscalls. 8446 * tests/xselect.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ 8447 is not available. Add test calls that use PATH_TRACING_FD. 8448 (main): Conditionalize expected output for those calls 8449 that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. 8450 * tests/_newselect-P.c: New file. 8451 * tests/select-P.c: Likewise. 8452 * tests/Makefile.am (check_PROGRAMS): Add _newselect-P and select-P. 8453 * tests/.gitignore: Likewise. 8454 * tests/gen_tests.in (_newselect-P, select-P): New entries. 8455 8456 tests: extend the check of select/_newselect syscalls decoding. 8457 * tests/xselect.c: Rewrite for better coverage. 8458 8459 2018-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 8460 8461 tests: redirect stdin to /dev/null. 8462 Ensure that stdin descriptor is not available for output 8463 by reopening it to input from /dev/null. 8464 8465 * tests/run.sh: Redirect test's stdin to /dev/null. 8466 8467 2018-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 8468 8469 tests: add file:line to perror_msg_and_fail/error_msg_and_fail output. 8470 * tests/tests.h [!perror_msg_and_fail] (perror_msg_and_fail): New macro 8471 wrapper around the homonymous function. 8472 [!error_msg_and_fail] (error_msg_and_fail): Likewise. 8473 * tests/error_msg.c (perror_msg_and_fail, error_msg_and_fail): New 8474 macros defined to themselves. 8475 8476 Rework decoding and pathtrace of old select syscall. 8477 * linux/arch_defs_.h [!HAVE_ARCH_OLD_SELECT] (HAVE_ARCH_OLD_SELECT): New 8478 macro. 8479 * linux/aarch64/arch_defs_.h (HAVE_ARCH_OLD_SELECT): Likewise. 8480 * linux/arm/arch_defs_.h: Likewise. 8481 * linux/bfin/arch_defs_.h: Likewise. 8482 * linux/i386/arch_defs_.h: Likewise. 8483 * linux/m68k/arch_defs_.h: Likewise. 8484 * linux/microblaze/arch_defs_.h: Likewise. 8485 * linux/powerpc64/arch_defs_.h: Likewise. 8486 * linux/sh/arch_defs_.h: Likewise. 8487 * linux/x32/arch_defs_.h: Likewise. 8488 * linux/x86_64/arch_defs_.h: Likewise. 8489 * linux/powerpc/arch_defs_.h: New file. 8490 * Makefile.am (EXTRA_DIST): Add it. 8491 * desc.c (SYS_FUNC(oldselect)): Rewrite using 8492 fetch_indirect_syscall_args, move under [HAVE_ARCH_OLD_SELECT]. 8493 * pathtrace.c (match_xselect_args): New function. 8494 (pathtrace_match_set): Use it. 8495 8496 2018-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 8497 8498 Transform fetch_old_mmap_args into fetch_indirect_syscall_args. 8499 As there are more than one old style syscall that take their arguments 8500 via array, generalize fetch_old_mmap_args into a function that could 8501 fetch variable number of arguments. 8502 8503 * mem.c (fetch_old_mmap_args): Transform into ... 8504 * fetch_indirect_syscall_args.c: ... fetch_indirect_syscall_args 8505 in this new file. 8506 * Makefile.am (libstrace_a_SOURCES): Add it. 8507 * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Remove. 8508 (fetch_indirect_syscall_args): New prototype. 8509 * pathtrace.c (pathtrace_match_set) [HAVE_ARCH_OLD_MMAP]: Use 8510 fetch_indirect_syscall_args instead of fetch_old_mmap_args. 8511 8512 2018-01-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8513 8514 signal.c: remove excess semicolon after the end of the function. 8515 * signal.c (rt_sigtimedwait): Remove semicolon after the function body. 8516 8517 Use char * for pointer arithmetics. 8518 * netlink_inet_diag.c (decode_inet_diag_req_compat, 8519 decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char * 8520 instead of void *. 8521 * netlink_netlink_diag.c (decode_netlink_diag_req, 8522 decode_netlink_diag_msg): Likewise. 8523 * netlink_packet_diag.c (decode_packet_diag_req, 8524 decode_packet_diag_msg): Likewise. 8525 * netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg): 8526 Likewise. 8527 * rtnl_addr.c (decode_ifaddrmsg): Likewise. 8528 * rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise. 8529 * rtnl_dcb.c (decode_dcbmsg): Likewise. 8530 * rtnl_link.c (decode_ifinfomsg): Likewise. 8531 * rtnl_mdb.c (decode_br_port_msg): Likewise. 8532 * rtnl_neigh.c (decode_ndmsg): Likewise. 8533 * rtnl_route.c (decode_rtmsg): Likewise. 8534 * rtnl_rule.c (decode_fib_rule_hdr): Likewise. 8535 * rtnl_tc.c (decode_tcmsg): Likewise. 8536 8537 2018-01-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8538 8539 netlink_inet_diag.c: remove unnecessary return. 8540 decode_inet_diag_req, as well as the functions it calls, returns void. 8541 8542 * netlink_inet_diag.c (decode_inet_diag_req): Do not return anything. 8543 8544 2018-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 8545 8546 Move decoder of getpagesize syscall to libstrace. 8547 As only five architectures have getpagesize syscall, moving the decoder 8548 to libstrace allows to get rid of getpagesize related ifdefs and check 8549 build of getpagesize decoder on other architectures. 8550 8551 * mem.c (SYS_FUNC(getpagesize)): Move ... 8552 * getpagesize.c: ... to this new file. 8553 * Makefile.am (libstrace_a_SOURCES): Add it. 8554 8555 2018-01-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8556 8557 mpers: implement gawk 3 support. 8558 Some old systems that still make some sense to be supported have only 8559 gawk 3, so let's support them for now. 8560 8561 In order to achieve that, multiple changes have been implemented: 8562 - Multidimensional arrays are replaced with single-dimensional ones. 8563 In most places it's a "][" -> ", " replacement, as awk allows some 8564 kind of emulation of multidimensional arrays that way, but in several 8565 occasions (specifically for storing name and special fields) we have 8566 to iterate over them later, so we store that information in 8567 additional arrays in order to get the keys. 8568 - "switch" statements are replaced with sets of "if ... else if ... 8569 else" statements. This change is trivial, except we've added 8570 a temporary variable in what_is order to store expression value, for 8571 readability purposes. 8572 - No support for array iteration ordering. This one is most ugly of 8573 them all. Luckily, not that ugly, we've just had to process index a 8574 bit in order to make it lexicographically sortable and add two 8575 temporary arrays containing sorted indices in order to sort over them 8576 instead of those two arrays that we've added in order to work around 8577 lack of multidimensional array support. 8578 8579 * mpers.awk (compare_indices): Remove unused function. 8580 (array_get, update_upper_bound, /^DW_AT_data_member_location/, 8581 /^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array 8582 access with comma-concatenated index. 8583 (norm_idx): New function. 8584 (array_seq): Replace multidimensional array access with 8585 comma-concatenated index. Use comma-concatenated pair of (array_idx, 8586 "seq") in order to check presence of the item in an array. 8587 (what_is): Add enc and i local variables. Store the value of 8588 array[what_idx, "encoding"] in it. Replace "switch" statements with 8589 sets of "if ... else if ... else" statements. Replace multidimensional 8590 array access with comma-concatenated index. Use for (... ; ...; ...) 8591 iteration over aparents_keys instead of iteration over array. 8592 (/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]). Replace 8593 multidimensional array access with comma-concatenated index. Store an 8594 additional flag in array_names array. 8595 (/^DW_AT_name/): Replace multidimensional array access with 8596 comma-concatenated index. Add a flag to array_names for that idx. 8597 (/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise 8598 the captured group. Replace multidimensional array access with 8599 comma-concatenated index. 8600 (/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access 8601 with comma-concatenated index. Store additional flags in 8602 array_special and array_parents arrays. 8603 (END): Remove PROCINFO["sorted_in"] setup. Sort array_parents. Replace 8604 multidimensional array access with comma-concatenated index. Iterate 8605 over array_special to go over all the items that have "special" field. 8606 Iterate over array_names to go over all items that have "name" field. 8607 * NEWS: Mention it. 8608 8609 2018-01-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8610 8611 dm: add support for event_nr in DM_LIST_DEVICES result. 8612 Commit v4.13-rc1~137^2~13 (and a follow-up fix v4.14-rc4~20^2~3 8613 that changed alignment) introduced an additional hidden field 8614 in the structure returned by DM_LIST_DEVICES ioctl command 8615 that contains event_nr information. 8616 8617 Unfortunately, we can't test it for now, but looks like it kinda works: 8618 8619 # ./strace -v -eioctl -y dmsetup ls 8620 ioctl(3</dev/mapper/control>, DM_VERSION, {version=4.0.0, 8621 data_size=16384, flags=DM_EXISTS_FLAG} => {version=4.37.0, 8622 data_size=16384, flags=DM_EXISTS_FLAG}) = 0 8623 ioctl(3</dev/mapper/control>, DM_LIST_DEVICES, {version=4.0.0, 8624 data_size=16384, data_start=312, flags=DM_EXISTS_FLAG} => 8625 {version=4.37.0, data_size=408, data_start=312, flags=DM_EXISTS_FLAG, 8626 {dev=makedev(253, 1), name="fedoratesting--30-swap", event_nr=0}, 8627 {dev=makedev(253, 0), name="fedoratesting--30-root"}}) = 0 8628 fedoratesting--30-swap (253:1) 8629 fedoratesting--30-root (253:0) 8630 8631 * dm.c (dm_decode_dm_name_list): Obtain the amount of bytes copied 8632 during printing device name, print event number if there's a suitable 8633 gap present and the DM version is high enough. 8634 * NEWS: Mention it. 8635 8636 2018-01-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8637 8638 Move definition of personality macros to arch_defs_.h. 8639 * supported_personalities.h: Remove. 8640 * defs.h: Do not include it. 8641 * linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New 8642 macro. 8643 [!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise. 8644 * linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro. 8645 * linux/riscv/arch_defs_.h: Likewise. 8646 * linux/s390x/arch_defs_.h: Likewise. 8647 * linux/sparc64/arch_defs_.h: Likewise. 8648 * linux/x32/arch_defs_.h: Likewise. 8649 * linux/x86_64/arch_defs_.h: Likewise. 8650 * linux/powerpc64/arch_defs_.h: New file. 8651 * linux/tile/arch_defs_.h: Likewise. 8652 * Makefile.am (EXTRA_DIST): Add them. 8653 (strace_SOURCES): Remove supported_personalities.h. 8654 8655 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 8656 8657 2018-01-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8658 8659 Introduce HAVE_ARCH_SA_RESTORER. 8660 In order to simplify HAVE_SA_RESTORER logic a bit. 8661 8662 * linux/ia64/arch_defs_.h (HAVE_ARCH_SA_RESTORER): New macro. 8663 * linux/m68k/arch_defs_.h: Likewise. 8664 * linux/sparc/arch_defs_.h: Likewise. 8665 * linux/sparc64/arch_defs_.h: Likewise. 8666 * linux/hppa/arch_defs_.h: New file. 8667 * Makefile.am (EXTRA_DIST): Add it. 8668 * signal.c [HAVE_ARCH_SA_RESTORER]: Define HAVE_SA_RESTORER to it. 8669 [!HAVE_ARCH_SA_RESTORER && SA_RESTORER]: Define HAVE_SA_RESTORER to 1. 8670 [!HAVE_ARCH_SA_RESTORER && !SA_RESTORER]: Define HAVE_SA_RESTORER to 0. 8671 8672 2018-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 8673 8674 Replace NEED_UID16_PARSERS with HAVE_ARCH_UID16_SYSCALLS. 8675 * linux/arch_defs_.h [!HAVE_ARCH_UID16_SYSCALLS] 8676 (HAVE_ARCH_UID16_SYSCALLS): New macro. 8677 * linux/aarch64/arch_defs_.h (HAVE_ARCH_UID16_SYSCALLS): New macro. 8678 * linux/arm/arch_defs_.h: Likewise. 8679 * linux/i386/arch_defs_.h: Likewise. 8680 * linux/ia64/arch_defs_.h: Likewise. 8681 * linux/m68k/arch_defs_.h: Likewise. 8682 * linux/s390/arch_defs_.h: Likewise. 8683 * linux/s390x/arch_defs_.h: Likewise. 8684 * linux/sh/arch_defs_.h: Likewise. 8685 * linux/sparc/arch_defs_.h: Likewise. 8686 * linux/sparc64/arch_defs_.h: Likewise. 8687 * linux/syscall.h: Likewise. 8688 * linux/x32/arch_defs_.h: Likewise. 8689 * linux/x86_64/arch_defs_.h: Likewise. 8690 * linux/bfin/arch_defs_.h: New file. 8691 * linux/microblaze/arch_defs_.h: Likewise. 8692 * linux/riscv/arch_defs_.h: Likewise. 8693 * linux/sh64/arch_defs_.h: Likewise. 8694 * Makefile.am (EXTRA_DIST): Add them. 8695 * defs.h (NEED_UID16_PARSERS): Remove. 8696 * linux/syscall.h: Check for HAVE_ARCH_UID16_SYSCALLS instead of 8697 NEED_UID16_PARSERS. 8698 * uid.c: Likewise. 8699 8700 Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2. 8701 * linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New 8702 macro. 8703 * linux/alpha/arch_defs_.h: New file. 8704 * linux/ia64/arch_defs_.h: Likewise. 8705 * linux/mips/arch_defs_.h: Likewise. 8706 * linux/sh/arch_defs_.h: Likewise. 8707 * linux/sparc/arch_defs_.h: Likewise. 8708 * linux/sparc64/arch_defs_.h: Likewise. 8709 * Makefile.am (EXTRA_DIST): Add them. 8710 * defs.h (HAVE_GETRVAL2): Remove. 8711 (getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks. 8712 * net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of 8713 HAVE_GETRVAL2. 8714 * syscall.c: Likewise. 8715 8716 Use #if idiom instead of #ifdef for HAVE_ARCH_* macros. 8717 * linux/arch_defs_.h [!HAVE_ARCH_OLD_MMAP] (HAVE_ARCH_OLD_MMAP): New 8718 macro. 8719 [!HAVE_ARCH_OLD_MMAP_PGOFF] (HAVE_ARCH_OLD_MMAP_PGOFF): Likewise. 8720 * defs.h: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP. 8721 * mem.c: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP 8722 and HAVE_ARCH_OLD_MMAP_PGOFF 8723 * pathtrace.c: Likewise. 8724 8725 2018-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 8726 8727 Rename arch-specific arch_defs.h files to arch_defs_.h. 8728 Introduce a new arch_defs.h header that includes the corresponding 8729 arch-specific arch_defs_.h file followed by generic arch_defs_.h file. 8730 8731 * linux/arch_defs.h: Rename to linux/arch_defs_.h. 8732 * linux/aarch64/arch_defs.h: Rename to linux/aarch64/arch_defs_.h. 8733 * linux/arm/arch_defs.h: Rename to linux/arm/arch_defs_.h. 8734 * linux/i386/arch_defs.h: Rename to linux/i386/arch_defs_.h. 8735 * linux/m68k/arch_defs.h: Rename to linux/m68k/arch_defs_.h. 8736 * linux/s390/arch_defs.h: Rename to linux/s390/arch_defs_.h. 8737 * linux/s390x/arch_defs.h: Rename to linux/s390x/arch_defs_.h. 8738 * linux/x32/arch_defs.h: Rename to linux/x32/arch_defs_.h. 8739 * linux/x86_64/arch_defs.h: Rename to linux/x86_64/arch_defs_.h. 8740 * arch_defs.h: New file. 8741 * Makefile.am (strace_SOURCES): Add it. 8742 (EXTRA_DIST): Rename linux/*/arch_defs.h to linux/*/arch_defs_.h. 8743 8744 2018-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 8745 8746 Fix ANY_WORDSIZE_LESS_THAN_KERNEL_LONG definition. 8747 * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): Rewrite without undefined 8748 behaviour. 8749 8750 Fixes: f916793 ("Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro") 8751 8752 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8753 8754 util: return string size in printstr. 8755 As umovestr now returns something useful, let's propagate it further. 8756 8757 * defs.h (printstr_ex, printpathn, printpath): Change return type from 8758 void to int. 8759 (printstrn, printstr): Change return type from void to int, return 8760 printstr_ex result. 8761 * util.c (printpathn): Return -1 on NULL addr, nul_seen (exit code of 8762 umovestr) on success. 8763 (printpath): Return printpathn result. 8764 (printstr_ex): Return -1 on NULL addr, umoven/umovestr result otherwise. 8765 8766 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8767 8768 ucopy: return string size in umovestr. 8769 We return the size that includes \0 in order to preserve existing 8770 behaviour (return 0 when \0 haven't been seen, return positive number 8771 when it has been seen). 8772 8773 * ucopy.c (umovestr_peekdata, umovestr): Return string length 8774 including \0 instead of 1 when \0 is found. 8775 8776 2018-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 8777 8778 mpers.awk: avoid redefinition of mpers_ptr_t. 8779 Older versions of gcc like those found in RHEL6 fail with the following 8780 diagnostics: 8781 8782 In file included from block.c:32: 8783 ./mpers-m32/struct_blk_user_trace_setup.h:2: error: redefinition of typedef mpers_ptr_t 8784 mpers_type.h:44: note: previous declaration of mpers_ptr_t was here 8785 8786 * mpers.awk (END): Add #ifndef guard to mpers_ptr_t typedef. 8787 * mpers_test.sh: Update expected output. 8788 8789 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8790 8791 Add support for --enable-mpers=m32|mx32. 8792 * configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values 8793 for --enable-mpers option. 8794 * m4/mpers.m4 (st_MPERS): Check for personality support if personality 8795 name is provided as an option. Fail if the requested personality 8796 support is not available. 8797 8798 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 8799 8800 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8801 8802 tests: improve setugid error diagnostics a bit. 8803 * tests/setugid.c (main): Print unexpected code returned by syscall. 8804 8805 2018-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 8806 8807 v4l2: do not mpersify struct v4l2_create unless it is used by other code 8808 This fixes build with mpers support on older systems that lack 8809 definition of struct v4l2_create. 8810 8811 * v4l2.c: Wrap references to struct v4l2_create with 8812 [VIDIOC_CREATE_BUFS]. 8813 8814 2018-01-18 Dmitry V. Levin <ldv (a] altlinux.org> 8815 8816 btrfs: use uint32_t instead of __u32. 8817 * btrfs.c (btrfs_ioctl) [!HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE]: 8818 Replace __u32 with uint32_t. Remove useless cast. 8819 8820 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8821 8822 strace.1.in: clarify mpers flags in strace -V output. 8823 The previous description was a bit dated. 8824 8825 * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove "no-m32" and 8826 "no-mx32", describe the situation when some of mpers flags are not 8827 present in strace -V output. 8828 8829 2018-01-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8830 8831 Add compat support for s390x. 8832 By very popular demand. 8833 8834 While we are here, let's refactor the condition for old_mmap_pgoff into 8835 an arch-specific one, as it is used more than in one place. 8836 8837 * NEWS: Mention this. 8838 * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Likewise. 8839 * configure.ac (case "$host_cpu" in) <s390x>: Set arch_m32 to s390, set 8840 cc_flags_m32 to -m31. 8841 (st_MPERS([m32])): Add s390x. 8842 * defs.h [S390X]: Define NEED_UID16_PARSERS. 8843 * linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New 8844 macro, define to s390_frame_ptr. 8845 [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to 8846 __SIGNAL_FRAMESIZE. 8847 [!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long. 8848 (arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE 8849 instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type, 8850 respectively. 8851 * linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define 8852 * to s390_regset. 8853 (get_error): Use it instead of s390_regset. 8854 * linux/s390/get_scno.c (arch_get_scno): Likewise. 8855 * linux/s390/get_syscall_args.c (get_syscall_args): Likewise. 8856 * linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise. 8857 * linux/s390/set_scno.c (arch_set_scno): Likewise. 8858 * linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs, 8859 s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New 8860 variables. 8861 (s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET, 8862 ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE, 8863 ARCH_PERSONALITY_1_IOV_SIZE): New macros. 8864 * linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New 8865 prototypes. 8866 * linux/s390x/arch_rt_sigframe.c: Conditionalize on tcp->currpers. 8867 * linux/s390x/arch_sigreturn.c: Likewise. 8868 * linux/s390x/get_error.c: Likewise. 8869 * linux/s390x/get_scno.c: Likewise. 8870 * linux/s390x/get_syscall_args.c: Likewise. 8871 * linux/s390x/set_error.c: Likewise. 8872 * linux/s390x/set_scno.c: Likewise. 8873 * linux/s390x/errnoent1.h: New file. 8874 * linux/s390x/ioctls_arch1.h: Likewise. 8875 * linux/s390x/ioctls_inc1.h: Likewise. 8876 * linux/s390x/signalent1.h: Likewise. 8877 * linux/s390x/syscallent1.h: Likewise. 8878 * Makefile.am (EXTRA_DIST): Add new files added to linux/s390x. 8879 * supported_personalities.h [S390X] (SUPPORTED_PERSONALITIES): Define 8880 to 2. 8881 * tests/strace-V.test: Add s390 to the list of architectures that have 8882 m32 personality. 8883 * linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New macro. 8884 * linux/s390x/arch_defs.h: Likewise. 8885 * mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF. 8886 * pathtrace.c: Likewise. 8887 8888 2018-01-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8889 8890 Update NEWS. 8891 8892 2018-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 8893 8894 tests: check path tracing of ppoll syscall. 8895 * tests/ppoll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ 8896 is not available. Add a test call that use PATH_TRACING_FD. 8897 (main): Conditionalize expected output for those calls 8898 that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. 8899 * tests/ppoll-P.c: New file. 8900 * tests/pure_executables.list: Add ppoll-P. 8901 * tests/.gitignore: Likewise. 8902 * tests/gen_tests.in (ppoll-P): New entry. 8903 8904 tests: check path tracing of poll syscall. 8905 * tests/poll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ 8906 is not available. Add tests calls that use PATH_TRACING_FD. 8907 (main): Conditionalize expected output for those calls 8908 that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. 8909 * tests/poll-P.c: New file. 8910 * tests/pure_executables.list: Add poll-P. 8911 * tests/.gitignore: Likewise. 8912 * tests/poll-P.test: New test. 8913 * tests/Makefile.am (DECODER_TESTS): Add poll-P.test. 8914 8915 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8916 8917 tests: enable old_mmap-P.test on s390x. 8918 As s390x is the only 64-bit architecture that has old_mmap, 8919 the test needs some adjustments there. 8920 8921 * tests/old_mmap.c: Update condition. 8922 (main): Change int types to long, extend numerals to 64 bit, change 8923 printing format qualifiers to corresponding long types. 8924 8925 Co-Authored-by: Dmitry V. Levin <ldv (a] altlinux.org> 8926 8927 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8928 8929 tests: check path tracing of old mmap syscall. 8930 * tests/old_mmap.c [!TEST_FD]: Define TEST_FD. 8931 (main) <args1_c>: Replace 5th argument with TEST_FD. 8932 (main): Wrap the output for the calls that do not use TEST_FD 8933 with #ifndef PATH_TRACING. 8934 * tests/old_mmap-P.c: New file. 8935 * tests/pure_executables.list: Add old_mmap-P. 8936 * tests/.gitignore: Likewise. 8937 * tests/gen_tests.in: Add old_mmap-P test. 8938 8939 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8940 8941 Fix pathtrace for old_mmap/old_mmap_pgoff. 8942 As these system calls have only one argument that points to the 8943 location in memory containing actual arguments, current path tracing 8944 implementation is incorrect. In order to fix this, let's use recently 8945 introduced fetch_old_mmap_args in order to get actual arguments suitable 8946 for path matching. 8947 8948 * pathtrace.c [HAVE_ARCH_OLD_MMAP] <case SEN_old_mmap, 8949 case SEN_old_mmap_pgoff>: Retrieve actual old_mmap arguments with 8950 fetch_old_mmap_args, pass the value from the retrieved args if it's 8951 available. 8952 8953 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8954 8955 Test non-verbose old_mmap output. 8956 * tests/old_mmap-v-none.c: New file. Include old_mmap.c. 8957 * tests/pure_executables.list: Add old_mmap-v-none. 8958 * tests/.gitignore: Likewise. 8959 * tests/gen_tests.in (old_mmap-v-none): New entry. 8960 8961 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8962 8963 mem.c: use runtime check in fetch_old_mmap_args. 8964 This makes code a bit cleaner and makes it compatible with the upcoming 8965 s390x compat support. 8966 8967 * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Replace 8968 ANY_WORDSIZE_LESS_THAN_KERNEL_LONG check with current_wordsize == 4 8969 check. 8970 8971 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8972 8973 mem.c: introduce fetch_old_mmap_args. 8974 Move common old_mmap/old_mmap_pgoff argument fetching code into a 8975 separate function. 8976 8977 As it is, it also fixes the case of non-verbose printing of old_mmap 8978 arguments (see the new test in the next commit). Also, it is a 8979 preparation for the fix of path tracing for these syscalls. 8980 8981 * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New prototype. 8982 * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New function. 8983 [HAVE_ARCH_OLD_MMAP] (old_mmap, old_mmap_pgoff): Use it. 8984 8985 Fixes: 3db07f11 "Fix old_mmap output when mmap arguments are unfetchable" 8986 Suggested-by: Dmitry V. Levin <ldv (a] altlinux.org> 8987 8988 2018-01-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 8989 8990 Introduce arch-specific define HAVE_ARCH_OLD_MMAP. 8991 * linux/arch_defs.h: New file. 8992 * linux/aarch64/arch_defs.h: New file. Define HAVE_ARCH_OLD_MMAP. 8993 * linux/arm/arch_defs.h: Likewise. 8994 * linux/i386/arch_defs.h: Likewise. 8995 * linux/m68k/arch_defs.h: Likewise. 8996 * linux/s390/arch_defs.h: Likewise. 8997 * linux/s390x/arch_defs.h: Likewise. 8998 * linux/x32/arch_defs.h: Likewise. 8999 * linux/x86_64/arch_defs.h: Likewise. 9000 * Makefile.am (EXTRA_DIST): Add them. 9001 * defs.h: Include "arch_defs.h" 9002 * mem.c: Replace condition for SYS_FUNC(old_mmap) with #ifdef 9003 HAVE_ARCH_OLD_MMAP. 9004 9005 Suggested-by: Dmitry V. Levin <ldv (a] altlinux.org> 9006 9007 2018-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 9008 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 9009 9010 tests: improve descriptor set syntax testing. 9011 * tests/filtering_fd-syntax.test: New file. 9012 * tests/options-syntax.test: Move descriptor set syntax testing 9013 to filtering_fd-syntax.test. 9014 * tests/Makefile.am (MISC_TESTS): Add filtering_fd-syntax.test. 9015 9016 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9017 9018 strace.c: print correct out file name in error messages in case of -ff. 9019 * strace.c (outf_perror): New function. 9020 (tvprintf, tprints, flush_tcp_output): Use it. 9021 9022 aarch64: use ARCH_SET_PERSONALITY_FROM_IOV_SIZE. 9023 * linux/aarch64/arch_regs.c (ARCH_PERSONALITY_0_IOV_SIZE, 9024 ARCH_PERSONALITY_1_IOV_SIZE): New macros. 9025 * linux/aarch64/get_scno.c (arch_get_scno): Do not call 9026 update_personality as it is handled by the generic get_regs code now. 9027 9028 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9029 9030 syscall.c: add ability to set personality based on GETREGSET iov size. 9031 Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface 9032 and use its size to detect current personality. Let's generalise this 9033 approach and also avoid subtle errors when we get register but forget to 9034 update personality, at least for those architectures. 9035 9036 Note that in order to employ this behaviour, architecture has to use 9037 PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare 9038 appropriate ARCH_PERSONALITY_*_IOV_SIZE macros. 9039 9040 * syscall.c (get_regs) [ptrace_getregset_or_getregs && 9041 !HAVE_GETREGS_OLD]: Call update_personality based on the value returned 9042 in the iov_len field by PTRACE_GETREGSET. Warn once if the returned 9043 iov_len is unknown. 9044 9045 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9046 9047 syscall.c: add sanity check for the target personality number. 9048 We can never be cautious enough. 9049 9050 * defs.h (set_personality): Change argument type to unsigned int. 9051 * syscall.c (set_personality): Change argument type to unsigned int, 9052 check whether requested personality is sane, die otherwise. 9053 9054 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9055 9056 syscall.c: move current_personality check to set_personality. 9057 As all the personality-dependent entries are initially in sync, we can 9058 move the check whether we are setting the same personality as we 9059 currently are inside set_personality out of update_personality. 9060 9061 * syscall.c (current_wordsize, current_klongsize): Initialise to 0'th 9062 personality value in order to make the statement about "all the 9063 personality-dependent entries are initially in sync" true. 9064 (set_personality): Check whether requested personality differs from 9065 current_personality. 9066 (update_personality): Call set_personality unconditionally. 9067 9068 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9069 9070 syscall.c: always update tcp->currpers in update_personality. 9071 Sometimes (for example, switching from a process with one personality 9072 to a process that previously had different personality but returning 9073 from execve to that same personality into) it is possible that 9074 current_personality is not changed, but tcp->currpers is different. 9075 So, let's not return from update_personality and always update 9076 tcp->currpers if it differs from the target personality. 9077 9078 * syscall.c (update_personality): Do not exit early if personality == 9079 current_personality. 9080 9081 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9082 9083 Update current_personality on tcb switch. 9084 * strace.c (set_current_tcp): New function. 9085 (printleader, droptcb, print_event_exit, next_event, dispatch_event): 9086 Call set_current_tcp instead of setting current_tcp manually. 9087 9088 2018-01-16 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9089 9090 Add support for specifying compiler options for mpers builds. 9091 Because some architectures are very, very special. 9092 9093 * configure.ac (cc_flags_m32, cc_flags_mx32): New variables. AC_SUBST 9094 them. 9095 * m4/mpers.m4 (MPERS_CFLAGS): Use instead of CFLAG, pushdef as 9096 $cc_flags_$1. 9097 Use mpers_name instead of CFLAG in AC_CACHE_CHECK messages. 9098 Pass MPERS_CFLAGS as the second argument to mpers_test.sh 9099 * mpers.sh: Add CC_ARCH_FLAGS as the second argument (PARSER_FILE 9100 is moved to the third one). Do not expect leading dash in ARCH_FLAG 9101 anymore. 9102 * mpers_test.sh (mpers_cc_flags): New variable, initialise to the second 9103 command line argument. 9104 Pass $mpers_name without leading dash to mpers.sh. 9105 Pass $mpers_cc_flags as the second argument to mpers.sh ($sample is 9106 the third argument now). 9107 * Makefile.am (mpers-m%.stamp:): Pass $(mpers_CC_FLAGS) as the second 9108 argument to mpers.sh ($$f is now the third argument). 9109 ($(mpers_m32_targets)): Define target variable mpers_CC_FLAGS with the 9110 value of @cc_flags_m32@ 9111 ($(mpers_mx32_targets)): Define target variable mpers_CC_FLAGS with the 9112 value of @cc_flags_mx32@ 9113 * tests/Makefile.am (MERS_CC_FLAGS): New variable. 9114 * bootstrap: Append @cc_flags_$1@ to MPERS_CC_FLAGS. Append 9115 $(MPERS_CC_FLAGS) to ARCH_MFLAGS. 9116 9117 2018-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 9118 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 9119 9120 tests: improve syscall set syntax testing. 9121 * tests/filtering_syscall-syntax.test: New file. 9122 * tests/options-syntax.test: Move syscall set syntax testing 9123 to filtering_syscall-syntax.test. 9124 * tests/qual_fault-syntax.test: Likewise. 9125 * tests/qual_inject-syntax.test: Likewise. 9126 * tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test. 9127 9128 2018-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 9129 9130 Enhance error diagnostics about invalid syscalls in fault injection syntax 9131 Validate syscall set before the whole fault injection syntax. 9132 9133 * filter_qualify.c (parse_inject_expression): Add const qualifier to 9134 return type. Return an empty string when no syscall set is specified. 9135 (qualify_inject_common): Add const qualifier to "name". Move 9136 qualify_syscall_tokens invocation right after parse_inject_expression. 9137 * tests/qual_fault-syntax.test: Update expected output. 9138 * tests/qual_inject-syntax.test: Likewise. 9139 9140 2018-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 9141 9142 basic_filters: use loop initial declarations. 9143 * basic_filters.c (qualify_syscall_number, qualify_syscall_regex, 9144 lookup_class, qualify_syscall_class, qualify_syscall_tokens, 9145 qualify_tokens): Use "for" loop initial declarations. 9146 9147 filter_qualify: use loop initial declarations. 9148 * filter_qualify.c (sigstr_to_uint, find_errno_by_name, 9149 parse_inject_expression, qualify_inject_common, qualify): Use "for" loop 9150 initial declarations. 9151 9152 configure: try to set the C compiler mode to accept ISO Standard C. 9153 * configure.ac: Use AC_PROG_CC_STDC. 9154 * NEWS: Mention this. 9155 9156 2018-01-15 Dmitry V. Levin <ldv (a] altlinux.org> 9157 9158 pathtrace: update the list of unrelated syscalls. 9159 * pathtrace.c (pathtrace_match_set) <SEN_accept4, SEN_accept, 9160 SEN_signalfd4, SEN_signalfd>: Skip matching. 9161 9162 basic_filters: move legacy tracing class names to the end of table. 9163 * basic_filters.c (lookup_class) <syscall_class>: Move names that do not 9164 start with % to the end of table. 9165 9166 Enhance decoding of mq_* syscalls. 9167 * mq.c (SYS_FUNC(mq_open)): Add RVAL_FD to return value. 9168 (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive), SYS_FUNC(mq_notify), 9169 SYS_FUNC(mq_getsetattr)): Print the first argument using printfd. 9170 * NEWS: Mention this change. 9171 * pathtrace.c (pathtrace_match_set) <SEN_mq_getsetattr, SEN_mq_notify, 9172 SEN_mq_open, SEN_mq_timedreceive, SEN_mq_timedsend>: Skip matching. 9173 * linux/32/syscallent.h (mq_getsetattr, mq_notify, mq_open, 9174 mq_timedreceive, mq_timedsend): Add TD flag. 9175 * linux/64/syscallent.h: Likewise. 9176 * linux/alpha/syscallent.h: Likewise. 9177 * linux/arm/syscallent.h: Likewise. 9178 * linux/avr32/syscallent.h: Likewise. 9179 * linux/bfin/syscallent.h: Likewise. 9180 * linux/crisv10/syscallent.h: Likewise. 9181 * linux/hppa/syscallent.h: Likewise. 9182 * linux/i386/syscallent.h: Likewise. 9183 * linux/ia64/syscallent.h: Likewise. 9184 * linux/m68k/syscallent.h: Likewise. 9185 * linux/microblaze/syscallent.h: Likewise. 9186 * linux/mips/syscallent-n32.h: Likewise. 9187 * linux/mips/syscallent-n64.h: Likewise. 9188 * linux/mips/syscallent-o32.h: Likewise. 9189 * linux/powerpc/syscallent.h: Likewise. 9190 * linux/powerpc64/syscallent.h: Likewise. 9191 * linux/s390/syscallent.h: Likewise. 9192 * linux/s390x/syscallent.h: Likewise. 9193 * linux/sh/syscallent.h: Likewise. 9194 * linux/sh64/syscallent.h: Likewise. 9195 * linux/sparc/syscallent.h: Likewise. 9196 * linux/sparc64/syscallent.h: Likewise. 9197 * linux/x32/syscallent.h: Likewise. 9198 * linux/x86_64/syscallent.h: Likewise. 9199 * linux/xtensa/syscallent.h: Likewise. 9200 9201 Enhance error diagnostics about invalid syscalls in fault injection syntax 9202 * basic_filters.c (qualify_syscall_tokens): Remove "name" argument, 9203 assume its value is "system call". 9204 * filter.h (qualify_syscall_tokens): Remove "name" argument. 9205 All callers updated. 9206 * tests/qual_fault-syntax.test: Update expected output. 9207 9208 basic_filters: handle "all" in a more readable way. 9209 * basic_filters.c (qualify_syscall_tokens, qualify_tokens): Remove 9210 handle_inversion label, handle "all" by invoking invert_number_set_array 9211 directly. 9212 9213 filter: remove redundant braces around single line expressions. 9214 * basic_filters.c (qualify_syscall_class, qualify_syscall_name): 9215 Rearrange the inner loop body. 9216 (qualify_syscall_number, lookup_class, qualify_syscall_tokens, 9217 qualify_tokens): Remove redundant braces around single line expressions. 9218 * filter_qualify.c (qualify_inject_common): Likewise. 9219 9220 filter_qualify: move memory allocation from parse_inject_expression. 9221 * filter_qualify.c (parse_inject_expression): Replace "s" and "buf" 9222 arguments with "str" argument, use it instead of "s" and "*buf". 9223 (qualify_inject_common): Rename "buf" to "copy", initialize it to a copy 9224 of "str", pass "copy" to parse_inject_expression instead of "str" and 9225 "buf". 9226 9227 2018-01-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9228 9229 xlat: update NT_* constants. 9230 Update NT_* descriptor types with the values borrowed from 9231 kernel's include/uapi/linux/elf.h and glibc's elf.h. 9232 9233 * xlat/nt_descriptor_types.in (NT_PRSTATUS, NT_FPREGSET, NT_PRPSINFO, 9234 NT_PRXREG, NT_TASKSTRUCT, NT_PLATFORM, NT_AUXV, NT_GWINDOWS, NT_ASRS, 9235 NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS, 9236 NT_LWPSINFO, NT_PRFPXREG, NT_PRXFPREG, NT_PPC_VMX, NT_PPC_SPE, 9237 NT_PPC_VSX, NT_386_TLS, NT_386_IOPERM, NT_X86_XSTATE): Add fallback 9238 definitions. 9239 (NT_SIGINFO, NT_FILE, NT_PPC_*, NT_S390_*, NT_ARM_*, NT_METAG_*, 9240 NT_ARC_V2): New constants. 9241 * NEWS: Mention this. 9242 9243 2018-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 9244 9245 configure: use AC_MSG_ERROR and AC_MSG_FAILURE consistently. 9246 * configure.ac [$arch = mips]: Use AC_MSG_FAILURE instead of 9247 AC_MSG_ERROR when _MIPS_SIM cannot be determined. Use AC_MSG_ERROR 9248 instead of AC_MSG_FAILURE when syscallent stubs cannot be generated. 9249 9250 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9251 Dmitry V. Levin <ldv (a] altlinux.org> 9252 9253 configure: add --disable-mpers and --enable-mpers=check options. 9254 On architectures supporting multiple personalities, multiple 9255 personalities support in strace is required for proper decoding of 9256 structures used by tracees with personalities that differ from the 9257 personality of strace. 9258 9259 New configure options control whether multiple personalities support 9260 in strace is mandatory, optional, or disabled. 9261 9262 The default is changed from what is now equivalent of 9263 --enable-mpers=check (automatically detect whether required mpers 9264 support could be enabled) to --enable-mpers (terminate the build 9265 if required mpers support could not be enabled). 9266 9267 * configure.ac (AC_ARG_ENABLE([mpers])): New option. 9268 * m4/mpers.m4 (st_MPERS): Use enable_mpers. Terminate the build 9269 if mpers could not be enabled and enable_mpers==yes. 9270 * strace.spec.in: Specify --enable-mpers=check to %configure. 9271 * debian/rules (build/Makefile, build64/Makefile): Specify 9272 --enable-mpers=check to configure. 9273 9274 Suggested-by: DJ Delorie <dj (a] redhat.com> 9275 9276 2018-01-11 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 9277 9278 Update ioctl entries from linux v4.15-rc7. 9279 * linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh. 9280 * linux/32/ioctls_inc_align32.h: Likewise. 9281 * linux/32/ioctls_inc_align64.h: Likewise. 9282 * linux/64/ioctls_inc.h: Likewise. 9283 * linux/x32/ioctls_inc0.h: Likewise. 9284 * NEWS: Mention this. 9285 9286 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9287 Dmitry V. Levin <ldv (a] altlinux.org> 9288 9289 Issue a warning when strace lacks tracee personality support. 9290 * defs.h (HAVE_PERSONALITY_1_MPERS, HAVE_PERSONALITY_2_MPERS): New 9291 macros. 9292 * syscall.c (update_personality): Add need_mpers_warning array 9293 initialized with mpers support data. Use it for printing the mpers 9294 unavailability warning once per personality. 9295 9296 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9297 9298 tests: add more checks of reboot syscall decoding. 9299 In particular, check for the recent fixes in reboot syscall decoder. 9300 9301 * tests/gen_tests.in (reboot): Provide -s 256 option. 9302 * tests/reboot.c (STR32, STR128): New macros. 9303 (main): Add more checks. 9304 9305 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9306 9307 tests: use sprintrc in reboot.test. 9308 * test/reboot.c (main): Use sprintrc instead of old-style manual 9309 printing of return code. 9310 9311 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9312 9313 reboot.c: limit printing of the fourth argument to 255 bytes. 9314 The size of kernel buffer is 256 bytes and the last byte is always zero. 9315 9316 * reboot.c (SYS_FUNC(reboot)): Replace printstr call with printstr_ex 9317 with size of 255 and style flag QUOTE_0_TERMINATED. 9318 9319 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9320 9321 reboot.c: use printxval instead of printflags. 9322 Numeric arguments of reboot syscall are not flags but magic values. 9323 9324 * reboot.c (SYS_FUNC(reboot)): Replace printflags with printxval. 9325 9326 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9327 9328 Search for <libiberty/demangle.h> in addition to <demangle.h> 9329 This is the location where this header is installed on Debian-based 9330 systems. 9331 9332 * configure.ac: Check for libiberty/demangle.h in addition to 9333 demangle.h. 9334 * unwind.c [USE_DEMANGLE]: Include either <demangle.h> or 9335 <libiberty_demangle.h> based on the presence of HAVE_DEMANGLE_H and 9336 HAVE_LIBIBERTY_DEMANGLE_H macros. 9337 9338 2018-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 9339 9340 strace.1: fix typo. 9341 * strace.1.in (.SH NOTES): Replace prlimit with prlimit64. 9342 9343 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9344 9345 Document multiple personalities support. 9346 * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): New section. 9347 9348 Add indication of mpers support to strace -V output. 9349 * strace.c (print_version): Append information about m32 and mx32 9350 decoding support. 9351 * tests/strace-V.test: Update expected output. 9352 9353 Provide strace's native arch to the test framework. 9354 * configure.ac (arch_native): New variable, set to arch. 9355 * tests/Makefile.am (NATIVE_ARCH): New variable, set to @arch_native@. 9356 (AM_TEST_LOG_FLAGS): Pass NATIVE_ARCH as STRACE_NATIVE_ARCH environment 9357 variable. 9358 9359 Add indication of optional demangle feature strace -V output. 9360 * strace.c (print_version) [USE_DEMANGLE]: Append " stack-demangle" 9361 to the features string. 9362 * tests/strace-V.test: Update expected output. 9363 9364 configure.ac: check for mpers support on RISC-V. 9365 * confgure.ac (st_MPERS([m32])): Add riscv. 9366 9367 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9368 9369 Use xappendstr instead of xsnprintf where suitable. 9370 Replace occurrences of 9371 9372 outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...) 9373 9374 with much more sleek 9375 9376 outptr = xappendstr(outstr, outptr, ...) 9377 9378 * desc.c (decode_select): Replace xsnprintf with xappendstr. 9379 * open.c (sprint_open_modes): Likewise. 9380 * poll.c (decode_poll_exiting): Likewise. 9381 * signal.c (sprintsigmask_n): Likewise. 9382 * xlat.c (sprintflags): Likewise. 9383 9384 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9385 9386 xstring.h: add xappendstr. 9387 Introduce a macro for handling common case of partial writes 9388 to a character array. 9389 9390 * xstring.h (get_pos_diff_): New function. 9391 (xappendstr): New macro. 9392 9393 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9394 9395 Update perf-related flags. 9396 - PERF_SAMPLE_BRANCH_TYPE_SAVE, added in v4.14-rc1~173^2~33^2~6 9397 - PERF_SAMPLE_PHYS_ADDR, added in v4.14-rc1~173^2~2 9398 9399 * xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_TYPE_SAVE): New 9400 flag. 9401 * xlat/perf_event_sample_format.in (PERF_SAMPLE_PHYS_ADDR): Likewise. 9402 * tests/perf_event_open.c: Update expected output. 9403 9404 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9405 9406 perf.c: add support for struct perf_event_attr.namespaces. 9407 This field was introduced by linux kernel commit v4.12-rc1~152^2~42^2~10. 9408 9409 * configure.ac (AC_CHECK_MEMBERS): Add perf_event_attr.namespaces. 9410 * perf_event_struct.h (struct perf_event_attr): Add namespaces field. 9411 * perf.c (print_perf_event_attr): Print namespaces field. 9412 Update comment for __reserved_1 field. 9413 * tests/perf_event_open.c (struct pea_flags): Add namespaces field. 9414 (print_event_attr): Update expected output. 9415 9416 2018-01-11 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9417 9418 tests: check decoding of [gs]et_thread_area syscalls on x86. 9419 * tests/xet_thread_area_x86.c: New file. 9420 * tests/xet_thread_area_x86.test: New test. 9421 * tests/Makefile.am (DECODER_TESTS): Add it. 9422 * tests/.gitignore: Add xet_thread_area_x86. 9423 * tests/pure_executables.list: Likewise. 9424 9425 2018-01-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9426 9427 tests: check decoding of modify_ldt with for 4-byte-available user_desc. 9428 Since there is possibility now that strace read only entry_number field 9429 of the user_desc struct, let's check that it doesn't do it with 9430 modify_ldt syscall. 9431 9432 * tests/modify_ldt.c (main): Add 4-byte-sized tail_alloc'ed variable. 9433 Try to provide it as an argument to modify_ldt. 9434 9435 2018-01-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9436 9437 Allow separate printing of struct user_desc.entry_number. 9438 Kernel reads only entry_number field in the beginning of the 9439 get_thread_area syscall handler. Let's replicate this behaviour. 9440 9441 * defs.h (enum user_desc_print_filter): New enumeration. 9442 (print_user_desc): Add an argument for signalling which part of the 9443 structure should be printed. 9444 * clone.c (print_tls_arg): Update print_user_desc call. 9445 * ldt.c (print_user_desc): Add filter argument. Print entry_number on 9446 entering and the rest on exiting. Store entering value of the 9447 entry_number field in order to print the updated value in the impossible 9448 case of changed entry_number value. 9449 (SYS_FUNC(modify_ldt), SYS_FUNC(set_thread_area)): Update 9450 print_user_desc call. 9451 (SYS_FUNC(get_thread_area)): Call print_user_desc with 9452 USER_DESC_ENTERING format argument on entering and with 9453 USER_DESC_EXITING on exiting. 9454 9455 2018-01-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9456 9457 tests: move struct user_desc printing function into a separate file. 9458 As part of preparation for the introduction of [gs]et_thread_area test. 9459 9460 * tests/modify_ldt.c (print_user_desc): Move it ... 9461 * tests/print_user_desc.c: ... to new file. 9462 * tests/Makefile.am (EXTRA_DIST): Add print_user_desc.c. 9463 9464 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9465 9466 tests: check decoding of modify_ldt syscall. 9467 * tests/modify_ldt.c: New file. 9468 * tests/gen_tests.in: Add modify_ldt test. 9469 * tests/pure_executables.list: Add modify_ldt. 9470 * tests/.gitignore: Likewise. 9471 9472 ldt.c: manually set modify_ldt's error code. 9473 * ldt.c (modify_ldt): Move parsing under entering(tcp). Check whether 9474 return code is erroneous and set tcp->u_error appropriately along with 9475 RVAL_PRINT_ERR_VAL flag. 9476 9477 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9478 9479 syscall.c: add support for printing return value and error code. 9480 Some weird syscalls (like modify_ldt) return value that doesn't indicate 9481 an error (less than -4096), but it is, in fact, erroneous (because they 9482 decide to clip the return value to 32-bit, for example). 9483 9484 Add a flag to print decoded error code along with syscall return value. 9485 9486 * defs.h (RVAL_PRINT_ERR_VAL): New rval flag. 9487 * syscall.c (syscall_exiting_trace): Handle it. 9488 9489 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9490 9491 ldt.c: print the first argument of modify_ldt as int. 9492 * ldt.c (SYS_FUNC(modify_ldt)): Print the first argument as %d. 9493 9494 ldt.c: print lm field for 64-bit tracees. 9495 * configure.ac (AC_CHECK_MEMBERS): Add struct user_desc.lm. 9496 * ldt.c (print_user_desc) [HAVE_STRUCT_USER_DESC_LM]: Print lm field 9497 for non-compat tracees (it is ignored for compat ones). 9498 9499 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9500 9501 ldt.c: make struct user_desc output more structured. 9502 Also, while we are here, let's fix print qualifiers (which should be %u 9503 and not %d). 9504 9505 * ldt.c (print_user_desc): Use PRINT_FIELD_* macros for printing 9506 structure. 9507 (SYS_FUNC(set_thread_area)): Change field key-value separator from ":" 9508 to "=", change print format qualifier from %d to %u. 9509 9510 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9511 9512 print_fields.h: add PRINT_FIELD_U_CAST. 9513 Add a macro for printing fields explicitly casted to specific type. 9514 This is useful for bit fields, as otherwise the magic of *_extend_to_* 9515 macros breaks. 9516 9517 * print_field.h (PRINT_FIELD_U_CAST): New macro. 9518 9519 2018-01-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9520 9521 print_fields.h: rename PRINT_FIELD_UID to PRINT_FIELD_ID. 9522 As uid is not the only thing that has a special treatment of the -1 9523 value (and, as a result, needs special care), let's rename 9524 PRINT_FIELD_UID to PRINT_FIELD_ID and make PRINT_FIELD_UID its alias. 9525 9526 * print_fields.h (PRINT_FIELD_ID): Rename from PRINT_FIELD_UID. 9527 (PRINT_FIELD_UID): Define to PRINT_FIELD_ID. 9528 9529 2018-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 9530 9531 Fix build on systems without linux/genetlink.h. 9532 * socketutils.c [!HAVE_LINUX_GENETLINK_H] (genl_families_xlat): Add 9533 tcp argument. 9534 9535 Fixes: v4.20-134-gc46fefc ("Add tcp arguments to netlink calls") 9536 9537 2018-01-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9538 9539 count.c: whitespace. 9540 9541 count.c: cleanup types and sizeof usage. 9542 * count.c (call_summary_pers): Change the type of sorted_count 9543 to "unsigned int *". Replace sizeof(int) with sizeof(sorted_count[0]). 9544 Change the type of idx to unsigned int. 9545 9546 2018-01-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9547 9548 count.c: collect definitions of format strings in one place. 9549 In an attempt to make it more readable. 9550 9551 * count.c (call_summary_pers): Put all format strings in static 9552 constants. Use them. 9553 9554 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9555 9556 Add tcp arguments to netlink calls. 9557 Since they call tracee-specific socket/sendmsg/recvmsg, we'd like to 9558 pass tcp there. 9559 9560 * defs.h (genl_families_xlat): Add tcp argument. 9561 * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_generic, 9562 decode_nlmsg_type_netfilter, typedef nlmsg_types_decoder_t): Likewise. 9563 (decode_nlmsg_type): Add tcp argument. Pass tcp to decoder call. 9564 (print_nlmsghdr): Pass tcp to the decode_nlmsg_type call. 9565 * socketutils.c (send_query, receive_responses): Add tcp argument. 9566 (inet_send_query, unix_send_query, netlink_send_query, ): Add tcp argument. 9567 Pass tcp to the send_query call. 9568 (unix_get): Add tcp argument. Pass tcp to the unix_send_query and 9569 receive_responses calls. 9570 (inet_get): Add tcp argument. Pass tcp to the inet_send_query and 9571 receive_responses calls. 9572 (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Add tcp argument. Pass 9573 tcp to the inet_get call. 9574 (netlink_get): Add tcp argument. Pass tcp to the netlink_send_query and 9575 receive_responses calls. 9576 (protocols): Add tcp argument to the get field. 9577 (get_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to 9578 the protocols[].get calls. 9579 (print_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to 9580 the get_sockaddr_by_inode_uncached call. 9581 (get_sockaddr_by_inode): Pass tcp to the get_sockaddr_by_inode_uncached 9582 call. 9583 (print_sockaddr_by_inode): Pass tcp to the 9584 print_sockaddr_by_inode_uncached call. 9585 (genl_send_dump_families): Add tcp argument. Pass tcp to the send_query 9586 call. 9587 (genl_families_xlat): Add tcp argument. Pass tcp to the 9588 genl_send_dump_families and receive_responses calls. 9589 9590 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9591 9592 Add tcp argument to clear_regs. 9593 * defs.h (clear_regs): Add argument struct tcb *tcp. 9594 * syscall.c (clear_regs): Likewise. 9595 * strace.c (next_event): Pass tcp to clear_regs() call. 9596 9597 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9598 9599 Pass tcp argument to get_optmem_max/read_int_from_file. 9600 In preparation to passing tcp to all tracee-related syscalls. 9601 9602 * defs.h (read_int_from_file): Add "struct tcb *" as the first argument. 9603 * util.c (read_int_from_file): Likewise. 9604 * msghdr.c (get_optmem_max): Add "struct tcb *tcp" as the first 9605 argument, pass it to read_int_from_file call. 9606 (decode_msg_control): Pass tcp to get_optmem_max. 9607 9608 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9609 9610 Include paths.h if it is available. 9611 Use the OS definition of _PATH_BSHELL macro if it is available. 9612 9613 * configure.ac (AC_CHECK_HEADERS): Add paths.h. 9614 * strace.c [HAVE_PATHS_H]: Include paths.h. 9615 9616 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9617 9618 strace.c: avoid duplication of a format string in attach_tcb. 9619 * strace.c (attach_tcb): Add task_path variable with the output format. 9620 Use it for the procdir declaration and xsprintf format string argument. 9621 9622 2018-01-07 Elvira Khabirova <lineprinter (a] altlinux.org> 9623 9624 Move syscall_tampered to defs.h. 9625 * syscall.c (syscall_tampered): Move ... 9626 * defs.h: ... here. 9627 9628 2018-01-07 Elvira Khabirova <lineprinter (a] altlinux.org> 9629 9630 strace.c: rename set_sigaction to set_sighandler. 9631 Since set_sigaction() actually specifies sa_handler and not sa_sigaction, 9632 rename set_sigaction() to set_sighandler() for future definition of 9633 set_sigaction() function as specifying sa_sigaction. 9634 9635 * strace.c (set_sigaction): Rename to set_sighandler. 9636 All callers updated. 9637 9638 2018-01-07 Elvira Khabirova <lineprinter (a] altlinux.org> 9639 9640 .gitignore: ignore "gnu" directory created by st_MPERS m4 macro. 9641 9642 Update .mailmap. 9643 * .mailmap (Elvira Khabirova): Add @altlinux.org. 9644 9645 2018-01-07 Chen Jingpiao <chenjingpiao (a] gmail.com> 9646 9647 .mailmap: add canonical name for Chen Jingpiao. 9648 * .mailmap: Add canonical name for Chen Jingpiao. 9649 9650 2018-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 9651 9652 personality.c: use sprintxval. 9653 * personality.c (SYS_FUNC(personality)): Use sprintxval instead of local 9654 implementation. 9655 9656 2018-01-07 Eugene Syromiatnikov <esyr (a] redhat.com> 9657 9658 xlat.c: add sprintxval for printing xval to string. 9659 * defs.h (sprintxval): New declaration. 9660 (sprintxval): New function. 9661 9662 2018-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 9663 9664 desc.c: use xsnprintf instead of sprintf. 9665 * desc.c: Include "xstring.h". 9666 (decode_select): Replace sprintf with xsnprintf. 9667 9668 xlat.c: use xsnprintf instead of sprintf. 9669 * xlat.c: Include "xstring.h". 9670 (sprintflags): Replace sprintf with xsnprintf. 9671 9672 open.c: use xsnprintf instead of sprintf. 9673 * open.c: Include "xstring.h". 9674 (sprint_open_modes): Replace sprintf with xsnprintf. 9675 9676 poll.c: use xs*printf instead of sprintf. 9677 * poll.c: Include "xstring.h". 9678 (decode_poll_exiting): Replace sprintf with xsnprintf and xsprintf. 9679 9680 signal.c: use xs*printf instead of sprintf. 9681 * signal.c: Include "xstring.h". 9682 (signame): Replace sprintf with xsprintf. 9683 (sprintsigmask_n): Replace sprintf with xsnprintf. 9684 9685 print_timeval.c: use xsprintf instead of snprintf. 9686 * print_timeval.c: Include "xstring.h". 9687 (sprint_timeval, sprint_timeval32): Replace snprintf with xsprintf. 9688 9689 print_timespec.c: use xsprintf instead of snprintf. 9690 * print_timespec.c: Include "xstring.h". 9691 (sprint_timespec): Replace snprintf with xsprintf. 9692 9693 mmsghdr.c: use xsprintf instead of snprintf. 9694 * mmsghdr.c: Include "xstring.h". 9695 (SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf. 9696 9697 socketutils.c: use xsprintf instead of snprintf. 9698 * socketutils.c: Include "xstring.h". 9699 (unix_parse_response): Replace snprintf with xsprintf. 9700 9701 alpha.c: use xsprintf instead of snprintf. 9702 * alpha.c: Include "xstring.h". 9703 (decode_getxxid): Replace snprintf with xsprintf. 9704 9705 v4l2.c: use xsprintf instead of sprintf. 9706 * v4l2.c: Include "xstring.h". 9707 (print_v4l2_create_buffers): Replace sprintf with xsprintf. 9708 9709 util.c: use x*sprintf instead of s*printf. 9710 * util.c: Include "xstring.h". 9711 (sprinttime_ex): Replace snprintf with xsnprintf. 9712 (getfdproto): Replace sprintf with xsprintf. 9713 9714 unwind.c: use xsprintf instead of sprintf. 9715 * unwind.c: Include "xstring.h". 9716 (build_mmap_cache): Replace sprintf with xsprintf. 9717 9718 syscall.c: use xsprintf instead of sprintf. 9719 * syscall.c: Include "xstring.h". 9720 (get_scno): Replace sprintf with xsprintf. 9721 9722 resource.c: use xsprintf instead of sprintf. 9723 * resource.c: Include "xstring.h". 9724 (sprint_rlim64, sprint_rlim32): Replace sprintf with xsprintf. 9725 9726 pathtrace.c: use xsprintf instead of sprintf. 9727 * pathtrace.c: Include "xstring.h". 9728 (getfdpath): Replace sprintf with xsprintf. 9729 9730 2018-01-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9731 9732 ldt.c: replace sprintf with xsprintf. 9733 * ldt.c: Include "xstring.h". 9734 (SYS_FUNC(set_thread_area)): Replace sprintf with xsprintf. 9735 9736 2018-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 9737 9738 strace.c: use xsprintf instead of sprintf. 9739 * strace.c: Include "xstring.h". 9740 (strerror, newoutf, attach_tcb, print_debug_info): Replace sprintf 9741 with xsprintf. 9742 9743 2018-01-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9744 9745 ioprio.c: use xsprintf instead of sprintf. 9746 * ioprio.c: Include "xstring.h". 9747 (sprint_ioprio): Replace sprintf with xsprintf. 9748 9749 2018-01-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9750 9751 Introduce hardened xsprintf/xsnprintf macros. 9752 Let's try to future/fool-proof code a bit by introducing variants 9753 of sprintf/snprintf that die if an overflow (or an error) occurs. 9754 They are deemed to be the default choice for printing to some local 9755 string buffer where no sensible error handling is implemented. 9756 9757 * xstring.h: New file. 9758 * Makefile.am (strace_SOURCES): Add it. 9759 9760 2018-01-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9761 9762 count.c: use %9.u conversion specification. 9763 Instead of printing to a temporary string. This also fixes a subtle bug 9764 when the output for a billion errors and more is cut and shown 9765 incorrectly. 9766 9767 * count.c (struct call_counts): Change type of calls and errors fields 9768 to unsigned int since they are used and printed as unsigned anyway. 9769 (call_summary_pers): Remove error_str. Print cc->errors 9770 and error_cum using %9.u conversion specification. 9771 9772 2018-01-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9773 9774 count.c: use personality_names in call_summary report caption. 9775 Otherwise the title is quite misleading for x32 personality. 9776 9777 * count.c (call_summary): Use personality_names. 9778 9779 2018-01-05 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 9780 9781 Move personality names to a global variable. 9782 This is a part of "Prepare for adding support for Lua scripting" 9783 commit. 9784 9785 * defs.h (personality_names): New external constant declaration. 9786 * syscall.c: (personality_names): New global variable. 9787 (update_personality): Use personality_names for reporting personality 9788 name. 9789 9790 Co-Authored-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 9791 9792 2018-01-04 Lubomir Rintel <lkundrak (a] v3.sk> 9793 9794 strace.spec.in: include Bluetooth headers for AF_BLUETOOTH sockets decoding 9795 * strace.spec.in (BuildRequires): Add pkgconfig(bluez). 9796 9797 2018-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 9798 9799 Lift artificial limit on output file names in -ff mode. 9800 Starting with commit v4.5.19~88 strace imposed an artificial limit 9801 on output file names in -ff mode, leading to the following absurd 9802 behaviour: 9803 9804 $ strace -ff -o"$(perl -e 'print "/" x 510')/$PWD/log" /bin/true 9805 strace: Can't fopen '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.12345': Permission denied 9806 9807 * strace.c (newoutf): Raise buffer size to PATH_MAX. 9808 (init) <followfork >= 2>: Check output file name prefix length. 9809 * tests/options-syntax.test: Check it. 9810 9811 2018-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 9812 9813 configure.ac: fix typo. 9814 * configure.ac: Replace CPPFALGS with CPPFLAGS. 9815 9816 Fixes: v4.20-85-gf9c8e8a ("unwind: demangle symbol names") 9817 9818 2018-01-03 Eugene Syromiatnikov <esyr (a] redhat.com> 9819 9820 Change the first argument of upeek from pid to tcp. 9821 All users were changed automatically by: 9822 9823 for i in `git grep -l 'upeek(tcp->pid'`; do \ 9824 sed -i 's/upeek(tcp->pid/upeek(tcp/g' "$i"; \ 9825 done 9826 9827 * upeek.c (upeek): Change the first argument from pid_t pid to struct 9828 tcb *tcp. Use tcp->pid instead of pid in the function's body. 9829 * defs.h (upeek): Update declaration. 9830 * linux/alpha/arch_getrval2.c: Pass tcp instead of tcp->pid to the 9831 upeek calls. 9832 * linux/alpha/arch_rt_sigframe.c: Likewise. 9833 * linux/alpha/arch_sigreturn.c: Likewise. 9834 * linux/alpha/get_scno.c: Likewise. 9835 * linux/alpha/get_syscall_args.c: Likewise. 9836 * linux/alpha/get_syscall_result.c: Likewise. 9837 * linux/bfin/arch_rt_sigframe.c: Likewise. 9838 * linux/bfin/get_scno.c: Likewise. 9839 * linux/bfin/get_syscall_args.c: Likewise. 9840 * linux/bfin/get_syscall_result.c: Likewise. 9841 * linux/crisv10/arch_rt_sigframe.c: Likewise. 9842 * linux/crisv10/get_scno.c: Likewise. 9843 * linux/crisv10/get_syscall_args.c: Likewise. 9844 * linux/crisv10/get_syscall_result.c: Likewise. 9845 * linux/hppa/arch_rt_sigframe.c: Likewise. 9846 * linux/hppa/get_scno.c: Likewise. 9847 * linux/hppa/get_syscall_args.c: Likewise. 9848 * linux/hppa/get_syscall_result.c: Likewise. 9849 * linux/microblaze/arch_rt_sigframe.c: Likewise. 9850 * linux/microblaze/arch_sigreturn.c: Likewise. 9851 * linux/microblaze/get_scno.c: Likewise. 9852 * linux/microblaze/get_syscall_args.c: Likewise. 9853 * linux/microblaze/get_syscall_result.c: Likewise. 9854 * linux/powerpc/getregs_old.c: Likewise. 9855 * linux/sh/arch_getrval2.c: Likewise. 9856 * linux/sh/arch_rt_sigframe.c: Likewise. 9857 * linux/sh/get_scno.c: Likewise. 9858 * linux/sh/get_syscall_args.c: Likewise. 9859 * linux/sh/get_syscall_result.c: Likewise. 9860 * linux/sh64/get_scno.c: Likewise. 9861 * linux/sh64/get_syscall_args.c: Likewise. 9862 * linux/sh64/get_syscall_result.c: Likewise. 9863 * linux/xtensa/arch_rt_sigframe.c: Likewise. 9864 * linux/xtensa/get_scno.c: Likewise. 9865 * linux/xtensa/get_syscall_args.c: Likewise. 9866 * linux/xtensa/get_syscall_result.c: Likewise. 9867 * syscall.c: Likewise. 9868 9869 2018-01-03 Eugene Syromiatnikov <esyr (a] redhat.com> 9870 9871 Change argument of getregs_old from pid to tcp. 9872 * linux/powerpc/getregs_old.c (getregs_old): Change the first argument 9873 from pid_t pid to struct tcb *tcp. Replace all instances of pid with 9874 tcp->pid. 9875 * linux/x86_64/getregs_old.c (getregs_old): Likewise. 9876 * linux/x86_64/getregs_old.h (getregs_old): Update declaration. 9877 * syscall.c (get_regs) [HAVE_GETREGS_OLD]: Pass tcp to the getregs_old 9878 call instead of tcp->pid. 9879 9880 2018-01-03 Eugene Syromiatnikov <esyr (a] redhat.com> 9881 9882 Change the first argument of upoke from pid to tcp. 9883 Users were updated automatically by: 9884 9885 for i in `git grep -l 'upoke(tcp->pid'`; do \ 9886 sed -i 's/upoke(tcp->pid/upoke(tcp/g' "$i"; \ 9887 done 9888 9889 * upoke.c (upoke): Change the first argument from pid_t pid to struct 9890 tcb *tcp. Use tcp->pid instead of pid in the function's body. 9891 * defs.h (upoke): Update declaration. 9892 * linux/alpha/set_error.c (arch_set_error, arch_set_success): Provide 9893 tcp in the first argument of the upoke call instead of tcp->pid. 9894 * linux/alpha/set_scno.c (arch_set_scno): Likewise. 9895 * linux/bfin/set_error.c (arch_set_error, arch_set_success): Likewise. 9896 * linux/bfin/set_scno.c (arch_set_scno): Likewise. 9897 * linux/crisv10/set_error.c (arch_set_error, arch_set_success): 9898 Likewise. 9899 * linux/crisv10/set_scno.c (arch_set_scno): Likewise. 9900 * linux/hppa/set_error.c (arch_set_error, arch_set_success): Likewise. 9901 * linux/hppa/set_scno.c (arch_set_scno): Likewise. 9902 * linux/i386/set_error.c (arch_set_error, arch_set_success): Likewise. 9903 * linux/i386/set_scno.c (arch_set_scno): Likewise. 9904 * linux/microblaze/set_error.c (arch_set_error, arch_set_success): 9905 Likewise. 9906 * linux/microblaze/set_scno.c (arch_set_scno): Likewise. 9907 * linux/powerpc/set_error.c (arch_set_error, arch_set_success): 9908 Likewise. 9909 * linux/powerpc/set_scno.c (arch_set_scno): Likewise. 9910 * linux/sh/set_error.c (arch_set_error, arch_set_success): Likewise. 9911 * linux/sh/set_scno.c (arch_set_scno): Likewise. 9912 * linux/sh64/set_error.c (arch_set_error, arch_set_success): Likewise. 9913 * linux/sh64/set_scno.c (arch_set_scno): Likewise. 9914 * linux/x86_64/set_error.c (arch_set_error, arch_set_success): Likewise. 9915 * linux/x86_64/set_scno.c (arch_set_scno): Likewise. 9916 * linux/xtensa/set_error.c (arch_set_error, arch_set_success): Likewise. 9917 * linux/xtensa/set_scno.c (arch_set_scno): Likewise. 9918 9919 2018-01-03 Eugene Syromiatnikov <esyr (a] redhat.com> 9920 9921 Move enum trace_event into a separate header. 9922 As it will have users outside strace.c in the future. 9923 9924 * trace_event.h (enum trace_event): Move it from... 9925 * strace.c (enum trace_event): ...here. 9926 (#include "trace_event.h"): New header, for enum trace_event. 9927 * Makefile.am (strace_SOURCES): Add trace_event.h. 9928 9929 2018-01-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9930 9931 Call get_scno during startup_tcb only for forcibly attached processes. 9932 Otherwise it makes little sense on most arches to try to get syscall 9933 number. 9934 9935 * defs.h (TCB_GRABBED): New tcb flag. 9936 * strace.c (attach_tcb): Set TCB_GRABBED for the tcb. 9937 (startup_tcb): Call get_scno() only if process is grabbed and its 9938 registers may contain syscall number information. 9939 9940 Reported-by: Dmitry V. Levin <ldv (a] altlinux.org> 9941 Closes: https://github.com/strace/strace/issues/22 9942 9943 2018-01-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9944 9945 strace.c: sort getopt switch branches alphabetically. 9946 There's no reason to have them out of order. This also (almost) matches 9947 their order in the getopt call argument, introduced in 9948 v4.20-64-g61c03be. 9949 9950 * strace.c (init): Sort branches in the getopt switch routine. 9951 9952 2018-01-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9953 9954 strace.c: check for (non)zero argc instead of argv[0] 9955 Since we can never be sure that we have NULL behind the last entry of 9956 the argv array. 9957 9958 * strace.c (init): Check for non-zero argc before/instead of argv[0]. 9959 9960 2018-01-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 9961 9962 strace.1: advertise strace-log-merge. 9963 In order to raise awareness about strace-log-merge, mention it in 9964 SEE ALSO section and -ff option description. 9965 9966 * strace.1.in (.SS Filtering) <.TP .B \-ff>: Mention strace-log-merge. 9967 (.SH "SEE ALSO"): Likewise. 9968 9969 2017-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 9970 9971 unwind: demangle function arguments. 9972 * unwind.c (print_stack_frame): Specify demangling style. 9973 * tests/strace-k.test (result): Update regexp. 9974 * tests/strace-k-demangle.test (expected): Update expected output. 9975 9976 tests: check strace -k symbol names demangling. 9977 * tests/strace-k-demangle.test: New test. 9978 * tests/stack-fcall-mangled.c: New file. 9979 * tests/stack-fcall-mangled-0.c: Likewise. 9980 * tests/stack-fcall-mangled-1.c: Likewise. 9981 * tests/stack-fcall-mangled-2.c: Likewise. 9982 * tests/stack-fcall-mangled-3.c: Likewise. 9983 * tests/stack-fcall.h [MANGLE] (f0, f1, f2, f3): New macros. 9984 * tests/.gitignore: Add stack-fcall-mangled. 9985 * tests/Makefile.am (check_PROGRAMS): Likewise. 9986 (stack_fcall_mangled_SOURCES): New variable. 9987 (EXTRA_DIST): Add strace-k-demangle.test. 9988 [USE_LIBUNWIND && USE_DEMANGLE] (LIBUNWIND_TESTS): Likewise. 9989 9990 2017-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 9991 9992 tests: parametrize strace-k.test. 9993 Prepare for the check of strace -k symbol names demangling. 9994 9995 * tests/strace-k.test: Parametrize $test_prog and $expected. 9996 * tests/stack-fcall.h: New file. 9997 * tests/stack-fcall.c: Include "stack-fcall.h" 9998 * tests/stack-fcall-0.c: Likewise. 9999 * tests/stack-fcall-1.c: Likewise. 10000 * tests/stack-fcall-2.c: Likewise. 10001 * tests/stack-fcall-3.c: Likewise. 10002 * tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h. 10003 10004 2017-12-26 Masatake YAMATO <yamato (a] redhat.com> 10005 10006 unwind: demangle symbol names. 10007 Implement demangling of C++ symbol names in stack trace 10008 using cplus_demangle function from GNU libiberty library. 10009 10010 This is an example demangled stack trace output: 10011 10012 fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 10013 > /usr/lib64/libc-2.25.so(__fxstat64+0x12) [0xffd62] 10014 > /usr/lib64/libc-2.25.so(_IO_file_doallocate+0x5f) [0x717ff] 10015 > /usr/lib64/libc-2.25.so(_IO_doallocbuf+0x79) [0x81699] 10016 > /usr/lib64/libc-2.25.so(_IO_file_overflow+0x198) [0x807b8] 10017 > /usr/lib64/libc-2.25.so(_IO_file_xsputn+0xbd) [0x7ed5d] 10018 > /usr/lib64/libc-2.25.so(fwrite_unlocked+0x60) [0x7d800] 10019 > /usr/lib64/libleveldb.so.1.18(leveldb::EnvWrapper::StartThread+0x3b6) [0x48656] 10020 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::EmitPhysicalRecord+0x89) [0x28bc9] 10021 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::AddRecord+0x9e) [0x28d9e] 10022 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Write+0x208) [0x1ce18] 10023 > /usr/lib64/libleveldb.so.1.18(leveldb::DB::Put+0x59) [0x192b9] 10024 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Put+0x1d) [0x1931d] 10025 > /home/yamato/var/leveldb/doc/a.out(main+0x120) [0x1107] 10026 > /usr/lib64/libc-2.25.so(__libc_start_main+0xea) [0x2088a] 10027 > /home/yamato/var/leveldb/doc/a.out(_start+0x2a) [0xf3a] 10028 10029 * Makefile.am [USE_DEMANGLE] (strace_CPPFLAGS, strace_LDFLAGS, 10030 libiberty_LDADD): Append libiberty_CPPFLAGS, strace_LDFLAGS, and 10031 libiberty_LIBS, respectively. 10032 * configure.ac: Add --with-libiberty option. Check cplus_demangle 10033 support in libiberty. 10034 * unwind.c [USE_DEMANGLE]: Include <demangle.h>. 10035 (print_stack_frame) [USE_DEMANGLE]: Use cplus_demangle. 10036 10037 2017-12-26 Masatake YAMATO <yamato (a] redhat.com> 10038 10039 Define macros for renaming xmalloc and xcalloc. 10040 I'm planning to link strace with libiberty for mangling C++ 10041 symbol names in stack trace enabled with -k option. 10042 10043 Both names, xmalloc and xcalloc, are already defined and used 10044 in libiberty, and they conflict with functions in strace. 10045 Rename xmalloc and xcalloc functions defined in strace 10046 to strace_xmalloc and strace_xcalloc, respectively, 10047 to avoid this conflict. 10048 10049 * xmalloc.h (xcalloc, xmalloc): New macros. 10050 10051 2017-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 10052 10053 syscall: move a sparc specific include to an arch specific file. 10054 * syscall.c [SPARC64]: Do not include <asm/psrcompat.h>. 10055 [SPARC]: Do not include <asm/psr.h>. 10056 * linux/sparc/get_error.c: Include <asm/psr.h>. 10057 10058 syscall: move all ia64 specific includes to an arch specific file. 10059 * syscall.c [IA64]: Remove. 10060 * linux/ia64/get_syscall_args.c: Include <asm/rse.h>. 10061 10062 syscall: simplify get_syscall_result. 10063 * syscall.c [ptrace_getregset_or_getregs] (get_syscall_result_regs): 10064 Define to get_regs. 10065 (get_syscall_result): Use get_syscall_result_regs unconditionally. 10066 10067 2017-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 10068 10069 syscall: change get_regs argument type. 10070 This opens the way for future changes related to get_regs. 10071 10072 * syscall.c (get_regs): Change argument type from "pid_t" 10073 to "struct tcb *", all callers changed. 10074 10075 2017-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 10076 10077 syscall: move get_regs call from syscall_exiting_decode to get_syscall_result 10078 This make the code less confusing and opens the way for future changes 10079 related to get_regs. 10080 10081 * syscall.c (syscall_exiting_decode): Move get_regs invocation ... 10082 (get_syscall_result) [ptrace_getregset_or_getregs]: ... here. 10083 10084 2017-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 10085 10086 syscall: rework subcall decoding on mips o32. 10087 Move syscall subcall handling to the same switch statement that 10088 handles ipc and socket subcalls. 10089 10090 * linux/mips/syscallent-o32.h [LINUX_MIPSO32] (SYS_syscall_subcall): 10091 Define. 10092 * syscall.c (decode_mips_subcall): Rename to decode_syscall_subcall, 10093 conditionalize on SYS_syscall_subcall instead of LINUX_MIPSO32. 10094 (syscall_entering_decode) [LINUX_MIPSO32]: Remove. 10095 (syscall_entering_decode) [SYS_syscall_subcall]: Handle SEN_syscall 10096 using decode_syscall_subcall. 10097 10098 2017-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 10099 10100 syscall: tweak shuffle_scno ifdefery. 10101 * syscall.c (shuffle_scno): Check for ARM_FIRST_SHUFFLED_SYSCALL 10102 instead of ARM || AARCH64. This does not result to any code change 10103 but looks more comprehensible. 10104 10105 syscall: change get_regs to return an error code. 10106 * syscall.c (get_regs_error) [!ptrace_getregset_or_getregs]: Do not 10107 define. 10108 (clear_regs) [!ptrace_getregset_or_getregs]: Do not set get_regs_error. 10109 (get_regs) [ptrace_getregset_or_getregs]: Return get_regs_error, all 10110 callers changed to test get_regs return code instead of get_regs_error 10111 static variable, which is now internally used by get_regs() and 10112 clear_regs() only. 10113 (USE_GET_SYSCALL_RESULT_REGS): Do not define. 10114 Use "#ifndef ptrace_getregset_or_getregs" 10115 instead of "#ifdef USE_GET_SYSCALL_RESULT_REGS". 10116 10117 2017-12-24 Harsha Sharma <harshasharmaiitr (a] gmail.com> 10118 10119 tests: enhance run.sh usage error diagnostics. 10120 * tests/run.sh: Execute timeout command only when invoked with 10121 an argument, otherwise print an error message. 10122 10123 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10124 10125 tests: skip nsyscalls-d.test on mips o32. 10126 On mips o32, nsyscalls test is implemented using syscall #4000, 10127 so nsyscalls-d cannot work there. 10128 10129 * tests/nsyscalls-d.test: Skip on mips o32. 10130 10131 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10132 10133 Remove linux/ptp_clock.h. 10134 As linux kernel provides a compatible linux/ptp_clock.h header since 10135 commit v3.8-rc1~139^2~514, there is no need for a local copy. 10136 10137 * linux/ptp_clock.h: Remove. 10138 * Makefile.am (EXTRA_DIST): Remove it. 10139 * configure.ac (AC_CHECK_TYPES): Check for struct ptp_sys_offset 10140 in <linux/ptp_clock.h>. 10141 * ioctl.c (ioctl_decode) <case '='>: Conditionalize 10142 on [HAVE_STRUCT_PTP_SYS_OFFSET]. 10143 * ptp.c: Likewise. 10144 10145 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10146 10147 Remove linux/ubi-user.h. 10148 As linux kernel provides a compatible mtd/ubi-user.h header since 10149 commit v3.7-rc1~85^2~17, there is no need for a local copy. 10150 10151 * linux/ubi-user.h: Remove. 10152 * Makefile.am (EXTRA_DIST): Remove it. 10153 * configure.ac (AC_CHECK_MEMBERS): Check 10154 for struct ubi_attach_req.max_beb_per1024 in <mtd/ubi-user.h>. 10155 * ioctl.c (ioctl_decode) <case 'o', case 'O'>: Conditionalize 10156 on HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024. 10157 * ubi.c: Likewise. 10158 10159 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10160 10161 Remove linux/mtd-abi.h. 10162 As linux kernel provides a compatible mtd/mtd-abi.h header since 10163 commit v3.2-rc1~14^2~33, there is no need for a local copy. 10164 10165 * linux/mtd-abi.h: Remove. 10166 * Makefile.am (EXTRA_DIST): Remove it. 10167 * configure.ac (AC_CHECK_TYPES): Check for struct mtd_write_req 10168 in <mtd/mtd-abi.h>. 10169 * ioctl.c (ioctl_decode) <case 'M'>: Conditionalize 10170 on [HAVE_STRUCT_MTD_WRITE_REQ]. 10171 * mtd.c: Likewise. 10172 * tests/ioctl_mtd.c: Likewise. 10173 * tests/ioctl.c (main): Likewise. 10174 10175 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10176 10177 Remove linux/personality.h. 10178 * linux/personality.h: Remove. 10179 * Makefile.am (EXTRA_DIST): Remove it. 10180 * personality.c: Do not include <linux/personality.h>, include 10181 "xlat/personality_flags.h" before "xlat/personality_types.h". 10182 * xlat/personality_flags.in: Provide fallback definitions. 10183 * xlat/personality_types.in: Likewise. 10184 10185 2017-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 10186 10187 travis: switch from clang-3.8 to clang. 10188 As travis provides a relatively fresh clang by default nowadays, 10189 it makes sense to use default clang in clang-based test builds. 10190 10191 * .travis.yml (matrix): Change clang-3.8 to clang. 10192 10193 2017-12-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10194 10195 strace.1.in: mention perf and ftrace in SEE ALSO. 10196 * strace.1.in (.SH SEE ALSO): Add references to perf-trace(1) and 10197 trace-cmd(1). 10198 10199 strace.1.in: clarify -F option behaviour. 10200 * strace.1.in <.TP \-F>: Extend deprecation warning. Describe behaviour 10201 of multiple instances of -F and interoperability of -F and -f. 10202 10203 2017-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 10204 10205 tests: consistently use $STRACE_EXE instead of local alternatives. 10206 * tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE". 10207 * tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE". 10208 * tests/syntax.sh: Likewise. 10209 10210 2017-12-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10211 Dmitry V. Levin <ldv (a] altlinux.org> 10212 10213 strace.c: inform the user about -F option obsolescence. 10214 * strace.c (init): Print an error message if the option is used. 10215 10216 2017-12-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10217 10218 strace.c: sort option arguments alphabetically. 10219 Except for the ones that enabled by configure options. 10220 10221 While we are here, let's also change the indentation of while expression 10222 continuation in order to separate it from the following switch clause. 10223 10224 * strace.c (init): Reorder options in getopt() call. 10225 10226 2017-12-20 Eugene Syromiatnikov <esyr (a] redhat.com> 10227 10228 strace.c: use _exit() instead of exit() in child's die() 10229 Let's keep child's death routine as minimalistic as possible for the 10230 cases when vfork() is used instead of fork() on systems that lack MMU. 10231 10232 * strace.c (die) <!(strace_tracer_pid == getpid())>: Call _exit(). 10233 10234 2017-12-20 Harsha Sharma <harshasharmaiitr (a] gmail.com> 10235 10236 syscall: replace if (debug_flag) ... with debug_msg macro. 10237 * syscall.c (get_scno): Use debug_msg instead of 10238 "if (debug_flag) error_msg". 10239 10240 2017-12-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10241 10242 tests: check (some) debugging output generated during nsyscalls test. 10243 * tests/nsyscalls-d.c: New file. 10244 * tests/.gitignore: Add it. 10245 * tests/nsyscalls-d.test: New test, variant of nsyscalls.test with debug 10246 output check. 10247 * tests/nsyscalls-nd.test: Likewise. 10248 * tests/nsyscalls.c: Add expected debug output. 10249 * tests/Makefile.am (check_PROGRAMS): Add nsyscalls-d. 10250 (DECODER_TESTS): Add nsyscalls-d.test and nsyscalls-nd.test. 10251 10252 2017-12-20 Eugene Syromiatnikov <esyr (a] redhat.com> 10253 10254 pathtrace.c: use xgrowarray. 10255 * defs.h <struct path_set>: Change type of num_selected field to size_t. 10256 Add size field. 10257 * pathtrace.c (storepath): Rewrite to utilise xgrowarray. 10258 10259 2017-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 10260 10261 dyxlat: use xgrowarray. 10262 * dyxlat.c (dyxlat_alloc): Use xgrowarray instead of xcalloc. 10263 (dyxlat_add_pair): Use xgrowarray instead of xreallocarray. 10264 10265 unwind: use xgrowarray. 10266 * unwind.c (get_symbol_name): Use xgrowarray instead of manual 10267 dynamic array management using xreallocarray. 10268 10269 2017-12-14 Eugene Syromiatnikov <esyr (a] redhat.com> 10270 10271 strace.c: use xgrowarray. 10272 * strace.c (tcbtabsize): Change type to size_t. 10273 (expand_tcbtab): Rewrite in order to utilise xgrowarray 10274 instead of manual dynamic array management. 10275 10276 unwind: use xgrowarray. 10277 * unwind.c (build_mmap_cache): Use xgrowarray instead of manual dynamic 10278 array management. 10279 10280 2017-12-14 Eugene Syromiatnikov <esyr (a] redhat.com> 10281 10282 xmalloc.c: introduce xgrowarray helper function. 10283 In order to simplify dynamic array management code. 10284 10285 * xmalloc.h (xgrowarray): New declaration. 10286 * xmalloc.c (xgrowarray): New function. 10287 10288 2017-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 10289 10290 tests: check error diagnostics when exec file name is too long. 10291 * tests/options-syntax.test: Check error diagnostics when 10292 exec file name length equals to PATH_MAX. 10293 10294 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10295 10296 strace.c: minor style fixes. 10297 * strace.c (test_ptrace_seize): Remove excess braces. 10298 (init): Wrap overly long string literal. Add braces 10299 to the else if branch. 10300 10301 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10302 10303 strace.c: use *_func_* message printing macros where appropriate. 10304 In order to provide some additional bits of information in weird error 10305 cases or just replace existing usages of __func__/literal function name. 10306 10307 * strace.c (detach): Use perror_func_msg() instead of perror_msg(). 10308 (startup_attach, open_dummy_desc, startup_child, test_ptrace_seize): Use 10309 perror_func_msg_and_die() instead of perror_msg_and_die(). 10310 (test_ptrace_seize): Use error_func_msg_and_die() instead of 10311 error_msg_and_die(). 10312 10313 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10314 10315 unwind.c: more verbose mapping overlapping diagnostic message. 10316 * unwind.c (build_mmap_cache): Change error_msg() to debug_msg(), add 10317 information about region names and the respective start and end 10318 addresses. 10319 10320 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10321 10322 unwind.c: non-fatal handling of asprintf error. 10323 An error returned by asprintf is a poor excuse for dying. 10324 10325 * unwind.c (asprintf_error_str): New string constant. 10326 (sprint_call_or_error): Replace error_msg_and_die() with 10327 perror_func_msg() and usage of asprintf_error_str for a return value. 10328 (queue_print): Free tmp->output line only if it is not 10329 asprintf_error_str. 10330 10331 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10332 10333 unwind.c: eliminate DPRINTF. 10334 Since DPRINTF is simply a macro that provides debugging information 10335 along with some information about printing routine call site, now standard 10336 debug_func_* macros are deemed to be a suitable replacement. 10337 10338 * unwind.c (DPRINTF): Remove. 10339 (build_mmap_cache, delete_mmap_cache, unwind_cache_invalidate, 10340 unwind_print_stacktrace, unwind_captiure_stacktrace): Replace 10341 DPRINTF(fmt, str, ...) with debug_func_msg(fmt, ...)/ 10342 10343 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10344 10345 strace.c: replace if (debug_flag) ... with suitable debug printing macros 10346 * strace.c (alloc_tcb, droptcb, detach, attach_tcb, test_ptrace_seize, 10347 init, startup_tcb): Replace if (debug_flag) error_msg(...) occurrences 10348 with debug_error_msg(...). 10349 (attach_tcb): Replace if (debug_flag) perror_msg(...) with 10350 debug_perror_msg(...). 10351 (cleanup, startup_tcb): Replace if (debug_flag) error_msg(...) 10352 occurrences with debug_func_msg() in attempt to provide additional 10353 information. 10354 10355 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10356 10357 error_prints.h: add *_func_* printing macros. 10358 In order to reduce boilerplate for the cases when __func__ is desired 10359 to be printed. 10360 10361 * error_prints.h (error_func_msg, perror_func_msg, debug_func_msg, 10362 debug_func_perror_msg, error_func_msg_and_die, perror_func_msg_and_die): 10363 New macro definitions. 10364 10365 2017-12-13 Eugene Syromiatnikov <esyr (a] redhat.com> 10366 10367 error_prints.h: add debug print macros. 10368 * defs.h (debug_flag): Move the declaration... 10369 * error_prints.h (debug_flag): ... here. 10370 (debug_msg, debug_perror_msg): New macro definitions. 10371 Include <stdbool.h> for the debug_flag declaration. 10372 10373 2017-12-04 Masatake YAMATO <yamato (a] redhat.com> 10374 Dmitry V. Levin <ldv (a] altlinux.org> 10375 10376 tests: check decoding of KVM ioctl commands. 10377 * tests/ioctl_kvm_run.c: New file. 10378 * tests/ioctl_kvm_run.test: New test. 10379 * tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test. 10380 * tests/pure_executables.list: Add ioctl_kvm_run. 10381 * tests/.gitignore: Likewise. 10382 10383 2017-12-04 Masatake YAMATO <yamato (a] redhat.com> 10384 10385 kvm: decode the argument of KVM_{SET, GET}_SREGS ioctl command. 10386 * configure.ac (AC_CHECK_TYPES): Add struct kvm_sregs. 10387 * kvm.c [HAVE_STRUCT_KVM_SREGS] (kvm_ioctl_decode_sregs): New function. 10388 (kvm_ioctl) [HAVE_STRUCT_KVM_SREGS] <KVM_SET_SREGS, KVM_GET_SREGS>: 10389 Use it. 10390 * linux/arch_kvm.c (arch_print_kvm_sregs): New function. 10391 * linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): New macro. 10392 (kvm_ioctl_decode_regs_dtable, kvm_ioctl_decode_regs_segment, 10393 arch_print_kvm_sregs): New functions. 10394 10395 kvm: decode the argument of KVM_{SET, GET}_REGS ioctl command. 10396 * configure.ac (AC_CHECK_TYPES): Add struct kvm_regs. 10397 * linux/arck_kvm.c: New file. 10398 * linux/x86_64/arch_kvm.c: Likewise. 10399 * linux/i386/arch_kvm.c: Likewise. 10400 * linux/x32/arch_kvm.c: Likewise. 10401 * Makefile.am (EXTRA_DIST): Add them. 10402 * kvm.c: Include "arch_kvm.c". 10403 [HAVE_STRUCT_KVM_REGS] (kvm_ioctl_decode_regs): New function. 10404 (kvm_ioctl) [HAVE_STRUCT_KVM_REGS] <KVM_SET_REGS, KVM_GET_REGS>: Use it. 10405 10406 kvm: decode the argument of KVM_SET_USER_MEMORY_REGION ioctl command. 10407 * configure.ac (AC_CHECK_TYPES): Add struct kvm_userspace_memory_region. 10408 * xlat/kvm_mem_flags.in: New file. 10409 * kvm.c: Include print_fields.h. 10410 [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]: Include xlat/kvm_mem_flags.h, 10411 (kvm_ioctl_set_user_memory_region): New function. 10412 (kvm_ioctl) [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION] 10413 <KVM_SET_USER_MEMORY_REGION>: Use it. 10414 10415 2017-12-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10416 10417 Add strace mascot. 10418 * strace.svg: New file. 10419 10420 Co-Authored-by: Vitaly Chaykovsky <mgspeker (a] gmail.com> 10421 10422 2017-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 10423 10424 tests: robustify attach-p-cmd.test against buggy kernels. 10425 From time to time various kernels, old and new, just go nuts 10426 and fail attach-p-cmd.test with the following diagnostics: 10427 10428 12345 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} --- 10429 -12345 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or directory) 10430 +12345 syscall_4294967295(0xffe60934, 0x1c0, 0xffe60934, 0x1, 0xffe609b4, 0xffe60a58) = -1 (errno 38) 10431 +12345 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented) 10432 10433 Let's workaround this kernel madness by rewriting the test 10434 without use of SIGALRM. 10435 10436 * tests/attach-p-cmd.h: New file. 10437 * tests/Makefile.am (EXTRA_DIST): Add attach-p-cmd.h. 10438 * tests/attach-p-cmd-cmd.c: Include "attach-p-cmd.h". 10439 (write_pidfile, wait_for_peer_invocation): New functions. 10440 (main): Use them. 10441 * tests/attach-p-cmd-p.c: Include <time.h> and "attach-p-cmd.h". 10442 (wait_for_peer_invocation, wait_for_peer_termination): New functions. 10443 (main): Use them. Do not raise SIGALRM, use nanosleep after peer 10444 termination. 10445 10446 2017-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 10447 10448 tests: robustify ipc_msgbuf.test against broken libc. 10449 glibc between commits glibc-2.25~130 and glibc-2.26~740 had broken 10450 msgctl(IPC_RMID) on hppa: this operation always failed with EINVAL 10451 because of inappropriate use of IPC_64 flag. Similar issues were 10452 fixed on other niche architectures. Let's workaround these issues 10453 by skipping the test in case of msgctl(IPC_RMID) failure. 10454 10455 * tests/ipc_msgbuf.c (cleanup): Change return type to int, 10456 return 77 in case of msgctl(IPC_RMID) failure. 10457 (main): Explicitly invoke cleanup() at the end. 10458 10459 2017-12-01 Masatake YAMATO <yamato (a] redhat.com> 10460 10461 kvm: decode the argument of KVM_CREATE_VCPU ioctl command. 10462 * kvm.c (kvm_ioctl_create_vcpu): New function. 10463 (kvm_ioctl) <KVM_CREATE_VCPU>: Use it. 10464 10465 kvm: handle KVM_CREATE_VM ioctl command. 10466 * kvm.c (kvm_ioctl): Handle KVM_CREATE_VM command. 10467 10468 kvm: handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, and KVM_GET_API_VERSION ioctl commands 10469 * kvm.c (kvm_ioctl): Handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, 10470 and KVM_GET_API_VERSION commands. 10471 10472 ioctl: add a stub for decoding kvm related ioctls. 10473 * kvm.c: New file. 10474 * Makefile.am (strace_SOURCES): Add it. 10475 * configure.ac (AC_CHECK_HEADERS): Add linux/kvm.h. 10476 * defs.h (kvm_ioctl): New prototype. 10477 * ioctl.c (ioctl_decode) HAVE_LINUX_KVM_H]: Use kvm_ioctl. 10478 10479 2017-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10480 10481 strace-log-merge: work around corner cases of strace -ttt parsing. 10482 Employing strace -ttt for the logs destined to be fed to 10483 strace-log-merge is ultimately the best solution except for the logs 10484 that pass the following dates: 10485 10486 Thu Jan 1 00:00:09 UTC 1970 10487 Thu Jan 1 00:01:39 UTC 1970 10488 Thu Jan 1 00:16:39 UTC 1970 10489 Thu Jan 1 02:46:39 UTC 1970 10490 Fri Jan 2 03:46:39 UTC 1970 10491 Mon Jan 12 13:46:39 UTC 1970 10492 Sun Apr 26 17:46:39 UTC 1970 10493 Sat Mar 3 09:46:39 UTC 1973 10494 Sun Sep 9 01:46:39 UTC 2001 10495 Sat Nov 20 17:46:39 UTC 2286 10496 Wed Nov 16 09:46:39 UTC 5138 10497 Fri Sep 27 01:46:39 UTC 33658 10498 Sun May 20 17:46:39 UTC 318857 10499 Sat Nov 7 09:46:39 UTC 3170843 10500 Sun Jul 5 01:46:39 UTC 31690708 10501 Sat Jan 25 17:46:39 UTC 316889355 10502 10503 Let's lift this limitation. 10504 10505 * strace-log-merge: Generate numeric-only key for sorting, use sort -n 10506 option. 10507 10508 2017-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10509 10510 debian: add strace-log-merge to the list of installed files. 10511 * debian/strace.install: Add strace-log-merge. 10512 10513 Add strace-log-merge man page. 10514 * strace-log-merge.1.in: New file. 10515 * NEWS: Mention this. 10516 * .gitignore: Add strace-log-merge.1. 10517 * Makefile.am (man_MANS): Likewise. 10518 * configure.ac (AC_CONFIG_FILES): Likewise. 10519 * debian/strace.manpages: Likewise. 10520 10521 strace-log-merge: add copyright header. 10522 10523 2017-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 10524 10525 Add initial GitLab CI support. 10526 * .gitlab-ci.yml: New file. 10527 * travis-build.sh: Print $CC -print-multi-lib. Print config.log 10528 in case of configure failure. 10529 * travis-install.sh: Check sudo availability. Install autoconf, 10530 automake, file, gawk, gcc-multilib, git, gzip, make, and xz-utils 10531 for all targets. 10532 (musl-gcc): Install ca-certificates. 10533 10534 2017-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 10535 10536 mpers: fix cross-compiling. 10537 In cross builds, a target version of readelf has to be used 10538 instead of a native one. 10539 10540 * configure.ac (AC_CHECK_TOOL): Add readelf. 10541 * Makefile.am (READELF): New variable. 10542 (mpers-m%.stamp): Pass it to $(srcdir)/mpers.sh. 10543 * m4/mpers.m4 (st_MPERS): Pass READELF environment variable 10544 to $srcdir/mpers_test.sh. 10545 * mpers.sh (READELF): New variable. 10546 Use it instead of readelf. 10547 * maint/ioctls_sym.sh: Likewise. 10548 * NEWS: Mention this fix. 10549 10550 Reported-by: Rolf Eike Beer <eb (a] emlix.com> 10551 10552 2017-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 10553 10554 tests: fix llseek test. 10555 * tests/llseek.test: Fix typo. 10556 10557 INSTALL-git.md: fix typo. 10558 10559 tests: simplify bpf test a bit. 10560 * tests/bpf.c (DEF_BPF_INIT_FIRST): New macro. 10561 (init_BPF_MAP_CREATE_first, init_BPF_MAP_LOOKUP_ELEM_first, 10562 init_BPF_PROG_LOAD_first, init_BPF_OBJ_PIN_first, 10563 init_BPF_PROG_ATTACH_first, init_BPF_PROG_TEST_RUN_first, 10564 init_BPF_PROG_GET_NEXT_ID_first, init_BPF_OBJ_GET_INFO_BY_FD_first): 10565 Use it. 10566 10567 2017-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 10568 10569 Implement decoding of BPF_OBJ_GET_INFO_BY_FD command of bpf syscall. 10570 * configure.ac (AC_CHECK_MEMBERS): Add union bpf_attr.info.info. 10571 * bpf.c (decode_BPF_OBJ_GET_INFO_BY_FD): New function. 10572 (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it. 10573 * NEWS: Mention this. 10574 * tests/bpf.c: Add macro guard for BPF_OBJ_GET_INFO_BY_FD decoder test. 10575 [HAVE_UNION_BPF_ATTR_INFO_INFO] (sample_BPF_OBJ_GET_INFO_BY_FD_attr): 10576 New variable. 10577 [HAVE_UNION_BPF_ATTR_INFO_INFO] (init_BPF_OBJ_GET_INFO_BY_FD_first, 10578 print_BPF_OBJ_GET_INFO_BY_FD_first, init_BPF_OBJ_GET_INFO_BY_FD_attr, 10579 print_BPF_OBJ_GET_INFO_BY_FD_attr): New functions. 10580 (main) [HAVE_UNION_BPF_ATTR_INFO_INFO]: Use them. 10581 10582 Simplify union bpf_attr field checks. 10583 * configure.ac: Use AC_CHECK_MEMBERS instead of st_CHECK_UNION_BPF_ATTR 10584 for union bpf_attr field checks as the former seems to be enough 10585 for the case. 10586 * m4/st_bpf.m4: Remove. 10587 10588 Implement decoding of BPF_*_GET_*_ID commands of bpf syscall. 10589 * configure.ac: Check for union bpf_attr.next_id. 10590 * bpf.c (decode_BPF_PROG_GET_NEXT_ID, decode_BPF_PROG_GET_FD_BY_ID, 10591 * decode_BPF_MAP_GET_FD_BY_ID): New functions. 10592 (decode_BPF_MAP_GET_NEXT_ID): New macro. 10593 (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use them. 10594 * NEWS: Mention this. 10595 * tests/bpf.c: Add macro guard for BPF_*_GET_*_ID decoder tests. 10596 [HAVE_UNION_BPF_ATTR_NEXT_ID] (init_BPF_PROG_GET_NEXT_ID_first, 10597 print_BPF_PROG_GET_NEXT_ID_first, init_BPF_PROG_GET_NEXT_ID_attr, 10598 print_BPF_PROG_GET_NEXT_ID_attr, print_BPF_PROG_GET_FD_BY_ID_first, 10599 print_BPF_PROG_GET_FD_BY_ID_attr, print_BPF_MAP_GET_NEXT_ID_first, 10600 print_BPF_MAP_GET_NEXT_ID_attr): New functions. 10601 (init_BPF_MAP_GET_NEXT_ID_first, print_BPF_MAP_GET_NEXT_ID_first, 10602 init_BPF_MAP_GET_NEXT_ID_attr, print_BPF_MAP_GET_NEXT_ID_attr, 10603 init_BPF_PROG_GET_FD_BY_ID_first, init_BPF_PROG_GET_FD_BY_ID_attr, 10604 init_BPF_MAP_GET_FD_BY_ID_first, init_BPF_MAP_GET_FD_BY_ID_attr): 10605 New macros. 10606 (main) [HAVE_UNION_BPF_ATTR_NEXT_ID]: Use them. 10607 10608 2017-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 10609 10610 Implement decoding of BPF_PROG_TEST_RUN command of bpf syscall. 10611 * configure.ac: Check for union bpf_attr.test.duration. 10612 * bpf.c (decode_BPF_PROG_TEST_RUN): New function. 10613 (SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it. 10614 * NEWS: Mention this. 10615 * tests/bpf.c: Include "print_fields.h". 10616 Add macro guard for BPF_PROG_TEST_RUN decoder test. 10617 [HAVE_UNION_BPF_ATTR_TEST_DURATION] (sample_BPF_PROG_TEST_RUN_attr): 10618 New variable. 10619 [HAVE_UNION_BPF_ATTR_TEST_DURATION] (init_BPF_PROG_TEST_RUN_first, 10620 print_BPF_PROG_TEST_RUN_first, init_BPF_PROG_TEST_RUN_attr, 10621 print_BPF_PROG_TEST_RUN_attr): New functions. 10622 (main) [HAVE_UNION_BPF_ATTR_TEST_DURATION]: Use them. 10623 10624 2017-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 10625 10626 bpf: update BPF_MAP_CREATE decoding. 10627 Implement decoding of union bpf_attr.numa_node field for BPF_MAP_CREATE 10628 command introduced by linux kernel commit v4.14-rc1~130^2~196^2~1. 10629 10630 * configure.ac: Check for numa_node member of union bpf_attr 10631 instead of inner_map_fd. 10632 (decode_BPF_MAP_CREATE): Add numa_node field to the structure, print it. 10633 * NEWS: Mention this. 10634 * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test. 10635 (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected 10636 output. 10637 (init_BPF_MAP_CREATE_attr): Initialize numa_node field, update offset. 10638 10639 2017-11-20 Eugene Syromiatnikov <esyr (a] redhat.com> 10640 10641 unwind.c: cleanup. 10642 * unwind.c (rebuild_cache_if_invalid): Simplify return statement. 10643 10644 unwind.c: fix typo in comment. 10645 * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, 10646 unwind_capture_stacktrace): Replace strack with stack. 10647 10648 2017-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 10649 10650 ipc_shm: decode hugetlb page size in shmget flags. 10651 Decode alternative hugetlb page sizes introduced by kernel commit 10652 v3.8-rc1~175^2~36. 10653 10654 * ipc_shm.c [!SHM_HUGE_SHIFT] (SHM_HUGE_SHIFT): New macro. 10655 [!SHM_HUGE_MASK] (SHM_HUGE_MASK): Likewise. 10656 (SYS_FUNC(shmget)): Print hugetlb page size. 10657 * tests/ipc_shm.c: Check it. 10658 10659 2017-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 10660 10661 memfd_create: decode hugetlb page size. 10662 Decode alternative hugetlb page sizes introduced by kernel commit 10663 v4.14-rc1~126^2~17. 10664 10665 * configure.ac (AC_CHECK_HEADERS): Add linux/memfd.h. 10666 * memfd_create.c [HAVE_LINUX_MEMFD_H]: Include it. 10667 [!MFD_HUGE_SHIFT] (MFD_HUGE_SHIFT): New macro. 10668 [!MFD_HUGE_MASK] (MFD_HUGE_MASK): Likewise. 10669 (SYS_FUNC(memfd_create)): Print hugetlb page size. 10670 * tests/memfd_create.c: Check it. 10671 10672 2017-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 10673 10674 Print the first argument of memfd_create syscall as a path. 10675 The limit imposed by the kernel on the length of memfd_create first 10676 argument is NAME_MAX - strlen("memfd:"). 10677 10678 * memfd_create.c (SYS_FUNC(memfd_create)): Print the first argument 10679 using printpathn. 10680 * tests/memfd_create.c: Check it. 10681 10682 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10683 10684 mem: decode hugetlb page size in mmap flags. 10685 Decode alternative hugetlb page sizes introduced by kernel commit 10686 v3.8-rc1~175^2~36. 10687 10688 * mem.c [!MAP_HUGE_SHIFT] (MAP_HUGE_SHIFT): New macro. 10689 [!MAP_HUGE_MASK] (MAP_HUGE_MASK): Likewise. 10690 (print_mmap_flags): Print hugetlb page size. 10691 * NEWS: Mention it. 10692 * tests/remap_file_pages.c: Check it. 10693 10694 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10695 10696 mem: assume that MAP_TYPE is defined. 10697 Since linux kernel provided a definition of MAP_TYPE in <asm/mman.h> 10698 as long ago as in v2.4.0, it's safe to assume that MAP_TYPE is defined. 10699 10700 * mem.c (print_mmap_flags) [!MAP_TYPE]: Remove. 10701 10702 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10703 10704 mem: move printing of mmap_flags to a separate function. 10705 * mem.c (print_mmap_flags): New function. 10706 (print_mmap, SYS_FUNC(remap_file_pages)): Use it. 10707 10708 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10709 10710 Provide fallback definitions for SHM_EXEC constant. 10711 Although SHM_EXEC is available in <linux/shm.h> since kernel commit 10712 v2.6.9-rc2~23^2~93^2~78, the glibc version of <sys/shm.h> did not 10713 provide SHM_EXEC until commit glibc-2.10~238. 10714 10715 * xlat/shm_flags.in (SHM_EXEC): Add fallback definition. 10716 * tests/shmxt.c (SHM_EXEC): Likewise. 10717 10718 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10719 10720 Update SHM_* constants. 10721 * xlat/shm_flags.in: Add SHM_EXEC introduced by kernel commit 10722 v2.6.9-rc2~23^2~93^2~78. 10723 * xlat/shm_resource_flags.in: Add SHM_NORESERVE introduced by kernel 10724 commit v2.6.15-rc1~622. 10725 * NEWS: Mention this. 10726 * tests/ipc_shm.c (main): Update expected output. 10727 * tests/shmxt.c (main): Update expected output, check SHM_EXEC decoding. 10728 10729 2017-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 10730 10731 Remove fallback definitions for SHM_STAT and SHM_INFO constants. 10732 These constants are universally available for quite a long time 10733 and are used unconditionally in tests without any complaints. 10734 10735 * xlat/shmctl_flags.in: Remove fallback definitions. 10736 10737 2017-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 10738 10739 net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding. 10740 NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests 10741 not just a single integer but an array of integers. The kernel also 10742 supports a zero optlen NETLINK_LIST_MEMBERSHIPS request. 10743 10744 * net.c (print_uint32): New function. 10745 (print_getsockopt): Add ulen argument, rename len argument to rlen, 10746 <SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array 10747 and print_uint32. 10748 (SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt. 10749 * tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS 10750 decoding. 10751 10752 2017-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 10753 10754 tests: check [gs]etsockopt SOL_NETLINK decoding. 10755 * tests/sockopt-sol_netlink.c: New file. 10756 * tests/gen_tests.in (sockopt-sol_netlink): New entry. 10757 * tests/pure_executables.list: Add sockopt-sol_netlink. 10758 * tests/.gitignore: Likewise. 10759 10760 2017-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 10761 10762 net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK. 10763 Tweak the parser to follow the kernel behaviour. 10764 10765 * net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and 10766 print returned value as integer iff the length is >= sizeof(int), 10767 otherwise print the address. 10768 * NEWS: Mention this. 10769 10770 2017-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 10771 10772 net: decode optname argument of [gs]etsockopt for SOL_NETLINK level. 10773 * xlat/socknetlinkoptions.in: New file. 10774 * net.c: Include "xlat/socknetlinkoptions.h". 10775 (print_sockopt_fd_level_name) <SOL_NETLINK>: Print name using 10776 socknetlinkoptions. 10777 * NEWS: Metnion this. 10778 10779 Update MSG_* constants. 10780 * xlat/msg_flags.in: Add MSG_ZEROCOPY introduced by kernel commit 10781 v4.14-rc1~130^2~376^2~6. 10782 * NEWS: Mention this. 10783 10784 netlink: print descriptor attributes using printfd. 10785 * nlattr.h (DECL_NLA(fd)): New prototype. 10786 * nlattr.c (decode_nla_fd): New function. 10787 * rtnl_link.c (ifla_xdp_nla_decoders) <IFLA_XDP_FD>: Use it. 10788 (ifinfomsg_nla_decoders) <IFLA_NET_NS_FD>: Likewise. 10789 * rtnl_nsid.c (rtgenmsg_nla_decoders) <NETNSA_FD>: Likewise. 10790 * NEWS: Mention this. 10791 10792 2017-11-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10793 10794 maint/update_copyright_years.sh: implement concurrent execution. 10795 Analogous to the way it is done in xlat/gen.sh. 10796 10797 * maint/update_copyright_years.sh (MAX_JOBS): New variable, initialize 10798 it to double the CPU count. 10799 <while [ -n "${1:-}" ]; do case "$1" in>: Add -j option parsing. 10800 (jobs, pids): New variables. 10801 <git ls-files -- "$@" | grep -vFx "$IGNORED_FILES" | while read f; do>: 10802 Execute process_file in background, count background jobs and wait 10803 if there are too many. 10804 10805 2017-11-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10806 10807 maint/update_copyright_years.sh: use -efu shell mode. 10808 * maint/update_copyright_years.sh: Add -efu to shebang. Adjust 10809 the script for -efu shell mode. 10810 10811 2017-11-14 Dmitry V. Levin <ldv (a] altlinux.org> 10812 10813 Post-release administrivia. 10814 * NEWS: Add a header line for the next release. 10815 * debian/changelog.in: Add a changelog entry for 4.20-1. 10816 * strace.spec.in: Likewise. 10817 10818 2017-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 10819 10820 Prepare for 4.20 release. 10821 * NEWS: Update for 4.20 release. 10822 10823 CREDITS.in: remove entries listed by maint/gen-contributors-list.sh. 10824 10825 2017-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10826 10827 Makefile.am: use gen-contributors-list.sh for CREDITS. 10828 * Makefile.am ($(srcdir)/CREDITS): Employ maint/gen-contributors-list.sh 10829 for the contributor list generation. 10830 10831 2017-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10832 10833 maint: make gen-contributors-list.sh suitable for generation of CREDITS. 10834 Implement various features in order to make it suitable for the 10835 generation of the CREDITS file: 10836 - add an option for including contributor e-mail; 10837 - add an option to read additional list of contributors from stdin; 10838 - add shorthand for referring to the initial commit of the branch; 10839 - document all of the above in a help message. 10840 10841 * maint/gen-contributors-list.sh (print_help): New function. 10842 (script): Rename to SCRIPT. 10843 (SCRIPT_NORM_EMAILS, MATCH_OUT, OUT_EMAILS, OUT_NO_EMAILS, read_stdin, 10844 include_email): New variables. 10845 Add parsing of options, rewrite input processing. 10846 10847 2017-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 10848 10849 .mailmap: add more entries to avoid duplication in CREDITS. 10850 10851 .mailmap: sort entries. 10852 10853 2017-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10854 10855 .mailmap: more deduplication. 10856 Of course there are no two persons in the whole world that share 10857 the same name. 10858 10859 2017-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 10860 10861 CREDITS.in: use UTF-8 consistently. 10862 In particular, do not use " symbols in names. 10863 10864 2017-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10865 10866 CREDITS.in: add Jiri Slaby as a contributor. 10867 Unfortunately, he wasn't mentioned in the message of the commit 10868 v4.19-68-g48cb633, so let's fix that omission. 10869 10870 References: https://github.com/strace/strace/pull/16 10871 10872 2017-11-13 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 10873 10874 s390, s390x: update ioctl entries from linux 4.14. 10875 * linux/s390/ioctls_arch0.h: Update from linux v4.14 using ioctls_gen.sh. 10876 * linux/s390x/ioctls_arch0.h: Likewise. 10877 10878 s390x: remove some of non-s390 KVM ioctls. 10879 * linux/s390x/ioctls_arch0.h: Regenerate. 10880 10881 maint: remove KVM_PPC_CONFIGURE_V3_MMU ioctl from non-powerpc arches. 10882 * maint/ioctls_sym.sh (ppc_list): Update. 10883 10884 2017-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 10885 10886 Update copyright headers. 10887 Headers updated semi-automatically using 10888 maint/update_copyright_years.sh script. 10889 10890 * m4/mpers.m4: Update copyright years. 10891 * tests/kcmp.c: Likewise. 10892 * tests/membarrier.c: Likewise. 10893 10894 2017-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 10895 10896 maint/update_copyright_years.sh: fix typo in help output. 10897 * maint/update_copyright_years.sh (print_help): Fix typo, disable 10898 here-document expansion. 10899 10900 2017-11-10 Eugene Syromiatnikov <esyr (a] redhat.com> 10901 10902 Move MIN, MAX, and CLAMP to macros.h. 10903 We shouldn't have to include the whole defs.h to get them. 10904 10905 * defs.h (MIN, MAX, CLAMP): Move ... 10906 * macros.h: ... here. 10907 10908 2017-11-10 Eugene Syromiatnikov <esyr (a] redhat.com> 10909 10910 Update .mailmap. 10911 * .mailmap (Eugene Syromyatnikov): Add work address. 10912 10913 2017-11-07 Steve McIntyre <steve (a] einval.com> 10914 10915 debian: update debhelper compat level to 10, replace -s with -a in some calls 10916 10917 debian: update Standards-Version to 3.9.8. 10918 10919 2017-11-06 Dmitry V. Levin <ldv (a] altlinux.org> 10920 10921 mpers.m4: check for size of long and kernel_long_t. 10922 The primary purpose of this new check is diagnostics. 10923 10924 * m4/mpers.m4 (st_MPERS): Check for size of long and kernel_long_t. 10925 10926 2017-11-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10927 10928 xlat/gen.sh: speedup xlat generation. 10929 This commit implements the following changes: 10930 - increases the number of concurrent jobs to twice the CPU count; 10931 - creates a circular buffer, so instead of running multiple jobs 10932 at once, the generator tries to keep about the same number of jobs 10933 being run concurrently; 10934 - runs gen_git and gen_make concurrently in order to squeeze in 10935 one more bit of concurrency. 10936 10937 With my deeply scientific measurements, this approach achieves 10938 up to 15% speedup with dash and about 30-40% with bash as /bin/sh 10939 on a 4-core machine. 10940 10941 * xlat/gen.sh (main): Declare pids local variable, append pid of every 10942 run job to it; increase the limit of jobs to ncpus * 2; when the limit 10943 is reached, wait for the first pid in pids instead of resetting jobs 10944 to zero and waiting for all the run jobs; put gen_git and gen_make 10945 into background. 10946 10947 2017-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 10948 10949 hppa: wire up statx syscall. 10950 * linux/hppa/syscallent.h [349]: Add statx entry. 10951 10952 2017-11-04 Dmitry V. Levin <ldv (a] altlinux.org> 10953 10954 tests: check signal mask transparency. 10955 Starting with commit v4.17-5-gf83b49b strace is expected 10956 to forward the signal mask to tracees unchanged. 10957 10958 * tests/check_sigblock.c: New file. 10959 * tests/set_sigblock.c: Likewise. 10960 * tests/sigblock.test: New test. 10961 * tests/.gitignore: Add check_sigblock and set_sigblock. 10962 * tests/Makefile.am (check_PROGRAMS): Likewise. 10963 (MISC_TESTS): Add sigblock.test. 10964 10965 2017-11-03 Dmitry V. Levin <ldv (a] altlinux.org> 10966 10967 tests: check signal disposition transparency. 10968 Starting with commit v4.17-8-ge97a66f strace is expected 10969 to forward the signal disposition to tracees unchanged. 10970 10971 * tests/check_sigign.c: New file. 10972 * tests/list_sigaction_signum.c: Likewise. 10973 * tests/set_sigign.c: Likewise. 10974 * tests/sigign.test: New test. 10975 * tests/.gitignore: Add check_sigign, list_sigaction_signum, 10976 and set_sigign. 10977 * tests/Makefile.am (check_PROGRAMS): Likewise. 10978 (MISC_TESTS): Add sigign.test. 10979 10980 2017-11-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10981 10982 tests: update futex test to accommodate the recent kernel change. 10983 Kernel commit v4.14-rc1~162^2~8 refactored futex implementation and 10984 introduced checks for invalid shift sizes. Accommodate this change 10985 by allowing EINVAL in the corresponding futex checks. 10986 10987 * tests/futex.c (CHECK_FUTEX_GENERIC): Reset errno before the syscall. 10988 (main) <wake_ops>: Add err2 field, describe err/err2 fields. 10989 Add EINVAL as a possible errno to the checks that contain invalid 10990 shift values. 10991 Update return value check so it checks that values are strictly 10992 as expected. 10993 10994 Closes: https://github.com/strace/strace/pull/16 10995 10996 2017-11-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 10997 10998 tests: cleanup futex test. 10999 * tests/futex.c (main) <wake_ops>: Remove unused errstr field 11000 from the structure type definition. 11001 11002 2017-11-02 Dmitry V. Levin <ldv (a] altlinux.org> 11003 11004 seccomp: decode SECCOMP_GET_ACTION_AVAIL operation. 11005 * defs.h (seccomp_ret_action): New xlat prototype. 11006 * seccomp.c (decode_seccomp_set_mode_strict): Remove. 11007 (SYS_FUNC(seccomp)): Decode SECCOMP_GET_ACTION_AVAIL operation. 11008 * NEWS: Mention this. 11009 * tests/seccomp_get_action_avail.c: New file. 11010 * tests/gen_tests.in (seccomp_get_action_avail): New entry. 11011 * tests/pure_executables.list: Add seccomp_get_action_avail. 11012 * tests/.gitignore: Likewise. 11013 11014 2017-11-01 Dmitry V. Levin <ldv (a] altlinux.org> 11015 11016 Add SECCOMP_RET_KILL_PROCESS decoding support. 11017 * bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove. 11018 [!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define. 11019 (print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL 11020 instead of SECCOMP_RET_ACTION. 11021 * xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced 11022 by linux kernel commit v4.14-rc2~15^2~3. 11023 11024 2017-11-01 Dmitry V. Levin <ldv (a] altlinux.org> 11025 11026 Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD. 11027 Follow linux kernel commit v4.14-rc2~15^2~4 and rename SECCOMP_RET_KILL 11028 to SECCOMP_RET_KILL_THREAD. 11029 11030 * xlat/seccomp_ret_action.in (SECCOMP_RET_KILL): Rename 11031 to SECCOMP_RET_KILL_THREAD. 11032 * tests/prctl-seccomp-filter-v.c (main): Update expected output. 11033 * tests/seccomp-filter-v.c (main): Likewise. 11034 11035 2017-11-01 Dmitry V. Levin <ldv (a] altlinux.org> 11036 11037 Update SECCOMP_* constants. 11038 * xlat/seccomp_filter_flags.in: Add SECCOMP_FILTER_FLAG_LOG introduced 11039 by kernel commit v4.14-rc2~15^2~6. 11040 * xlat/seccomp_ops.in: Add SECCOMP_GET_ACTION_AVAIL introduced 11041 by kernel commit v4.14-rc2~15^2~9. 11042 * xlat/seccomp_ret_action.in: Add SECCOMP_RET_LOG introduced 11043 by kernel commit v4.14-rc2~15^2~5. 11044 * NEWS: Mention this. 11045 * tests/seccomp-filter.c (main): Update expected output. 11046 * tests/seccomp-filter-v.c (main): Likewise. 11047 11048 Provide fallback definitions for SECCOMP_RET_* constants. 11049 * xlat/seccomp_ret_action.in: Add fallback definitions. 11050 11051 2017-11-01 Dmitry V. Levin <ldv (a] altlinux.org> 11052 11053 tests: robustify options-syntax.test against inquisitive musl. 11054 Workaround musl >= 1.1.17 ability to use AT_EXECFN during 11055 program_invocation_name initialization. 11056 11057 * tests/options-syntax.test: Check for two valid variants 11058 of "zeroargc strace" expected output. 11059 11060 2017-11-01 Dmitry V. Levin <ldv (a] altlinux.org> 11061 11062 Update MEMBARRIER_CMD_* constants. 11063 * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 11064 introduced by kernel commit v4.14-rc6~26. 11065 * tests/membarrier.c (main): Update expected output. 11066 11067 2017-10-31 JingPiao Chen <chenjingpiao (a] gmail.com> 11068 11069 tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags. 11070 * tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function. 11071 (main): Use it. 11072 11073 tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags. 11074 * tests/nfnetlink_nftables.c (test_nlmsg_flags): New function. 11075 (main): Use it. 11076 11077 tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags. 11078 * tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function. 11079 (main): Use it. 11080 11081 tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags 11082 * tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function. 11083 (main): Use it. 11084 11085 tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags. 11086 * tests/nfnetlink_acct.c (test_nlmsg_flags): New function. 11087 (main): Use it. 11088 11089 tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags 11090 * tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function. 11091 (main): Use it. 11092 11093 tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags. 11094 * tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function. 11095 (main): Use it. 11096 11097 2017-10-26 JingPiao Chen <chenjingpiao (a] gmail.com> 11098 11099 netlink: decode NETLINK_NETFILTER netlink message flags. 11100 * netlink.c (decode_nlmsg_flags_netfilter): New function. 11101 (nlmsg_flags): Add NETLINK_NETFILTER. 11102 * NEWS: Mention this. 11103 11104 netlink: decode netlink message delete flags. 11105 * netlink.c: Include "xlat/netlink_delete_flags.h". 11106 (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route, 11107 decode_nlmsg_flags_xfrm): Decode delete flags. 11108 * netlink.h (NLM_F_NONREC): New macro. 11109 * xlat/netlink_delete_flags.in: New file. 11110 * tests/netlink_crypto.c (test_nlmsg_flags): Check this. 11111 * tests/netlink_route.c (test_nlmsg_flags): Likewise. 11112 * tests/netlink_xfrm.c (test_nlmsg_flags): Likewise. 11113 11114 2017-10-26 JingPiao Chen <chenjingpiao (a] gmail.com> 11115 11116 netlink: refactor decode_nlmsg_flags. 11117 Refactor decode_nlmsg_flags to make it family-specific, just like 11118 decode_nlmsg_type and decode_payload. 11119 11120 * netlink.c (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route, 11121 decode_nlmsg_flags_sock_diag, decode_nlmsg_flags_xfrm): New functions. 11122 (nlmsg_flags_decoder_t): New typedef. 11123 (nlmsg_flags): New array. 11124 (decode_nlmsg_flags): Use it. 11125 11126 2017-10-14 JingPiao Chen <chenjingpiao (a] gmail.com> 11127 11128 Workaround historic linux/netfilter/xt_osf.h deficiencies. 11129 When using linux kernel headers without commit v4.5-rc1~128^2~115^2~22 11130 ("netfilter: fix include files for compilation"), both <linux/ip.h> 11131 and <linux/tcp.h> have to be included before <linux/netfilter/xt_osf.h>. 11132 11133 * configure.ac (AC_CHECK_HEADERS): Include <linux/ip.h> 11134 and <linux/tcp.h> when checking for linux/netfilter/xt_osf.h header. 11135 * tests/nfnetlink_osf.c: Include <linux/ip.h> and <linux/tcp.h> 11136 before <linux/netfilter/xt_osf.h>. 11137 11138 2017-09-24 JingPiao Chen <chenjingpiao (a] gmail.com> 11139 11140 tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types. 11141 * configure.ac (AC_CHECK_HEADERS): Add 11142 linux/netfilter/nf_tables_compat.h. 11143 * tests/nfnetlink_nft_compat.c: New file. 11144 * tests/gen_tests.in (nfnetlink_nft_compat): New entry. 11145 * tests/pure_executables.list: Add nfnetlink_nft_compat. 11146 * tests/.gitignore: Likewise. 11147 11148 tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types. 11149 * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nf_tables.h. 11150 * tests/nfnetlink_nftables.c: New file. 11151 * tests/gen_tests.in (nfnetlink_nftables): New entry. 11152 * tests/pure_executables.list: Add nfnetlink_nftables. 11153 * tests/.gitignore: Likewise. 11154 11155 tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types. 11156 * configure.ac (AC_CHECK_HEADERS): Add 11157 linux/netfilter/nfnetlink_cthelper.h. 11158 * tests/nfnetlink_cthelper.c: New file. 11159 * tests/gen_tests.in (nfnetlink_cthelper): New entry. 11160 * tests/pure_executables.list: Add nfnetlink_cthelper. 11161 * tests/.gitignore: Likewise. 11162 11163 tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types 11164 * configure.ac (AC_CHECK_HEADERS): Add 11165 linux/netfilter/nfnetlink_cttimeout.h. 11166 * tests/nfnetlink_cttimeout.c: New file. 11167 * tests/gen_tests.in (nfnetlink_cttimeout): New entry. 11168 * tests/pure_executables.list: Add nfnetlink_cttimeout. 11169 * tests/.gitignore: Likewise. 11170 11171 tests: check decoding of NFNL_SUBSYS_ACCT netlink message types. 11172 * configure.ac (AC_CHECK_HEADERS): Add 11173 linux/netfilter/nfnetlink_acct.h. 11174 * tests/nfnetlink_acct.c: New file. 11175 * tests/gen_tests.in (nfnetlink_acct): New entry. 11176 * tests/pure_executables.list: Add nfnetlink_acct. 11177 * tests/.gitignore: Likewise. 11178 11179 tests: check decoding of NFNL_SUBSYS_IPSET netlink message types. 11180 * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/ipset/ip_set.h. 11181 * tests/nfnetlink_ipset.c: New file. 11182 * tests/gen_tests.in (nfnetlink_ipset): New entry. 11183 * tests/pure_executables.list: Add nfnetlink_ipset. 11184 * tests/.gitignore: Likewise. 11185 11186 tests: check decoding of NFNL_SUBSYS_OSF netlink message types. 11187 * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/xt_osf.h. 11188 * tests/nfnetlink_osf.c: New file. 11189 * tests/gen_tests.in (nfnetlink_osf): New entry. 11190 * tests/pure_executables.list: Add nfnetlink_osf. 11191 * tests/.gitignore: Likewise. 11192 11193 tests: check decoding of NFNL_SUBSYS_ULOG netlink message types. 11194 * configure.ac (AC_CHECK_HEADERS): Add 11195 linux/netfilter/nfnetlink_log.h. 11196 * tests/nfnetlink_ulog.c: New file. 11197 * tests/gen_tests.in (nfnetlink_ulog): New entry. 11198 * tests/pure_executables.list: Add nfnetlink_ulog. 11199 * tests/.gitignore: Likewise. 11200 11201 tests: check decoding of NFNL_SUBSYS_QUEUE netlink message types. 11202 * configure.ac (AC_CHECK_HEADERS): Add 11203 linux/netfilter/nfnetlink_queue.h. 11204 * tests/nfnetlink_queue.c: New file. 11205 * tests/gen_tests.in (nfnetlink_queue): New entry. 11206 * tests/pure_executables.list: Add nfnetlink_queue. 11207 * tests/.gitignore: Likewise. 11208 11209 tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types 11210 * tests/nfnetlink_ctnetlink_exp.c: New file. 11211 * tests/gen_tests.in (nfnetlink_ctnetlink_exp): New entry. 11212 * tests/pure_executables.list: Add nfnetlink_ctnetlink_exp. 11213 * tests/.gitignore: Likewise. 11214 11215 tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types. 11216 * configure.ac (AC_CHECK_HEADERS): Add 11217 linux/netfilter/nfnetlink_conntrack.h. 11218 * tests/nfnetlink_ctnetlink.c: New file. 11219 * tests/gen_tests.in (nfnetlink_ctnetlink): New entry. 11220 * tests/pure_executables.list: Add nfnetlink_ctnetlink. 11221 * tests/.gitignore: Likewise. 11222 11223 netlink: decode NETLINK_NETFILTER netlink message types. 11224 * netlink.c: Include "xlat/nf_acct_msg_types.h", 11225 "xlat/nf_cthelper_msg_types.h", "xlat/nf_ctnetlink_exp_msg_types.h", 11226 "xlat/nf_ctnetlink_msg_types.h", "xlat/nf_cttimeout_msg_types.h", 11227 "xlat/nf_ipset_msg_types.h", "xlat/nf_nft_compat_msg_types.h", 11228 "xlat/nf_nftables_msg_types.h", "xlat/nf_osf_msg_types.h", 11229 "xlat/nf_queue_msg_types.h", and "xlat/nf_ulog_msg_types.h". 11230 (nf_nlmsg_types): New array. 11231 (decode_nlmsg_type_netfilter): Use it. 11232 * NEWS: Mention this. 11233 * xlat/nf_acct_msg_types.in: New file. 11234 * xlat/nf_cthelper_msg_types.in: Likewise. 11235 * xlat/nf_ctnetlink_exp_msg_types.in: Likewise. 11236 * xlat/nf_ctnetlink_msg_types.in: Likewise. 11237 * xlat/nf_cttimeout_msg_types.in: Likewise. 11238 * xlat/nf_ipset_msg_types.in: Likewise. 11239 * xlat/nf_nft_compat_msg_types.in: Likewise. 11240 * xlat/nf_nftables_msg_types.in: Likewise. 11241 * xlat/nf_osf_msg_types.in: Likewise. 11242 * xlat/nf_queue_msg_types.in: Likewise. 11243 * xlat/nf_ulog_msg_types.in: Likewise. 11244 * tests/netlink_netfilter.c (test_nlmsg_type): Update expected output. 11245 11246 2017-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 11247 11248 ppc64: fix sigreturn parser for ppc personality. 11249 * linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite. 11250 11251 ppc64: truncate syscall args for 32-bit personality tracees. 11252 * linux/powerpc/get_syscall_args.c (get_syscall_args): Clear upper 11253 32 bits of syscall args for 32-bit personality tracees. 11254 * NEWS: Mention this fix. 11255 11256 ppc64: fix PRI__64 macro definition when compiled with -m32. 11257 * kernel_types.h [SIZEOF_LONG != 4]: Check for __powerpc64__ instead 11258 of POWERPC to handle -m32 case properly. 11259 11260 2017-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 11261 11262 loop: decode LOOP_SET_BLOCK_SIZE. 11263 * loop.c (loop_ioctl) <LOOP_SET_BLOCK_SIZE>: Handle LOOP_SET_BLOCK_SIZE. 11264 * tests/ioctl_loop.c (main): Check it. 11265 11266 Update ioctl entries from linux v4.14-rc1. 11267 * linux/32/ioctls_inc_align16.h: Update from linux v4.14-rc1 11268 using ioctls_gen.sh. 11269 * linux/32/ioctls_inc_align32.h: Likewise. 11270 * linux/32/ioctls_inc_align64.h: Likewise. 11271 * linux/64/ioctls_inc.h: Likewise. 11272 * linux/x32/ioctls_inc0.h: Likewise. 11273 * xlat/loop_cmds.in: Add LOOP_SET_BLOCK_SIZE introduced 11274 by kernel commit v4.13-rc7-176-g89e4fde. 11275 * NEWS: Mention this. 11276 * tests/ioctl_loop.c (main): Update. 11277 11278 2017-09-19 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 11279 11280 maint: generate ioctl entries without target architecture code execution 11281 ioctls_sym.sh used to generate and invoke target architecture 11282 executables that limited its applicability. 11283 After this change, the generated code is just compiled to the target 11284 architecture object files and all required information is obtained 11285 from the dwarf sections. 11286 This approach allows to generate ioctl entries for any target 11287 architecture supported by compiler. 11288 11289 * maint/ioctls_sym.awk: New file. 11290 * maint/ioctls_sym.sh (LC_ALL): Define to C and export. 11291 (uname_m): Make configurable. 11292 (CFLAGS): Add -gdwarf-2. 11293 (LDFLAGS): Remove. 11294 Do not use print_ioctlent.c. 11295 Change asm-generic/ioctl.h and asm/ioctl.h hook. 11296 Dump and process dwarf sections of generated object files. 11297 * maint/print_ioctlent.c: Remove. 11298 11299 2017-09-18 Dmitry V. Levin <ldv (a] altlinux.org> 11300 11301 Remove KVM_S390_* ioctls from non-s390 architectures. 11302 * maint/ioctls_sym.sh <linux/kvm.h> (s390_list): New variable. 11303 Use it to exclude KVM_S390_* ioctls on non-s390 architectures. 11304 * linux/arm/ioctls_arch0.h: Regenerate. 11305 * linux/i386/ioctls_arch0.h: Likewise. 11306 * linux/powerpc/ioctls_arch0.h: Likewise. 11307 * linux/s390/ioctls_arch0.h: Likewise. 11308 * linux/x86_64/ioctls_arch0.h: Likewise. 11309 11310 2017-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 11311 11312 Remove some of arch-specific KVM ioctls from non-matching architectures. 11313 * maint/ioctls_sym.sh (arm_list, ppc_list, x86_list): Use bracket 11314 expressions to generalize arch-specific regular expressions. 11315 * linux/arm/ioctls_arch0.h: Regenerate. 11316 * linux/i386/ioctls_arch0.h: Likewise. 11317 * linux/powerpc/ioctls_arch0.h: Likewise. 11318 * linux/s390/ioctls_arch0.h: Likewise. 11319 * linux/x86_64/ioctls_arch0.h: Likewise. 11320 11321 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11322 11323 dm: add support for DM_DEV_ARM_POLL. 11324 Added in Linux commit v4.13-rc1~137^2~14. 11325 11326 * dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero. 11327 [!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise. 11328 [!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise. 11329 [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. 11330 (dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL. 11331 * tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. 11332 (main) <dummy_check_cmds>: Add DM_DEV_ARM_POLL. 11333 11334 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11335 11336 kcmp: add KCMP_EPOLL_TFD support. 11337 * configure.ac (AC_CHECK_TYPES): Add check for struct kcmp_epoll_slot. 11338 * kcmp.c (SYS_FUNC(kcmp)) <case KCMP_EPOLL_TFD>: Implement idx1/idx2 11339 argument parsing. 11340 * tests/kcmp.c: Update test. 11341 * xlat/kcmp_types.in (KCMP_EPOLL_TFD): New entry. 11342 11343 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11344 11345 tests: add kcmp-y test. 11346 It is not very useful as of now, but it will allow tracking changes 11347 in fd output once they are implemented. 11348 11349 * tests/gen_tests.in (kcmp-y): New test. 11350 * tests/kcmp-y.c: New file, wrapper for kcmp.c 11351 * tests/kcmp.c: Add opening of some files for which info may be printed 11352 in the future. 11353 * tests/pure_executables.list: Add kcmp-y. 11354 * tests/.gitignore: Likewise. 11355 11356 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11357 11358 kcmp: output fds using a separate function. 11359 This is a preparation for the future introduction of cross-NS PID 11360 derivation, which would enable us to print fd information for fds 11361 related to all processes, not just traced ones. 11362 11363 Note the change in output type for idx1/idx2 in KCMP_FILE command from 11364 unsigned to int, it follows printfd output format. 11365 11366 * kcmp.c (printpidfd): New function. 11367 (PRINT_FIELD_PIDFD): New macro. 11368 (SYS_FUNC(kcmp)) <case KCMP_FILE>: Use printpidfd for printing 11369 idx1/idx2, as they are fds, after all. 11370 11371 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11372 11373 tests/kcmp: add more checks. 11374 Let's check all kcmp commands that they indeed do not print idx1/idx2. 11375 Also, check that upper bits of pid arguments are ignored. 11376 11377 * tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22. 11378 * tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all 11379 kcmp types not tested before. 11380 11381 2017-09-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11382 11383 tests/kcmp: use <linux/kcmp.h> if it is available. 11384 I see it as a good idea to stick to system headers whenever possible 11385 in order to also check for possible discrepancies between strace's 11386 internal definitions and definitions present in the system headers. 11387 11388 * configure.ac (AC_CHECK_HEADERS): Add linux/kcmp.h. 11389 * tests/kcmp.h [HAVE_LINUX_KCMP_H]: Include <linux/kcmp.h>, 11390 do not define KCMP_FILE and KCMP_SYSVSEM. 11391 11392 2017-09-17 JingPiao Chen <chenjingpiao (a] gmail.com> 11393 11394 tests: check decoding of MDBA_ROUTER_PORT netlink attribute. 11395 * tests/nlattr_mdba_router_port.c: New file. 11396 * tests/gen_tests.in (nlattr_mdba_router_port): New entry. 11397 * tests/pure_executables.list: Add nlattr_mdba_router_port. 11398 * tests/.gitignore: Likewise. 11399 11400 tests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes. 11401 * tests/nlattr_mdba_mdb_entry.c: New file. 11402 * tests/gen_tests.in (nlattr_mdba_mdb_entry): New entry. 11403 * tests/pure_executables.list: Add nlattr_mdba_mdb_entry. 11404 * tests/.gitignore: Likewise. 11405 11406 2017-09-17 JingPiao Chen <chenjingpiao (a] gmail.com> 11407 11408 tests: extend TEST_NESTED_NLATTR_OBJECT macro. 11409 Extend TEST_NESTED_NLATTR_OBJECT macro for multi-nested netlink 11410 attributes, such as 11411 11412 [MDBA_MDB] = { 11413 [MDBA_MDB_ENTRY] = { 11414 [MDBA_MDB_ENTRY_INFO] { 11415 struct br_mdb_entry 11416 [MDBA_MDB_EATTR attributes] 11417 } 11418 } 11419 } 11420 11421 * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_, 11422 TEST_NESTED_NLATTR_OBJECT_EX): New macros. 11423 (TEST_NESTED_NLATTR_OBJECT): Use TEST_NESTED_NLATTR_OBJECT_EX_. 11424 11425 2017-09-17 JingPiao Chen <chenjingpiao (a] gmail.com> 11426 11427 rtnl_mdb: decode br_port_msg netlink attributes. 11428 * configure.ac (AC_CHECK_TYPES): Check for struct br_mdb_entry 11429 in <linux/if_bridge.h>. 11430 (AC_CHECK_MEMBERS): Check for flags and vid fields in struct br_mdb_entry. 11431 * rtnl_mdb.c: Include "xlat/mdb_flags.h", "xlat/mdb_states.h", 11432 "xlat/rtnl_mdba_mdb_attrs.h", "xlat/rtnl_mdba_mdb_eattr_attrs.h", 11433 "xlat/rtnl_mdba_mdb_entry_attrs.h" ,"xlat/rtnl_mdba_router_attrs.h" 11434 and "xlat/rtnl_mdba_router_pattr_attrs.h". 11435 (decode_mdba_mdb_entry_info, decode_mdba_mdb_entry, 11436 decode_mdba_mdb, decode_multicast_router_type, 11437 decode_mdba_router_port, decode_mdba_router): New functions. 11438 (mdba_mdb_eattr_nla_decoders, mdba_mdb_entry_nla_decoders, 11439 mdba_mdb_nla_decoders, mdba_router_pattr_nla_decoders, 11440 mdba_router_nla_decoders, br_port_msg_nla_decoders): New arrays. 11441 (decode_br_port_msg): Use br_port_msg_nla_decoders. 11442 * xlat/mdb_flags.in: New file. 11443 * xlat/mdb_states.in: Likewise. 11444 * xlat/multicast_router_types.in: Likewise. 11445 * xlat/rtnl_mdba_mdb_attrs.in: Likewise. 11446 * xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise. 11447 * xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise. 11448 * xlat/rtnl_mdba_router_attrs.in: Likewise. 11449 * xlat/rtnl_mdba_router_pattr_attrs.in: Likewise. 11450 11451 2017-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 11452 11453 netlink: implement decoding of INET_DIAG_CLASS_ID attribute. 11454 This is a new netlink attribute introduced by linux kernel commit 11455 v4.14-rc1~130^2~207. 11456 11457 * linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum. 11458 * netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add 11459 INET_DIAG_CLASS_ID. 11460 * xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID. 11461 * xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1). 11462 * tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID 11463 decoding. 11464 11465 2017-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 11466 11467 Update MEMBARRIER_CMD_* constants. 11468 * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED 11469 introduced by kernel commit v4.14-rc1~174^2^2^4. 11470 * NEWS: Mention this. 11471 * tests/membarrier.c (main): Update expected output. 11472 11473 Update UFFD_FEATURE_* constants. 11474 * xlat/memfd_create_flags.in: Remove UFFD_FEATURE_EVENT_EXIT removed 11475 by kernel commit v4.11-rc2~15^2~18. 11476 Add UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID introduced by kernel 11477 commits v4.14-rc1~126^2~28 and v4.14-rc1~126^2~23, repsectively. 11478 * NEWS: Mention this. 11479 11480 Update MFD_* constants. 11481 * xlat/memfd_create_flags.in: Add MFD_HUGETLB introduced 11482 by kernel commit v4.14-rc1~126^2~17. 11483 * NEWS: Mention this. 11484 * tests/memfd_create.c (main): Update expected output. 11485 11486 Update ETH_P_* constants. 11487 * xlat/ethernet_protocols.in: Add ETH_P_ERSPAN, ETH_P_NSH, ETH_P_IFE, 11488 and ETH_P_MAP introduced by kernel commits v4.14-rc1~130^2~164, 11489 v4.14-rc1~130^2~89^2~3, v4.14-rc1~130^2~90^2~2, and 11490 v4.14-rc1~130^2~78^2~2, respectively. 11491 * NEWS: Mention this. 11492 11493 Update ARPHRD_* constants. 11494 * xlat/arp_hardware_types.in: Add ARPHRD_RAWIP introduced 11495 by kernel commit v4.14-rc1~130^2~78^2~1. 11496 * NEWS: Mention this. 11497 11498 Update BPF_* constants. 11499 * xlat/bpf_attach_type.in: Add BPF_SK_SKB_STREAM_PARSER 11500 and BPF_SK_SKB_STREAM_VERDICT introduced by kernel commit 11501 v4.14-rc1~130^2~123^2~8. 11502 * xlat/bpf_map_flags.in: Add BPF_F_NO_COMMON_LRU and BPF_F_NUMA_NODE 11503 introduced by kernel commits v4.10-rc1~202^2~271^2~2 11504 and v4.14-rc1~130^2~196^2~1, respectively. 11505 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_DEVMAP 11506 and BPF_MAP_TYPE_SOCKMAP introduced by kernel commits 11507 v4.14-rc1~130^2~497^2~4 and v4.14-rc1~130^2~234^2~4, 11508 respectively. 11509 * xlat/bpf_op_jmp.in: Add BPF_JLT, BPF_JLE, BPF_JSLT, and BPF_JSLE 11510 introduced by kernel commit v4.14-rc1~130^2~309^2~8. 11511 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SK_SKB introduced 11512 by kernel commit v4.14-rc1~130^2~234^2~6. 11513 * NEWS: Mention this. 11514 11515 Update SO_* constants. 11516 * xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit 11517 v4.14-rc1~130^2~376^2~5. 11518 * NEWS: Mention this. 11519 11520 Update MADV_* constants. 11521 * xlat/madvise_cmds.in: Add MADV_WIPEONFORK and MADV_KEEPONFORK 11522 introduced by kernel commit v4.14-rc1~126^2. 11523 * NEWS: Mention this. 11524 11525 2017-09-08 Baruch Siach <baruch (a] tkos.co.il> 11526 11527 error_prints: fix potential program_invocation_name type conflict. 11528 uClibc-ng declares program_invocation_name as const. 11529 This causes the build failure below: 11530 11531 error_prints.c:40:14: error: conflicting types for program_invocation_name 11532 extern char *program_invocation_name; 11533 ^~~~~~~~~~~~~~~~~~~~~~~ 11534 In file included from error_prints.c:32:0: 11535 .../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of program_invocation_name was here 11536 extern const char *program_invocation_name, *program_invocation_short_name; 11537 ^~~~~~~~~~~~~~~~~~~~~~~ 11538 11539 * error_prints.c (program_invocation_name): Declare only in case 11540 of [!HAVE_PROGRAM_INVOCATION_NAME]. 11541 11542 2017-09-07 JingPiao Chen <chenjingpiao (a] gmail.com> 11543 11544 rtnl_tc_action: decode tcamsg netlink attributes. 11545 * rtnl_tc_action.c (tcamsg_nla_decoders): New array. 11546 (decode_tcamsg): Use it. 11547 11548 tests: check decoding of TCA_STAB netlink attribute of tcmsg. 11549 * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro. 11550 * tests/nlattr_tca_stab.c: New file. 11551 * tests/gen_tests.in (nlattr_tca_stab): New entry. 11552 * tests/pure_executables.list: Add nlattr_tca_stab. 11553 * tests/.gitignore: Likewise. 11554 11555 tests: check decoding of TCA_STATS2 netlink attribute of tcmsg. 11556 * tests/nlattr_tc_stats.c: New file. 11557 * tests/gen_tests.in (nlattr_tc_stats): New entry. 11558 * tests/pure_executables.list: Add nlattr_tc_stats. 11559 * tests/.gitignore: Likewise. 11560 11561 tests: check decoding of tcmsg netlink attributes. 11562 * tests/nlattr_tcmsg.c: Include <stddef.h> and <linux/pkt_sched.h>. 11563 (main): Check decoding of TCA_STATS and TCA_RATE. 11564 11565 rtnl_tc: decode tcmsg netlink attributes. 11566 * configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic, 11567 gnet_stats_queue, gnet_stats_rate_est, 11568 and gnet_stats_rate_est64 structures in <linux/gen_stats.h>. 11569 And check for struct tc_sizespec in <linux/pkt_sched.h>. 11570 * nlattr.h (tc_stats): New prototype. 11571 * rtnl_tc.c: Include <linux/gen_stats.h>, <linux/pkt_sched.h>, 11572 "xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h". 11573 (decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic, 11574 decode_gnet_stats_rate_est, decode_gnet_stats_queue, 11575 decode_gnet_stats_rate_est64, decode_nla_tc_stats, 11576 decode_tc_sizespec, print_stab_data, decode_tca_stab_data, 11577 decode_tca_stab): New functions. 11578 (tca_stats_nla_decoders, tca_stab_nla_decoders, 11579 tcmsg_nla_decoders): New arrays. 11580 (decode_tcmsg): Use tcmsg_nla_decoders. 11581 * xlat/rtnl_tca_stab_attrs.in: New file. 11582 * xlat/rtnl_tca_stats_attrs.in: Likewise. 11583 11584 2017-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 11585 11586 Update TCP_* constants. 11587 * xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT. 11588 * NEWS: Mention this. 11589 11590 Update SOL_* constants. 11591 * xlat/socketlayers.in: Add SOL_TLS. 11592 * NEWS: Mention this. 11593 11594 2017-09-06 Dmitry V. Levin <ldv (a] altlinux.org> 11595 11596 Post-release administrivia. 11597 * NEWS: Add a header line for the next release. 11598 * debian/changelog.in: Add a changelog entry for 4.19-1. 11599 * strace.spec.in: Likewise. 11600 11601 2017-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 11602 11603 Prepare for 4.19 release. 11604 * NEWS: Update for 4.19 release. 11605 11606 .mailmap: add canonical name and address of Edgar Kaziakhmedov. 11607 * .mailmap: Add canonical name and address of Edgar Kaziakhmedov here 11608 to avoid duplications in CREDITS file. 11609 11610 maint: add gen-tag-message.sh script. 11611 * maint/gen-tag-message.sh: New file. 11612 11613 maint: add gen-contributors-list.sh script. 11614 * maint/gen-contributors-list.sh: New file. 11615 11616 2017-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11617 11618 Update copyright headers. 11619 Headers updated automatically with 11620 11621 maint/update_copyright_headers.sh -c 11622 11623 2017-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11624 11625 update_copyright_years.sh: add ability to automatically commit results. 11626 * maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE, 11627 GIT_COMMIT_MESSAGE): New variables. 11628 <-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string 11629 as a template. 11630 11631 2017-09-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11632 11633 configure.ac: specify minimal GNU Automake version. 11634 In order to provide better diagnostics. 11635 11636 * configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as 11637 1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro. 11638 11639 Closes: https://github.com/strace/strace/issues/11 11640 11641 2017-09-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11642 11643 Update NEWS. 11644 11645 2017-09-03 JingPiao Chen <chenjingpiao (a] gmail.com> 11646 11647 tests: check decoding of IFLA_XDP netlink attribute of ifinfomsg. 11648 * tests/nlattr_ifla_xdp.c: New file. 11649 * tests/gen_tests.in (nlattr_ifla_xdp): New entry. 11650 * tests/pure_executables.list: Add nlattr_ifla_xdp. 11651 * tests/.gitignore: Likewise. 11652 11653 tests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg. 11654 * tests/nlattr_ifla_port.c: New file. 11655 * tests/gen_tests.in (nlattr_ifla_port): New entry. 11656 * tests/pure_executables.list: Add nlattr_ifla_port. 11657 * tests/.gitignore: Likewise. 11658 11659 tests: check decoding of more ifinfomsg netlink attributes. 11660 * tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS, 11661 IFLA_INFO_KIND, IFLA_VF_PORT): New macros. 11662 (main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS. 11663 11664 rtnl_link: decode more ifinfomsg netlink attributes. 11665 * configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi 11666 in <linux/if_link.h>. 11667 * rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h", 11668 "xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h", 11669 "xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h". 11670 (decode_ifla_linkinfo, decode_ifla_port_vsi, 11671 decode_ifla_port, decode_ifla_vf_ports, 11672 decode_ifla_xdp_flags, decode_ifla_xdp): New functions. 11673 (ifla_linkinfo_nla_decoders, ifla_port_nla_decoders, 11674 ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays. 11675 (ifinfomsg_nla_decoders) <IFLA_LINKINFO>: Use decode_ifla_linkinfo. 11676 <IFLA_VF_PORTS>: Use decode_ifla_vf_ports. 11677 <IFLA_PORT_SELF>: Use decode_ifla_port. 11678 <IFLA_XDP>: Use decode_ifla_xdp. 11679 * xlat/rtnl_ifla_info_attrs.in: New file. 11680 * xlat/rtnl_ifla_port_attrs.in: Likewise. 11681 * xlat/rtnl_ifla_vf_port_attrs.in: Likewise. 11682 * xlat/rtnl_ifla_xdp_attrs.in: Likewise. 11683 * xlat/xdp_flags.in: Likewise. 11684 11685 2017-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11686 11687 keyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE. 11688 * fetch_struct_keyctl_kdf_params.c: New file. 11689 * keyctl_kdf_params.h: Likewise. 11690 * Makefile.am (strace_SOURCES): Add them. 11691 * configure.ac: Add check for struct keyctl_kdf_params presence in 11692 <linux/keyctl.h>. 11693 * defs.h (struct strace_keyctl_kdf_params): Add forward declaration. 11694 * keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it 11695 on exiting. 11696 (SYS_FUNC(keyctl)) <case KEYCTL_DH_COMPUTE>: Pass arg5 to 11697 keyctl_dh_compute. 11698 * tests/keyctl.c: Include assert.h. 11699 (struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New 11700 definition. 11701 (STR32): New definition, copied from ioctl_dm.c. 11702 (append_str, kckdfp_to_str): New functions. 11703 (main): Update expected output, add checks for struct keyctl_kdf_params 11704 decoding. 11705 11706 tests/keyctl: improve readability. 11707 * tests/keyctl.c: Since do_keyctl() has so convoluted calling convention 11708 and keyctl test is so complex, let's try to improve readability a bit 11709 with some conventions regarding do_keyctl() call formatting: arguments 11710 representing single keyctl argument should be put on the separate line, 11711 continuations of arguments related to the same keyctl argument should 11712 have additional indentation and termination 0UL should always be 11713 on a separate line. Also, while we are here, let's add spaces 11714 to two type casts that are missing them. 11715 11716 2017-09-01 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 11717 11718 s390: update ioctl entries from linux 4.13. 11719 * linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh. 11720 11721 2017-09-01 Dmitry V. Levin <ldv (a] altlinux.org> 11722 11723 mpers.awk: fix regression introduced by the previous cleanup. 11724 * mpers.awk (what_is): Remove returned_size from local variables. 11725 11726 Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently") 11727 11728 2017-09-01 Dmitry V. Levin <ldv (a] altlinux.org> 11729 11730 rtnl_link: enhance decoding of struct rtnl_link_stats{,64} 11731 Enhance runtime detection of struct rtnl_link_stats.rx_nohandler 11732 and struct rtnl_link_stats64.rx_nohandler. 11733 11734 * rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length 11735 greater than min_size but less than sizeof(struct rtnl_link_stats). 11736 (decode_rtnl_link_stats64): Likewise, so not accept structure length 11737 greater than min_size but less than sizeof(struct rtnl_link_stats64). 11738 11739 2017-09-01 Dmitry V. Levin <ldv (a] altlinux.org> 11740 11741 rtnl_neightbl: enhance decoding of struct ndt_stats. 11742 Add support of kernels that operate with older definition of 11743 struct ndt_stats than the definition used to build strace. 11744 11745 * rtnl_neightbl.c (decode_ndt_stats): Add runtime detection 11746 of struct ndt_stats.ndts_table_fulls field, print the field 11747 when it is available. 11748 11749 2017-09-01 JingPiao Chen <chenjingpiao (a] gmail.com> 11750 11751 tests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg. 11752 * tests/nlattr_ifla_brport.c: New file. 11753 * tests/gen_tests.in (nlattr_ifla_brport): New entry. 11754 * tests/pure_executables.list: Add nlattr_ifla_brport. 11755 * tests/.gitignore: Likewise. 11756 * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro. 11757 11758 rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg. 11759 * configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id 11760 and rtnl_link_stats64 structures in <linux/if_link.h>. 11761 * rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h". 11762 (decode_ifla_bridge_id, decode_ifla_protinfo): New functions. 11763 (ifla_brport_nla_decoders): New array. 11764 (ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo. 11765 * xlat/rtnl_ifla_brport_attrs.in: New file. 11766 11767 tests: check decoding of ndtmsg netlink attributes. 11768 * tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros. 11769 (main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS. 11770 11771 rtnl_neightbl: decode ndtmsg netlink attributes. 11772 * configure.ac (AC_CHECK_TYPES): Check for ndt_config 11773 and ndt_stats structures in <linux/neighbour.h>. 11774 (AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats. 11775 * rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h". 11776 (decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions. 11777 (ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays. 11778 (decode_ndtmsg): Use ndtmsg_nla_decoders. 11779 * xlat/rtnl_neightbl_parms_attrs.in: New file. 11780 11781 tests: check decoding of ifaddrlblmsg netlink attributes. 11782 * tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS. 11783 11784 rtnl_addrlabel: decode ifaddrlblmsg netlink attributes. 11785 * rtnl_addrlabel.c (decode_ifal_address): New function. 11786 (ifaddrlblmsg_nla_decoders): New array. 11787 (decode_ifaddrlblmsg): Use it. 11788 11789 2017-09-01 Dmitry V. Levin <ldv (a] altlinux.org> 11790 11791 alpha: wire up new syscalls. 11792 * linux/alpha/syscallent.h [514..522]: New entries. 11793 11794 2017-08-31 JingPiao Chen <chenjingpiao (a] gmail.com> 11795 11796 tests/.gitignore: add missing files that should be ignored. 11797 * tests/.gitignore: Add is_linux_mips_n64. 11798 11799 2017-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 11800 11801 mpers.awk: declare local variables consistently. 11802 * mpers.awk (compare_indices): Make c1 and c2 variables local. 11803 (enter): Make item variable local. 11804 (what_is): Make loc_diff, returned_size, and to_return local. 11805 11806 2017-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 11807 11808 mpers.awk: separate local variables from real parameters by newline. 11809 * mpers.awk (array_get, update_upper_bound): Separate local variables 11810 from real parameters by newline. 11811 11812 2017-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11813 11814 rtnl_rule: enhance FRA_TABLE decoding. 11815 The attribute of FRA_TABLE is not just a 32-bit integer, some constants 11816 have well-known symbolic names like RT_TABLE_DEFAULT. 11817 11818 * rtnl_rule.c (fib_rule_hdr_nla_decoders) <FRA_TABLE>: 11819 Use decode_nla_rt_class. 11820 * tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro. 11821 (main): Check FRA_TABLE decoding. 11822 11823 2017-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 11824 11825 rtnl_route: enhance RTA_TABLE decoding. 11826 The attribute of RTA_TABLE is not just a 32-bit integer, some constants 11827 have well-known symbolic names like RT_TABLE_DEFAULT. 11828 11829 * nlattr.h (decode_nla_rt_class): New prototype. 11830 * rtnl_route.c (decode_nla_rt_class): New function. 11831 (rtmsg_nla_decoders) <RTA_TABLE>: Use it. 11832 * tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding. 11833 11834 2017-08-29 JingPiao Chen <chenjingpiao (a] gmail.com> 11835 11836 rtnl_nsid: decode rtgenmsg netlink attributes. 11837 * rtnl_nsid.c (rtgenmsg_nla_decoders): New array. 11838 (decode_rtgenmsg): Use it. 11839 11840 rtnl_netconf: decode netconfmsg netlink attributes. 11841 * rtnl_netconf.c (netconfmsg_nla_decoders): New array. 11842 (decode_netconfmsg): Use it. 11843 11844 tests: check decoding of ndmsg netlink attributes. 11845 * tests/nlattr_ndmsg.c: Include <netinet/in.h> and <arpa/inet.h>. 11846 (NDA_PORT): New macro. 11847 (main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT. 11848 11849 rtnl_neigh: decode ndmsg netlink attributes. 11850 * nlattr.c: Include <netinet/in.h> and <arpa/inet.h>. 11851 (decode_nla_be16): New function. 11852 * nlattr.h (decode_nla_be16): New prototype. 11853 * rtnl_neigh.c (decode_neigh_addr, 11854 decode_nda_cacheinfo): New functions. 11855 (ndmsg_nla_decoders): New array. 11856 (decode_ndmsg): Use it. 11857 11858 tests: check decoding of fib_rule_hdr netlink attributes. 11859 * tests/nlattr_fib_rule_hdr.c: Include <inttypes.h>. 11860 (FRA_TUN_ID, FRA_UID_RANGE): New macros. 11861 (main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID. 11862 11863 rtnl_rule: decode fib_rule_hdr netlink attributes. 11864 * configure.ac (AC_CHECK_FUNCS): Add be64toh. 11865 (AC_CHECK_TYPES): Check for struct fib_rule_uid_range 11866 in <linux/fib_rules.h>. 11867 * nlattr.c: Include <endian.h>. 11868 (decode_nla_be64): New function. 11869 * nlattr.h (decode_nla_be64): New prototype. 11870 * rtnl_rule.c (decode_rule_addr, 11871 decode_fib_rule_uid_range): New functions. 11872 (fib_rule_hdr_nla_decoders): New array. 11873 (decode_fib_rule_hdr): Use it. 11874 11875 rtnl_neigh: fix ndm_type field decode in struct ndmsg. 11876 * defs.h (routing_types): New xlat prototype. 11877 * rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode. 11878 * xlat/nda_types.in: Remove it. 11879 * tests/netlink_route.c (test_rtnl_neigh): Update the test. 11880 * tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise. 11881 11882 2017-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 11883 11884 Disallow more than one signal= specification in an injection expression. 11885 Specifying several signal= specifications in an injection expressions 11886 makes no sense. 11887 11888 * filter_qualify.c (parse_inject_token): Disallow second 11889 signal= specification. 11890 * strace.1.in: Document it. 11891 * tests/qual_inject-syntax.test: Check it. 11892 11893 2017-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 11894 11895 Add "flags" field to struct inject_data. 11896 Introduce "flags" field to struct inject_data and use it instead 11897 of magic rval and signo constants. 11898 Due to layout of struct inject_data, this new field does not change 11899 sizeof(struct inject_data). 11900 11901 * defs.h (INJECT_F_RETVAL, INJECT_F_SIGNAL): New macros. 11902 (INJECT_OPTS_RVAL_DEFAULT): Remove macro. 11903 (struct inject_data): Add "flags" field. 11904 * filter_qualify.c (parse_inject_token, qualify_inject_common): Check 11905 struct inject_data.flags instead of inject_data.rval 11906 and inject_data.signo, do not initialize inject_opts.data. 11907 * syscall.c (tamper_with_syscall_entering): Check struct 11908 inject_data.flags instead of inject_data.rval and inject_data.signo. 11909 11910 2017-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 11911 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 11912 11913 Move inject data of struct inject_opts to inject_data substructure. 11914 * defs.h (inject_data): New structure. 11915 (struct inject_opts): Replace "signo" and "rval" fields with "data" 11916 field of type "struct inject_data". 11917 * filter_qualify.c (parse_inject_token, qualify_inject_common): Update 11918 for the new layout of struct inject_opts. 11919 * syscall.c (tamper_with_syscall_entering, tamper_with_syscall_exiting): 11920 Likewise. 11921 11922 2017-08-28 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 11923 11924 Update ioctl entries from linux v4.13-rc7. 11925 * linux/32/ioctls_inc_align16.h: Update from linux v4.13-rc7 using ioctls_gen.sh. 11926 * linux/32/ioctls_inc_align32.h: Likewise. 11927 * linux/32/ioctls_inc_align64.h: Likewise. 11928 * linux/64/ioctls_inc.h: Likewise. 11929 * linux/x32/ioctls_inc0.h: Likewise. 11930 * linux/arm/ioctls_arch0.h: Likewise. 11931 * linux/i386/ioctls_arch0.h: Likewise. 11932 * linux/powerpc/ioctls_arch0.h: Likewise. 11933 * linux/s390x/ioctls_arch0.h: Likewise. 11934 * linux/x86_64/ioctls_arch0.h: Likewise. 11935 * NEWS: Mention this. 11936 11937 2017-08-28 JingPiao Chen <chenjingpiao (a] gmail.com> 11938 11939 tests: check decoding of ifinfomsg netlink attributes. 11940 * tests/nlattr_ifinfomsg.c: Include <stddef.h> and <linux/if_link.h>. 11941 (IFLA_LINK_NETNSID): New macro. 11942 (main): Check decoding of IFLA_LINK_NETNSID, 11943 IFLA_STATS, IFLA_MAP and IFLA_STATS64. 11944 11945 rtnl_link: decode ifinfomsg netlink attributes. 11946 * configure.ac (AC_CHECK_HEADERS): Add linux/if_link.h. 11947 (AC_CHECK_TYPES): Check for struct rtnl_link_stats64 11948 in <linux/if_link.h>. 11949 (AC_CHECK_MEMBERS): Check for rx_nohandler field 11950 in struct rtnl_link_stats/rtnl_link_stats64. 11951 * rtnl_link.c: Include <linux/if_link.h>. 11952 (decode_rtnl_link_stats, decode_rtnl_link_ifmap, 11953 decode_rtnl_link_stats64): New functions. 11954 (ifinfomsg_nla_decoders): New array. 11955 (decode_ifinfomsg): Use it. 11956 11957 2017-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 11958 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11959 11960 Imply RVAL_DECODED when RVAL_IOCTL_PARSED is returned on entering. 11961 Also, rename RVAL_IOCTL_PARSED to RVAL_IOCTL_DECODED as the latter 11962 is a more suitable name. 11963 11964 * defs.h (RVAL_IOCTL_PARSED): Rename to RVAL_IOCTL_DECODED. 11965 * ioctl.c (ioctl_decode): Update comment. 11966 (SYS_FUNC(ioctl)): Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED, 11967 add convertation of RVAL_IOCTL_DECODED to RVAL_DECODED. 11968 * block.c (block_ioctl): Replace RVAL_DECODED | RVAL_IOCTL_PARSED 11969 with RVAL_IOCTL_DECODED on entering. Replace RVAL_IOCTL_PARSED 11970 with RVAL_IOCTL_DECODED on exiting. 11971 * btrfs.c (btrfs_ioctl): Likewise. 11972 * evdev.c: Likewise. 11973 * file_ioctl.c: Likewise. 11974 * fs_x_ioctl.c: Likewise. 11975 * hdio.c: Likewise. 11976 * loop.c: Likewise. 11977 * mtd.c: Likewise. 11978 * nsfs.c: Likewise. 11979 * print_sg_req_info.c: Likewise. 11980 * ptp.c: Likewise. 11981 * rtc.c: Likewise. 11982 * scsi.c: Likewise. 11983 * sg_io_v3.c: Likewise. 11984 * sg_io_v4.c: Likewise. 11985 * sock.c: Likewise. 11986 * term.c: Likewise. 11987 * ubi.c: Likewise. 11988 * userfaultfd.c: Likewise. 11989 * dm.c (dm_known_ioctl): Return RVAL_IOCTL_DECODED on exiting and 0 11990 on entering. Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED 11991 on exiting. 11992 * v4l2.c: Likewise. 11993 11994 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 11995 11996 Replace return 1 ioctl sub-decoder hack with proper flag. 11997 * defs.h (RVAL_IOCTL_PARSED): Introduce new flag for ioctl sub-decoders 11998 * to signalise that they have successfully printed argument. 11999 * ioctl.c (SYS_FUNC(ioctl)): Check for RVAL_IOCTL_PARSED flag, remove 12000 un-set it before returning the value. 12001 * block.c: Use RVAL_IOCTL_PARSED instead of 1. 12002 * btrfs.c: Likewise. 12003 * dm.c: Likewise. 12004 * evdev.c: Likewise. 12005 * file_ioctl.c: Likewise. 12006 * fs_x_ioctl.c: Likewise. 12007 * hdio.c: Likewise. 12008 * loop.c: Likewise. 12009 * mtd.c: Likewise. 12010 * nsfs.c: Likewise. 12011 * print_sg_req_info.c: Likewise. 12012 * ptp.c: Likewise. 12013 * rtc.c: Likewise. 12014 * scsi.c: Likewise. 12015 * sg_io_v3.c: Likewise. 12016 * sg_io_v4.c: Likewise. 12017 * sock.c: Likewise. 12018 * term.c: Likewise. 12019 * ubi.c: Likewise. 12020 * userfaultfd.c: Likewise. 12021 * v4l2.c: Likewise. 12022 12023 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12024 12025 v4l2: streamline logic. 12026 Move exiting path out of if (entering(tcp)) { ... return 0; } else, 12027 provide common exit point in v4l2_ioctl handler, use break instead of 12028 return in specific command handlers. 12029 12030 * v4l2.c (print_v4l2_format, print_v4l2_buffer, print_v4l2_standard, 12031 print_v4l2_input, print_v4l2_frmivalenum): Move exiting path out of else 12032 par of the entering(tcp) condition. 12033 (v4l2_ioctl): Add return RVAL_DECODED | 1 at the end of function. 12034 (v4l2_ioctl) <case VIDIOC_S_STD, case VIDIOC_S_INPUT>: Replace return 12035 with break. 12036 12037 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12038 12039 v4l2: reorder field printing in order to avoid auxstr usage. 12040 Also rework flow a little in order to reduce amount of indentation. 12041 12042 * v4l2.c (print_v4l2_requestbuffers): Print count as the last field on 12043 entering, append it with updated value on exiting. 12044 * tests/ioctl_v4l2.c: Update expected output. 12045 12046 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12047 12048 userfaultfd: streamline logic. 12049 Make userfaultfd ioctl handling more in line with other ioctl decoders. 12050 12051 * userfaultfd.c (uffdio_ioctl): Return RVAL_DECODED | 1, break instead 12052 of returning in specific command handlers, return 0 on entering paths, 12053 move exiting paths out of else branch of entering(tcp) condition. 12054 12055 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12056 12057 Do not return RVAL_DECODED on exiting path of ioctl decoders. 12058 * print_sg_req_info.c (decode_sg_req_info): Return 1 instead of 12059 RVAL_DECODED | 1 on exiting path. 12060 * scsi.c (decode_sg_scsi_id): Likewise. 12061 * sg_io_v3.c (decode_response): Likewise. 12062 * sg_io_v4.c (decode_response): Likewise. 12063 12064 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12065 12066 dm: return RVAL_DECODED instead of 0 if we can't decode command. 12067 Return RVAL_DECODED if we can't decode command in order to avoid being 12068 called on exiting. 12069 12070 * dm.c (dm_ioctl): Return RVAL_DECODED instead of 0 if command can't be 12071 decoded. 12072 12073 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12074 Dmitry V. Levin <ldv (a] altlinux.org> 12075 12076 Return 0 instead of 1 on entering path of ioctl decoders. 12077 As returning 1 (without RVAL_DECODED) on entering makes no sense. 12078 12079 * block.c (block_ioctl) <case BLKTRACESETUP>: Replace return 1 with 12080 return 0 on entering path. 12081 * ptp.c (ptp_ioctl) <case PTP_SYS_OFFSET>: Likewise. 12082 * sg_io_v3.c (decode_request): Likewise. 12083 * sg_io_v4.c (decode_request): Likewise. 12084 * sock.c (decode)ifconf, sock_ioctl) <case SIOCGIFMAP>: Likewise. 12085 * ubi.c (ubi_ioctl) <case UBI_IOCMKVOL, case UBI_IOCATT>: Likewise. 12086 * v4l2.c (print_v4l2_ext_controls): Likewise. 12087 12088 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12089 12090 ioctl: simplify ioctl_decode handling, document its return value semantics 12091 * ioctl.s (SYS_FUNC(ioctl.c)): Unconditionally unset 1, simply print arg 12092 when (ret & RVAL_DECODED) && !(ret & 1). 12093 12094 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12095 Dmitry V. Levin <ldv (a] altlinux.org> 12096 12097 syscall.c: define personality names for all multi-personality architectures 12098 I see no reason for not having these definitions for SPARC64 and RISC-V. 12099 Also, borrow the check template from supported_personalities.h. 12100 12101 * syscall.c (update_personality) [defined RISCV, defined SPARC64] 12102 <PERSONALITY_NAMES>: Define it for these architectures. 12103 12104 2017-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12105 12106 copyright-year-gen: workaround for old git versions. 12107 Apply the same treatment to this script as the one in 12108 v4.18-278-g295cf32. 12109 12110 * copyright-year-gen <year>: Change format to format:%cD, remove --date, 12111 supply output as a -d option argument to date +%Y. 12112 12113 2017-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12114 12115 ubi: trim overly long lines. 12116 12117 term: use print_quoted_string. 12118 * term.c (decode_termios): Use print_quoted_string for printing c_cc field 12119 instead of writing the printing code by hand. 12120 12121 2017-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12122 12123 update_copyright_years.sh: workaround for old git versions. 12124 Old git versions (like the one shipped in Debian 8) do not support setting 12125 date format with --date, working this around by processing git log output 12126 with date +%Y. 12127 12128 * main/update_copyright_years.sh (process_file) <first_commit_year, 12129 last_commit_year>: Change format to format:%aD, remove --date, supply 12130 output as a -d option argument to date +%Y. 12131 12132 2017-08-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12133 12134 syscall: use spaces in tile personality names, de-duplicate definition. 12135 As Chris Metcalf, the author of v4.7-40-g0b99a8a, told in private, there 12136 is no strong reason for having tile's personality name different from 12137 personality names on other architectures, so let's use spaces instead of 12138 dashes here. And, while we are here, remove duplication of personality 12139 name definitions for various architectures. 12140 12141 * syscall.c (update_personality) [defined TILE]: Change dashes to spaces 12142 in personality names. 12143 12144 2017-08-26 JingPiao Chen <chenjingpiao (a] gmail.com> 12145 Dmitry V. Levin <ldv (a] altlinux.org> 12146 12147 tests: check decoding of rtmsg netlink attributes. 12148 * tests/nlattr_rtmsg.c: Include <netinet/in.h> and <arpa/inet.h>. 12149 (LWTUNNEL_ENCAP_NONE, RTA_ENCAP_TYPE): New macros. 12150 (main): Check decoding of RTA_DST, RTA_OIF, RTA_METRICS, RTA_MULTIPATH, 12151 RTA_CACHEINFO, RTA_MFC_STATS, RTA_VIA, and RTA_ENCAP_TYPE. 12152 12153 rtnl_route: decode rtmsg netlink attributes. 12154 * configure.ac (AC_CHECK_TYPES): Check for 12155 rta_mfc_stats and rtvia structures in <linux/rtnetlink.h>. 12156 * nlattr.c (decode_nla_ifindex): New function. 12157 * nlattr.h (decode_nla_ifindex): New prototype. 12158 * rtnl_route.c (decode_route_addr, decode_rta_metrics, 12159 decode_rta_multipath, decode_rta_cacheinfo, 12160 decode_rta_mfc_stats, decode_rtvia, 12161 decode_rta_encap_type): New functions. 12162 (rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays. 12163 (decode_rtmsg): Use rtmsg_nla_decoders. 12164 * xlat/lwtunnel_encap_types.in: New file. 12165 * xlat/route_nexthop_flags.in: Likewise. 12166 * xlat/rtnl_rta_metrics_attrs.in: Likewise. 12167 12168 2017-08-25 Dmitry V. Levin <ldv (a] altlinux.org> 12169 12170 s390: wire up s390_guarded_storage syscall. 12171 * linux/s390/syscallent.h [378]: Add s390_guarded_storage entry. 12172 * linux/s390x/syscallent.h: Likewise. 12173 12174 microblaze: wire up statx syscall. 12175 * linux/microblaze/syscallent.h [398]: Add statx entry. 12176 12177 2017-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 12178 12179 alloc_number_set_array: add ATTRIBUTE_MALLOC. 12180 * number_set.h: Include "gcc_compat.h". 12181 (alloc_number_set_array): Add ATTRIBUTE_MALLOC. 12182 12183 2017-08-24 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 12184 12185 Add macros for testing QUAL_* flags. 12186 * defs.h (traced, raw, inject): Add macros for testing QUAL_TRACE, 12187 QUAL_RAW, and QUAL_INJECT flags. 12188 * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use them. 12189 12190 2017-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 12191 12192 Remove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE. 12193 Remove these flags that are unused since commit v4.15~26. 12194 They might be introduced later with a different meaning. 12195 12196 * defs.h (QUAL_SIGNAL, QUAL_READ, QUAL_WRITE): Remove. 12197 12198 2017-08-24 Eugene Syromiatnikov <evgsyr (a] gmail.com> 12199 12200 xstrdup, xtrndup: allow NULL argument. 12201 Accept NULL argument in xstrdup and xtrndup functions to allow use 12202 of "xstrdup(str)" instead of "str ? xstrdup(str) : NULL". 12203 12204 * xmalloc.c (xstrdup, xstrndup): Handle NULL argument. 12205 * xmalloc.h: Add comment regarding this deviation from the behaviour 12206 of the POSIX counterparts of these functions. 12207 12208 2017-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 12209 12210 tests: really skip mips o32 scno tampering tests on mips n64. 12211 * tests/is_linux_mips_n64.c: New file. 12212 * tests/Makefile.am (check_PROGRAMS): Add it. 12213 * tests/scno_tampering.sh <$STRACE_ARCH == mips>: 12214 In case of mips o32 abi, skip the test if is_linux_mips_n64 says 12215 that the kernel is mips n64, even if "uname -m" claims it's mips. 12216 12217 2017-08-22 Dmitry V. Levin <ldv (a] altlinux.org> 12218 12219 Hide struct number_set implementation details from users. 12220 * number_set.h (number_slot_t, struct number_set): Move to number_set.c. 12221 (struct number_set): Add forward declaration. 12222 (read_set, write_set, signal_set): Change prototypes from objects 12223 to pointers. 12224 * filter_qualify.c (read_set, write_set, signal_set): Change definitions 12225 from objects to pointers. 12226 (abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change 12227 definitions from arrays to pointers. 12228 (qualify_read): Initialize read_set before first use. 12229 (qualify_write): Initialize write_set before first use. 12230 (qualify_signals): Initialize signal_set before first use. 12231 (qualify_trace): Initialize trace_set before first use. 12232 (qualify_abbrev): Initialize abbrev_set before first use. 12233 (qualify_verbose): Initialize verbose_set before first use. 12234 (qualify_raw): Initialize raw_set before first use. 12235 (qualify_inject_common): Initialize inject_set before first use. 12236 * strace.c (print_signalled, print_stopped): Update signal_set usage. 12237 * syscall.c (dumpio): Update usage of read_set and write_set. 12238 12239 Extend number_set interface. 12240 * number_set.h (number_set_array_is_empty, is_number_in_set_array, 12241 add_number_to_set_array, clear_number_set_array, 12242 invert_number_set_array, alloc_number_set_array, free_number_set_array): 12243 New function prototypes. 12244 * number_set.c (number_set_array_is_empty, is_number_in_set_array, 12245 add_number_to_set_array, clear_number_set_array, 12246 invert_number_set_array, alloc_number_set_array, free_number_set_array): 12247 New functions. 12248 * basic_filters.c (qualify_syscall_number, qualify_syscall_regex, 12249 qualify_syscall_class, qualify_syscall_name): Use 12250 add_number_to_set_array. 12251 (qualify_syscall_tokens, qualify_tokens): Use 12252 clear_number_set_array and invert_number_set_array. 12253 * filter_qualify.c (qualify_inject_common): Use alloc_number_set_array, 12254 number_set_array_is_empty, is_number_in_set_array, 12255 add_number_to_set_array, and free_number_set_array. 12256 (qual_flags): Use is_number_in_set_array. 12257 12258 Move number_set interface to separate files. 12259 * number_set.c: New file. 12260 * number_set.h: Likewise. 12261 * Makefile.am (strace_SOURCES): Add them. 12262 * basic_filters.c: Include "number_set.h". 12263 (number_slot_t, struct number_set): Move to number_set.h. 12264 (BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set, 12265 add_number_to_set, is_number_in_set): Move to number_set.c. 12266 * defs.h (struct number_set): Remove forward declaration. 12267 (read_set, write_set, signal_set, is_number_in_set): Move to number_set.h. 12268 * filter.h (add_number_to_set): Move to number_set.h. 12269 * filter_qualify.c: Include "number_set.h". 12270 (number_slot_t, struct number_set): Remove. 12271 * strace.c: Include "number_set.h". 12272 * syscall.c: Likewise. 12273 12274 2017-08-22 Edgar Kaziakhmedov <edgar.kaziakhmedov (a] virtuozzo.com> 12275 12276 Move SUPPORTED_PERSONALITIES to a separate file. 12277 Since the defs.h contains unrelated declarations which are 12278 redundant (and sometimes conflicting) for other binaries included 12279 in the strace package, move SUPPORTED_PERSONALITIES defintions 12280 to a separate file. 12281 12282 * defs.h: Include "supported_personalities.h". 12283 (SUPPORTED_PERSONALITIES): Move ... 12284 * supported_personalities.h: ... to the new file. 12285 * Makefile.am (strace_SOURCES): Add it. 12286 12287 2017-08-22 Edgar Kaziakhmedov <edgar.kaziakhmedov (a] virtuozzo.com> 12288 12289 Move string_to_uint* functions to a separate file. 12290 Make string_to_uint* functions available to other binaries 12291 included in the strace package. 12292 12293 * string_to_uint.h: New file. 12294 * defs.h: Include it. 12295 (string_to_uint_ex, string_to_uint_upto, string_to_uint): Move 12296 to string_to_uint.h. 12297 * util.c (string_to_uint_ex, string_to_uint): Move ... 12298 * string_to_uint.c: ... to the new file. 12299 * Makefile.am (strace_SOURCES): Add string_to_uint.h and string_to_uint.c. 12300 12301 2017-08-22 JingPiao Chen <chenjingpiao (a] gmail.com> 12302 12303 tests: check decoding of ifaddrmsg netlink attributes. 12304 * tests/nlattr_ifaddrmsg.c: Include <arpa/inet.h>. 12305 (IFA_FLAGS, SET_IFA_FAMILY): New macros. 12306 (init_ifaddrmsg): Set ifaddrmsg.ifa_family field from ifa_family. 12307 (print_ifaddrmsg): Print ifaddrmsg.ifa_family field using ifa_family_str. 12308 (main): Check decoding of IFA_ADDRESS, IFA_CACHEINFO, and IFA_FLAGS. 12309 12310 rtnl_addr: decode ifaddrmsg netlink attributes. 12311 * rtnl_addr.c (decode_ifa_address, 12312 decode_ifa_cacheinfo, decode_ifa_flags): New functions. 12313 (ifaddrmsg_nla_decoders): New array. 12314 (decode_ifaddrmsg): Use it. 12315 12316 2017-08-22 Dmitry V. Levin <ldv (a] altlinux.org> 12317 12318 Export decode_inet_addr. 12319 * defs.h (decode_inet_addr): New prototype. 12320 * netlink_inet_diag.c (decode_inet_addr): Remove static keyword, move ... 12321 * sockaddr.c: ... here. 12322 12323 netlink_inet_diag: prepare decode_inet_addr for export. 12324 * netlink_inet_diag.c (decode_inet_addr): Change return type to bool, 12325 parametrize field name using new var_name argument. 12326 (decode_inet_diag_hostcond): Specify "addr" field name 12327 to decode_inet_addr. 12328 12329 2017-08-20 Dmitry V. Levin <ldv (a] altlinux.org> 12330 12331 print_inet_addr: add support of invocations without field name. 12332 Prepare print_inet_addr for use in structureless contexts where 12333 no structure field name is available. 12334 12335 * sockaddr.c (print_inet_addr): Handle var_name == NULL. 12336 12337 2017-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 12338 12339 print_inet_addr: print address of unsupported family in hex. 12340 * sockaddr.c (print_inet_addr): Specify QUOTE_FORCE_HEX 12341 to print_quoted_string. 12342 12343 2017-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 12344 12345 mips o32: do not bail out in get_syscall_args if umoven fails. 12346 If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, 12347 both PTRACE_PEEKDATA and process_vm_readv become unavailable when the 12348 process dumpable flag is cleared. As the first 4 syscall arguments are 12349 still available via registers, do not treat this as get_syscall_args 12350 error. 12351 12352 This condition is triggered and therefore tested by prctl-dumpable test. 12353 12354 * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSO32]: 12355 Do not bail out if umoven fails. 12356 12357 2017-08-17 Dmitry V. Levin <ldv (a] altlinux.org> 12358 12359 configure: cleanup struct statfs/statfs64 member checks. 12360 * configure.ac <AC_CHECK_TYPES([struct statfs])>: Merge several 12361 AC_CHECK_MEMBERS checks of struct statfs members into a single check. 12362 <AC_CHECK_TYPES([struct statfs64])>: Likewise, for checks 12363 of struct statfs64 members. 12364 12365 2017-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 12366 12367 tests: fix a few harmless -Woverflow compilation warnings. 12368 Fix the following compilation warnings on platforms where 12369 sizeof(struct timeval.tv_usec) < sizeof(long): 12370 12371 xettimeofday.c: In function main: 12372 xettimeofday.c:76:16: warning: overflow in implicit constant conversion [-Woverflow] 12373 tv->tv_usec = (long) 0xbadc0dedfacefeedLL; 12374 xetitimer.c: In function main: 12375 xetitimer.c:170:28: warning: overflow in implicit constant conversion [-Woverflow] 12376 p_new->it_value.tv_usec = (long) 0xbadc0dedfacefeedLL; 12377 In file included from utimes.c:38:0: 12378 xutimes.c: In function main: 12379 xutimes.c:110:18: warning: overflow in implicit constant conversion [-Woverflow] 12380 tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL; 12381 futimesat.c: In function main: 12382 futimesat.c:121:18: warning: overflow in implicit constant conversion [-Woverflow] 12383 tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL; 12384 In file included from _newselect.c:35:0: 12385 xselect.c: In function main: 12386 xselect.c:94:16: warning: overflow in implicit constant conversion [-Woverflow] 12387 tv->tv_usec = (long) 0xbadc0dedfacefeedLL; 12388 ^ 12389 * tests/futimesat.c (main): In initialization of struct timeval.tv_usec, 12390 change explicit cast from (long) to (suseconds_t). 12391 * tests/xetitimer.c: Likewise. 12392 * tests/xettimeofday.c: Likewise. 12393 * tests/xselect.c: Likewise. 12394 * tests/xutimes.c: Likewise. 12395 12396 Reported-by: Anatoly Pugachev <matorola (a] gmail.com> 12397 12398 2017-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 12399 12400 tests: fix sigaction.test on sparc. 12401 On sparc, the first argument of old sigaction syscall has negated 12402 semantics, compared to other architectures. While sigaction.test 12403 was aware about this arch-specific detail from the beginning, in one 12404 of many sigaction syscall invocations a non-negative signal number 12405 was erroneously passed on sparc. 12406 12407 * tests/sigaction.c (ADDR_INT, SIGNO_INT): New arch-specific macros. 12408 (signo, addr): Use them. 12409 12410 2017-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 12411 12412 nlattr: fix printing of unrecognized attribute data. 12413 Do not print more than "nlattr.nla_len - NLA_HDRLEN" bytes 12414 of unrecognized attribute data. 12415 12416 * nlattr.c (decode_nlattr_with_data): Specify "nla_len - NLA_HDRLEN" 12417 instead of "len - NLA_HDRLEN" as the size of unrecognized attribute 12418 data. 12419 * tests/nlattr.c (test_nlattr): Check it. 12420 12421 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12422 12423 tests: check decoding of NETLINK_ROUTE rtgenmsg attributes. 12424 * tests/nlattr_rtgenmsg.c: New file. 12425 * tests/gen_tests.in (nlattr_rtgenmsg): New entry. 12426 * tests/pure_executables.list: Add nlattr_rtgenmsg. 12427 * tests/.gitignore: Likewise. 12428 12429 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12430 Fabien Siron <fabien.siron (a] epita.fr> 12431 12432 netlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes. 12433 * rtnl_nsid.c: Include "nlattr.h" and "xlat/rtnl_nsid_attrs.h". 12434 (decode_rtgenmsg): Call decode_nlattr. 12435 * xlat/rtnl_nsid_attrs.in: New file. 12436 12437 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12438 12439 tests: check decoding of NETLINK_ROUTE br_port_msg attributes. 12440 * tests/nlattr_br_port_msg.c: New file. 12441 * tests/gen_tests.in (nlattr_br_port_msg): New entry. 12442 * tests/pure_executables.list: Add nlattr_br_port_msg. 12443 * tests/.gitignore: Likewise. 12444 12445 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12446 Fabien Siron <fabien.siron (a] epita.fr> 12447 12448 netlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes. 12449 * rtnl_mdb.c: Include "netlink.h", "nlattr.h". 12450 and "xlat/rtnl_mdb_attrs.h". 12451 (decode_br_port_msg): Call decode_nlattr. 12452 * xlat/rtnl_mdb_attrs.in: New file. 12453 12454 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12455 12456 tests: check decoding of NETLINK_ROUTE netconfmsg attributes. 12457 * tests/nlattr_netconfmsg.c: New file. 12458 * tests/gen_tests.in (nlattr_netconfmsg): New entry. 12459 * tests/pure_executables.list: Add nlattr_netconfmsg. 12460 * tests/.gitignore: Likewise. 12461 12462 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12463 Fabien Siron <fabien.siron (a] epita.fr> 12464 12465 netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes. 12466 * rtnl_netconf.c: Include "netlink.h", "nlattr.h", 12467 and "xlat/rtnl_netconf_attrs.h". 12468 (decode_netconfmsg): Call decode_nlattr. 12469 * xlat/rtnl_netconf_attrs.in: New file. 12470 12471 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12472 12473 tests: check decoding of NETLINK_ROUTE dcbmsg attributes. 12474 * tests/nlattr_dcbmsg.c: New file. 12475 * tests/gen_tests.in (nlattr_dcbmsg): New entry. 12476 * tests/pure_executables.list: Add nlattr_dcbmsg. 12477 * tests/.gitignore: Likewise. 12478 12479 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12480 Fabien Siron <fabien.siron (a] epita.fr> 12481 12482 netlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes. 12483 * rtnl_dcb.c: Include "netlink.h", "nlattr.h", 12484 and "xlat/rtnl_dcb_attrs.h". 12485 (decode_dcbmsg): Call decode_nlattr. 12486 * xlat/rtnl_dcb_attrs.in: New file. 12487 12488 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12489 12490 tests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes. 12491 * tests/nlattr_ifaddrlblmsg.c: New file. 12492 * tests/gen_tests.in (nlattr_ifaddrlblmsg): New entry. 12493 * tests/pure_executables.list: Add nlattr_ifaddrlblmsg. 12494 * tests/.gitignore: Likewise. 12495 12496 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12497 Fabien Siron <fabien.siron (a] epita.fr> 12498 12499 netlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes. 12500 * rtnl_addrlabel.c: Include "netlink.h", "nlattr.h", 12501 and "xlat/rtnl_addrlabel_attrs.h". 12502 (decode_ifaddrlblmsg): Call decode_nlattr. 12503 * xlat/rtnl_addrlabel_attrs.in: New file. 12504 12505 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12506 12507 tests: check decoding of NETLINK_ROUTE tcamsg attributes. 12508 * tests/nlattr_tcamsg.c: New file. 12509 * tests/gen_tests.in (nlattr_tcamsg): New entry. 12510 * tests/pure_executables.list: Add nlattr_tcamsg. 12511 * tests/.gitignore: Likewise. 12512 12513 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12514 Fabien Siron <fabien.siron (a] epita.fr> 12515 12516 netlink: add basic decoding of NETLINK_ROUTE tcamsg attributes. 12517 * rtnl_tc_action.c: Include "nlattr.h" and "xlat/rtnl_tc_action_attrs.h". 12518 (decode_tcamsg): Call decode_nlattr. 12519 * xlat/rtnl_tc_action_attrs.in: New file. 12520 12521 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12522 12523 tests: check decoding of NETLINK_ROUTE tcmsg attributes. 12524 * tests/nlattr_tcmsg.c: New file. 12525 * tests/gen_tests.in (nlattr_tcmsg): New entry. 12526 * tests/pure_executables.list: Add nlattr_tcmsg. 12527 * tests/.gitignore: Likewise. 12528 12529 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12530 Fabien Siron <fabien.siron (a] epita.fr> 12531 12532 netlink: add basic decoding of NETLINK_ROUTE tcmsg attributes. 12533 * rtnl_tc.c: Include "nlattr.h" and "xlat/rtnl_tc_attrs.h". 12534 (decode_tcmsg): Call decode_nlattr. 12535 * xlat/rtnl_tc_attrs.in: New file. 12536 12537 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12538 12539 tests: check decoding of NETLINK_ROUTE ndtmsg attributes. 12540 * tests/nlattr_ndtmsg.c: New file. 12541 * tests/gen_tests.in (nlattr_ndtmsg): New entry. 12542 * tests/pure_executables.list: Add nlattr_ndtmsg. 12543 * tests/.gitignore: Likewise. 12544 12545 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12546 Fabien Siron <fabien.siron (a] epita.fr> 12547 12548 netlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes. 12549 * rtnl_neightbl.c: Include "nlattr.h" and "xlat/rtnl_neightbl_attrs.h". 12550 (decode_ndtmsg): Call decode_nlattr. 12551 * xlat/rtnl_neightbl_attrs.in: New file. 12552 12553 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12554 12555 tests: check decoding of NETLINK_ROUTE ndmsg attributes. 12556 * tests/nlattr_ndmsg.c: New file. 12557 * tests/gen_tests.in (nlattr_ndmsg): New entry. 12558 * tests/pure_executables.list: Add nlattr_ndmsg. 12559 * tests/.gitignore: Likewise. 12560 12561 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12562 Fabien Siron <fabien.siron (a] epita.fr> 12563 12564 netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes. 12565 * rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h". 12566 (decode_ndmsg): Call decode_nlattr. 12567 * xlat/rtnl_neigh_attrs.in: New file. 12568 12569 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12570 12571 tests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes. 12572 * tests/nlattr_fib_rule_hdr.c: New file. 12573 * tests/gen_tests.in (nlattr_fib_rule_hdr): New entry. 12574 * tests/pure_executables.list: Add nlattr_fib_rule_hdr. 12575 * tests/.gitignore: Likewise. 12576 12577 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12578 Fabien Siron <fabien.siron (a] epita.fr> 12579 12580 netlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes. 12581 * rtnl_rule.c: Include "nlattr.h" and "xlat/rtnl_rule_attrs.h". 12582 (decode_fib_rule_hdr): Call decode_nlattr. 12583 * xlat/rtnl_rule_attrs.in: New file. 12584 12585 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12586 12587 tests: check decoding of NETLINK_ROUTE rtmsg attributes. 12588 * tests/nlattr_rtmsg.c: New file. 12589 * tests/gen_tests.in (nlattr_rtmsg): New entry. 12590 * tests/pure_executables.list: Add nlattr_rtmsg. 12591 * tests/.gitignore: Likewise. 12592 12593 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12594 Fabien Siron <fabien.siron (a] epita.fr> 12595 12596 netlink: add basic decoding of NETLINK_ROUTE rtmsg attributes. 12597 * rtnl_route.c: Include "nlattr.h" and "xlat/rtnl_route_attrs.h". 12598 (decode_rtmsg): Call decode_nlattr. 12599 * xlat/rtnl_route_attrs.in: New file. 12600 12601 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12602 12603 tests: check decoding of NETLINK_ROUTE ifaddrmsg attributes. 12604 * tests/nlattr_ifaddrmsg.c: New file. 12605 * tests/gen_tests.in (nlattr_ifaddrmsg): New entry. 12606 * tests/pure_executables.list: Add nlattr_ifaddrmsg. 12607 * tests/.gitignore: Likewise. 12608 12609 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12610 Fabien Siron <fabien.siron (a] epita.fr> 12611 12612 netlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes. 12613 * rtnl_addr.c: Include "nlattr.h" and "xlat/rtnl_addr_attrs.h". 12614 (decode_ifaddrmsg): Call decode_nlattr. 12615 * xlat/rtnl_addr_attrs.in: New file. 12616 12617 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12618 12619 tests: check decoding of NETLINK_ROUTE ifinfomsg attributes. 12620 * tests/nlattr_ifinfomsg.c: New file. 12621 * tests/gen_tests.in (nlattr_ifinfomsg): New entry. 12622 * tests/pure_executables.list: Add nlattr_ifinfomsg. 12623 * tests/.gitignore: Likewise. 12624 12625 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12626 Fabien Siron <fabien.siron (a] epita.fr> 12627 12628 netlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes. 12629 * rtnl_link.c: Include "nlattr.h" and "xlat/rtnl_link_attrs.h". 12630 (decode_ifinfomsg): Call decode_nlattr. 12631 * xlat/rtnl_link_attrs.in: New file. 12632 12633 2017-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 12634 12635 tests/test_nlattr.h: include <stdint.h> 12636 * tests/test_nlattr.h: Include <stdint.h> for definition of uint16_t 12637 used by init_nlattr. 12638 12639 tests: use ifindex_lo and IFINDEX_LO_STR. 12640 * tests/netlink_route.c: Do not check for HAVE_IF_INDEXTONAME. 12641 (if_nametoindex, IFINDEX_LO): Remove. 12642 (test_rtnl_link, test_rtnl_addr, test_rtnl_neigh, test_rtnl_tc, 12643 test_rtnl_addrlabel, test_rtnl_mdb): Use ifindex_lo instead 12644 of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. 12645 * tests/netlink_sock_diag.c: Do not check for HAVE_IF_INDEXTONAME. 12646 (if_nametoindex, IFINDEX_LO): Remove. 12647 (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2, 12648 test_inet_diag_msg, test_smc_diag_req): Use ifindex_lo instead 12649 of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. 12650 * tests/nlattr_inet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME. 12651 (if_nametoindex, IFINDEX_LO): Remove. 12652 (init_inet_diag_msg): Use ifindex_lo instead of if_nametoindex. 12653 (print_inet_diag_msg): Use IFINDEX_LO_STR instead of hardcoded string. 12654 * tests/nlattr_inet_diag_req_compat.c: Do not check 12655 for HAVE_IF_INDEXTONAME. 12656 (if_nametoindex, IFINDEX_LO): Remove. 12657 (init_inet_diag_req): Use ifindex_lo instead of if_nametoindex. 12658 (print_inet_diag_req): Use IFINDEX_LO_STR instead of hardcoded string. 12659 * tests/nlattr_inet_diag_req_v2.c: Do not check for HAVE_IF_INDEXTONAME. 12660 (if_nametoindex, IFINDEX_LO): Remove. 12661 (init_inet_diag_req_v2, print_inet_diag_req_v2, 12662 test_inet_diag_bc_dev_cond): Use ifindex_lo instead of if_nametoindex, 12663 use IFINDEX_LO_STR instead of hardcoded string. 12664 * tests/nlattr_packet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME. 12665 (if_nametoindex, IFINDEX_LO): Remove. 12666 (main): Use ifindex_lo instead of if_nametoindex. 12667 (print_packet_diag_mclist): Use IFINDEX_LO_STR instead of hardcoded 12668 string. 12669 12670 tests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR. 12671 * tests/net-sockaddr.c (if_nametoindex): Remove declaration. 12672 (check_in6_linklocal, check_ll): Remove HAVE_IF_INDEXTONAME checks, 12673 Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR instead 12674 of hardcoded string. 12675 12676 tests/msg_control: use ifindex_lo and IFINDEX_LO_STR. 12677 * tests/msg_control.c (test_ip_pktinfo): Use ifindex_lo instead 12678 of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. 12679 12680 tests/inet-cmsg: use IFINDEX_LO_STR. 12681 * tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead 12682 of hardcoded string. 12683 12684 tests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR. 12685 * tests/ip_mreq.c: Do not check for HAVE_IF_INDEXTONAME. 12686 (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR 12687 instead of hardcoded string. 12688 12689 tests/group_req: use ifindex_lo and IFINDEX_LO_STR. 12690 * tests/group_req.c: Do not check for HAVE_IF_INDEXTONAME. 12691 (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR 12692 instead of hardcoded string. 12693 12694 tests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests. 12695 * tests/ifindex.c: New file. 12696 * tests/Makefile.am (libtests_a_SOURCES): Add it. 12697 * tests/tests.h (ifindex_lo): New prototype. 12698 (IFINDEX_LO_STR): New macro. 12699 12700 2017-08-15 JingPiao Chen <chenjingpiao (a] gmail.com> 12701 12702 configure.ac: remove redundant linux/dcbnl.h header check. 12703 * configure.ac (AC_CHECK_HEADERS): Remove linux/dcbnl.h. 12704 * rtnl_dcb.c: Replace HAVE_LINUX_DCBNL_H with HAVE_STRUCT_DCBMSG. 12705 * tests/netlink_route.c: Likewise. 12706 12707 2017-08-14 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12708 12709 pathtrace: fix typo in comment. 12710 12711 pathtrace: limit amount of checked poll fds similarly to select limit. 12712 * pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number 12713 checked for fd match in poll family syscalls to 1024 * 1024. 12714 12715 pathtrace: fail poll path match on first failed umove. 12716 * pathtrace.c (pathtrace_match_set): When checking descriptors of poll 12717 family syscalls for fd match, break the loop on first failed umove call. 12718 12719 2017-08-14 JingPiao Chen <chenjingpiao (a] gmail.com> 12720 12721 Update NEWS. 12722 12723 2017-08-14 JingPiao Chen <chenjingpiao (a] gmail.com> 12724 Fabien Siron <fabien.siron (a] epita.fr> 12725 12726 tests: check decoding of rtnetlink nsid messages. 12727 * tests/netlink_route.c (test_rtnl_nsid): New function. 12728 (main): Use it. 12729 12730 netlink: add a basic rtnetlink parser of nsid messages. 12731 * rtnl_nsid.c: New file. 12732 * Makefile.am (strace_SOURCES): Add it. 12733 * netlink_route.h (decode_rtgenmsg): New prototype. 12734 * netlink_route.c (route_decoders): Add RTM_DELNSID, RTM_GETNSID, 12735 and RTM_NEWNSID. 12736 12737 tests: check decoding of rtnetlink mdb messages. 12738 * tests/netlink_route.c: Include <netinet/in.h> 12739 and <linux/if_bridge.h>. 12740 (test_rtnl_mdb): New function. 12741 (main): Use it. 12742 12743 netlink: add a basic rtnetlink parser of mdb messages. 12744 * rtnl_mdb.c: New file. 12745 * Makefile.am (strace_SOURCES): Add it. 12746 * netlink_route.h (decode_br_port_msg): New prototype. 12747 * configure.ac (AC_CHECK_TYPES): Check for struct br_port_msg 12748 in <linux/if_bridge.h>. 12749 * netlink_route.c (route_decoders): Add RTM_DELMDB, RTM_GETMDB, 12750 and RTM_NEWMDB. 12751 12752 tests: check decoding of rtnetlink netconf messages. 12753 * tests/netlink_route.c: Include <linux/netconf.h>. 12754 (test_rtnl_netconf): New function. 12755 (main): Use it. 12756 12757 netlink: add a basic rtnetlink parser of netconf messages. 12758 * rtnl_netconf.c: New file. 12759 * Makefile.am (strace_SOURCES): Add it. 12760 * netlink_route.h (decode_netconfmsg): New prototype. 12761 * configure.ac (AC_CHECK_TYPES): Check for struct netconfmsg 12762 in <linux/netconf.h>. 12763 * netlink_route.c (route_decoders): Add RTM_GETNETCONF 12764 and RTM_NEWNETCONF. 12765 12766 tests: check decoding of rtnetlink dcb messages. 12767 * tests/netlink_route.c: Include <linux/dcbnl.h>. 12768 (test_rtnl_dcb): New function. 12769 (main): Use it. 12770 12771 netlink: add a basic rtnetlink parser of dcb messages. 12772 * rtnl_dcb.c: New file. 12773 * Makefile.am (strace_SOURCES): Add it. 12774 * netlink_route.h (decode_dcbmsg): New prototype. 12775 * configure.ac (AC_CHECK_HEADERS): Add linux/dcbnl.h. 12776 (AC_CHECK_TYPES): Check for struct dcbmsg in <linux/dcbnl.h>. 12777 * netlink_route.c (route_decoders): Add RTM_GETDCB and RTM_SETDCB. 12778 * xlat/dcb_commands.in: New file. 12779 12780 tests: check decoding of rtnetlink addrlabel messages. 12781 * tests/netlink_route.c: Include <linux/if_addrlabel.h>. 12782 (test_rtnl_addrlabel): New function. 12783 (main): Use it. 12784 12785 netlink: add a basic rtnetlink parser of addrlabel messages. 12786 * rtnl_addrlabel.c: New file. 12787 * Makefile.am (strace_SOURCES): Add it. 12788 * netlink_route.h (decode_ifaddrlblmsg): New prototype. 12789 * configure.ac (AC_CHECK_TYPES): Check for struct ifaddrlblmsg 12790 in <linux/if_addrlabel.h>. 12791 * netlink_route.c (route_decoders): Add RTM_DELADDRLABEL, 12792 RTM_GETADDRLABEL, and RTM_NEWADDRLABEL. 12793 12794 tests: check decoding of rtnetlink tc action messages. 12795 * tests/netlink_route.c (test_rtnl_tca): New function. 12796 (main): Use it. 12797 12798 netlink: add a basic rtnetlink parser of tc action messages. 12799 * rtnl_tc_action.c: New file. 12800 * Makefile.am (strace_SOURCES): Add it. 12801 * netlink_route.h (decode_tcamsg): New prototype. 12802 * netlink_route.c (route_decoders): Add RTM_DELACTION, RTM_GETACTION, 12803 and RTM_NEWACTION. 12804 12805 tests: check decoding of rtnetlink tc messages. 12806 * tests/netlink_route.c (test_rtnl_tc): New function. 12807 (main): Use it. 12808 12809 netlink: add a basic rtnetlink parser of tc messages. 12810 * rtnl_tc.c: New file. 12811 * Makefile.am (strace_SOURCES): Add it. 12812 * netlink_route.h (decode_tcmsg): New prototype. 12813 * netlink_route.c (route_decoders): Add RTM_DELQDISC, 12814 RTM_GETQDISC, RTM_NEWQDISC, RTM_DELTCLASS, RTM_GETTCLASS, 12815 RTM_NEWTCLASS, RTM_DELTFILTER, RTM_GETTFILTER, and RTM_NEWTFILTER. 12816 12817 tests: check decoding of rtnetlink neightbl messages. 12818 * tests/netlink_route.c (test_rtnl_neightbl): New function. 12819 (main): Use it. 12820 12821 netlink: add a basic rtnetlink parser of neightbl messages. 12822 * rtnl_neightbl.c: New file. 12823 * Makefile.am (strace_SOURCES): Add it. 12824 * netlink_route.h (decode_ndtmsg): New prototype. 12825 * netlink_route.c (route_decoders): Add RTM_GETNEIGHTBL, 12826 RTM_NEWNEIGHTBL, and RTM_SETNEIGHTBL. 12827 12828 tests: check decoding of rtnetlink neigh messages. 12829 * tests/netlink_route.c: Include <linux/neighbour.h>. 12830 (test_rtnl_neigh): New function. 12831 (main): Use it. 12832 12833 netlink: add a basic rtnetlink parser of neigh messages. 12834 * rtnl_neigh.c: New file. 12835 * Makefile.am (strace_SOURCES): Add it. 12836 * netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes. 12837 * configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h. 12838 * netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH, 12839 and RTM_NEWNEIGH. 12840 * xlat/nda_types.in: New file. 12841 * xlat/neighbor_cache_entry_flags.in: Likewise. 12842 * xlat/neighbor_cache_entry_states.in: Likewise. 12843 12844 tests: check decoding of rtnetlink rule messages. 12845 * tests/netlink_route.c: Include <linux/fib_rules.h>. 12846 (test_rtnl_rule): New function. 12847 (main): Use it. 12848 12849 netlink: add a basic rtnetlink parser of rule messages. 12850 * defs.h (routing_table_ids): New xlat prototype. 12851 * rtnl_rule.c: New file. 12852 * Makefile.am (strace_SOURCES): Add it. 12853 * defs.h (ip_type_of_services, routing_table_ids): New xlat prototypes. 12854 * netlink_route.h (decode_fib_rule_hdr): New prototype. 12855 * configure.ac (AC_CHECK_HEADERS): Add linux/fib_rules.h. 12856 * netlink_route.c (route_decoders): Add RTM_DELRULE, RTM_GETRULE, 12857 and RTM_NEWRULE. 12858 * xlat/fib_rule_actions.in: New file. 12859 * xlat/fib_rule_flags.in: Likewise. 12860 12861 tests: check decoding of rtnetlink route messages. 12862 * tests/netlink_route.c: Include <linux/ip.h>. 12863 (test_rtnl_route): New function. 12864 (main): Use it. 12865 12866 netlink: add a basic rtnetlink parser of route messages. 12867 * defs.h (routing_scopes): New xlat prototype. 12868 * rtnl_route.c: New file. 12869 * Makefile.am (strace_SOURCES): Add it. 12870 * netlink_route.h (decode_rtmsg): New prototype. 12871 * netlink_route.c (route_decoders): Add RTM_DELROUTE, RTM_GETROUTE, 12872 and RTM_NEWROUTE. 12873 * xlat/ip_type_of_services.in: New file. 12874 * xlat/routing_flags.in: Likewise. 12875 * xlat/routing_protocols.in: Likewise. 12876 * xlat/routing_table_ids.in: Likewise. 12877 * xlat/routing_types.in: Likewise. 12878 12879 tests: check decoding of rtnetlink addr messages. 12880 * tests/netlink_route.c: Include <linux/if_addr.h>. 12881 (test_rtnl_addr): New function. 12882 (main): Use it. 12883 12884 2017-08-13 JingPiao Chen <chenjingpiao (a] gmail.com> 12885 Fabien Siron <fabien.siron (a] epita.fr> 12886 12887 netlink: add a basic rtnetlink parser of addr messages. 12888 * rtnl_addr.c: New file. 12889 * Makefile.am (strace_SOURCES): Add it. 12890 * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h. 12891 * netlink_route.h (decode_ifaddrmsg): New prototype. 12892 * netlink_route.c (route_decoders): Add RTM_DELADDR, 12893 RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST, and RTM_NEWADDR. 12894 * xlat/ifaddrflags.in: New file. 12895 * xlat/routing_scopes.in: Likewise. 12896 12897 2017-08-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12898 12899 Make description of discrepancies between libc and kernel APIs more relevant 12900 Looks like this part was untouched since the days strace supported OSes 12901 other than Linux. Well, it's time to make it more contemporary. 12902 12903 * strace.1.in (.SH NOTES): Use faccessat(2) and setrlimit(2)/prlimit(2) 12904 instead of time(2) and stat(2)/xstat(2) as examples of libc/kernel API 12905 discrepancies. 12906 12907 2017-08-11 JingPiao Chen <chenjingpiao (a] gmail.com> 12908 12909 tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE. 12910 * tests/netlink_route.c (test_nlmsg_done): New function. 12911 (main): Use it. 12912 12913 2017-08-11 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 12914 12915 Add TF flag to inotify_add_watch syscall entries. 12916 The second argument of the inotify_add_watch syscall is a file name, 12917 but inotify_add_watch has no TF flag set. 12918 12919 * linux/32/syscallent.h (inotify_add_watch): Add TF flag. 12920 * linux/64/syscallent.h: Likewise. 12921 * linux/alpha/syscallent.h: Likewise. 12922 * linux/arm/syscallent.h: Likewise. 12923 * linux/avr32/syscallent.h: Likewise. 12924 * linux/bfin/syscallent.h: Likewise. 12925 * linux/crisv10/syscallent.h: Likewise. 12926 * linux/hppa/syscallent.h: Likewise. 12927 * linux/i386/syscallent.h: Likewise. 12928 * linux/ia64/syscallent.h: Likewise. 12929 * linux/m68k/syscallent.h: Likewise. 12930 * linux/microblaze/syscallent.h: Likewise. 12931 * linux/mips/syscallent-n32.h: Likewise. 12932 * linux/mips/syscallent-n64.h: Likewise. 12933 * linux/mips/syscallent-o32.h: Likewise. 12934 * linux/powerpc/syscallent.h: Likewise. 12935 * linux/powerpc64/syscallent.h: Likewise. 12936 * linux/s390/syscallent.h: Likewise. 12937 * linux/s390x/syscallent.h: Likewise. 12938 * linux/sh/syscallent.h: Likewise. 12939 * linux/sh64/syscallent.h: Likewise. 12940 * linux/sparc/syscallent.h: Likewise. 12941 * linux/sparc64/syscallent.h: Likewise. 12942 * linux/x32/syscallent.h: Likewise. 12943 * linux/x86_64/syscallent.h: Likewise. 12944 * linux/xtensa/syscallent.h: Likewise. 12945 12946 2017-08-11 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 12947 12948 pathtrace: fix matching of execveat syscall. 12949 * pathtrace.c (pathtrace_match_set): Add testing of SEN_execveat. 12950 12951 2017-08-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12952 12953 strace.1: add indentation to examples. 12954 * strace.1 (.de CW): Add .in +4n. 12955 (.de CE): Add .in. 12956 12957 Generate date for the man page. 12958 * Makefile.am (dist-hook): Add .strace.1.in.date generation. 12959 * strace.spec.in (%setup): Likewise. 12960 * configure.ac (manpage_date): New m4 define. 12961 (MANPAGE_DATE): New define/subst. 12962 * strace.1 (.TH): Add manpage date and strace's version. 12963 12964 Add script for generating date of the last commit for specific file. 12965 * file-date-gen: New auxiliary script. 12966 12967 Make strace.1 generated. 12968 * .gitignore (/strace.1): New entry. 12969 * configure.ac (AC_CONFIG_FILES): Add strace.1. 12970 * strace.1.in: Rename from strace.1. 12971 12972 2017-08-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12973 12974 strace.1: format synopsis using .SY/.OP macros. 12975 Also, add .OM and .OR macros and use { ... | ... } syntax for indicating 12976 possible options regarding mandatory arguments. 12977 12978 * strace.1 (.OM, .OR): New macro definitions, based on .OP 12979 (.SH SYNOPSYS): Format using .SY/.OP/.OM/.OR. Put -p/command inside 12980 { ... | ... } block. 12981 12982 2017-08-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12983 12984 strace.1: remove date from .TH, as it is no longer relevant. 12985 * strace.1 (.TH): Remove date. 12986 12987 2017-08-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12988 12989 strace.1: remove .IX definition. 12990 It is present in groff macros nowadays. 12991 12992 * strace.1 (.de IX): Remove. 12993 12994 2017-08-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 12995 12996 strace.1: replace .TP with .TQ between command-line option variants. 12997 In order to eliminate unneeded space between them. 12998 12999 * strace.1 (Filtering): Replace .TP with .TQ between different variants 13000 of the same option. 13001 13002 2017-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 13003 13004 rtnl_link: include "netlink.h" before <linux/rtnetlink.h> 13005 <sys/socket.h> has to be included before <linux/netlink.h> because 13006 the latter used to be incomplete in older kernel headers. 13007 13008 As a local wrapper file called netlink.h was introduced earlier 13009 to workaround this and related portability issues, include it before 13010 <linux/rtnetlink.h> that in turn includes <linux/netlink.h>. 13011 13012 This fixes build on systems with older kernel headers. 13013 13014 * rtnl_link.c: Include "netlink.h" before <linux/rtnetlink.h>. 13015 13016 2017-08-09 JingPiao Chen <chenjingpiao (a] gmail.com> 13017 Fabien Siron <fabien.siron (a] epita.fr> 13018 13019 tests: check decoding of rtnetlink link messages. 13020 * tests/netlink_route.c: Include <linux/if_arp.h>. 13021 (TEST_NL_ROUTE): New macro. 13022 (test_rtnl_link): New function. 13023 (main): Use it. 13024 13025 netlink: add a basic rtnetlink parser of link messages. 13026 * netlink_route.h: New file. 13027 * rtnl_link.c: Likewise. 13028 * Makefile.am (strace_SOURCES): Add them. 13029 * defs.h (arp_hardware_types, iffflags): New xlat prototypes. 13030 * netlink_route.c: Include "netlink_route.h" 13031 and <linux/rtnetlink.h>. 13032 (netlink_route_decoder_t): New typedef. 13033 (route_decoders): New array. 13034 (decode_netlink_route): Use it. 13035 13036 2017-08-09 JingPiao Chen <chenjingpiao (a] gmail.com> 13037 13038 Move nl_route_types definition from netlink.c to netlink_route.c. 13039 The side effect of #include "xlat/nl_route_types.h" is 13040 RTM_* constants properly defined in that header file. 13041 While netlink.c does not use these constants itself, 13042 netlink_route.c is going to need them soon. 13043 13044 * defs.h (nl_route_types): New xlat prototype. 13045 * netlink.c: Move inclusion of "xlat/nl_route_types.h" ... 13046 * netlink_route.c: ... here. 13047 13048 2017-08-09 JingPiao Chen <chenjingpiao (a] gmail.com> 13049 Fabien Siron <fabien.siron (a] epita.fr> 13050 13051 tests: check netlink family specific decoder of NETLINK_ROUTE. 13052 * tests/netlink_route.c: Include <stdint.h>, 13053 include "test_netlink.h" instead of "netlink.h". 13054 (test_rtnl_unspec): New function. 13055 (main): Use it. 13056 13057 netlink: introduce family specific decoder of NETLINK_ROUTE. 13058 * netlink_route.c: New file. 13059 * Makefile.am (strace_SOURCES): Add it. 13060 * defs.h (decode_netlink_route): New prototype. 13061 * netlink.c (netlink_decoders): Add NETLINK_ROUTE. 13062 13063 2017-08-08 JingPiao Chen <chenjingpiao (a] gmail.com> 13064 Dmitry V. Levin <ldv (a] altlinux.org> 13065 13066 tests: check decoding of NETLINK_KOBJECT_UEVENT messages. 13067 * tests/netlink_kobject_uevent.c: New file. 13068 * tests/gen_tests.in (netlink_kobject_uevent): New entry. 13069 * tests/pure_executables.list: Add netlink_kobject_uevent. 13070 * tests/.gitignore: Likewise. 13071 13072 2017-08-08 JingPiao Chen <chenjingpiao (a] gmail.com> 13073 13074 netlink: add decoding of NETLINK_KOBJECT_UEVENT messages. 13075 * netlink.c (decode_netlink): Print NETLINK_KOBJECT_UEVENT messages 13076 as a string using printstrn. 13077 13078 2017-08-08 JingPiao Chen <chenjingpiao (a] gmail.com> 13079 13080 netlink: call get_fd_nl_family before nlmsghdr decoding. 13081 Prepare for decoding of NETLINK_KOBJECT_UEVENT. Messages of the latter, 13082 unlike traditional netlink families, don't contain a header at all. 13083 13084 * netlink.c (NL_FAMILY_*): Remove enum. 13085 (get_fd_nl_family): Replace NL_FAMILY_ERROR with -1. 13086 (decode_nlmsg_type): Update the comment. 13087 Skip family specific type decoders for type < NLMSG_MIN_TYPE. 13088 (decode_nlmsghdr_with_payload): Skip family specific decoders 13089 for type < NLMSG_MIN_TYPE && type != NLMSG_DONE. 13090 (print_nlmsghdr): Move get_fd_nl_family invocation ... 13091 (decode_nlmsghdr_with_payload): ... here. 13092 13093 2017-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 13094 13095 Make sysent_shorthand_defs.h suitable for tests. 13096 * sysent_shorthand_defs.h [STRACE_TESTS_H]: Add shorthand notations from 13097 tests/ksysent.c and tests/nsyscalls.c. 13098 * tests/ksysent.c: Remove shorthand notations. 13099 * tests/nsyscalls.c: Likewise. 13100 13101 2017-08-07 Edgar Kaziakhmedov <edgar.kaziakhmedov (a] virtuozzo.com> 13102 13103 Move sysent shorthand notations to separate files. 13104 Avoid proliferation of exactly the same definitions of shorthand 13105 notations for macros defined in sysent.h by moving definitions 13106 and undefs of these shorthand notations to separate files. 13107 13108 * sysent_shorthand_defs.h: New file. 13109 * sysent_shorthand_undefs.h: Likewise. 13110 * Makefile.am (strace_SOURCES): Add them. 13111 * syscall.c: Use them. 13112 13113 2017-08-07 JingPiao Chen <chenjingpiao (a] gmail.com> 13114 13115 netlink.c: fix indentation. 13116 * netlink.c (print_cookie): Fix indentation. 13117 13118 2017-08-07 Edgar Kaziakhmedov <edgar.kaziakhmedov (a] virtuozzo.com> 13119 13120 Move err/mem subroutines to separate files. 13121 In order to allow usage of utility functions by other binaries 13122 included in the strace package (like the upcoming asinfo utility), 13123 these functions should be moved to separate files. 13124 13125 * error_prints.h: New file. 13126 * xmalloc.h: Likewise. 13127 * defs.h: Include "xmalloc.h" and "error_prints.h". 13128 (error_msg, error_msg_and_die, error_msg_and_help, perror_msg, 13129 perror_msg_and_die): Move to error_prints.h. 13130 (xcalloc, xmalloc, xreallocarray, xstrdup, xstrndup): Move to xmalloc.h. 13131 * strace.c (die): Remove static quialifier to make visible 13132 by error_prints.c. 13133 (error_msg, error_msg_and_die, error_msg_and_help, perror_msg, 13134 perror_msg_and_die, verror_msg): Move ... 13135 * error_prints.c: ... to the new file. 13136 * xmalloc.c: Include "config.h", <stdlib.h>, <string.h>, 13137 "error_prints.h", and "xmalloc.h" instead of "defs.h". 13138 Use int instead of bool. Fix codestyle. 13139 * Makefile.am (strace_SOURCES): Add error_prints.c, error_prints.h, 13140 and xmalloc.h. 13141 13142 2017-08-07 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 13143 13144 tests: move check_* functions from options-syntax.test to separate file. 13145 * tests/options-syntax.test: Move check_* functions to ... 13146 * tests/syntax.sh: ... new file. 13147 * tests/Makefile.am (EXTRA_DIST): Add syntax.sh. 13148 13149 2017-08-07 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 13150 13151 Split qualify.c into basic_filters.c and filter_qualify.c. 13152 This change also exports add_number_to_set, qualify_tokens, 13153 and qualify_syscall_tokens. 13154 13155 * basic_filters.c: New file, part of qualify.c. 13156 * filter_qualify.c: Likewise. 13157 * filter.h: New file. 13158 * qualify.c: Remove. 13159 * Makefile.am (strace_SOURCES): Add new files, remove qualify.c. 13160 13161 2017-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 13162 13163 Simplify handling of unexpected tracees. 13164 * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>: 13165 Remove the dance around possible re-injection of WSTOPSIG(status) 13166 as the only observable stop here is the initial ptrace-stop. 13167 13168 Fix handling of unexpected tracees when PTRACE_SEIZE is not in use. 13169 * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>: 13170 The expected ptrace stop signal in case of !use seize is not 13171 syscall_trap_sig but SIGSTOP. An idea of using PTRACE_GETSIGINFO to 13172 distinguish signal stops that should be re-injected from other kinds 13173 of stops didn't work out due to kernel implementation peculiarities 13174 of initial ptrace-stop. 13175 13176 pathtrace: fix matching of symlinkat syscall. 13177 * pathtrace.c (pathtrace_match_set) <SEN_symlinkat>: The first argument 13178 of symlinkat syscall is not a path but an arbitrary string, ignore it. 13179 13180 2017-08-06 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 13181 13182 pathtrace: fix missing syscalls. 13183 * pathtrace.c (pathtrace_match_set): Fix symlink decoding, 13184 disable pathtracing for inotify_init. 13185 13186 2017-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 13187 13188 Enhance fflush error diagnostics. 13189 * strace.c (flush_tcp_output): New function. 13190 (line_ended, droptcb, print_event_exit): Use it to flush tcp->outf. 13191 * tests/fflush.c: New file. 13192 * tests/fflush.test: New test. 13193 * tests/Makefile.am (MISC_TESTS): Add it. 13194 * tests/.gitignore: Add fflush. 13195 * tests/pure_executables.list: Likewise. 13196 13197 tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes. 13198 * tests/clone_parent.c: New file. 13199 * tests/clone_ptrace.c: Likewise. 13200 * tests/clone_parent.test: New test. 13201 * tests/clone_ptrace.test: Likewise. 13202 * tests/.gitignore: Add clone_parent and clone_ptrace. 13203 * tests/Makefile.am (check_PROGRAMS): Likewise. 13204 (MISC_TESTS): Add clone_parent.test and clone_ptrace.test. 13205 13206 tests: export a path to the trace executable to check_PROGRAMS. 13207 * tests/init.sh (STRACE_EXE): Initialize from $STRACE and export. 13208 13209 2017-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13210 13211 Makefile.am: build top directory first. 13212 This solves potential issues when tests run first and strace is rebuilt 13213 only after they have finished. As noted in [1], providing the current 13214 directory explicitly should help. 13215 13216 [1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html 13217 13218 * Makefile.am (SUBDIRS): Prepend the current directory. 13219 13220 2017-08-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13221 13222 Improve handling of unexpected tracees. 13223 When receiving a ptrace stop of an unexpected child, handle it 13224 in the most transparent way possible: 13225 - detach it instead of PTRACE_CONT'ing; 13226 - send it the signal with which it has been stopped. 13227 This should hopefully help to deal with processes that have been created 13228 with misused CLONE_PTRACE flag set. 13229 13230 * strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>: 13231 Calculate the signal similarly to the way next_event does, 13232 forward it to the unexpected tracee, and detach the tracee. 13233 13234 2017-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 13235 13236 tests: fix unaligned access in nlattr.test. 13237 * tests/nlattr.c (test_nlattr): Use SET_STRUCT 13238 to initialize potentially unaligned struct nlattr. 13239 13240 tests: fix unaligned access in nlattr_packet_diag_msg.test. 13241 * tests/nlattr_packet_diag_msg.c (init_packet_diag_msg): Use SET_STRUCT 13242 to initialize potentially unaligned struct packet_diag_msg. 13243 13244 2017-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 13245 13246 sparc64: do not bail out in get_scno if PTRACE_PEEKTEXT fails. 13247 If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, 13248 PTRACE_PEEKTEXT becames unavailable when the process dumpable flag is 13249 cleared. As this is not a fatal condition for get_scno, do not bail out 13250 if PTRACE_PEEKTEXT fails. 13251 13252 This condition is triggered and therefore tested by prctl-dumpable test. 13253 13254 * linux/sparc64/get_scno.c (arch_get_scno): Do not bail out 13255 if PTRACE_PEEKTEXT fails. 13256 13257 2017-08-02 Dmitry V. Levin <ldv (a] altlinux.org> 13258 13259 tests: enhance test coverage of printstrn and umoven. 13260 * tests/printstrn-umoven.c: New file. 13261 * tests/printstrn-umoven-peekdata.c: Likewise. 13262 * tests/printstrn-umoven-undumpable.c: Likewise. 13263 * tests/printstrn-umoven-legacy.test: New test. 13264 * tests/Makefile.am (MISC_TESTS): Add printstrn-umoven-legacy.test. 13265 * tests/gen_tests.in (printstrn-umoven, printstrn-umoven-peekdata, 13266 printstrn-umoven-undumpable): New entries. 13267 * tests/pure_executables.list: Add printstrn-umoven, 13268 printstrn-umoven-peekdata, and printstrn-umoven-undumpable. 13269 * tests/.gitignore: Likewise. 13270 13271 tests: add test_printstrn function to libtests. 13272 * tests/test_ucopy.h (test_printstrn): New prototype. 13273 * tests/test_printstrn.c: New file. 13274 * tests/Makefile.am (libtests_a_SOURCES): Add it. 13275 13276 2017-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 13277 13278 tests: enhance test coverage of printpath and umovestr. 13279 * tests/init.sh (TIMEOUT_DURATION): Raise from 300 to 600. 13280 * tests/printpath-umovestr.c: New file. 13281 * tests/printpath-umovestr-peekdata.c: Likewise. 13282 * tests/printpath-umovestr-undumpable.c: Likewise. 13283 * tests/printpath-umovestr-legacy.test: New test. 13284 * tests/Makefile.am (MISC_TESTS): Add printpath-umovestr-legacy.test. 13285 * tests/gen_tests.in (printpath-umovestr, printpath-umovestr-peekdata, 13286 printpath-umovestr-undumpable): New entries. 13287 * tests/pure_executables.list: Add printpath-umovestr, 13288 printpath-umovestr-peekdata, and printpath-umovestr-undumpable. 13289 * tests/.gitignore: Likewise. 13290 13291 tests: add test_printpath function to libtests. 13292 * tests/test_ucopy.h (test_printpath): New prototype. 13293 * tests/test_printpath.c: New file. 13294 * tests/Makefile.am (libtests_a_SOURCES): Add it. 13295 13296 tests: add test_process_vm_readv and test_ptrace_peekdata to libtests. 13297 * tests/test_ucopy.c: New file. 13298 * tests/test_ucopy.h: Likewise. 13299 * tests/Makefile.am (libtests_a_SOURCES): Add them. 13300 13301 2017-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 13302 13303 printpath: do not fetch more than PATH_MAX bytes from tracee's memory. 13304 The kernel does not copy more than PATH_MAX bytes from userspace 13305 pathnames, treating non-NUL-terminated pathnames as ENAMETOOLONG. 13306 13307 * util.c (printpathn): Decrease buffer size to PATH_MAX. 13308 (printpath): Specify PATH_MAX - 1 as the maximum pathname length 13309 to match the kernel behaviour. The underlying umovestr call will fetch 13310 up to PATH_MAX bytes from tracee's memory, but no more than first 13311 PATH_MAX - 1 bytes will be printed. 13312 13313 2017-07-31 Dmitry V. Levin <ldv (a] altlinux.org> 13314 13315 ucopy: cleanup umoven_peekdata and umovestr_peekdata. 13316 * ucopy.c (umoven_peekdata, umovestr_peekdata): Merge aligned 13317 and unaligned tracee address cases. 13318 13319 2017-07-31 Dmitry V. Levin <ldv (a] altlinux.org> 13320 13321 ucopy: move legacy fallbacks of umoven and umovestr to separate functions 13322 Move legacy PTRACE_PEEKDATA-based support to separate functions. 13323 13324 * ucopy.c (umoven_peekdata, umovestr_peekdata): New functions. 13325 (umoven, umovestr): Use them. 13326 13327 2017-07-31 Dmitry V. Levin <ldv (a] altlinux.org> 13328 13329 ucopy: move process_vm_readv ENOSYS check to vm_read_mem. 13330 * ucopy.c (vm_read_mem): Set process_vm_readv_not_supported in case 13331 of ENOSYS. 13332 * ucopy.c (umoven, umovestr): Do not set process_vm_readv_not_supported. 13333 13334 2017-07-31 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13335 13336 Print enabled optional features in strace version output. 13337 In order to provide information to user what optionally built features 13338 are available. 13339 13340 * strace.c (print_version): New variable "features". Print features string 13341 after non-liability disclaimer (or "(none)" in case it is empty). 13342 (print_version) [USE_LIBUNWIND]: Concatenate "stack-unwind" into features 13343 string. 13344 * tests/strace-V.tests (getoption): New function. 13345 Update check in accordance with updated output. 13346 13347 2017-07-31 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13348 13349 tests/strace-V.test: rename getval to getstr. 13350 As this name is more suitable. 13351 13352 * tests/strace-V (getval): Rename to getstr, update all call sites. 13353 13354 2017-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 13355 13356 ucopy: refactor the check for invalid tracee addresses. 13357 * ucopy.c (tracee_addr_is_invalid): New function. 13358 * ucopy.c (umoven, umovestr): Use it. 13359 13360 ucopy: enhance vm_read_mem error diagnostics. 13361 * ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics 13362 to match PTRACE_PEEKDATA case. 13363 13364 2017-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 13365 13366 ucopy: skip redundant tracee address truncation check. 13367 * ucopy.c (vm_read_mem): Skip raddr != truncated_raddr check 13368 if these variables have the same data size. 13369 13370 2017-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 13371 13372 util: move umoven and umovestr to a separate file. 13373 These functions are more kernel-specific compared to all other functions 13374 defined in util.c. 13375 13376 * ucopy.c: New file. 13377 * Makefile.am (strace_SOURCES): Add it. 13378 * util.c (umoven, umovestr): Move to ucopy.c. 13379 13380 2017-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 13381 13382 bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY. 13383 Print union bpf_attr.value field of BPF_MAP_LOOKUP_ELEM command 13384 and union bpf_attr.next_key field of BPF_MAP_GET_NEXT_KEY command 13385 on entering syscall. These fields are addresses specified to the 13386 kernel from userspace. The amount of data written by the kernel 13387 to these addresses is specified at the map creation time 13388 by BPF_MAP_CREATE command and is not available at this point. 13389 13390 * bpf.c (decode_BPF_MAP_LOOKUP_ELEM): Print union bpf_attr.value 13391 on entering syscall. 13392 (decode_BPF_MAP_GET_NEXT_KEY): Print union bpf_attr.next_key 13393 on entering syscall. 13394 (bpf_map_io): Remove. 13395 * tests/bpf.c (print_BPF_MAP_DELETE_ELEM_first, 13396 print_BPF_MAP_DELETE_ELEM_attr, print_BPF_MAP_GET_NEXT_KEY_first, 13397 print_BPF_MAP_GET_NEXT_KEY_attr): Replace macro redirects with 13398 new functions. 13399 (print_BPF_MAP_LOOKUP_ELEM_first, print_BPF_MAP_LOOKUP_ELEM_attr, 13400 13401 2017-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 13402 13403 bpf: update BPF_MAP_CREATE decoding. 13404 Implement decoding of map_flags and inner_map_fd fields of union bpf_attr 13405 for BPF_MAP_CREATE command introduced by linux kernel commits 13406 v4.6-rc1~91^2~108^2~6 and v4.12-rc1~64^3~373^2~2, respectively. 13407 13408 * configure.ac: Check for inner_map_fd member of union bpf_attr 13409 instead of max_entries. 13410 * xlat/bpf_map_flags.in: New file. 13411 * bpf.c: Include "xlat/bpf_map_flags.h". 13412 (decode_BPF_MAP_CREATE): Add map_flags and inner_map_fd fields 13413 to the structure, print them. 13414 * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test. 13415 (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected 13416 output. 13417 (init_BPF_MAP_CREATE_attr): Initialize map_flags and inner_map_fd 13418 fields, update offset. 13419 13420 2017-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 13421 13422 bpf: update BPF_PROG_LOAD decoding. 13423 Implement decoding of union bpf_attr.prog_flags field for BPF_PROG_LOAD 13424 command introduced by linux kernel commit v4.12-rc2~34^2~29^2~2. 13425 13426 * configure.ac: Check for prog_flags member of union bpf_attr 13427 instead of kern_version. 13428 * xlat/bpf_prog_flags.in: New file. 13429 * bpf.c: Include "xlat/bpf_prog_flags.h". 13430 (decode_BPF_PROG_LOAD): Add prog_flags field to the structure, print it. 13431 * tests/bpf.c: Update macro guards of BPF_PROG_LOAD decoder test. 13432 (init_BPF_PROG_LOAD_first, print_BPF_PROG_LOAD_attr): Update expected 13433 output. 13434 (init_BPF_PROG_LOAD_attr): Initialize prog_flags field, update offset. 13435 13436 2017-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 13437 13438 tests: enhance test coverage of bpf syscall parser. 13439 * configure.ac: Update union bpf_attr member checks. 13440 * tests/bpf.c: Rewrite. 13441 * tests/bpf-v.c: New file. 13442 * tests/gen_tests.in (bpf-v): New entry. 13443 * tests/pure_executables.list: Add bpf-v. 13444 * tests/.gitignore: Likewise. 13445 13446 m4: macroize union bpf_attr field checks. 13447 * m4/st_bpf.m4: New file. 13448 * configure.ac: Use st_CHECK_UNION_BPF_ATTR. 13449 13450 Move offsetofend from defs.h to macros.h. 13451 * defs.h (offsetofend): Move ... 13452 * macros.h: ... here. 13453 13454 2017-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 13455 13456 bpf: print unused fields of union bpf_attr if one of them is non-zero. 13457 When the size argument specifies more data than necessary for the given 13458 command, kernel checks that all unused fields of union bpf_attr are 13459 zero. Print this extra data when it contains non-zero bytes to enhance 13460 debugging experience. 13461 13462 * bpf.c (decode_attr_extra_data): New function. 13463 (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM, 13464 decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD, 13465 decode_BPF_OBJ_PIN, decode_BPF_OBJ_GET, decode_BPF_PROG_ATTACH, 13466 decode_BPF_PROG_DETACH): Use it to print extra data passed 13467 via bpf_attr pointer. 13468 (bpf_obj_manage, bpf_prog_attach_detach): Remove. 13469 * tests/bpf.c (map_delete_elem): New function. 13470 (main): Use it. 13471 13472 2017-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 13473 13474 bpf: change handling of big and unaccessible data to match the kernel. 13475 When the size argument exceeds PAGE_SIZE, the kernel fails with E2BIG 13476 without parsing union bpf_attr. 13477 When the whole chunk of memory specified by addr and size arguments is 13478 not readable, the kernel fails with EFAULT. 13479 13480 * bpf.c (DECL_BPF_CMD_DECODER) <bpf_cmd_decoder>: Add const qualifier 13481 to size argument, add data argument. 13482 (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM, 13483 decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD, 13484 bpf_obj_manage, bpf_prog_attach_detach): Move size argument check and 13485 memory fetching ... 13486 (SYS_FUNC(bpf)) ... here, add PAGE_SIZE check, pass fetched memory 13487 to command-specific parsers. 13488 13489 2017-07-25 Dmitry V. Levin <ldv (a] altlinux.org> 13490 13491 bpf: replace big switch statement with a dispatch table. 13492 * bpf.c (DECL_BPF_CMD_DECODER, DEF_BPF_CMD_DECODER, BPF_CMD_ENTRY): 13493 New macros. 13494 (bpf_cmd_decoder_t): New typedef. 13495 Rename static parser functions using DEF_BPF_CMD_DECODER. 13496 (decode_BPF_MAP_LOOKUP_ELEM, decode_BPF_MAP_GET_NEXT_KEY): New proxy 13497 functions. 13498 (SYS_FUNC(bpf)): Replace big switch statement with a dispatch table. 13499 13500 bpf: use PRINT_FIELD_* macros. 13501 * print_fields.h (PRINT_FIELD_STR, PRINT_FIELD_PATH): New macros. 13502 * bpf.c: Include "print_fields.h". 13503 (bpf_map_create): Use PRINT_FIELD_U and PRINT_FIELD_XVAL. 13504 (bpf_map_update_elem): Use PRINT_FIELD_FD, PRINT_FIELD_X, and 13505 PRINT_FIELD_XVAL. 13506 (bpf_map_delete_elem, bpf_map_io): Use PRINT_FIELD_FD and PRINT_FIELD_X. 13507 (bpf_prog_load): Use PRINT_FIELD_STR, PRINT_FIELD_U, PRINT_FIELD_X, 13508 and PRINT_FIELD_XVAL. 13509 (bpf_obj_manage): Use PRINT_FIELD_FD and PRINT_FIELD_PATH. 13510 (bpf_prog_attach_detach): Use PRINT_FIELD_FD, PRINT_FIELD_FLAGS, 13511 and PRINT_FIELD_XVAL. 13512 13513 2017-07-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13514 13515 Add terminating comment after each DECL_* macro definition. 13516 In an attempt to improve readability. 13517 13518 * defs.h (DECL_IOCTL, DECL_NETLINK, DECL_PRINTNUM, DECL_PRINTNUM_ADDR, 13519 ATTRIBUTE_FORMAT): Add comment that marks end of macro definition. 13520 * netlink_sock_diag (DECL_NETLINK_DIAG_DECODER): Likewise. 13521 * nlattr.h (DECL_NLA): Likewise. 13522 13523 2017-07-24 Dmitry V. Levin <ldv (a] altlinux.org> 13524 13525 Introduce print_quoted_cstring. 13526 In many places where kernel expects a NUL-terminated string of length 13527 up to a known fixed limit, e.g. when a NUL-terminated string is 13528 a fixed-size field of a structure, strace does not print the last byte 13529 assuming it is NUL, which is not always the case. 13530 13531 Change output format for such strings to distinguish NUL-terminated 13532 strings from non-NUL-terminated ones: append ellipsis to the output 13533 when the string is not NUL-terminated. 13534 13535 * defs.h (print_quoted_cstring): New prototype. 13536 * util.c (print_quoted_cstring): New function. 13537 (printpathn): Use it instead of print_quoted_string with 13538 QUOTE_0_TERMINATED argument. 13539 * print_fields.h (PRINT_FIELD_CSTRING): Likewise. 13540 * btrfs.c (btrfs_ioctl): Likewise. 13541 * dirent.c (SYS_FUNC(getdents)): Likewise. 13542 * dirent64.c (SYS_FUNC(getdents64)): Likewise. 13543 * print_ifindex.c (print_ifindex): Likewise. 13544 * sysmips.c (SYS_FUNC(sysmips)): Likewise. 13545 * ubi.c (ubi_ioctl): Likewise. 13546 * tests/tests.h (print_quoted_cstring): New prototype. 13547 * tests/print_quoted_string.c (print_quoted_cstring): New function. 13548 * tests/ioctl_block.c (main): Update expected output. 13549 * tests/ioctl_dm.c (main): Likewise. 13550 * tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise. 13551 * tests/netlink_crypto.c (test_crypto_msg_newalg): Likewise. 13552 13553 2017-07-24 JingPiao Chen <chenjingpiao (a] gmail.com> 13554 13555 tests: check decoding of NETLINK_CRYPTO crypto_user_alg attributes. 13556 * tests/nlattr_crypto_user_alg.c: New file. 13557 * tests/gen_tests.in (nlattr_crypto_user_alg): New entry. 13558 * tests/pure_executables.list: Add nlattr_crypto_user_alg. 13559 * tests/.gitignore: Likewise. 13560 13561 tests: extend TEST_NLATTR_OBJECT macro. 13562 * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, 13563 TEST_NLATTR_OBJECT_EX): New macros. 13564 (TEST_NLATTR_OBJECT): Use TEST_NLATTR_OBJECT_EX_. 13565 13566 netlink: decode NETLINK_CRYPTO crypto_user_alg netlink attributes. 13567 * configure.ac (AC_CHECK_TYPES): Check for crypto_report_aead, 13568 crypto_report_blkcipher, crypto_report_cipher, crypto_report_hash, 13569 and crypto_report_rng structures in <linux/cryptouser.h>. 13570 * netlink_crypto.c (decode_crypto_report_generic, 13571 decode_crypto_report_hash, decode_crypto_report_blkcipher, 13572 decode_crypto_report_aead, decode_crypto_report_rng, 13573 decode_crypto_report_cipher): New functions. 13574 (crypto_user_alg_nla_decoders): New array. 13575 (decode_crypto_user_alg): Use it. 13576 * xlat/crypto_nl_attrs.in: New file. 13577 * NEWS: Mention this. 13578 13579 tests: check decoding of NETLINK_CRYPTO messages. 13580 * tests/netlink_crypto.c: Include "test_netlink.h" 13581 instead of "netlink.h". 13582 (test_crypto_msg_newalg, test_crypto_msg_unspec): New functions. 13583 (main): Use them. 13584 13585 2017-07-24 JingPiao Chen <chenjingpiao (a] gmail.com> 13586 13587 tests: extend TEST_NETLINK_OBJECT macro. 13588 As the first field of NETLINK_CRYPTO messages is a string, print 13589 unrecognized data as a string. Extend TEST_NETLINK_OBJECT macro 13590 to test this case. 13591 13592 * tests/test_netlink.h (TEST_NETLINK_OBJECT_EX_, 13593 TEST_NETLINK_OBJECT_EX): New macros. 13594 (TEST_NETLINK_OBJECT): Use TEST_NETLINK_OBJECT_EX_. 13595 13596 2017-07-24 JingPiao Chen <chenjingpiao (a] gmail.com> 13597 13598 netlink: add a basic parser of NETLINK_CRYPTO messages. 13599 * netlink_crypto.c: New file. 13600 * Makefile.am (strace_SOURCES): Add it. 13601 * defs.h (decode_netlink_crypto): New prototype. 13602 * netlink.c (netlink_decoders): Add NETLINK_CRYPTO. 13603 * NEWS: Mention this. 13604 13605 2017-07-23 Dmitry V. Levin <ldv (a] altlinux.org> 13606 13607 Unify PRINT_FIELD_XVAL and PRINT_FIELD_XVAL64. 13608 * print_fields.h (PRINT_FIELD_XVAL64): Unify with PRINT_FIELD_XVAL. 13609 13610 Unify PRINT_FIELD_FLAGS and PRINT_FIELD_FLAGS64. 13611 * print_fields.h (PRINT_FIELD_FLAGS64): Unify with PRINT_FIELD_FLAGS. 13612 * userfaultfd.c (uffdio_ioctl): Replace PRINT_FIELD_FLAGS64 with 13613 PRINT_FIELD_FLAGS. 13614 13615 2017-07-23 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 13616 13617 pathtrace: fix fanotify_mark path tracing on 32-bit architectures. 13618 The fanotify_mark syscall takes a 64-bit mask, and on 32-bit 13619 architectures it is split up into two syscall arguments. 13620 13621 * pathtrace.c (pathtrace_match_set): Use getllval to properly decode 13622 arguments after mask. 13623 13624 2017-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 13625 13626 travis: add valgrind check support. 13627 * travis-build.sh [CHECK == valgrind]: Pass --enable-valgrind 13628 to configure and appropriate check-valgrind-* to make. 13629 * travis-install.sh [CHECK == valgrind]: Install valgrind. 13630 13631 2017-07-22 JingPiao Chen <chenjingpiao (a] gmail.com> 13632 13633 netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN. 13634 In several netlink_sock_diag parsers NLA_ALIGN was used instead of 13635 NLMSG_ALIGN to align the length of netlink messages. Fortunately, 13636 both macros round the given length to the closest multiple of 4, 13637 so technically there is no difference, but the use of wrong macro 13638 is misleading. 13639 13640 * netlink_inet_diag.c (decode_inet_diag_req_compat, 13641 decode_inet_diag_req_v2, decode_inet_diag_msg): Replace 13642 NLA_ALIGN with NLMSG_ALIGN. 13643 * netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise. 13644 * netlink_packet_diag.c (decode_packet_diag_msg): Likewise. 13645 * netlink_smc_diag.c (decode_smc_diag_msg): Likewise. 13646 13647 2017-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 13648 13649 travis: configure build with dependency tracking disabled. 13650 Dependency tracking is completely useless for one-time builds, 13651 so configure build with dependency tracking disabled. 13652 13653 * travis-build.sh (DISTCHECK_CONFIGURE_FLAGS): Add 13654 --disable-dependency-tracking. 13655 13656 2017-07-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 13657 13658 m4: remove equal sign from define directive in ax_valgrind_check.m4. 13659 Support for providing equal sign in define directives has been added 13660 only in GNU Make 3.82 [1] and it provides the same semantics (variables 13661 should be recursively expanded) as when it is omitted at all, so let's 13662 remove it in order to preserve compatibility with older GNU Make 13663 versions (like the one used on Travis). 13664 13665 [1] https://git.savannah.gnu.org/cgit/make.git/tree/ChangeLog?h=3.82#n766 13666 13667 * m4/ax_valgrind_check.m4 <define valgrind_tool_rule>: Remove equal 13668 sign. 13669 13670 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13671 13672 keyctl: add support for KEYCTL_RESTRICT_KEYRING operation. 13673 * keyctl.c (keyctl_restrict_keyring): New function. 13674 (SYS_FUNC(keyctl)): Use it to implement KEYCTL_RESTRICT_KEYRING support. 13675 * NEWS: Mention this. 13676 * tests/keyctl.c (main): Check KEYCTL_RESTRICT_KEYRING decoding. 13677 13678 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13679 13680 tests: robustify strace-t.test. 13681 If strace -t is running too long, it might happen that time stamps 13682 before and after its invocation differ for more than a second. 13683 Adjust expected output to handle this rare but possible case. 13684 13685 * tests/strace-t.test: Allow any time stamp between start and finish 13686 of strace invocation. 13687 13688 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13689 13690 x86: wire up arch_prctl syscall. 13691 * linux/i386/syscallent.h [384]: Add arch_prctl entry. 13692 * xlat/archvals.in: Add fallback definitions for constants. 13693 * prctl.c: Stop including <asm/prctl.h>. 13694 (SYS_FUNC(arch_prctl)): Enable for [I386]. 13695 * NEWS: Mention this. 13696 13697 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13698 13699 tests: tweak strace-ff.test for slow startup case. 13700 strace starts up much slower when invoked under valgrind control. 13701 Increase the tracee's sleep delay to let strace more time to attach. 13702 13703 * tests/strace-ff.test: Increase sleep delay. 13704 13705 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13706 13707 tests: update valgrind suppressions. 13708 * tests/strace.supp: Add a suppression for the memleak before 13709 error_msg_and_die in qualify_tokens. 13710 13711 2017-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 13712 13713 Do not copy optarg unnecessarily. 13714 There is no need to copy the optarg string since it is a pointer 13715 into the original argv array, not into a static area 13716 that might be overwritten. 13717 13718 * strace.c (username, outfname): Add const qualifier. 13719 (init): Do not xstrdup optarg to initialize outfname and username. 13720 13721 2017-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 13722 13723 travis: add build environment information to the travis log. 13724 * travis-build.sh: Print build environment information. 13725 13726 2017-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 13727 13728 build: add check-valgrind-* to recursive targets. 13729 As make -j$N check-valgrind cannot parallelize properly, add 13730 recursive targets for each of valgrind checks. This way one can run 13731 for t in $valgrind_enabled_tools; do 13732 make -k check-valgrind-$n || rc=$? 13733 done 13734 in $top_builddir. 13735 13736 * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Remove. 13737 * m4/ax_valgrind_check.m4 (AX_VALGRIND_CHECK): Add check-valgrind 13738 and check-valgrind-* to AM_EXTRA_RECURSIVE_TARGETS. 13739 13740 2017-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 13741 13742 tests: add check-valgrind-local make rule. 13743 This guarantees that $(check_LIBRARIES) and $(check_PROGRAMS) 13744 are made on 'make check-valgrind' before its recipe is processed. 13745 13746 * tests/Makefile.am (check-valgrind-local): New rule. 13747 (.PHONY): Add it. 13748 13749 2017-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 13750 13751 Add ksysent.h and scno.h to BUILT_SOURCES. 13752 This guarantees that ksysent.h and scno.h, along with other targets 13753 listed in BUILT_SOURCES, are made on 'make all', 'make check', 13754 and 'make check-valgrind' before other targets are processed. 13755 13756 * scno.am (BUILT_SOURCES): Add scno.h. 13757 * tests/Makefile.am (BUILT_SOURCES): Add ksysent.h. 13758 13759 2017-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 13760 13761 tests: fix valgrind suppression file path. 13762 * tests/Makefile.am (VALGRIND_SUPPRESSIONS_FILES): Replace srcdir 13763 with abs_srcdir. 13764 13765 Fixes: v4.16-74-g16036030 ("tests: run every test except ksysent.test in its own subdirectory") 13766 13767 2017-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 13768 13769 Update AX_VALGRIND_CHECK. 13770 * m4/ax_valgrind_check.m4: Update to serial 15. In particular, 13771 this version does not eat check-valgrind errors. 13772 13773 Update AX_CODE_COVERAGE. 13774 * m4/ax_code_coverage.m4: Update to serial 24. In particular, 13775 this version has no lcov version check. 13776 * Makefile.am (strace_LDADD): Rename CODE_COVERAGE_LDFLAGS 13777 to CODE_COVERAGE_LIBS. 13778 13779 Update input event KEY_* constants. 13780 * xlat/evdev_keycode.in: Add KEY_ASSISTANT introduced by linux kernel 13781 commit v4.13-rc1~13^2~1^2~1. 13782 * NEWS: Mention this. 13783 13784 Update fs *_MAGIC constants. 13785 * xlat/fsmagic.in: Add AAFS_MAGIC introduced by linux kernel commit 13786 v4.13-rc1~161^2~87. 13787 * NEWS: Mention this. 13788 13789 2017-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 13790 13791 Move family-specific NETLINK_SOCK_DIAG parsers to separate files. 13792 Split netlink_sock_diag.c that grew too big. 13793 13794 * defs.h (tcp_states, tcp_state_flags): New xlat prototypes. 13795 * netlink_sock_diag.h: New file. 13796 * netlink_inet_diag.c: Likewise. 13797 * netlink_netlink_diag.c: Likewise. 13798 * netlink_packet_diag.c: Likewise. 13799 * netlink_smc_diag.c: Likewise. 13800 * netlink_unix_diag.c: Likewise. 13801 * Makefile.am (strace_SOURCES): Add them. 13802 * netlink_sock_diag.c: Move family-specific parsers and associated 13803 header includes to separate files. 13804 * nlattr.h (DECL_NLA(meminfo)): New prototype. 13805 * nlattr.c: Include <linux/sock_diag.h>. 13806 (print_meminfo, decode_nla_meminfo): New functions from 13807 netlink_sock_diag.c. 13808 13809 2017-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 13810 13811 Adjust prototypes of netlink parsing functions. 13812 Change the type of "len" argument that is based 13813 on struct nlmsghdr.nlmsg_len from kernel_ulong_t to unsigned int. 13814 13815 * defs.h (netlink_decoder_t, DECL_NETLINK): Change "len" argument type 13816 from kernel_ulong_t to unsigned int. 13817 * netlink.c (decode_nlmsgerr_attr_cookie, decode_nlmsgerr, 13818 decode_payload): Likewise. 13819 * netlink_selinux.c (decode_netlink_selinux): Likewise. 13820 * netlink_sock_diag.c (decode_family, decode_unix_diag_req, 13821 decode_meminfo, decode_unix_diag_vfs, decode_unix_diag_inode, 13822 decode_unix_diag_rqlen, decode_unix_diag_msg, decode_netlink_diag_req, 13823 print_group, decode_netlink_diag_ring, decode_netlink_diag_flags, 13824 decode_netlink_diag_msg, decode_packet_diag_req, 13825 decode_packet_diag_info, decode_packet_diag_mclist, 13826 decode_packet_diag_ring, decode_packet_diag_filter, 13827 decode_packet_diag_msg, decode_inet_addr, decode_inet_diag_hostcond, 13828 decode_inet_diag_markcond, decode_bytecode_data, decode_inet_diag_bc_op, 13829 decode_inet_diag_req_compat, decode_inet_diag_req_v2, 13830 decode_inet_diag_req, decode_inet_diag_meminfo, decode_tcpvegas_info, 13831 decode_tcp_dctcp_info, decode_tcp_bbr_info, decode_inet_diag_msg, 13832 decode_smc_diag_req, decode_smc_diag_conninfo, decode_smc_diag_lgrinfo, 13833 decode_smc_diag_msg, netlink_diag_decoder_t, decode_netlink_sock_diag): 13834 Likewise. 13835 * nlattr.c (fetch_nlattr, decode_nlattr_with_data, decode_nlattr, 13836 decode_nla_str, decode_nla_strn, DECODE_NLA_INTEGER): Likewise. 13837 * nlattr.h (nla_decoder_t, DECL_NLA, decode_nlattr): Likewise. 13838 13839 2017-07-19 JingPiao Chen <chenjingpiao (a] gmail.com> 13840 13841 tests: check decoding of nlmsgerr attributes. 13842 * tests/nlattr_nlmsgerr.c: New file. 13843 * tests/gen_tests.in (nlattr_nlmsgerr): New entry. 13844 * tests/pure_executables.list: Add nlattr_nlmsgerr. 13845 * tests/.gitignore: Likewise. 13846 13847 netlink: decode nlmsgerr attributes. 13848 * netlink.c: Include "nlattr.h" and "xlat/nlmsgerr_attrs.h". 13849 (print_cookie, decode_nlmsgerr_attr_cookie): New functions. 13850 (nlmsgerr_nla_decoders): New array. 13851 (decode_nlmsgerr): Use it. 13852 * xlat/nlmsgerr_attrs.in: New file. 13853 * NEWS: Mention this. 13854 13855 2017-07-19 JingPiao Chen <chenjingpiao (a] gmail.com> 13856 13857 netlink: adjust decode_nlmsgerr for extended ACK reporting. 13858 Extended ACK reporting introduced by linux kernel commit 13859 v4.11-rc5-1382-g2d4bc93. 13860 13861 * netlink.h (NLM_F_CAPPED): New macro. 13862 * netlink.c (decode_payload): Pass 13863 nlmsghdr->nlmsg_flags & NLM_F_CAPPED to decode_nlmsgerr. 13864 (decode_nlmsgerr): Adjust the length pass to 13865 decode_nlmsghdr_with_payload. 13866 13867 2017-07-19 JingPiao Chen <chenjingpiao (a] gmail.com> 13868 13869 netlink: decode netlink message ack flags. 13870 * netlink.c: Include "xlat/netlink_ack_flags.h". 13871 (decode_nlmsg_flags): Decode ack flags when type == NLMSG_ERROR. 13872 * xlat/netlink_ack_flags.in: New file. 13873 * NEWS: Mention this. 13874 * tests/netlink_protocol.c (test_ack_flags): New function, check this. 13875 (main): Use it. 13876 13877 2017-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 13878 13879 tests: enhance error diagnostics. 13880 * tests/init.sh (dump_log_and_fail_with): Dump $LOG to stderr instead 13881 of stdout as the latter is more likely to be redirected to a temporary 13882 file in the context where this function is called. 13883 13884 tests: enhance timeout diagnostics. 13885 * tests/init.sh: Trap SIGXCPU. 13886 * tests/run.sh: Send SIGXCPU instead of SIGKILL in case of timeout, send 13887 SIGKILL if the command is still running 5 seconds after SIGXCPU. 13888 13889 userfaultfd: decode struct uffdio_api.features as flags. 13890 * xlat/uffd_api_features.in: New file. 13891 * userfaultfd.c: Include "xlat/uffd_api_features.h". 13892 (uffdio_ioctl): Print struct uffdio_api.features using 13893 PRINT_FIELD_FLAGS64 and uffd_api_features. 13894 * NEWS: Mention this. 13895 * tests/ioctl_uffdio.c: Include "xlat.h" and "xlat/uffd_api_features.h". 13896 (main): Update expected output. 13897 13898 2017-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 13899 13900 userfaultfd: enhance decoding of struct uffdio_api.features. 13901 As struct uffdio_api.features has read-write semantics, 13902 print the value returned by the kernel only when it differs 13903 from the value passed to the kernel. 13904 13905 * userfaultfd.c (uffdio_ioctl) <UFFDIO_API>: On entering syscall, 13906 save the value of struct uffdio_api.features. On exiting syscall, do 13907 not print struct uffdio_api.features when it's the same as on entering. 13908 * tests/ioctl_uffdio.c (main): Update expected output. 13909 13910 2017-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 13911 13912 userfaultfd: use PRINT_FIELD_* macros. 13913 This also fixes output correctness for struct uffdio_api.features. 13914 13915 * userfaultfd.c: Include "print_fields.h". 13916 (tprintf_uffdio_range): Use PRINT_FIELD_X. 13917 (PRINT_FIELD_UFFDIO_RANGE): New macro. 13918 (uffdio_ioctl): Use it, PRINT_FIELD_FLAGS64, and PRINT_FIELD_X. 13919 * tests/ioctl_uffdio.c (main): Update expected output. 13920 13921 2017-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 13922 13923 Introduce PRINT_FIELD_FLAGS64 and PRINT_FIELD_XVAL64. 13924 * print_fields.h (PRINT_FIELD_FLAGS64, PRINT_FIELD_XVAL64): New macros. 13925 13926 2017-07-17 Dmitry V. Levin <ldv (a] altlinux.org> 13927 13928 Update NEWS. 13929 13930 aio: change struct iocb.aio_lio_opcode output format. 13931 * aio.c (tprint_lio_opcode): Change opcode output format to match 13932 the kernel. 13933 * tests/aio.c (main): Update expected output. 13934 13935 2017-07-17 Dmitry V. Levin <ldv (a] altlinux.org> 13936 13937 aio: use PRINT_FIELD_* macros. 13938 This also fixes output correctness for struct iocb. 13939 13940 * aio.c: Include "print_fields.h". 13941 (print_common_flags, print_iocb_header, print_iocb, print_io_event): 13942 Use PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_FD, 13943 and PRINT_FIELD_STRN. 13944 * tests/aio.c (main): Update expected output. 13945 13946 2017-07-17 Dmitry V. Levin <ldv (a] altlinux.org> 13947 13948 Introduce PRINT_FIELD_FD and PRINT_FIELD_STRN. 13949 * print_fields.h (PRINT_FIELD_FD, PRINT_FIELD_STRN): New macros. 13950 13951 2017-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 13952 13953 Update BPF_* constants. 13954 * xlat/bpf_commands.in: Add BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID, 13955 BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID, 13956 and BPF_OBJ_GET_INFO_BY_FD introduced by linux kernel commits 13957 v4.12-rc1~64^3~287^2~5, v4.13-rc1~157^2~271^2~5, 13958 v4.13-rc1~157^2~271^2~4, v4.13-rc1~157^2~271^2~3, and 13959 v4.13-rc1~157^2~271^2~1, respectively. 13960 * xlat/bpf_attach_type.in: Add BPF_CGROUP_SOCK_OPS introduced 13961 by linux kernel commit v4.13-rc1~157^2~37^2~15. 13962 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SOCK_OPS introduced 13963 by the same commit. 13964 13965 Update SO_* constants. 13966 * xlat/sockoptions.in: Add SO_PEERGROUPS introduced by linux kernel 13967 commit v4.13-rc1~157^2~124. 13968 13969 Update SCM_* constants. 13970 * xlat/scmvals.in: Add SCM_TIMESTAMPING_PKTINFO introduced 13971 by linux kernel commit v4.13-rc1~157^2~405^2~3. 13972 13973 2017-07-16 JingPiao Chen <chenjingpiao (a] gmail.com> 13974 13975 tests: check decoding of NETLINK_SELINUX protocol. 13976 * test_netlink.h (TEST_NETLINK_OBJECT): New macro. 13977 * tests/netlink_selinux.c: Include "test_netlink.h" 13978 instead of "netlink.h". 13979 (test_selnl_msg_unspec, test_selnl_msg_setenforce, 13980 test_selnl_msg_policyload): New functions. 13981 (main): Use them. 13982 13983 netlink: decode NETLINK_SELINUX protocol. 13984 * netlink_selinux.c: New file. 13985 * Makefile.am (strace_SOURCES): Add it. 13986 * defs.h (decode_netlink_selinux): New prototype. 13987 * netlink.c (netlink_decoders): Add NETLINK_SELINUX. 13988 13989 2017-07-15 Dmitry V. Levin <ldv (a] altlinux.org> 13990 13991 sg_io_v3: use PRINT_FIELD_* macros. 13992 * sg_io_v3.c: Include "print_fields.h". 13993 (PRINT_FIELD_SG_IO_BUFFER): New macro. 13994 (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U, 13995 PRINT_FIELD_X, PRINT_FIELD_PTR, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL. 13996 13997 Introduce PRINT_FIELD_PTR. 13998 * print_fields.h (PRINT_FIELD_PTR): New macro. 13999 14000 2017-07-15 Dmitry V. Levin <ldv (a] altlinux.org> 14001 14002 Provide mpers_ptr_t definition for non-mpers case. 14003 In mpers case, mpers_ptr_t is already defined by DEF_MPERS_TYPE(...). 14004 This allows use of mpers_ptr_t regardless of IN_MPERS state. 14005 14006 * mpers_type.h [!IN_MPERS] (mpers_ptr_t): New typedef. 14007 14008 2017-07-14 Lazar Trsic <Lazar.Trsic (a] imgtec.com> 14009 14010 Move is_negated_errno() to new header negated_errno.h. 14011 Move is_negated_errno() to a separate new header file negated_errno.h 14012 and include it just for architectures which require it. 14013 14014 is_negated_errno() is not used on those architectures 14015 that have a dedicated register to signal a syscall error. 14016 14017 The issue was raised when compiling with clang, which is more 14018 strict regarding semantics of unused static inline functions 14019 defined in C files and will issue a -Wunused-function warrning 14020 if they are not used anywhere. 14021 14022 * syscall.c (is_negated_errno): Move to ... 14023 * negated_errno.h: ... new file. 14024 * Makefile.am (strace_SOURCES): Add it. 14025 * linux/aarch64/get_error.c: Include it. 14026 * linux/arc/get_error.c: Likewise. 14027 * linux/arm/get_error.c: Likewise. 14028 * linux/avr32/get_error.c: Likewise. 14029 * linux/bfin/get_error.c: Likewise. 14030 * linux/crisv10/get_error.c: Likewise. 14031 * linux/hppa/get_error.c: Likewise. 14032 * linux/i386/get_error.c: Likewise. 14033 * linux/ia64/get_error.c: Likewise. 14034 * linux/m68k/get_error.c: Likewise. 14035 * linux/metag/get_error.c: Likewise. 14036 * linux/microblaze/get_error.c: Likewise. 14037 * linux/or1k/get_error.c: Likewise. 14038 * linux/riscv/get_error.c: Likewise. 14039 * linux/s390/get_error.c: Likewise. 14040 * linux/sh/get_error.c: Likewise. 14041 * linux/sh64/get_error.c: Likewise. 14042 * linux/tile/get_error.c: Likewise. 14043 * linux/x86_64/get_error.c: Likewise. 14044 * linux/xtensa/get_error.c: Likewise. 14045 14046 2017-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 14047 14048 sg_io_v4: use PRINT_FIELD_* macros. 14049 * sg_io_v4.c: Include "print_fields.h". 14050 (PRINT_FIELD_SG_IO_BUFFER): New macro. 14051 (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U, 14052 PRINT_FIELD_X, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL. 14053 14054 dm: use PRINT_FIELD_* macros. 14055 * dm.c (dm_decode_values, dm_decode_dm_target_spec, 14056 dm_decode_dm_target_deps, dm_decode_dm_target_msg, dm_known_ioctl): Use 14057 PRINT_FIELD_D, PRINT_FIELD_U, and PRINT_FIELD_FLAGS. 14058 14059 2017-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 14060 14061 Move macros related to kernel types to kernel_types.h. 14062 Some macros related to kernel types are defined both in defs.h and 14063 tests/tests.h. Avoid this redundancy by moving these definitions 14064 to kernel_types.h. 14065 14066 * defs.h (PRI_kl, PRI_kld, PRI_klu, PRI_klx, PRI__64, PRI__d64, 14067 PRI__u64, PRI__x64): Move ... 14068 * kernel_types.h: ... here. 14069 * tests/tests.h (PRI__64, PRI__d64, PRI__u64, PRI__x64): Remove. 14070 14071 2017-07-13 Lazar Trsic <Lazar.Trsic (a] imgtec.com> 14072 14073 mips64: fix PRI__64 macro definition when compiled for Android. 14074 By default for MIPS64 in Android __u64 type is exported 14075 as unsigned long long. This caused compilation -Wformat warnings 14076 and would break the build if -Werror is used. 14077 14078 * defs.h [SIZEOF_LONG != 4 && MIPS && __ANDROID__] (PRI__64): Change 14079 from "l" to "ll". 14080 14081 2017-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 14082 14083 block: use PRINT_FIELD_* macros. 14084 This also fixes output correctness for struct blkpg_ioctl_arg. 14085 14086 * block.c (print_blkpg_req): Use PRINT_FIELD_D and PRINT_FIELD_XVAL. 14087 (block_ioctl): Use PRINT_FIELD_U. 14088 * tests/ioctl_block.c (main): Update expected output. 14089 14090 2017-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 14091 14092 netlink_sock_diag: enhance decoding of long meminfo arrays. 14093 Print trailing dots instead of silent truncation if the array 14094 is too long. 14095 14096 * netlink_sock_diag.c (decode_meminfo): Do not apply SK_MEMINFO_VARS 14097 limit to nmemb, specify element count to print_array instead. 14098 (print_meminfo): Check element count and terminate printing 14099 if the element count exceeds SK_MEMINFO_VARS. 14100 * tests/nlattr_inet_diag_msg.c (main): Check it. 14101 14102 2017-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 14103 14104 tests: extend coverage of netlink_diag_req decoder. 14105 Add one more NETLINK_SOCK_DIAG check to ressurrect full coverage 14106 of netlink_diag_req decoder that was lost after commit 14107 v4.18-58-g37ef2d0d. 14108 14109 * tests/netlink_sock_diag.c (test_netlink_diag_req): Add a check for 14110 sdiag_protocol != NDIAG_PROTO_ALL. 14111 14112 2017-07-12 JingPiao Chen <chenjingpiao (a] gmail.com> 14113 14114 tests: check decoding of NETLINK_CRYPTO nlmsg_flags. 14115 * tests/netlink_crypto.c (test_nlmsg_flags): New function. 14116 (main): Use it. 14117 14118 netlink: add decoding of NETLINK_CRYPTO nlmsg_flags. 14119 * netlink.c (decode_nlmsg_flags): Add NETLINK_CRYPTO. 14120 14121 tests: check decoding of NETLINK_CRYPTO message types. 14122 * configure.ac (AC_CHECK_HEADERS): Add linux/cryptouser.h. 14123 * tests/netlink_crypto.c: New file. 14124 * tests/gen_tests.in (netlink_crypto): New entry. 14125 * tests/pure_executables.list: Add netlink_crypto. 14126 * tests/.gitignore: Likewise. 14127 14128 netlink: add decoding of NETLINK_CRYPTO message types. 14129 * xlat/nl_crypto_types.in: New file. 14130 * netlink.c: Include "xlat/nl_crypto_types.h". 14131 (nlmsg_types): Add NETLINK_CRYPTO. 14132 14133 tests: introduce TEST_NETLINK and TEST_NETLINK_ macros. 14134 * tests/test_netlink.h: New file. 14135 * tests/Makefile.am (libtests_a_SOURCES): Add it. 14136 * tests/netlink_sock_diag.c: Include "test_netlink.h" 14137 instead of "netlink.h". 14138 (TEST_SOCK_DIAG): New macro. 14139 (test_unix_diag_req, test_unix_diag_msg, 14140 test_netlink_diag_req, test_netlink_diag_msg, 14141 test_packet_diag_req, test_packet_diag_msg, 14142 test_inet_diag_req, test_inet_diag_req_v2, 14143 test_inet_diag_msg, test_smc_diag_req, 14144 test_smc_diag_msg): Use it. 14145 (test_odd_family_req, test_odd_family_msg, 14146 test_inet_diag_sockid): Use TEST_NETLINK macro. 14147 14148 2017-07-11 JingPiao Chen <chenjingpiao (a] gmail.com> 14149 14150 tests: check decoding of nlattr_inet_diag_req_v2 attributes. 14151 * tests/nlattr_inet_diag_req_v2.c: New file. 14152 * tests/gen_tests.in (nlattr_inet_diag_req_v2): New entry. 14153 * tests/pure_executables.list: Add nlattr_inet_diag_req_v2. 14154 * tests/.gitignore: Likewise. 14155 14156 tests: check decoding of nlattr_inet_diag_req_compat attributes. 14157 * tests/nlattr_inet_diag_req_compat.c: New file. 14158 * tests/gen_tests.in (nlattr_inet_diag_req_compat): New entry. 14159 * tests/pure_executables.list: Add nlattr_inet_diag_req_compat. 14160 * tests/.gitignore: Likewise. 14161 14162 netlink: decode AF_INET inet_diag_req_* attributes. 14163 * linux/inet_diag.h (inet_diag_bc_op, inet_diag_hostcond, 14164 inet_diag_markcond): New structures. 14165 (INET_DIAG_BC_*): New enum. 14166 * netlink_sock_diag.c: Include "xlat/inet_diag_bytecodes.h". 14167 (decode_inet_addr, decode_inet_diag_hostcond, 14168 print_inet_diag_bc_op, decode_inet_diag_markcond, 14169 decode_bytecode_data, decode_inet_diag_bc_op): New functions. 14170 (inet_diag_req_nla_decoders): New array. 14171 (decode_inet_diag_req_compat, decode_inet_diag_req_v2): Use it. 14172 * xlat/inet_diag_bytecodes.in: New file. 14173 14174 2017-07-11 Dmitry V. Levin <ldv (a] altlinux.org> 14175 14176 Introduce PRINT_FIELD_CSTRING. 14177 * print_fields.h (PRINT_FIELD_CSTRING): New macro. 14178 * block.c (print_blkpg_req, block_ioctl): Use PRINT_FIELD_CSTRING 14179 instead of print_quoted_string. 14180 * btrfs.c (btrfs_ioctl): Likewise. 14181 * dm.c (dm_decode_device, dm_decode_dm_target_spec): Likewise. 14182 * loop.c (decode_loop_info, decode_loop_info64): Likewise. 14183 * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, 14184 print_v4l2_standard, print_v4l2_input, print_v4l2_tuner, 14185 print_v4l2_queryctrl): Likewise. 14186 * netlink_sock_diag.c (decode_smc_diag_lgrinfo): Use PRINT_FIELD_CSTRING 14187 instead of PRINT_FIELD_STRING. 14188 * uname.c (PRINT_UTS_MEMBER): Remove. 14189 (SYS_FUNC(uname)): Use PRINT_FIELD_CSTRING instead of PRINT_UTS_MEMBER. 14190 14191 2017-07-11 Dmitry V. Levin <ldv (a] altlinux.org> 14192 14193 Rename PRINT_FIELD_QUOTED_STRING to PRINT_FIELD_STRING. 14194 As string fields are always qouted when printed, choose a shorter name 14195 for the helper macro. 14196 14197 * print_fields.h (PRINT_FIELD_QUOTED_STRING): Rename 14198 to PRINT_FIELD_STRING. All callers updated. 14199 14200 2017-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 14201 14202 Update RWF_* constants. 14203 * xlat/rwf_flags.in: Add RWF_NOWAIT introduced by linux kernel 14204 commit v4.12-rc5-150-gb745fafa. 14205 14206 Intorduce PRINT_FIELD_0X. 14207 * print_fields.h (PRINT_FIELD_0X): New macro. 14208 * sockaddr.c (print_sockaddr_data_ipx, print_sockaddr_data_nl): Use it 14209 instead of manual tprintf statements. 14210 * netlink_sock_diag.c (PRINT_FIELD_SMC_DIAG_CONNINFO_FLAGS): Remove. 14211 (decode_smc_diag_conninfo): Replace it with PRINT_FIELD_0X. 14212 14213 print_inet_addr: use inet_addr-based output format for IPv4. 14214 * sockaddr.c (print_inet_addr): Remove af_name variable. 14215 <AF_INET>: Use inet_addr-based output format. 14216 * tests/netlink_sock_diag.c (test_inet_diag_sockid, test_inet_diag_req, 14217 test_inet_diag_req_v2, test_inet_diag_msg, test_smc_diag_req, 14218 test_smc_diag_msg): Update expected output. 14219 * tests/nlattr_inet_diag_msg.c (print_inet_diag_msg): Likewise. 14220 * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise. 14221 14222 2017-07-10 JingPiao Chen <chenjingpiao (a] gmail.com> 14223 14224 tests: check decoding of netlink smc_diag_msg attributes. 14225 * tests/nlattr_smc_diag_msg.c: New file. 14226 * tests/gen_tests.in (nlattr_smc_diag_msg): New entry. 14227 * tests/pure_executables.list: Add nlattr_smc_diag_msg. 14228 * tests/.gitignore: Likewise. 14229 14230 netlink: decode AF_SMC smc_diag_msg attributes. 14231 * linux/smc_diag.h (smc_diag_cursor, smc_diag_conninfo 14232 smc_diag_linkinfo, smc_diag_lgrinfo): New structures. 14233 * netlink_sock_diag.c: Include "xlat/smc_link_group_roles.h". 14234 (decode_smc_diag_conninfo, decode_smc_diag_lgrinfo): New functions. 14235 (smc_diag_msg_nla_decoders): New array. 14236 (decode_smc_diag_msg): Use it. 14237 * xlat/smc_link_group_roles.in: New file. 14238 14239 2017-07-10 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 14240 14241 pathtrace.c: introduce user-provided sets of paths. 14242 * defs.h (struct path_set): New structure. 14243 (global_path_set): New variable prototype. 14244 (tracing_paths): Change macro body to use global_path_set variable. 14245 (pathtrace_select_set): Add "struct path_set *" argument. 14246 (pathtrace_match_set): Likewise. Change return type to bool. 14247 (pathtrace_select, pathtrace_match): Change into thin macro wrappers 14248 around pathtrace_select_set and pathtrace_match_set, repsectively. 14249 * pathtrace.c (global_path_set): New variable. 14250 (storepath, pathtrace_select_set): Add "struct path_set *" argument. 14251 (pathmatch, upathmatch, fdmatch, pathtrace_match_set): Likewise. 14252 Change return type to bool. 14253 14254 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14255 14256 tests: check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. 14257 * tests/group_req.c: New file. 14258 * tests/gen_tests.in (group_req): New entry. 14259 * tests/pure_executables.list: Add group_req. 14260 * tests/.gitignore: Likewise. 14261 14262 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14263 14264 Mpersify struct group_req. 14265 The size of struct group_req depends on alignment of long and therefore 14266 has to be mpersified. 14267 14268 * print_group_req.c: New file. 14269 * Makefile.am (strace_SOURCES): Add it. 14270 * net.c (print_group_req): Move to print_group_req.c, wrap into 14271 MPERS_PRINTER_DECL. 14272 14273 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14274 14275 net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. 14276 * net.c (print_group_req): Allow option length greater than 14277 sizeof(struct group_req) to match the kernel behaviour. 14278 When the option length is invalid, print the address. 14279 * NEWS: Mention this. 14280 14281 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14282 14283 net: hook up MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP decoding for SOL_IPV6. 14284 As multicast socket options are shared between IPv4 and IPv6, 14285 they should be decoded both for SOL_IP and SOL_IPV6. 14286 14287 * net.c (print_setsockopt) <SOL_IPV6> [MCAST_JOIN_GROUP]: Handle 14288 MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP. 14289 14290 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14291 14292 xlat: add MCAST_* to sockipv6options. 14293 Multicast socket options are shared between IPv4 and IPv6. 14294 14295 * xlat/sockipv6options.in: Add MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE, 14296 MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP, 14297 MCAST_LEAVE_SOURCE_GROUP, and MCAST_MSFILTER. 14298 14299 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14300 14301 net: enhance decoding of IP_ADD_MEMBERSHIP et al socket options. 14302 * net.c (print_mreq, print_mreq6): Treat negative option length 14303 as invalid to match the kernel behaviour. When the option length 14304 is invalid, print the address. 14305 * NEWS: Mention it. 14306 * tests/ip_mreq.c (main): Check it. Update expected output. 14307 14308 net: enhance decoding of setsockopt's SO_LINGER negative option length. 14309 * net.c (print_set_linger): Treat negative option length as invalid 14310 to match the kernel behaviour. 14311 * tests/so_linger.c (main): Check it. 14312 14313 msghdr: use PRINT_FIELD_* macros. 14314 * msghdr.c (print_scm_creds): Use PRINT_FIELD_U and PRINT_FIELD_UID. 14315 (print_cmsg_ip_recverr): Use PRINT_FIELD_U. 14316 (print_struct_msghdr): Use PRINT_FIELD_U and PRINT_FIELD_FLAGS. 14317 14318 Intorduce PRINT_FIELD_SOCKADDR. 14319 * print_fields.h (PRINT_FIELD_SOCKADDR): New macro. 14320 * msghdr.c (print_cmsg_ip_recverr): Use it instead of print_sockaddr. 14321 * net.c (print_group_req): Likewise. 14322 * sock.c (PRINT_IFREQ_ADDR): Remove. 14323 (print_ifreq, print_ifconf_ifreq): Use PRINT_FIELD_SOCKADDR 14324 instead of PRINT_IFREQ_ADDR. 14325 14326 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14327 14328 print_sockaddr: remove "struct tcb *" argument. 14329 print_sockaddr does not use its first argument, remove it. 14330 14331 * defs.h (print_sockaddr): Remove argument. 14332 * sockaddr.c (print_sockaddr): Remove argument. All callers updated. 14333 * sock.c (PRINT_IFREQ_ADDR): Likewise. 14334 14335 2017-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 14336 14337 net: use PRINT_FIELD_* macros. 14338 * net.c (print_tpacket_stats, print_tpacket_req): Use PRINT_FIELD_U. 14339 (print_group_req): Use PRINT_FIELD_IFINDEX. 14340 (print_packet_mreq): Use PRINT_FIELD_IFINDEX, PRINT_FIELD_U, 14341 and PRINT_FIELD_XVAL. 14342 14343 netlink_sock_diag: introduce PRINT_FIELD_INET_DIAG_SOCKID. 14344 * netlink_sock_diag.c (PRINT_FIELD_INET_DIAG_SOCKID): New macro. 14345 (decode_inet_diag_req_compat, decode_inet_diag_req_v2, 14346 decode_inet_diag_msg, decode_smc_diag_req, decode_smc_diag_msg): Use it 14347 instead of print_inet_diag_sockid. 14348 14349 Intorduce PRINT_FIELD_DEV. 14350 * print_fields.h (PRINT_FIELD_DEV): New macro. 14351 * dm.c (dm_decode_device, dm_decode_dm_name_list): Use it 14352 instead of print_dev_t. 14353 * loop.c (decode_loop_info, decode_loop_info64): Likewise. 14354 * netlink_sock_diag.c (decode_unix_diag_vfs): Likewise. 14355 14356 Intorduce PRINT_FIELD_INET4_ADDR. 14357 * print_fields.h (PRINT_FIELD_INET4_ADDR): New macro. 14358 * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of manual 14359 tprintf statements. 14360 * net.c (print_mreq): Likewise. 14361 * sockaddr.c (print_sockaddr_data_in): Likewise. 14362 14363 Intorduce PRINT_FIELD_NET_PORT. 14364 * print_fields.h (PRINT_FIELD_NET_PORT): New macro. 14365 * netlink_sock_diag.c (print_inet_diag_sockid): Use it 14366 instead of a manual tprintf statement. 14367 * sockaddr.c (print_sockaddr_data_in, print_sockaddr_data_in6, 14368 print_sockaddr_data_ipx): Likewise. 14369 14370 Intorduce PRINT_FIELD_IFINDEX. 14371 * print_fields.h (PRINT_FIELD_IFINDEX): New macro. 14372 * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of print_ifindex. 14373 * net.c (print_mreq6): Likewise. 14374 * netlink_sock_diag.c (print_packet_diag_mclist, 14375 print_inet_diag_sockid): Likewise. 14376 * sockaddr.c (print_sockaddr_data_in6, print_sockaddr_data_ll): 14377 Likewise. 14378 14379 Intorduce PRINT_FIELD_INET_ADDR. 14380 * print_fields.h (PRINT_FIELD_INET_ADDR): New macro. 14381 * net.c (print_mreq6): Use it instead of print_inet_addr. 14382 * netlink_sock_diag.c (print_inet_diag_sockid): Likewise. 14383 * sockaddr.c (print_sockaddr_data_in6): Likewise. 14384 14385 net: move print_ifindex to a separate file. 14386 * print_ifindex.c: New file. 14387 * Makefile.am (strace_SOURCES): Add it. 14388 * net.c (print_ifindex): Move to print_ifindex.c. 14389 14390 net: move parsers of bind, listen, and shutdown to separate files. 14391 * bind.c: New file. 14392 * listen.c: Likewise. 14393 * shutdown.c: Likewise. 14394 * Makefile.am (strace_SOURCES): Add them. 14395 * net.c (SYS_FUNC(bind)): Move to bind.c. 14396 (SYS_FUNC(listen)): Move to listen.c. 14397 (SYS_FUNC(shutdown)): Move to shutdown.c. 14398 14399 2017-07-09 JingPiao Chen <chenjingpiao (a] gmail.com> 14400 Dmitry V. Levin <ldv (a] altlinux.org> 14401 14402 tests: check decoding of packet_diag_msg attributes. 14403 * tests/netlink_sock_diag-v.sh: New file. 14404 * tests/Makefile.am (EXTRA_DIST): Add it. 14405 * tests/nlattr_packet_diag_msg.c: New file. 14406 * tests/gen_tests.in (nlattr_packet_diag_msg): New entry. 14407 * tests/pure_executables.list: Add nlattr_packet_diag_msg. 14408 * tests/.gitignore: Likewise. 14409 14410 netlink: decode AF_PACKET packet_diag_msg attributes. 14411 * linux/packet_diag.h (packet_diag_info, packet_diag_mclist, 14412 packet_diag_ring): New structures. 14413 (PDI_*): New macros. 14414 * netlink_sock_diag.c: Include <linux/filter.h> 14415 and "xlat/packet_diag_info_flags.h". 14416 (decode_packet_diag_info, decode_packet_diag_mclist, 14417 decode_packet_diag_ring, decode_packet_diag_filter): New functions. 14418 (packet_diag_msg_nla_decoders): New array. 14419 (decode_packet_diag_msg): Use it. 14420 * print_fields.h (PRINT_FIELD_QUOTED_STRING): New macro. 14421 * xlat/packet_diag_info_flags.in: New file. 14422 14423 2017-07-09 JingPiao Chen <chenjingpiao (a] gmail.com> 14424 14425 tests: fix TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects. 14426 commit v4.17-161-gdbd0605 that adjusted TEST_NLATTR_OBJECT and 14427 TEST_NLATTR_ARRAY for large objects, only changed the pattern 14428 print length, large length still can be specified as nla_data_len, 14429 resulting to output mismatch. 14430 14431 * tests/test_nlattr.h (TEST_NLATTR_OBJECT): Pass "plen" 14432 both as nla_data_len and slen arguments of TEST_NLATTR_ 14433 in len < sizeof(object) case. 14434 (TEST_NLATTR_ARRAY): Likewise, Pass "plen" both as nla_data_len 14435 and slen arguments of TEST_NLATTR_ in len < sizeof(object[0]) case. 14436 14437 2017-07-09 JingPiao Chen <chenjingpiao (a] gmail.com> 14438 14439 tests: introduce TEST_NLATTR_nla macro in test_nlattr.h. 14440 Explicitly make struct nlattr * pointer which is internal 14441 to TEST_NLATTR_ macro available to its varadic arguments. 14442 14443 * tests/test_nlattr.h (TEST_NLATTR_): Rename nla to TEST_NLATTR_nla. 14444 14445 2017-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 14446 14447 tests: check decoding of SO_PEERCRED socket option. 14448 * tests/so_peercred.c: New file. 14449 * tests/gen_tests.in (so_peercred): New entry. 14450 * tests/pure_executables.list: Add so_peercred. 14451 * tests/.gitignore: Likewise. 14452 14453 net: accept arbitrary option length for getsockopt's SO_PEERCRED. 14454 * print_fields.h (PRINT_FIELD_UID): New macro. 14455 * net.c (print_ucred): Rewrite to match the kernel behaviour. 14456 * NEWS: Mention this. 14457 14458 tests: check decoding of socket filters. 14459 * tests/sock_filter-v.c: New file. 14460 * tests/gen_tests.in (sock_filter-v): New entry. 14461 * tests/pure_executables.list: Add sock_filter-v. 14462 * tests/.gitignore: Likewise. 14463 14464 Implement decoding of linux socket filter programs. 14465 * bpf_sock_filter.c: New file. 14466 * Makefile.am (strace_SOURCES): Add it. 14467 * xlat/skf_ad.in: New file. 14468 * defs.h (decode_sock_fprog, print_sock_fprog): New prototypes. 14469 * fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer. 14470 * net.c (print_getsockopt): Use decode_sock_fprog to print 14471 socket filter programs for SO_GET_FILTER socket option. 14472 (print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size 14473 to print socket filter programs for SO_ATTACH_FILTER 14474 and SO_ATTACH_REUSEPORT_CBPF socket options. 14475 * NEWS: Mention this. 14476 14477 tests: check decoding of SO_LINGER socket option. 14478 * tests/so_linger.c: New file. 14479 * tests/gen_tests.in (so_linger): New entry. 14480 * tests/pure_executables.list: Add so_linger. 14481 * tests/.gitignore: Likewise. 14482 14483 tests: fix print_quoted_hex output of bytes with high bit set. 14484 * tests/tests.h (print_quoted_memory, print_quoted_hex): Change the type 14485 of first argument from "const char *" to "const void *". 14486 * tests/print_quoted_string.c: Likewise. 14487 (print_quoted_hex): Print bytes as unsigned char objects to avoid 14488 unwanted sign extension. 14489 * tests/netlink_protocol.c (send_query): Remove the cast of print_quoted_hex 14490 first argument which is now redundant. 14491 14492 net: accept arbitrary option length for getsockopt's SO_LINGER. 14493 * net.c (print_linger): Rename to print_set_linger. 14494 (print_setsockopt): Replace print_linger with print_set_linger. 14495 (print_get_linger): New function that accepts arbitrary option length 14496 to match the kernel behaviour. 14497 (print_getsockopt): Replace print_linger with print_get_linger. 14498 * NEWS: Mention this. 14499 14500 net: accept large option length for SO_LINGER. 14501 * net.c (print_linger): Allow len > sizeof(struct linger) to match 14502 the kernel behaviour. 14503 14504 net: fix printing of struct linger's field names. 14505 * net.c: Include "print_fields.h". 14506 (print_linger): Print fields of struct linger using PRINT_FIELD_D. 14507 14508 2017-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 14509 14510 net: enhance decoding of getsockopt's optlen argument. 14511 As the last argument of getsockopt syscall has read-write semantics, 14512 print both user and kernel values when they differ. 14513 14514 * net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save 14515 the length specified to the kernel. On error, print the length saved 14516 on entering. When the saved length and the length returned by the 14517 kernel differ, print both values. 14518 * NEWS: Mention this. 14519 * tests/net-icmp_filter.c (main): Update expected output. 14520 14521 2017-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 14522 14523 net: move printing of [gs]etsockopt's socklen argument to toplevel parsers 14524 * net.c (print_getsockopt, print_setsockopt): Remove "done" label, 14525 replace "goto done" statement with "return". 14526 Move printing of "len" argument ... 14527 (SYS_FUNC(getsockopt), SYS_FUNC(setsockopt)): ... here. 14528 14529 2017-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 14530 14531 Generalize seccomp filter parser. 14532 Linux socket filter uses almost the same classic BPF as seccomp filter, 14533 The only difference noticeable from strace PoV is the meaning of generic 14534 multiuse field. 14535 14536 Transform the parser of seccomp filters to a more generic parser 14537 of classic BPF, parametrized with a method of parsing the generic 14538 multiuse field in BPF_STMT. 14539 14540 * bpf_filter.c: New file. 14541 * bpf_filter.h: Likewise. 14542 * bpf_fprog.h: Likewise. 14543 * bpf_seccomp_filter.c: Likewise. 14544 * fetch_bpf_fprog.c: Likewise. 14545 * fetch_seccomp_fprog.c: Remove. 14546 * seccomp_fprog.h: Likewise. 14547 * Makefile.am (strace_SOURCES): Add bpf_filter.c, bpf_filter.h, 14548 bpf_fprog.h, bpf_seccomp_filter.c, and fetch_bpf_fprog.c. 14549 Remove fetch_seccomp_fprog.c and seccomp_fprog.h. 14550 * seccomp.c: Do not include linux/filter.h and xlat header files. 14551 Do not define SECCOMP_RET_ACTION. 14552 (bpf_filter, decode_bpf_code, decode_bpf_stmt, decode_bpf_jump, 14553 print_bpf_filter, print_seccomp_fprog, print_seccomp_filter): Remove. 14554 * defs.h (print_seccomp_filter): Rename to decode_seccomp_fprog. 14555 (SYS_FUNC(seccomp)): Replace print_seccomp_filter 14556 with decode_seccomp_fprog. 14557 * prctl.c (SYS_FUNC(prctl)): Likewise. 14558 14559 2017-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 14560 14561 Assume that <linux/filter.h> is always available. 14562 <linux/filter.h> was introduced in linux 2.1.75, way before 14563 the minimal kernel version supported by strace. 14564 14565 * configure.ac (AC_CHECK_HEADERS): Remove linux/filter.h. 14566 * seccomp.c: Assume HAVE_LINUX_FILTER_H. 14567 * tests/prctl-seccomp-filter-v.c: Likewise. 14568 * tests/seccomp-filter-v.c: Likewise. 14569 * tests/seccomp-filter.c: Likewise. 14570 14571 2017-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 14572 14573 xlat: add BPF_END to BPF_ALU opcode list. 14574 BPF_END is one of three eBPF-only opcodes for BPF_ALU class. 14575 Other two (BPF_MOV and BPF_ARSH) has been added earlier. 14576 14577 * xlat/bpf_op_alu.in: Add BPF_END. 14578 14579 2017-07-07 JingPiao Chen <chenjingpiao (a] gmail.com> 14580 14581 netlink_sock_diag: print unrecognized data in hex. 14582 * netlink_sock_diag.c (decode_family): Replace printstrn with 14583 printstr_ex and set QUOTE_FORCE_HEX flag. 14584 * tests/netlink_sock_diag.c (test_odd_family_req, 14585 test_odd_family_msg): Update expected output. 14586 14587 netlink: print unrecognized nlattr in hex. 14588 * nlattr.c (fetch_nlattr): Replace printstrn 14589 with printstr_ex and set QUOTE_FORCE_HEX flag. 14590 * tests/nlattr.c (test_nlattr): Update expected output. 14591 14592 netlink: print unrecognized netlink messages in hex. 14593 * netlink.c (fetch_nlmsghdr): Replace printstrn 14594 with printstr_ex and set QUOTE_FORCE_HEX flag. 14595 * tests/netlink_protocol.c (send_query): Update expected output. 14596 14597 netlink: print unrecognized netlink payload in hex. 14598 * netlink.c (decode_payload): Replace printstrn 14599 with printstr_ex and set QUOTE_FORCE_HEX flag. 14600 * tests/netlink_protocol.c (send_query, test_nlmsgerr, 14601 test_nlmsg_done): Update expected output. 14602 * tests/netlink_generic.c (test_nlmsg_type): Likewise. 14603 14604 netlink: print unrecognized nlmsgerr in hex. 14605 * netlink.c (decode_nlmsgerr): Replace printstrn 14606 with printstr_ex and set QUOTE_FORCE_HEX flag. 14607 * tests/netlink_protocol.c (test_nlmsgerr): Update expected output. 14608 14609 netlink: print unrecognized attribute data in hex. 14610 * nlattr.c (decode_nlattr_with_data): Replace printstrn 14611 with printstr_ex and set QUOTE_FORCE_HEX flag. 14612 * tests/tests.h (print_quoted_hex): New prototype. 14613 * tests/print_quoted_string.c (print_quoted_hex): New function. 14614 * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Use it 14615 for updated expected output. Change the type of "plen" variable 14616 to unsigned int. 14617 * tests/nlattr.c (test_nlattr): Update expected output. 14618 14619 tests: print quotation marks in print_quoted_memory. 14620 * tests/print_quoted_string.c (print_quoted_memory): Print opening 14621 and closing quotation marks. 14622 * tests/getcwd.c (main): Do not print quotation marks around 14623 print_quoted_string. 14624 * tests/uname.c (main): Likewise. 14625 * tests/keyctl.c (print_quoted_string_limit): Do not print quotation 14626 marks around print_quoted_memory. 14627 * tests/netlink_protocol.c (send_query): Likewise. 14628 * tests/xattr.c (main): Likewise. 14629 14630 2017-07-06 Dmitry V. Levin <ldv (a] altlinux.org> 14631 14632 strace.1: remove misleading remark that -i option is weakly supported. 14633 Given that -i functionality is covered by pc.test, the remark that 14634 it is weakly supported is wrong. 14635 14636 * strace.1 (BUGS): Remove the remark about weakly supported -i option. 14637 14638 2017-07-06 Dmitry V. Levin <ldv (a] altlinux.org> 14639 14640 Post-release administrivia. 14641 * NEWS: Add a header line for the next release. 14642 * debian/changelog.in: Add a changelog entry for 4.18-1. 14643 * strace.spec.in: Likewise. 14644 14645 2017-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 14646 14647 Prepare for 4.18 release. 14648 * NEWS: Update for 4.18 release. 14649 14650 2017-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 14651 14652 tests: robustify create_nl_socket based tests against the race condition 14653 There is a race condition between the moment a netlink socket is created 14654 and the moment it is reported via SOCK_DIAG_BY_FAMILY interface. 14655 Add one more operation on the socket created by create_nl_socket 14656 to increase chances of winning the race. 14657 14658 * tests/create_nl_socket.c (create_nl_socket_ext): Add a getsockopt call 14659 with the created socket. 14660 14661 2017-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 14662 14663 Update NEWS. 14664 14665 2017-07-04 Romain Naour <romain.naour (a] smile.fr> 14666 14667 nios2: fix wrong access to "SP" register in user_pt_regs. 14668 Starting with linux commit v4.0-rc4~21^2, "SP" register 14669 is available via regs[PTR_SP] member of struct user_pt_regs. 14670 14671 * linux/nios2/arch_regs.h (nios2_sp_ptr): Change type 14672 to "unsigned int *". 14673 * linux/nios2/arch_regs.c (nios2_sp_ptr): Likewise. 14674 Replace .sp with .regs[PTR_SP]. 14675 14676 Fixes: http://autobuild.buildroot.net/results/b9f/b9fc25b82f3280872fe1593ac252a8529ba83576 14677 Fixes: v4.16-34-g6117728a ("nios2: export nios2_sp_ptr") 14678 14679 2017-07-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 14680 Dmitry V. Levin <ldv (a] altlinux.org> 14681 14682 tests: add multi-process check to qual_fault.test. 14683 Check that syscall counters used for tampering are per-tcb. 14684 14685 * tests/qual_fault.c: Include <fcntl.h> for open(), 14686 <sys/param.h> for PATH_MAX, and <sys/wait.h> for wait(). 14687 (expfd): Rename to exp_fd, remove const qualifier and initialization. 14688 (gotfd): Rename to got_fd, remove const qualifier and initialization. 14689 (out_fd): New variable, for the expected strace output. 14690 (open_file): New helper function. 14691 (main): Remove st, add num_procs, proc, exp_prefix, got_prefix, 14692 out_prefix, pid_prefix. Remove stat asserts, update argc assert. 14693 Add num_procs, exp_prefix, got_prefix, out_prefix, pid_prefix 14694 initialization. Add per-process loop, open expfd, gotfd, out_fd, pidfd 14695 in each one, print process's pid to pidfd, print exit message to out_fd. 14696 Add wait() call for each forked process. 14697 * tests/qual_fault.test (N): increase to 100 in order to check 14698 concurrent process execution. 14699 (check_fault_injection): Take additional argument for the process 14700 count, pass it to qual_fault, add filename variables for expected strace 14701 output and pid file, pass them to qual_fault. 14702 Specify -ff parameter to strace invocation. 14703 Compare write and strace output for the each process. 14704 Update all check_fault_injection invocation with process count argument, 14705 add an invocation with 4 concurrent processes. 14706 * tests/init.sh (TIMEOUT_DURATION): Raise from 120 to 300. 14707 14708 2017-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 14709 14710 tests: adjust TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects 14711 * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Add 14712 support for objects larger than DEFAULT_STRLEN. 14713 * tests/nlattr_inet_diag_msg.c (main): Change pattern size 14714 from DEFAULT_STRLEN to 4096. 14715 * tests/nlattr_netlink_diag_msg.c: Likewise. 14716 * tests/nlattr_unix_diag_msg.c: Likewise. 14717 14718 Reported-by: JingPiao Chen <chenjingpiao (a] gmail.com> 14719 14720 2017-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 14721 14722 tests: move DEFAULT_STRLEN macro to tests.h. 14723 * tests/tests.h [!DEFAULT_STRLEN] (DEFAULT_STRLEN): New macro. 14724 * tests/mincore.c (DEFAULT_STRLEN): Remove. 14725 * tests/mmsg_name.c: Likewise. 14726 * tests/msg_control.c: Likewise. 14727 * tests/netlink_protocol.c: Likewise. 14728 * tests/nlattr.c: Likewise. 14729 * tests/nlattr_inet_diag_msg.c: Likewise. 14730 * tests/nlattr_netlink_diag_msg.c: Likewise. 14731 * tests/nlattr_unix_diag_msg.c: Likewise. 14732 * tests/printstr.c: Likewise. 14733 * tests/xattr.c: Likewise. 14734 * tests/execve.c: Likewise. 14735 (main): Initialize str_a and str_b arrays at run time. 14736 * tests/execveat.c: Likewise. 14737 14738 Suggested-by: JingPiao Chen <chenjingpiao (a] gmail.com> 14739 14740 2017-07-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 14741 14742 tests: use unified diff in order to improve test log readability. 14743 * tests/init.sh (match_diff): Add -u option to the diff invocation. 14744 14745 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 14746 14747 Fix error diagnostics in case of zero argc. 14748 * strace.c (init): Adjust argc along with argv, 14749 check that adjusted argc is sane. 14750 * tests/zeroargc.c: New file. 14751 * tests/.gitignore: Add zeroargc. 14752 * tests/Makefile.am (check_PROGRAMS): Likewise. 14753 * tests/options-syntax.test: Check strace error diagnostics 14754 in case of zero argc. 14755 14756 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 14757 14758 Use program_invocation_name instead of a local progname variable. 14759 Emulate program_invocation_name only if it is not provided by libc. 14760 14761 * configure.ac: Check for program_invocation_name variable. 14762 * strace.c (progname): Remove. 14763 [!HAVE_PROGRAM_INVOCATION_NAME] (program_invocation_name): New variable. 14764 (verror_msg, error_msg_and_help): Use it instead of progname. 14765 (init): Initialize program_invocation_name instead of progname. 14766 14767 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 14768 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 14769 14770 Introduce generic STRINGIFY and STRINGIFY_VAL macros. 14771 * macros.h (STRINGIFY, STRINGIFY_VAL): New macros. 14772 * mpers_type.h: Include "macros.h". 14773 [IN_MPERS] (STRINGIFY): Remove. 14774 * tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove. 14775 (TEST_SYSCALL_STR): Use STRINGIFY_VAL. 14776 14777 2017-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 14778 14779 Introduce macros.h. 14780 Introduce a separate header file for generic macros shared between 14781 strace and its tests. Start this unification with ARRAY_SIZE macro. 14782 14783 * defs.h: Include "macros.h". 14784 (ARRAY_SIZE): Move ... 14785 * macros.h: ... to new file. 14786 * Makefile.am (strace_SOURCES): Add it. 14787 * tests/tests.h: Include "macros.h". 14788 (ARRAY_SIZE): Remove. All callers updated. 14789 14790 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14791 14792 quota: use PRINT_FIELD_FLAGS. 14793 * quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t 14794 to uint8_t. 14795 (decode_cmd_data): Use PRINT_FIELD_FLAGS. 14796 14797 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14798 14799 Unify different generic PRINT_FIELD_* implementations. 14800 Create a new header print_fields.h and move generic PRINT_FIELD_* 14801 macros there. 14802 14803 * print_fields.h: New file. 14804 * Makefile.am (strace_SOURCES): Add it. 14805 * netlink_sock_diag.c: Include "print_fields.h". 14806 (PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS, 14807 PRINT_FIELD_XVAL): Move to print_fields.h file. 14808 * quota.c: Include "print_fields.h". 14809 (PRINT_FIELD_D): Move to print_fields.h file. 14810 (PRINT_FIELD_U, PRINT_FIELD_X): Remove. 14811 * statx.c: Include "print_fields.h". 14812 (PRINT_FIELD_U): Remove. 14813 (SYS_FUNC(statx)): Update PRINT_FIELD_U callers. 14814 * tests/quotactl.h: Include "print_fields.h". 14815 * tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros. 14816 * tests/quotactl.c: Likewise. 14817 (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove. 14818 * tests/test_nlattr.h: Include "print_fields.h". 14819 (PRINT_FIELD_U, PRINT_FIELD_X): Remove. 14820 * tests/xstatx.c: Include "print_fields.h". 14821 (PRINT_FIELD_U): Remove. 14822 (print_stat): Update PRINT_FIELD_U callers. 14823 * tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf. 14824 14825 2017-07-01 Eugeniy Paltsev <Eugeniy.Paltsev (a] synopsys.com> 14826 14827 arc: fix wrong access to "sp" member in user_regs_struct. 14828 "sp" register is a member of "scratch" structure (which is nested 14829 in user_regs_struct) 14830 14831 * linux/arc/arch_regs.c: Replace .sp with .scratch.sp . 14832 14833 Fixes: v4.16-31-g134042a5 ("arc: export arc_sp_ptr") 14834 14835 2017-07-01 Khem Raj <raj.khem (a] gmail.com> 14836 14837 aarch64, tile: replace struct ucontext with ucontext_t. 14838 glibc >= 2.26 has dropped the tag struct ucontext from ucontext_t type. 14839 14840 * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Replace 14841 struct ucontext with ucontext_t. 14842 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 14843 14844 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14845 14846 tests: enhance nlattr_unix_diag_msg test. 14847 * tests/nlattr_unix_diag_msg.c: Include "test_nlattr.h". 14848 (test_unix_diag_vfs, test_unix_diag_icons, test_unix_diag_rqlen): 14849 Remove. 14850 (init_unix_diag_msg): Add const qualifier to arguments and variables. 14851 (print_unix_diag_msg, print_uint): New functions. 14852 (main): Use them and macros from test_nlattr.h file. 14853 14854 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 14855 14856 tests: check decoding of netlink unix_diag_msg attributes. 14857 * tests/nlattr_unix_diag_msg.c: New file. 14858 * tests/gen_tests.in (nlattr_unix_diag_msg): New entry. 14859 * tests/pure_executables.list: Add nlattr_unix_diag_msg. 14860 * tests/.gitignore: Likewise. 14861 14862 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14863 14864 netlink_sock_diag: ensure that structure field names are printed properly 14865 * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_rqlen): 14866 Use PRINT_FIELD_U to print structure fields. 14867 14868 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14869 14870 netlink_sock_diag: add const qualifiers. 14871 Add const qualifiers to auto variables and function arguments. 14872 This change does not affect the code generated by the compiler, 14873 the purpose of these "const" qualifiers is to highlight the intent. 14874 14875 * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_inode, 14876 decode_unix_diag_rqlen): Add const qualifier to tcp, addr, and len 14877 arguments. 14878 14879 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 14880 14881 netlink: decode AF_UNIX unix_diag_msg attributes. 14882 * netlink_sock_diag.c (unix_diag_msg_nla_decoders): New array. 14883 (decode_unix_diag_msg): Use it. 14884 * linux/unix_diag.h (unix_diag_vfs, unix_diag_rqlen): New structures. 14885 14886 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14887 14888 tests: enhance nlattr_netlink_diag_msg test. 14889 * tests/nlattr_netlink_diag_msg.c: Include "test_nlattr.h". 14890 (test_netlink_diag_groups, test_netlink_diag_rx_ring, 14891 test_netlink_diag_flags): Remove. 14892 (init_netlink_diag_msg): Add const qualifier to arguments and variables. 14893 (print_netlink_diag_msg, print_xlong): New functions. 14894 (main): Use them and macros from test_nlattr.h file. 14895 14896 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 14897 14898 tests: check decoding of netlink_diag_msg attributes. 14899 * tests/nlattr_netlink_diag_msg.c: New file. 14900 * tests/gen_tests.in (nlattr_netlink_diag_msg): New entry. 14901 * tests/pure_executables.list: Add nlattr_netlink_diag_msg. 14902 * tests/.gitignore: Likewise. 14903 14904 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14905 14906 netlink_sock_diag: ensure that structure field names are printed properly 14907 * netlink_sock_diag.c (decode_netlink_diag_ring): Use PRINT_FIELD_U 14908 to print structure fields. 14909 14910 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14911 14912 netlink_sock_diag: add const qualifiers. 14913 Add const qualifiers to auto variables and function arguments. 14914 This change does not affect the code generated by the compiler, 14915 the purpose of these "const" qualifiers is to highlight the intent. 14916 14917 * netlink_sock_diag.c (print_group, decode_netlink_diag_groups, 14918 decode_netlink_diag_ring, decode_netlink_diag_flags): Add const 14919 qualifier to tcp, addr, and len arguments. 14920 14921 2017-07-01 JingPiao Chen <chenjingpiao (a] gmail.com> 14922 14923 netlink: decode AF_NETLINK netlink_diag_msg attributes. 14924 * linux/netlink_diag.h (netlink_diag_ring): New structure. 14925 (NDIAG_FLAG_*): New macros. 14926 * netlink_sock_diag.c: Include "xlat/netlink_socket_flags.h". 14927 (print_group, decode_netlink_diag_groups, decode_netlink_diag_ring, 14928 decode_netlink_diag_flags): New functions. 14929 (netlink_diag_msg_nla_decoders): New array. 14930 (decode_netlink_diag_msg): Use it. 14931 * xlat/netlink_socket_flags.in: New file. 14932 14933 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14934 14935 netlink_sock_diag: print inet_diag_sockid.idiag_if as an interface index 14936 * netlink_sock_diag.c (print_inet_diag_sockid): Print idiag_if field 14937 using print_ifindex. 14938 * tests/nlattr_inet_diag_msg.c: Include <net/if.h>. 14939 (IFINDEX_LO): New macro. 14940 (init_inet_diag_msg): Set inet_diag_sockid.idiag_if field. 14941 (print_inet_diag_msg): Update expected output. 14942 14943 2017-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 14944 JingPiao Chen <chenjingpiao (a] gmail.com> 14945 14946 tests: check decoding of several standard netlink attributes. 14947 * tests/nlattr_inet_diag_msg.c (main): Check decoding of uint32_t, 14948 uint8_t, and zero-terminated string attributes. 14949 14950 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 14951 14952 tests: enhance nlattr_inet_diag_msg test. 14953 * tests/test_nlattr.h: New file. 14954 * tests/Makefile.am (libtests_a_SOURCES): Add it. 14955 * tests/nlattr_inet_diag_msg.c: Include "test_nlattr.h". 14956 (test_inet_diag_meminfo, test_inet_diag_vegasinfo, 14957 test_inet_diag_dctcpinfo, test_inet_diag_bbrinfo): Remove. 14958 (address): New variable. 14959 (init_inet_diag_msg): Remove "address" argument, add const qualifier 14960 to all remaining arguments. 14961 (print_inet_diag_msg, print_uint): New functions. 14962 (main): Use macros from test_nlattr.h file. 14963 14964 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 14965 14966 tests: check decoding of netlink inet_diag_msg attributes. 14967 * tests/nlattr_inet_diag_msg.c: New file. 14968 * tests/gen_tests.in (nlattr_inet_diag_msg): New entry. 14969 * tests/pure_executables.list: Add nlattr_inet_diag_msg. 14970 * tests/.gitignore: Likewise. 14971 14972 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 14973 14974 netlink_sock_diag: ensure that structure field names are printed properly 14975 * netlink_sock_diag.c (PRINT_FIELD_X): New macro. 14976 (decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, 14977 decode_tcp_bbr_info): Use it and PRINT_FIELD_U to print structure 14978 fields. 14979 14980 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 14981 14982 netlink_sock_diag: add const qualifiers. 14983 Add const qualifiers to auto variables and function arguments. 14984 This change does not affect the code generated by the compiler, 14985 the purpose of these "const" qualifiers is to highlight the intent. 14986 14987 * netlink_sock_diag.c (print_meminfo, decode_meminfo, 14988 decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, 14989 decode_tcp_bbr_info): Add const qualifier to tcp, addr, and len 14990 arguments. 14991 14992 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 14993 14994 netlink: decode AF_INET inet_diag_msg attributes. 14995 * linux/inet_diag.h (inet_diag_meminfo, tcpvegas_info, 14996 tcp_dctcp_info, tcp_bbr_info): New structures. 14997 * linux/sock_diag.h (SK_MEMINFO_VARS): New macro. 14998 * netlink_sock_diag.c: Include <linux/sock_diag.h>. 14999 (print_meminfo, decode_meminfo, decode_inet_diag_meminfo, 15000 decode_tcpvegas_info, decode_tcp_dctcp_info, decode_tcp_bbr_info): 15001 New functions. 15002 (inet_diag_msg_nla_decoders): New array. 15003 (decode_inet_diag_msg): Use it. 15004 15005 2017-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 15006 15007 nlattr: add const qualifiers to auto variables and function arguments. 15008 This change does not affect the code generated by the compiler, 15009 the purpose of these "const" qualifiers is to highlight the intent. 15010 15011 * nlattr.c (decode_nlattr_with_data, decode_nla_str, decode_nla_strn, 15012 decode_nla_##name): Add const qualifier to tcp, addr, and len arguments. 15013 15014 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 15015 Fabien Siron <fabien.siron (a] epita.fr> 15016 15017 netlink: introduce nla_decoder_t to parse netlink attributes data. 15018 * nlattr.h (nla_decoder_t): New typedef. 15019 (DECL_NLA): New macro. 15020 (decode_nlattr): Add decoders, size and opaque_data argument. 15021 * nlattr.c: (decode_nlattr_with_data): Likewise. 15022 (decode_nla_*): New functions. 15023 * netlink_sock_diag.c (decode_inet_diag_req_compat) 15024 (decode_inet_diag_req_v2, decode_inet_diag_msg) 15025 (decode_netlink_diag_msg, (decode_packet_diag_msg) 15026 (decode_smc_diag_msg, decode_unix_diag_msg): Add decoders, 15027 size and opaque_data arguments. All callers updated. 15028 15029 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 15030 15031 netlink: add a basic netlink attribute parser of AF_SMC diag. 15032 * netlink_sock_diag.c: Include "xlat/smc_diag_attrs.h". 15033 (decode_smc_diag_msg): Use decode_nlattr. 15034 * xlat/smc_diag_attrs.in: New file. 15035 15036 2017-06-30 JingPiao Chen <chenjingpiao (a] gmail.com> 15037 Fabien Siron <fabien.siron (a] epita.fr> 15038 15039 netlink: add a basic netlink attribute parser of AF_INET diag. 15040 * linux/inet_diag.h (INET_DIAG_REQ_*): New enum. 15041 * netlink_sock_diag.c: Include "xlat/inet_diag_attrs.h" 15042 and "xlat/inet_diag_req_attrs.h". 15043 (decode_inet_diag_req_compat, decode_inet_diag_req_v2, 15044 decode_inet_diag_msg): Use decode_nlattr. 15045 * xlat/inet_diag_attrs.in: New file. 15046 * xlat/inet_diag_req_attrs.in: Likewise. 15047 15048 netlink: add a basic netlink attribute parser of AF_PACKET diag. 15049 * linux/packet_diag.h (PACKET_DIAG_*): New enum. 15050 * netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h". 15051 (decode_packet_diag_msg): Use decode_nlattr. 15052 * xlat/packet_diag_attrs.in: New file. 15053 15054 netlink: add a basic netlink attribute parser of AF_NETLINK diag. 15055 * linux/netlink_diag.h (NETLINK_DIAG_*): New enum. 15056 * netlink_sock_diag.c: Include "xlat/netlink_diag_attrs.h". 15057 (decode_netlink_diag_msg): Use decode_nlattr. 15058 * xlat/netlink_diag_attrs.in: New file. 15059 15060 2017-06-29 Dmitry V. Levin <ldv (a] altlinux.org> 15061 15062 netlink_sock_diag: ensure that structure field names are printed properly 15063 * netlink_sock_diag.c (PRINT_FIELD_U, PRINT_FIELD_COOKIE, 15064 PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): New macros. 15065 (decode_unix_diag_req, decode_unix_diag_msg, decode_netlink_diag_req, 15066 decode_netlink_diag_msg, decode_packet_diag_req, decode_packet_diag_msg, 15067 print_inet_diag_sockid, decode_inet_diag_req_compat, 15068 decode_inet_diag_req_v2, decode_inet_diag_msg, decode_smc_diag_req, 15069 decode_smc_diag_msg): Use them to print structure fields. 15070 15071 2017-06-29 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 15072 15073 Update ioctl entries from linux v4.12-rc7. 15074 * linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7 15075 (with f7a320ff commit applied on top) using ioctls_gen.sh. 15076 * linux/32/ioctls_inc_align32.h: Likewise. 15077 * linux/32/ioctls_inc_align64.h: Likewise. 15078 * linux/64/ioctls_inc.h: Likewise. 15079 * linux/x32/ioctls_inc0.h: Likewise. 15080 * NEWS: Mention this. 15081 15082 2017-06-29 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 15083 15084 maint: fix ioctls_sym.sh premature termination. 15085 When the list of headers do not fit into the command line, xargs splits 15086 it into several lists and then passes them to grep. If no headers from 15087 a list match the grep pattern, grep exits with a non-zero status that 15088 causes xargs to exit with a non-zero status, too. 15089 15090 * maint/ioctls_sym.sh: Use "find -exec +" instead of xargs, 15091 ignore its exit status. 15092 15093 2017-06-27 JingPiao Chen <chenjingpiao (a] gmail.com> 15094 15095 tests: introduce NLMSG_ATTR macro. 15096 * tests/tests.h (NLMSG_ATTR): New macro. 15097 * tests/nlattr.c (test_nlattr, test_nla_type): Use it. 15098 15099 2017-06-27 JingPiao Chen <chenjingpiao (a] gmail.com> 15100 15101 netlink: pass NLMSG_DONE messages to family specific payload decoders. 15102 While many NLMSG_DONE messages indeed have payload containing 15103 just one integer, there are exceptions. Handle this by passing 15104 payloads of NLMSG_DONE messages to family specific netlink 15105 payload decoders. 15106 15107 * netlink.c (print_nlmsghdr): Do not skip family detection 15108 for nlmsg_type == NLMSG_DONE. 15109 (decode_nlmsg_type): Skip family specific type decoders 15110 for type == NLMSG_DONE. 15111 (decode_nlmsg_flags): Skip family specific decoding of flags 15112 for type == NLMSG_DONE. 15113 (decode_netlink_sock_diag): Skip for nlmsg_type == NLMSG_DONE. 15114 15115 2017-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 15116 15117 Unexport die_out_of_memory. 15118 Print more specific error diagnostics than a generic "Out of memory" 15119 when an error happens outside xmalloc.c. 15120 15121 * defs.h (die_out_of_memory): Remove prototype. 15122 * strace.c (strace_popen, init): Call perror_msg_and_die instead 15123 of die_out_of_memory. 15124 * unwind.c (unwind_tcb_init): Likewise. 15125 * xmalloc.c (die_out_of_memory): Add static qualifier. 15126 15127 2017-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 15128 15129 Check -s argument early. 15130 * util.c (printstr_ex): Move the check that -s argument 15131 does not exceed -1U / 4 ... 15132 * strace.c (init): ... here. 15133 * tests/options-syntax.test: Check it. 15134 15135 2017-06-25 Dmitry V. Levin <ldv (a] altlinux.org> 15136 15137 Include "netlink.h" instead of <linux/netlink.h> 15138 * net.c: Include "netlink.h" instead of <linux/netlink.h>. 15139 * sockaddr.c: Likewise. 15140 * tests/create_nl_socket.c: Likewise. 15141 * tests/net-sockaddr.c: Likewise. 15142 * tests/netlink_audit.c: Likewise. 15143 * tests/netlink_generic.c: Likewise. 15144 * tests/netlink_inet_diag.c: Likewise. 15145 * tests/netlink_netfilter.c: Likewise. 15146 * tests/netlink_route.c: Likewise. 15147 * tests/netlink_selinux.c: Likewise. 15148 * tests/netlink_xfrm.c: Likewise. 15149 * tests/net-yy-netlink.c: Include "netlink.h" instead 15150 of <linux/netlink.h>, remove fallback definition of NETLINK_SOCK_DIAG. 15151 * tests/netlink_netlink_diag.c: Likewise. 15152 * tests/netlink_protocol.c: Likewise. 15153 * tests/netlink_sock_diag.c: Likewise. 15154 * tests/netlink_unix_diag.c: Likewise. 15155 * tests/nlattr.c: Likewise. 15156 15157 2017-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 15158 15159 netlink: provide a fallback definition of NETLINK_SOCK_DIAG. 15160 Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h 15161 instead of adding these fallback definitions to every file. 15162 15163 * netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG. 15164 * socketutils.c: Include "netlink.h" instead of <linux/netlink.h>, 15165 remove fallback definition of NETLINK_SOCK_DIAG. 15166 15167 2017-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 15168 15169 Update prctl ARCH_* constants. 15170 * xlat/archvals.in: Add ARCH_GET_CPUID and ARCH_SET_CPUID 15171 introduced by linux kernel commit v4.12-rc1~153^2~2. 15172 15173 2017-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 15174 15175 Update V4L2_* constants. 15176 * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_META_CAPTURE introduced 15177 by linux kernel commit v4.12-rc1~85^2~71. 15178 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_META_CAPTURE 15179 introduced by the same commit. 15180 * xlat/v4l2_control_flags.in: Add V4L2_CTRL_FLAG_HAS_PAYLOAD, 15181 V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and V4L2_CTRL_FLAG_MODIFY_LAYOUT 15182 introduced by linux kernel commits v3.17-rc1~112^2~363, 15183 v4.1-rc1~59^2~1^2~63, and v4.12-rc1~85^2~62, respectively. 15184 * xlat/v4l2_control_types.in: Add V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16, 15185 and V4L2_CTRL_TYPE_U32 introduced by linux kernel commits 15186 v3.17-rc1~112^2~343 and v3.17-rc1~112^2~112. 15187 15188 Update SCTP_* constants. 15189 * xlat/socksctpoptions.in: Add SCTP_ENABLE_STREAM_RESET, 15190 SCTP_RESET_STREAMS, SCTP_RESET_ASSOC, SCTP_ADD_STREAMS, 15191 SCTP_RECONFIG_SUPPORTED, and SCTP_PR_STREAM_STATUS introduced 15192 by linux kernel commits v4.11-rc1~124^2~387^2~1, v4.11-rc1~124^2~387^2, 15193 v4.11-rc1~124^2~166^2~2, v4.11-rc1~124^2~166^2, v4.12-rc1~64^3~469^2, 15194 and v4.12-rc1~64^3~276, respectively. 15195 15196 Update RTM_* constants. 15197 * xlat/nl_route_types.in: Add RTM_DELNETCONF introduced 15198 by linux kernel commit v4.12-rc1~64^3~312^2~6. 15199 15200 Update NDIAG_SHOW_* constants. 15201 * linux/netlink_diag.h (NDIAG_SHOW_FLAGS): New constant introduced 15202 by linux kernel commit v4.12-rc1~64^3~260. 15203 * xlat/netlink_diag_show.in: Add it. 15204 15205 Update KEYCTL_* constants. 15206 * xlat/keyctl_commands.in: Add KEYCTL_RESTRICT_KEYRING introduced 15207 by linux kernel commit v4.12-rc1~123^2~7^2~2^2~3. 15208 15209 Update ARPHRD_* constants. 15210 * xlat/arp_hardware_types.in: Add ARPHRD_VSOCKMON introduced 15211 by linux kernel commit v4.12-rc1~129^2~118^2~2. 15212 15213 Update SO_* constants. 15214 * xlat/sockoptions.in: Add SO_MEMINFO, SO_INCOMING_NAPI_ID, 15215 and SO_COOKIE introduced by linux kernel commits v4.12-rc1~64^3~389, 15216 v4.12-rc1~64^3~341^2, and v4.12-rc1~64^3~221^2~1, respectively. 15217 15218 2017-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 15219 15220 tests: check more corner cases of nlattr decoding. 15221 * tests/nlattr.c (test_nlattr): Check decoding in case of invalid 15222 struct nlattr.nla_len. 15223 15224 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 15225 15226 tests: check decoding of netlink attribute. 15227 * tests/nlattr.c: New file. 15228 * tests/gen_tests.in (nlattr): New entry. 15229 * tests/pure_executables.list: Add nlattr. 15230 * tests/.gitignore: Likewise. 15231 15232 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 15233 Fabien Siron <fabien.siron (a] epita.fr> 15234 15235 netlink: introduce a basic netlink attributes parser. 15236 * linux/unix_diag.h (UNIX_DIAG_*): New enum. 15237 * nlattr.c: New file. 15238 * nlattr.h: Likewise. 15239 * Makefile.am (strace_SOURCES): Add them. 15240 * netlink_sock_diag.c: Include "nlattr.h" and "xlat/unix_diag_attrs.h". 15241 (decode_unix_diag_msg): Use decode_nlattr. 15242 * xlat/unix_diag_attrs.in: New file. 15243 15244 2017-06-21 JingPiao Chen <chenjingpiao (a] gmail.com> 15245 15246 netlink: introduce netlink.h. 15247 * netlink.h: New file. 15248 * Makefile.am (strace_SOURCES): Add it. 15249 * netlink_sock_diag.c: Include "netlink.h", 15250 remove <sys/socket.h> and <linux/netlink.h>. 15251 * netlink.c: Likewise. 15252 (NLMSG_HDRLEN): Move to netlink.h. 15253 * tests/netlink_protocol.c: Replace <linux/netlink.h> with "netlink.h". 15254 * tests/netlink_sock_diag.c: Likewise. 15255 15256 2017-06-20 Dmitry V. Levin <ldv (a] altlinux.org> 15257 15258 tests: add SET_STRUCT macro to tests.h. 15259 * tests/netlink_sock_diag.c (INIT_STRUCT): Rename to SET_STRUCT, 15260 all callers updated. Move ... 15261 * tests/tests.h: ... here. 15262 15263 2017-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 15264 15265 tests: fix potential unaligned access in netlink_sock_diag.test. 15266 Despite our efforts made to avoid unaligned access, gcc appears to be 15267 generating instructions that might cause unaligned access when copying 15268 structures to unaligned addresses. 15269 15270 Fix this issue by replacing copying of structures to unaligned addresses 15271 with memcpy calls. 15272 15273 * tests/netlink_sock_diag.c (INIT_STRUCT): New macro. 15274 (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, 15275 test_unix_diag_msg, test_netlink_diag_req, test_netlink_diag_msg, 15276 test_packet_diag_req, test_packet_diag_msg, test_inet_diag_sockid, 15277 test_inet_diag_req, test_inet_diag_req_v2, test_inet_diag_msg, 15278 test_smc_diag_req, test_smc_diag_msg): Use it to initialize potentially 15279 unaligned struct nlmsghdr. Do not access nlh->nlmsg_len. 15280 15281 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 15282 15283 tests: check decoding of NETLINK_GENERIC message types. 15284 * tests/netlink_generic.c: New file. 15285 * tests/gen_tests.in (netlink_generic): New entry. 15286 * tests/pure_executables.list: Add netlink_generic. 15287 * tests/.gitignore: Likewise. 15288 15289 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 15290 15291 netlink: add decoding of NETLINK_GENERIC protocol families. 15292 NETLINK_GENERIC is a protocol stacked on netlink protocol. 15293 15294 When a NETLINK_GENERIC subsystem registers its "family" name in the 15295 kernel at run time, an integer value associated with this name is 15296 assigned by the kernel. This integer value is specified in struct 15297 nlmsghdr.nlmsg_type of subsequent communications with the 15298 NETLINK_GENERIC subsystem. 15299 15300 This change implements decoding of NETLINK_GENERIC message types in 15301 symbolic form, for example: 15302 15303 $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null 15304 sendto(4<NETLINK:[GENERIC:12345]>, {{len=20, type=tcp_metrics, ... 15305 +++ exited with 0 +++ 15306 15307 Note that type= specifying the NETLINK_GENERIC protocol family 15308 is decoded properly. 15309 15310 * netlink.c (decode_nlmsg_type_generic): New function. 15311 (nlmsg_types): Add NETLINK_GENERIC entry. 15312 15313 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 15314 15315 socketutils: build a dynamic xlat table for NETLINK_GENERIC decoding. 15316 * configure.ac (AC_CHECK_HEADERS): Add linux/genetlink.h. 15317 * defs.h (genl_families_xlat): New prototype. 15318 * socketutils.c [HAVE_LINUX_GENETLINK_H]: Include <linux/genetlink.h>. 15319 [HAVE_LINUX_GENETLINK_H] (genl_send_dump_families, 15320 genl_parse_families_response): New helper functions. 15321 (genl_families_xlat): New function for building the xlat table 15322 for NETLINK_GENERIC decoding. 15323 15324 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 15325 15326 dyxlat: new interface for building xlat tables dynamically. 15327 xlat tables are usually generated at build time. 15328 15329 printxval is suitable for printing struct nlmsghdr.nlmsg_type for 15330 NETLINK_GENERIC protocol. However, the corresponding xlat table 15331 cannot be defined at build time because the values are registered 15332 by the kernel at run time. 15333 15334 This change introduces dyxlat functions for building xlat tables 15335 dynamically. The primary use case is decoding nlmsg_type but this 15336 interface can be used for other purposes. 15337 15338 * defs.h (struct dyxlat): New opaque data type. 15339 (dyxlat_alloc, dyxlat_free, dyxlat_add_pair): New function declarations. 15340 * dyxlat.c: New file. 15341 * Makefile.am (strace_SOURCES): Add it. 15342 15343 2017-06-19 Masatake YAMATO <yamato (a] redhat.com> 15344 15345 Introduce xstrndup function. 15346 * configure.ac (AC_CHECK_FUNCS): Add strndup. 15347 * defs.h (xstrndup): New prototype. 15348 * xmalloc.c (xstrndup): New function. 15349 15350 2017-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 15351 15352 netlink: do not print extra braces around payloadless nlmsghdr. 15353 * netlink.c (decode_nlmsghdr_with_payload): Print braces before 15354 print_nlmsghdr and after decode_payload iff decode_payload is invoked. 15355 * tests/netlink_audit.c (test_nlmsg_type): Update expected output. 15356 * tests/netlink_netfilter.c: Likewise. 15357 * tests/netlink_selinux.c: Likewise. 15358 * tests/netlink_protocol.c (send_query): Likewise. 15359 * tests/netlink_route.c (test_nlmsg_type, test_nlmsg_flags): Likewise. 15360 * tests/netlink_sock_diag.c: Likewise. 15361 * tests/netlink_xfrm.c: Likewise. 15362 15363 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15364 15365 Strip argument name of type "struct tcb *" from function prototypes. 15366 "struct tcb *" was used in most prototypes along with "struct tcb *tcp", 15367 this change converts the latter form to the former for consistency. 15368 15369 Fix a few spacing style issues. 15370 Reported by kernel's checkpatch.pl script. 15371 15372 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15373 15374 Strip redundant trailing semicolons. 15375 Strip trailing semicolons from macro definitions. 15376 Strip extra semicolons from statements terminations. 15377 15378 Reported by kernel's checkpatch.pl script. 15379 15380 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15381 15382 Fix macros encosure in a do/while loop. 15383 Enclose macros with multiple statements and macros starting 15384 with "if" statement in a do/while loop. 15385 Do not enclose single statement macros in a do/while loop. 15386 15387 Reported by kernel's checkpatch.pl script. 15388 15389 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15390 15391 Use __func__ instead of gcc specific __FUNCTION__ 15392 Reported by kernel's checkpatch.pl script. 15393 15394 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15395 15396 Fix a few initialization style issues. 15397 Do not initialise statics and globals to 0, NULL, or false. 15398 15399 Reported by kernel's checkpatch.pl script. 15400 15401 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15402 15403 Fix function prototypes with unspecified arguments. 15404 Change functions declared as taking unspecified number of arguments 15405 of unspecified type to functions that take no arguments. 15406 15407 Reported by kernel's checkpatch.pl script. 15408 15409 2017-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 15410 15411 Fix a few sizeof style issues. 15412 Reported by kernel's checkpatch.pl script. 15413 15414 Fix a few misspellings in comments. 15415 Reported by kernel's checkpatch.pl script. 15416 15417 2017-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 15418 15419 print_mreq: remove superfluous print_quoted_string calls. 15420 The string returned by inet_ntoa(3) has IPv4 dotted-decimal notation, 15421 no need to quote it. 15422 15423 * net.c (print_mreq): Remove print_quoted_string calls. 15424 15425 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 15426 15427 tests: check decoding of incomplete SCM_TIMESTAMP* control messages. 15428 * tests/msg_control.c (test_scm_timestamp, test_scm_timestampns, 15429 test_scm_timestamping): Check decoding of incomplete control messages. 15430 15431 2017-06-15 Miroslav Lichvar <mlichvar (a] redhat.com> 15432 15433 msghdr: print SCM_TIMESTAMP* control messages. 15434 Add support for printing control messages containing software and/or 15435 hardware timestamps, which are typically enabled by NTP and PTP 15436 implementations. 15437 15438 * print_timeval.c (print_struct_timeval_data_size): New mpers printer. 15439 * print_timespec.c (print_struct_timespec_data_size, 15440 print_struct_timespec_array_data_size): Likewise. 15441 * msghdr.c (print_scm_timestamp, print_scm_timestampns, 15442 print_scm_timestamping): New functions. 15443 (cmsg_socket_printers): Add them. 15444 * NEWS: Mention this change. 15445 * tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h". 15446 (test_scm_timestamp, test_scm_timestampns, test_scm_timestamping): 15447 New functions. 15448 (test_sol_socket): Use them. 15449 15450 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 15451 15452 tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages. 15453 * tests/netlink_sock_diag.c: Include <linux/smc_diag.h>. 15454 (SMC_ACTIVE): New macro. 15455 (test_smc_diag_req, test_smc_diag_msg): New functions. 15456 (main): Use them. 15457 15458 netlink: add a basic socket diag parser of AF_SMC messages. 15459 * linux/smc_diag.h: New file. 15460 * Makefile.am (EXTRA_DIST): Add it. 15461 * netlink_sock_diag.c: Include <linux/smc_diag.h>, 15462 "xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h". 15463 (decode_smc_diag_req, decode_smc_diag_msg): New functions. 15464 (diag_decoders): Add AF_SMC. 15465 * xlat/smc_diag_extended_flags.in: New file. 15466 * xlat/smc_states.in: Likewise. 15467 15468 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 15469 Fabien Siron <fabien.siron (a] epita.fr> 15470 15471 tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages. 15472 * tests/netlink_sock_diag.c: Include <arpa/inet.h> 15473 and <linux/inet_diag.h>. 15474 (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2, 15475 test_inet_diag_msg): New functions. 15476 (mian): Use them. 15477 15478 netlink: add a basic socket diag parser of AF_INET and AF_INET6 messages 15479 * defs.h (inet_protocols): New xlat prototype. 15480 * linux/inet_diag.h (inet_diag_req): New structure. 15481 (INET_DIAG_*): New enum. 15482 * netlink_sock_diag.c: Include <arpa/inet.h>, <linux/inet_diag.h> 15483 and "xlat/inet_diag_extended_flags.h". 15484 (print_inet_diag_sockid, decode_inet_diag_req_compat) 15485 (decode_inet_diag_req_v2, decode_inet_diag_req) 15486 (decode_inet_diag_msg): New functions. 15487 (diag_decoders): Add AF_INET and AF_INET6; 15488 * xlat/inet_diag_extended_flags.in: New file. 15489 15490 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 15491 15492 Introduce print_inet_addr. 15493 * defs.h (print_inet_addr): New prototype. 15494 * sockaddr.c (print_inet_addr): New function. 15495 (print_sockaddr_data_in6): Use it. 15496 * net.c (print_mreq6): Likewise. 15497 * tests/ip_mreq.c (main): Update expected output. 15498 15499 2017-06-15 JingPiao Chen <chenjingpiao (a] gmail.com> 15500 Fabien Siron <fabien.siron (a] epita.fr> 15501 15502 tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages. 15503 * tests/netlink_sock_diag.c: Include <linux/if_ether.h> 15504 and <linux/packet_diag.h>. 15505 (test_packet_diag_req, test_packet_diag_msg): New functions. 15506 (main): Use them. 15507 15508 netlink: add a basic socket diag parser of AF_PACKET messages. 15509 * linux/packet_diag.h: New file. 15510 * Makefile.am (EXTRA_DIST): Add it. 15511 * defs.h (ethernet_protocols): New xlat prototype. 15512 * netlink_sock_diag.c: Include <linux/packet_diag.h> 15513 and "xlat/packet_diag_show.h". 15514 (decode_packet_diag_req, decode_packet_diag_msg): New functions. 15515 (diag_decoders): Add AF_PACKET. 15516 * xlat/packet_diag_show.in: New file. 15517 15518 tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages. 15519 * tests/netlink_sock_diag.c: Include <linux/netlink_diag.h>. 15520 (test_netlink_diag_req, test_netlink_diag_msg): New functions. 15521 (main): Use them. 15522 15523 netlink: add a basic socket diag parser of AF_NETLINK messages. 15524 * linux/netlink_diag.h (NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG): 15525 New macros. 15526 * netlink_sock_diag.c: Include <linux/netlink_diag.h>, 15527 "xlat/netlink_diag_show.h" and "xlat/netlink_states.h". 15528 (decode_netlink_diag_req, decode_netlink_diag_msg): New functions. 15529 (diag_decoders): Add AF_NETLINK. 15530 * xlat/netlink_diag_show.in: New file. 15531 * xlat/netlink_states.in: Likewise. 15532 15533 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 15534 Fabien Siron <fabien.siron (a] epita.fr> 15535 JingPiao Chen <chenjingpiao (a] gmail.com> 15536 15537 tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages. 15538 * tests/netlink_sock_diag.c: Include <netinet/tcp.h> 15539 and <linux/unix_diag.h>. 15540 (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, 15541 test_unix_diag_msg): New functions. 15542 (main): Use them. 15543 15544 netlink: add a basic socket diag parser of AF_UNIX messages. 15545 * defs.h (socktypes): New xlat prototype. 15546 * linux/unix_diag.h (UDIAG_SHOW_VFS, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN, 15547 UDIAG_SHOW_MEMINFO): New macros. 15548 * netlink_sock_diag.c: Include <sys/socket.h>, <linux/netlink.h>, 15549 <linux/unix_diag.h>, "xlat/tcp_states.h", "xlat/tcp_state_flags.h", 15550 and "xlat/unix_diag_show.h". 15551 (decode_unix_diag_req, decode_unix_diag_msg): New functions. 15552 (netlink_diag_decoder_t): New typedef. 15553 (diag_decoders): New array. 15554 (decode_netlink_sock_diag): Use it. 15555 * xlat/tcp_state_flags.in: New file. 15556 * xlat/tcp_states.in: Likewise. 15557 * xlat/unix_diag_show.in: Likewise. 15558 15559 netlink: introduce family specific payload decoders. 15560 * defs.h (netlink_decoder_t): New typedef. 15561 (DECL_NETLINK): New macro. 15562 (decode_netlink_sock_diag): New prototype. 15563 * netlink.c (netlink_decoders): New array. 15564 (decode_payload): Use it to invoke netlink family specific decoders. 15565 * netlink_sock_diag.c: New file. 15566 * Makefile.am (strace_SOURCES): Add it. 15567 15568 2017-06-15 Dmitry V. Levin <ldv (a] altlinux.org> 15569 15570 Update SCM_* constants. 15571 * xlat/scmvals.in: Add SCM_TIMESTAMP, SCM_TIMESTAMPNS, SCM_TIMESTAMPING, 15572 SCM_WIFI_STATUS, and SCM_TIMESTAMPING_OPT_STATS. 15573 15574 2017-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 15575 15576 netlink: refactor decode_nlmsg_type. 15577 * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_netfilter): 15578 New functions. 15579 (nlmsg_types_decoder_t): New typedef. 15580 (nlmsg_types): Add decoder field. 15581 (decode_nlmsg_type): Use it. 15582 15583 2017-06-14 JingPiao Chen <chenjingpiao (a] gmail.com> 15584 15585 tests: extend printstr test. 15586 * tests/printstr.c (main): Add a case for short read. 15587 15588 2017-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 15589 15590 v4l2: fix preprocessor checks. 15591 Fix checks for struct v4l2_window.global_alpha and struct 15592 v4l2_sdr_format.buffersize. 15593 15594 * v4l2.c (print_v4l2_format_fmt): Do not assume that 15595 HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA and 15596 HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE are defined. 15597 * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise. 15598 15599 2017-06-12 Dmitry V. Levin <ldv (a] altlinux.org> 15600 15601 Move xlat related functions to a separate file. 15602 * util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals, 15603 printxval_searchn, addflags, sprintflags, printflags_ex): Move ... 15604 * xlat.c: ... to this new file. 15605 * Makefile.am (strace_SOURCES): Add it. 15606 15607 2017-06-12 Masatake YAMATO <yamato (a] redhat.com> 15608 15609 socketeutils: extend receive_responses further. 15610 This is the second patch in series of implementing NETLINK_GENERIC 15611 protocol decoder. 15612 15613 This change allows passing of opaque user data to the callback function. 15614 15615 * socketutils.c (receive_responses): Change the type of proto_name 15616 argument from "const char *" to "void *" to allow passing 15617 of arbitrary data to the callback function. 15618 Rename proto_name to opaque_data, make it the last argument. 15619 Pass it to the callback function as the last argument. 15620 (inet_parse_response, unix_parse_response, netlink_parse_response): 15621 Change the type of proto_name argument from "const char *" to "void *", 15622 rename it to opaque_data, make it the last argument. 15623 Introduce a local variable proto_name to convert the type 15624 of opaque_data argument from "void *" to "const char *". 15625 (unix_get, inet_get, netlink_get): Cast the protocol name from 15626 "const char *" to "void *" for passing to the callback function. 15627 15628 2017-06-12 Masatake YAMATO <yamato (a] redhat.com> 15629 15630 socketeutils: extend receive_responses to handle other netlink types. 15631 This is the first patch in series of implementing NETLINK_GENERIC 15632 protocol decoder. 15633 15634 receive_responses was written for decoding kernel responses of type 15635 SOCK_DIAG_BY_FAMILY, other types were ignored. 15636 15637 This change makes the type of netlink response a parameter 15638 so the function can be used for other types of communication. 15639 15640 * socketutils.c (receive_responses): add a new parameter 15641 expected_msg_type to handle types other than SOCK_DIAG_BY_FAMILY. 15642 15643 2017-06-12 JingPiao Chen <chenjingpiao (a] gmail.com> 15644 15645 tests: fix typo. 15646 * tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&. 15647 15648 2017-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 15649 15650 Introduce printflags_ex function. 15651 Add printflags_ex extension over printflags64 that, similar 15652 to printxvals, takes a NULL-terminated sequence of xlat pointers. 15653 15654 * defs.h (printflags_ex): New prototype. 15655 (printflags64): Turn into a thin wrapper around printflags_ex. 15656 * netlink.c (decode_nlmsg_flags): Use printflags_ex. 15657 * util.c (printflags_ex): New function. 15658 (printflags64): Remove. 15659 * xlat/netlink_get_flags.in: Remove entries listed 15660 in xlat/netlink_flags.in file. 15661 * xlat/netlink_new_flags.in: Likewise. 15662 15663 2017-06-08 JingPiao Chen <chenjingpiao (a] gmail.com> 15664 15665 tests: add check for decoding netlink get and new flags. 15666 * tests/netlink_route.c (test_nlmsg_flags): New function, checks 15667 decoding of NETLINK_ROUTE get and new flags. 15668 (main): Use it. 15669 * tests/netlink_sock_diag.c (test_nlmsg_flags): New function, checks 15670 decoding of NETLINK_SOCK_DIAG get flags. 15671 (main): Use it. 15672 * tests/netlink_xfrm.c: (test_nlmsg_flags): New function, checks 15673 decoding of NETLINK_XFRM get and new flags. 15674 (main): Use it. 15675 15676 2017-06-08 JingPiao Chen <chenjingpiao (a] gmail.com> 15677 Fabien Siron <fabien.siron (a] epita.fr> 15678 Dmitry V. Levin <ldv (a] altlinux.org> 15679 15680 netlink: implement generic nlmsg_flags decoding. 15681 * netlink.c: Include "xlat/netlink_get_flags.h" 15682 and "xlat/netlink_new_flags.h". 15683 (decode_nlmsg_flags): New function. 15684 (print_nlmsghdr): Use it. 15685 * xlat/netlink_get_flags.in: New file. 15686 * xlat/netlink_new_flags.in: Likewise. 15687 15688 2017-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 15689 15690 xlat: provide fallback definitions for XFRM_MSG_* constants. 15691 Some of XFRM_MSG_* constants were introduced later than the header file 15692 where they are defined. 15693 15694 * xlat/nl_xfrm_types.in: Add default values for constants. 15695 15696 2017-06-05 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 15697 15698 syscall.c: split trace_syscall() into 6 functions. 15699 This change removes the trace_syscall function. Now, the code that uses 15700 syscall.c trace functions is expected to check whether it is a syscall 15701 entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make 15702 an appropriate sequence of function calls. 15703 15704 * defs.h: Update comment on TCB_INSYSCALL. 15705 (trace_syscall): Remove prototype. 15706 (syscall_entering_decode, syscall_entering_trace, 15707 syscall_entering_finish, syscall_exiting_decode, syscall_exiting_trace, 15708 syscall_exiting_finish): New prototypes. 15709 * strace.c (trace_syscall): New static replacement for old trace_syscall. 15710 * syscall.c (trace_syscall): Remove. 15711 (trace_syscall_entering): Split into ... 15712 (syscall_entering_decode, syscall_entering_trace, 15713 syscall_entering_finish): ... new functions. 15714 (trace_syscall_exiting): Split into ... 15715 (syscall_exiting_decode, syscall_exiting_trace, 15716 syscall_exiting_finish): ... new functions. 15717 15718 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15719 15720 tests: guard against missing linux/netfilter/nfnetlink.h. 15721 nfnetlink was introduced in linux by commit v2.6.14-rc1~1035^2~217, 15722 add a guard for the case when system headers are not fresh enough. 15723 15724 * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nfnetlink.h. 15725 * tests/netlink_netfilter.c: Check for HAVE_LINUX_NETFILTER_NFNETLINK_H. 15726 15727 2017-06-05 JingPiao Chen <chenjingpiao (a] gmail.com> 15728 15729 tests: check decoding of NETLINK_XFRM message types. 15730 * tests/netlink_xfrm.c: New file. 15731 * tests/gen_tests.in (netlink_xfrm): New entry. 15732 * tests/pure_executables.list: Add netlink_xfrm. 15733 * tests/.gitignore: Likewise. 15734 15735 tests: check decoding of NETLINK_SELINUX message types. 15736 * tests/netlink_selinux.c: New file. 15737 * tests/gen_tests.in (netlink_selinux): New entry. 15738 * tests/pure_executables.list: Add netlink_selinux. 15739 * tests/.gitignore: Likewise. 15740 15741 tests: check decoding of NETLINK_NETFILTER message types. 15742 * tests/netlink_netfilter.c: New file. 15743 * tests/gen_tests.in (netlink_netfilter): New entry. 15744 * tests/pure_executables.list: Add netlink_netfilter. 15745 * tests/.gitignore: Likewise. 15746 15747 tests: check decoding of NETLINK_AUDIT message types. 15748 * tests/netlink_audit.c: New file. 15749 * tests/gen_tests.in (netlink_audit): New entry. 15750 * tests/pure_executables.list: Add netlink_audit. 15751 * tests/.gitignore: Likewise. 15752 15753 tests: check decoding of NETLINK_ROUTE message types. 15754 * tests/netlink_route.c: New file. 15755 * tests/gen_tests.in (netlink_route): New entry. 15756 * tests/pure_executables.list: Add netlink_route. 15757 * tests/.gitignore: Likewise. 15758 15759 tests: check decoding of NETLINK_SOCK_DIAG message types. 15760 * tests/netlink_sock_diag.c: New file. 15761 * tests/netlink_sock_diag.test: New test. 15762 * tests/pure_executables.list: Add netlink_sock_diag. 15763 * tests/.gitignore: Likewise. 15764 * tests/Makefile.am (DECODER_TESTS): Add netlink_sock_diag.test. 15765 15766 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15767 15768 tests: use create_nl_socket in netlink_protocol.test. 15769 * tests/netlink_protocol.c (main): Use create_nl_socket. 15770 15771 tests: change netlink_protocol.test to trace sendto syscalls only. 15772 * tests/gen_tests.in (netlink_protocol): Replace %network with sendto. 15773 * tests/netlink_protocol.c (main): Update expected output. 15774 15775 tests: enhance create_nl_socket diagnostics messages. 15776 * tests/tests.h (create_nl_socket): Rename to create_nl_socket_ext, 15777 add a string argument. 15778 (create_nl_socket): New macro wrapper around create_nl_socket_ext. 15779 * tests/create_nl_socket.c (create_nl_socket): Rename 15780 to create_nl_socket_ext, add a string argument, include it 15781 in diagnostic messages. 15782 15783 tests: use const and designated initializers in create_nl_socket.c. 15784 * tests/create_nl_socket.c: Stop including <string.h>. 15785 (create_nl_socket): Use const and designated initializers. 15786 15787 2017-06-05 JingPiao Chen <chenjingpiao (a] gmail.com> 15788 15789 tests: add create_nl_socket function to libtests. 15790 * tests/create_nl_socket.c: New file. 15791 * tests/tests.h (create_nl_socket): New prototype. 15792 * tests/Makefile.am (libtests_a_SOURCES): Add create_nl_socket.c. 15793 15794 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15795 Fabien Siron <fabien.siron (a] epita.fr> 15796 15797 netlink: add decoding of NETLINK_NETFILTER message types. 15798 * xlat/nl_netfilter_msg_types.in: New file. 15799 * xlat/nl_netfilter_subsys_ids.in: Likewise. 15800 * netlink.c: Include "xlat/nl_netfilter_msg_types.h" 15801 and "xlat/nl_netfilter_subsys_ids.h". 15802 (nlmsg_types): Add NETLINK_NETFILTER. 15803 (decode_nlmsg_type): Handle NETLINK_NETFILTER. 15804 15805 netlink: add decoding of NETLINK_XFRM message types. 15806 * xlat/nl_xfrm_types.in: New file. 15807 * netlink.c: Include "xlat/nl_xfrm_types.h". 15808 (nlmsg_types): Add NETLINK_XFRM. 15809 15810 netlink: add decoding of NETLINK_SELINUX message types. 15811 * xlat/nl_selinux_types.in: New file. 15812 * netlink.c: Include "xlat/nl_selinux_types.h". 15813 (nlmsg_types): Add NETLINK_SELINUX. 15814 15815 netlink: add decoding of NETLINK_ROUTE message types. 15816 * xlat/nl_route_types.in: New file. 15817 * netlink.c: Include <linux/rtnetlink.h> and "xlat/nl_route_types.h". 15818 (nlmsg_types): Add NETLINK_ROUTE. 15819 15820 netlink: add decoding of NETLINK_AUDIT message types. 15821 * xlat/nl_audit_types.in: New file. 15822 * netlink.c: Include <linux/audit.h> and "xlat/nl_audit_types.h". 15823 (nlmsg_types): Add NETLINK_AUDIT. 15824 15825 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15826 Fabien Siron <fabien.siron (a] epita.fr> 15827 15828 netlink: implement generic nlmsg_type decoding. 15829 Implement a pluggable mechanism of nlmsg_type decoding. 15830 Add decoding of NETLINK_SOCK_DIAG types. 15831 15832 * linux/sock_diag.h (SOCK_DESTROY): New macro. 15833 * xlat/nl_sock_diag_types.in: New file. 15834 * netlink.c: Include xlat/nl_sock_diag_types.h. 15835 (get_fd_nl_family, decode_nlmsg_type): New functions. 15836 (print_nlmsghdr): Use them for nlmsg_type decoding. 15837 15838 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15839 15840 netlink: add netlink family argument to printers and decoders. 15841 * netlink.c (NL_FAMILY_ERROR, NL_FAMILY_DEFAULT): New constants. 15842 (print_nlmsghdr): Add netlink family argument, change return type 15843 to int, return family. 15844 (decode_nlmsghdr_with_payload, decode_nlmsgerr, decode_payload): Add 15845 netlink family argument. All callers updated. 15846 15847 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 15848 Dmitry V. Levin <ldv (a] altlinux.org> 15849 15850 Add file descriptor argument to decode_netlink. 15851 * defs.h (decode_netlink): Add file descriptor argument. 15852 * io.c (print_iovec): Specify file descriptor to decode_netlink. 15853 * net.c (decode_sockbuf): Likewise. 15854 * netlink.c (print_nlmsghdr, decode_nlmsghdr_with_payload, 15855 decode_nlmsgerr, decode_payload, decode_nlmsghdr_with_payload, 15856 decode_netlink): Likewise. 15857 All callers updated. 15858 15859 Introduce getfdinode to obtain inode from fd. 15860 * defs.h (getfdinode): New prototype. 15861 * utils.c (getfdinode): New function. 15862 15863 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 15864 Dmitry V. Levin <ldv (a] altlinux.org> 15865 15866 Introduce get_sockaddr_by_inode. 15867 Add a way to get socket information without printing it. 15868 15869 * defs.h (get_sockaddr_by_inode): New prototype. 15870 * socketutils.c (get_sockaddr_by_inode): New function. 15871 15872 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15873 15874 socketutils.c: introduce get_sockaddr_by_inode_uncached. 15875 * socketutils.c (get_sockaddr_by_inode_uncached): New function. 15876 (print_sockaddr_by_inode_uncached): Use it. 15877 15878 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 15879 Dmitry V. Levin <ldv (a] altlinux.org> 15880 15881 socketutils.c: use get_sockaddr_by_inode_cached. 15882 * socketutils.c (unix_print, inet_print, tcp_v4_print, tcp_v6_print, 15883 udp_v4_print, udp_v6_print, netlink_print): Remove. 15884 (unix_get, inet_get, tcp_v4_get, tcp_v6_get, udp_v4_get, 15885 udp_v6_get, netlink_get): New functions. 15886 (protocols): Update. 15887 15888 2017-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 15889 15890 socketutils.c: move inet_print closer to its first use. 15891 * socketutils.c (inet_print): Move right before tcp_v4_print. 15892 15893 2017-06-05 Fabien Siron <fabien.siron (a] epita.fr> 15894 Dmitry V. Levin <ldv (a] altlinux.org> 15895 15896 socketutils.c: introduce cache_inode_details. 15897 cache_inode_details gives a way to obtain cache information without 15898 printing it. 15899 15900 * socketutils.c (cache_and_print_inode_details): Rename 15901 to cache_inode_details. Do not print cached information. 15902 (inet_parse_response, unix_parse_response, netlink_parse_response): 15903 Use cache_inode_details instead of cache_and_print_inode_details. 15904 (inet_print, unix_print, netlink_print): Call 15905 print_sockaddr_by_inode_cached. 15906 15907 2017-06-05 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 15908 15909 strace.c: move termination code to a separate function. 15910 This will be needed for the pull-style API. 15911 15912 * strace.c (terminate): New function. 15913 (main): Use it. 15914 15915 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 15916 15917 tests: avoid hitting SO_SNDBUF limit in sendfile/sendfile64 tests. 15918 Do not assume that an executable is small enough and SO_SNDBUF is large 15919 enough so that the executable could be sendfile'ed into a socket pair. 15920 15921 * tests/sendfile.c (main): Create a regular file of the right size 15922 to avoid hitting SO_SNDBUF limit. 15923 * tests/sendfile64.c: Likewise. 15924 15925 Reported-by: Andreas Schwab <schwab (a] linux-m68k.org> 15926 15927 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 15928 15929 Move netlink_protocols definition from net.c to netlink.c. 15930 The side effect of #include "xlat/netlink_protocols.h" is 15931 NETLINK_* constants properly defined in that header file. 15932 While net.c does not use these constants itself, netlink.c 15933 is going to need them soon. 15934 15935 * net.c: Move inclusion of "xlat/netlink_protocols.h" ... 15936 * netlink.c: ... here. 15937 15938 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 15939 15940 travis: switch from gcc-6 to gcc-7. 15941 * .travis.yml (matrix): Change gcc-6 to gcc-7. 15942 15943 tests: extend checking of NLMSG_DONE decoding. 15944 * tests/netlink_protocol.c (test_nlmsg_done): Use designated 15945 initializers. Check decoding of messages with non-integer payload. 15946 15947 2017-06-04 JingPiao Chen <chenjingpiao (a] gmail.com> 15948 15949 netlink: decode NLMSG_DONE messages. 15950 * netlink.c (decode_payload): Decode NLMSG_DONE messages. 15951 * tests/netlink_protocol.c (test_nlmsg_done): New function 15952 for checking decoding of NLMSG_DONE messages. 15953 (main): Use it. 15954 15955 2017-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 15956 15957 socketutils.c: introduce get_sockaddr_by_inode_cached. 15958 * socketutils.c (get_sockaddr_by_inode_cached): New function. 15959 (print_sockaddr_by_inode_cached): Use it. 15960 15961 2017-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 15962 15963 Unexport print_sockaddr_by_inode_cached. 15964 Change print_sockaddr_by_inode to be the only function exposed, 15965 hide print_sockaddr_by_inode_cached as a part of implementation. 15966 15967 * defs.h (print_sockaddr_by_inode_cached): Remove prototype. 15968 (print_sockaddr_by_inode): Add struct tcb * and descriptor arguments. 15969 * socketutils.c (print_sockaddr_by_inode_cached): Make static. 15970 (print_sockaddr_by_inode): Rename to print_sockaddr_by_inode_uncached, 15971 make static. 15972 (print_sockaddr_by_inode): New function. 15973 * util.c (printfd): Update to use new print_sockaddr_by_inode. 15974 15975 2017-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 15976 15977 Introduce str_strip_prefix_len function and STR_STRIP_PREFIX macro. 15978 Address proliferation of string prefix check implementations. 15979 15980 * defs.h (str_strip_prefix_len): New inline function. 15981 (STR_STRIP_PREFIX): New macro. 15982 * qualify.c (strip_prefix): Remove. 15983 (parse_inject_token): Use STR_STRIP_PREFIX instead of strip_prefix. 15984 (qualify): Use str_strip_prefix_len. 15985 * socketutils.c (netlink_parse_response): Likewise. 15986 * util.c (printfd): Likewise. 15987 15988 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 15989 15990 netlink: move NLMSG_ERROR payload length check to nlmsgerr decoder. 15991 Move decoder specific check to the decoder. 15992 15993 * netlink.c (decode_payload): Move NLMSG_ERROR payload length check ... 15994 (decode_nlmsgerr): ... here. 15995 15996 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 15997 15998 strace.c: handle PTRACE_EVENT_EXEC like other events. 15999 There is nothing unusual about PTRACE_EVENT_EXEC that would require 16000 a special treatment. 16001 16002 * strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main 16003 switch statement. 16004 16005 2017-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 16006 16007 strace.c: remove dead code. 16008 As strace does not use WCONTINUED flag, there is no need to handle 16009 WIFCONTINUED status. 16010 16011 * strace.c (print_debug_info) [WIFCONTINUED]: Remove. 16012 (next_event): Remove redundant !WIFSTOPPED check. 16013 16014 2017-06-02 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 16015 16016 strace.c: refactor trace into two functions. 16017 This change decouples waiting for next event from reacting to it. This 16018 makes the control flow easier to understand, and serves as a preparation 16019 for implementing a pull-style API for LuaJIT. 16020 16021 * strace.c (enum trace_event): New enum. 16022 (trace): Split into ... 16023 (next_event, dispatch_event): ... new functions. 16024 (main): Use them. 16025 16026 2017-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 16027 16028 scno.am: include config.h before syscallent.h. 16029 This fixes generation of syscallent.i and subsequent scno.h files 16030 on mips where syscallent.h checks macros defined in config.h. 16031 16032 * scno.am (syscallent.i): Add $(top_builddir)/config.h 16033 to prerequisites, include it. 16034 * NEWS: Mention this fix. 16035 16036 Reported-by: David Robins <dbrobins (a] i4031.net> 16037 16038 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16039 16040 tests: check decoding of sigaction syscall. 16041 * tests/sigaction.c: New file. 16042 * tests/gen_tests.in (sigaction): New entry. 16043 * tests/pure_executables.list: Add sigaction. 16044 * tests/.gitignore: Likewise. 16045 16046 tests: rename sigaction.test to rt_sigaction.test. 16047 * tests/sigaction.awk: Rename to rt_sigaction.awk. 16048 * tests/sigaction.c: Rename to tests/rt_sigaction.c. 16049 * tests/sigaction.test: Rename to tests/rt_sigaction.test. 16050 * tests/.gitignore: Replace sigaction with rt_sigaction. 16051 * tests/pure_executables.list: Likewise. 16052 * tests/Makefile.am (DECODER_TESTS): Replace sigaction.test 16053 with rt_sigaction.test. 16054 (EXTRA_DIST): Replace sigaction.awk with rt_sigaction.awk. 16055 16056 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16057 16058 sparc: enhance decoding of signal number argument of sigaction syscall. 16059 On sparc, unlike all other architectures, old sigaction syscall takes 16060 a negated signal number. 16061 16062 * signal.c (SYS_FUNC(sigaction)) [SPARC || SPARC64]: Enhance printing 16063 of negative signal number argument. 16064 16065 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16066 16067 signal: enhance printing of old_sigaction.mask. 16068 * signal.c (decode_old_sigaction): Print old_sigaction.mask 16069 using tprint_old_sigmask_val. 16070 16071 signal: limit scope of struct old_sigaction32 definition. 16072 * signal.c (struct old_sigaction32): Define only if [!current_wordsize]. 16073 16074 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16075 16076 signal: fix decoding of struct old_sigaction on some architectures. 16077 On alpha, struct old_sigaction.sa_flags has a 32-bit type. 16078 16079 On mips, only first word of old_sigaction.sa_mask is read. 16080 16081 On all architectures except alpha and mips that have old sigaction 16082 syscall, struct old_sigaction has sa_restorer field that has to be 16083 decoded. 16084 16085 * signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type 16086 to unsigned int, add ATTRIBUTE_PACKED. 16087 [MIPS]: Dhrink sa_mask array to 1 element. 16088 [!ALPHA && !MIPS]: Define sa_restorer field unconditionally. 16089 (struct old_sigaction32): Likewise. 16090 (decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field 16091 from old_sigaction32.sa_restorer unconditionally. 16092 [!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag 16093 is set. 16094 * NEWS: Mention this change. 16095 16096 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16097 16098 xlat: rename SA_STACK to SA_ONSTACK. 16099 SA_ONSTACK is the standard name while its alias SA_STACK is not even 16100 defined on many platforms. 16101 16102 * xlat/sigact_flags.in (SA_STACK): Rename to SA_ONSTACK. 16103 16104 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16105 16106 tests: check decoding of sigpending syscall. 16107 * tests/sigpending.c: New file. 16108 * tests/gen_tests.in (sigpending): New entry. 16109 * tests/pure_executables.list: Add sigpending. 16110 * tests/.gitignore: Likewise. 16111 16112 tests: check decoding of sigprocmask syscall. 16113 * tests/sigprocmask.c: New file. 16114 * tests/gen_tests.in (sigprocmask): New entry. 16115 * tests/pure_executables.list: Add sigprocmask. 16116 * tests/.gitignore: Likewise. 16117 16118 2017-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 16119 16120 alpha: rename sys_sigprocmask to sys_osf_sigprocmask. 16121 Parsers of sigprocmask and osf_sigprocmask syscalls are different 16122 anyway, so rename the function to match the syscall name. 16123 16124 * signal.c [ALPHA] (SYS_FUNC(sigprocmask)): Rename 16125 to SYS_FUNC(osf_sigprocmask). 16126 * linux/alpha/syscallent.h: Update sys_func. 16127 16128 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16129 16130 Enable coverage when strace is self terminated by signal. 16131 The data collected by -fprofile-arcs during program run is saved 16132 on program exit. When program is terminated by signal, the data 16133 is not saved. However, libgcov provides an interface to dump 16134 the data at runtime. 16135 16136 * m4/ax_code_coverage.m4 (AX_CODE_COVERAGE): Add -DENABLE_COVERAGE_GCOV 16137 to CODE_COVERAGE_CPPFLAGS. 16138 * strace.c [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype. 16139 (main) [ENABLE_COVERAGE_GCOV]: Call __gcov_flush() before raise() 16140 and sigprocmask() calls that might cause program termination. 16141 16142 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16143 16144 tests: check termination signal forwarding. 16145 * tests/run_expect_termsig.c: New file. 16146 * tests/unblock_reset_raise.c: Likewise. 16147 * tests/termsig.test: New test. 16148 * tests/.gitignore: Add run_expect_termsig and unblock_reset_raise. 16149 * tests/Makefile.am (check_PROGRAMS): Likewise. 16150 (MISC_TESTS): Add termsig.test. 16151 16152 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16153 16154 Fix termination signal forwarding. 16155 When traced command is terminated by a blocked signal, unblock 16156 that signal to ensure strace termination with the same signal. 16157 16158 * strace.c (main): Unblock the signal raised for strace termination. 16159 * NEWS: Mention this change. 16160 16161 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16162 16163 Do not reset SIGCHLD handler in tracees to SIG_DFL. 16164 While strace resets SIGCHLD handler to the default action so that 16165 waitpid definitely works without losing track of children, tracees 16166 should not inherit this change. 16167 16168 * strace.c (struct exec_params): Add child_sa field. 16169 (init): When setting SIGCHLD handler to SIG_DFL, save the old handler. 16170 (exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL 16171 at startup. 16172 * NEWS: Mention this change. 16173 16174 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16175 16176 Refactor setting of signal handlers to reduce redundancy. 16177 * strace.c (set_sigaction): New function. 16178 (init): Use it instead of sigaction with sigaddset. 16179 16180 tests: check how signals are unblocked in interactive mode. 16181 * tests/block_reset_raise_run.c: New file. 16182 * tests/interactive_block.test: New test. 16183 * tests/.gitignore: Add block_reset_raise_run. 16184 * tests/Makefile.am (check_PROGRAMS): Likewise. 16185 (MISC_TESTS): Add interactive_block.test. 16186 16187 2017-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 16188 16189 Fix unblocking of signals in interactive mode. 16190 In interactive mode (-I2), those signals that were blocked at startup 16191 will remain blocked for the whole period of strace execution. 16192 16193 * strace.c (empty_set): Rename to start_set. All users changed. 16194 (init): Initialize start_set and blocked_set to the set of currently 16195 blocked signals. 16196 (startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK. 16197 * NEWS: Mention this change. 16198 16199 2017-05-26 Dmitry V. Levin <ldv (a] altlinux.org> 16200 16201 Cleanup interactive check. 16202 * strace.c (init): Check for INTR_WHILE_WAIT mode the same way 16203 as in other places. 16204 16205 tests: check decoding of signal syscall. 16206 * tests/signal.c: New file. 16207 * tests/gen_tests.in (signal): New entry. 16208 * tests/pure_executables.list: Add signal. 16209 * tests/.gitignore: Likewise. 16210 16211 2017-05-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16212 16213 Unify capitalisation of (c) in copyright notices. 16214 16215 2017-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 16216 16217 Post-release administrivia. 16218 * NEWS: Add a header line for the next release. 16219 * debian/changelog.in: Add a changelog entry for 4.17-1. 16220 * strace.spec.in: Likewise. 16221 16222 2017-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 16223 16224 Prepare for 4.17 release. 16225 * NEWS: Update for 4.17 release. 16226 16227 powerpc64, sparc, sparc64: wire up statx syscall. 16228 * linux/powerpc64/syscallent.h [383]: Add statx entry. 16229 * linux/sparc/syscallent.h [360]: Likewise. 16230 * linux/sparc64/syscallent.h [360]: Likewise. 16231 16232 2017-05-23 Dmitry V. Levin <ldv (a] altlinux.org> 16233 16234 Fix compat personality support for sgetmask syscall. 16235 * signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val 16236 with sprint_old_sigmask_val. 16237 * tests/sxetmask.c (main): Check decoding of signal mask containing 16238 RT signals. 16239 16240 2017-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 16241 16242 Fix decoding of sgetmask and ssetmask syscalls. 16243 Old ssetmask syscall takes an argument and returns a value of type int. 16244 Old sgetmask syscall may return an error. 16245 16246 * signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument 16247 and return value to unsigned int, print it using sprint_old_sigmask_val. 16248 (SYS_FUNC(sgetmask)): Do not print the mask in case of syserror. 16249 * tests/sxetmask.c: New file. 16250 * tests/gen_tests.in (sxetmask): New entry. 16251 * tests/pure_executables.list: Add sxetmask. 16252 * tests/.gitignore: Likewise. 16253 * NEWS: Mention this fix. 16254 16255 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16256 16257 Add copyright headers. 16258 16259 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16260 Elvira Khabirova <lineprinter0 (a] gmail.com> 16261 16262 Add scripts for automating copyright notices update. 16263 * maint/update_copyright_years.awk: New file. 16264 * maint/update_copyright_years.sh: Likewise. 16265 16266 2017-05-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16267 16268 Fix typos in copyright notices. 16269 16270 unwind.c: remove non-ASCII character from comment. 16271 16272 2017-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 16273 16274 Rename sys_sig[gs]etmask to sys_s[gs]etmask to match syscall names. 16275 * signal.c (SYS_FUNC(sigsetmask)): Rename to SYS_FUNC(ssetmask). 16276 (SYS_FUNC(siggetmask)): Rename to SYS_FUNC(sgetmask). 16277 * linux/arm/syscallent.h (sgetmask, ssetmask): Update sys_func. 16278 * linux/bfin/syscallent.h: Likewise. 16279 * linux/crisv10/syscallent.h: Likewise. 16280 * linux/hppa/syscallent.h: Likewise. 16281 * linux/i386/syscallent.h: Likewise. 16282 * linux/m68k/syscallent.h: Likewise. 16283 * linux/microblaze/syscallent.h: Likewise. 16284 * linux/mips/syscallent-o32.h: Likewise. 16285 * linux/powerpc/syscallent.h: Likewise. 16286 * linux/powerpc64/syscallent.h: Likewise. 16287 * linux/sh/syscallent.h: Likewise. 16288 * linux/sh64/syscallent.h: Likewise. 16289 * linux/sparc/syscallent.h: Likewise. 16290 * linux/sparc64/syscallent.h: Likewise. 16291 16292 tests: enhance sigsuspend.test. 16293 * tests/sigsuspend.c (sigtxt): New variable. 16294 (main): Change signal masks to contain all signals except USR1 and USR2. 16295 16296 2017-05-20 Dmitry V. Levin <ldv (a] altlinux.org> 16297 16298 Fix compat personality support for old sigsuspend syscall. 16299 * signal.c (sprint_old_sigmask_val): New function. 16300 (tprint_old_sigmask_val): New macro. 16301 (SYS_FUNC(sigsuspend)): Use it. 16302 16303 2017-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 16304 16305 Move errnoent.sh, signalent.sh, and syscallent.sh to maint subdirectory. 16306 Also do not include them into release tarballs. These files are 16307 intended for developers who are expected to use a git repository. 16308 16309 * errnoent.sh: Move to maint subdirectory. 16310 * signalent.sh: Likewise. 16311 * syscallent.sh: Likewise. 16312 * HACKING-scripts: Update. 16313 * Makefile.am (EXTRA_DIST): Remove errnoent.sh, signalent.sh, 16314 and syscallent.sh. 16315 16316 2017-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 16317 16318 Do not include maint subdirectory into release tarballs. 16319 These files are intended for developers who are expected to use 16320 a git repository. 16321 16322 * Makefile.am (EXTRA_DIST): Remove maint/ioctls_gen.sh, 16323 maint/ioctls_hex.sh, maint/ioctls_sym.sh, and maint/print_ioctlent.c. 16324 16325 2017-05-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16326 16327 linux/ia64/syscallent.h: remove tabulation, add spaces in file comment. 16328 16329 linux/mtd-abi.h: remove non-ASCII character from file comment. 16330 16331 2017-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 16332 16333 alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall. 16334 On some architectures old sigsuspend syscall takes the signal mask from 16335 the 3rd argument, on some from the 1st. And, if it wasn't peculiar 16336 enough, the signal mask is passed by value on all architectures except 16337 mips where it's passed by reference. 16338 16339 * signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last 16340 argument. 16341 * linux/alpha/syscallent.h (sigsuspend): Set nargs to 1. 16342 * linux/crisv10/syscallent.h: Likewise. 16343 * linux/mips/syscallent-o32.h: Likewise. 16344 * linux/powerpc/syscallent.h: Likewise. 16345 * linux/powerpc64/syscallent.h: Likewise. 16346 * linux/sh/syscallent.h: Likewise. 16347 * linux/sh64/syscallent.h: Likewise. 16348 * linux/sparc/syscallent.h: Likewise. 16349 * linux/sparc64/syscallent.h: Likewise. 16350 * tests/sigsuspend.c: New file. 16351 * tests/gen_tests.in (sigsuspend): New entry. 16352 * tests/pure_executables.list: Add sigsuspend. 16353 * tests/.gitignore: Likewise. 16354 * NEWS: Mention this fix. 16355 16356 2017-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 16357 16358 tests: raise default timeout for individual tests. 16359 Recently added tests based on pure_executables.list are quite slow 16360 by their nature, the one minute default timeout is no longer enough 16361 for some of not so fast architectures. 16362 16363 * tests/init.sh (TIMEOUT_DURATION): Raise from 60 to 120. 16364 16365 2017-05-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16366 16367 Update NEWS. 16368 16369 2017-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 16370 16371 Update TCP_* constants. 16372 * xlat/socktcpoptions.in: Add TCP_FASTOPEN_CONNECT introduced 16373 by linux kernel commit v4.11-rc1~124^2~321^2. 16374 16375 2017-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 16376 16377 Update AF_* constants. 16378 * xlat/addrfams.in: Add AF_SMC introduced by linux kernel 16379 commit v4.11-rc1~94^2~43^2~13. 16380 16381 2017-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 16382 16383 tests: enhance madvise decoder check. 16384 * tests/mmap.c (main): Remove madvise check. 16385 * tests/madvise.c: New file. 16386 * tests/gen_tests.in (madvise): New entry. 16387 * tests/.gitignore: Add madvise. 16388 * tests/pure_executables.list: Likewise. 16389 16390 2017-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16391 16392 tests: add -etrace=?... test. 16393 Check for some architecture-specific syscalls which are not present 16394 on most architectures. 16395 16396 * gen_tests.in: Add trace_question test. 16397 * tests/trace_question.in: New file. 16398 * tests/Makefile.am (EXTRA_DIST): Add it. 16399 16400 2017-04-25 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16401 16402 tests: add more information to generated header comments. 16403 * tests/gen_tests.sh: Update header comment with the source string 16404 used for test generation. 16405 16406 tests: move generated common header comment into a variable. 16407 * tests/gen_tests.sh: Move generated file header comment 16408 into a variable, use it in all cases. 16409 16410 2017-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 16411 16412 tests: use TAIL_ALLOC_OBJECT_CONST_PTR in v4l2 test. 16413 * tests/ioctl_v4l2.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR. 16414 16415 2017-04-25 Edgar Kaziahmedov <edos (a] linux.com> 16416 16417 tests: Check decoding of VIDIOC_G/S_TUNER's arg. 16418 * tests/ioctl_v4l2.c (main): Add checks for VIDIOC_G/S_TUNER's arg. 16419 16420 v4l2: Add decoding for VIDIOC_G/S_TUNER's arg. 16421 * v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h", 16422 "xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h". 16423 (print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg. 16424 (v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg. 16425 * xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and 16426 V4L2_TUNER_ANALOG_TV introduced by linux kernel commit 16427 2.5.46~39^2~23^2~4. 16428 Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel 16429 commit v2.6.11-rc4~55^2~20. 16430 Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit 16431 v3.15-rc1~85^2~215. 16432 Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17 16433 (as the replacement of V4L2_TUNER_ADC). 16434 * xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW, 16435 V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2, 16436 V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel 16437 commit 2.5.46~39^2~23^2~4. 16438 Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP 16439 introduced by linux kernel commit v3.6-rc1~28^2~306. 16440 Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189. 16441 Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS 16442 introduced by linux kernel commit v2.6.37-rc1~64^2~110. 16443 Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit 16444 v3.6-rc1~28^2~46. 16445 Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit 16446 v3.6-rc1~28^2~40. 16447 Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit 16448 v3.15-rc1~85^2~214. 16449 * xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO, 16450 V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and 16451 V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit 16452 2.5.46~39^2~23^2~4. 16453 Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit 16454 v2.6.17-rc1~739^2~9. 16455 * xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO, 16456 V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and 16457 V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit 16458 2.5.46~39^2~23^2~4. 16459 Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit 16460 v2.6.32-rc1~679^2~189. 16461 16462 2017-04-24 Dmitry V. Levin <ldv (a] altlinux.org> 16463 16464 tests: check decoding of invalid tv_sec and tv_usec values. 16465 * tests/futimesat.c (main): Check decoding of invalid tv_sec and tv_usec 16466 values. 16467 * tests/xetitimer.c (main): Likewise. 16468 * tests/xettimeofday.c (main): Likewise. 16469 * tests/xselect.c (main): Likewise. 16470 * tests/xutimes.c (main): Likewise. 16471 16472 tests: check decoding of invalid tv_sec and tv_nsec values. 16473 * tests/aio.c (main): Check decoding of invalid tv_sec and tv_nsec 16474 values. 16475 * tests/clock_nanosleep.c (main): Likewise. 16476 * tests/clock_xettime.c (main): Likewise. 16477 * tests/futex.c (main): Likewise. 16478 * tests/nanosleep.c (main): Likewise. 16479 * tests/ppoll.c (main): Likewise. 16480 * tests/pselect6.c (main): Likewise. 16481 * tests/recvmmsg-timeout.c (main): Likewise. 16482 * tests/rt_sigtimedwait.c (main): Likewise. 16483 * tests/semop.c (main): Likewise. 16484 * tests/timer_xettime.c (main): Likewise. 16485 * tests/timerfd_xettime.c (main): Likewise. 16486 * tests/utimensat.c (main): Likewise. 16487 16488 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16489 16490 Print time in ISO 8601 format in time syscall decoder. 16491 * print_time.c (SYS_FUNC(time)): Print timestamp stringification 16492 (via sprinttime) for the value stored in the argument and return value 16493 (return RVAL_STR in the latter case). 16494 * tests/time.c (main): Update expected output. 16495 16496 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16497 Dmitry V. Levin <ldv (a] altlinux.org> 16498 16499 Print string representation of timestamps in parsers of *utime* syscalls 16500 * print_timespec.c (print_timespec_t_utime): Use sprinttime_nsec 16501 to format a string representation of time, use tprints_comment 16502 to print it as a comment. 16503 * print_timeval.c (print_timeval_t_utime): New function. 16504 (print_timeval_utimes): Use it instead of print_timeval_t. 16505 [ALPHA] (print_timeval32_t_utime): New function. 16506 [ALPHA] (print_timeval32_utimes): Use it instead of print_timeval32_t. 16507 * tests/futimesat.c (print_tv): Update expected output. 16508 * tests/utimensat.c (print_ts): Likewise. 16509 * tests/xutimes.c (print_tv): Likewise. 16510 16511 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16512 16513 tests: add support for printing timestamp with microsecond precision. 16514 It will be needed later. 16515 16516 * tests/tests.h (print_time_t_usec): New prototype. 16517 * tests/print_time.c (print_time_t_usec): New function, a thin wrapper 16518 around print_time_t_ex. 16519 16520 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16521 Dmitry V. Levin <ldv (a] altlinux.org> 16522 16523 Print microseconds/nanoseconds as non-negative. 16524 Negative micro/nanoseconds values are treated as invalid by kernel 16525 anyway, and in one case (timespec_valid in include/linux/time.h) 16526 it is even checked by conversion to unsigned long. 16527 16528 * print_timespec.c (timespec_fmt): Change tv_sec format to %lld and 16529 tv_nsec format to %llu. 16530 (print_timespec_t): Cast tv_sec to long long and process tv_nsec with 16531 zero_extend_signed_to_ull. 16532 (sprint_timespec): Likewise. 16533 * print_timeval.c (timeval_fmt): Change tv_sec format to %lld and 16534 tv_usec format to %llu. 16535 (print_timeval_t): Cast tv_sec to long long and process tv_nsec with 16536 zero_extend_signed_to_ull. 16537 (sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise. 16538 * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. 16539 * tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast 16540 it to long long; change tv_usec printing format to %llu, process it with 16541 zero_extend_signed_to_ull. 16542 * tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld, 16543 cast it to long long; change tv_nsec printing format to %llu, process it 16544 with zero_extend_signed_to_ull. 16545 * tests/clock_xettime.c (main): Likewise. 16546 * tests/futex.c (main): Likewise. 16547 * tests/futimesat.c (print_tv): Likewise. 16548 * tests/getrusage.c (invoke_print): Likewise. 16549 * tests/mq_sendrecv.c (do_send, do_recv, main): Likewise. 16550 * tests/nanosleep.c (main): Likewise. 16551 * tests/pselect6.c (main): Likewise. 16552 * tests/restart_syscall.c (main): Likewise. 16553 * tests/rt_sigtimedwait.c (iterate, main): Likewise. 16554 * tests/sched_rr_get_interval.c (main): Likewise. 16555 * tests/semop.c (main): Likewise. 16556 * tests/timer_xettime.c (main): Likewise. 16557 * tests/timerfd_xettime.c (main): Likewise. 16558 * tests/waitid.c (main): Likewise. 16559 * tests/xetitimer.c (main): Likewise. 16560 * tests/xettimeofday.c (main): Likewise. 16561 * tests/xselect.c (main): Likewise. 16562 * tests/xutimes.c (print_tv): Likewise. 16563 * tests/wait4.c (sprint_rusage): Likewise. 16564 * tests/waitid.c (sprint_rusage): Likewise. 16565 * tests/utimensat.c (print_ts): Likewise. 16566 (main): Add check for higher bits of tv_sec/tv_nsec. 16567 16568 2017-04-24 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16569 Dmitry V. Levin <ldv (a] altlinux.org> 16570 16571 Always print raw values of time data fields. 16572 Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec 16573 that handle nanoseconds and microseconds, respectively. 16574 Always print raw values of time data fields, format string 16575 representations of time as comments. 16576 16577 * defs.h (sprinttime): Change argument type from time_t to long long. 16578 (sprinttime_nsec, sprinttime_usec): New prototypes. 16579 * util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New 16580 functions. 16581 (sprinttime): Turn into a thin wrapper around sprinttime_ex. 16582 * stat.h (struct strace_stat): Add has_nsec field. 16583 * fetch_struct_stat.c (HAVE_NSEC): New macro. 16584 (fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC. 16585 * fetch_struct_stat64.c (HAVE_NSEC): New macro. 16586 (fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC. 16587 * print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>: 16588 Print raw values of time fields, use sprinttime_nsec to format a string 16589 representation of time, use tprints_comment to print it as a comment. 16590 * statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise. 16591 * utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime 16592 and struct utimbuf.modtime fields, use sprinttime to format a string 16593 representation of time, use tprints_comment to print it as a comment. 16594 * tests/tests.h (print_time_t_nsec): Add int argument. 16595 * tests/print_time.c (print_time_t_ex): New function. 16596 (print_time_t_nsec): Add int argument, turn into a thin wrapper around 16597 print_time_t_ex. 16598 * tests/utime.c (main): Update expected output. 16599 * tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro. 16600 [!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update 16601 expected output. 16602 * NEWS: Mention this timestamps representation improvement. 16603 16604 2017-04-24 Dmitry V. Levin <ldv (a] altlinux.org> 16605 16606 Introduce tprintf_comment and tprints_comment functions. 16607 * defs.h (tprintf_comment, tprints_comment): New prototypes. 16608 * strace.c (tvprintf): New function. 16609 (tprintf): Use it. 16610 (tprintf_comment, tprints_comment): New functions. 16611 * aio.c (tprint_lio_opcode): Use tprints_comment. 16612 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 16613 dm_decode_dm_name_list, dm_decode_dm_target_versions, 16614 dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise. 16615 * futex.c (SYS_FUNC(futex)): Likewise. 16616 * perf.c (print_perf_event_attr): Likewise. 16617 * seccomp.c (decode_bpf_code): Likewise. 16618 * util.c (printxvals, printxval_searchn, printflags64): Likewise. 16619 * btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid, 16620 print_key_value_internal): Likewise. 16621 (btrfs_ioctl): Use tprints_comment and tprintf_comment. 16622 * dirent.c (SYS_FUNC(getdents)): Likewise. 16623 * dirent64.c (SYS_FUNC(getdents64)): Likewise. 16624 * execve.c (printargc): Use tprintf_comment. 16625 * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl, 16626 btrfs_test_features_ioctls): Update expected output. 16627 16628 Make output of execve/execveat syscall parsers more structured. 16629 * execve.c (printargc): Always print the address, format the number 16630 of variables as a comment. 16631 * tests/execve.c: Update expected output. 16632 * tests/execveat.c: Likewise. 16633 * tests/qual_syscall.test: Likewise. 16634 * tests/strace-r.expected: Likewise. 16635 * tests/strace-t.test: Likewise. 16636 * tests/strace-tt.test: Likewise. 16637 * tests/strace-ttt.test: Likewise. 16638 * tests/threads-execve.c: Likewise. 16639 * tests/threads-execve.test: Likewise. 16640 16641 dm: fix diagnostics about misplaced parts of struct dm_ioctl. 16642 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 16643 dm_decode_dm_name_list, dm_decode_dm_target_versions, 16644 dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Fix 16645 diagnostics about various misplaced parts of struct dm_ioctl. 16646 * tests/ioctl_dm.c: Update expected output. 16647 16648 print_mq_attr: fix typo. 16649 * print_mq_attr.c (printmqattr): Fix the last argument of printflags64. 16650 16651 2017-04-23 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16652 16653 tests: add faulty pointer check to time test. 16654 * tests/time.c (main): Add check for an inaccessible pointer. 16655 16656 2017-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 16657 16658 tests: fix print_time_t_nsec usage in xstatx.c. 16659 * tests/xstatx.c (print_stat): Pass tv_nsec field through 16660 zero_extend_signed_to_ull before feeding it to print_time_t_nsec. 16661 16662 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16663 16664 tests: fix netlink_protocol on sparc. 16665 * tests/netlink_protocol.c (test_nlmsgerr): Do not access fields of an 16666 unaligned structure, this makes architectures like sparc very unhappy. 16667 16668 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16669 16670 util: return pointer to string literal directly in sprinttime. 16671 There is no sense to copy it to static buffer first. 16672 16673 * util.c (sprinttime): Just return "0", do not copy it to internal 16674 buffer first. 16675 16676 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16677 16678 tests: remove stat.sample creation from gen_tests.in. 16679 stat.sample is created by appropriate executables and never removed. 16680 16681 * tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat, 16682 trace_stat_like): Remove stat.sample creation. 16683 16684 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 16685 16686 tests: tabulate fstat.test. 16687 * tests/gen_tests.in (fstat): New entry. 16688 (fstat64, oldfstat): Update. 16689 * tests/fstat.test: Remove. 16690 * tests/Makefile.am (DECODER_TESTS): Remove fstat.test. 16691 16692 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16693 16694 Implement -e trace=%stat option. 16695 linux/*/syscallent*.h part is updated automatically by: 16696 16697 sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h 16698 16699 * sysent.h (TRACE_STAT): New macro. 16700 * syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion. 16701 * qualify.c (lookup_class): Add TRACE_STAT for "%stat". 16702 * strace.1 (.SS Filtering): Add information about %stat syscall class. 16703 * NEWS: Mention this change. 16704 * linux/aarch64/syscallent.h (stat): Add TST flag. 16705 * linux/ia64/syscallent.h: Likewise. 16706 * linux/mips/syscallent-n32.h: Likewise. 16707 * linux/mips/syscallent-n64.h: Likewise. 16708 * linux/s390x/syscallent.h: Likewise. 16709 * linux/x32/syscallent.h: Likewise. 16710 * linux/x86_64/syscallent.h: Likewise. 16711 * linux/arm/syscallent.h (oldstat, stat, stat64): Likewise. 16712 * linux/bfin/syscallent.h: Likewise. 16713 * linux/crisv10/syscallent.h: Likewise. 16714 * linux/i386/syscallent.h: Likewise. 16715 * linux/m68k/syscallent.h: Likewise. 16716 * linux/microblaze/syscallent.h: Likewise. 16717 * linux/mips/syscallent-o32.h: Likewise. 16718 * linux/powerpc/syscallent.h: Likewise. 16719 * linux/sh64/syscallent.h: Likewise. 16720 * linux/sh/syscallent.h: Likewise. 16721 * linux/avr32/syscallent.h (stat, stat64): Likewise. 16722 * linux/hppa/syscallent.h: Likewise. 16723 * linux/s390/syscallent.h: Likewise. 16724 * linux/sparc64/syscallent.h: Likewise. 16725 * linux/sparc/syscallent.h: Likewise. 16726 * linux/xtensa/syscallent.h: Likewise. 16727 * linux/powerpc64/syscallent.h (oldstat, stat): Likewise. 16728 * linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise. 16729 * linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat, 16730 svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise. 16731 * tests/gen_tests.in (trace_stat): New entry. 16732 * tests/trace_stat.in: New file. 16733 * tests/Makefile.am (EXTRA_DIST): Add it. 16734 * tests/ksysent.c (TST): New macro, defined to 0. 16735 * tests/nsyscalls.c: Likewise. 16736 16737 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16738 16739 Implement -e trace=%lstat option. 16740 linux/*/syscallent*.h part is updated automatically by: 16741 16742 sed -i '/TSTA,.*lx\?stat/ s/TSTA,/TLST|&/' linux/*/syscallent*.h 16743 16744 * sysent.h (TRACE_LSTAT): New macro. 16745 * syscall.c: Alias TLST to TRACE_LSTAT around syscallent.h inclusion. 16746 * qualify.c (lookup_class): Add TRACE_LSTAT for "%lstat". 16747 * strace.1 (.SS Filtering): Add information about %lstat syscall class. 16748 * NEWS: Mention this change. 16749 * linux/aarch64/syscallent.h (lstat): Likewise. 16750 * linux/ia64/syscallent.h: Likewise. 16751 * linux/mips/syscallent-n32.h: Likewise. 16752 * linux/mips/syscallent-n64.h: Likewise. 16753 * linux/s390x/syscallent.h: Likewise. 16754 * linux/x32/syscallent.h: Likewise. 16755 * linux/x86_64/syscallent.h: Likewise. 16756 * linux/arm/syscallent.h (lstat, lstat64, oldlstat): Likewise. 16757 * linux/bfin/syscallent.h: Likewise. 16758 * linux/crisv10/syscallent.h: Likewise. 16759 * linux/i386/syscallent.h: Likewise. 16760 * linux/m68k/syscallent.h: Likewise. 16761 * linux/microblaze/syscallent.h: Likewise. 16762 * linux/mips/syscallent-o32.h: Likewise. 16763 * linux/powerpc/syscallent.h: Likewise. 16764 * linux/sh64/syscallent.h: Likewise. 16765 * linux/sh/syscallent.h: Likewise. 16766 * linux/sparc64/syscallent.h: Likewise. 16767 * linux/sparc/syscallent.h: Likewise. 16768 * linux/avr32/syscallent.h (lstat, lstat64): Likewise. 16769 * linux/hppa/syscallent.h: Likewise. 16770 * linux/powerpc64/syscallent.h: Likewise. 16771 * linux/s390/syscallent.h: Likewise. 16772 * linux/xtensa/syscallent.h: Likewise. 16773 * linux/alpha/syscallent.h (lstat, lstat64, osf_lstat, osf_old_lstat): Likewise. 16774 * linux/mips/syscallent-compat.h (bsd43_lstat, posix_lstat, svr4_lstat, 16775 sysv_lstat): Likewise. 16776 * tests/gen_tests.in (trace_lstat): New entry. 16777 * tests/trace_lstat.in: New file. 16778 * tests/Makefile.am (EXTRA_DIST): Add it. 16779 * tests/ksysent.c (TLST): New macro, defined to 0. 16780 * tests/nsyscalls.c: Likewise. 16781 16782 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16783 16784 Implement -e trace=%fstat option. 16785 linux/*/syscallent*.h part is updated automatically by: 16786 16787 sed -i -e '/TSTA.*fx\?stat/ s/TSTA,/TFST|&/' \ 16788 -e 's/\(TD|TF|TFST|TSTA,\)[[:space:]]/\1/' linux/*/syscallent*.h 16789 16790 * sysent.h (TRACE_FSTAT): New macro. 16791 * syscall.c: Alias TFST to TRACE_FSTAT around syscallent.h inclusion. 16792 * qualify.c (lookup_class): Add TRACE_FSTAT for "%fstat". 16793 * strace.1 (.SS Filtering): Add information about %fstat syscall class. 16794 * NEWS: Mention this change. 16795 * linux/32/syscallent.h (fstat64, fstatat64): Add TFST flag. 16796 * linux/64/syscallent.h (fstat, newfstatat): Likewise. 16797 * linux/aarch64/syscallent.h: Likewise. 16798 * linux/ia64/syscallent.h: Likewise. 16799 * linux/mips/syscallent-n32.h: Likewise. 16800 * linux/mips/syscallent-n64.h: Likewise. 16801 * linux/s390x/syscallent.h: Likewise. 16802 * linux/x32/syscallent.h: Likewise. 16803 * linux/x86_64/syscallent.h: Likewise. 16804 * linux/arm/syscallent.h (fstat, fstat64, fstatat64, oldfstat): Likewise. 16805 * linux/bfin/syscallent.h: Likewise. 16806 * linux/crisv10/syscallent.h: Likewise. 16807 * linux/i386/syscallent.h: Likewise. 16808 * linux/m68k/syscallent.h: Likewise. 16809 * linux/microblaze/syscallent.h: Likewise. 16810 * linux/mips/syscallent-o32.h: Likewise. 16811 * linux/powerpc/syscallent.h: Likewise. 16812 * linux/sh64/syscallent.h: Likewise. 16813 * linux/sh/syscallent.h: Likewise. 16814 * linux/avr32/syscallent.h (fstat, fstat64, fstatat64): Likewise. 16815 * linux/hppa/syscallent.h: Likewise. 16816 * linux/s390/syscallent.h: Likewise. 16817 * linux/sparc64/syscallent.h: Likewise. 16818 * linux/sparc/syscallent.h: Likewise. 16819 * linux/xtensa/syscallent.h: Likewise. 16820 * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, osf_fstat, 16821 osf_old_fstat): Likewise. 16822 * linux/powerpc64/syscallent.h (fstat, newfstatat, oldfstat): Likewise. 16823 * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_oldfstat, posix_fstat, 16824 svr4_fstat, sysv_fstat): Likewise. 16825 * tests/gen_tests.in (trace_fstat): New entry. 16826 * tests/trace_fstat.in: New file. 16827 * tests/Makefile.am (EXTRA_DIST): Add it. 16828 * tests/ksysent.c (TFST): New macro, defined to 0. 16829 * tests/nsyscalls.c: Likewise. 16830 16831 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16832 16833 Implement -e trace=%%stat option. 16834 linux/*/syscallent*.h part is updated automatically by: 16835 16836 sed -i '/TSFA\|stat[iu]s/! s/,[[:space:]]\?\([[:space:]]*SEN(.*stat\)/|TSTA,\1/' \ 16837 linux/*/syscallent*.h 16838 16839 * sysent.h (TRACE_STAT_LIKE): New macro. 16840 * syscall.c: Alias TSTA to TRACE_STAT_LIKE around syscallent.h inclusion. 16841 * qualify.c (lookup_class): Add TRACE_STAT_LIKE for "%%stat". 16842 * strace.1 (.SS Filtering): Add information about %%stat syscall class. 16843 * NEWS: Mention this change. 16844 * linux/32/syscallent.h (fstat64, fstatat64, statx): Add TSTA flag. 16845 * linux/64/syscallent.h (fstat, newfstatat, statx): Likewise. 16846 * linux/aarch64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. 16847 * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16848 osf_fstat, osf_lstat, osf_old_fstat, osf_old_lstat, osf_old_stat, osf_stat, 16849 stat, stat64): Likewise. 16850 * linux/arm/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 16851 oldlstat, oldstat, stat, stat64, statx): Likewise. 16852 * linux/avr32/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 16853 stat64): Likewise. 16854 * linux/bfin/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16855 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 16856 * linux/crisv10/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16857 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 16858 * linux/hppa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 16859 stat64): Likewise. 16860 * linux/i386/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 16861 oldlstat, oldstat, stat, stat64, statx): Likewise. 16862 * linux/ia64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. 16863 * linux/m68k/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 16864 oldlstat, oldstat, stat, stat64, statx): Likewise. 16865 * linux/microblaze/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16866 oldfstat, oldlstat, oldstat, stat, stat64): Likewise. 16867 * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_lstat, bsd43_oldfstat, 16868 bsd43_oldstat, bsd43_stat, posix_fstat, posix_lstat, posix_stat, svr4_fstat, 16869 svr4_fxstat, svr4_lstat, svr4_lxstat, svr4_stat, svr4_xstat, sysv_fstat, 16870 sysv_fxstat, sysv_lstat, sysv_lxstat, sysv_stat, sysv_xstat): Likewise. 16871 * linux/mips/syscallent-n32.h (fstat, lstat, newfstatat, stat, statx): Likewise. 16872 * linux/mips/syscallent-n64.h (fstat, lstat, newfstatat, stat, statx): Likewise. 16873 * linux/mips/syscallent-o32.h (fstat, fstat64, fstatat64, lstat, lstat64, 16874 oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. 16875 * linux/powerpc64/syscallent.h (fstat, lstat, newfstatat, oldfstat, oldlstat, 16876 oldstat, stat): Likewise. 16877 * linux/powerpc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16878 oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. 16879 * linux/s390/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 16880 stat64, statx): Likewise. 16881 * linux/s390x/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 16882 * linux/sh64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 16883 oldlstat, oldstat, stat, stat64): Likewise. 16884 * linux/sh/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, 16885 oldlstat, oldstat, stat, stat64): Likewise. 16886 * linux/sparc64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16887 oldlstat, stat, stat64): Likewise. 16888 * linux/sparc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, 16889 oldlstat, stat, stat64): Likewise. 16890 * linux/x32/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 16891 * linux/x86_64/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. 16892 * linux/xtensa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, 16893 stat64, statx): Likewise. 16894 * tests/gen_tests.in (trace_stat_like): New entry. 16895 * tests/trace_stat_like.in: New file. 16896 * tests/Makefile.am (EXTRA_DIST): Add it. 16897 * tests/ksysent.c (TSTA): New macro, defined to 0. 16898 * tests/nsyscalls.c: Likewise. 16899 16900 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16901 16902 qualify: add syntax for optional non-matching syscall qualification. 16903 It may be useful in case syscall is not present on the target 16904 architecture. 16905 16906 * qualify.c (qualify_syscall): Add ignore_fail flag, set it to true 16907 in case syscall qualification is led by a question mark(s). 16908 * strace.1 (.SS Filtering): Document ability to use question marks 16909 in syscall qualification. 16910 16911 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16912 16913 linux/alpha/syscallent.h: add TSFA flag to osf_getfsstat. 16914 In accordance with [1]. 16915 16916 [1] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2 16917 16918 * linux/alpha/syscallent.h (osf_getfsstat): Add TSFA flag. 16919 * strace.1 (.SS Filtering) <%%statfs>: Update equivalent regexp. 16920 16921 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16922 16923 linux/mips/syscallent-compat.h: add some TD/TF flags for *stat* variants 16924 *xstat syscalls are, according to [1], like their *stat counterparts, 16925 but with additional argument with fixed value. 16926 16927 [1] http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf 16928 16929 * linux/mips/syscallent-compat.h (*_xstat, *_lxstat, bsd43_oldstat): 16930 Add TF flag. 16931 (*_fxstat, bsd43_oldfstat): Add TD flag. 16932 16933 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16934 16935 Implement -e trace=%%statfs option. 16936 linux/*/syscallent*.h part is updated automatically by: 16937 16938 sed -i 's/\(TSF\),[[:space:]]\?/\1|TSFA,/' linux/*/syscallent*.h 16939 sed -i 's/\(TFSF\),/\1|TSFA,/' linux/*/syscallent*.h 16940 sed -i 's/0\(,.*ustat\)/TSFA\1/' linux/*/syscallent*.h 16941 16942 * sysent.h (TRACE_STATFS_LIKE): New macro. 16943 * syscall.c: Alias TSFA to TRACE_STATFS_LIKE around syscallent.h inclusion. 16944 * qualify.c (lookup_class): Add SCHED_STATFS_LIKE for "%%statfs". 16945 * strace.1 (.SS Filtering): Add information about %%statfs syscall class. 16946 * NEWS: Mention this change. 16947 * linux/32/syscallent.h (statfs64, fstatfs64): Add TSFA flag. 16948 * linux/64/syscallent.h (statfs, fstatfs): Likewise. 16949 * linux/aarch64/syscallent.h (statfs, fstatfs, ustat): Likewise. 16950 * linux/mips/syscallent-n64.h: Likewise. 16951 * linux/x32/syscallent.h: Likewise. 16952 * linux/x86_64/syscallent.h: Likewise. 16953 * linux/arm/syscallent.h (statfs, statfs64, fstatfs, fstatfs64, ustat): 16954 Likewise. 16955 * linux/avr32/syscallent.h: Likewise. 16956 * linux/bfin/syscallent.h: Likewise. 16957 * linux/crisv10/syscallent.h: Likewise. 16958 * linux/hppa/syscallent.h: Likewise. 16959 * linux/i386/syscallent.h: Likewise. 16960 * linux/ia64/syscallent.h: Likewise. 16961 * linux/m68k/syscallent.h: Likewise. 16962 * linux/microblaze/syscallent.h: Likewise. 16963 * linux/mips/syscallent-n32.h: Likewise. 16964 * linux/mips/syscallent-o32.h: Likewise. 16965 * linux/powerpc/syscallent.h: Likewise. 16966 * linux/powerpc64/syscallent.h: Likewise. 16967 * linux/s390/syscallent.h: Likewise. 16968 * linux/s390x/syscallent.h: Likewise. 16969 * linux/sh/syscallent.h: Likewise. 16970 * linux/sh64/syscallent.h: Likewise. 16971 * linux/sparc/syscallent.h: Likewise. 16972 * linux/sparc64/syscallent.h: Likewise. 16973 * linux/xtensa/syscallent.h: Likewise. 16974 * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs, 16975 ofs_fstatfs, osf_fstatfs64, ustat): Likewise. 16976 * linux/mips/syscallent-compat.h (*_statfs, *_statvfs, *_fstatfs): Likewise. 16977 * tests/gen_tests.in (trace_statfs_like): New entry. 16978 * tests/trace_statfs_like.in: New file. 16979 * tests/Makefile.am (EXTRA_DIST): Add it. 16980 * tests/ksysent.c (TSFA): New macro, defined to 0. 16981 * tests/nsyscalls.c: Likewise. 16982 16983 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 16984 16985 Implement -e trace=%fstatfs option. 16986 linux/*/syscallent*.h part is updated automatically by: 16987 16988 sed -i 's/TD,[[:space:]]\([[:space:]]*SEN.*[_"]fstatv\?fs\)/TD|TFSF,\1/' \ 16989 linux/*/syscallent*.h 16990 16991 * sysent.h (TRACE_FSTATFS): New macro. 16992 * syscall.c: Alias TFSF to TRACE_FSTATFS around syscallent.h inclusion. 16993 * qualify.c (lookup_class): Add SCHED_FSTATFS for "%fstatfs". 16994 * strace.1 (.SS Filtering): Add information about %fstatfs syscall class. 16995 * NEWS: Mention this change. 16996 * linux/32/syscallent.h (fstatfs64): Add TFSF flag. 16997 * linux/64/syscallent.h (fstatfs): Likewise. 16998 * linux/aarch64/syscallent.h: Likewise. 16999 * linux/mips/syscallent-n64.h: Likewise. 17000 * linux/x32/syscallent.h: Likewise. 17001 * linux/x86_64/syscallent.h: Likewise. 17002 * linux/arm/syscallent.h (fstatfs, fstatfs64): 17003 Likewise. 17004 * linux/avr32/syscallent.h: Likewise. 17005 * linux/bfin/syscallent.h: Likewise. 17006 * linux/crisv10/syscallent.h: Likewise. 17007 * linux/hppa/syscallent.h: Likewise. 17008 * linux/i386/syscallent.h: Likewise. 17009 * linux/ia64/syscallent.h: Likewise. 17010 * linux/m68k/syscallent.h: Likewise. 17011 * linux/microblaze/syscallent.h: Likewise. 17012 * linux/mips/syscallent-n32.h: Likewise. 17013 * linux/mips/syscallent-o32.h: Likewise. 17014 * linux/powerpc/syscallent.h: Likewise. 17015 * linux/powerpc64/syscallent.h: Likewise. 17016 * linux/s390/syscallent.h: Likewise. 17017 * linux/s390x/syscallent.h: Likewise. 17018 * linux/sh/syscallent.h: Likewise. 17019 * linux/sh64/syscallent.h: Likewise. 17020 * linux/sparc/syscallent.h: Likewise. 17021 * linux/sparc64/syscallent.h: Likewise. 17022 * linux/xtensa/syscallent.h: Likewise. 17023 * linux/alpha/syscallent.h (ofs_fstatfs, osf_fstatfs64): Likewise. 17024 * linux/mips/syscallent-compat.h (*_fstatfs, *_fstatvfs): Likewise. 17025 * tests/gen_tests.in (trace_fstatfs): New entry. 17026 * tests/trace_fstatfs.in: New file. 17027 * tests/Makefile.am (EXTRA_DIST): Add it. 17028 * tests/ksysent.c (TFSF): New macro, defined to 0. 17029 * tests/nsyscalls.c: Likewise. 17030 17031 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17032 17033 sysent.h: format syscall flag macros. 17034 Add some tabulation and leading zeroes to the values. 17035 17036 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 17037 17038 tests: tabulate sched.test. 17039 Rewrite sched.test using test_trace_expr(). 17040 17041 * tests/gen_tests.in (sched): New entry. 17042 * tests/sched.in: New file, derived from a set of tests in sched.test. 17043 * tests/sched.test: Remove. 17044 * tests/Makefile.am (DECODER_TESTS): Remove sched.test. 17045 (EXTRA_DIST): Add sched.in. 17046 17047 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 17048 17049 tests: tabulate regex.test. 17050 Rewrite regex.test using test_trace_expr(). 17051 17052 * tests/gen_tests.in (regex): New entry. 17053 * tests/regex.in: New file, derived from a set of tests in regex.test. 17054 * tests/regex.test: Remove. 17055 * tests/Makefile.am (DECODER_TESTS): Remove regex.test. 17056 (EXTRA_DIST): Add regex.in. 17057 17058 2017-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 17059 17060 tests: tabulate clock.test. 17061 Rewrite clock.test using test_trace_expr(). 17062 17063 * tests/gen_tests.in (clock): New entry. 17064 * tests/clock.in: New file, derived from a set of tests in clock.test. 17065 * tests/clock.test: Remove. 17066 * tests/Makefile.am (DECODER_TESTS): Remove clock.test. 17067 (EXTRA_DIST): Add clock.in. 17068 17069 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17070 17071 tests: tabulate trace_statfs.test. 17072 Rewrite trace_statfs.test using test_trace_expr(). 17073 17074 * tests/gen_tests.in (trace_statfs): New entry. 17075 * tests/trace_statfs.in: New file, derived from a set of tests 17076 in trace_statfs.test. 17077 * tests/trace_statfs.test: Remove. 17078 * tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test. 17079 (EXTRA_DIST): Add trace_statfs.in. 17080 17081 2017-04-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17082 17083 tests/init.sh: add helpers for running set of programs. 17084 This introduces three new helpers: 17085 prog_set_subtract subtracts one program set from another, 17086 test_pure_prog_set runs strace check on a set of programs, 17087 test_trace_expr tests trace expressions. 17088 17089 * tests/init.sh (prog_set_subtract, test_pure_prog_set, 17090 test_trace_expr): New functions. 17091 17092 2017-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 17093 17094 tests: extend gen_tests.sh further. 17095 * tests/gen_tests.sh: Extend support of arbitrary rules. 17096 17097 2017-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17098 17099 tests/xstat.c: do not remove sample file after test. 17100 As tests are executed in separate directories now, there is no need to 17101 remove sample file. 17102 17103 * tests/xstat.c (main): Remove unlink calls. 17104 17105 2017-04-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17106 17107 tests: use fixed name for stat tests sample file. 17108 As tests are now run in separate directories. 17109 17110 * tests/xstatx.c: Use fixed "stat.sample" name for sample file. 17111 * tests/fstat.test: Use it as an argument for -P option. 17112 * tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat, 17113 oldstat, stat, stat64, statx): Likewise. 17114 17115 2017-04-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17116 17117 Derive copyright year from the git commit date. 17118 This solves problems like the need to update test suite on every 17119 New Year's Eve. 17120 17121 * Makefile.am (dist-hook): Generate .year. 17122 * copyright-year-gen: New file. 17123 * configure.ac (copyright_year): New m4 variable, defined as the output 17124 of copyright-year-gen script. 17125 (AC_COPYRIGHT): Use it. 17126 (COPYRIGHT_YEAR): New output variable and preprocessor macro. 17127 * strace.c (print_version): Use COPYRIGHT_YEAR. 17128 * strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf 17129 variable to .year file. 17130 * tests/strace-V.test (config_year): New variable, derived from config.h. 17131 Add sanity checks for $config_year and use it in expected output. 17132 17133 Reported-by: Andreas Schwab <schwab (a] suse.de> 17134 17135 2017-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 17136 17137 tests: move /proc/ checks from scripts to executables. 17138 Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts 17139 to xecutables. 17140 17141 * tests/attach-f-p.test: Move /proc/self/task/ check ... 17142 * tests/attach-f-p-cmd.c (main): ... here. 17143 * tests/fstat.test: Move /proc/self/fd/ check ... 17144 * tests/xstatx.c (main): ... here. 17145 * tests/net-y-unix.test: Move /proc/self/fd/ check ... 17146 * tests/net-y-unix.c (main): ... here. 17147 * tests/net-yy-inet.test: Move /proc/self/fd/ check ... 17148 * tests/net-yy-inet.c (main): ... here. 17149 * tests/net-yy-netlink.test: Move /proc/self/fd/ check ... 17150 * tests/net-yy-netlink.c (main): ... here. 17151 * tests/net-yy-unix.test: Move /proc/self/fd/ check ... 17152 * tests/net-yy-unix.c (main): ... here. 17153 17154 2017-04-19 Dmitry V. Levin <ldv (a] altlinux.org> 17155 17156 tests: tabulate pread64-pwrite64.test. 17157 * tests/gen_tests.in (pread64-pwrite64): New entry. 17158 * tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/ 17159 is not available. 17160 * tests/pread64-pwrite64.test: Remove. 17161 * tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test. 17162 17163 tests: tabulate read-write.test. 17164 * tests/gen_tests.in (read-write): New entry. 17165 * tests/read-write.c: (main): Skip the test if /proc/self/fd/ 17166 is not available. 17167 * tests/read-write.test: Remove. 17168 * tests/Makefile.am (DECODER_TESTS): Remove read-write.test. 17169 17170 tests: add skip_if_unavailable function to libtests. 17171 * tests/skip_unavailable.c: New file. 17172 * tests/tests.h (skip_if_unavailable): New prototype. 17173 * tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c. 17174 17175 tests: tabulate netlink_protocol.test. 17176 * tests/gen_tests.in (netlink_protocol): New entry. 17177 * tests/netlink_protocol.test: Remove. 17178 * tests/Makefile.am (DECODER_TESTS): Remove netlink_protocol.test. 17179 17180 tests: tabulate statfs.test. 17181 * tests/gen_tests.in (statfs): New entry. 17182 (fstatfs, fstatfs64, statfs64): Update. 17183 * tests/statfs.test: Remove. 17184 * tests/Makefile.am (DECODER_TESTS): Remove statfs.test. 17185 17186 2017-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 17187 17188 tests: skip statfs related tests if their sample files are not available 17189 * tests/xstatfsx.c (print_statfs): Skip the test if open failed. 17190 17191 tests: extend gen_tests.sh to support arbitrary test_* rules. 17192 * tests/gen_tests.sh: Add support of arbitrary test_* rules. 17193 17194 tests: change gen_tests.sh to read its input as raw input. 17195 * tests/gen_tests.sh: Specify -r option to read. 17196 * tests/gen_tests.in (shmxt): Update. 17197 17198 2017-04-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 17199 17200 strace.1: s/regex expression/regular expression/ 17201 17202 2017-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 17203 17204 strace.1: enhance %statfs description. 17205 * strace.1 (.SS Filtering) <%statfs>: Fix the list of syscalls, 17206 add an equivalent regex expression. 17207 17208 netlink: decode NLMSG_ERROR messages. 17209 * netlink.c (decode_nlmsgerr, decode_payload): New functions. 17210 (decode_nlmsghdr_with_payload): Use decode_payload. 17211 * tests/netlink_protocol.c (send_query): Check decoding 17212 of NLMSG_ERROR messages. 17213 * NEWS: Mention this change. 17214 17215 netlink: avoid using unaligned sizeof(struct nlmsghdr) unnecessarily. 17216 * netlink.c (NLMSG_HDRLEN): Redefine. 17217 (decode_nlmsghdr_with_payload, decode_netlink): Use it instead 17218 of sizeof(struct nlmsghdr). 17219 17220 Fix the length argument passed from print_iovec to decode_netlink. 17221 * io.c (print_iovec): Pass the actual length to decode_netlink 17222 instead of the original length. 17223 * NEWS: Mention this fix. 17224 17225 numa: fix printing of error values in move_pages status array. 17226 * numa.c (print_status): Do not lose a minus sign when printing 17227 a symbolic error code. 17228 * tests/move_pages.c (print_status_array): Update expected output. 17229 17230 tests: generate pure_executables part of check_PROGRAMS automatically. 17231 * tests/gen_pure_executables.sh: New file. 17232 * bootstrap: Invoke it. 17233 * tests/Makefile.am: Include pure_executables.am. 17234 (check_PROGRAMS): Add $(PURE_EXECUTABLES). Remove everything listed 17235 in pure_executables.list. 17236 (EXTRA_DIST): Add gen_pure_executables.sh. 17237 * tests/.gitignore: Add pure_executables.am. 17238 17239 tests: make EXTRA_DIST sorted. 17240 * tests/Makefile.am (EXTRA_DIST): Sort. 17241 17242 tests: check decoding of alpha specific osf_utimes syscall. 17243 * tests/osf_utimes.c: New file. 17244 * tests/gen_tests.in (osf_utimes): New entry. 17245 * tests/Makefile.am (check_PROGRAMS): Add osf_utimes. 17246 * tests/pure_executables.list: Likewise. 17247 * tests/.gitignore: Likewise. 17248 17249 tests: parametrize utimes.c. 17250 * tests/xutimes.c: New file, based on utimes.c. 17251 * tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR, 17252 TEST_STRUCT): New macros. 17253 [__NR_utimes]: Replace all the rest with include "xutimes.c". 17254 * tests/Makefile.am (EXTRA_DIST): Add xutimes.c. 17255 17256 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17257 17258 alpha: fix tracing flags of osf_select and osf_utimes syscalls. 17259 * linux/alpha/syscallent.h (osf_select): Add TD flag. 17260 (osf_utimes): Add TF flag. 17261 * NEWS: Mention alpha specific fixes. 17262 17263 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17264 17265 alpha: rename print_timeval32_pair to print_timeval32_utimes. 17266 This follows the rename of print_timeval_item to print_timeval_utimes. 17267 17268 * defs.h [ALPHA] (print_timeval32_pair): Rename 17269 to print_timeval32_utimes. 17270 * print_timeval.c [ALPHA] (print_timeval32_pair): Likewise. 17271 * utimes.c [ALPHA] (SYS_FUNC(osf_utimes)): Replace print_timeval32_pair 17272 with print_timeval32_utimes. 17273 17274 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17275 17276 tests: do more rigorous testing of utimes syscall parser. 17277 * tests/utimes.c (errstr): New variable. 17278 (print_ts, k_utimes): New functions. 17279 (main): Use them to do more rigorous testing of utimes syscall parser. 17280 * tests/gen_tests.in (utimes): Update -a option. 17281 17282 tests: do more rigorous testing of futimesat syscall parser. 17283 * tests/futimesat.c (errstr): New variable. 17284 (print_ts, k_futimesat): New functions. 17285 (main): Use them to do more rigorous testing of futimesat syscall parser. 17286 17287 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17288 17289 Fix printing of inaccessible times argument of utimes and futimesat syscalls 17290 When the whole pair of struct timeval structures cannot be fetched from 17291 tracee's memory, print the address. This behavior follows the kernel's 17292 that uses copy_from_user for the whole pair, too. 17293 17294 * print_timeval.c (print_timeval_item): Remove. 17295 (print_timeval_pair): Rename to print_timeval_utimes, all callers 17296 updated. Fetch the whole timeval_t array with a single 17297 umove_or_printaddr call. 17298 * tests/futimesat.c (main): Update expected output. 17299 * tests/utimes.c (main): Likewise. 17300 17301 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17302 17303 tests: rewrite utimensat.test without relying on libc utimensat wrapper. 17304 The new test also does more rigorous testing. 17305 17306 * tests/utimensat.c: Stop including <assert.h> and <errno.h>, include 17307 <unistd.h> and <asm/unistd.h>, check __NR_utimensat instead 17308 of HAVE_UTIMENSAT. 17309 (errstr): New variable. 17310 (k_utimensat): New function, a thin wrapper around 17311 syscall(__NR_utimensat). 17312 (main): Use them instead of utimensat. 17313 * tests/gen_tests.in (utimensat): New entry. 17314 * tests/utimensat.test: Remove. 17315 * tests/Makefile.am (DECODER_TESTS): Remove it. 17316 17317 2017-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 17318 17319 tests: use fixed timestamps in utime related tests. 17320 * tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests 17321 from the list of exceptions. 17322 * tests/utime.c (main): Do not use time(), use fixed timestamp instead. 17323 * tests/futimesat.c (main): Do not use gettimeofday(), use fixed 17324 timestamps instead. 17325 * tests/utimensat.c (main): Likewise. 17326 * tests/utimes.c (main): Likewise. 17327 17328 2017-04-15 Dmitry V. Levin <ldv (a] altlinux.org> 17329 17330 xtensa: wire up new syscalls. 17331 * linux/xtensa/syscallent.h [348..350]: New pkey_* entries. 17332 17333 Reported-by: Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 17334 17335 2017-04-15 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 17336 17337 Update statx parser and syscall entries lists to the upstream. 17338 * linux/32/syscallent.h [291]: Add statx entry. 17339 * linux/64/syscallent.h [291]: Likewise. 17340 * linux/arm/syscallent.h [397]: Likewise. 17341 * linux/m68k/syscallent.h [379]: Likewise. 17342 * linux/mips/syscallent-n32.h [6330]: Likewise. 17343 * linux/mips/syscallent-n64.h [5326]: Likewise. 17344 * linux/mips/syscallent-o32.h [4366]: Likewise. 17345 * linux/powerpc/syscallent.h [383]: Likewise. 17346 * linux/s390/syscallent.h [379]: Likewise. 17347 * linux/s390x/syscallent.h [379]: Likewise. 17348 * linux/xtensa/syscallent.h [351]: Likewise. 17349 * statx.h (struct_statx): Update. 17350 * statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask. 17351 * tests/xstatx.c (print_stat, main): Update to test decoding 17352 of struct_statx.stx_attributes_mask. 17353 17354 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17355 17356 tests: add more regex match checks. 17357 * tests/qual_syscall.test: Add regex match checks. 17358 17359 tests: make mq_sendrecv* test executables reenterable. 17360 * tests/mq_sendrecv.c (MQ_NAME): Remove. 17361 (mq_name): New static variable. 17362 (cleanup): Use it instead of MQ_NAME. 17363 (main): Initialize it dynamically using the pid of process. Use it 17364 instead of MQ_NAME. 17365 17366 tests: make mq test executable reenterable. 17367 * tests/mq.c (NAME): Remove. 17368 (main): Replace the fixed message queue name with a dynamically 17369 made name containing the pid of process. 17370 * tests/gen_tests.in (mq): Update -a option. 17371 17372 tests: make net-yy-netlink test executable reenterable. 17373 * tests/net-yy-netlink.c (main): Use getpid() instead of a fixed 17374 magic number. 17375 17376 tests: tabulate shmxt.test. 17377 * tests/gen_tests.in (shmxt): New entry. 17378 * tests/shmxt.test: Remove. 17379 * tests/Makefile.am (DECODER_TESTS): Remove shmxt.test. 17380 17381 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17382 17383 Revert "Implement -e trace=%sched option" 17384 -e trace=%sched became redundant as -e trace=/sched does the same. 17385 17386 This reverts commit 811638e9c1805438a63c14f9704b8b00ac922623. 17387 17388 * syscall.c (TSC): Remove. 17389 * sysent.h (TRACE_SCHED): Remove. 17390 * qualify.c (lookup_class): Remove %sched. 17391 * strace.1 (.SS Filtering): Likewise. 17392 * NEWS: Likewise. 17393 * linux/32/syscallent.h: Remove TSC flag from sched* syscalls. 17394 * linux/64/syscallent.h: Likewise. 17395 * linux/alpha/syscallent.h: Likewise. 17396 * linux/arm/syscallent.h: Likewise. 17397 * linux/avr32/syscallent.h: Likewise. 17398 * linux/bfin/syscallent.h: Likewise. 17399 * linux/crisv10/syscallent.h: Likewise. 17400 * linux/hppa/syscallent.h: Likewise. 17401 * linux/i386/syscallent.h: Likewise. 17402 * linux/ia64/syscallent.h: Likewise. 17403 * linux/m68k/syscallent.h: Likewise. 17404 * linux/microblaze/syscallent.h: Likewise. 17405 * linux/mips/syscallent-n32.h: Likewise. 17406 * linux/mips/syscallent-n64.h: Likewise. 17407 * linux/mips/syscallent-o32.h: Likewise. 17408 * linux/powerpc/syscallent.h: Likewise. 17409 * linux/powerpc64/syscallent.h: Likewise. 17410 * linux/s390/syscallent.h: Likewise. 17411 * linux/s390x/syscallent.h: Likewise. 17412 * linux/sh/syscallent.h: Likewise. 17413 * linux/sh64/syscallent.h: Likewise. 17414 * linux/sparc/syscallent.h: Likewise. 17415 * linux/sparc64/syscallent.h: Likewise. 17416 * linux/x32/syscallent.h: Likewise. 17417 * linux/x86_64/syscallent.h: Likewise. 17418 * linux/xtensa/syscallent.h: Likewise. 17419 * tests/sched.test: Replace trace=%sched with trace=/sched. 17420 * tests/ksysent.c (TSC): Remove. 17421 * tests/nsyscalls.c: Likewise. 17422 17423 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17424 17425 Revert "Implement -e trace=%clock option" 17426 -e trace=%clock became redundant as -e trace=/clock does the same. 17427 17428 This reverts commit 0a13d2391c413e3847b71ec0c1d38f56e353b1b5. 17429 17430 * syscall.c (TCL): Remove. 17431 * sysent.h (TRACE_CLOCK): Remove. 17432 * qualify.c (lookup_class): Remove %clock. 17433 * strace.1 (.SS Filtering): Likewise. 17434 * NEWS: Likewise. 17435 * linux/32/syscallent.h: Remove TCL flag from clock_* syscalls. 17436 * linux/64/syscallent.h: Likewise. 17437 * linux/alpha/syscallent.h: Likewise. 17438 * linux/arm/syscallent.h: Likewise. 17439 * linux/avr32/syscallent.h: Likewise. 17440 * linux/bfin/syscallent.h: Likewise. 17441 * linux/crisv10/syscallent.h: Likewise. 17442 * linux/hppa/syscallent.h: Likewise. 17443 * linux/i386/syscallent.h: Likewise. 17444 * linux/ia64/syscallent.h: Likewise. 17445 * linux/m68k/syscallent.h: Likewise. 17446 * linux/microblaze/syscallent.h: Likewise. 17447 * linux/mips/syscallent-n32.h: Likewise. 17448 * linux/mips/syscallent-n64.h: Likewise. 17449 * linux/mips/syscallent-o32.h: Likewise. 17450 * linux/powerpc/syscallent.h: Likewise. 17451 * linux/powerpc64/syscallent.h: Likewise. 17452 * linux/s390/syscallent.h: Likewise. 17453 * linux/s390x/syscallent.h: Likewise. 17454 * linux/sh/syscallent.h: Likewise. 17455 * linux/sh64/syscallent.h: Likewise. 17456 * linux/sparc/syscallent.h: Likewise. 17457 * linux/sparc64/syscallent.h: Likewise. 17458 * linux/x32/syscallent.h: Likewise. 17459 * linux/x86_64/syscallent.h: Likewise. 17460 * linux/xtensa/syscallent.h: Likewise. 17461 * tests/clock.test: Replace trace=%clock with trace=/clock. 17462 * tests/ksysent.c (TCL): Remove. 17463 * tests/nsyscalls.c: Likewise. 17464 17465 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17466 17467 tests: robustify regex.test. 17468 * tests/regex.test: Use trace_statfs.test as a template instead 17469 of clock.test and sched.test, not because of more interesting 17470 regular expressions but to fix build on platforms where 17471 clock.test and sched.test are not reenterable. 17472 17473 2017-04-14 JingPiao Chen <chenjingpiao (a] gmail.com> 17474 17475 Implement -e trace=/regex option. 17476 * qualify.c: Include <regex.h>. 17477 (qualify_syscall_regex): New function. 17478 (qualify_syscall): Use it. 17479 * strace.1: Document -e trace=/regex option. 17480 * NEWS: Mention -e trace=/regex option. 17481 * tests/regex.test: New test. 17482 * tests/Makefile.am (DECODER_TESTS): Add it. 17483 * tests/options-syntax.test: Add checks for invaild regexp 17484 and for regexp that doesn't match a syscall. 17485 17486 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17487 17488 tests: fix ioctl_nsfs.test on hppa. 17489 * tests/ioctl_nsfs.c (test_user_namespace): Specify an address 17490 in the middle of a mapped page as child_stack address argument 17491 of the clone call. 17492 [IA64] (clone): Update. 17493 17494 2017-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 17495 17496 tests: fix ioctl_nsfs.test on ia64. 17497 glibc on ia64 provides no clone() function, but there is a __clone2 17498 function instead. It is documented but no prototype is provided by 17499 glibc. 17500 17501 * tests/ioctl_nsfs.c [IA64] (__clone2): New prototype. 17502 [IA64] (clone): New macro wrapper around __clone2. 17503 17504 2017-04-13 Edgar Kaziahmedov <edos (a] linux.com> 17505 17506 tests: check decoding of the remaining V4L2_BUF_TYPE_* types. 17507 * tests/ioctl_v4l2.c (init_v4l2_format, print_ioctl_v4l2): New functions 17508 to avoid code duplication in VIDIOC_S_FMT and VIDIOC_TRY_FMT tests. 17509 (main) <VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT>: Use them. Add 17510 checks for remaining V4L2_BUF_TYPE_* types. 17511 17512 v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types. 17513 * v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h". 17514 (struct_v4l2_clip): New typedef. Mpersify it. 17515 (print_v4l2_clip): New function. 17516 (print_v4l2_format_fmt): Use it. Add struct tcb argument. Implement 17517 decoding of the remaining V4L2_BUF_TYPE_* types. 17518 * xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED 17519 introduced by linux kernel commit v2.5.46~39^2~23^2~4. 17520 Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START, 17521 V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by 17522 linux kernel commit v3.17-rc1~112^2~217. 17523 * xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS, 17524 V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and 17525 V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64. 17526 * configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and 17527 V4L2_BUF_TYPE_SDR_OUTPUT. 17528 (AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and 17529 struct v4l2_sdr_format.buffersize. 17530 * NEWS: Mention this change. 17531 17532 2017-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 17533 17534 travis: use mainline kernel uapi headers for coverage. 17535 * .travis.yml (matrix) <CHECK=coverage>: Add KHEADERS=torvalds/linux. 17536 * travis-build.sh: Handle $KHEADERS. 17537 * travis-install.sh: Likewise. 17538 17539 travis: switch from clang-3.6 to clang-3.8. 17540 * .travis.yml (matrix): Change clang-3.6 to clang-3.8. 17541 17542 2017-04-13 Nikolay Marchuk <marchuk.nikolay.a (a] gmail.com> 17543 17544 Implement decoding of NS_* ioctl commands. 17545 * configure.ac (AC_CHECK_HEADERS): Add linux/nsfs.h. 17546 * defs.h (DECL_IOCTL(nsfs)): New prototype. 17547 (setns_types): Make global. 17548 * ioctl.c (ioctl_decode): Call nsfs_ioctl for 0xb7 code. 17549 * nsfs.c: New file. 17550 * nsfs.h: Likewise. 17551 * Makefile.am (strace_SOURCES): Add them. 17552 * tests/ioctl_nsfs.c: New file. 17553 * tests/ioctl_nsfs.test: Likewise. 17554 * tests/.gitignore: Add ioctl_nsfs. 17555 * tests/Makefile.am (check_PROGRAMS): Likewise. 17556 (DECODER_TESTS): Add ioctl_nsfs.test. 17557 * NEWS: Mention this change. 17558 17559 2017-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 17560 17561 travis: copy coverage test suite log to the travis log. 17562 * travis-build.sh (coverage): Print tests*/test-suite.log 17563 and tests*/ksysent.log. 17564 17565 2017-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 17566 17567 travis: add gcc-6. 17568 * .travis.yml (matrix): Add gcc-6 entries. 17569 * travis-build.sh: Handle gcc*. 17570 * travis-install.sh: Handle gcc-*. 17571 17572 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17573 17574 tests: robustify gen_tests.sh against in-tree builds. 17575 * tests/gen_tests.sh: Use abs_srcdir instead of srcdir to construct 17576 a path to gen_tests.sh in implicit make rules. 17577 17578 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17579 17580 trace_syscall_exiting: do not call get_regs for filtered syscalls. 17581 This saves up to 25% of ptrace syscalls in case of trace filtering. 17582 17583 * syscall.c (trace_syscall_exiting): Do not call gettimeofday 17584 and get_regs for filtered syscalls. 17585 * NEWS: Mention this change. 17586 * tests/get_regs.test: New test. 17587 * tests/Makefile.am (MISC_TESTS): Add it. 17588 17589 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17590 17591 Delay get_regs invocation. 17592 strace used to call get_regs on every stop of a tracee, including cases 17593 when the result is going to be discarded. Prepare to change this lavish 17594 practice by delaying get_regs invocation until its result is actually 17595 needed. 17596 17597 * defs.h (get_regs): Remove. 17598 * strace.c (trace): Do not call get_regs. 17599 * syscall.c (get_regs): Add static qualifier. 17600 (trace_syscall_exiting, print_pc, get_scno): Call get_regs. 17601 17602 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17603 17604 startup_tcb: move get_scno invocation to a more convenient place. 17605 * strace.c (trace): Move get_scno invocation ... 17606 (startup_tcb): ... here. This is a no-op change that slightly improves 17607 readability. 17608 17609 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17610 17611 get_regs: guard against subsequent invocations. 17612 At this moment there is only one call to get_regs, 17613 but there is going to be more of them, so a guard is needed. 17614 17615 This change also adds a clear_regs call before get_regs, 17616 which essentially reverts commit v4.9-288-ge9bfff6. 17617 17618 * strace.c (trace): Call clear_regs before get_regs. 17619 * syscall.c (get_regs): Skip if get_regs_error != -1. 17620 17621 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17622 17623 syscall: move definitions of automatic variables closer to their use. 17624 * syscall.c (trace_syscall_entering, trace_syscall_exiting): Move 17625 definitions of automatic variables closer to their first use. This 17626 change slightly improves readability. 17627 17628 tests: check decoding of gettid syscall. 17629 * tests/gettid.c: New file. 17630 * tests/.gitignore: Add gettid. 17631 * tests/Makefile.am (check_PROGRAMS): Likewise. 17632 * tests/gen_tests.in (gettid): New entry. 17633 17634 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17635 17636 tests: fix build on alpha. 17637 * tests/getpid.c: Skip if __NR_getpid is not defined. 17638 * tests/getppid.c: Skip if __NR_getppid is not defined. 17639 17640 Fixes: fd1041f6 ("tests: add tests for getpid and getppid syscalls") 17641 17642 2017-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 17643 17644 Fix build with old linux/netlink.h. 17645 * socketutils.c: Provide a fallback definition of NETLINK_SOCK_DIAG. 17646 17647 Fixes: 5c256356 ("Do not include xlat/netlink_protocols.h twice") 17648 17649 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 17650 17651 Do not include xlat/netlink_protocols.h twice. 17652 Make netlink_protocols a global xlat array defined in net.c file. 17653 17654 * defs.h (netlink_protocols): New prototype. 17655 * socketutils.c: Stop including "xlat/netlink_protocols.h". 17656 17657 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 17658 17659 Do not include xlat/clocknames.h twice. 17660 Make clocknames a global xlat array defined in time.c file. 17661 17662 * defs.h (clocknames): New prototype. 17663 * perf.c: Stop including "xlat/clocknames.h". 17664 17665 2017-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 17666 17667 Remove unused xlat/openmodessol.in. 17668 * xlat/openmodessol.in: Remove file unused since commit 17669 v4.10-45-gdf4dd8b. 17670 17671 Remove unused xlat/aclipc.in. 17672 * xlat/aclipc.in: Remove file unused since commit v4.9-46-g681452b. 17673 17674 2017-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 17675 17676 tests: remove statfs.expected. 17677 statfs.expected is unused since commit v4.11-515-g67c2f67. 17678 17679 * tests/statfs.expected: Remove. 17680 * tests/Makefile.am (EXTRA_DIST): Remove it. 17681 17682 2017-04-07 Sandhya Bankar <bankarsandhya512 (a] gmail.com> 17683 17684 tests: add tests for getpid and getppid syscalls. 17685 17686 [ldv: rewritten everything] 17687 17688 * tests/getpid.c: New file. 17689 * tests/getppid.c: Likewise. 17690 * tests/.gitignore: Add getpid and getppid. 17691 * tests/pure_executables.list: Likewise. 17692 * tests/Makefile.am (check_PROGRAMS): Likewise. 17693 * tests/gen_tests.in (getpid, getppid): New entries. 17694 17695 2017-04-07 Edgar Kaziahmedov <edos (a] linux.com> 17696 17697 Update V4L2_* constants. 17698 * xlat/v4l2_buf_flags.in: Add V4L2_BUF_FLAG_PREPARED, 17699 V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, and V4L2_BUF_FLAG_NO_CACHE_CLEAN 17700 introduced by linux kernel commit v3.2-rc1~63^2~55. 17701 Add V4L2_BUF_FLAG_TIMESTAMP_MASK, V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, 17702 and V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC introduced by linux kernel commit 17703 v3.9-rc1~93^2~536. 17704 Add V4L2_BUF_FLAG_TIMESTAMP_COPY introduced by linux kernel commit 17705 v3.10-rc1~136^2~560. 17706 Add V4L2_BUF_FLAG_TSTAMP_SRC_MASK, V4L2_BUF_FLAG_TSTAMP_SRC_EOF, 17707 and V4L2_BUF_FLAG_TSTAMP_SRC_SOE introduced by linux kernel commit 17708 v3.15-rc1~85^2~186. 17709 Add V4L2_BUF_FLAG_LAST introduced by linux kernel commit 17710 v4.2-rc1~107^2~389. 17711 * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_SDR_CAPTURE 17712 and V4L2_BUF_TYPE_SDR_OUTPUT introduced by linux kernel commits 17713 v3.15-rc1~85^2~213 and v4.4-rc1~118^2~14, respectively. 17714 * xlat/xlat/v4l2_colorspaces.in: Add V4L2_COLORSPACE_ADOBERGB 17715 and V4L2_COLORSPACE_BT2020 introduced by linux kernel commit 17716 v3.19-rc1~29^2~72. 17717 Add V4L2_COLORSPACE_RAW and V4L2_COLORSPACE_DCI_P3 introduced by linux 17718 kernel commits v4.2-rc1~107^2~182 and v4.4-rc1~118^2~120, respectively. 17719 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_SDR_CAPTURE, 17720 V4L2_CAP_EXT_PIX_FORMAT, and V4L2_CAP_SDR_OUTPUT introduced by linux 17721 kernel commits v3.15-rc1~85^2~210, v3.17-rc1~112^2~327, 17722 and v4.4-rc1~118^2~14, respectively. 17723 * xlat/v4l2_memories.in: Add V4L2_MEMORY_OVERLAY introduced 17724 in linux 2.5.46. Add V4L2_MEMORY_DMABUF introduced by linux kernel 17725 commit v3.8-rc1~115^2^2~52. 17726 17727 2017-04-07 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 17728 17729 Implement -e trace=%statfs option. 17730 linux/*/syscallent*.h part is modified automatically by: 17731 17732 sed -i 's/TF\(,[[:space:]]*SEN.*[_"]statv\?fs\)/TF|TSF\1/' \ 17733 linux/*/syscallent*.h 17734 17735 [ldv: rewritten trace_statfs.test using sched.test as a template] 17736 17737 * sysent.h (TRACE_STATFS): New macro. 17738 * syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion. 17739 * qualify.c (lookup_class): Add SCHED_STATFS for "%statfs". 17740 * strace.1 (.SS Filtering): Add information about %statfs syscall class. 17741 * NEWS: Mention this change. 17742 * linux/64/syscallent.h (statfs): Add TSF flag. 17743 * linux/aarch64/syscallent.h: Likewise. 17744 * linux/x32/syscallent.h: Likewise. 17745 * linux/x86_64/syscallent.h: Likewise. 17746 * linux/mips/syscallent-n64.h: Likewise. 17747 * linux/32/syscallent.h (statfs64): Likewise. 17748 * linux/arm/syscallent.h (statfs, statfs64): Likewise. 17749 * linux/avr32/syscallent.h: Likewise. 17750 * linux/bfin/syscallent.h: Likewise. 17751 * linux/crisv10/syscallent.h: Likewise. 17752 * linux/hppa/syscallent.h: Likewise. 17753 * linux/i386/syscallent.h: Likewise. 17754 * linux/ia64/syscallent.h: Likewise. 17755 * linux/m68k/syscallent.h: Likewise. 17756 * linux/microblaze/syscallent.h: Likewise. 17757 * linux/mips/syscallent-n32.h: Likewise. 17758 * linux/mips/syscallent-o32.h: Likewise. 17759 * linux/powerpc/syscallent.h: Likewise. 17760 * linux/powerpc64/syscallent.h: Likewise. 17761 * linux/s390/syscallent.h: Likewise. 17762 * linux/s390x/syscallent.h: Likewise. 17763 * linux/sh/syscallent.h: Likewise. 17764 * linux/sh64/syscallent.h: Likewise. 17765 * linux/sparc/syscallent.h: Likewise. 17766 * linux/sparc64/syscallent.h: Likewise. 17767 * linux/xtensa/syscallent.h: Likewise. 17768 * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs): Likewise. 17769 * linux/mips/syscallent-compat.h (*_statfs, *_statvfs): Likewise. 17770 * tests/trace_statfs.test: New test. 17771 * tests/Makefile.am (DECODER_TESTS): Add it. 17772 * tests/ksysent.c (TSF): New macro, defined to 0. 17773 * tests/nsyscalls.c: Likewise. 17774 17775 2017-04-06 Rishi Bhatt <bhatt.rishi062 (a] gmail.com> 17776 17777 Implement -e trace=%clock option. 17778 linux/*/syscallent.h part is modified automatically by 17779 sed -i 's/0\(,[[:space:]]*SEN(clock_\)/TCL\1/' linux/*/syscallent*.h 17780 17781 [ldv: rewritten clock.test using sched.test as a template] 17782 17783 * sysent.h (TRACE_CLOCK): New macro. 17784 * syscall.c: Alias TCL to TRACE_CLOCK around syscallent.h inclusion. 17785 * qualify.c (lookup_class): Add TRACE_CLOCK for "%clock". 17786 * strace.1 (.SS Filtering): Add information about %clock syscall class. 17787 * NEWS: Mention this change. 17788 * linux/32/syscallent.h: Add TCL flag for clock_* syscalls. 17789 * linux/64/syscallent.h: Likewise. 17790 * linux/alpha/syscallent.h: Likewise. 17791 * linux/arm/syscallent.h: Likewise. 17792 * linux/avr32/syscallent.h: Likewise. 17793 * linux/bfin/syscallent.h: Likewise. 17794 * linux/crisv10/syscallent.h: Likewise. 17795 * linux/hppa/syscallent.h: Likewise. 17796 * linux/i386/syscallent.h: Likewise. 17797 * linux/ia64/syscallent.h: Likewise. 17798 * linux/m68k/syscallent.h: Likewise. 17799 * linux/microblaze/syscallent.h: Likewise. 17800 * linux/mips/syscallent-n32.h: Likewise. 17801 * linux/mips/syscallent-n64.h: Likewise. 17802 * linux/mips/syscallent-o32.h: Likewise. 17803 * linux/powerpc/syscallent.h: Likewise. 17804 * linux/powerpc64/syscallent.h: Likewise. 17805 * linux/s390/syscallent.h: Likewise. 17806 * linux/s390x/syscallent.h: Likewise. 17807 * linux/sh/syscallent.h: Likewise. 17808 * linux/sh64/syscallent.h: Likewise. 17809 * linux/sparc/syscallent.h: Likewise. 17810 * linux/sparc64/syscallent.h: Likewise. 17811 * linux/x32/syscallent.h: Likewise. 17812 * linux/x86_64/syscallent.h: Likewise. 17813 * linux/xtensa/syscallent.h: Likewise. 17814 * tests/clock.test: New test. 17815 * tests/Makefile.am (DECODER_TESTS): Add it. 17816 * tests/ksysent.c (TCL): New macro, defined to 0. 17817 * tests/nsyscalls.c: Likewise. 17818 17819 2017-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 17820 17821 tests: tabulate xattr.test. 17822 * tests/gen_tests.in (xattr): New entry. 17823 * tests/xattr.test: Remove. 17824 * tests/Makefile.am (DECODER_TESTS): Remove xattr.test. 17825 17826 2017-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 17827 17828 tests: generalize scripts that check non-abbreviated decoding of ioctls. 17829 * tests/ioctl-v.sh: New file. 17830 * tests/Makefile.am (EXTRA_DIST): Add it. 17831 (DECODER_TESTS): Remove ioctl_evdev-v.test, ioctl_loop-v.test, 17832 and ioctl_rtc-v.test. 17833 * tests/gen_tests.in (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): 17834 New entries. 17835 * tests/ioctl_evdev-v.test: Remove. 17836 * tests/ioctl_loop-v.test: Ditto. 17837 * tests/ioctl_rtc-v.test: Ditto. 17838 17839 2017-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 17840 17841 tests: tabulate stereotypical test scripts. 17842 Convert test scripts that follow simple testing patterns to a table. 17843 Generate all these scripts from gen_tests.in file using gen_tests.sh 17844 script at bootstrap time. 17845 17846 The largest set of test scripts has been converted using 17847 the following command: 17848 17849 grep -l ^run_strace_match_diff *.test |while read f; do 17850 n="${f%.test}" 17851 grep '^[^#]' "$f" | 17852 grep -Evq '^(\. "\${srcdir=\.}/init\.sh"|run_strace_match_diff)' || 17853 sed -n 's/^run_strace_match_diff\(.*\)/'$n'\1/p' "$f" 17854 done 17855 17856 The second largest set of test scripts has been converted using 17857 the following command: 17858 17859 grep -l srcdir= *.test |while read f; do 17860 n="${f%.test}" 17861 grep '^[^#]' "$f" | 17862 grep -Fvq srcdir= || 17863 sed -n 's/^. "\${srcdir=.}\/\([^"]\+\)".*/'$n'\t+\1/p' "$f" 17864 done 17865 17866 * tests/gen_tests.in: New file. 17867 * tests/gen_tests.sh: New file. 17868 * bootstrap: Invoke it. 17869 * tests/.gitignore: Add *.gen.test and gen_tests.am. 17870 * tests/_newselect.test: Remove. 17871 * tests/accept.test: Ditto. 17872 * tests/accept4.test: Ditto. 17873 * tests/access.test: Ditto. 17874 * tests/acct.test: Ditto. 17875 * tests/add_key.test: Ditto. 17876 * tests/adjtimex.test: Ditto. 17877 * tests/aio.test: Ditto. 17878 * tests/alarm.test: Ditto. 17879 * tests/bpf.test: Ditto. 17880 * tests/btrfs.test: Ditto. 17881 * tests/chmod.test: Ditto. 17882 * tests/chown.test: Ditto. 17883 * tests/chown32.test: Ditto. 17884 * tests/chroot.test: Ditto. 17885 * tests/clock_adjtime.test: Ditto. 17886 * tests/clock_nanosleep.test: Ditto. 17887 * tests/clock_xettime.test: Ditto. 17888 * tests/copy_file_range.test: Ditto. 17889 * tests/creat.test: Ditto. 17890 * tests/delete_module.test: Ditto. 17891 * tests/dup.test: Ditto. 17892 * tests/dup2.test: Ditto. 17893 * tests/dup3.test: Ditto. 17894 * tests/epoll_create.test: Ditto. 17895 * tests/epoll_create1.test: Ditto. 17896 * tests/epoll_ctl.test: Ditto. 17897 * tests/epoll_pwait.test: Ditto. 17898 * tests/epoll_wait.test: Ditto. 17899 * tests/erestartsys.test: Ditto. 17900 * tests/execveat-v.test: Ditto. 17901 * tests/execveat.test: Ditto. 17902 * tests/faccessat.test: Ditto. 17903 * tests/fadvise64_64.test: Ditto. 17904 * tests/fallocate.test: Ditto. 17905 * tests/fanotify_init.test: Ditto. 17906 * tests/fanotify_mark.test: Ditto. 17907 * tests/fchdir.test: Ditto. 17908 * tests/fchmod.test: Ditto. 17909 * tests/fchmodat.test: Ditto. 17910 * tests/fchown.test: Ditto. 17911 * tests/fchown32.test: Ditto. 17912 * tests/fchownat.test: Ditto. 17913 * tests/fcntl.test: Ditto. 17914 * tests/fcntl64.test: Ditto. 17915 * tests/fdatasync.test: Ditto. 17916 * tests/file_handle.test: Ditto. 17917 * tests/file_ioctl.test: Ditto. 17918 * tests/finit_module.test: Ditto. 17919 * tests/flock.test: Ditto. 17920 * tests/fork-f.test: Ditto. 17921 * tests/fstat64.test: Ditto. 17922 * tests/fstatat64.test: Ditto. 17923 * tests/fstatfs.test: Ditto. 17924 * tests/fstatfs64.test: Ditto. 17925 * tests/fsync.test: Ditto. 17926 * tests/ftruncate.test: Ditto. 17927 * tests/ftruncate64.test: Ditto. 17928 * tests/futimesat.test: Ditto. 17929 * tests/get_mempolicy.test: Ditto. 17930 * tests/getcpu.test: Ditto. 17931 * tests/getcwd.test: Ditto. 17932 * tests/getdents.test: Ditto. 17933 * tests/getdents64.test: Ditto. 17934 * tests/getegid.test: Ditto. 17935 * tests/getegid32.test: Ditto. 17936 * tests/geteuid.test: Ditto. 17937 * tests/geteuid32.test: Ditto. 17938 * tests/getgid.test: Ditto. 17939 * tests/getgid32.test: Ditto. 17940 * tests/getgroups.test: Ditto. 17941 * tests/getgroups32.test: Ditto. 17942 * tests/getpeername.test: Ditto. 17943 * tests/getpgrp.test: Ditto. 17944 * tests/getrandom.test: Ditto. 17945 * tests/getresgid.test: Ditto. 17946 * tests/getresgid32.test: Ditto. 17947 * tests/getresuid.test: Ditto. 17948 * tests/getresuid32.test: Ditto. 17949 * tests/getrlimit.test: Ditto. 17950 * tests/getrusage.test: Ditto. 17951 * tests/getsid.test: Ditto. 17952 * tests/getsockname.test: Ditto. 17953 * tests/getuid32.test: Ditto. 17954 * tests/getxxid.test: Ditto. 17955 * tests/inet-cmsg.test: Ditto. 17956 * tests/init_module.test: Ditto. 17957 * tests/inotify.test: Ditto. 17958 * tests/inotify_init1.test: Ditto. 17959 * tests/int_0x80.test: Ditto. 17960 * tests/ioctl_block.test: Ditto. 17961 * tests/ioctl_evdev.test: Ditto. 17962 * tests/ioctl_loop.test: Ditto. 17963 * tests/ioctl_mtd.test: Ditto. 17964 * tests/ioctl_rtc.test: Ditto. 17965 * tests/ioctl_scsi.test: Ditto. 17966 * tests/ioctl_sg_io_v3.test: Ditto. 17967 * tests/ioctl_sg_io_v4.test: Ditto. 17968 * tests/ioctl_uffdio.test: Ditto. 17969 * tests/ioctl_v4l2.test: Ditto. 17970 * tests/ioperm.test: Ditto. 17971 * tests/iopl.test: Ditto. 17972 * tests/ioprio.test: Ditto. 17973 * tests/ip_mreq.test: Ditto. 17974 * tests/ipc.test: Ditto. 17975 * tests/ipc_msg.test: Ditto. 17976 * tests/ipc_sem.test: Ditto. 17977 * tests/ipc_shm.test: Ditto. 17978 * tests/kcmp.test: Ditto. 17979 * tests/kexec_file_load.test: Ditto. 17980 * tests/kexec_load.test: Ditto. 17981 * tests/keyctl.test: Ditto. 17982 * tests/kill.test: Ditto. 17983 * tests/lchown.test: Ditto. 17984 * tests/lchown32.test: Ditto. 17985 * tests/link.test: Ditto. 17986 * tests/linkat.test: Ditto. 17987 * tests/lookup_dcookie.test: Ditto. 17988 * tests/lstat.test: Ditto. 17989 * tests/lstat64.test: Ditto. 17990 * tests/mbind.test: Ditto. 17991 * tests/membarrier.test: Ditto. 17992 * tests/memfd_create.test: Ditto. 17993 * tests/migrate_pages.test: Ditto. 17994 * tests/mincore.test: Ditto. 17995 * tests/mkdir.test: Ditto. 17996 * tests/mkdirat.test: Ditto. 17997 * tests/mknod.test: Ditto. 17998 * tests/mknodat.test: Ditto. 17999 * tests/mlock.test: Ditto. 18000 * tests/mlock2.test: Ditto. 18001 * tests/mlockall.test: Ditto. 18002 * tests/mmap64.test: Ditto. 18003 * tests/mmsg-silent.test: Ditto. 18004 * tests/mmsg.test: Ditto. 18005 * tests/mmsg_name-v.test: Ditto. 18006 * tests/mmsg_name.test: Ditto. 18007 * tests/mount.test: Ditto. 18008 * tests/move_pages.test: Ditto. 18009 * tests/mq.test: Ditto. 18010 * tests/mq_sendrecv-read.test: Ditto. 18011 * tests/mq_sendrecv-write.test: Ditto. 18012 * tests/mq_sendrecv.test: Ditto. 18013 * tests/msg_control-v.test: Ditto. 18014 * tests/msg_control.test: Ditto. 18015 * tests/msg_name.test: Ditto. 18016 * tests/munlockall.test: Ditto. 18017 * tests/nanosleep.test: Ditto. 18018 * tests/net-icmp_filter.test: Ditto. 18019 * tests/net-sockaddr.test: Ditto. 18020 * tests/newfstatat.test: Ditto. 18021 * tests/old_mmap.test: Ditto. 18022 * tests/oldfstat.test: Ditto. 18023 * tests/oldlstat.test: Ditto. 18024 * tests/oldstat.test: Ditto. 18025 * tests/open.test: Ditto. 18026 * tests/openat.test: Ditto. 18027 * tests/pause.test: Ditto. 18028 * tests/perf_event_open.test: Ditto. 18029 * tests/perf_event_open_nonverbose.test: Ditto. 18030 * tests/perf_event_open_unabbrev.test: Ditto. 18031 * tests/pipe2.test: Ditto. 18032 * tests/pkey_alloc.test: Ditto. 18033 * tests/pkey_free.test: Ditto. 18034 * tests/pkey_mprotect.test: Ditto. 18035 * tests/ppoll-v.test: Ditto. 18036 * tests/ppoll.test: Ditto. 18037 * tests/preadv-pwritev.test: Ditto. 18038 * tests/preadv.test: Ditto. 18039 * tests/preadv2-pwritev2.test: Ditto. 18040 * tests/printstr.test: Ditto. 18041 * tests/prlimit64.test: Ditto. 18042 * tests/process_vm_readv.test: Ditto. 18043 * tests/process_vm_writev.test: Ditto. 18044 * tests/pselect6.test: Ditto. 18045 * tests/ptrace.test: Ditto. 18046 * tests/pwritev.test: Ditto. 18047 * tests/quotactl-v.test: Ditto. 18048 * tests/quotactl-xfs-v.test: Ditto. 18049 * tests/quotactl-xfs.test: Ditto. 18050 * tests/quotactl.test: Ditto. 18051 * tests/readahead.test: Ditto. 18052 * tests/readdir.test: Ditto. 18053 * tests/readlink.test: Ditto. 18054 * tests/readlinkat.test: Ditto. 18055 * tests/reboot.test: Ditto. 18056 * tests/recvfrom.test: Ditto. 18057 * tests/recvmmsg-timeout.test: Ditto. 18058 * tests/recvmsg.test: Ditto. 18059 * tests/remap_file_pages.test: Ditto. 18060 * tests/rename.test: Ditto. 18061 * tests/renameat.test: Ditto. 18062 * tests/renameat2.test: Ditto. 18063 * tests/request_key.test: Ditto. 18064 * tests/rmdir.test: Ditto. 18065 * tests/rt_sigpending.test: Ditto. 18066 * tests/rt_sigprocmask.test: Ditto. 18067 * tests/rt_sigqueueinfo.test: Ditto. 18068 * tests/rt_sigreturn.test: Ditto. 18069 * tests/rt_sigsuspend.test: Ditto. 18070 * tests/rt_sigtimedwait.test: Ditto. 18071 * tests/rt_tgsigqueueinfo.test: Ditto. 18072 * tests/sched_get_priority_mxx.test: Ditto. 18073 * tests/sched_rr_get_interval.test: Ditto. 18074 * tests/sched_xetaffinity.test: Ditto. 18075 * tests/sched_xetattr.test: Ditto. 18076 * tests/sched_xetparam.test: Ditto. 18077 * tests/sched_xetscheduler.test: Ditto. 18078 * tests/sched_yield.test: Ditto. 18079 * tests/seccomp-filter-v.test: Ditto. 18080 * tests/seccomp-filter.test: Ditto. 18081 * tests/select.test: Ditto. 18082 * tests/semop.test: Ditto. 18083 * tests/sendfile.test: Ditto. 18084 * tests/sendfile64.test: Ditto. 18085 * tests/set_mempolicy.test: Ditto. 18086 * tests/setdomainname.test: Ditto. 18087 * tests/setfsgid.test: Ditto. 18088 * tests/setfsgid32.test: Ditto. 18089 * tests/setfsuid.test: Ditto. 18090 * tests/setfsuid32.test: Ditto. 18091 * tests/setgid.test: Ditto. 18092 * tests/setgid32.test: Ditto. 18093 * tests/setgroups.test: Ditto. 18094 * tests/setgroups32.test: Ditto. 18095 * tests/sethostname.test: Ditto. 18096 * tests/setns.test: Ditto. 18097 * tests/setregid.test: Ditto. 18098 * tests/setregid32.test: Ditto. 18099 * tests/setresgid.test: Ditto. 18100 * tests/setresgid32.test: Ditto. 18101 * tests/setresuid.test: Ditto. 18102 * tests/setresuid32.test: Ditto. 18103 * tests/setreuid.test: Ditto. 18104 * tests/setreuid32.test: Ditto. 18105 * tests/setrlimit.test: Ditto. 18106 * tests/setuid.test: Ditto. 18107 * tests/setuid32.test: Ditto. 18108 * tests/shutdown.test: Ditto. 18109 * tests/siginfo.test: Ditto. 18110 * tests/signal_receive.test: Ditto. 18111 * tests/signalfd4.test: Ditto. 18112 * tests/sigreturn.test: Ditto. 18113 * tests/socketcall.test: Ditto. 18114 * tests/splice.test: Ditto. 18115 * tests/stat.test: Ditto. 18116 * tests/stat64.test: Ditto. 18117 * tests/statfs64.test: Ditto. 18118 * tests/statx.sh: Ditto. 18119 * tests/statx.test: Ditto. 18120 * tests/swap.test: Ditto. 18121 * tests/symlink.test: Ditto. 18122 * tests/symlinkat.test: Ditto. 18123 * tests/sync.test: Ditto. 18124 * tests/sync_file_range.test: Ditto. 18125 * tests/sync_file_range2.test: Ditto. 18126 * tests/sysinfo.test: Ditto. 18127 * tests/syslog.test: Ditto. 18128 * tests/tee.test: Ditto. 18129 * tests/time.test: Ditto. 18130 * tests/timer_create.test: Ditto. 18131 * tests/timer_xettime.test: Ditto. 18132 * tests/timerfd_xettime.test: Ditto. 18133 * tests/times-fail.test: Ditto. 18134 * tests/times.test: Ditto. 18135 * tests/truncate.test: Ditto. 18136 * tests/truncate64.test: Ditto. 18137 * tests/ugetrlimit.test: Ditto. 18138 * tests/umask.test: Ditto. 18139 * tests/umoven-illptr.test: Ditto. 18140 * tests/umovestr-illptr.test: Ditto. 18141 * tests/umovestr3.test: Ditto. 18142 * tests/unlink.test: Ditto. 18143 * tests/unlinkat.test: Ditto. 18144 * tests/unshare.test: Ditto. 18145 * tests/userfaultfd.test: Ditto. 18146 * tests/ustat.test: Ditto. 18147 * tests/utime.test: Ditto. 18148 * tests/utimes.test: Ditto. 18149 * tests/vfork-f.test: Ditto. 18150 * tests/vhangup.test: Ditto. 18151 * tests/vmsplice.test: Ditto. 18152 * tests/wait4-v.test: Ditto. 18153 * tests/wait4.test: Ditto. 18154 * tests/waitid-v.test: Ditto. 18155 * tests/waitid.test: Ditto. 18156 * tests/waitpid.test: Ditto. 18157 * tests/xattr-strings.test: Ditto. 18158 * tests/xet_robust_list.test: Ditto. 18159 * tests/xetitimer.test: Ditto. 18160 * tests/xetpgid.test: Ditto. 18161 * tests/xetpriority.test: Ditto. 18162 * tests/xettimeofday.test: Ditto. 18163 * tests/Makefile.am (DECODER_TESTS, MISC_TESTS): Remove them. 18164 Include gen_tests.am. 18165 (TESTS): Add $(GEN_TESTS). 18166 (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Rename int_0x80.test 18167 to int_0x80.gen.test. 18168 (EXTRA_DIST): Add gen_tests.in and gen_tests.sh, remove statx.sh. 18169 (clean-local-check): Remove $(GEN_TESTS:.gen.test=.dir). 18170 18171 2017-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 18172 18173 tests: handle test scripts with .gen.test suffix. 18174 * tests/init.sh: If script name ends with .gen.test, 18175 set NAME variable with .gen.test suffix stripped. 18176 18177 2017-04-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18178 18179 mpers.awk: add support for multidimensional arrays. 18180 * mpers.awk (update_upper_bound): New function, which maintains new "count" 18181 property for storing total element count and updates "upper_bound" 18182 property which now contains string with array dimensions. 18183 (/^DW_AT_upper_bound/, /^DW_AT_count/): Use it. 18184 (what_is) <case "array_type">: Use "count" property in order to calculate 18185 returned_size, do not embody returned string in square brackets. 18186 * mpers_test.sh: Add checks for multidimensional arrays. 18187 18188 2017-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 18189 18190 mpers.awk: prepare for adding support of multidimensional arrays. 18191 * mpers.awk (what_is) <case "structure_type", case "union_type">: 18192 Move formatting of array upper_bound ... 18193 <case "array_type">: ... here. 18194 18195 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18196 18197 tests: cleanup temporary files removals. 18198 As every test now runs in its own subdirectory, there is no need 18199 to remove leftover files manually by each test. 18200 18201 * tests/init.sh (run_strace_match_diff): Do not remove $EXP. 18202 * tests/brk.test: Likewise. 18203 * tests/options-syntax.test: Likewise. 18204 * tests/qual_inject-retval.test (check_injection): Likewise. 18205 * tests/qual_signal.test (test_one_sig): Likewise. 18206 * tests/sched.test: Likewise. 18207 * tests/seccomp-strict.test: Likewise. 18208 * tests/strace-V.test: Likewise. 18209 * tests/strace-tt.test: Likewise. 18210 * tests/strace-ttt.test: Likewise. 18211 * tests/threads-execve.test: Likewise. 18212 * tests/attach-f-p.test: Use $EXP instead of $OUT, do not remove it. 18213 * tests/personality.test: Likewise. 18214 * tests/poll.test: Likewise. 18215 * tests/fstat.test: Likewise. 18216 * tests/ipc.sh: Likewise. 18217 * tests/restart_syscall.test: Likewise. 18218 * tests/utimensat.test: Likewise. 18219 * tests/attach-p-cmd.test: Likewise. Do not remove 18220 attach-p-cmd.test-lock. 18221 * tests/detach-running.test: Do not remove $LOG. 18222 * tests/detach-sleeping.test: Likewise. 18223 * tests/detach-stopped.test: Likewise. 18224 * tests/redirect.test: Do not remove $OUT. 18225 * tests/strace-S.test: Likewise. 18226 * tests/getdents.test: Do not remove $LOG.dir. 18227 * tests/getdents64.test: Likewise. 18228 * tests/readdir.test: Likewise. 18229 * tests/btrfs-v.test: Do not remove $EXP and $OUT. 18230 * tests/btrfs-vw.test: Likewise. 18231 * tests/btrfs-w.test: Likewise. 18232 * tests/execve-v.test: Likewise. 18233 * tests/execve.test: Likewise. 18234 * tests/fadvise64.test: Likewise. 18235 * tests/getuid.test: Likewise. 18236 * tests/ioctl.test: Likewise. 18237 * tests/ioctl_dm-v.test: Likewise. 18238 * tests/ioctl_dm.test: Likewise. 18239 * tests/ioctl_evdev-v.test: Likewise. 18240 * tests/ioctl_loop-nv.test: Likewise. 18241 * tests/ioctl_loop-v.test: Likewise. 18242 * tests/ioctl_loop.test: Likewise. 18243 * tests/ioctl_rtc-v.test: Likewise. 18244 * tests/ioctl_sock_gifconf.test: Likewise. 18245 * tests/llseek.test: Likewise. 18246 * tests/lseek.test: Likewise. 18247 * tests/mmap.test: Likewise. 18248 * tests/net-y-unix.test: Likewise. 18249 * tests/net-yy-inet.test: Likewise. 18250 * tests/net-yy-netlink.test: Likewise. 18251 * tests/net-yy-unix.test: Likewise. 18252 * tests/opipe.test: Likewise. 18253 * tests/prctl-arg2-intptr.test: Likewise. 18254 * tests/prctl-dumpable.test: Likewise. 18255 * tests/prctl-name.test: Likewise. 18256 * tests/prctl-no-args.test: Likewise. 18257 * tests/prctl-pdeathsig.test: Likewise. 18258 * tests/prctl-seccomp-filter-v.test: Likewise. 18259 * tests/prctl-seccomp-strict.test: Likewise. 18260 * tests/prctl-securebits.test: Likewise. 18261 * tests/prctl-tid_address.test: Likewise. 18262 * tests/prctl-tsc.test: Likewise. 18263 * tests/umovestr2.test: Likewise. 18264 * tests/uname.test: Likewise. 18265 * tests/pread64-pwrite64.test: Do nore remove pread64-pwrite64-tmpfile. 18266 * tests/read-write.test: Do nore remove read-write-tmpfile. 18267 * tests/qual_fault.test (check_fault_injection): Do not remove $EXP, 18268 $outexp, and $outgot. 18269 * tests/redirect-fds.test (check_fd): Reorder removal of work files. 18270 * tests/pc.test: Use $EXP instead of $EXPECTED, do not remove it. 18271 * tests/strace-t.test: Likewise. 18272 * tests/scm_rights-fd.test: Likewise. Use dir instead of $LOG.dir, 18273 do not remove it. 18274 * tests/strace-ff.test: Do not remove $OUT and $LOG.* files. 18275 18276 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18277 18278 tests: enhance sched.test negative check. 18279 * tests/sched.test: Test that trace=%sched doesn't match 18280 anything besides sched_* syscalls by checking it against all test 18281 executables without side effects listed in pure_executables.list 18282 except sched_* and times. 18283 18284 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18285 18286 tests: add a list of executables without side effects. 18287 These are executables that could be used by several different tests 18288 simultaneously. 18289 18290 * tests/pure_executables.list: New file. 18291 * tests/Makefile.am (EXTRA_DIST): Add it. 18292 18293 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18294 18295 tests: use fixed socket address in net-yy-unix.test. 18296 This allows net-yy-unix invocation without arguments. 18297 18298 * tests/net-yy-unix.c (TEST_SOCKET): New macro. 18299 (void): Use it instead of av[1]. 18300 * tests/net-yy-unix.test: Do not specify arguments for the test 18301 executable. 18302 18303 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18304 18305 tests: use fixed socket address in net-y-unix.test. 18306 This allows net-y-unix invocation without arguments. 18307 18308 * tests/net-y-unix.c (TEST_SOCKET): New macro. 18309 (void): Use it instead of av[1]. 18310 * tests/net-y-unix.test: Do not specify arguments for the test 18311 executable. 18312 18313 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18314 18315 tests: run every test except ksysent.test in its own subdirectory. 18316 Many test executables create temporary files in the current work 18317 directory for the duration of their execution. 18318 This level of test isolation allows more test executables to be invoked 18319 several times simultaneously. 18320 18321 * tests/.gitignore: Add *.dir, remove *.log.*, *.tmp, *.tmp-*, 18322 and *.tmp.* patterns. 18323 * tests/Makefile.am (clean-local, clean-local-check): New rules. 18324 (.PHONY): Add clean-local-check. 18325 (CLEANFILES): Remove all but ksysent.h. 18326 * tests/init.sh: Strip test-specific prefix from LOG, OUT, and EXP 18327 variables. When invoked from a test, create a new test-specific 18328 directory, chdir into it, and add more ../ prefix to STRACE variable. 18329 (run_prog): Replace "./" with "../". 18330 * tests/attach-f-p.test: Replace "./" with "../". 18331 * tests/attach-p-cmd.test: Likewise. 18332 * tests/bexecve.test: Likewise. 18333 * tests/btrfs-v.test: Likewise. 18334 * tests/btrfs-vw.test: Likewise. 18335 * tests/btrfs-w.test: Likewise. 18336 * tests/count.test: Likewise. 18337 * tests/detach-running.test: Likewise. 18338 * tests/detach-sleeping.test: Likewise. 18339 * tests/detach-stopped.test: Likewise. 18340 * tests/mmap.test: Likewise. 18341 * tests/net-y-unix.test: Likewise. 18342 * tests/net-yy-inet.test: Likewise. 18343 * tests/net-yy-netlink.test: Likewise. 18344 * tests/net-yy-unix.test: Likewise. 18345 * tests/net.test: Likewise. 18346 * tests/opipe.test: Likewise. 18347 * tests/poll.test: Likewise. 18348 * tests/prctl-seccomp-strict.test: Likewise. 18349 * tests/qual_fault-exit_group.test: Likewise. 18350 * tests/qual_fault.test: Likewise. 18351 * tests/qual_inject-error-signal.test: Likewise. 18352 * tests/qual_inject-retval.test: Likewise. 18353 * tests/qual_inject-signal.test: Likewise. 18354 * tests/qual_signal.test: Likewise. 18355 * tests/qual_syscall.test: Likewise. 18356 * tests/readv.test: Likewise. 18357 * tests/redirect-fds.test: Likewise. 18358 * tests/sched.test: Likewise. 18359 * tests/scm_rights-fd.test: Likewise. 18360 * tests/seccomp-strict.test: Likewise. 18361 * tests/strace-C.test: Likewise. 18362 * tests/strace-E.expected: Likewise. 18363 * tests/strace-E.test: Likewise. 18364 * tests/strace-S.test: Likewise. 18365 * tests/strace-T.test: Likewise. 18366 * tests/strace-V.test: Likewise. 18367 * tests/strace-ff.test: Likewise. 18368 * tests/strace-k.test: Likewise. 18369 * tests/strace-r.expected: Likewise. 18370 * tests/strace-r.test: Likewise. 18371 * tests/strace-t.test: Likewise. 18372 * tests/strace-tt.test: Likewise. 18373 * tests/strace-ttt.test: Likewise. 18374 * tests/sun_path.test: Likewise. 18375 * tests/uname.test: Likewise. 18376 * tests/unix-pair-send-recv.test: Likewise. 18377 * tests/unix-pair-sendto-recvfrom.test: Likewise. 18378 18379 2017-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 18380 18381 tests: make test executables invocable outside current work directory. 18382 Most of test executables were ready for the upcoming change, 18383 this change prepares all the rest. 18384 18385 * tests/getdents.c (main): Use fixed name for the sample directory. 18386 * tests/getdents64.c (main): Likewise. 18387 * tests/readdir.c (main): Likewise. 18388 * tests/mknod.c (sample): Change to a pointer. 18389 (main): Use av[0] as a sample. 18390 * tests/symlink.c (main): Use av[0] as a linkpath. 18391 * tests/umode_t.c (sample): Change to a pointer. 18392 (test_syscall): Fix expected output. 18393 (main): Use av[0] as a sample. 18394 18395 2017-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 18396 18397 tests: cleanup access.test. 18398 * tests/access.test: Use run_strace_match_diff. 18399 * tests/access.c (main): Update expected output. 18400 18401 2017-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 18402 18403 tests: cleanup oldfstat.test. 18404 * tests/oldfstat.test: Use fstat.test. 18405 18406 2017-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 18407 18408 aarch64: workaround gcc+kernel bug. 18409 Due to a subtle gcc bug that leads to miscompiled aarch64 kernels, 18410 the 3rd argument of sched_getattr syscall is not quite 32-bit 18411 on aarch64 as on other architectures. For more details see 18412 https://sourceforge.net/p/strace/mailman/message/35721703/ 18413 18414 * defs.h (print_abnormal_hi): New prototype. 18415 * util.c (print_abnormal_hi): New function. 18416 * sched.c (SYS_FUNC(sched_getattr)) [AARCH64]: Use it. 18417 * tests/sched_xetattr.c (main) [__arm64__ || __aarch64__]: Test it. 18418 18419 2017-03-29 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 18420 18421 alpha, mips: fix missing flags in stat related compatibility syscalls. 18422 Following commands do the fix: 18423 18424 Add TF flag, fixed by: 18425 git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ 18426 's/0\(,[[:space:]]*SEN(.*_l\?stat[^i]\)/TF\1/' 18427 18428 Add TD flag, fixed by: 18429 git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ 18430 's/0\(,[[:space:]]*SEN(.*_fstat\)/TD\1/' 18431 18432 * linux/alpha/syscallent.h: Add TF and TD flags to stat related 18433 compat syscall entries. 18434 * linux/mips/syscallent-compat.h: Likewise. 18435 18436 2017-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 18437 18438 alpha: fix the number of arguments in alpha specific syscalls. 18439 * linux/alpha/syscallent.h (getxgid, osf_stat, osf_lstat, osf_fstat, 18440 osf_sysinfo, sethae): Set nargs according to arch/alpha/kernel/osf_sys.c 18441 from linux v4.10. 18442 18443 alpha: update comments about not implemented syscalls. 18444 * linux/alpha/syscallent.h: Sync "not implemented" comments 18445 with arch/alpha/kernel/systbls.S from linux v4.10. 18446 18447 2017-03-23 Quentin Monnet <quentin.monnet (a] 6wind.com> 18448 18449 Update BPF_MAP_TYPE_* constants. 18450 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_ARRAY_OF_MAPS 18451 and BPF_MAP_TYPE_HASH_OF_MAPS constants. 18452 18453 2017-03-23 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 18454 18455 Update ioctl entries from linux v4.11-rc3. 18456 * linux/32/ioctls_inc_align16.h: Update from linux v4.11-rc3 using ioctls_gen.sh. 18457 * linux/32/ioctls_inc_align32.h: Likewise. 18458 * linux/32/ioctls_inc_align64.h: Likewise. 18459 * linux/64/ioctls_inc.h: Likewise. 18460 * linux/x32/ioctls_inc0.h: Likewise. 18461 * linux/arm/ioctls_arch0.h: Likewise. 18462 * linux/i386/ioctls_arch0.h: Likewise. 18463 * linux/powerpc/ioctls_arch0.h: Likewise. 18464 * linux/s390/ioctls_arch0.h: Likewise. 18465 * linux/s390x/ioctls_arch0.h: Likewise. 18466 * linux/x86_64/ioctls_arch0.h: Likewise. 18467 * NEWS: Mention this. 18468 18469 maint: update for linux 4.11. 18470 * maint/ioctls_sym.sh (ppc_list): Add KVM_PPC_GET_RMMU_INFO 18471 and KVM_PPC_CONFIGURE_V3_MMU. 18472 18473 2017-03-19 Dmitry V. Levin <ldv (a] altlinux.org> 18474 18475 test: rename README to README.md. 18476 * test/README: Rename to README.md, turn ../tests reference into an URL. 18477 18478 test: update README. 18479 * test/README: Tell the reader what this directory is actually for. 18480 18481 test: rewrite skodic.c demo. 18482 * test/skodic.c: Rewrite this demo to simplify its use. 18483 18484 2017-03-18 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 18485 18486 Implement decoding of statx syscall. 18487 * linux/i386/syscallent.h [383]: Add statx entry. 18488 * linux/x32/syscallent.h [332]: Likewise. 18489 * linux/x86_64/syscallent.h [332]: Likewise. 18490 * pathtrace.c (pathtrace_match): Handle SEN_statx. 18491 * statx.c: New file. 18492 * statx.h: Likewise. 18493 * Makefile.am (strace_SOURCES): Add them. 18494 * tests/.gitignore: Add statx. 18495 * tests/Makefile.am (check_PROGRAMS): Likewise. 18496 (DECODER_TESTS): Add statx.test. 18497 * tests/statx.c: New file. 18498 * tests/statx.test: Likewise. 18499 * tests/xstatx.c: Modify to support statx. 18500 * xlat/at_statx_sync_types.in: New file. 18501 * xlat/statx_attrs.in: Likewise. 18502 * xlat/statx_masks.in: Likewise. 18503 * NEWS: Mention this change. 18504 18505 2017-03-17 Dmitry V. Levin <ldv (a] altlinux.org> 18506 18507 tests: check for out of bounds fetch in parsers of stat family syscalls. 18508 * tests/xstatx.c (main): Create STRUCT_STAT object using 18509 TAIL_ALLOC_OBJECT_CONST_PTR. 18510 18511 tests: check unexpected syscall errors returned by stat family syscalls. 18512 * tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test 18513 in case of EOVERFLOW. 18514 Treat errors other than ENOSYS and EOVERFLOW as fatal. 18515 18516 2017-03-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18517 18518 tests: move try_run_prog to init.sh. 18519 Looks like try_run_prog may be of general use by other syscall class 18520 tests. 18521 18522 * tests/sched.test (try_run_prog): Move it... 18523 * tests/init: ... here. 18524 18525 2017-03-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18526 18527 tests/sched.test: rc should be a local variable in try_run_prog. 18528 * tests/sched.test (try_run_prog): Add local rc. 18529 18530 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 18531 18532 tests: check decoding of int 0x80 on x86_64, x32, and x86. 18533 * tests/int_0x80.c: New file. 18534 * tests/int_0x80.test: New test. 18535 * tests/.gitignore: Add int_0x80. 18536 * tests/Makefile.am (check_PROGRAMS): Likewise. 18537 (MISC_TESTS, XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Add int_0x80.test. 18538 (XFAIL_TESTS): Add $(XFAIL_TESTS_$(ARCH)). 18539 (CLEANFILES): Add $(TESTS:=.tmp.out) and $(TESTS:=.tmp.exp). 18540 18541 2017-03-16 Damien Profeta <damien.profeta (a] amadeus.com> 18542 18543 strace-graph: handle pid looping. 18544 * strace-graph: On long running process or heavily forking one (like 18545 compilation), it can happen that a parent get 2 different children with 18546 the same pid. By tracking the currently runnig pid and adding the start 18547 timestamp to the pid, the graph can now handle that case. 18548 18549 Closes: https://github.com/strace/strace/pull/7 18550 18551 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 18552 18553 tests: use TAIL_ALLOC_OBJECT_CONST_PTR. 18554 Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro 18555 with the following sed expression: 18556 18557 sed -ri \ 18558 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \ 18559 tests/*.c 18560 18561 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 18562 18563 tests: use TAIL_ALLOC_OBJECT_VAR_PTR. 18564 Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro 18565 with the following sed expression: 18566 18567 sed -ri \ 18568 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \ 18569 tests/{move_pages,net-sockaddr,sendfile}.c 18570 18571 2017-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 18572 18573 tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h. 18574 Introduce a new macros for the most widespread use of tail_alloc. 18575 18576 * tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR, 18577 TAIL_ALLOC_OBJECT_VAR_PTR): New macros. 18578 18579 2017-03-16 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 18580 18581 Decode RUSAGE_THREAD. 18582 * xlat/usagewho.in: Add values for existing entities, add 18583 RUSAGE_THREAD. 18584 * tests/getrusage.c: Test decoding of RUSAGE_THREAD. 18585 18586 2017-03-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18587 18588 tests/sched.test: use heredoc in order to avoid spawning of subprocess. 18589 Pipelined commands executed in subprocesses (some shells have special 18590 provision for last command in the pipeline, but it is not guaranteed 18591 and not POSIX), so exit codes of these subprocesses can be lost. 18592 In order to avoid creating subprocesses, input for read commands 18593 is better to supply via heredoc and not pipe. 18594 18595 * tests/sched.test: Move test cases to heredoc. 18596 18597 2017-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 18598 18599 tests: do not skip sched.test if one of its subtests skips. 18600 * tests/sched.test (try_run_prog): New function. 18601 Use it instead of run_prog. 18602 18603 2017-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 18604 18605 tests: do not check decoding of setitimer syscall outside xetitimer.test 18606 xetitimer.test already implements a comprehensive test of setitimer 18607 syscall parser, no need to duplicate its parts in other tests. 18608 18609 * tests/clock_nanosleep.c (main): Remove setitimer expected output. 18610 * tests/nanosleep.c (main): Likewise. 18611 * tests/clock_nanosleep.test: Remove setitimer from the trace set. 18612 * tests/nanosleep.test: Likewise. 18613 18614 2017-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 18615 18616 tests: check decoding of getitimer and setitimer corner cases. 18617 * tests/sched_xetattr.c: Include <unistd.h> and <asm/unistd.h>. 18618 (main): Check that pointer and integer arguments of getitimer 18619 and setitimer syscalls are decoded properly. 18620 * tests/xetitimer.test: Add -a option. 18621 18622 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18623 18624 tests: rewrite sigreturn syscall decoding check from match_grep to match_diff 18625 Unlike the former test that was based on match_grep, 18626 the new one uses match_diff and does more rigorous testing. 18627 18628 * tests/sigreturn.c: Rewrite. 18629 * tests/sigreturn.test: Likewise. 18630 18631 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18632 18633 ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls. 18634 As there is no sigreturn syscall on ia64, mips n32, mips n64, x32, 18635 and x86_64, no longer used parsers could be safely removed. 18636 18637 * linux/ia64/arch_sigreturn.c: Remove. 18638 * Makefile.am (EXTRA_DIST): Remove it. 18639 * linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32]. 18640 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove. 18641 18642 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18643 18644 Move sigreturn parser to libstrace. 18645 All architectures have rt_sigreturn, but only old ones also have 18646 sigreturn. Since not all architectures need a parser of sigreturn 18647 syscall, remove the warning and move the parser to libstrace. 18648 18649 * Makefile.am (strace_SOURCES): Move sigreturn.c ... 18650 (libstrace_a_SOURCES): ... here. 18651 * linux/arch_sigreturn.c: Remove warning. 18652 18653 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18654 18655 tests: check decoding of rt_sigreturn syscall. 18656 * tests/rt_sigreturn.c: New file. 18657 * tests/rt_sigreturn.test: New test. 18658 * tests/.gitignore: Add rt_sigreturn. 18659 * tests/Makefile.am (check_PROGRAMS): Likewise. 18660 (DECODER_TESTS): Add rt_sigreturn.test. 18661 18662 Implement proper decoding of rt_sigreturn syscall. 18663 * rt_sigreturn.c: New file. 18664 * Makefile.am (strace_SOURCES): Add it. 18665 * linux/dummy.h (sys_rt_sigreturn): Remove. 18666 * linux/64/syscallent.h (rt_sigreturn): Change sys_func to rt_sigreturn. 18667 * linux/hppa/syscallent.h (rt_sigreturn): Likewise. 18668 * linux/ia64/syscallent.h (rt_sigreturn): Likewise. 18669 * linux/s390/syscallent.h (rt_sigreturn): Likewise. 18670 * linux/s390x/syscallent.h (rt_sigreturn): Likewise. 18671 * linux/x86_64/syscallent.h (rt_sigreturn): Likewise. 18672 * linux/x32/syscallent.h (rt_sigreturn, 64:rt_sigreturn): Likewise. 18673 * NEWS: Mention this change. 18674 18675 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18676 18677 Introduce get_rt_sigframe_addr function. 18678 Add get_rt_sigframe_addr function for all supported architectures. 18679 It is going to be used in a parser of rt_sigreturn syscall. 18680 18681 * defs.h (get_rt_sigframe_addr): New function prototype. 18682 * rt_sigframe.c: New file. 18683 * Makefile.am (strace_SOURCES): Add it. 18684 * linux/aarch64/arch_rt_sigframe.c: New file. 18685 * linux/alpha/arch_rt_sigframe.c: Likewise. 18686 * linux/arc/arch_rt_sigframe.c: Likewise. 18687 * linux/arm/arch_rt_sigframe.c: Likewise. 18688 * linux/avr32/arch_rt_sigframe.c: Likewise. 18689 * linux/bfin/arch_rt_sigframe.c: Likewise. 18690 * linux/crisv10/arch_rt_sigframe.c: Likewise. 18691 * linux/crisv32/arch_rt_sigframe.c: Likewise. 18692 * linux/hppa/arch_rt_sigframe.c: Likewise. 18693 * linux/i386/arch_rt_sigframe.c: Likewise. 18694 * linux/ia64/arch_rt_sigframe.c: Likewise. 18695 * linux/m68k/arch_rt_sigframe.c: Likewise. 18696 * linux/metag/arch_rt_sigframe.c: Likewise. 18697 * linux/microblaze/arch_rt_sigframe.c: Likewise. 18698 * linux/mips/arch_rt_sigframe.c: Likewise. 18699 * linux/nios2/arch_rt_sigframe.c: Likewise. 18700 * linux/or1k/arch_rt_sigframe.c: Likewise. 18701 * linux/powerpc/arch_rt_sigframe.c: Likewise. 18702 * linux/powerpc64/arch_rt_sigframe.c: Likewise. 18703 * linux/riscv/arch_rt_sigframe.c: Likewise. 18704 * linux/s390/arch_rt_sigframe.c: Likewise. 18705 * linux/s390x/arch_rt_sigframe.c: Likewise. 18706 * linux/sh/arch_rt_sigframe.c: Likewise. 18707 * linux/sh64/arch_rt_sigframe.c: Likewise. 18708 * linux/sparc/arch_rt_sigframe.c: Likewise. 18709 * linux/sparc64/arch_rt_sigframe.c: Likewise. 18710 * linux/tile/arch_rt_sigframe.c: Likewise. 18711 * linux/x32/arch_rt_sigframe.c: Likewise. 18712 * linux/x86_64/arch_rt_sigframe.c: Likewise. 18713 * linux/xtensa/arch_rt_sigframe.c: Likewise. 18714 * Makefile.am (EXTRA_DIST): Add them. 18715 18716 2017-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 18717 18718 Introduce struct_rt_sigframe type. 18719 Add rt_sigframe.h files with definitions of struct_rt_sigframe type 18720 for all supported architectures. 18721 These definitions are going to be used in a parser of rt_sigreturn 18722 syscall. 18723 18724 * linux/rt_sigframe.h: New file. 18725 * linux/bfin/rt_sigframe.h: Likewise. 18726 * linux/crisv10/rt_sigframe.h: Likewise. 18727 * linux/crisv32/rt_sigframe.h: Likewise. 18728 * linux/hppa/rt_sigframe.h: Likewise. 18729 * linux/i386/rt_sigframe.h: Likewise. 18730 * linux/ia64/rt_sigframe.h: Likewise. 18731 * linux/m68k/rt_sigframe.h: Likewise. 18732 * linux/mips/rt_sigframe.h: Likewise. 18733 * linux/powerpc64/rt_sigframe.h: Likewise. 18734 * linux/s390/rt_sigframe.h: Likewise. 18735 * linux/s390x/rt_sigframe.h: Likewise. 18736 * linux/sh64/rt_sigframe.h: Likewise. 18737 * linux/sparc/rt_sigframe.h: Likewise. 18738 * linux/sparc64/rt_sigframe.h: Likewise. 18739 * linux/tile/rt_sigframe.h: Likewise. 18740 * linux/x32/rt_sigframe.h: Likewise. 18741 * linux/x86_64/rt_sigframe.h: Likewise. 18742 * Makefile.am (EXTRA_DIST): Add them. 18743 18744 2017-03-13 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 18745 18746 unwind.c: fix a possible buffer overflow. 18747 Linux does not prevent a user from creating a lot of nested directories 18748 with length of the absolute path of the deepest one exceeding PATH_MAX, 18749 then chdir'ing into it, creating a file there and mmap'ing it. Since the 18750 length of the prefix preceding the pathname in /proc/[pid]/maps is not 18751 necessary 80 (it's 73 on my machine), an overflow is possible. 18752 18753 * unwind.c (build_mmap_cache): Fix a possible buffer overflow. 18754 18755 2017-03-13 Victor Krapivensky <krapivenskiy.va (a] phystech.edu> 18756 18757 util.c: remove a wrong comment. 18758 4924dbd6d750665cf383b20ab4fd67e48219ab91 modified the return type, but 18759 not the comment. 18760 18761 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18762 18763 riscv: export riscv_sp_ptr. 18764 Export SP register for later use by get_rt_sigframe_addr. 18765 18766 * linux/riscv/arch_regs.h: New file. 18767 * Makefile.am (EXTRA_DIST): Add it. 18768 * linux/riscv/arch_regs.c (riscv_sp_ptr): New variable. 18769 18770 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18771 18772 or1k: export or1k_sp_ptr. 18773 Export SP register for later use by get_rt_sigframe_addr. 18774 18775 * linux/or1k/arch_regs.h: New file. 18776 * Makefile.am (EXTRA_DIST): Add it. 18777 * linux/or1k/arch_regs.c (or1k_sp_ptr): New variable. 18778 18779 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18780 18781 nios2: export nios2_sp_ptr. 18782 Export SP register for later use by get_rt_sigframe_addr. 18783 18784 * linux/nios2/arch_regs.h: New file. 18785 * Makefile.am (EXTRA_DIST): Add it. 18786 * linux/nios2/arch_regs.c (nios2_sp_ptr): New variable. 18787 18788 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18789 18790 metag: export metag_sp_ptr. 18791 Export SP register for later use by get_rt_sigframe_addr. 18792 18793 * linux/metag/arch_regs.h: New file. 18794 * Makefile.am (EXTRA_DIST): Add it. 18795 * linux/metag/arch_regs.c (metag_sp_ptr): New variable. 18796 18797 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18798 18799 avr32: export avr32_sp_ptr. 18800 Export SP register for later use by get_rt_sigframe_addr. 18801 18802 * linux/avr32/arch_regs.h: New file. 18803 * Makefile.am (EXTRA_DIST): Add it. 18804 * linux/avr32/arch_regs.c (avr32_sp_ptr): New variable. 18805 18806 2017-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 18807 18808 arc: export arc_sp_ptr. 18809 Export SP register for later use by get_rt_sigframe_addr. 18810 18811 * linux/arc/arch_regs.h: New file. 18812 * Makefile.am (EXTRA_DIST): Add it. 18813 * linux/arc/arch_regs.c (arc_sp_ptr): New variable. 18814 18815 2017-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 18816 18817 Introduce print_sigset_addr function. 18818 As the definition of NSIG_BYTES is based on NSIG defined in <signal.h>, 18819 NSIG_BYTES cannot be used in files that use kernel sigset_t. 18820 18821 Add another wrapper around print_sigset_addr_len_limit function that 18822 takes one argument less than print_sigset_addr_len wrapper. This new 18823 wrapper is going to be used in cases when the length argument is equal 18824 to NSIG_BYTES. 18825 18826 * defs.h (print_sigset_addr): New function prototype. 18827 * signal.c (print_sigset_addr): New function. 18828 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Replace 18829 print_sigset_addr_len with print_sigset_addr. 18830 * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. 18831 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. 18832 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 18833 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 18834 * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. 18835 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 18836 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. 18837 18838 2017-03-08 Dmitry V. Levin <ldv (a] altlinux.org> 18839 18840 README.md: rework guidelines about sending bug reports. 18841 18842 2017-03-08 Abhishek Tiwari <erabhishektiwarics (a] gmail.com> 18843 18844 Update information on how to build strace from git repository. 18845 * INSTALL-git.md: Describe how to build strace from git repository. 18846 * README.md: Add reference to INSTALL-git.md. 18847 * README-hacking: Likewise. 18848 18849 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 18850 18851 README.md: fix references to in-tree files. 18852 * README.md: Change references to COPYING and NEWS files from absolute 18853 to relative. 18854 18855 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 18856 18857 INSTALL: regenerate from install.texi. 18858 Regenerate INSTALL from install.texi using the following command: 18859 makeinfo --plaintext install.texi > INSTALL 18860 18861 * INSTALL: Regenerate from install.texi. 18862 18863 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 18864 18865 install.texi: remove irrelevant sections. 18866 Remove "Multiple Architectures" and "Particular Systems" sections using 18867 the following filter script: 18868 18869 awk '/^@node (Multiple Architectures|Particular Systems)/{skip=1;next} 18870 /^@node/{skip=0} {if(!skip)print}' 18871 18872 * install.texi (Multiple Architectures, Particular Systems): Remove. 18873 18874 2017-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 18875 18876 install.texi: import from GNU Autoconf. 18877 install.texi from GNU Autoconf is the ultimate source of INSTALL file. 18878 This edition of install.texi has been downloaded from 18879 https://git.savannah.gnu.org/cgit/autoconf.git/plain/doc/install.texi?id=63f3c78cdb0ccc85751543e387ef2a7252d5f0a2 18880 18881 * install.texi: Import from GNU Autoconf. 18882 18883 2017-03-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18884 Md Haris Iqbal <haris.phnx (a] gmail.com> 18885 18886 Implement -e trace=%sched option for tracing sched_* syscalls. 18887 Based on the patch by Md Haris Iqbal 18888 (https://sourceforge.net/p/strace/mailman/message/35111320/) 18889 18890 linux/*/syscallent.h part is modified automatically by: 18891 18892 git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \ 18893 's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/' 18894 18895 * sysent.h (TRACE_SCHED): New definition. 18896 * syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion. 18897 * linux/32/syscallent.h: Add TSC flag for sched_* sycalls. 18898 * linux/64/syscallent.h: Likewise. 18899 * linux/alpha/syscallent.h: Likewise. 18900 * linux/arm/syscallent.h: Likewise. 18901 * linux/avr32/syscallent.h: Likewise. 18902 * linux/bfin/syscallent.h: Likewise. 18903 * linux/crisv10/syscallent.h: Likewise. 18904 * linux/hppa/syscallent.h: Likewise. 18905 * linux/i386/syscallent.h: Likewise. 18906 * linux/ia64/syscallent.h: Likewise. 18907 * linux/m68k/syscallent.h: Likewise. 18908 * linux/microblaze/syscallent.h: Likewise. 18909 * linux/mips/syscallent-n32.h: Likewise. 18910 * linux/mips/syscallent-n64.h: Likewise. 18911 * linux/mips/syscallent-o32.h: Likewise. 18912 * linux/powerpc/syscallent.h: Likewise. 18913 * linux/powerpc64/syscallent.h: Likewise. 18914 * linux/s390/syscallent.h: Likewise. 18915 * linux/s390x/syscallent.h: Likewise. 18916 * linux/sh/syscallent.h: Likewise. 18917 * linux/sh64/syscallent.h: Likewise. 18918 * linux/sparc/syscallent.h: Likewise. 18919 * linux/sparc64/syscallent.h: Likewise. 18920 * linux/x32/syscallent.h: Likewise. 18921 * linux/x86_64/syscallent.h: Likewise. 18922 * linux/xtensa/syscallent.h: Likewise. 18923 * qualify.c (lookup_class): Add TRACE_SCHED for "%sched". 18924 * tests/ksysent.c: Define TSC to 0. 18925 * tests/nsyscalls.c: Likewise. 18926 * tests/sched.test: New test. 18927 * tests/Makefile.am (DECODER_TESTS): Add sched.test. 18928 * strace.1 (.SS Filtering): Add information about %sched syscall class. 18929 * NEWS: Mention this change. 18930 18931 2017-03-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 18932 18933 Add "%" prefix for syscall classes in qualify. 18934 (as suggested in 18935 https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html ) 18936 18937 In order to move them to a different namespace than syscall names. This is 18938 already a problem in case of ipc class which shadows ipc syscall. 18939 18940 Old behaviour is retained in order to preserve backwards compatibility. 18941 18942 * qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions. 18943 * strace.1 (.SS Filtering): Add information regarding %-prefixed class 18944 syntax, declare legacy class syntax deprecated. 18945 * tests/net.test: Update to use %-prefixed syscall class name. 18946 * tests/netlink_protocol.test: Likewise. 18947 * tests/qual_fault-exit_group.test: Likewise. 18948 * tests/qual_syscall.test: Likewise. 18949 * tests/scm_rights-fd.test: Likewise. 18950 * tests/sigreturn.test: Likewise. 18951 * tests/uio.test: Likewise. 18952 * NEWS: Mention this change. 18953 18954 2017-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 18955 18956 tests: simplify print_time_t. 18957 * tests/print_time.c (print_time_t): Treat localtime errors as fatal. 18958 18959 2017-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 18960 18961 Update homepage URL. 18962 * README: Change homepage URL to https://strace.io 18963 * debian/control: Likewise. 18964 * strace.spec.in: Likewise. 18965 18966 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 18967 18968 tests: transform print_time_t into print_time_t_nsec. 18969 * tests/print_time.c (print_time_t): Rename to print_time_t_nsec, 18970 take second argument and print it. 18971 * tests/tests.h (print_time_t): Rename to print_time_t_nsec, 18972 add second argument. 18973 * tests/utime.c (main): Use print_time_t_nsec instead of print_time_t. 18974 * tests/xstatx.c (print_stat): Likewise. Pass nanoseconds 18975 to print_time_t_nsec instead of printing them. 18976 18977 tests: use print_time_t in utime.test. 18978 * tests/utime.c (print_tm): Remove. 18979 (main): Use print_time_t instead of print_tm. 18980 18981 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 18982 18983 tests: move print_time function to libtests. 18984 Rename print_time function to print_time_t and move it to libtests. 18985 18986 * tests/print_time.c: New file. 18987 * tests/Makefile.am (libtests_a_SOURCES): Add it. 18988 * tests/tests.h (print_time_t): New prototype. 18989 * tests/print_time.c (print_time): Remove. 18990 (print_stat): Replace print_time with print_time_t. 18991 18992 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 18993 18994 tests: macroize printing of atime, mtime, and ctime fields in xstatx.c. 18995 Introduce a macro for printing similar time related fields. 18996 18997 * print_struct_stat.c (PRINT_ST_TIME): New macro. 18998 (print_stat): Use it. 18999 19000 2017-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 19001 19002 print_struct_stat.c: macroize printing of atime, mtime, and ctime fields 19003 Introduce a macro for printing similar time related fields. 19004 19005 * print_struct_stat.c (PRINT_ST_TIME): New macro. 19006 (print_struct_stat): Use it. 19007 19008 2017-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 19009 19010 x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls. 19011 x32 is the only linux architecture where preadv2 and pwritev2 syscalls 19012 take 5 arguments instead of 6. 19013 19014 * io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro. 19015 (SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it. 19016 * linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5. 19017 * NEWS: Mention this fix. 19018 * tests/preadv2-pwritev2.c (main): Fix invocation of preadv2 19019 and pwritev2 syscalls on x32. 19020 19021 2017-02-21 Dmitry V. Levin <ldv (a] altlinux.org> 19022 19023 tests: rewrite ppoll syscall decoding check from match_grep to match_diff 19024 Unlike the former test that was based on match_grep, 19025 the new one uses match_diff and does more rigorous testing. 19026 19027 * tests/ppoll-v.c: New file. 19028 * tests/ppoll-v.test: New test. 19029 * tests/ppoll.c: Rewrite. 19030 * tests/ppoll.test: Likewise. 19031 * tests/ppoll.expected: Remove. 19032 * tests/ppoll-v.expected: Remove. 19033 * tests/.gitignore: Add ppoll-v. 19034 * tests/Makefile.am (check_PROGRAMS): Likewise. 19035 (DECODER_TESTS): Add ppoll-v.test. 19036 (EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected. 19037 19038 2017-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 19039 19040 tests: move get_sigset_size function to libtests. 19041 * tests/get_sigset_size.c: New file. 19042 * tests/Makefile.am (libtests_a_SOURCES): Add it. 19043 * tests/tests.h (get_sigset_size): New prototype. 19044 * tests/ptrace.c: Do not check for __NR_rt_sigprocmask. 19045 (main): Use get_sigset_size. 19046 * tests/signalfd4.c: Do not check for __NR_rt_sigprocmask. 19047 (get_sigset_size): Remove. 19048 19049 2017-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 19050 19051 sched: enhance decoding of sched_setattr syscall. 19052 Implement read/write semantics of struct sched_attr.size argument 19053 of sched_setattr syscall. Do not print members of struct sched_attr 19054 besides sched_attr.size when the specified structure size is less than 19055 the minimal size allowed by the kernel. 19056 19057 * sched.c (print_sched_attr): Fetch struct sched_attr.size and use it 19058 as the structure size. Print struct sched_attr.size only when the 19059 structure size is less than SCHED_ATTR_MIN_SIZE. 19060 (SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size 19061 argument. Print struct sched_attr.size returned by the kernel 19062 on exiting syscall in case of E2BIG. Print the last syscall argument 19063 on exiting syscall. 19064 (SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size 19065 argument. 19066 * NEWS: Mention it. 19067 * tests/sched_xetattr.c (main): Check it. 19068 19069 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 19070 19071 tests: check decoding of sched_[gs]etattr corner cases. 19072 * tests/sched_xetattr.c (main): Check that integer arguments 19073 of sched_getattr and sched_setattr syscalls are decoded properly 19074 by adding a few cases with filled higher 32 bits. 19075 Check that pointer argument is decoded properly 19076 on F8ILL_KULONG_SUPPORTED architectures. 19077 19078 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 19079 19080 Move definition of struct sched_attr to a separate header file. 19081 Avoid multiple defintions of struct sched_attr by creating a separate 19082 header file with its definition and using it in other places. 19083 19084 * sched_attr.h: New file. 19085 * Makefile.am (strace_SOURCES): Add it. 19086 * sched.c: Include it. 19087 (print_sched_attr): Use it. 19088 * tests/sched_xetattr.c: Include it. 19089 (main): Use it. 19090 19091 2017-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 19092 19093 tests: rewrite sched_xetattr.test from match_grep to match_diff. 19094 Unlike the previous edition of the test that was based on match_grep, 19095 the new one is match_diff based and does more rigorous testing. 19096 19097 * tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h", 19098 (sys_sched_getattr, sys_sched_setattr): New functions. 19099 (main): Use them. Update expected output. 19100 * tests/adjtimex.test: Use run_strace_match_diff. 19101 19102 2017-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 19103 19104 Use tprints instead of tprintf in a few more places. 19105 * bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf 19106 with tprints for printing strings without format specifiers. 19107 * dm.c (dm_decode_dm_target_spec): Likewise. 19108 * mq.c (SYS_FUNC(mq_timedreceive)): Likewise. 19109 * perf.c (print_perf_event_attr): Likewise. 19110 * syscall.c (trace_syscall_exiting): Likewise. 19111 19112 2017-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 19113 19114 bpf: update BPF_PROG_ATTACH decoding. 19115 Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH 19116 command introduced by linux kernel commit v4.10-rc7-174-g7f67763. 19117 19118 * configure.ac: Check for union bpf_attr.attach_flags 19119 instead of union bpf_attr.attach_type. 19120 * xlat/bpf_attach_flags.in: New file. 19121 * bpf.c: Include "xlat/bpf_attach_flags.h". 19122 (bpf_prog_attach_detach): Rename print_attach_bpf_fd argument 19123 to print_attach. Add attach_flags field to the structure, 19124 print it in case of BPF_PROG_ATTACH. 19125 * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 19126 instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE. 19127 (prog_cgroup): Initialize attach_flags field. 19128 (main): Update expected output. 19129 19130 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 19131 19132 tests: rewrite adjtimex.test from match_grep to match_diff. 19133 Unlike the previous edition of the test that was based on match_grep, 19134 the new one is match_diff based and does more rigorous testing. 19135 19136 * tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h", 19137 and "xlat/adjtimex_status.h". 19138 (main): Update expected output. 19139 * tests/adjtimex.test: Use run_strace_match_diff. 19140 19141 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 19142 19143 tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 19144 * tests/init_delete_module.h (bogus_zero): Remove. 19145 * tests/delete_module.c (main): Replace bogus_zero and 19146 (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 19147 * tests/finit_module.c (main): Replace bogus_zero 19148 with F8ILL_KULONG_MASK. 19149 * tests/init_module.c (main): Likewise. 19150 * tests/pipe2.c (main): Likewise. 19151 * tests/epoll_ctl.c (invoke_syscall): Replace 19152 (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 19153 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise. 19154 * tests/fanotify_init.c (main): Likewise. 19155 * tests/xetpgid.c (main): Likewise. 19156 * tests/xetpriority.c (main): Likewise. 19157 (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 19158 * tests/fanotify_mark.c (main): Likewise. 19159 * tests/file_handle.c (main): Likewise. 19160 * tests/kexec_load.c (main): Likewise. 19161 * tests/setfsugid.c (main): Likewise. 19162 * tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL 19163 with F8ILL_KULONG_MASK. 19164 * tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL 19165 and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. 19166 19167 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 19168 19169 tests: fill higher bits of integer arguments of fcntl* syscalls. 19170 Check that integer arguments of fcntl and fcntl64 syscalls are decoded 19171 properly by casting them to kernel_ulong_t and filling higher bits. 19172 19173 * tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd" 19174 syscall arguments to kernel_ulong_t, fill their higher 32 bits. 19175 19176 2017-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 19177 19178 tests: use sprintrc in tests of fcntl and fcntl64 syscalls. 19179 * tests/struct_flock.c (EINVAL_STR): Remove. 19180 (test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR. 19181 * tests/fcntl.c (test_flock64_einval): Likewise. 19182 * tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise. 19183 19184 2017-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 19185 19186 Post-release administrivia. 19187 * NEWS: Add a header line for the next release. 19188 * debian/changelog.in: Add a changelog entry for 4.16-1. 19189 * strace.spec.in: Likewise. 19190 19191 2017-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 19192 19193 Prepare for 4.16 release. 19194 * NEWS: Update for 4.16 release. 19195 19196 2017-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 19197 19198 .mailmap: add addresses of JingPiao Chen. 19199 * .mailmap: Add both addresses of JingPiao Chen here to avoid 19200 duplications in CREDITS file. 19201 19202 tests: skip scno tampering tests on compat mips abi. 19203 * tests/scno_tampering.sh: In case of mips abi, skip the test 19204 unless it is the native abi. 19205 19206 2017-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 19207 19208 Fix -Werror=duplicate-decl-specifier compilation issues. 19209 capability.c:82:28: error: duplicate "const" declaration specifier 19210 capability.c:110:33: error: duplicate "const" declaration specifier 19211 rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier 19212 utime.c:66:23: error: duplicate "const" declaration specifier 19213 waitid.c:147:20: error: duplicate "const" declaration specifier 19214 19215 * capability.c (cap_user_header_t, cap_user_data_t): Remove. 19216 (get_cap_header): Change return type 19217 to "const struct user_cap_header_struct *". 19218 (print_cap_header, print_cap_data): Change the type of last argument 19219 to "const struct user_cap_header_struct * const". 19220 (SYS_FUNC(capget)): Change type of "h" variable 19221 to "const struct user_cap_header_struct *". 19222 (SYS_FUNC(capset)): Change type of "h" variable 19223 to "const struct user_cap_header_struct * const". 19224 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last 19225 argument to "const void *const". 19226 * tests/utime.c (main): Change the type of "tail_u" variable 19227 to "const struct utimbuf *const". 19228 * tests/waitid.c (do_waitid): Change the type of 3rd argument 19229 to "const siginfo_t *const". 19230 19231 2017-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 19232 19233 tests: rewrite pipe syscall decoding check from match_grep to match_diff 19234 * configure.ac (AC_CHECK_FUNCS): Remove pipe2. 19235 * tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe] 19236 instead of [!HAVE_PIPE2]. 19237 (main): Do not call pipe2. 19238 * tests/pipe.test: Skip the test if libc pipe wrapper does not use 19239 pipe syscall, rewrite from match_grep to match_diff. 19240 * tests/pipe.expected: Update expected output. 19241 19242 2017-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 19243 19244 tests: rewrite pipe2 syscall decoding check from match_grep to match_diff 19245 Unlike pipe.test that is based on match_grep, the new test 19246 is based on match_diff and does more rigorous testing. 19247 19248 * tests/pipe2.c: New file. 19249 * tests/pipe2.test: New test. 19250 * tests/.gitignore: Add pipe2. 19251 * tests/Makefile.am (check_PROGRAMS): Likewise. 19252 (DECODER_TESTS): Add pipe2.test. 19253 19254 2017-02-10 Dmitry V. Levin <ldv (a] altlinux.org> 19255 19256 tests: rewrite mq.test from match_grep to match_diff. 19257 Unlike the previous edition of the test that was based on match_grep, 19258 the new one is match_diff based and does more rigorous testing. 19259 19260 * tests/mq.c: Include <stdio.h>. 19261 (NAME): New macro. 19262 (main): Use it. Print expected output. 19263 * tests/mq.expected: Remove. 19264 * tests/Makefile.am (EXTRA_DIST): Remove mq.expected. 19265 * tests/mq.test: Use run_strace_match_diff. 19266 19267 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 19268 19269 Simplify struct inject_opts.rval semantics. 19270 Drop use of INJECT_OPTS_RVAL_DISABLE special inject_opts.rval value, 19271 INJECT_OPTS_RVAL_DEFAULT is enough. 19272 19273 * defs.h (INJECT_OPTS_RVAL_DISABLE): Remove. 19274 * qualify.c (qualify_inject_common): Do not replace 19275 INJECT_OPTS_RVAL_DEFAULT with INJECT_OPTS_RVAL_DISABLE 19276 in inject_opts.rval. 19277 * syscall.c (tamper_with_syscall_entering): Check 19278 for INJECT_OPTS_RVAL_DEFAULT instead of INJECT_OPTS_RVAL_DISABLE. 19279 19280 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 19281 19282 tests: check signal injection along with fault injection. 19283 * tests/qual_inject-error-signal.c: New file. 19284 * tests/qual_inject-error-signal.expected: Likewise. 19285 * tests/qual_inject-error-signal.test: New test. 19286 * tests/.gitignore: Add qual_inject-error-signal. 19287 * tests/Makefile.am (check_PROGRAMS): Likewise. 19288 (MISC_TESTS): Add qual_inject-error-signal.test. 19289 (EXTRA_DIST): Add qual_inject-error-signal.expected. 19290 19291 tests: simplify qual_inject-signal.test. 19292 * tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal. 19293 19294 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 19295 19296 Make symbolic errno values match case-insensitive. 19297 Follow the example of case-insensitive symbolic signal values in signal 19298 and inject expressions and make symbolic errno values in inject 19299 expressions case-insensitive. 19300 19301 * qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp 19302 to match symbolic errno values. 19303 * tests/qual_fault.c (main): Likewise. 19304 * tests/qual_fault.test: Test case-insensitive symbolic errno match. 19305 19306 2017-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 19307 19308 tests: check case-insensitive symbolic signal match. 19309 * tests/qual_signal.test: Test case-insensitive symbolic signal match. 19310 19311 2017-02-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 19312 19313 Update NEWS. 19314 19315 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19316 19317 Update NEWS. 19318 19319 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19320 19321 strace.spec.in: fix dist version checks. 19322 * strace.spec.in: Fix libunwind availability check. 19323 19324 Reported-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 19325 19326 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19327 19328 tests: update ipc_sem.test for new glibc. 19329 Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL 19330 address to semctl like other libcs. 19331 19332 * tests/ipc_sem.c (main) [__GLIBC__]: Remove. 19333 19334 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19335 19336 tests: fix typo in bpf.test. 19337 * tests/bpf.c (main): Add missing semicolon. 19338 19339 Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff") 19340 19341 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19342 19343 tests: check signal injection. 19344 * tests/qual_inject-signal.c: New file. 19345 * tests/qual_inject-signal.expected: Likewise. 19346 * tests/qual_inject-signal.test: New test. 19347 * tests/.gitignore: Add qual_inject-signal. 19348 * tests/Makefile.am (check_PROGRAMS): Likewise. 19349 (MISC_TESTS): Add qual_inject-signal.test. 19350 (EXTRA_DIST): Add qual_inject-signal.expected. 19351 19352 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19353 19354 Implement -e inject= option. 19355 Introduce -e inject= as a general injection option, 19356 limit -e fault= option to syscall fault injection. 19357 19358 Change default return code of syscall fault injection to ENOSYS. 19359 19360 * qualify.c (parse_inject_token): Add fault_tokens_only argument, 19361 do not accept retval= and signal= tokens when fault_tokens_only 19362 is set to true. 19363 (parse_inject_expression): Add fault_tokens_only argument, 19364 forward it to parse_inject_token. 19365 (qualify_inject_common): New function. 19366 (qualify_fault): Use it. 19367 (qualify_inject): New function. 19368 (qual_options): New entry. 19369 * strace.1: Describe -e inject= option. 19370 * NEWS: Mention -e inject= option. 19371 * tests/qual_fault-syntax.test: Test that -e fault= option does not 19372 support retval=, signal=, and multiple error= tokens. 19373 * tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally. 19374 * tests/qual_inject-retval.test: Replace -e fault= option 19375 with -e inject= option. 19376 * tests/qual_inject-syntax.test: New test. 19377 * tests/Makefile.am (MISC_TESTS): Add it. 19378 19379 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19380 19381 tests: prepare for introduction of -e inject= option. 19382 Rename files related to fault injection to avoid further confusion. 19383 19384 * tests/fault_injection-exit_group.expected: Rename 19385 to tests/qual_fault-exit_group.expected. 19386 * tests/fault_injection-exit_group.test: Rename 19387 to tests/qual_fault-exit_group.test. 19388 * tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test. 19389 * tests/fault_injection.c: Rename to tests/qual_fault.c. 19390 * tests/fault_injection.test: Rename to tests/qual_fault.test. 19391 * tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c. 19392 * tests/fault_injection-retval.test: Rename 19393 to tests/qual_inject-retval.test. 19394 * tests/fault_injection.sh: Rename to tests/scno_tampering.sh. 19395 * tests/.gitignore: Update. 19396 * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, 19397 EXTRA_DIST): Update. 19398 19399 2017-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 19400 19401 Prepare for introduction of -e inject= option. 19402 As -e fault= injection syntax has been extended to configure various 19403 kinds of injections besides fault injection, the original option name 19404 bacame too narrow. 19405 19406 This change renames internal constants, types, and functions from 19407 "fault" to more generic inject/tamper ones. 19408 19409 * defs.h (fault_opts): Rename to inject_opts. 19410 (FAULT_OPTS_RVAL_DEFAULT): Rename to INJECT_OPTS_RVAL_DEFAULT. 19411 (FAULT_OPTS_RVAL_DISABLE): Rename to INJECT_OPTS_RVAL_DISABLE. 19412 (struct tcb): Rename fault_vec field to inject_vec. 19413 (TCB_FAULT_INJ): Rename to TCB_TAMPERED. 19414 (QUAL_FAULT): Rename to QUAL_INJECT. 19415 (fault_vec): Rename to inject_vec. 19416 All users changed. 19417 * qualify.c (fault_set): Rename to inject_set. 19418 (parse_fault_token): Rename to parse_inject_token. 19419 (parse_fault_expression): Rename to parse_inject_expression. 19420 All callers changed. 19421 * syscall.c (fault_vec): Rename to inject_vec. 19422 (tcb_fault_opts): Rename to tcb_inject_opts. 19423 (inject_syscall_fault_entering): Rename to tamper_with_syscall_entering. 19424 (update_syscall_fault_exiting): Rename to tamper_with_syscall_exiting. 19425 (syscall_fault_injected): Rename to syscall_tampered. 19426 All callers changed. 19427 19428 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 19429 19430 tests: make Makefile.am lists sorted in C locale. 19431 * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS, 19432 EXTRA_DIST): Make sorted in C locale. 19433 19434 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 19435 19436 tests: use ARG_STR in msg_control.test. 19437 Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h. 19438 19439 * tests/msg_control.c (VAL_STR): Remove. 19440 (test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR. 19441 19442 2017-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 19443 19444 powerpc, powerpc64: wire up new syscalls. 19445 * linux/powerpc/syscallent.h [382]: Add kexec_file_load entry. 19446 * linux/powerpc64/syscallent.h [382]: Likewise. 19447 19448 microblaze: wire up new syscalls. 19449 * linux/microblaze/syscallent.h [392..397]: New entries. 19450 19451 avr32: wire up new syscalls. 19452 * linux/avr32/syscallent.h [328..330]: New entries. 19453 19454 2017-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 19455 19456 Update IPV6_* constants. 19457 * xlat/sockipv6options.in: Add IPV6_RECVFRAGSIZE introduced 19458 by linux kernel commit v4.10-rc1~202^2~340^2~1. 19459 19460 Update IP_* constants. 19461 * xlat/sockipoptions.in: Add IP_RECVFRAGSIZE introduced 19462 by linux kernel commit v4.10-rc1~202^2~340^2~2. 19463 19464 2017-02-06 Jacob Goense <dugo (a] xs4all.nl> 19465 19466 or1k: fix build. 19467 This fixes a typo in the arch_set_success for the or1k architecture. 19468 19469 * linux/or1k/set_error.c (arch_setsuccess): Rename to arch_set_success. 19470 19471 Fixes: 41d647c ("Implement success injection") 19472 Closes: https://github.com/strace/strace/pull/6 19473 19474 2017-02-04 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 19475 19476 Update ioctl entries from linux 4.10. 19477 * linux/32/ioctls_inc_align16.h: Update from linux v4.10 using ioctls_gen.sh. 19478 * linux/32/ioctls_inc_align32.h: Likewise. 19479 * linux/32/ioctls_inc_align64.h: Likewise. 19480 * linux/64/ioctls_inc.h: Likewise. 19481 * linux/x32/ioctls_inc0.h: Likewise. 19482 * NEWS: Mention this. 19483 19484 maint: update for linux 4.10. 19485 * maint/ioctls_sym.sh: Update workaround for linux/if_pppox.h file. 19486 19487 maint: add workaround for m68k. 19488 * maint/ioctls_sym.sh: Skip asm/amigayle.h. 19489 19490 2017-01-31 Dmitry V. Levin <ldv (a] altlinux.org> 19491 19492 tests: check decoding of bpf corner cases. 19493 * tests/bpf.c (bogus_bpf): New function. 19494 (BOGUS_BPF): New macro. 19495 (main): Use them. 19496 * tests/bpf.test: Add -a option. 19497 19498 2017-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 19499 19500 tests: rewrite bpf.test from match_grep to match_diff. 19501 * tests/bpf.c (errstr): New variable. 19502 (sys_bpf): New function. 19503 (map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it. 19504 (main): Update expected output. 19505 * tests/bpf.test: Use run_strace_match_diff. 19506 19507 bpf: move common code to a separate function. 19508 * bpf.c (bpf_prog_attach_detach): New function. 19509 (bpf_prog_attach, bpf_prog_detach): Use it. 19510 19511 2017-01-29 Quentin Monnet <quentin.monnet (a] 6wind.com> 19512 19513 Update bpf syscall decoding. 19514 Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH, 19515 and BPF_PROG_DETACH commands. 19516 19517 * bpf.c: Include "xlat/bpf_attach_type.h". 19518 (bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions. 19519 (SYS_FUNC(bpf)): Use them. 19520 * configure.ac: Check for union bpf_attr.bpf_fd and union 19521 bpf_attr.attach_type. 19522 * xlat/bpf_attach_type.in: New file. 19523 * xlat/bpf_commands.in: Update list of BPF_* command constants. 19524 * xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants. 19525 * xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants. 19526 * tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function. 19527 [HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise. 19528 (main): Use them. 19529 19530 2017-01-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 19531 19532 tests: check success injection. 19533 * tests/fault_injection-retval.c: New file. 19534 * tests/fault_injection-retval.test: New test. 19535 * tests/.gitignore: Add fault_injection-retval. 19536 * tests/Makefile.am (check_PROGRAMS): Likewise. 19537 (MISC_TESTS): Add fault_injection-retval.test. 19538 19539 2017-01-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 19540 19541 Implement success injection. 19542 This extends fault injection syntax with :retval= option. 19543 When :retval=VALUE is specified, the syscall number is replaced by -1 19544 and a bogus success VALUE is returned to the callee. 19545 19546 * defs.h (fault_opts): Remove err field, add rval field. 19547 (MAX_ERRNO_VALUE, FAULT_OPTS_RVAL_DEFAULT, FAULT_OPTS_RVAL_DISABLE): 19548 New macros. 19549 * qualify.c (parse_fault_token): Handle retval= token. 19550 (qualify_fault): Update fault_opts initialization after the move 19551 from struct fault_opts.err to struct fault_opts.rval. 19552 * syscall.c (arch_set_success): New prototype. 19553 (inject_syscall_fault_entering): Check opts->rval instead of opts->err. 19554 (update_syscall_fault_exiting): Implement retval injection. 19555 * strace.1: Update the section on fault injection. 19556 * NEWS: Mention retval= option. 19557 * linux/aarch64/set_error.c (arch_set_success): New function. 19558 * linux/alpha/set_error.c: Likewise. 19559 * linux/arc/set_error.c: Likewise. 19560 * linux/arm/set_error.c: Likewise. 19561 * linux/avr32/set_error.c: Likewise. 19562 * linux/bfin/set_error.c: Likewise. 19563 * linux/crisv10/set_error.c: Likewise. 19564 * linux/hppa/set_error.c: Likewise. 19565 * linux/i386/set_error.c: Likewise. 19566 * linux/ia64/set_error.c: Likewise. 19567 * linux/m68k/set_error.c: Likewise. 19568 * linux/metag/set_error.c: Likewise. 19569 * linux/microblaze/set_error.c: Likewise. 19570 * linux/mips/set_error.c: Likewise. 19571 * linux/nios2/set_error.c: Likewise. 19572 * linux/or1k/set_error.c: Likewise. 19573 * linux/powerpc/set_error.c: Likewise. 19574 * linux/riscv/set_error.c: Likewise. 19575 * linux/s390/set_error.c: Likewise. 19576 * linux/sh/set_error.c: Likewise. 19577 * linux/sh64/set_error.c: Likewise. 19578 * linux/sparc/set_error.c: Likewise. 19579 * linux/sparc64/set_error.c: Likewise. 19580 * linux/tile/set_error.c: Likewise. 19581 * linux/x86_64/set_error.c: Likewise. 19582 * linux/xtensa/set_error.c: Likewise. 19583 19584 Closes: https://github.com/strace/strace/issues/3 19585 19586 2017-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 19587 19588 mips: rewrite configure check without sgidefs.h. 19589 Use builtin macros provided by gcc >= 3.4 instead of sgidefs.h macros. 19590 19591 * configure.ac <mips>: Do not include <asm/sgidefs.h>, use _ABIO32 19592 instead of _MIPS_SIM_ABI32, _ABIN32 instead of _MIPS_SIM_NABI32, 19593 and _ABI64 instead of _MIPS_SIM_ABI64. 19594 19595 2017-01-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 19596 19597 .gitignore: add missing files that should be ignored. 19598 * .gitignore: Add /ioctl_iocdef.[ih]. 19599 19600 Fixes: 5679fad ("ioctlsort: get ioctl definitions from host, not build") 19601 19602 2017-01-20 Andre McCurdy <armccurdy (a] gmail.com> 19603 19604 mips: use <asm/sgidefs.h> 19605 Build fix for MIPS with musl libc. 19606 19607 The MIPS specific header <sgidefs.h> is provided by glibc and uclibc 19608 but not by musl. Regardless of the libc, the kernel headers provide 19609 <asm/sgidefs.h> which provides the same definitions, so use that 19610 instead. 19611 19612 * configure.ac: Replace <sgidefs.h> with <asm/sgidefs.h>. 19613 19614 2017-01-20 JingPiao Chen <chenjingpiao (a] gmail.com> 19615 19616 Implement decoding of ustat syscall. 19617 * configure.ac (AC_CHECK_HEADERS): Add ustat.h. 19618 * ustat.c: New file. 19619 * Makefile.am (strace_SOURCES): Add it. 19620 * linux/dummy.h: Remove sys_ustat. 19621 * tests/ustat.c: New file. 19622 * tests/ustat.test: New test. 19623 * tests/.gitignore: Add ustat. 19624 * tests/Makefile.am (check_PROGRAMS): Likewise. 19625 (DECODER_TESTS): Add ustat.test. 19626 19627 Makefile.am: allow indented DEF_MPERS_TYPE includes. 19628 * Makefile.am (m%_type_defs.h): Change sed regular expression to allow 19629 arbitrary number of whitespace characters between "#" symbol 19630 and "include" directive. 19631 19632 strace.1: fix formatting. 19633 * strace.1: Remove misplaced .TP macros. 19634 19635 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 19636 19637 tests: drop non-USE_ASM_STAT case support. 19638 With the switch of fstatat family tests to USE_ASM_STAT variant, 19639 there are no non-USE_ASM_STAT users left. Remove support of unused 19640 non-USE_ASM_STAT case. 19641 19642 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec. 19643 * tests/fstatat.c (USE_ASM_STAT): Remove. 19644 * tests/fstatx.c: Likewise. 19645 * tests/lstatx.c: Likewise. 19646 * tests/xstatx.c: Assume USE_ASM_STAT. 19647 [!USE_ASM_STAT]: Remove. 19648 19649 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 19650 19651 tests: call newfstatat and fstatat64 syscalls directly. 19652 Do not use glibc wrappers to call newfstatat and fstatat64. 19653 These wrappers have various problems, e.g. they segfault on sparc64 19654 and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong 19655 conversion of timestamps on mips64. 19656 19657 * tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall 19658 directly. 19659 (USE_ASM_STAT): Define. 19660 * tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove. 19661 (STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define. 19662 19663 Based on patch by James Cowgill <james410 (a] cowgill.org.uk>. 19664 19665 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 19666 19667 tests: remove redundant SAMPLE_SIZE definitions. 19668 Remove all definitions of SAMPLE_SIZE that are identical to the fallback 19669 definition in tests/xstatx.c. 19670 19671 * tests/fstat64.c (SAMPLE_SIZE): Remove. 19672 * tests/lstat64.c (SAMPLE_SIZE): Remove. 19673 * tests/stat64.c (SAMPLE_SIZE): Remove. 19674 19675 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 19676 19677 tests: change SAMPLE_SIZE type to libc_off_t. 19678 As ftruncate libc function and our create_sample function that calls 19679 ftruncate both take size argument of type libc_off_t, change the type 19680 of SAMPLE_SIZE constant to libc_off_t. 19681 19682 * tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t. 19683 * tests/lstat.c (SAMPLE_SIZE): Likewise. 19684 * tests/oldfstat.c (SAMPLE_SIZE): Likewise. 19685 * tests/oldlstat.c (SAMPLE_SIZE): Likewise. 19686 * tests/oldstat.c (SAMPLE_SIZE): Likewise. 19687 * tests/stat.c (SAMPLE_SIZE): Likewise. 19688 * tests/xstatx.c (SAMPLE_SIZE): Likewise. 19689 19690 2017-01-13 Alexey Neyman <stilor (a] att.net> 19691 19692 ioctlsort: get ioctl definitions from host, not build. 19693 When cross-compiling, ioctlsort must obtain _IOC_* values from the 19694 host, build's values may be incompatible. 19695 19696 * ioctl_iocdef.c: New file. 19697 * Makefile.am (EXTRA_DIST): Add it. 19698 (ioctl_iocdef.i, ioctl_iocdef.h): New rules. 19699 (ioctlsort%.o): Depend on ioctl_iocdef.h. 19700 (CLEANFILES): Add ioctl_iocdef.h and ioctl_iocdef.i. 19701 * ioctlsort.c: Include "ioctl_iocdef.h" instead of <linux/ioctl.h>. 19702 19703 2017-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 19704 19705 tests: treat struct stat mismatch as an error. 19706 If the test detects struct stat mismatch, this is likely an error 19707 in definitions of a stat structure that might affect strace as well. 19708 Fail the test instead of skipping it to attract more attention. 19709 19710 * tests/xstatx.c (main): Return 1 instead of 77 19711 in case of struct stat mismatch. 19712 19713 2017-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 19714 19715 tests: rewrite diagnostics about struct stat mismatch. 19716 * tests/xstatx.c (LOG_STAT_OFFSETOF_SIZEOF): New macro. 19717 (main): Use it to print struct stat mismatch details. 19718 19719 tests: fix typo in tests/xstatx.c. 19720 * tests/xstatx.c [!IS_FSTAT]: Define IS_FSTAT instead of IS_STAT. 19721 19722 2017-01-12 JingPiao Chen <chenjingpiao (a] gmail.com> 19723 19724 tests: fix typo in mlock.c. 19725 * tests/mlock.c [!(__NR_mlock && __NR_munlock)]: Fix spelling 19726 of SKIP_MAIN_UNDEFINED. 19727 19728 2017-01-12 JingPiao Chen <chenjingpiao (a] gmail.com> 19729 19730 strace: move description of -k option to the appropriate place. 19731 Follow the example of strace.1 and put the description of -k option 19732 into the output format group. 19733 19734 * strace.c (usage): Move description of -k option to the output 19735 format group. 19736 19737 2017-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 19738 19739 Remove redundant commas at the end of structure initializers. 19740 Automatically remove redundant commas using the following 19741 sed expression: 19742 19743 git grep -El ',[[:space:]]+}' |xargs sed -ri 's/,([[:space:]]+\})/\1/' 19744 19745 * linux/32/syscallent.h: Remove redundant commas at the end of structure 19746 initializers. 19747 * linux/64/syscallent.h: Likewise. 19748 * linux/alpha/syscallent.h: Likewise. 19749 * linux/arm/syscallent.h: Likewise. 19750 * linux/avr32/syscallent.h: Likewise. 19751 * linux/bfin/syscallent.h: Likewise. 19752 * linux/crisv10/syscallent.h: Likewise. 19753 * linux/hppa/syscallent.h: Likewise. 19754 * linux/i386/syscallent.h: Likewise. 19755 * linux/ia64/syscallent.h: Likewise. 19756 * linux/m68k/syscallent.h: Likewise. 19757 * linux/microblaze/syscallent.h: Likewise. 19758 * linux/microblaze/userent.h: Likewise. 19759 * linux/mips/syscallent-n32.h: Likewise. 19760 * linux/mips/syscallent-n64.h: Likewise. 19761 * linux/mips/syscallent-o32.h: Likewise. 19762 * linux/powerpc/syscallent.h: Likewise. 19763 * linux/powerpc64/syscallent.h: Likewise. 19764 * linux/s390/syscallent.h: Likewise. 19765 * linux/s390x/syscallent.h: Likewise. 19766 * linux/sh/syscallent.h: Likewise. 19767 * linux/sh64/syscallent.h: Likewise. 19768 * linux/sparc/syscallent.h: Likewise. 19769 * linux/sparc64/syscallent.h: Likewise. 19770 * linux/x32/syscallent.h: Likewise. 19771 * linux/x86_64/syscallent.h: Likewise. 19772 * linux/xtensa/syscallent.h: Likewise. 19773 * tests/kexec_file_load.c: Likewise. 19774 19775 Reported-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 19776 19777 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19778 19779 tests: check decoding of scsi ioctl commands. 19780 * tests/ioctl_scsi.c: New file. 19781 * tests/ioctl_scsi.test: New test. 19782 * tests/.gitignore: Add ioctl_scsi. 19783 * tests/Makefile.am (check_PROGRAMS): Likewise. 19784 (DECODER_TESTS): Add ioctl_scsi.test. 19785 19786 scsi: implement decoding of all SG_* ioctl commands. 19787 * print_sg_req_info.c: New file. 19788 * Makefile.am (strace_SOURCES): Add it. 19789 * xlat/sg_scsi_reset.in: New file. 19790 * scsi.c: Include "xlat/sg_scsi_reset.h". 19791 (scsi_ioctl): Implement decoding of all SG_* ioctl commands. 19792 19793 scsi: prepare for decoding of other SG_* ioctl commands. 19794 * scsi.c (scsi_ioctl): Introduce a switch statement. 19795 19796 tests: check decoding of ioctl SG_IO v3 commands. 19797 * tests/ioctl_sg_io_v3.c: New file. 19798 * tests/ioctl_sg_io_v3.test: New test. 19799 * tests/.gitignore: Add ioctl_sg_io_v3. 19800 * tests/Makefile.am (check_PROGRAMS): Likewise. 19801 (DECODER_TESTS): Add ioctl_sg_io_v3.test. 19802 19803 tests: check decoding of ioctl SG_IO v4 commands. 19804 * tests/ioctl_sg_io_v4.c: New file. 19805 * tests/ioctl_sg_io_v4.test: New test. 19806 * tests/.gitignore: Add ioctl_sg_io_v4. 19807 * tests/Makefile.am (check_PROGRAMS): Likewise. 19808 (DECODER_TESTS): Add ioctl_sg_io_v4.test. 19809 19810 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19811 19812 scsi: add fallback definitions for SG_* ioctl command constants. 19813 Unfortunately, <scsi/sg.h> from libc does not provide all constants 19814 recognized by the kernel. 19815 19816 * xlat/scsi_sg_commands.in: New file. 19817 * scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing 19818 a fallback definition of SG_IO. 19819 19820 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19821 19822 xlat: provide fallback definitions for BSG_FLAG_* constants. 19823 BSG_FLAG_* constants were introduced later than the header file where 19824 they are defined. 19825 19826 * xlat/bsg_flags.in: Add default values for constants. 19827 19828 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19829 19830 xlat: provide fallback definitions for SG_FLAG_* constants. 19831 Unfortunately, <scsi/sg.h> from libc does not provide all constants 19832 recognized by the kernel. 19833 19834 * xlat/sg_io_flags.in: Add default values for constants. 19835 19836 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19837 19838 sg_io_v4: print din_resid and dout_resid fields as signed integers. 19839 * sg_io_v4.c (decode_response): Print din_resid and dout_resid fields 19840 using %d format. 19841 19842 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19843 19844 sg_io: cleanup printing of sg_io buffers. 19845 Turn print_sg_io_buffer into a universal sg_io buffer printer. 19846 19847 * sg_io_v3.c (print_sg_io_buffer): Add iovec_count argument. 19848 Call tprint_iov_upto when iovec_count is non-zero. 19849 (decode_request, decode_response): Do not call tprint_iov_upto directly, 19850 use print_sg_io_buffer instead. 19851 * sg_io_v4.c: Likewise. 19852 19853 2017-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 19854 19855 sg_io: decode structures on exiting syscall in case of syserror. 19856 The SCSI driver, starting with kernel commit v2.6.25-rc1~1230^2~78, 19857 translates its "struct request.errors" to ioctl errors after 19858 filling in all the output members of the SG_IO header structure. 19859 19860 As there is no easy way to tell SCSI layer errors from other syscall 19861 errors, decode the structure on exiting syscall in case of syserror, 19862 too. 19863 19864 * scsi.c (scsi_ioctl): Do not call set_tcb_priv_ulong, use 19865 get_tcb_priv_data instead of get_tcb_priv_ulong, call decode_sg_io 19866 unconditionally. 19867 * sg_io_v3.c (decode_request): Save a copy of struct_sg_io_hdr using 19868 set_tcb_priv_data. 19869 (decode_response): Restore it using get_tcb_priv_data. Print its i/o 19870 fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto 19871 unconditionally. 19872 * sg_io_v4.c (decode_request): Save a copy of struct sg_io_v4 using 19873 set_tcb_priv_data. 19874 (decode_response): Restore it using get_tcb_priv_data. Print its i/o 19875 fields when umove call fails. Pass IOV_DECODE_STR to tprint_iov_upto 19876 unconditionally. 19877 19878 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19879 19880 sg_io: reorder printing of fields to follow structure order. 19881 * sg_io_v4.c (decode_request): Print timeout, flags, and usr_ptr fields 19882 after dout_xferp field. 19883 19884 sg_io_v3: print sg_io_hdr.duration field as unsigned integer. 19885 * sg_io_v3.c (decode_response): Print duration field using %u format. 19886 19887 sg_io_v3: print msg_status field. 19888 * sg_io_v3.c (decode_response): Print msg_status field. 19889 19890 sg_io: print names of array fields and corresponding length fields. 19891 * sg_io_v3.c (decode_request): Print names of cmd_len, cmdp, 19892 and dxferp fields. 19893 (decode_response): Print names of dxferp, sb_len_wr, and sbp fields. 19894 * sg_io_v4.c (decode_request): Print names of request_len, request, 19895 dout_xfer_len, and dout_xferp fields. 19896 (decode_response): Print names of response_len, response, 19897 and din_xferp fields. 19898 19899 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19900 19901 sg_io_v3: print status fields using %#x format specifier. 19902 The formerly used format string %02x led to misleading output as there 19903 was no clear indication sometimes whether the printed integer was 19904 decimal or hexadecimal. 19905 19906 * sg_io_v3.c (decode_response): Print status and masked_status fields 19907 using %#x format specifier instead of %02x. 19908 19909 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19910 19911 sg_io_v4: print status fields in a hexadecimal form. 19912 The tradition is to print scsi status codes in a hexadecimal form. 19913 19914 * sg_io_v4.c (decode_response): Print driver_status, transport_status, 19915 and device_status fields using %#x format specifier instead of %u. 19916 19917 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19918 19919 sg_io_v4: print request_tag and generated_tag fields in hex. 19920 The tradition is to print scsi tags in a hexadecimal form. 19921 19922 * sg_io_v4.c (decode_request): Print request_tag field 19923 using ("%#" PRI__x64) format string. 19924 (decode_response): Print generated_tag field using ("%#" PRI__x64) 19925 format string. 19926 19927 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19928 19929 sg_io_v4: print usr_ptr field in a hexadecimal form. 19930 As the nature of this field is pointer-like, print it 19931 in a hexadecimal form. 19932 19933 * sg_io_v4.c (decode_request): Print usr_ptr field 19934 using ("%#" PRI__x64) format string. 19935 19936 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19937 19938 sg_io_v4: do not print spare_in and spare_out fields. 19939 As the kernel does not touch these fields, there is no use 19940 to print them. 19941 19942 * sg_io_v4.c (decode_request): Do not print spare_in field. 19943 (decode_response): Do not print spare_out field. 19944 19945 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19946 19947 sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info. 19948 Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags. 19949 19950 * xlat/sg_io_info.in: New file. 19951 * defs.h (sg_io_info): New xlat prototype. 19952 * sg_io_v3.c: Include "xlat/sg_io_info.h". 19953 (decode_response): Print struct_sg_io_hdr.info using printflags. 19954 * sg_io_v4.c: (decode_response): Print struct sg_io_v4.info 19955 using printflags. 19956 19957 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19958 19959 sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags. 19960 Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags. 19961 19962 * xlat/sg_io_flags.in: New file. 19963 * sg_io_v3.c: Include "xlat/sg_io_flags.h". 19964 (decode_request): Print struct_sg_io_hdr.flags using printflags. 19965 * xlat/bsg_flags.in: New file. 19966 * sg_io_v4.c: Include "xlat/bsg_flags.h". 19967 (decode_request): Print struct sg_io_v4.flags using printflags. 19968 19969 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19970 19971 Mpersify struct sg_io_hdr. 19972 struct sg_io_hdr contains pointers and therefore has to be mpersified. 19973 19974 * defs.h (decode_sg_io_v3): Remove prototype. 19975 * sg_io_v3.c (struct_sg_io_hdr): Typedef to struct sg_io_hdr. 19976 Mpersify it. 19977 (decode_sg_io_v3): Wrap into MPERS_PRINTER_DECL. 19978 19979 2017-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 19980 19981 Split scsi.c. 19982 Move decoders of SG_IO v3 and v4 APIs into separate files, 19983 compile generic SG_IO decoder unconditionally. 19984 19985 * sg_io_v3.c: New file. 19986 * sg_io_v4.c: Likewise. 19987 * Makefile.am (strace_SOURCES): Add them. 19988 * defs.h (decode_sg_io_v3, decode_sg_io_v4): New prototypes. 19989 * ioctl.c (ioctl_decode): Remove [HAVE_SCSI_SG_H] condition. 19990 * scsi.c: (print_sg_io_res): Remove. 19991 (print_sg_io_req): Rename to decode_sg_io, replace print_sg_io_v3_req 19992 with decode_sg_io_v3, replace print_sg_io_v4_req with decode_sg_io_v4, 19993 compile uncoditionally. 19994 (scsi_ioctl): Replace print_sg_io_req and print_sg_io_res 19995 with decode_sg_io, compile uncoditionally. 19996 Move [HAVE_SCSI_SG_H] code to sg_io_v3.c. 19997 Move [HAVE_LINUX_BSG_H] code to sg_io_v4.c. 19998 19999 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 20000 20001 scsi: detect and print changes of interface id. 20002 * scsi.c (print_sg_io_v3_res): Detect and print changes 20003 of struct sg_io_hdr.interface_id field between entering and exiting 20004 syscall. 20005 (print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard 20006 field between entering and exiting syscall. 20007 20008 scsi: print field names of all fields being printed. 20009 * scsi.c (print_sg_io_v3_req): Always print the name 20010 of struct sg_io_hdr.interface_id field. 20011 (print_sg_io_v4_req): Always print the name of struct sg_io_v4.guard 20012 field. 20013 (print_sg_io_req): Print unknown interface id as an integer. 20014 (scsi_ioctl): Save interface id on entering syscall and use it 20015 on exiting syscall. 20016 20017 scsi: print struct sg_io_hdr.dxfer_direction field name. 20018 * scsi.c (print_sg_io_v3_req): Print struct sg_io_hdr.dxfer_direction 20019 field name. 20020 20021 scsi: print "protocol" and "subprotocol" field names of struct sg_io_v4. 20022 * scsi.c (print_sg_io_v4_req): Print field names 20023 of struct sg_io_v4.protocol and struct sg_io_v4.subprotocol. 20024 20025 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 20026 20027 Print hexadecimal integer in error diagnostics using %#x. 20028 The formerly used format string %x led to misleading output as there was 20029 no clear indication sometimes whether the printed integer was decimal or 20030 hexadecimal. 20031 20032 * aio.c (startup_child, test_ptrace_seize): Print status 20033 using %#x format specifier instead of %x. 20034 20035 2017-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 20036 20037 aio: print hexadecimal integer using %#x. 20038 The formerly used format string %x led to misleading output as there was 20039 no clear indication sometimes whether the printed integer was decimal or 20040 hexadecimal. 20041 20042 * aio.c (print_common_flags): Print struct iocb.aio_flags using %#x 20043 format specifier instead of %x. 20044 * tests/aio.c (main): Likewise. 20045 20046 2017-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 20047 20048 scsi: rewrite print_sg_io_buffer using printstr_ex(QUOTE_FORCE_HEX) 20049 As printstr_ex has got QUOTE_FORCE_HEX flag support, there is no need 20050 to implement it manually any longer. 20051 20052 * scsi.c (print_uchar): Remove. 20053 (print_sg_io_buffer): Rewrite using printstr_ex(QUOTE_FORCE_HEX). 20054 20055 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20056 20057 getrandom: print string as hex-escaped. 20058 Since there is no reason to interpret the value returned by getrandom as 20059 ASCII string, it makes sense to always print it as a hex-escaped string. 20060 20061 * getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead 20062 of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order 20063 to force hex-escaped string formatting. 20064 * tests/getrandom.test: Remove no longer needed -xx flag as the string 20065 is always printed in hexadecimal format now. 20066 20067 Suggested-by: JingPiao Chen <chenjingpiao (a] gmail.com> 20068 20069 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20070 20071 util: add support for forcing printing string as hex-escaped. 20072 This could be useful in cases when some binary data should not be 20073 interpreted as an ASCII string, but rather as an array of byte values. 20074 20075 * defs.h (QUOTE_FORCE_HEX): New macro constant. 20076 * util.c (quote_string): Enable use_hex when QUOTE_FORCE_HEX is set 20077 in user_style parameter. 20078 20079 2017-01-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20080 20081 term: do not abort decoding in case of non-verbose output. 20082 The case of unset verbose is handled by umoven_or_printaddr, moreover, 20083 exiting at this point is plain wrong and leads to last argument not 20084 being printed while it should be. 20085 20086 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 20087 decode_modem_flags): Do not check verbose flags explicitly and do not 20088 exit early if it is not set. 20089 20090 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 20091 20092 tests: skip fault injection tests on hppa if the kernel is too old. 20093 * tests/fault_injection.sh: Add the minimal kernel version for hppa. 20094 20095 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 20096 20097 tests: skip readahead.test on MIPS n64 when built with glibc < 2.25. 20098 Due to a bug in glibc readahead syscall wrapper on MIPS n64, 20099 this wrapper cannot be used in readahead.test. 20100 20101 * tests/readahead.c [HAVE_READAHEAD && LINUX_MIPSN64 && glibc < 2.25]: 20102 Undefine HAVE_READAHEAD. 20103 20104 Reported-by: James Cowgill <james410 (a] cowgill.org.uk> 20105 20106 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 20107 20108 tests: replace init_magic with fill_memory. 20109 Use the same fill_memory/fill_memory_ex interface in all affected tests. 20110 20111 * tests/ioctl_block.c (init_magic): Remove. 20112 (main): Replace init_magic with fill_memory. 20113 * tests/ioctl_evdev.c: Likewise. 20114 * tests/ioctl_v4l2.c: Likewise. 20115 * tests/ioctl_mtd.c (magic, init_magic): Remove. 20116 (main): Replace init_magic with fill_memory. 20117 * tests/ioctl_rtc.c: Likewise. 20118 20119 2017-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 20120 20121 tests: rewrite ioctl_v4l2 test without reliance on init_magic. 20122 * tests/ioctl_v4l2.c (cc0, cc1, cc2, cc3, fourcc): New macros. 20123 (main): Use them. Rewrite expected output without assumptions 20124 on any particular magic data. 20125 20126 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 20127 20128 tests: remove redundant casts in fill_memory{,_ex} invocations. 20129 * tests/ioctl_loop.c (main): Remove redundant casts of fill_memory 20130 first argument. 20131 * tests/kexec_load.c (main): Likewise. 20132 * tests/perf_event_open.c (main): Likewise. 20133 * tests/quotactl.c (main): Likewise. 20134 * tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex 20135 first argument. 20136 * tests/quotactl-xfs.c (main): Likewise. 20137 20138 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 20139 20140 tests: change the type of fill_memory{,_ex} first argument to void * 20141 As these functions behave like memset, it's more convenient to have 20142 the first argument of type void * like memset. 20143 20144 * tests/fill_memory.c (fill_memory, fill_memory_ex): Change the type 20145 of first argument from "char *" to "void *". 20146 * tests/tests.h (fill_memory, fill_memory_ex): Likewise. 20147 20148 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20149 20150 tests: check non-verbose decoding of LOOP_* ioctls. 20151 * tests/ioctl_loop-nv.c: New file. 20152 * tests/ioctl_loop-nv.test: New test. 20153 * tests/ioctl_loop.c [!ABBREV] (ABBREV): Define to 0. 20154 (print_loop_info, print_loop_info64): Handle [ABBREV != 0] case. 20155 * tests/.gitignore: Add ioctl_loop-nv. 20156 * tests/Makefile.am (check_PROGRAMS): Likewise. 20157 20158 tests: add more checks of LOOP_* ioctls decoding. 20159 * tests/ioctl_loop.c: Include <linux/ioctl.h>. 20160 (magic, lmagic): Move static constants ... 20161 (main): ... here. Change types of magic constants to kernel_ulong_t. 20162 Add more checks. 20163 20164 2017-01-04 JingPiao Chen <chenjingpiao (a] gmail.com> 20165 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20166 20167 tests: check decoding of LOOP_* ioctls. 20168 * tests/ioctl_loop.c: New file. 20169 * tests/ioctl_loop-v.c: Likewise. 20170 * tests/ioctl_loop.test: New test. 20171 * tests/ioctl_loop-v.test: Likewise. 20172 * tests/.gitignore: Add ioctl_loop and ioctl_loop-v. 20173 * tests/Makefile.am (check_PROGRAMS): Likewise. 20174 (DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test. 20175 20176 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 20177 20178 Drop vsprintf.c. 20179 Drop custom vfprintf implementation that was disabled by default. 20180 Apparently nobody tests strace with this vfprintf enabled, otherwise 20181 multiple uses of format specifiers not supported by this custom vfprintf 20182 would not left unnoticed. 20183 20184 The GNU C library is not the only libc available, so those who want 20185 faster implementations of libc functions are encouraged to try building 20186 strace with other libc implementations. 20187 20188 * vsprintf.c: Remove. 20189 * Makefile.am (strace_SOURCES): Remove vsprintf.c. 20190 * defs.h (USE_CUSTOM_PRINTF, strace_vfprintf): Remove. 20191 * strace.c (tprintf): Replace strace_vfprintf with vfprintf. 20192 20193 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20194 20195 loop: remove unnecessary verbose check. 20196 The verbose flag is responsible for dereferencing of addresses, and it 20197 is perfectly handled by umove_or_printaddr; moreover, this early exit 20198 leads to incorrect formatting of last argument. 20199 20200 * loop.c (loop_ioctl): Do not check verbose flag explicitly and do not 20201 exit early if it is not set. 20202 20203 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20204 20205 loop: fix lo_encrypt_key field output. 20206 lo_encrypt_key is a sized string with its size specified by 20207 lo_encrypt_key_size field, so take lo_encrypt_key_size into account. 20208 20209 * loop.c (decode_loop_info, decode_loop_info64): Use minimum of 20210 LO_KEY_SIZE and lo_encrypt_key_size field value as lo_encrypt_key size. 20211 20212 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20213 20214 loop: print lo_encrypt_key_size field of struct loop_info as unsigned. 20215 It is converted to an unsigned value in kernel (see loop_info64_from_old 20216 in drivers/block/loop.c), so let's print it that way despite its type. 20217 20218 * loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t 20219 value. 20220 20221 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20222 20223 tests: add more checks of unknown ioctl command formatting. 20224 * tests/ioctl.c (main): Additional check for unknown ioctl command 20225 decoding. 20226 * tests/ioctl_evdev.c (main): Likewise. 20227 * tests/ioctl_dm.c: Include <linux/ioctl.h> for _IOC_SIZE and _IOC_NR. 20228 (main) <dummy_dm_ioctl1, dummy_dm_ioctl2, dummy_dm_arg>: New constants. 20229 Add more checks for unknown command formatting. 20230 20231 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20232 20233 ioctl: do not print explicit 0x prefix and do not specify minimum width. 20234 Specifying output width for size argument is rather misleading - it can 20235 be up to 14 bits in size. The use of explicit "0x" prefix is 20236 discouraged because 0x0 looks ugly. Usage of width specification along 20237 with alternate form flag leads to inconsistent output for 0. 20238 Let's use just plain %#x qualifiers instead. 20239 20240 * ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command 20241 type, number and size to "%#x". 20242 * tests/ioctl.c (main): Update expected test output. 20243 * tests/ioctl_dm.c (main): Likewise. 20244 * tests/ioctl_evdev.c (main): Likewise. 20245 20246 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20247 20248 loop: fix printing of the reserved field array items. 20249 They are of char type, so "hh" length modifier should be used (otherwise 20250 they are printed incorrectly as they are sign extended implicitly when 20251 passed as printf arguments in case char is a signed type which is true 20252 for most compilers). 20253 20254 * loop.c (decode_loop_info): Change "%#x" printf qualifier to "%#hhx" 20255 in printing routine for array elements of the "reserved" field of 20256 loop_info structure. 20257 20258 2017-01-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20259 20260 tests: check ioctl(SIOCGIFCONF) decoding. 20261 * tests/ioctl_sock_gifconf.c: New file. 20262 * tests/ioctl_sock_gifconf.test: New test. 20263 * tests/.gitignore: Add ioctl_sock_gifconf. 20264 * tests/Makefile.am (check_PROGRAMS): Likewise. 20265 (DECODER_TESTS): Add ioctl_sock_gifconf.test. 20266 20267 dm.c: add copyright notice. 20268 20269 2017-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 20270 20271 Add scno.h and syscallent.i to .gitignore files. 20272 * .gitignore: Add /scno.h and /syscallent.i. 20273 * tests/.gitignore: Add scno.h and syscallent.i. 20274 20275 2017-01-04 JingPiao Chen <chenjingpiao (a] gmail.com> 20276 20277 tests/.gitignore: add generated files that should be ignored. 20278 * tests/.gitignore: Replace addkey with add_key, add attach-f-p-cmd. 20279 20280 2017-01-03 Dmitry V. Levin <ldv (a] altlinux.org> 20281 20282 Remove checks of __NR_* availability from strace source code. 20283 * strace.c: Remove __NR_tkill checks, assume it is always defined. 20284 * util.c: Remove __NR_process_vm_readv checks and fallback definitions, 20285 assume it is always defined. 20286 20287 Include "scno.h" in files that check __NR_* constants. 20288 * strace.c: Include "scno.h". 20289 * util.c: Likewise. 20290 20291 Generate scno.h for use during the build of strace itself. 20292 * Makefile.am: Include scno.am. 20293 ($(strace_OBJECTS)): New rule. 20294 20295 2017-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 20296 20297 Generate scno.h without invoking a generated executable helper. 20298 Generate scno.h using only those tools that are available for cross 20299 build. This allows to use scno.h during the build of strace itself. 20300 20301 * scno.am: New file. 20302 * scno.head: New file. 20303 * Makefile.am (EXTRA_DIST): Add it. 20304 * tests/generate_scno.c: Remove. 20305 * tests/.gitignore: Remove generate_scno. 20306 * tests/Makefile.am (check_PROGRAMS): Likewise. 20307 (CLEANFILES): Remove scno.h. 20308 (scno.h, $(scno_dependants)): Remove rules. 20309 (scno_dependants): Remove. 20310 ($(objects)): New rule. 20311 Include ../scno.am. 20312 20313 2017-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 20314 20315 Update all publicly shown copyright year number ranges. 20316 * COPYING: Update copyright year number range. 20317 * configure.ac: Likewise. 20318 * strace.c: Likewise. 20319 * tests/strace-V.test: Use the current year for the check. 20320 20321 2016-12-31 Dmitry V. Levin <ldv (a] altlinux.org> 20322 20323 defs.h: stop including <asm/unistd.h> 20324 Limit the number of files where <asm/unistd.h> is included 20325 to only those few that need it. 20326 20327 * defs.h: Do not include <asm/unistd.h>. 20328 * clone.c: Include <asm/unistd.h>. 20329 * strace.c: Likewise. 20330 * syscall.c: Likewise. 20331 * util.c: Likewise. 20332 20333 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 20334 20335 tests: do not use BUILT_SOURCES. 20336 * tests/Makefile.am (ksysent.$(OBJEXT)): New rule. 20337 (BUILT_SOURCES): Remove. 20338 20339 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 20340 20341 Fix cross build. 20342 This fixes cross build regression introduced by commit 20343 v4.15-39-g605a705a63d533dceb3c2d489468fcd3aed3963c. 20344 20345 * tests/Makefile.am (BUILT_SOURCES): Remove scno.h 20346 (objects, scno_dependants): New variables. 20347 ($(scno_dependants)): New rule. 20348 20349 Reported-by: Joakim Bech <joakim.bech (a] linaro.org> 20350 20351 2016-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 20352 20353 tests: do not use defs.h and syscall.h. 20354 * tests/generate_scno.c: Include "tests.h", "sysent.h", <stdio.h>, 20355 <string.h>, and <asm/unistd.h> instead of "defs.h" and "syscall.h". 20356 * tests/ksysent.c: Likewise. 20357 * tests/nsyscalls.c: Include "tests.h", "sysent.h", <errno.h>, 20358 <stdio.h>, and <unistd.h> instead of "defs.h" and "syscall.h". 20359 20360 Move definition of struct sysent and trace flags to a separate file. 20361 * sysent.h: New file. 20362 * Makefile.am (strace_SOURCES): Add it. 20363 * defs.h: Include it. 20364 (struct sysent, TRACE_FILE, TRACE_IPC, TRACE_NETWORK, TRACE_PROCESS, 20365 TRACE_SIGNAL, TRACE_DESC, TRACE_MEMORY, SYSCALL_NEVER_FAILS, 20366 STACKTRACE_INVALIDATE_CACHE, STACKTRACE_CAPTURE_ON_ENTER, 20367 TRACE_INDIRECT_SUBCALL, COMPAT_SYSCALL_TYPES): Remove. 20368 20369 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20370 20371 Mpersify SIOC* ioctls. 20372 struct ifreq and struct ifconf are ABI-dependent and should have been 20373 mpersified. 20374 20375 * defs.h (sock_ioctl): Remove prototype. 20376 * sock.c (struct_ifconf, struct_ifreq): New typedefs. 20377 (DEF_MPERS_TYPE(struct_ifconf), DEF_MPERS_TYPE(struct_ifreq), 20378 MPERS_DEFS): New includes. 20379 (print_ifreq, print_ifc_len, print_ifconf_ifreq): Replace struct ifreq 20380 with struct_ifreq. 20381 (decode_ifconf): Replace struct ifconf with struct_ifconf, struct ifreq 20382 with struct_fireq. 20383 (sock_ioctl): Wrap into MPERS_PRINTER_DECL. 20384 20385 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20386 Dmitry V. Levin <ldv (a] altlinux.org> 20387 20388 sock: rewrite decode_ifconf. 20389 * sock.c (decode_ifconf): Rewrite. 20390 20391 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20392 20393 xlat: update LOOP_* ioctl flags constants. 20394 * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_USE_AOPS 20395 and LO_FLAGS_DIRECT_IO. 20396 * xlat/loop_flags_options.in: Likewise. Add default values 20397 for constants. 20398 20399 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20400 20401 loop: add fallback definitions for LOOP_* ioctl command constants. 20402 Since these are architecture-independent and have been added over the 20403 kernel's lifetime, it makes sense to have these definitions in strace 20404 itself. 20405 20406 * xlat/loop_cmds.in: New file. 20407 * loop.c: Include "xlat/loop_cmds.h". 20408 (loop_ioctl): Eliminate conditional compilation based on availability 20409 of LOOP_* constant definitions. 20410 20411 2016-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 20412 20413 xlat: extend syntax. 20414 * xlat/gen.sh: Implement #stop directive that stops preprocessor 20415 at the line it has been encountered during the first pass. This could 20416 be used, for example, to provide fallback definitions for constants 20417 without defining xlat tables. 20418 20419 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20420 Dmitry V. Levin <ldv (a] altlinux.org> 20421 20422 loop: mpersify struct loop_info and loop_ioctl function. 20423 struct loop_info contains fields of type long, so it definitely should 20424 have been mpersified. 20425 20426 * defs.h (loop_ioctl): Remove prototype. 20427 * loop.c (struct_loop_info): New typedef. 20428 Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS. 20429 (decode_loop_info): Replace struct loop_info with struct_loop_info. 20430 Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print 20431 them using appropriate format specifiers. 20432 (loop_ioctl): Wrap into MPERS_PRINTER_DECL. 20433 20434 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20435 20436 loop: print lo_device and lo_rdevice fields using print_dev_t. 20437 * loop.c (decode_loop_info, decode_loop_info64): Use print_dev_t 20438 for printing lo_device and lo_rdevice fields. 20439 20440 2016-12-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20441 Dmitry V. Levin <ldv (a] altlinux.org> 20442 20443 Move device number printing code into a separate routine. 20444 * print_dev_t.c: New file. 20445 * Makefile.am (strace_SOURCES): Add it. 20446 * defs.h (print_dev_t): New prototype. 20447 * dm.c: Do not include <sys/sysmacros.h>. 20448 (dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use 20449 print_dev_t function for printing device numbers. 20450 * mknod.c: Do not include <sys/sysmacros.h>. 20451 (decode_mknod): Use print_dev_t function for printing device number. 20452 * print_struct_stat.c: Do not include <sys/sysmacros.h>. 20453 (print_struct_stat): Use print_dev_t function for printing device 20454 numbers. 20455 20456 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 20457 20458 tests: enhance invalid address decoding check in seccomp-strict.test. 20459 * tests/seccomp-strict.c (main): Change the type of addr variable 20460 containg the invalid address from unsigned long to kernel_ulong_t, 20461 print it using %#llx format. 20462 20463 2016-12-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20464 20465 tests: check decoding of prctl PR_GET_TID_ADDRESS operation. 20466 * tests/prctl-tid_address.c: New file. 20467 * tests/prctl-tid_address.test: New test. 20468 * tests/.gitignore: Add prctl-tid_address. 20469 * tests/Makefile.am (check_PROGRAMS): Likewise. 20470 (DECODER_TESTS): Add prctl-tid_address.test. 20471 20472 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 20473 20474 Update the publicly shown copyright information. 20475 Set the publicly shown copyright holder to "The strace developers.". 20476 20477 * COPYING: Update copyright information. 20478 * configure.ac: Add AC_COPYRIGHT. 20479 * strace.c (print_version): New function. 20480 (init): Use it. 20481 * tests/strace-V.test: Update expected output. 20482 20483 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 20484 20485 configure: specify project URL. 20486 * configure.ac (AC_INIT): Add URL. 20487 20488 2016-12-28 Seraphime Kirkovski <kirkseraph (a] gmail.com> 20489 20490 Document signal injection. 20491 * strace.1: Describe :signal=SIG option of the fault injection syntax. 20492 * NEWS: Mention signal injection. 20493 20494 2016-12-28 Seraphime Kirkovski <kirkseraph (a] gmail.com> 20495 20496 Implement signal injection. 20497 This extends the fault injection capability with :signal=SIG option 20498 which injects a signal on entering each syscall from the specified set. 20499 20500 :signal and :error options are complementary, if they are both specified 20501 the syscall will be fault injected as usual and the specified signal 20502 will be delivered to the tracee. 20503 20504 * defs.h (struct fault_opts): Change the type of err field to int16_t, 20505 add signo field. 20506 (trace_syscall): Add a pointer argument. 20507 * qualify.c: Include "nsig.h". 20508 (parse_fault_token): Handle signal= option. 20509 (qualify_fault): Update default fault_opts. 20510 * strace.c (trace): Forward signal number from trace_syscall 20511 to ptrace_restart(PTRACE_SYSCALL). 20512 * syscall.c (inject_syscall_fault_entering): Add pointer argument, 20513 save there the signal number specified by fault options. Do not inject 20514 a syscall fault unless instructed by fault options. 20515 (update_syscall_fault_exiting): Update the error code injection check. 20516 (trace_syscall_entering): Add pointer argument, forward it to 20517 inject_syscall_fault_entering. 20518 (trace_syscall): Add pointer argument, forward it to 20519 trace_syscall_entering. 20520 20521 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 20522 20523 Update README.md. 20524 * README.md: Update homepage URL, mention command-line interface 20525 and tampering capabilities in the description. 20526 20527 2016-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 20528 20529 tests: robustify prctl-arg2-intptr.test. 20530 Robustify prctl-arg2-intptr.test against unrelated prctl invocations. 20531 20532 * tests/prctl-arg2-intptr.test: Filter out unrelated PR_GET_* 20533 and PR_SET_* prctl calls. 20534 20535 2016-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 20536 20537 signal: remove redundant checks around NSIG. 20538 * signal.c (struct old_sigaction, struct new_sigaction, 20539 struct new_sigaction32): Remove safety checks for NSIG >= sizeof(long). 20540 20541 Introduce NSIG_BYTES. 20542 * nsig.h (NSIG_BYTES): New macro. 20543 * desc.c: Use it in comments instead of NSIG. 20544 * epoll.c: Likewise. 20545 * poll.c: Likewise. 20546 * signalfd.c: Likewise. 20547 * signal.c: Likewise. 20548 (sprintsigmask_n, print_sigset_addr_len_limit): Use it instead of NSIG. 20549 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Likewise. 20550 * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. 20551 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. 20552 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 20553 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. 20554 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 20555 * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. 20556 * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. 20557 * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. 20558 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. 20559 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 20560 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. 20561 * tests/pselect6.c (main): Likewise. 20562 20563 Move NSIG ifdefery to a separate header file. 20564 * nsig.h: New file. 20565 * Makefile.am (strace_SOURCES): Add it. 20566 * signal.c: Include "nsig.h" instead of <signal.h>, remove 20567 NSIG workarounds. 20568 * sigreturn.c: Likewise. 20569 * syscall.c: Likewise. 20570 * tests/pselect6.c: Likewise. 20571 20572 Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro. 20573 * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): New macro. 20574 (truncate_klong_to_current_wordsize, 20575 truncate_kulong_to_current_wordsize): Use it. 20576 * mem.c (SYS_FUNC(old_mmap)): Likewise. 20577 * util.c (umoven, umovestr, dumpiov_upto): Likewise. 20578 * syscall.c (trace_syscall_exiting): Likewise. 20579 20580 Simplify personality checks in msghdr.c and signal.c. 20581 * msghdr.c: Check for [!current_wordsize] instead 20582 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]. 20583 * signal.c: Likewise. 20584 20585 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20586 20587 Replace widen_to_long with truncate_klong_to_current_wordsize. 20588 * defs.h (widen_to_long): Remove. 20589 (truncate_klong_to_current_wordsize): New static inline function. 20590 * aio.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents): Use it 20591 instead of widen_to_long. 20592 * linux/sparc64/get_syscall_args.c (get_syscall_args): Update comment. 20593 * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise. 20594 20595 Replace widen_to_ulong with truncate_kulong_to_current_wordsize. 20596 * defs.h (widen_to_ulong): Remove. 20597 (truncate_kulong_to_current_wordsize): New static inline function. 20598 * io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong. 20599 20600 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20601 20602 Simplify print_lld_from_low_high_val ifdefery. 20603 The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler 20604 implementation. 20605 20606 * io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4 20607 && SIZEOF_LONG == SIZEOF_LONG_LONG] 20608 and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases 20609 into a single [SIZEOF_KERNEL_LONG_T > 4] case. 20610 [SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long 20611 instead of zero_extend_signed_to_ull. 20612 20613 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20614 20615 Simplify getllval ifdefery. 20616 The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler 20617 implementation. 20618 20619 * util.c (getllval): Merge [SIZEOF_LONG > 4 20620 && SIZEOF_LONG == SIZEOF_LONG_LONG] 20621 and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases 20622 into a single [SIZEOF_KERNEL_LONG_T > 4] case. 20623 20624 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20625 20626 prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long. 20627 Since there is no compat handler for x32/n32, kernel returns kernel's 20628 long as a result of the call. 20629 20630 Interesting, does any callee out there actually care to have enough room 20631 allocated for kernel long? 20632 20633 * prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr 20634 to print the value stored at address pointed by addr2 argument 20635 of PR_GET_TID_ADDRESS operation. 20636 20637 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20638 20639 Add functions for printing pointers of kernel_ulong_t size. 20640 In cases where no compat for x32/n32 is implemented, pointer is of 20641 kernel's long size, so it should be printed appropriately. 20642 20643 * defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype. 20644 (printnum_kptr): New macro. 20645 * util.c [!current_klongsize] (printnum_addr_klong_int): New function. 20646 20647 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20648 Dmitry V. Levin <ldv (a] altlinux.org> 20649 20650 Print indirect pointers as pointers. 20651 Originally, printnum_long_int was used, but it prints NULL incorrectly. 20652 20653 * defs.h (DECL_PRINTNUM_ADDR): New macro. 20654 (DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes. 20655 [!current_wordsize] (printnum_addr_long_int): New prototype. 20656 [!current_wordsize] (printnum_ptr): Use it. 20657 [current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64. 20658 [current_wordsize == 4] (printnum_ptr) Use printnum_addr_int. 20659 * util.c (DEF_PRINTNUM_ADDR): New macro. 20660 (DEF_PRINTNUM_ADDR(int, unsigned int), 20661 DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that 20662 provide printnum_addr_int and printnum_addr_int64, accordingly. 20663 [!current_wordsize] (printnum_addr_long_int): New function. 20664 * xet_robust_list.c (sprintaddr): New function. 20665 (main): Use it, update expected output. 20666 * tests/ipc_sem.c (main): Update expected output. 20667 20668 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20669 20670 ipc_sem: print 4th argument of semctl syscall as an address. 20671 * ipc_sem.c (SYS_FUNC(semctl)): Print 4th argument using printaddr. 20672 * tests/ipc_sem.c (cleanup): Update expected output. 20673 20674 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20675 20676 Do not define printnum_long_int on systems with constant current_wordsize 20677 * defs.h: Check [!current_wordsize] instead 20678 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to select 20679 definitions of printnum_slong, printnum_ulong, and printnum_ptr. 20680 * util.c: Check [!current_wordsize] instead 20681 of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] to decide 20682 whether to compile printnum_long_int. 20683 20684 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20685 20686 umoven: detect invalid addresses. 20687 Do not silently truncate tracee addresses to current_wordsize. 20688 After transition from long to kernel_ulong_t there should be no sign 20689 extension issues with tracee addresses, and invalid addresses should 20690 be printed properly. 20691 20692 * util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead 20693 of [SIZEOF_LONG > 4], reject addresses that do not fit into 20694 current_wordsize. 20695 * tests/umoven-illptr.c: New file. 20696 * tests/umoven-illptr.test: New test. 20697 * tests/.gitignore: Add umoven-illptr. 20698 * tests/Makefile.am (check_PROGRAMS): Likewise. 20699 (DECODER_TESTS): Add umoven-illptr.test. 20700 20701 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20702 20703 umovestr: detect invalid addresses. 20704 Do not silently truncate tracee addresses to current_wordsize. 20705 After transition from long to kernel_ulong_t there should be no sign 20706 extension issues with tracee addresses, and invalid addresses should 20707 be printed properly. 20708 20709 * util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead 20710 of [SIZEOF_LONG > 4], reject addresses that do not fit into 20711 current_wordsize. 20712 * tests/umovestr-illptr.c: New file. 20713 * tests/umovestr-illptr.test: New test. 20714 * tests/.gitignore: Add umovestr-illptr. 20715 * tests/Makefile.am (check_PROGRAMS): Likewise. 20716 (DECODER_TESTS): Add umovestr-illptr.test. 20717 20718 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20719 20720 lseek: simplify _llseek syscall decoder. 20721 After transition from long to kernel_ulong_t the implementation 20722 could be made a bit simpler. 20723 20724 * lseek.c (SYS_FUNC(llseek)): Use direct cast to long long instead 20725 of zero_extend_signed_to_ull. 20726 20727 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20728 20729 lseek: merge two different implementations of lseek syscall decoder. 20730 After transition from long to kernel_ulong_t there are no mo 20731 complications that required to keep a separate implementation 20732 for x32 and mips n32. 20733 20734 * lseek.c (SYS_FUNC(lseek)): Merge two different implementations 20735 into a single one. 20736 20737 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20738 20739 Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval. 20740 After transition from long to kernel_ulong_t these fields 20741 are no longer needed. 20742 20743 * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove. 20744 (struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 20745 [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 20746 (RVAL_MASK): Update. 20747 * io.c (print_lld_from_low_high_val): Check 20748 [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 20749 instead of [HAVE_STRUCT_TCB_EXT_ARG]. 20750 Use u_arg instead of ext_arg. 20751 * linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove. 20752 * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]: 20753 Remove. 20754 [LINUX_MIPSN64]: Extend to [LINUX_MIPSN32]. 20755 * linux/x86_64/get_error.c (get_error) [X32]: Remove. 20756 * linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove. 20757 * lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 20758 instead of [HAVE_STRUCT_TCB_EXT_ARG]. 20759 [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg 20760 instead of ext_arg. Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL. 20761 * mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly 20762 to print_mmap. 20763 * syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove. 20764 * times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead 20765 of RVAL_LUDECIMAL. 20766 * util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] 20767 instead of [HAVE_STRUCT_TCB_EXT_ARG]. Use u_arg instead of ext_arg. 20768 20769 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20770 20771 Remove getarg_klu. 20772 After transition from long to kernel_ulong_t we no longer need 20773 tcp->ext_arg, and therefore a function to access it is also no longer 20774 needed. 20775 20776 * defs.h (getarg_klu): Remove prototype. 20777 * util.c (getarg_klu): Remove. 20778 (printargs): Access tcp->u_arg directly 20779 * bjm.c (SYS_FUNC(init_module)): Likewise. 20780 * clone.c (SYS_FUNC(unshare)): Likewise. 20781 * fadvise.c (SYS_FUNC(fadvise64)): Likewise. 20782 * kcmp.c (SYS_FUNC(kcmp)): Likewise. 20783 * kexec.c (SYS_FUNC(kexec_file_load)): Likewise. 20784 * keyctl.c (SYS_FUNC(keyctl)): Likewise. 20785 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. 20786 * mem.c (do_mprotect): Likewise. 20787 * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. 20788 * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. 20789 * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): 20790 Likewise. 20791 20792 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20793 20794 Remove printaddr_klu. 20795 After transition from long to kernel_ulong_t we no longer need 20796 two versions of printaddr function. 20797 20798 * defs.h (printaddr): Remove. 20799 (printaddr_klu): Rename to printaddr. 20800 * util.c (printaddr_klu): Likewise. 20801 * bjm.c (SYS_FUNC(init_module)): Replace printaddr_klu with printaddr. 20802 * mem.c (do_mprotect): Likewise. 20803 20804 2016-12-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 20805 20806 tests: check decoding of a subset of prctl operations. 20807 Check decoding of prctl operations that take the second syscall argument 20808 as a pointer to an integer. 20809 20810 * tests/prctl-arg2-intptr.c: New file. 20811 * tests/prctl-arg2-intptr.test: New test. 20812 * tests/.gitignore: Add prctl-arg2-intptr. 20813 * tests/Makefile.am (check_PROGRAMS): Likewise. 20814 (DECODER_TESTS): Add prctl-arg2-intptr.test. 20815 20816 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20817 20818 Automatically replace PRI_kr[dux] with PRI_kl[dux] 20819 Remove temporary macros created for transition from long 20820 to kernel_ulong_t. 20821 20822 Automatically replace PRI_kr[dux] with PRI_kl[dux] using 20823 $ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g' 20824 20825 * defs.h (PRI_krd, PRI_kru, PRI_krx): Remove. All users updated. 20826 20827 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20828 20829 Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t. 20830 Remove temporary types created for transition from long 20831 to kernel_ulong_t. 20832 20833 Automatically replace kernel_scno_t and kernel_ureg_t with 20834 kernel_ulong_t using 20835 $ git grep -El 'kernel_(scno|ureg)_t' | 20836 xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g' 20837 20838 * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove. 20839 All users updated. 20840 20841 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20842 20843 Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t 20844 * defs.h (struct tcb): Change u_rval type from long to kernel_long_t. 20845 (PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx. 20846 * kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect 20847 to kernel_ulong_t. 20848 20849 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20850 20851 Print kernel_ureg_t and kernel_scno_t using dedicated format strings. 20852 Prepare for the change of kernel_ureg_t and kernel_scno_t from 20853 unsigned long to kernel_ulong_t. 20854 20855 * defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros. 20856 All users updated. 20857 20858 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20859 20860 vm_read_mem: detect address truncation. 20861 When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed 20862 to vm_read_mem could be silently truncated. Detect this situation 20863 and return EIO when the tracee address does not fit into unsigned long. 20864 20865 * util.c (vm_read_mem): Save raddr argument into a temporary variable 20866 truncated_raddr of type unsigned long. Set errno to EIO and return -1 20867 when truncated_raddr does not equal to raddr. 20868 20869 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20870 20871 trace_syscall_exiting: prepare personality check for u_rval type change. 20872 * syscall.c (trace_syscall_exiting): Check for sizeof(tcp->u_rval) 20873 instead of sizeof(long) when deciding how to print tcp->u_rval. 20874 20875 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20876 20877 Use ptr_to_kulong instead of explicit casts of pointers to kernel_ureg_t 20878 Direct casts to kernel_ureg_t will not work after the change 20879 of kernel_ureg_t from unsigned long to kernel_ulong_t. 20880 20881 * defs.h (ptr_to_kulong): New macro. 20882 * block.c (print_blkpg_req): Use it instead of explicit casts 20883 to kernel_ureg_t. 20884 * btrfs.c (btrfs_ioctl): Likewise. 20885 * evdev.c (ff_effect_ioctl): Likewise. 20886 * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. 20887 * msghdr.c (print_struct_msghdr, dumpiov_in_msghdr): Likewise. 20888 * mtd.c (decode_mtd_oob_buf): Likewise. 20889 * printsiginfo.c (printsigval, print_si_info): Likewise. 20890 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Likewise. 20891 * sigaltstack.c (print_stack_t): Likewise. 20892 * sock.c (decode_ifconf): Likewise. 20893 * sysctl.c (SYS_FUNC(sysctl)): Likewise. 20894 * util.c (dumpiov_upto): Likewise. 20895 * v4l2.c (print_v4l2_framebuffer, print_v4l2_ext_control, 20896 print_v4l2_ext_controls): Likewise. 20897 20898 2016-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 20899 20900 umove*: remove redundant casts. 20901 * util.c (umoven, umovestr): Remove casts from unsigned long to pointer. 20902 20903 upoke: remove redundant casts. 20904 * upoke.c (upoke): Remove casts from unsigned long to pointer. 20905 20906 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20907 20908 signal: cleanup decoding of sa_handler and sa_restorer. 20909 Change type of sa_handler and sa_restorer fields from function pointers 20910 to unsigned long. This saves the code from a lot of casts between 20911 pointers and integers. 20912 20913 Rename __sa_handler to sa_handler__ as names starting with underscore 20914 symbol are reserved and should not be used. 20915 20916 * signal.c (old_sigaction): Rename __sa_handler to sa_handler__, 20917 all users updated. Change the type of sa_handler__ and sa_restorer 20918 from pointer to unsigned long. 20919 (old_sigaction32): Rename __sa_handler to sa_handler__, all users 20920 updated. 20921 (decode_old_sigaction): Remove now redundant casts from 20922 old_sigaction32.sa_handler__ to old_sigaction.sa_handler__, 20923 from old_sigaction32.sa_restorer to old_sigaction.sa_restorer, 20924 and from old_sigaction.sa_handler__ to unsigned long. Print 20925 old_sigaction.sa_restorer using printaddr. 20926 * signal.c (new_sigaction): Rename __sa_handler to sa_handler__, 20927 all users updated. Change the type of sa_handler__ and sa_restorer 20928 from pointer to unsigned long. 20929 (new_sigaction32): Rename __sa_handler to sa_handler__, all users 20930 updated. 20931 (decode_new_sigaction): Remove now redundant casts from 20932 new_sigaction32.sa_handler__ to new_sigaction.sa_handler__, 20933 from new_sigaction32.sa_restorer to new_sigaction.sa_restorer, 20934 and from new_sigaction.sa_handler__ to unsigned long. Print 20935 new_sigaction.sa_restorer using printaddr. 20936 20937 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20938 20939 signal: change signal handler address type from unsigned long to kernel_ureg_t 20940 * signal.c (get_sa_handler_str, print_sa_handler): Change handler type 20941 from unsigned long to kernel_ureg_t. 20942 20943 quota: change address argument type from unsigned long to kernel_ureg_t. 20944 * quota.c (decode_cmd_data): Change the type of data argument 20945 from unsigned long to kernel_ureg_t. 20946 20947 execve: prepare for handling big pointers. 20948 * execve.c (printargv): Change cp.p64 type from unsigned long 20949 to kernel_ulong_t so it could handle wordsize > sizeof(long) properly. 20950 20951 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20952 20953 clone: print clone flags without truncation. 20954 The flags argument is defined in kernel as unsigned long, 20955 so change its decoding to avoid truncation. 20956 20957 * clone.c (SYS_FUNC(clone)): Change flags type from unsigned long 20958 to kernel_ureg_t, print it using printflags64 instead of printflags. 20959 20960 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20961 20962 Use printxval64 instead of printxval_long. 20963 After the change of tcb.u_arg type from long to kernel_ureg_t it is safe 20964 to stop using printxval_long proxy and pass syscall arguments directly 20965 to printxval64. 20966 20967 * defs.h (printxval_long): Remove. 20968 * fcntl.c (print_fcntl): Replace printxval_long with printxval64. 20969 * mtd.c (mtd_ioctl): Likewise. 20970 * numa.c (SYS_FUNC(mbind)): Likewise. 20971 * or1k_atomic.c [OR1K] (SYS_FUNC(or1k_atomic)): Likewise. 20972 * sysmips.c [MIPS] (SYS_FUNC(sysmips)): Likewise. 20973 * term.c (term_ioctl): Likewise. 20974 20975 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20976 20977 Use printflags64 instead of printflags_long. 20978 After the change of tcb.u_arg type from long to kernel_ureg_t it is safe 20979 to stop using printflags_long proxy and pass syscall arguments directly 20980 to printflags64. 20981 20982 * defs.h (printflags_long): Remove. 20983 * fcntl.c (print_fcntl): Replace printflags_long with printflags64. 20984 * numa.c (SYS_FUNC(get_mempolicy)): Likewise. 20985 * perf.c (SYS_FUNC(perf_event_open)): Likewise. 20986 * sram_alloc.c [BFIN] (SYS_FUNC(sram_alloc)): Likewise. 20987 20988 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 20989 20990 upeek, upoke: change argument types from long to unsigned long. 20991 * defs.h (upeek, upoke): Change offset argument type from long 20992 to unsigned long. Change res argument type from long to kernel_ureg_t. 20993 * upeek.c (upeek): Likewise. 20994 * upoke.c (upoke.c): Likewise. 20995 * syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long 20996 to kernel_ureg_t. 20997 * linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast. 20998 * linux/metag/get_syscall_args.c (get_syscall_args): Likewise. 20999 * linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise. 21000 * linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise. 21001 * linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts. 21002 * linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long 21003 to unsigned long. 21004 * linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long 21005 to unsigned long. 21006 * linux/bfin/arch_regs.c (bfin_r0): Likewise. 21007 * linux/crisv10/arch_regs.c (cris_r10): Likewise. 21008 * linux/hppa/arch_regs.c (hppa_r28): Likewise. 21009 * linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise. 21010 * linux/microblaze/arch_regs.c (microblaze_r3): Likewise. 21011 * linux/sh/arch_regs.c (sh_r0): Likewise. 21012 * linux/sh64/arch_regs.c (sh64_r9): Likewise. 21013 * linux/xtensa/arch_regs.c (xtensa_a2): Likewise. 21014 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type 21015 from long to unsigned long. 21016 * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. 21017 * linux/alpha/get_scno.c (arch_get_scno): Update for the change 21018 of signedness. 21019 * linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type 21020 from pointer to long to pointer to unsigned long. 21021 * linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long 21022 to pointer to unsigned long. 21023 * linux/arm/arch_regs.h (arm_sp_ptr): Likewise. 21024 * linux/i386/arch_regs.c (i386_esp_ptr): Likewise. 21025 * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. 21026 * linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise. 21027 * linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise. 21028 * linux/ia64/get_syscall_args.c (get_syscall_args): Use umove 21029 instead of umoven. 21030 * linux/sh/arch_getrval2.c (getrval2): Change val type from long 21031 to unsigned long. 21032 21033 arch_sigreturn: change tracee address type from long to unsigned long. 21034 * linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable 21035 type from long to unsigned long. 21036 * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. 21037 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise. 21038 * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise. 21039 * linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise. 21040 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise. 21041 * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. 21042 * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type 21043 of addr and regs variables from long to unsigned long. 21044 * linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable 21045 type from long to kernel_ureg_t. 21046 * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type 21047 of offset and addr variables from long to kernel_ureg_t. 21048 21049 kexec: change flags type from unsigned long to kernel_ureg_t. 21050 * kexec.c (SYS_FUNC(kexec_load)): Change n variable type 21051 from unsigned long to kernel_ureg_t. Use printxval64 instead 21052 of printxval_long. Use printflags64 instead of printflags_long. 21053 21054 kexec: change types of pointers and sizes to kernel_ureg_t. 21055 * kexec.c (print_seg): Change the type of *seg and seg_buf variables 21056 from unsigned long to kernel_ureg_t. 21057 (print_kexec_segments): Change len argument type from unsigned long 21058 to kernel_ureg_t. Change seg variable type from unsigned long 21059 to kernel_ureg_t. 21060 21061 printsiginfo: change len argument type from unsigned long to kernel_ureg_t 21062 * printsiginfo.c (print_siginfo_array): Change len argument type 21063 from unsigned long to kernel_ureg_t. 21064 21065 signal: change address argument type from unsigned long to kernel_ureg_t 21066 * signal.c (print_sigqueueinfo): Change address argument type 21067 from unsigned long to kernel_ureg_t. 21068 21069 statfs64: change size argument type from unsigned long to kernel_ureg_t. 21070 * defs.h (print_struct_statfs64): Change size argument type 21071 from unsigned long to kernel_ureg_t. 21072 * print_statfs.c (print_struct_statfs64): Likewise. 21073 * fetch_struct_statfs.c (fetch_struct_statfs64): Likewise. 21074 * fstatfs64.c (SYS_FUNC(fstatfs64)): Pass size argument directly 21075 to print_struct_statfs64. 21076 * statfs64.c (SYS_FUNC(statfs64)): Likewise. 21077 21078 Cast tcp->u_rval to kernel_ureg_t instead of unsigned long. 21079 * fcntl.c (print_fcntl): Cast tcp->u_rval to kernel_ureg_t instead 21080 of unsigned long. 21081 * membarrier.c (SYS_FUNC(membarrier)): Likewise. 21082 * prctl.c (SYS_FUNC(prctl)): Likewise. 21083 * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. 21084 * time.c (do_adjtimex): Likewise. 21085 21086 decode_sockbuf: change addrlen argument type from long to kernel_ureg_t. 21087 * net.c (decode_sockbuf): Change addrlen argument type from long 21088 to kernel_ureg_t. 21089 21090 netlink: change size types from unsigned long to kernel_ureg_t. 21091 * defs.h (decode_netlink): Change len argument type from unsigned long 21092 to kernel_ureg_t. 21093 * netlink.c (fetch_nlmsghdr): Likewise. 21094 (decode_nlmsghdr_with_payload): Likewise. Change nlmsg_len variable 21095 type from unsigned long to unsigned int. 21096 (decode_netlink): Change the type of len argument and next_len variable 21097 from unsigned long to kernel_ureg_t. Change nlmsg_len variable type 21098 from unsigned long to unsigned int. 21099 21100 ipc_msg: change size types from unsigned long to kernel_ureg_t. 21101 * ipc_msg.c (tprint_msgsnd): Change count argument type 21102 from unsigned long to kernel_ureg_t. Change flags argument type 21103 from unsigned long to unsigned int. 21104 (tprint_msgrcv): Change the type of count and msgtyp arguments 21105 from unsigned long to kernel_ureg_t. 21106 (fetch_msgrcv_args): Change *pair type from unsigned long 21107 to kernel_ureg_t. 21108 (SYS_FUNC(msgrcv)): Change pair type from unsigned long 21109 to kernel_ureg_t. 21110 * print_msgbuf.c (tprint_msgbuf): Change count argument type 21111 from unsigned long to kernel_ureg_t. 21112 21113 dumpiov_upto: change size types from unsigned long to kernel_ureg_t. 21114 * defs.h (dumpiov_upto): Change data_size argument type 21115 from unsigned long to kernel_ureg_t. 21116 * util.c (dumpiov_upto): Change the type of data_size argument 21117 and iov_len variable from unsigned long to kernel_ureg_t. 21118 21119 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21120 21121 msghdr: change cmsghdr size types from size_t to unsigned int. 21122 As the kernel does not accept control messages longer than the value 21123 of int sysctl_optmem_max kernel variable exported as 21124 /proc/sys/net/core/optmem_max, we do not print them either. 21125 21126 Since unsigned int has enough room to contain any valid control message 21127 size, change all internal cmsghdr size types from size_t 21128 to unsigned int. 21129 21130 * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, 21131 print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t, 21132 print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr, 21133 cmsg_printer, print_cmsg_type_data): Change data_len argument type 21134 from size_t to unsigned int. 21135 (cmsg_socket_printers): Change min_len type from size_t to unsigned int. 21136 (decode_msg_control): Change the type of in_control_len argument, 21137 cmsg_len, and len variables from size_t to kernel_ureg_t. 21138 Change the type of cmsg_size, control_len, and buf_len variables 21139 from size_t to unsigned int. 21140 21141 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21142 21143 msghdr: change register based size types from unsigned long to kernel_ureg_t 21144 * defs.h (dumpiov_in_msghdr): Change data_size argument type 21145 from unsigned long to kernel_ureg_t. 21146 * msghdr.h (print_struct_msghdr): Likewise. 21147 * msghdr.c (print_struct_msghdr): Likewise. Cast msghdr.msg_iovlen 21148 and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long. 21149 (decode_msghdr, dumpiov_in_msghdr): Change data_size argument type 21150 from unsigned long to kernel_ureg_t. 21151 (SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument 21152 to decode_msghdr. 21153 * mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead 21154 of -1UL as data_size argument to print_struct_msghdr. 21155 (dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead 21156 of unsigned long. 21157 * syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument 21158 to dumpiov_in_msghdr 21159 21160 mq: remove redundant u_rval check. 21161 * mq.c (SYS_FUNC(mq_timedreceive)): Do not check for tcp->u_rval < 0, 21162 syserror(tcp) is enough, and printstrn can handle len < 0 anyway. 21163 21164 io: change size types from unsigned long to kernel_ureg_t. 21165 * defs.h (tprint_iov_upto): Change the type of len and data_size 21166 arguments from unsigned long to kernel_ureg_t. 21167 (tprint_iov): Change the type of len argument from unsigned long 21168 to kernel_ureg_t. 21169 * io.c (print_iovec_config): Change data_size type from unsigned long 21170 to kernel_ureg_t. 21171 (print_iovec): Change the type of *iov, iov_buf, and len variables 21172 from unsigned long to kernel_ureg_t. 21173 (tprint_iov_upto): Change the type of len and data_size arguments, and 21174 the type of iov variable from unsigned long to kernel_ureg_t. 21175 21176 mount: change flags type from unsigned long to kernel_ureg_t. 21177 * mount.c (SYS_FUNC(mount)): Change the type of flags from unsigned long 21178 to kernel_ureg_t, use printflags64 instead of printflags_long 21179 to print it. 21180 21181 mem: change mmap arguments type from unsigned long to kernel_ureg_t. 21182 * mem.c (print_mmap): Change the type of len, prot, and flags 21183 from unsigned long to kernel_ureg_t. Use printflags64 instead 21184 of printflags_long. Use printxval64 instead of printxval_long. 21185 (SYS_FUNC(old_mmap)): Check for current_klongsize instead 21186 of [AARCH64 || X86_64] to take X32 into account. 21187 (SYS_FUNC(mremap)): Use printflags64 instead of printflags_long. 21188 (SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and 21189 flags from unsigned long to kernel_ureg_t. Use printflags64 instead 21190 of printflags_long. Use printxval64 instead of printxval_long. 21191 [POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb 21192 from unsigned long to kernel_ureg_t. 21193 21194 numa: change size arguments type from unsigned long to kernel_ureg_t. 21195 * numa.c (print_node, print_addr): Add kernel_ureg_t support. 21196 (print_nodemask): Change type of maxnodes argument from unsigned long 21197 to kernel_ureg_t. 21198 (SYS_FUNC(move_pages)): Change npages type from unsigned long 21199 to kernel_ureg_t. Change buf type from long to kernel_ureg_t. 21200 21201 print_sigset_addr_len: change len argument type from long to kernel_ureg_t 21202 * defs.h (print_sigset_addr_len): Change len argument type from long 21203 to kernel_ureg_t. 21204 * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise. 21205 21206 process_vm: change size arguments type from unsigned long to kernel_ureg_t 21207 * process_vm.c (SYS_FUNC(process_vm_readv), 21208 SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt, 21209 remote_iovcnt, and flags from unsigned long to kernel_ureg_t. 21210 21211 printstr*: change len argument type from long to kernel_ureg_t. 21212 * defs.h (printstr_ex, printstrn): Change len argument type from long 21213 to kernel_ureg_t. 21214 * util.c (printstr_ex): Likewise. 21215 21216 xattr: change size arguments type from unsigned long to kernel_ureg_t. 21217 * xattr.c (print_xattr_val): Change type of insize and size arguments 21218 from unsigned long to kernel_ureg_t. 21219 (print_xattr_list): Change type of size argument from unsigned long 21220 to kernel_ureg_t. 21221 21222 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21223 21224 printstr_ex: fix decoding of non-NUL-terminated strings when len == -1. 21225 Do not treat len == -1 in any special way. All users who need the 21226 string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED 21227 bit in user_style flags already. 21228 21229 * util.c (printstr_ex): Remove (len == -1) check. 21230 * tests/printstr.c: New file. 21231 * tests/printstr.test: New test. 21232 * tests/.gitignore: Add printstr. 21233 * tests/Makefile.am (check_PROGRAMS): Likewise. 21234 (DECODER_TESTS): Add printstr.test. 21235 21236 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21237 21238 Fix decoding of sethostname syscall. 21239 The second argument of sethostname syscall is not an unsigned long but 21240 unsigned int. The kernel does not look at the string argument when 21241 the length argument is too long. 21242 21243 * hostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>. 21244 [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. 21245 (SYS_FUNC(sethostname)): Treat the second argument as unsigned int. 21246 Print the first argument as a pointer when the second argument exceeds 21247 __NEW_UTS_LEN. 21248 * tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>. 21249 [!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define. 21250 (main): Use it. Check that the second argument of sethostname 21251 is handled as unsigned int. Check that the first argument is printed 21252 as a pointer when the second argument exceeds __NEW_UTS_LEN. 21253 21254 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21255 21256 tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h. 21257 * tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros. 21258 (f8ill_ptr_to_kulong): New static inline function. 21259 21260 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21261 21262 printstr: rename to printstrn, add printstr as a thin wrapper. 21263 As about half of all printstr uses cases are invocations with the last 21264 argument set to -1, create a dedicated function for this use case. 21265 21266 * defs.h (printstr): Rename to printstrn. All callers updated. 21267 (printstr): New static inline function. All callers updated. 21268 21269 2016-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 21270 21271 process: change ptrace arguments type from unsigned long to kernel_ureg_t 21272 (SYS_FUNC(ptrace)): Change type of request and data arguments 21273 from unsigned long to kernel_ureg_t. 21274 21275 process: change tracee address type from unsigned long to kernel_ureg_t. 21276 * process.c (print_user_offset_addr): Change address argument type 21277 from unsigned long to kernel_ureg_t. 21278 (SYS_FUNC(ptrace)): Change addr variable type from unsigned long 21279 to kernel_ureg_t. 21280 21281 net: change address argument type from long to kernel_ureg_t. 21282 * net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred, 21283 print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq, 21284 print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq, 21285 print_setsockopt): Change address argument type from long 21286 to kernel_ureg_t. 21287 21288 print_mq_attr: change address argument type from long to kernel_ureg_t. 21289 * print_mq_attr.c (printmqattr): Change address argument type from long 21290 to kernel_ureg_t. 21291 21292 ipc_*: change address argument type from long to kernel_ureg_t. 21293 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change 21294 address argument type from long to kernel_ureg_t. 21295 * ipc_msgctl.c (print_msqid_ds): Likewise. 21296 * ipc_sem.c (tprint_sembuf_array): Likewise. 21297 * ipc_shmctl.c (print_shmid_ds): Likewise. 21298 21299 print_msgbuf: change address argument type from long to kernel_ureg_t. 21300 * print_msgbuf.c (tprint_msgbuf): Change address argument type 21301 from long to kernel_ureg_t. 21302 21303 desc: change tracee address type from long to kernel_ureg_t. 21304 * desc.c (decode_select): Rename arg to addr, change its type 21305 from long to kernel_ureg_t. 21306 21307 uid: change address argument type from long to kernel_ureg_t. 21308 * uid.c (get_print_uid): Change address argument type 21309 from long to kernel_ureg_t. 21310 21311 time: change address argument type from long to kernel_ureg_t. 21312 * time.c (print_timezone, do_adjtimex): Change address argument type 21313 from long to kernel_ureg_t. 21314 21315 sched: change address argument type from long to kernel_ureg_t. 21316 * sched.c (print_sched_attr): Change address argument type 21317 from long to kernel_ureg_t. 21318 21319 printsiginfo: change address argument type from long to kernel_ureg_t. 21320 * printsiginfo.c (printsiginfo_at): Change address argument type 21321 from long to kernel_ureg_t. 21322 21323 print_timex: change address argument type from long to kernel_ureg_t. 21324 * print_timex.c (print_timex): Change address argument type 21325 from long to kernel_ureg_t. 21326 21327 print_sigevent: change address argument type from long to kernel_ureg_t. 21328 * print_sigevent.c (print_sigevent): Change address argument type 21329 from long to kernel_ureg_t. 21330 21331 poll: change address argument type from long to kernel_ureg_t. 21332 * poll.c (decode_poll_exiting): Change tracee address argument type 21333 from long to kernel_ureg_t. 21334 21335 printrusage*: change tracee address argument type from long to kernel_ureg_t 21336 * defs.h [ALPHA] (printrusage32): Change address argument type 21337 from long to kernel_ureg_t. 21338 * printrusage.c (printrusage): Likewise. 21339 [ALPHA] (printrusage32): Likewise. 21340 * wait.c (printwaitn): Change the type of tracee address argument 21341 of print_rusage from long to kernel_ureg_t. 21342 21343 print_time*: change tracee address argument type from long to kernel_ureg_t 21344 * defs.h [ALPHA] (sprint_timeval32, print_timeval32, 21345 print_timeval32_pair, print_itimerval32): Change address argument type 21346 from long to kernel_ureg_t. 21347 * desc.c (decode_select): Change the type of tracee address argument 21348 of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t. 21349 * print_timespec.c (print_timespec, sprint_timespec, 21350 print_timespec_utime_pair, print_itimerspec): Change address argument 21351 type from long to kernel_ureg_t. 21352 * print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval, 21353 print_itimerval, print_timeval32, print_timeval32_pair, 21354 print_itimerval32, sprint_timeval32): Likewise. 21355 21356 rtc: change type of ioctl 3rd argument from long to kernel_ureg_t. 21357 * rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info): 21358 Change addr type from long to kernel_ureg_t. 21359 (rtc_ioctl): Change arg type from long to kernel_ureg_t. 21360 21361 mtd: change type of ioctl 3rd argument from long to kernel_ureg_t. 21362 * mtd.c (decode_erase_info_user, decode_erase_info_user64, 21363 decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info, 21364 decode_otp_select, decode_mtd_write_req, decode_mtd_info_user, 21365 decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats): 21366 Change addr type from long to kernel_ureg_t. 21367 (mtd_ioctl): Change arg type from long to kernel_ureg_t. 21368 21369 hdio: change type of ioctl 3rd argument from long to kernel_ureg_t. 21370 * hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t. 21371 21372 v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t. 21373 * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format, 21374 print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer, 21375 print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard, 21376 print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl, 21377 print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls, 21378 print_v4l2_frmsizeenum, print_v4l2_frmivalenum, 21379 print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long 21380 to kernel_ureg_t. 21381 21382 evdev: change type of ioctl 3rd argument from long to kernel_ureg_t. 21383 * evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl, 21384 getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl, 21385 evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type 21386 from long to kernel_ureg_t. 21387 21388 btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t. 21389 * btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long 21390 to kernel_ureg_t. 21391 21392 block: change type of ioctl 3rd argument from long to kernel_ureg_t. 21393 * block.c (block_ioctl): Change arg type from long to kernel_ureg_t. 21394 21395 Change type of ioctl 3rd argument from long to kernel_ureg_t. 21396 * defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t. 21397 * dm.c (dm_known_ioctl, dm_ioctl): Likewise. 21398 * file_ioctl.c (file_ioctl): Likewise. 21399 * fs_x_ioctl.c (fs_x_ioctl): Likewise. 21400 * ioctl.c (ioctl_decode): Likewise. 21401 * loop.c (decode_loop_info, decode_loop_info64): Change addr type 21402 from long to kernel_ureg_t. 21403 (loop_ioctl): Change arg type from long to kernel_ureg_t. 21404 * ptp.c (ptp_ioctl): Likewise. 21405 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 21406 print_sg_io_v4_res, scsi_ioctl): Likewise. 21407 * sock.c (print_ifreq, sock_ioctl): Likewise. 21408 (decode_ifconf): Change addr type from long to kernel_ureg_t. 21409 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 21410 decode_modem_flags): Likewise. 21411 (term_ioctl): Change arg type from long to kernel_ureg_t. 21412 * ubi.c (ubi_ioctl): Likewise. 21413 * userfaultfd.c (uffdio_ioctl): Likewise. 21414 21415 ldt: change address argument type from long to kernel_ureg_t. 21416 * defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address 21417 argument type from long to kernel_ureg_t. 21418 * ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise. 21419 21420 fcntl: change address argument type from long to kernel_ureg_t. 21421 * fcntl.c (printflock64, printflock, print_f_owner_ex): Change 21422 address argument type from long to kernel_ureg_t. 21423 21424 execve: change address argument type from long to kernel_ureg_t. 21425 * execve.c (printargv, printargc): Change address argument type 21426 from long to kernel_ureg_t. 21427 21428 dirent: change address argument type from long to kernel_ureg_t. 21429 * dirent.c (print_old_dirent): Change address argument type from long 21430 to kernel_ureg_t. 21431 21432 bpf: change address argument type from long to kernel_ureg_t. 21433 * bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem, 21434 bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument 21435 type from long to kernel_ureg_t. 21436 21437 dump*: change address argument type from long to kernel_ureg_t. 21438 * defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr): 21439 Change address argument type from long to kernel_ureg_t. 21440 * mmsghdr.c (dumpiov_in_mmsghdr): Likewise. 21441 * msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr): 21442 Likewise. 21443 * util.c (dumpiov_upto, dumpstr): Likewise. 21444 21445 print_sigset_addr_len: change address argument type from long to kernel_ureg_t 21446 * defs.h (print_sigset_addr_len) Change address argument type from long 21447 to kernel_ureg_t. 21448 * signal.c (print_sigset_addr_len_limit, print_sigset_addr_len, 21449 decode_old_sigaction, decode_new_sigaction): Likewise. 21450 21451 decode_sockaddr: change address argument type from long to kernel_ureg_t 21452 * defs.h (decode_sockaddr) Change tracee address argument type from long 21453 to kernel_ureg_t. 21454 * sockaddr.c (decode_sockaddr): Likewise. 21455 21456 print_struct_statfs*: change address argument type from long to kernel_ureg_t 21457 * defs.h (print_struct_statfs, print_struct_statfs64): Change address 21458 argument type from long to kernel_ureg_t. 21459 * print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise. 21460 * fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64): 21461 Likewise. 21462 21463 fetch_struct_flock: change address argument type from long to kernel_ureg_t 21464 * fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64): 21465 Change address argument type from long to kernel_ureg_t. 21466 21467 fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t 21468 * fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument 21469 type from long to kernel_ureg_t. 21470 21471 printnum_*, printpair_*: change address argument type from long to kernel_ureg_t 21472 * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change 21473 address argument type from long to kernel_ureg_t. 21474 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. 21475 21476 printpath*: change address argument type from long to kernel_ureg_t. 21477 * defs.h (printpath, printpathn): Change address argument type 21478 from long to kernel_ureg_t. 21479 * util.c (printpath, printpathn): Likewise. 21480 21481 printstr*: change address argument type from long to kernel_ureg_t. 21482 * defs.h (printstr_ex, printstr_ex): Change address argument type 21483 from long to kernel_ureg_t. 21484 * util.c (printstr_ex): Likewise. 21485 21486 umove*: change tracee address argument type from long to kernel_ureg_t. 21487 * defs.h (umovestr, umoven, umoven_or_printaddr, 21488 umoven_or_printaddr_ignore_syserror): Change tracee address argument 21489 type from long to kernel_ureg_t. 21490 (print_array): Change the type of tracee address argument of umoven_func 21491 from long to kernel_ureg_t. 21492 * util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr, 21493 umoven_or_printaddr_ignore_syserror): Change tracee address argument 21494 type from long to kernel_ureg_t. 21495 (print_array): Change the type of tracee address argument of umoven_func 21496 from long to kernel_ureg_t. 21497 * desc.c (umove_kulong_array_or_printaddr): Change tracee address 21498 argument type from long to kernel_ureg_t. 21499 * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise. 21500 21501 futex: change address type from long to kernel_ureg_t. 21502 * futex.c (SYS_FUNC(futex)): Change address type from long 21503 to kernel_ureg_t. 21504 21505 file_handle: change address type from long to kernel_ureg_t. 21506 * file_handle.c (SYS_FUNC(name_to_handle_at), 21507 SYS_FUNC(open_by_handle_at)): Change address type from long 21508 to kernel_ureg_t. 21509 21510 printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long. 21511 * printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer 21512 to kernel_ureg_t instead of unsigned long. 21513 (print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers 21514 to kernel_ureg_t instead of unsigned long. 21515 21516 sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long 21517 * sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer 21518 and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long. 21519 21520 v4l2: cast pointers to kernel_ureg_t instead of long. 21521 * v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer 21522 to kernel_ureg_t instead of long. 21523 21524 v4l2: cast pointers to kernel_ureg_t instead of unsigned long. 21525 * v4l2.c (print_v4l2_buffer): Remove redundant cast. 21526 (print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer 21527 to kernel_ureg_t instead of unsigned long. 21528 (print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer 21529 to kernel_ureg_t instead of unsigned long. 21530 21531 2016-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 21532 21533 sysctl: cast pointers to kernel_ureg_t instead of size_t. 21534 * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and 21535 __sysctl_args.newval pointers to kernel_ureg_t instead of size_t. 21536 21537 sysctl: cast pointers to kernel_ureg_t instead of long. 21538 * sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer 21539 to kernel_ureg_t instead of long. 21540 21541 block: cast pointers to kernel_ureg_t instead of long. 21542 * block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer 21543 to kernel_ureg_t instead of long. 21544 21545 dumpiov_upto: cast pointers to kernel_ureg_t instead of long. 21546 * util.c (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t 21547 instead of long. 21548 21549 msghdr: cast pointers to kernel_ureg_t instead of long. 21550 * msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer 21551 to kernel_ureg_t instead of long. 21552 (dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t 21553 instead of long. 21554 21555 mmsghdr: cast pointers to kernel_ureg_t instead of long. 21556 * mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer 21557 to kernel_ureg_t instead of long. 21558 21559 Remove redundant casts of ptrace arguments. 21560 * strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument 21561 from pointer to long type. 21562 21563 ptrace_restart: cleanup. 21564 * strace.c (ptrace_restart): Replace the sequence of "if" statements 21565 with a "switch" statement. 21566 21567 ptrace_restart: change types of integer arguments to unsigned. 21568 * strace.c (ptrace_restart): Change types of "op" and "sig" 21569 from int to unsigned int. 21570 21571 process: remove redundant syserror checks. 21572 * process.c (SYS_FUNC(ptrace)): Remove syserror checks as both 21573 print_siginfo_array and print_seccomp_fprog do the right thing 21574 by using umoven_or_printaddr. 21575 21576 sparc64: remove redundant casts. 21577 * linux/sparc64/get_syscall_args.c (get_syscall_args): Remove 21578 redundant casts from uint32_t to long. 21579 21580 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 21581 21582 numa: change address argument type from unsigned long to kernel_ureg_t. 21583 * numa.c (print_nodemask): Change address argument type from 21584 unsigned long to kernel_ureg_t. 21585 21586 net: change address argument type from unsigned long to kernel_ureg_t. 21587 * net.c (fetch_socklen): Change address argument type from 21588 unsigned long to kernel_ureg_t. 21589 21590 mem: change tracee address type from unsigned long to kernel_ureg_t. 21591 * mem.c (print_mmap, SYS_FUNC(remap_file_pages), 21592 SYS_FUNC(subpage_prot)): Change the type of variables containing tracee 21593 addresses from unsigned long to kernel_ureg_t. 21594 21595 kexec: change address argument type from unsigned long to kernel_ureg_t. 21596 * kexec.c (print_kexec_segments): Change address argument type 21597 from unsigned long to kernel_ureg_t. 21598 21599 poll: change counter type from unsigned long to unsigned int. 21600 * poll.c (decode_poll_exiting): Change the type of printed and 21601 max_printed counters from unsigned long to unsigned int. 21602 21603 xattr: change address argument type from unsigned long to kernel_ureg_t. 21604 * xattr.c (print_xattr_val, print_xattr_list): Change address 21605 argument type from unsigned long to kernel_ureg_t. 21606 21607 uid: change address argument type from unsigned long to kernel_ureg_t. 21608 * uid.c (print_groups): Change address argument type 21609 from unsigned long to kernel_ureg_t. 21610 21611 stat64: change address argument type from unsigned long to kernel_ureg_t 21612 * stat64.c (decode_struct_stat64): Change address argument type 21613 from unsigned long to kernel_ureg_t. 21614 21615 stat: change address argument type from unsigned long to kernel_ureg_t. 21616 * stat.c (decode_struct_stat): Change address argument type 21617 from unsigned long to kernel_ureg_t. 21618 21619 sigaltstack: change address argument type from unsigned long to kernel_ureg_t 21620 * sigaltstack.c (print_stack_t): Change address argument type 21621 from unsigned long to kernel_ureg_t. 21622 21623 resource: change address argument type from unsigned long to kernel_ureg_t 21624 * resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change 21625 address argument type from unsigned long to kernel_ureg_t. 21626 21627 printsiginfo: change address argument type from unsigned long to kernel_ureg_t 21628 * printsiginfo.c (print_siginfo_array): Change address argument type 21629 from unsigned long to kernel_ureg_t. 21630 21631 poll: change tracee address type from unsigned long to kernel_ureg_t. 21632 * poll.c (decode_poll_entering, decode_poll_exiting): Change the type 21633 all tracee address variables from unsigned long to kernel_ureg_t. 21634 21635 perf: change address argument type from unsigned long to kernel_ureg_t. 21636 * perf.c (fetch_perf_event_attr, print_perf_event_attr): Change 21637 address argument type from unsigned long to kernel_ureg_t. 21638 21639 pathtrace: change tracee address type from unsigned long to kernel_ureg_t 21640 * pathtrace.c (upathmatch): Change address argument type 21641 from unsigned long to kernel_ureg_t. 21642 (pathtrace_match): Change the type of all tracee address variables 21643 from unsigned long to kernel_ureg_t. 21644 21645 scsi: change address argument type from unsigned long to kernel_ureg_t. 21646 * scsi.c (print_sg_io_buffer): Change address argument type 21647 from unsigned long to kernel_ureg_t. 21648 21649 dm: change address argument type from unsigned long to kernel_ureg_t. 21650 * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, 21651 dm_decode_dm_name_list, dm_decode_dm_target_versions, 21652 dm_decode_dm_target_msg, dm_decode_string): Change address argument type 21653 from unsigned long to kernel_ureg_t. 21654 21655 oldstat: change address argument type from unsigned long to kernel_ureg_t 21656 * oldstat.c (print_old_kernel_stat): Change address argument type 21657 from unsigned long to kernel_ureg_t. 21658 21659 capability: change address argument type from unsigned long to kernel_ureg_t 21660 * capability.c (get_cap_header, print_cap_header, print_cap_data): 21661 Change address argument type from unsigned long to kernel_ureg_t. 21662 21663 btrfs: change address argument type from unsigned long to kernel_ureg_t. 21664 * btrfs.c (btrfs_print_qgroup_inherit): Change address argument type 21665 from unsigned long to kernel_ureg_t. 21666 21667 affinity: change address argument type from unsigned long to kernel_ureg_t 21668 * affinity.c (print_affinitylist): Change address argument type from 21669 unsigned long to kernel_ureg_t. 21670 21671 aio: change address type from unsigned long to kernel_ureg_t. 21672 * aio.c (print_iocb): Remove casts to unsigned long. 21673 (print_iocbp, SYS_FUNC(io_submit)): Change address type 21674 from unsigned long to kernel_ureg_t. 21675 21676 mmsghdr: change address argument type from unsigned long to kernel_ureg_t 21677 * mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change 21678 address argument type from unsigned long to kernel_ureg_t. 21679 21680 msghdr: change address argument type from unsigned long to kernel_ureg_t 21681 * msghdr.c (decode_msg_control): Change address argument type 21682 from unsigned long to kernel_ureg_t. 21683 21684 fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t 21685 * fetch_struct_stat64.c (fetch_struct_stat64): Change address argument 21686 type from unsigned long to kernel_ureg_t. 21687 21688 fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t 21689 * fetch_struct_stat.c (fetch_struct_stat): Change address argument 21690 type from unsigned long to kernel_ureg_t. 21691 21692 fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t 21693 * fetch_struct_msghdr.c (fetch_struct_msghdr): Change 21694 address argument type from unsigned long to kernel_ureg_t. 21695 21696 fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t 21697 * fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change 21698 address argument type from unsigned long to kernel_ureg_t. 21699 21700 decode_netlink: change address argument type from unsigned long to kernel_ureg_t 21701 * defs.h (decode_netlink) Change address argument type 21702 from unsigned long to kernel_ureg_t. 21703 * netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload, 21704 decode_netlink): Likewise. 21705 21706 print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t 21707 * defs.h (print_seccomp_filter, print_seccomp_fprog): Change 21708 address argument type from unsigned long to kernel_ureg_t. 21709 * seccomp.c (print_seccomp_filter, print_seccomp_fprog, 21710 decode_seccomp_set_mode_strict): Likewise. 21711 21712 tprint_iov*: change address argument type from unsigned long to kernel_ureg_t 21713 * defs.h (tprint_iov, tprint_iov_upto): Change address argument type 21714 from unsigned long to kernel_ureg_t. 21715 * io.c (tprint_iov, tprint_iov_upto): Likewise. 21716 21717 print_array: change tracee address type from unsigned long to kernel_ureg_t 21718 * defs.h (print_array): Change start_addr type from unsigned long 21719 to kernel_ureg_t. 21720 * util.c (print_array): Likewise. Change the type of all tracee 21721 address variables from unsigned long to kernel_ureg_t. 21722 21723 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 21724 21725 Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long 21726 In all places where LONG_LONG is used the destination already has type 21727 unsigned long long, so it is quite natural to change LONG_LONG as well. 21728 21729 * defs.h (LONG_LONG): Rename to ULONG_LONG, change return type 21730 from long long to unsigned long long. All callers updated. 21731 21732 2016-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 21733 21734 mem: remove redundant casts. 21735 * mem.c (SYS_FUNC(old_mmap)): Remove redundant cast 21736 from kernel_ureg_t to unsigned long. 21737 [S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast 21738 from unsigned int to unsigned long. 21739 21740 desc: remove redundant casts. 21741 * desc.c (umove_kulong_array_or_printaddr): Remove redundant cast 21742 from uint32_t to kernel_ulong_t. 21743 (SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t 21744 to unsigned long. 21745 21746 2016-12-22 Dmitry V. Levin <ldv (a] altlinux.org> 21747 21748 print_sigevent: remove redundant cast. 21749 * print_sigevent.c (print_sigevent): Remove redundant cast from 21750 struct_sigevent.sigev_value.sival_ptr to unsigned long as the former 21751 is not a pointer but an unsigned integer. 21752 21753 tests: fix xattr.test for the case when listxattr returns a long list. 21754 * tests/xattr.c (DEFAULT_STRLEN): New macro. 21755 (main): Use it to limit the length passed to print_quoted_memory. 21756 Print ellipsis when the list returned by listxattr is too long. 21757 21758 2016-12-22 Gabriel Laskar <gabriel (a] lse.epita.fr> 21759 21760 tests: test for correct ellipsis with -s in xattr. 21761 * tests/xattr-strings.c: New file. 21762 * tests/xattr-strings.test: New test. 21763 * tests/.gitignore: Add xattr-string. 21764 * tests/Makefile.am (check_PROGRAMS): Likewise. 21765 (DECODER_TESTS): Add xattr-string.test. 21766 21767 2016-12-22 Gabriel Laskar <gabriel (a] lse.epita.fr> 21768 21769 xattr: use printstr_ex instead of print_quoted_string. 21770 This fixes the display when using `-s` to limit the string size 21771 of the values displayed by {get,set}xattr. 21772 21773 * xattr.c (print_xattr_val): Remove static buffer. Use printstr_ex 21774 instead of print_quoted_string. 21775 21776 Reported-by: <socketpair (a] gmail.com> 21777 21778 2016-12-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 21779 21780 tests: use scno.h in finit_module, kcmp, renameat2 tests. 21781 * tests/finit_module.c: Include "scno.h". 21782 * tests/kcmp.c: Likewise. 21783 * tests/renameat2.c: Likewise. 21784 21785 2016-12-21 Dmitry V. Levin <ldv (a] altlinux.org> 21786 21787 sock: cast pointers to kernel_ureg_t instead of unsigned long. 21788 * sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t 21789 instead of unsigned long. 21790 21791 scsi: cast pointers to kernel_ureg_t instead of unsigned long. 21792 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res): Cast sg_io_hdr.cmdp, 21793 sg_io_hdr.dxferp, and sg_io_hdr.sbp pointers to kernel_ureg_t instead 21794 of unsigned long. 21795 21796 mtd: cast pointers to kernel_ureg_t instead of unsigned long. 21797 * mtd.c (decode_mtd_oob_buf): Cast mtd_oob_buf.ptr pointer 21798 to kernel_ureg_t instead of unsigned long. 21799 21800 msghdr: cast pointers to kernel_ureg_t instead of unsigned long. 21801 * msghdr.c (print_struct_msghdr): Cast msghdr.msg_iov and 21802 msghdr.msg_control pointers to kernel_ureg_t instead of unsigned long. 21803 21804 evdev: cast tcp->u_rval to kernel_ureg_t instead of unsigned long. 21805 * evdev.c (decode_bitset): Cast tcp->u_rval to kernel_ureg_t 21806 instead of unsigned long. 21807 21808 evdev: cast pointers to kernel_ureg_t instead of unsigned long. 21809 * evdev.c (ff_effect_ioctl): Cast ff_periodic_effect.custom_data 21810 pointer to kernel_ureg_t instead of unsigned long. 21811 21812 btrfs: cast pointers to kernel_ureg_t instead of unsigned long. 21813 * btrfs.c (btrfs_ioctl): Cast btrfs_ioctl_send_args.clone_sources 21814 and btrfs_ioctl_vol_args_v2.qgroup_inherit pointers to kernel_ureg_t 21815 instead of unsigned long. 21816 21817 Rework ifdefery around print_user_desc. 21818 * configure.ac (AC_CHECK_TYPES): Check for struct user_desc 21819 in <asm/ldt.h>. 21820 * clone.c (print_tls_arg): New function. 21821 (SYS_FUNC(clone)): Use it. 21822 (print_user_desc): Move prototype ... 21823 * defs.h [HAVE_STRUCT_USER_DESC]: ... here. 21824 * ldt.c: Check for HAVE_STRUCT_USER_DESC instead of architectures. 21825 * linux/dummy.h: Likewise. 21826 21827 Introduce DECL_IOCTL macro to declare *_ioctl functions. 21828 * defs.h (DECL_IOCTL): New macro. 21829 (dm_ioctl, file_ioctl, fs_x_ioctl, loop_ioctl, ptp_ioctl, scsi_ioctl, 21830 sock_ioctl, term_ioctl, ubi_ioctl, uffdio_ioctl): Rewrite prototypes 21831 using DECL_IOCTL. 21832 21833 Introduce DECL_PRINT* macros to declare printnum_* and printpair_* 21834 * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR): New macros. 21835 (printnum_short, printnum_int, printnum_int64): Rewrite prototypes 21836 using DECL_PRINTNUM. 21837 (printpair_int, printpair_int64): Rewrite prototypes 21838 using DECL_PRINTPAIR. 21839 21840 ioctl: use uintptr_t for casts between 32-bit integers and pointers. 21841 * ioctl.c (compare): Cast pointer to uintptr_t before assigning 21842 it to an integer. 21843 (ioctl_lookup): Cast integer to uintptr_t before passing it 21844 as a pointer. 21845 21846 scsi: use umove_or_printaddr. 21847 * scsi.c (scsi_ioctl): Use umove_or_printaddr. 21848 21849 Remove dumpiov wrapper. 21850 * defs.h (dumpiov): Remove. 21851 * syscall.c (dumpio): Use dumpiov_upto instead of dumpiov. 21852 21853 travis: fix enabling of gcc -Werror builds. 21854 * travis-build.sh: Use DISTCHECK_CONFIGURE_FLAGS instead 21855 of CHECK_CONFIGURE_FLAGS and ENABLE_GCC_WERROR. 21856 [$CC == gcc]: Add --enable-gcc-Werror to DISTCHECK_CONFIGURE_FLAGS 21857 instead of ENABLE_GCC_WERROR. 21858 [$CHECK == coverage]: Add --enable-code-coverage 21859 to DISTCHECK_CONFIGURE_FLAGS instead of CHECK_CONFIGURE_FLAGS. 21860 21861 printaddr: change argument type to kernel_ureg_t. 21862 * defs.h (printaddr): Change argument type from unsigned long 21863 to kernel_ureg_t. 21864 21865 tests: check decoding of unreadable ip_mreq and ipv6_mreq structures. 21866 * tests/ip_mreq.c (main): Check short read. 21867 21868 tests: rewrite ip_mreq.c using arrays and iterators. 21869 * tests/ip_mreq.c (main): Create arrays of setsockopt arguments to test. 21870 Iterate over these arrays invoking setsockopt and printing expected 21871 output. 21872 21873 tests: rewrite ip_mreq.c using tail_alloc. 21874 * tests/ip_mreq.c (main): Allocate objects of struct ip_mreq 21875 and struct ipv6_mreq using tail_alloc instead of using stack. 21876 21877 tests: rewrite ip_mreq.c without asserts. 21878 * tests/ip_mreq.c: Do not include <assert.h>. 21879 (main): Do not use assert. Use sprintrc instead of errno2name. 21880 21881 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21882 21883 Remove NEED_PTRACE_PROTOTYPE_WORKAROUND. 21884 Remove the workaround for broken ptrace prototypes 21885 that seems to be unneeded for quite a long time. 21886 21887 * defs.h [NEED_PTRACE_PROTOTYPE_WORKAROUND]: Remove. 21888 21889 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21890 21891 tests: use scno.h in tests of relatively new syscalls. 21892 * tests/add_key.c: Include "scno.h" after <asm/unistd.h>. 21893 * tests/copy_file_range.c: Likewise. 21894 * tests/execveat.c: Likewise. 21895 * tests/kexec_file_load.c: Likewise. 21896 * tests/membarrier.c: Likewise. 21897 * tests/memfd_create.c: Likewise. 21898 * tests/mlock2.c: Likewise. 21899 * tests/pkey_alloc.c: Likewise. 21900 * tests/pkey_free.c: Likewise. 21901 * tests/pkey_mprotect.c: Likewise. 21902 * tests/preadv2-pwritev2.c: Likewise. 21903 * tests/userfaultfd.c: Likewise. 21904 21905 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21906 21907 tests: generate scno.h from syscallent.h for use by other tests. 21908 Provide scno.h with fallback definitions of all __NR_* constants known 21909 to strace for the personbality being tested. 21910 21911 Some tests need just __NR_* constants without any kernel support. 21912 Such tests can include "scno.h" after <asm/unistd.h> to get definitions 21913 of these constants when system headers are too old. 21914 21915 * tests/generate_scno.c: New file. 21916 * tests/.gitignore: Add generate_scno. 21917 * tests/Makefile.am (check_PROGRAMS): Likewise. 21918 (scno.h): New rule. 21919 (BUILT_SOURCES, CLEANFILES): Add scno.h. 21920 21921 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21922 21923 tests: fix potential errno clobbering in membarrier test. 21924 * tests/membarrier.c (main): Save errno. 21925 21926 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21927 21928 Do not use widen_to_ulong in kexec.c and process_vm.c. 21929 Automatic argument truncation makes use of this function redundant. 21930 21931 * kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong. 21932 * process_vm.c (SYS_FUNC(process_vm_readv), 21933 SYS_FUNC(process_vm_writev)): Likewise. 21934 21935 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21936 21937 x32: implement automatic argument truncation for compat syscalls. 21938 x32 syscalls starting with number 512 are compat syscalls that operate 21939 on compat types. Set COMPAT_SYSCALL_TYPES flag to these syscall entries 21940 and make get_syscall_args truncate arguments of syscalls that have this 21941 flag set, to avoid unpleasant alternative of adding multiple 21942 widen_to_ulong invocations to individual syscall parsers. 21943 21944 preadv, pwritev, preadv2, and pwritev2 are exceptions: while these 21945 syscalls operate on compat types, the offset argument has a regular 21946 64-bit type, so the automatic argument truncation cannot be applied. 21947 21948 * defs.h (COMPAT_SYSCALL_TYPES): New macro. 21949 * syscall.c (CST): New macro, defined to COMPAT_SYSCALL_TYPES. 21950 * linux/ia64/syscallent.h: Do not include "../i386/syscallent.h" 21951 unless [CST > 0]. 21952 * linux/x32/syscallent.h [512..533, 536..545]: Add CST flag. 21953 * linux/x86_64/get_syscall_args.c (get_syscall_args): Truncate arguments 21954 of compat syscalls to 32-bit values. 21955 * tests/ksysent.c (CST): New macro, defined to 0. 21956 * tests/nsyscalls.c (CST): Likewise. 21957 21958 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21959 21960 x32: fix decoding of mprotect and pkey_mprotect syscall arguments. 21961 As there are no compat versions of mprotect or pkey_mprotect syscalls 21962 in x32 personality, "addr", "len", and "prot" syscall arguments have 21963 kernel_ulong_t type and should be printed accordingly. 21964 21965 * mem.c (do_mprotect): Retrieve 1st, 2nd and 3rd arguments using 21966 getarg_klu, print them using printaddr_klu, PRI_klu format, 21967 and printflags64, correspondingly. 21968 21969 2016-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 21970 21971 Make tprint_iov function a static inline wrapper. 21972 * io.c (tprint_iov): Move ... 21973 * defs.h: ... here, add static inline keywords. 21974 21975 2016-12-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 21976 21977 x32: fix decoding of 3rd argument of preadv* and pwritev* syscalls. 21978 In x32 personality these syscalls use compat type for the 3rd argument, 21979 therefore it has to be truncated there. 21980 21981 * io.c (do_preadv, do_pwritev): Truncate tcp->u_arg[2] using 21982 widen_to_ulong. 21983 21984 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 21985 21986 tests: fix preadv2-pwritev2 test on x32. 21987 On x32 p(read|write)v(|2) syscalls are implemented via compat, which 21988 truncates len argument to unsigned int. 21989 21990 * tests/preadv2-pwritev2.c (main): Print vlen argument as unsigned long. 21991 21992 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 21993 21994 kexec: fix for the x32 ABI. 21995 There is no compat (and no 32-bit version, ever) for x32 ABI, so 21996 kernel's long type should be used for arguments' values. 21997 21998 The only remaining thing is a pointer to cmdline string, but it is 21999 currently broken on x32 anyway. 22000 22001 * kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument 22002 as kernel long, retrieve it via getarg_klu; use printflags64 for 22003 printing the flags argument, retrieve it via getarg_klu. 22004 22005 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22006 22007 Check for current_klongsize instead of current_personality where appropriate 22008 current_klongsize checks are more universal, therefore they are usually 22009 shorter and easier to comprehend. 22010 22011 * desc.c (umove_kulong_array_or_printaddr): Check for current_klongsize 22012 instead of current_personality and current_wordsize. 22013 * io.c (print_lld_from_low_high_val): Likewise. 22014 * lseek.c (SYS_FUNC(lseek)): Likewise. 22015 * resource.c (decode_rlimit): Likewise. 22016 * syscall.c (is_negated_errno): Likewise. 22017 * util.c (getllval, getarg_klu): Likewise. 22018 22019 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22020 22021 Use kernel_ulong_t instead of unsigned long long where appropriate. 22022 * defs.h (printaddr_ull): Rename to printaddr_klu, change argument 22023 type from unsigned long long to kernel_ulong_t. All callers updated. 22024 (getarg_ull): Rename to getarg_klu, change return value type 22025 from unsigned long long to kernel_ulong_t. All callers updated. 22026 (PRI_kl, PRI_kld, PRI_klu, PRI_klx): New macros. 22027 * bjm.c (SYS_FUNC(init_module)): Print kernel_ulong_t type using 22028 PRI_klu format. 22029 * desc.c (SYS_FUNC(pselect6)): Likewise. 22030 * fadvise.c (SYS_FUNC(fadvise64)): Likewise. 22031 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise. 22032 * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise. 22033 * kcmp.c (SYS_FUNC(kcmp)): Print kernel_ulong_t type using 22034 PRI_klx format. 22035 * keyctl.c (SYS_FUNC(keyctl)): Likewise. 22036 * pkeys.c (SYS_FUNC(pkey_alloc)): Likewise. 22037 * prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): 22038 Print kernel_ulong_t type using PRI_kld, PRI_klu, or PRI_klx format. 22039 * util.c (printaddr_ull): Rename to printaddr_klu, change argument 22040 type from unsigned long long to kernel_ulong_t, print it using 22041 PRI_klx format. 22042 (getarg_ull): Rename to getarg_klu, change return value type 22043 from unsigned long long to kernel_ulong_t, print it using 22044 PRI_klx format. 22045 22046 fcntl.c: print 64-bit fields of struct_kernel_flock64 using PRId64 format 22047 * fcntl.c (print_struct_flock64): Print l_start and l_len fields 22048 of struct_kernel_flock64 using PRId64 format. 22049 22050 v4l2.c: print v4l2_ext_control.value64 using PRId64 format. 22051 * v4l2.c (print_v4l2_ext_control): Print value64 field 22052 of struct_v4l2_ext_control using PRId64 format. 22053 22054 perf.c: print perf_event_attr.__reserved_1 using PRIx64 format. 22055 * perf.c (print_perf_event_attr): Print __reserved_1 field 22056 of perf_event_attr using PRIx64 format. 22057 22058 btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format 22059 * block.c (btrfs_ioctl): Print size and transid fields 22060 of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format. 22061 22062 block.c: change type of long long fileds to int64_t. 22063 * block.c (struct_blkpg_partition): Change type of start and length 22064 fields from long long to int64_t. 22065 (print_blkpg_req): Print them using PRId64 format. 22066 22067 2016-12-19 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22068 22069 Introduce current_klongsize in addition to current_wordsize. 22070 Subsequent commits are going to use current_klongsize 22071 as the tracee's size of kernel_ulong_t type. 22072 22073 * defs.h (PERSONALITY0_KLONGSIZE): New macro. 22074 [X86_64] (PERSONALITY2_KLONGSIZE): Likewise. 22075 [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise. 22076 [SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise. 22077 [SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == 22078 PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise. 22079 [SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 || 22080 PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize): 22081 New variable prototype. 22082 * syscall.c [!current_klongsize] (current_klongsize): New variable. 22083 [!current_klongsize] (personality_klongsize): New array. 22084 (set_personality) [!current_klongsize]: Update current_klongsize 22085 with the appropriate value from personality_klongsize. 22086 22087 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22088 22089 configure: define SIZEOF_KERNEL_LONG_T macro. 22090 Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and 22091 SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t 22092 types at the time of preprocessing. 22093 22094 * configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t. 22095 22096 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22097 22098 Remove getarg_ll. 22099 This function has never been used in the code, and in perspective 22100 the whole ext_arg thing will go away. 22101 22102 * defs.h (getarg_ll): Remove prototype. 22103 * util.c (getarg_ll): Remove. 22104 22105 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22106 22107 struct tcb: make types of syscall arguments unsigned. 22108 This is the first step in the direction of revisiting current practice 22109 of indiscriminate use of signed types for syscall arguments and memory 22110 addresses. 22111 22112 * kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long. 22113 * defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t. 22114 [HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long 22115 to unsigned long long. 22116 * desc.c (decode_select): Change type of syscall arguments from long 22117 to kernel_ureg_t. 22118 (SYS_FUNC(oldselect)): Change type of select_args from long 22119 to kernel_ureg_t. 22120 * io.c (print_lld_from_low_high_val): Remove no longer needed cast 22121 of syscall arguments to unsigned long. 22122 * lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long 22123 to long. 22124 * mem.c (print_mmap): Change type of syscall arguments from long 22125 to kernel_ureg_t. 22126 (SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg 22127 from long to kernel_ureg_t. 22128 (SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove 22129 no longer needed cast of syscall arguments to unsigned long. 22130 * pathtrace.c (pathtrace_match): Change type of args and select_args 22131 from long to kernel_ureg_t. 22132 * util.c (getarg_ull): Remove no longer needed casts of syscall 22133 arguments to unsigned types. 22134 22135 2016-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 22136 22137 s390: fix decoding of mmap2 syscall when arguments are not available. 22138 * mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr 22139 instead of umoven to fetch mmap arguments, fix return value when this 22140 fetch fails. 22141 22142 Fix pathmatch of oldselect syscall on 64-bit architectures. 22143 * pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect 22144 arguments on 64-bit architectures. 22145 22146 Cleanup oldselect. 22147 * desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros. 22148 22149 2016-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 22150 22151 Change scno type from long to unsigned long. 22152 Use an unsigned type for syscall numbers as they are not intended 22153 for signed arithmetics. Introduce kernel_scno_t as a typedef 22154 to unsigned long, that could be changed later to kernel_ulong_t. 22155 22156 * kernel_types.h (kernel_scno_t): New type, typedef to unsigned long. 22157 * defs.h (struct tcb): Change type of scno field from long 22158 to kernel_scno_t. 22159 (syscall_name): Change argument type from long to kernel_scno_t. 22160 (scno_in_range, scno_is_valid): Change argument type from unsigned long 22161 to kernel_scno_t. 22162 * linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type 22163 from long to kernel_scno_t. 22164 * linux/alpha/set_scno.c (arch_set_scno): Likewise. 22165 * linux/arc/set_scno.c (arch_set_scno): Likewise. 22166 * linux/arm/set_scno.c (arch_set_scno): Likewise. 22167 * linux/avr32/set_scno.c (arch_set_scno): Likewise. 22168 * linux/bfin/set_scno.c (arch_set_scno): Likewise. 22169 * linux/crisv10/set_scno.c (arch_set_scno): Likewise. 22170 * linux/hppa/set_scno.c (arch_set_scno): Likewise. 22171 * linux/i386/set_scno.c (arch_set_scno): Likewise. 22172 * linux/ia64/set_scno.c (arch_set_scno): Likewise. 22173 * linux/m68k/set_scno.c (arch_set_scno): Likewise. 22174 * linux/metag/set_scno.c (arch_set_scno): Likewise. 22175 * linux/microblaze/set_scno.c (arch_set_scno): Likewise. 22176 * linux/mips/set_scno.c (arch_set_scno): Likewise. 22177 * linux/nios2/set_scno.c (arch_set_scno): Likewise. 22178 * linux/or1k/set_scno.c (arch_set_scno): Likewise. 22179 * linux/powerpc/set_scno.c (arch_set_scno): Likewise. 22180 * linux/riscv/set_scno.c (arch_set_scno): Likewise. 22181 * linux/s390/set_scno.c (arch_set_scno): Likewise. 22182 * linux/sh/set_scno.c (arch_set_scno): Likewise. 22183 * linux/sh64/set_scno.c (arch_set_scno): Likewise. 22184 * linux/sparc/set_scno.c (arch_set_scno): Likewise. 22185 * linux/tile/set_scno.c (arch_set_scno): Likewise. 22186 * linux/x86_64/set_scno.c (arch_set_scno): Likewise. 22187 * linux/xtensa/set_scno.c (arch_set_scno): Likewise. 22188 * linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type 22189 from long to kernel_scno_t. 22190 * linux/alpha/get_scno.c (arch_get_scno): Likewise. 22191 * linux/arm/get_scno.c (arch_get_scno): Likewise. 22192 * linux/sh/get_scno.c (arch_get_scno): Likewise. 22193 * linux/x86_64/get_scno.c (arch_get_scno): Likewise. 22194 * syscall.c (arch_set_scno): Likewise. 22195 (shuffle_scno): Change return type from long to kernel_scno_t. 22196 (syscall_name): Change argument type from long to kernel_scno_t. 22197 22198 2016-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 22199 22200 Lowercase SCNO_IN_RANGE and SCNO_IS_VALID. 22201 * defs.h (SCNO_IN_RANGE): Rename to scno_in_range. All callers updated. 22202 (SCNO_IS_VALID): Rename to scno_is_valid. All callers updated. 22203 22204 Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions. 22205 * defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline 22206 functions. 22207 22208 count.c: use syserror instead of direct u_error access. 22209 * count.c (count_syscall): Use syserror instead of u_error. 22210 22211 Replace "(unsigned long) -1L" with -1UL. 22212 * defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL. 22213 * io.c (print_iovec, tprint_iov): Likewise. 22214 * msghdr.c (SYS_FUNC(sendmsg)): Likewise. 22215 * syscall.c (dumpio): Likewise. 22216 * poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U. 22217 22218 Add toplevel recursive check-valgrind rule. 22219 * Makefile.am (.PHONY): Add check-valgrind-local. 22220 (check-valgrind): New rule. 22221 * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it. 22222 22223 m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK. 22224 * m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend 22225 on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am 22226 instead of check-TESTS. 22227 22228 travis: do coverage using a dedicated build. 22229 * .travis.yml (after_success): Remove. 22230 (matrix): Create an entry for the regular x86_64 target. 22231 * travis-success.sh: Merge into ... 22232 * travis-build.sh: ... this file. Disable optimization 22233 for coverage builds. 22234 * travis-install.sh: Rename COVERAGE=true to CHECK=coverage. 22235 22236 2016-12-17 Dmitry V. Levin <ldv (a] altlinux.org> 22237 22238 mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t. 22239 * kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) && 22240 LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types. 22241 22242 2016-12-17 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22243 22244 util: simplify definitions of bit mask constants in umovestr. 22245 * util.c (umovestr): Do not check for SIZEOF_LONG in definitions 22246 of bit mask constants. 22247 22248 tests: check decoding of prctl operations without arguments. 22249 * tests/prctl-no-args.c: New file. 22250 * tests/prctl-no-args.test: New test. 22251 * tests/.gitignore: Add prctl-no-args. 22252 * tests/Makefile.am (check_PROGRAMS): Likewise. 22253 (DECODER_TESTS): Add prctl-no-args.test. 22254 22255 tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations. 22256 * tests/prctl-securebits.c: New file. 22257 * tests/prctl-securebits.test: New test. 22258 * tests/.gitignore: Add prctl-securebits. 22259 * tests/Makefile.am (check_PROGRAMS): Likewise. 22260 (DECODER_TESTS): Add prctl-securebits.test. 22261 22262 tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations. 22263 * tests/prctl-dumpable.c: New file. 22264 * tests/prctl-dumpable.test: New test. 22265 * tests/.gitignore: Add prctl-dumpable. 22266 * tests/Makefile.am (check_PROGRAMS): Likewise. 22267 (DECODER_TESTS): Add prctl-dumpable.test. 22268 22269 prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE 22270 * xlat/pr_dumpable.in: New file. 22271 * prctl.c: Include "xlat/pr_dumpable.h". 22272 (SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation 22273 and the second syscall argument of PR_SET_DUMPABLE operation 22274 as SUID_DUMP_* constants. 22275 22276 2016-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 22277 22278 Include "kernel_types.h" in defs.h and tests/tests.h. 22279 As kernel_ulong_t type is going to be used in the definition 22280 of struct tcb and in many function prototypes, make it readily 22281 available for every source file by including "kernel_types.h" 22282 in defs.h and tests/tests.h files. 22283 22284 * defs.h: Include "kernel_types.h". 22285 * tests/tests.h: Likewise. 22286 * desc.c: Do not include "kernel_types.h". 22287 * dirent.c: Likewise. 22288 * keyctl.c: Likewise. 22289 * syscall.c: Likewise. 22290 * linux/asm_stat.h: Likewise. 22291 * tests/answer.c: Likewise. 22292 * tests/epoll_pwait.c: Likewise. 22293 * tests/fanotify_init.c: Likewise. 22294 * tests/fanotify_mark.c: Likewise. 22295 * tests/file_handle.c: Likewise. 22296 * tests/ftruncate.c: Likewise. 22297 * tests/getdents.c: Likewise. 22298 * tests/init_delete_module.h: Likewise. 22299 * tests/inotify.c: Likewise. 22300 * tests/inotify_init1.c: Likewise. 22301 * tests/ioprio.c: Likewise. 22302 * tests/ipc_msgbuf.c: Likewise. 22303 * tests/kcmp.c: Likewise. 22304 * tests/kexec_file_load.c: Likewise. 22305 * tests/kexec_load.c: Likewise. 22306 * tests/keyctl.c: Likewise. 22307 * tests/lookup_dcookie.c: Likewise. 22308 * tests/lseek.c: Likewise. 22309 * tests/mq_sendrecv.c: Likewise. 22310 * tests/nsyscalls.c: Likewise. 22311 * tests/pkey_alloc.c: Likewise. 22312 * tests/pkey_free.c: Likewise. 22313 * tests/pkey_mprotect.c: Likewise. 22314 * tests/prctl-pdeathsig.c: Likewise. 22315 * tests/prctl-tsc.c: Likewise. 22316 * tests/preadv2-pwritev2.c: Likewise. 22317 * tests/process_vm_readv_writev.c: Likewise. 22318 * tests/read-write.c: Likewise. 22319 * tests/setfsugid.c: Likewise. 22320 * tests/setns.c: Likewise. 22321 * tests/truncate.c: Likewise. 22322 * tests/unshare.c: Likewise. 22323 * tests/xgetrlimit.c: Likewise. 22324 22325 2016-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 22326 22327 Post-release administrivia. 22328 * NEWS: Add a header line for the next release. 22329 * debian/changelog.in: Add a changelog entry for 4.15-1. 22330 * strace.spec.in: Likewise. 22331 22332 2016-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 22333 22334 xlat: provide fallback definitions for NETLINK_* constants. 22335 As new constants have been added gradually over kernel releases, define 22336 all constant values to make newer constants decoded properly when strace 22337 is built with older kernel headers. 22338 22339 * xlat/netlink_protocols.in: Add default values for constants. 22340 * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove. 22341 * socketutils.c: Likewise. 22342 22343 2016-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 22344 22345 tests: relax getaffinity return value check in tests/sched_xetaffinity.c 22346 * tests/sched_xetaffinity.c (errstr): New variable. 22347 (getaffinity, setaffinity): Initialize it. 22348 (main): Use it. Allow getaffinity return value to be less than 22349 its cpusetsize argument. 22350 22351 tests: fix threads-execve.test for large pids. 22352 * tests/threads-execve.c (main): Fix expected output for large pids. 22353 22354 2016-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 22355 22356 Prepare for 4.15 release. 22357 * NEWS: Update for 4.15 release. 22358 22359 .mailmap: add addresses of Thomas De Schampheleire. 22360 * .mailmap: Add both addresses of Thomas De Schampheleire here to avoid 22361 duplications in CREDITS file. 22362 22363 Sync strace.spec and debian/ with packages. 22364 * debian/control: Add Vcs-* metadata from 4.13-0.1. 22365 * debian/watch: Sync with 4.13-0.1. 22366 * strace.spec.in: Sync with 4.14.0.100.622a-1. 22367 22368 2016-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 22369 22370 tests: workaround a bug in GNU grep. 22371 Workaround a bug introduced in GNU grep 2.27, for details see 22372 https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html 22373 22374 * tests/init.sh (grep_pid_status): New function. 22375 * tests/detach-running.test: Use it instead of grep to search 22376 in /proc/$pid/status. 22377 * tests/detach-sleeping.test: Likewise. 22378 * tests/detach-stopped.test: Likewise. 22379 22380 2016-12-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22381 22382 tests: fix typo in comment inside prctl-tsc.c. 22383 22384 2016-12-13 Sean Stangl <sstangl (a] mozilla.com> 22385 Dmitry V. Levin <ldv (a] altlinux.org> 22386 22387 Fix libunwind segfault when -p is passed before -k. 22388 * strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after 22389 unwind_init for all allocated tcb structures if stack trace is enabled. 22390 * unwind.c (unwind_tcb_init): Skip if tcb is already initialized. 22391 22392 2016-12-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22393 Dmitry V. Levin <ldv (a] altlinux.org> 22394 22395 Update NEWS. 22396 22397 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22398 22399 tests: skip fault injection tests on unsupported platforms. 22400 * tests/fault_injection.sh: New file. 22401 * tests/Makefile.am (EXTRA_DIST): Add it. 22402 * tests/fault_injection-exit_group.test: Use it. 22403 * tests/fault_injection.test: Likewise. 22404 22405 tests: introduce require_min_kernel_version_or_skip function. 22406 * tests/init.sh (kernel_version_code, 22407 require_min_kernel_version_or_skip): New functions. 22408 * tests/threads-execve.test: Use require_min_kernel_version_or_skip. 22409 22410 2016-12-07 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22411 22412 tests: add descriptions to prctl-pdeathsig and prctl-tsc tests. 22413 22414 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22415 22416 tests: robustify prctl-pdeathsig.test and prctl-tsc.test. 22417 Rrobustify remaining prctl tests against unrelated prctl invocations 22418 22419 * tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_* 22420 prctl calls. 22421 * tests/prctl-tsc.test: Likewise. 22422 22423 2016-12-07 Thomas De Schampheleire <thomas.de_schampheleire (a] nokia.com> 22424 22425 Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD. 22426 Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra 22427 warning flags through configure.ac. The configure script will determine 22428 dynamically if CC supports these flags before adding them to WARN_CFLAGS. 22429 22430 ioctlsort is compiled with CC_FOR_BUILD, rather than CC. Nevertheless, 22431 the flags passed to this compilation also include WARN_CFLAGS (through 22432 AM_CFLAGS). This is incorrect: in a cross-compilation use case, CC 22433 and CC_FOR_BUILD are not the same. The former is the cross-compiler, 22434 the latter is the host compiler. Both may be of different versions 22435 and support different warning flags. 22436 22437 In particular, this posed a problem when cross-compiling with a host 22438 compiler gcc 4.1, which does not support all the new flags: 22439 22440 /usr/bin/gcc -DHAVE_CONFIG_H -I./linux/arm -I./linux/arm -I./linux 22441 -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body 22442 -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op 22443 -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration 22444 -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 22445 -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o 22446 ioctlsort0.o ./ioctlsort.c 22447 cc1: error: unrecognized command line option "-Wempty-body" 22448 cc1: error: unrecognized command line option "-Wignored-qualifiers" 22449 cc1: error: unrecognized command line option "-Wlogical-op" 22450 cc1: error: unrecognized command line option "-Wmissing-parameter-type" 22451 cc1: error: unrecognized command line option "-Wold-style-declaration" 22452 cc1: error: unrecognized command line option "-Wtype-limits" 22453 make[2]: *** [ioctlsort0.o] Error 1 22454 22455 * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New 22456 variables. 22457 (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS. 22458 (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS. 22459 (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS. 22460 * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect 22461 WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS, 22462 substitute WARN_CFLAGS_FOR_BUILD. 22463 22464 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22465 22466 m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers. 22467 * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use 22468 _AC_LANG_PREFIX[]FLAGS in unquoted form. Change gl_Warn to use gl_Flags 22469 instead of _AC_LANG_ABBREV. Change notification message to mention 22470 the variable name of the compiler. 22471 (gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if 22472 gl_unknown_warnings_are_errors is set. 22473 (gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from 22474 AC_REQUIRE to a regular call. 22475 22476 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22477 22478 AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler. 22479 Some of these variables cannot be redirected using traditional 22480 pushdef/popdef mechanism because of complex constructions like 22481 [ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros. 22482 Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue. 22483 22484 * m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc, 22485 ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89, 22486 am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using 22487 pushdef/popdef. 22488 Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag, 22489 ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu, 22490 ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR. 22491 22492 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22493 22494 Move all gl_WARN_ADD calls to a separate m4 macro. 22495 This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD 22496 change. 22497 22498 * configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD. 22499 Move all gl_WARN_ADD calls ... 22500 * m4/st_warn_cflags.m4: ... here. 22501 22502 2016-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 22503 22504 m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros. 22505 These new macros are going to be needed for the upcoming 22506 AX_PROG_CC_FOR_BUILD change. 22507 22508 * m4/st_save_restore_var.m4: New file. 22509 22510 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22511 22512 tests: add valgrind support to "make check" 22513 * m4/ax_valgrind_check.m4: Import from the autoconf-archive package. 22514 * configure.ac: Invoke AX_VALGRIND_CHECK. 22515 * valgrind.supp: Move to tests/strace.supp. 22516 * Makefile.am (EXTRA_DIST): Remove valgrind.supp. 22517 * tests/Makefile.am: Add @VALGRIND_CHECK_RULES@. 22518 (VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables. 22519 (EXTRA_DIST): Add strace.supp. 22520 * tests/init.sh: Add valgrind command prefix to $STRACE when appropriate. 22521 22522 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22523 22524 tests: robustify threads-execve.test against race conditions. 22525 Due to probabilistic nature of the test, try it several times. 22526 22527 * tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1. 22528 * tests/threads-execve.test: Iterate up to 10 times. 22529 22530 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22531 22532 tests: fix expected output in strace-ttt.test. 22533 If strace -ttt is running too long, it might happen that time stamps 22534 before and after its invocation differ for more than a second. 22535 Adjust expected output to handle this rare but possible case. 22536 22537 * tests/strace-ttt.test: Allow any time stamp between start and finish 22538 of strace invocation. 22539 22540 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22541 22542 tests: fix expected output in strace-tt.test. 22543 If strace -tt is running too long, it might happen that time stamps 22544 before and after its invocation differ for more than a second. 22545 Adjust expected output to handle this rare but possible case. 22546 22547 * tests/strace-tt.test: Allow any time stamp between start and finish 22548 of strace invocation. 22549 22550 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22551 22552 tests: robustify redirect.test against race conditions. 22553 Introduce a synchronization mechanism between the tracee and its peer. 22554 22555 * tests/redirect.test: Change timeout file to $OUT. Let the tracee 22556 remove $LOG, wait for $LOG removal in its peer. 22557 22558 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22559 22560 tests: robustify attach-f-p.test against race conditions. 22561 Introduce a synchronization mechanism between attach-f-p and strace. 22562 22563 * tests/attach-f-p-cmd.c: New file. 22564 * tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd. 22565 * tests/attach-f-p.c: Include <sys/stat.h>. 22566 (main): Write to stdout instead of descriptor 3. Wait for the peer 22567 writing to stdout. 22568 * tests/attach-f-p.test: Assume that ./attach-f-p-cmd works. 22569 Use $OUT for expected output. Use attach-f-p-cmd for unlocking $OUT. 22570 22571 2016-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 22572 22573 tests: robustify attach-p-cmd.test against race conditions. 22574 Introduce a synchronization mechanism between attach-p-cmd-p 22575 and attach-p-cmd-cmd processes. 22576 22577 * tests/attach-p-cmd-cmd.c: Include <errno.h> and <sys/stat.h>. 22578 (main): Wait for the lock directory creation by attach-p-cmd-p. 22579 * tests/attach-p-cmd-p.c: Include <errno.h> and <sys/stat.h>. 22580 (main): Create a lock directory and wait for its removal 22581 by attach-p-cmd-cmd. 22582 * tests/attach-p-cmd.test: Assume that test programs work. 22583 22584 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22585 22586 Rewrite remaining qual_* parsers using bit sets. 22587 * defs.h (struct fault_opts): Replace forward declaration 22588 with a definition. 22589 (qualbits_t, qualify_read, qualify_write, qualify_signals): Remove. 22590 (qual_flags): New function prototype. 22591 (nsyscall_vec, sysent_vec, fault_vec): New variable prototypes. 22592 * qualify.c (abbrev_set, fault_set, raw_set, trace_set, verbose_set): 22593 New variables. 22594 (qualify_read, qualify_write, qualify_signals): Add static qualifier. 22595 (find_errno_by_name, lookup_class, parse_fault_expression, 22596 parse_fault_token, qual_flags, qualify, qualify_abbrev, qualify_fault, 22597 qualify_raw, qualify_syscall, qualify_syscall_class, 22598 qualify_syscall_name, qualify_syscall_number, qualify_syscall_tokens, 22599 qualify_trace, qualify_verbose, strip_prefix): New functions. 22600 * syscall.c (nsyscall_vec, nsysent_vec): Remove static qualifier. 22601 (MAX_NSYSCALLS1, MAX_NSYSCALLS2, MAX_NSYSCALLS, qual_vec, qual_flags, 22602 qual_fault, qual_syscall, qual_options, fault_opts, qualify_one, 22603 qualify_scno, lookup_class, qualify_syscall_class, qualify_syscall_name, 22604 qual_syscall_ex, qual_syscall, strip_prefix, find_errno_by_name, 22605 parse_fault_token, parse_fault_expression, qual_fault, qualify): Remove. 22606 (decode_socket_subcall, decode_ipc_subcall, decode_mips_subcall, 22607 get_scno): Update use of qual_flags. 22608 (inject_syscall_fault_entering): Update per-personality allocation 22609 of tcp->fault_vec. 22610 * tests/fault_injection-exit_group.test: Check parsing of inversed 22611 fault sets. 22612 * tests/fault_injection.test: Check parsing of -efault=none. 22613 * tests/options-syntax.test: Check parsing of invalid syscall numbers. 22614 22615 Change qual_vec/qual_fault into static fixed size arrays. 22616 * defs.h (qual_vec, num_quals): Remove. 22617 (qual_flags): Move ... 22618 * syscall.c: ... here. 22619 (num_quals, num_faults, MIN_QUALS, reallocate_vec, reallocate_qual, 22620 reallocate_fault): Remove. 22621 (qual_vec, qual_fault): Change into static fixed size arrays. 22622 (qualify_one): Remove reallocate_qual and reallocate_fault calls. 22623 (qualify): Likewise. Replace num_quals and num_faults with 22624 MAX_NSYSCALLS. 22625 22626 Rewrite qual_signal using bit sets. 22627 * defs.h (signal_set): New variable prototypes. 22628 (qualify_signals): New function prototypes. 22629 (QUAL_SIGNAL): Change to a value greater than 0xff. 22630 (QUAL_FAULT): Change to a lower value. 22631 * qualify.c (signal_set): New variable. 22632 (sigstr_to_uint, qualify_signals): New functions. 22633 * syscall.c (qual_signal): Remove. 22634 (qual_options): Replace qual_signal with NULL. 22635 (qualify): Use qualify_signals. 22636 * strace.c (print_signalled, print_stopped): Use is_number_in_set 22637 with signal_set argument. 22638 22639 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22640 22641 Rewrite qual_desc using bit sets. 22642 As a side effect, this also fixes support of negated sets 22643 of descriptors. 22644 22645 * defs.h (struct number_set): New forward declaration. 22646 (read_set, write_set): New variable prototypes. 22647 (is_number_in_set, qualify_read, qualify_write): New function 22648 prototypes. 22649 (QUAL_READ, QUAL_WRITE): Change to values greater than 0xff. 22650 * qualify.c: New file. 22651 * Makefile.am (strace_SOURCES): Add it. 22652 * syscall.c (qual_desc): Remove. 22653 (qual_options): Replace qual_desc with NULL. 22654 (qualify): Use qualify_read and qualify_write. 22655 (dumpio): Use is_number_in_set. 22656 * tests/options-syntax.test: Check invalid sets of descriptors. 22657 * tests/readv.test: Check dumping of negated sets of descriptors. 22658 22659 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22660 22661 tests: skip redirect-fds.test when strace is wrapped with valgrind. 22662 valgrind is not as transparent as strace wrt standard descriptors, 22663 so if strace is wrapped with valgrind, the test would check valgrind 22664 transparency properties and fail imminently. 22665 22666 * tests/redirect-fds.test: Skip the test when $STRACE shows a presence 22667 of valgrind. 22668 22669 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22670 22671 Add valgrind.supp. 22672 As valgrind is not quite happy about the way how get_cpuset_size uses 22673 sched_getaffinity, add a suppression file for this case. 22674 22675 * valgrind.supp: New file. 22676 * Makefile.am (EXTRA_DIST): Add it. 22677 22678 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22679 22680 affinity: pass 0 as a pid to sched_getaffinity. 22681 * affinity.c (get_cpuset_size): Pass 0 instead of getpid() 22682 to sched_getaffinity. 22683 22684 affinity: document the method of finding out the cpuset size. 22685 * affinity.c (get_cpuset_size): Add a comment about sched_getaffinity. 22686 22687 2016-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 22688 22689 tests: make options-syntax.test tolerant of strace wrappers. 22690 Change the test to allow wrappers like STRACE="valgrind ./strace". 22691 22692 * tests/options-syntax.test: Strip all words but last from $STRACE 22693 variable in all contexts where the name of strace executable is expected 22694 in its output. 22695 22696 2016-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 22697 22698 Do not allocate memory for line buffered output. 22699 libc is perfectly capable of allocating memory for its buffers, 22700 so let it do its job. 22701 22702 * strace.c (init): Do not allocate memory for setvbuf invocation. 22703 22704 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22705 22706 Update NEWS. 22707 22708 tests: use kernel_ulong_t as argument type in setfsuid/setfsgid tests. 22709 * setfsugid.c: Include "kernel_types.h". 22710 (main): Change type of entries of the "tests" array from long to 22711 kernel_ulong_t. 22712 22713 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22714 Elvira Khabirova <lineprinter0 (a] gmail.com> 22715 22716 uid: print size as signed in setgroups/getgroups. 22717 As this is the type used in kernel. 22718 22719 * uid.c (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Print size parameter 22720 as "%d". 22721 * tests/getgroups.c: Update expected output. 22722 * tests/setgroups.c: Likewise. 22723 22724 2016-12-04 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22725 Elvira Khabirova <lineprinter0 (a] gmail.com> 22726 22727 uid: use printuid for printing UID/GID value. 22728 * uid.c (setfsuid, get_print_uid, print_gid): Use printuid. 22729 * tests/setfsugid.c (printuid): New function. 22730 (main): Use it to print UID/GID values. 22731 * tests/setgroups.c: Likewise. 22732 * tests/setugid.c (ugid2int): Remove. 22733 (printuid): New function. 22734 (main): Use it to print UID/GID values. 22735 22736 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22737 22738 tests: additional check for PTRACE_SETSIGINFO ptrace command. 22739 * tests/ptrace.c (main): Add an additional PTRACE_SETSIGINFO check. 22740 22741 2016-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 22742 22743 syscall_name: clear __X32_SYSCALL_BIT from syscall number on x32. 22744 * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro. 22745 * syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]: 22746 Clear __X32_SYSCALL_BIT from scno on x32 personality. 22747 22748 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22749 22750 Print syscall names only for defined syscalls. 22751 The string literal "__NR_syscall_4294967295" is semantically incorrect 22752 as there is no such constant defined. 22753 22754 * syscall.c (syscall_name): Return NULL if there is no syscall 22755 corresponding to the given number. 22756 * defs.h (syscall_name): Document this behaviour. 22757 * printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix 22758 only if there is a syscall corresponding to si_syscall number; print 22759 a plain syscall number otherwise. 22760 * tests/ptrace.c (main): Update expected output. 22761 22762 2016-12-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22763 22764 affinity: print cpu set as an array. 22765 * affinity.c: Add comma between elements of cpu set. 22766 * tests/sched_xetaffinity.c (main): Update expected output. 22767 22768 statfs: fix printing format of f_fsid field. 22769 * print_statfs.c: Print f_fsid as a structure containing field "val" 22770 which, in turn, is an array of two elements that used to be printed 22771 as members of f_fsid structure. 22772 * tests/statfs.expected: Update expected output. 22773 * tests/xstatfsx.c (print_statfs): Likewise. 22774 22775 swap: always print priority value. 22776 * swapon.c (SYS_FUNC(swapon)): Do not check for non-zero the value 22777 of the prio variable in order to print it. 22778 * tests/swap.c (main): Update expected output. 22779 22780 2016-12-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 22781 22782 tests: show pattern line number in match_grep. 22783 This makes debugging of failing test a bit easier. 22784 22785 * tests/init.sh (match_grep): Add the cnt variable, increment it on every 22786 pattern line read, print it as a prefix for non-matched pattern. 22787 22788 2016-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22789 Elvira Khabirova <lineprinter0 (a] gmail.com> 22790 22791 futex: make output of the val3 argument of the FUTEX_WAKE_OP command more structured 22792 It is a number which consists of several xlat values, not a structure. 22793 22794 * futex.c (SYS_FUNC(futex)): Modify output of the val3 argument 22795 of the FUTEX_WAKE_OP futex syscall command. 22796 * tests/futex.c (main): Update expected output. 22797 22798 2016-11-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22799 22800 tests: additional checks for prctl-* tests. 22801 * tests/prctl-pdeathsig.c (main): Additional checks. 22802 * tests/prctl-tsc.c (main): Likewise. 22803 * tests/prctl-pdeathsig.test: Update value of -a argument. 22804 * tests/prctl-tsc.test: Likewise. 22805 22806 2016-11-30 JingPiao Chen <chenjingpiao (a] foxmail.com> 22807 22808 tests: add prctl-pdeathsig.test and prctl-tsc.test. 22809 * tests/prctl-pdeathsig.c: New file. 22810 * tests/prctl-tsc.c: Likewise. 22811 * tests/prctl-pdeathsig.test: New test. 22812 * tests/prctl-tsc.test: Likewise. 22813 * tests/.gitignore: Add prctl-pdeathsig and prctl-tsc. 22814 * tests/Makefile.am (check_PROGRAMS): Likewise. 22815 (DECODER_TESTS): Add prctl-pdeathsig.test and prctl-tsc.test. 22816 22817 2016-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 22818 22819 syscall: Simplify strip_prefix. 22820 * syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp. 22821 22822 util: fix integer overflow check in string_to_uint_ex. 22823 * util.c (string_to_uint_ex): Fix the check for integer overflow 22824 on systems where LONG_MAX == INT_MAX. 22825 22826 Check dumping of io syscalls when descriptor arguments are sensibly large 22827 * tests/tests.h (pipe_maxfd): New prototype. 22828 * tests/pipe_maxfd.c: New file. 22829 * tests/print_maxfd.c: Likewise. 22830 * tests/.gitignore: Add print_maxfd. 22831 * tests/Makefile.am (check_PROGRAMS): Likewise. 22832 (libtests_a_SOURCES): Add pipe_maxfd.c. 22833 * tests/readv.c (main): Use pipe_maxfd() instead of pipe(), 22834 fds[0] instead of 0, fds[1] instead of 1. 22835 * tests/readv.test: Use print_maxfd to specify dump descriptor numbers. 22836 22837 dumpio: remove useless check. 22838 * syscall.c (dumpio): Remove SEN_printargs check. Use tcp->s_ent->sen 22839 directly. 22840 22841 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 22842 22843 Fix dumping of io syscalls when descriptor argument has unused bits set. 22844 * syscall.c (dumpio): Explicitly cast the first argument of syscall 22845 to "int", the same way as the kernel does. 22846 * tests/read-write.c: Include <asm/unistd.h> and "kernel_types.h". 22847 (k_read, k_write): New functions. 22848 (test_dump, main): Use them. 22849 22850 x32: fix preadv2-pwritev2.test. 22851 * tests/preadv2-pwritev2.c: Include "kernel_types.h". 22852 (main): Use kernel_ulong_t instead of unsigned long as types 22853 of arguments of preadv2 and pwritev2 syscalls. 22854 22855 x32: wire up preadv2 and pwritev2 syscalls. 22856 * linux/x32/syscallent.h [546]: Add preadv2 entry. 22857 [547]: Add pwritev2 entry. 22858 22859 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22860 Elvira Khabirova <lineprinter0 (a] gmail.com> 22861 22862 signal: fix omission of field names in sigaction printers. 22863 * signal.c (decode_old_sigaction, decode_new_sigaction): Add printing 22864 of the field names. 22865 * tests/sigaction.awk: Update expected output. 22866 22867 2016-11-29 Elvira Khabirova <lineprinter0 (a] gmail.com> 22868 22869 Make date output format conform to ISO 8601. 22870 * util.c (sprinttime): Make date output conform to ISO 8601. 22871 * tests/utime.c (print_tm): Update expected output. 22872 * tests/xstatx.c (print_time): Likewise. 22873 22874 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 22875 22876 tests: rewrite utime.test without relying on libc utime wrapper. 22877 * tests/utime.c (k_utime): New function, a thin wrapper around 22878 syscall(__NR_utime). 22879 (main): Use it instead of utime. 22880 * tests/utime.test: Update. 22881 22882 2016-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 22883 22884 Fix meaning of negated sets in fault expressions. 22885 Change the parser of fault expression to follow the POLA: 22886 -e fault=!SET 22887 means that all syscalls except those from SET are subject to fault 22888 injection; 22889 -e fault=!SET1:error=ERRNO1, -e fault=!SET2:error=ERRNO2 22890 means that all syscalls except those from SET2 are subject to fault 22891 injection with error code ERRNO2, and all syscalls from SET2 that are 22892 not in SET1 are subject to fault injection with error code ERRNO1. 22893 22894 * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): 22895 Handle negated QUAL_FAULT case differently. 22896 * tests/fault_syntax.test: Add checks of negated sets. 22897 22898 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22899 22900 print_sigevent: fix field names of sigev_value structure. 22901 * print_sigevent.c (print_sigevent): Change "int" to "sival_int", "ptr" 22902 to "sival_ptr". 22903 * tests/mq_sendrecv.c (main): Update expected output in accordance with 22904 fixed field names. 22905 * tests/timer_create.c (main): Likewise. 22906 22907 tests: add more utime checks. 22908 * tests/utime.c: Include <unistd.h> and <asm/unistd.h>. 22909 (main): Add checks for invalid pointers. 22910 22911 utime: fix omission of field names in utimbuf structure printing. 22912 * utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure, 22913 not as an array (use curly brackets instead of square ones). 22914 Add field names to the output. 22915 * tests/utime.c (main): Update expected output. 22916 22917 mem: print mincore output as an array. 22918 * mem.c (SYS_FUNC(minore)): Print commas between elements. 22919 * tests/mincore.c (print_mincore): Update expected output in accordance 22920 with syscall decoder formatting change. 22921 22922 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22923 22924 util: provide information whether xlat value has been found. 22925 This is necessary for the upcoming change in the output format 22926 of the val3 argument of the FUTEX_WAKE_OP futex command. 22927 22928 * defs.h (printxvals, printxval_searchn): Change return type to int. 22929 (printxval64, printxval, printxval_long): Likewise. Forward the value 22930 returned by printxvals call. 22931 * util.c (printxvals, printxval_searchn): Change return type to int, 22932 return 1 if xlat value has been found, 0 otherwise. 22933 22934 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22935 22936 util: check dflt argument for NULL in printxvals. 22937 This is necessary for the upcoming change in the output format 22938 of the val3 argument of the FUTEX_WAKE_OP futex command. 22939 22940 * util.c (printxvals): Do not print dflt if it is NULL. 22941 22942 2016-11-29 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22943 22944 capability: fix omission of capability structure field names. 22945 * capability.c (print_cap_header, print_cap_data): Add field names 22946 to the output. 22947 * tests/caps.awk: Update test output. 22948 22949 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 22950 22951 tests: fix "comparison between signed and unsigned" compilation warnings 22952 * tests/readv.c (main): Cast r_len to int. 22953 * tests/preadv2-pwritev2.c (dumpio): Likewise. 22954 22955 aarch64, arm, sparc: add comments on fault injection support in kernel. 22956 * linux/aarch64/set_scno.c: Note the kernel commit that introduced 22957 NT_ARM_SYSTEM_CALL support. 22958 * linux/arm/set_scno.c: Note the kernel commit that introduced 22959 PTRACE_SET_SYSCALL support. 22960 * linux/sparc/set_scno.c: Note the kernel commit that introduced 22961 reloading from the syscall number register. 22962 22963 tests: check -C option. 22964 * tests/strace-C.expected: New file. 22965 * tests/strace-C.test: New test. 22966 * tests/Makefile.am (MISC_TESTS): Add strace-C.test. 22967 (EXTRA_DIST): Add strace-C.expected. 22968 22969 tests: check basic options syntax. 22970 * tests/options-syntax.test: New file. 22971 * tests/Makefile.am (MISC_TESTS): Add it. 22972 22973 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 22974 22975 Fix -r option syntax. 22976 While -r option implies -t, it should not literally have the effect 22977 of -t option, e.g. -rr should not increment tflag twice. 22978 22979 * strace.c (init): In the getopt loop, do not increment tflag for each 22980 occurrence of -r option. After the getopt loop, if rflag is set, set 22981 tflag to 1. Issue a warning that -tt has no effect with -r. 22982 22983 2016-11-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 22984 22985 Print timeval pair as an array of timeval entries. 22986 * print_timeval.c (print_timeval_item): New function. 22987 (print_timeval_pair): Use it as a print_function in print_array call. 22988 * tests/futimesat.c (main): Update to test new behaviour. 22989 * tests/utimes.c (main): Likewise. 22990 22991 tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests 22992 * tests/futimesat.c: Print tv_sec and tv_usec fields as signed types. 22993 * tests/utimes.c: Likewise. 22994 22995 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 22996 22997 alpha: print struct timeval32 consistently. 22998 * defs.h [ALPHA] (timeval32_t): New type. 22999 [ALPHA] (print_timeval32_t): New prototype. 23000 * print_timeval.c [ALPHA] (timeval32_t): Remove. 23001 [ALPHA] (print_timeval32_t): Remove static keyword. 23002 * printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead 23003 of local definition of struct timeval32. Use print_timeval32_t. 23004 23005 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 23006 23007 Print struct timeval consistently. 23008 Use print_struct_timeval interface to print struct timeval. 23009 23010 * print_timeval.c (print_struct_timeval): New mpers printer. 23011 * print_timex.c (print_timex): Use it. 23012 * printrusage.c (printrusage): Likewise. 23013 * v4l2.c (print_v4l2_buffer): Likewise. 23014 * tests/getrusage.c (main): Print tv_sec and tv_usec fields as signed. 23015 * tests/waitid.c (sprint_rusage): Likewise. 23016 23017 Suggested-by: Eugene Syromyatnikov <evgsyr (a] gmail.com> 23018 23019 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 23020 23021 Split print_time.c. 23022 After commit v4.14-136-g151d1d1 that removed the last object common 23023 for timespec and timeval parsers there is no need to keep them all 23024 in a single file. 23025 23026 * print_timespec.c: New file. 23027 * print_timeval.c: Likewise. 23028 * Makefile.am (strace_SOURCES): Add them. 23029 * print_time.c: Move all timespec related code to print_timespec.c. 23030 Move all timeval related code to print_timeval.c. 23031 23032 2016-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 23033 23034 tests: check decoding of threads when a non-leader thread invokes execve 23035 * tests/threads-execve.c: New file. 23036 * tests/threads-execve.test: New test. 23037 * tests/.gitignore: Add threads-execve. 23038 * tests/Makefile.am (check_PROGRAMS): Likewise. 23039 (threads_execve_LDADD): New variable. 23040 (MISC_TESTS): Add threads-execve.test. 23041 23042 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 23043 23044 tests: check decoding of fault injected exit_group syscall. 23045 * tests/answer.c: New file. 23046 * tests/fault_injection-exit_group.expected: Likewise. 23047 * tests/fault_injection-exit_group.test: New test. 23048 * tests/.gitignore: Add answer. 23049 * tests/Makefile.am (check_PROGRAMS): Likewise. 23050 (DECODER_TESTS): Add fault_injection-exit_group.test. 23051 (EXTRA_DIST): Add fault_injection-exit_group.expected. 23052 23053 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 23054 23055 Set PTRACE_O_TRACEEXIT option and handle PTRACE_EVENT_EXIT events. 23056 Do not assume that some syscalls do not generate syscall-exit-stops. 23057 When syscalls fail for any reason they may generate syscall-exit-stops. 23058 23059 The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT 23060 and print the end of unfinished exiting syscall properly. 23061 23062 * exit.c: Remove. 23063 * Makefile.am (strace_SOURCES): Remove exit.c. 23064 * linux/dummy.h (sys_exit): Alias to printargs_d. 23065 * strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit. 23066 (print_event_exit): New function. 23067 (trace): Use it in case of PTRACE_EVENT_EXIT. 23068 * syscall.c (trace_syscall_entering): Remove special handling 23069 of SEN_exit. 23070 23071 2016-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 23072 23073 Change printargs to return RVAL_DECODED. 23074 As printargs is invoked as a generic syscall decoder only and 23075 it is not supposed to print anything on exiting, change printargs 23076 to return RVAL_DECODED so it would not be called on exiting at all. 23077 23078 * util.c (printargs): Print args unconditionally, return RVAL_DECODED. 23079 23080 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 23081 23082 Enhance error diagnostics of exit/exit_group decoder. 23083 * exit.c (SYS_FUNC(exit)): Print the name of syscall that has returned. 23084 23085 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 23086 23087 Restrain from fault injection while the trace executes strace code. 23088 There is little use in injections of faults into syscalls made by strace. 23089 23090 * syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from 23091 tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set. 23092 23093 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 23094 23095 Move two global flags to tracee scope. 23096 A simultaneous use of -p option and tracing of a command available 23097 since commit v4.11-183-gfa8c286 introduces a race condition because 23098 the flags whether the first exec has happened are global. 23099 23100 Fix the race by moving hide_log_until_execve and hide_log_until_execve 23101 global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits 23102 in struct tcb.flags, correspondingly. 23103 23104 * defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log): 23105 New macros. 23106 (hide_log_until_execve): Remove prototype. 23107 * strace.c (skip_one_b_execve, hide_log_until_execve): Remove. 23108 (startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits 23109 in the allocated tcb structure. 23110 (init): Remove initialization of hide_log_until_execve and 23111 skip_one_b_execve. 23112 (print_stopped): Use hide_log() instead of hide_log_until_execve. 23113 (trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead 23114 of skip_one_b_execve. 23115 * syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of 23116 hide_log_until_execve. 23117 (trace_syscall_entering, trace_syscall_exiting): Check hide_log() 23118 instead of hide_log_until_execve. 23119 23120 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 23121 23122 Treat execveat as an execve family syscall. 23123 * syscall.c (trace_syscall_entering): Clear hide_log_until_execve flag 23124 also when SEN_execveat is encountered. 23125 23126 2016-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 23127 23128 Change parser of fault expressions to conform the documentation. 23129 Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work 23130 as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM. 23131 23132 * syscall.c (parse_fault_expression): Remove const qualifier from 23133 "name" and "token: variables, as well as from the return value. 23134 (qual_fault): Remove const qualifier from "name" variables. 23135 Split "name" into comma delimited tokens and pass each token 23136 to individual qual_syscall_ex call. 23137 (qualify): For QUAL_FAULT options, pass the whole option value 23138 to their qualify methods without prior splitting into comma 23139 delimited tokens. 23140 * tests/fault_injection.test: Check it. 23141 * tests/fault_syntax.test: Check empty syscall sets. 23142 23143 2016-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 23144 23145 Simplify parse_fault_expression. 23146 * syscall.c (parse_fault_expression): Rewrite iterator over strtok_r 23147 in a more concise way. 23148 23149 2016-11-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23150 23151 Fix omission of field names in printers of timeval structure. 23152 * print_time.c (time_fmt): Remove. 23153 (timeval_fmt): New constant. 23154 (print_timeval_t, sprint_timeval, print_timeval32_t, sprint_timeval32): 23155 Use it instead of time_fmt. 23156 * print_timex.c (print_timex): Print field names of the time field. 23157 * printrusage.c (printrusage, printrusage32): Print field names 23158 of ru_utime and ru_stime fields. 23159 * tests/adjtimex.c (main): Add field names to expected output. 23160 * tests/clock_nanosleep.c (main): Likewise. 23161 * tests/futimesat.c (main): Likewise. 23162 * tests/getrusage.c (main): Likewise. 23163 * tests/nanosleep.c (main): Likewise. 23164 * tests/oldselect.expected: Likewise. 23165 * tests/utimes.c (main): Likewise. 23166 * tests/wait4.c (sprint_rusage): Likewise. 23167 * tests/waitid.c (sprint_rusage): Likewise. 23168 * tests/xetitimer.c (main): Likewise. 23169 * tests/xettimeofday.c (main): Likewise. 23170 * tests/xselect.c (main): Likewise. 23171 23172 Fix omission of field names in printers of timespec structure. 23173 * print_time.c (timespec_fmt): New constant. 23174 (print_timespec_t, sprint_timespec): Use it instead of time_fmt. 23175 * tests/aio.c: Add field names to expected output. 23176 * tests/clock_nanosleep.c (main): Likewise. 23177 * tests/clock_xettime.c (main): Likewise. 23178 * tests/futex.c (main): Likewise. 23179 * tests/mq_sendrecv.c (do_send, do_recv): Likewise. 23180 * tests/nanosleep.c (main): Likewise. 23181 * tests/ppoll-v.expected: Likewise. 23182 * tests/ppoll.expected: Likewise. 23183 * tests/pselect6.c (main): Likewise. 23184 * tests/recvmmsg-timeout.c (main): Likewise. 23185 * tests/restart_syscall.c (main): Likewise. 23186 * tests/rt_sigtimedwait.c (iterate, main): Likewise. 23187 * tests/sched_rr_get_interval.c (main): Likewise. 23188 * tests/semop.c (main): Likewise. 23189 * tests/strace-T.expected: Likewise. 23190 * tests/timer_xettime.c (main): Likewise. 23191 * tests/timerfd_xettime.c (main): Likewise. 23192 * tests/utimensat.c (print_ts): Likewise. 23193 23194 2016-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 23195 23196 tests: robustify prctl-name.test against unrelated prctl invocations. 23197 * tests/prctl-name.test: Filter out unrelated PR_GET_* prctl calls. 23198 23199 2016-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 23200 23201 tests: cleanup prctl-name.c. 23202 * tests/prctl-name.c (main): Remove "len" variable, rename "len1" 23203 to "len". Remove "name1" variable, use "name" instead. 23204 23205 Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h. 23206 * linux/32/ioctls_inc_align32.h: Regenerate. 23207 * linux/32/ioctls_inc_align64.h: Likewise. 23208 * linux/64/ioctls_inc.h: Likewise. 23209 * linux/arm/ioctls_arch0.h: Likewise. 23210 * linux/i386/ioctls_arch0.h: Likewise. 23211 * linux/powerpc/ioctls_arch0.h: Likewise. 23212 * linux/s390/ioctls_arch0.h: Likewise. 23213 * linux/s390x/ioctls_arch0.h: Likewise. 23214 * linux/x32/ioctls_inc0.h: Likewise. 23215 * linux/x86_64/ioctls_arch0.h: Likewise. 23216 23217 maint: add more workarounds for alpha and powerpc. 23218 * maint/ioctls_sym.sh: Skip asm/core_*.h. Filter out from 23219 asm-generic/ioctls.h those macros that are defined using unavailable 23220 struct termios2 on alpha and powerpc. 23221 23222 2016-11-22 Andreas Schwab <schwab (a] linux-m68k.org> 23223 23224 Add ioctl definitions for 16-bit alignment. 23225 * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align16.h. 23226 * linux/32/ioctls_inc_align16.h: New file. 23227 * linux/32/ioctls_inc.h [M68K]: Include it. 23228 23229 2016-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 23230 23231 maint: move KVM_* constants from ioctls_inc.h to ioctls_arch.h. 23232 * maint/ioctls_gen.sh: Place constants defined in linux/kvm.h 23233 into ioctls_arch.h instead of ioctls_inc.h. 23234 23235 2016-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 23236 23237 maint: harmonize use of ioctls_sym.sh. 23238 * maint/ioctls_gen.sh: Consistently specify INCLUDES for all 23239 ioctls_sym.sh invocations. Use $mydir to specify ioctls_sym.sh 23240 location. 23241 23242 maint: rework workarounds for linux/kvm.h. 23243 * maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds. 23244 Skip linux/kvm.h on those architectures that have no asm/kvm.h file. 23245 Introduce post-process workarounds, add post-process workarounds 23246 for linux/kvm.h. 23247 23248 2016-11-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 23249 23250 Restructure strace.1. 23251 * strace.1 (OPTIONS): Add subsections. 23252 (PROBLEMS): Rename to REPORTING BUGS. 23253 (SEE ALSO): Move to the bottom. 23254 23255 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23256 23257 prctl: implement decoding of PR_SET_FP_MODE and PR_GET_FP_MODE options. 23258 * xlat/pr_fp_mode.in: New file. 23259 * prctl.c: Include "xlat/pr_fp_mode.h". 23260 (SYS_FUNC(prctl)): Add handling for PR_SET_FP_MODE and PR_GET_FP_MODE 23261 options. 23262 23263 prctl: add braces for conditional blocks with else/else-if blocks having braces 23264 23265 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23266 23267 prctl: cast arg2 to int in PR_SET_PTRACER handler. 23268 Kernel code does this when compares it with -1 (apart from comparing it with 23269 PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c. 23270 23271 * prctl.c (SYS_FUNC(prctl)) <PR_SET_PTRACER>: Cast arg2 to int before 23272 comparing it with -1. 23273 23274 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23275 23276 prctl: use getarg_ull for option value retrieval. 23277 The prctl syscall does not use compat on x32/n32, so argument types 23278 are in fact kernel_ulong_t. 23279 23280 * prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead 23281 of "%#lx". 23282 (SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3, 23283 arg4, arg5 variables of type unsigned long long. Use them in printing 23284 routines. 23285 (SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr 23286 variable of type unsigned long long. Print it as "%#llx" instead of 23287 "%#lx". 23288 23289 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23290 23291 block: add some definitions from <linux/blkpg.h> 23292 This is done in order to fix build error on old distributions where 23293 struct blkpg_ioctl_arg declaration is broken: 23294 23295 In file included from block.c:35: 23296 /usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token 23297 block.c: In function 'print_blkpg_req': 23298 block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data' 23299 23300 (from SLE10) 23301 23302 * block.c: Include <linux/ioctl.h> instead of <linux/blkpg.h>. 23303 (BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros. 23304 (struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions, 23305 copied from blkpg_ioctl_arg and blkpg_partition structures defined 23306 in <linux/blkpg.h>. 23307 23308 2016-11-20 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23309 23310 xlat: add values to new ARCH_* constants. 23311 Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE 23312 and they would never be defined in user space. 23313 23314 * xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants. 23315 23316 2016-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 23317 23318 prctl: include <linux/prctl.h> instead of <sys/prctl.h> 23319 There are no users of prctl function in prctl.c, and all the rest 23320 is provided by <linux/prctl.h> anyway. 23321 23322 * prctl.c: Include <linux/prctl.h> instead of <sys/prctl.h>. 23323 23324 2016-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 23325 23326 tests: check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. 23327 * tests/prctl-name.c: New file. 23328 * tests/prctl-name.test: New test. 23329 * tests/.gitignore: Add prctl-name. 23330 * tests/Makefile.am (check_PROGRAMS): Likewise. 23331 (DECODER_TESTS): Add prctl-name.test. 23332 23333 prctl: fix printing of PR_SET_NAME's argument. 23334 * prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED 23335 instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME 23336 operations. 23337 23338 printstr_ex: fix handling of last byte when QUOTE_0_TERMINATED bit set. 23339 * util.c (printstr_ex): Simplify handling of size == 0 case. 23340 Do not artificially decrement size when QUOTE_0_TERMINATED bit is set. 23341 Ensure that str[size] byte is non-zero if it hasn't been fetched. 23342 23343 2016-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 23344 23345 printstr_ex: handle QUOTE_0_TERMINATED bit consistently. 23346 When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints 23347 the fetched string as a NUL-terminated. 23348 After this change, the string is being fetched as a NUL-terminated, too. 23349 23350 * util.c (printstr_ex): Use umovestr instead of umoven 23351 if QUOTE_0_TERMINATED bit is set. 23352 23353 2016-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 23354 23355 Cleanup fetch part of printstr_ex. 23356 * util.c (printstr_ex): Initialize "style" early, unify error handling. 23357 23358 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 23359 23360 Update prctl ARCH_* constants. 23361 * xlat/archvals.in: Add ARCH_MAP_VDSO_X32, ARCH_MAP_VDSO_32, and 23362 ARCH_MAP_VDSO_64 introduced by linux kernel commit v4.9-rc1~155^2~6. 23363 23364 Update V4L2_* constants. 23365 * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced 23366 by linux kernel commit v4.9-rc4~7^2~422. 23367 * xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced 23368 by linux kernel commit v4.9-rc4~7^2~422. 23369 23370 Update fs *_MAGIC constants. 23371 * xlat/fsmagic.in: Add DAXFS_MAGIC introduced by linux kernel commit 23372 v4.9-rc1~45^2^2~5. 23373 23374 Update MS_* constants. 23375 * xlat/mount_flags.in: Add MS_NOREMOTELOCK introduced 23376 by linux kernel commit v4.9-rc1~57^2~1^2~7. 23377 23378 Update FALLOC_* constants. 23379 * xlat/falloc_flags.in: Add FALLOC_FL_UNSHARE_RANGE introduced 23380 by linux kernel commit v4.9-rc1~31^2~69. 23381 23382 Update BTRFS_* constants. 23383 * xlat/btrfs_features_compat_ro.in: Add 23384 BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID introduced 23385 by linux kernel commit v4.9-rc1~7^2^2~4. 23386 23387 Update BPF_* constants. 23388 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_PERF_EVENT introduced 23389 by linux kernel commit v4.9-rc1~127^2~302^2~4. 23390 23391 2016-11-18 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23392 23393 make-dist: use HEAD for making distribution package. 23394 * make-dist: Use HEAD commit instead of master branch by default. 23395 23396 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 23397 23398 tests: fix btrfs build error on some old systems. 23399 Fix the following build error on SLE 11 SP4: 23400 23401 btrfs.c: In function 'btrfs_test_dev_replace_ioctl': 23402 btrfs.c:1570: error: unknown field 'start' specified in initializer 23403 23404 * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization 23405 of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the 23406 designated initializer. 23407 23408 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 23409 23410 tests: check decoding of ERESTARTSYS error code. 23411 * tests/erestartsys.c: New file. 23412 * tests/erestartsys.test: New test. 23413 * tests/.gitignore: Add erestartsys. 23414 * tests/Makefile.am (check_PROGRAMS): Likewise. 23415 (DECODER_TESTS): Add erestartsys.test. 23416 23417 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 23418 23419 Fix signame usage in qual_signal. 23420 Do not assume that the string returned by signame starts with "SIG" 23421 prefix, this is not always the case. 23422 23423 * syscall.c (qual_signal): Skip signame return value 23424 when it does not have "SIG" prefix. 23425 23426 2016-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 23427 23428 tests: check -e signal=set syntax. 23429 * tests/qual_signal.c: New file. 23430 * tests/qual_signal.test: New test. 23431 * tests/.gitignore: Add qual_signal. 23432 * tests/Makefile.am (check_PROGRAMS): Likewise. 23433 (MISC_TESTS): Add qual_signal.test. 23434 23435 2016-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 23436 23437 Make -e fault= expressions cumulative. 23438 Change the way how subsequent -e fault= expressions are interpreted 23439 to implement a cumulative behavior. For example, 23440 -e fault=file:when=3+ -e fault=chdir 23441 now specifies that all chdir syscalls and 3+ file related syscalls 23442 except chdir are subject for fault injection. 23443 23444 * syscall.c (qualify): Do not reset qual_vec for QUAL_FAULT. 23445 * tests/fault_injection.test: Check it. 23446 23447 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23448 23449 tests: check syscall fault injection. 23450 * tests/fault_injection.c: New file. 23451 * tests/fault_injection.test: New test. 23452 * tests/fault_syntax.test: Likewise. 23453 * tests/.gitignore: Add fault_injection. 23454 * tests/Makefile.am (check_PROGRAMS): Likewise. 23455 (MISC_TESTS): Add fault_injection.test and fault_syntax.test. 23456 23457 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23458 23459 Implement syscall fault injection. 23460 Introduce new -e fault=EXPR syntax that can be used to specify a subset 23461 of syscalls that are subject of syscall fault injection, an error code 23462 that has to be injected, and a frequency of injection. 23463 23464 The expression specifying syscall fault injection has the following 23465 format: SET[:error=ERRNO][:when=FIRST[+[STEP]]] 23466 where only SET is a required part and all the rest is optional. 23467 23468 The method used to implement syscall fault injection is the following: 23469 on entering syscall the syscall number is substituted by an invalid 23470 syscall number -1, and on exiting syscall the error code returned by 23471 the kernel is substituted with the error code specified in the fault 23472 expression. 23473 23474 This implementaion is based on the prototype developed 23475 by Nahim El Atmani as a part of his GSoC 2016 strace project. 23476 23477 * defs.h (struct fault_opts): New forward declaration. 23478 (struct tcb): Add fault_vec field. 23479 (TCB_FAULT_INJ, QUAL_FAULT): New macros. 23480 * strace.1: Document -e fault expression syntax. 23481 * strace.c (usage): Mention -e fault expression. 23482 (droptcb): Deallocate fault_vec member. 23483 * syscall.c (qual_fault, arch_set_scno, arch_set_error): New prototypes. 23484 (qual_options): Add "fault" option. 23485 (struct fault_opts): New structure. 23486 (num_faults): New variable. 23487 (fault_vec): New array. 23488 (syscall_fault_injected, tcb_fault_opts, reallocate_fault, 23489 find_errno_by_name, qual_syscall_ex, strip_prefix, parse_fault_token, 23490 parse_fault_expression, qual_fault, inject_syscall_fault_entering, 23491 update_syscall_fault_exiting): New functions. 23492 (qual_syscall): Use qual_syscall_ex. 23493 (qualify_one): Add argument: a pointer to struct fault_opts, all callers 23494 changed. Copy struct fault_opts from the pointer to fault_vec. 23495 Use reallocate_fault. 23496 (qualify_scno, qualify_syscall_class, qualify_syscall_name): Add 23497 argument: a pointer to struct fault_opts. 23498 (qualify): Use reallocate_fault. Do not check "all" class for 23499 QUAL_FAULT qualifier. 23500 (lookup_class): Check for "all" class. 23501 (trace_syscall_entering): Use inject_syscall_fault_entering. 23502 (trace_syscall_exiting): Use update_syscall_fault_exiting. Clear 23503 TCB_FAULT_INJ flag along with TCB_INSYSCALL. Print " (INJECTED)" suffix 23504 when the syscall has been injected successfully. 23505 [ARCH_REGS_FOR_GETREGSET && !HAVE_GETREGS_OLD] 23506 (ptrace_setregset): New function. 23507 (ptrace_setregset_or_setregs): Define to ptrace_setregset. 23508 [ARCH_REGS_FOR_GETREGS && !HAVE_GETREGS_OLD] 23509 (ptrace_setregs): New function. 23510 (ptrace_setregset_or_setregs): Define to ptrace_setregs. 23511 [ptrace_setregset_or_setregs] (set_regs): New function. 23512 Include "set_scno.c" and "set_error.c" 23513 * NEWS: Mention this enhancement. 23514 23515 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23516 23517 Implement arch specific methods of changing syscall number and error code 23518 This introduces arch_set_error and arch_set_scno functions for each 23519 supported architecture, needed to implement syscall fault injection. 23520 23521 * linux/aarch64/set_error.c: New file. 23522 * linux/aarch64/set_scno.c: Likewise. 23523 * linux/alpha/set_error.c: Likewise. 23524 * linux/alpha/set_scno.c: Likewise. 23525 * linux/arc/set_error.c: Likewise. 23526 * linux/arc/set_scno.c: Likewise. 23527 * linux/arm/set_error.c: Likewise. 23528 * linux/arm/set_scno.c: Likewise. 23529 * linux/avr32/set_error.c: Likewise. 23530 * linux/avr32/set_scno.c: Likewise. 23531 * linux/bfin/set_error.c: Likewise. 23532 * linux/bfin/set_scno.c: Likewise. 23533 * linux/crisv10/set_error.c: Likewise. 23534 * linux/crisv10/set_scno.c: Likewise. 23535 * linux/crisv32/set_error.c: Likewise. 23536 * linux/crisv32/set_scno.c: Likewise. 23537 * linux/hppa/set_error.c: Likewise. 23538 * linux/hppa/set_scno.c: Likewise. 23539 * linux/i386/set_error.c: Likewise. 23540 * linux/i386/set_scno.c: Likewise. 23541 * linux/ia64/set_error.c: Likewise. 23542 * linux/ia64/set_scno.c: Likewise. 23543 * linux/m68k/set_error.c: Likewise. 23544 * linux/m68k/set_scno.c: Likewise. 23545 * linux/metag/set_error.c: Likewise. 23546 * linux/metag/set_scno.c: Likewise. 23547 * linux/microblaze/set_error.c: Likewise. 23548 * linux/microblaze/set_scno.c: Likewise. 23549 * linux/mips/set_error.c: Likewise. 23550 * linux/mips/set_scno.c: Likewise. 23551 * linux/nios2/set_error.c: Likewise. 23552 * linux/nios2/set_scno.c: Likewise. 23553 * linux/or1k/set_error.c: Likewise. 23554 * linux/or1k/set_scno.c: Likewise. 23555 * linux/powerpc/set_error.c: Likewise. 23556 * linux/powerpc/set_scno.c: Likewise. 23557 * linux/powerpc64/set_error.c: Likewise. 23558 * linux/powerpc64/set_scno.c: Likewise. 23559 * linux/riscv/set_error.c: Likewise. 23560 * linux/riscv/set_scno.c: Likewise. 23561 * linux/s390/set_error.c: Likewise. 23562 * linux/s390/set_scno.c: Likewise. 23563 * linux/s390x/set_error.c: Likewise. 23564 * linux/s390x/set_scno.c: Likewise. 23565 * linux/sh/set_error.c: Likewise. 23566 * linux/sh/set_scno.c: Likewise. 23567 * linux/sh64/set_error.c: Likewise. 23568 * linux/sh64/set_scno.c: Likewise. 23569 * linux/sparc/set_error.c: Likewise. 23570 * linux/sparc/set_scno.c: Likewise. 23571 * linux/sparc64/set_error.c: Likewise. 23572 * linux/sparc64/set_scno.c: Likewise. 23573 * linux/tile/set_error.c: Likewise. 23574 * linux/tile/set_scno.c: Likewise. 23575 * linux/x32/set_error.c: Likewise. 23576 * linux/x32/set_scno.c: Likewise. 23577 * linux/x86_64/set_error.c: Likewise. 23578 * linux/x86_64/set_scno.c: Likewise. 23579 * linux/xtensa/set_error.c: Likewise. 23580 * linux/xtensa/set_scno.c: Likewise. 23581 * Makefile.am (EXTRA_DIST): Add them. 23582 23583 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23584 23585 cris: add syscall tables. 23586 The incomplete CRIS support introduced by commit v4.5.18-77-gea0e6e8 23587 should not have been merged because it lacks essential parts, e.g. 23588 syscall tables. 23589 23590 This change adds missing syscall tables for crisv10 and crisv32. 23591 23592 * linux/crisv10/syscallent.h: New file. 23593 * linux/crisv32/syscallent.h: Likewise. 23594 * Makefile.am (EXTRA_DIST): Add them. 23595 23596 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23597 23598 Introduce string_to_uint_ex and string_to_uint_upto functions. 23599 * defs.h (string_to_uint_ex): New prototype. 23600 (string_to_uint_upto): New function, a thin wrapper around 23601 string_to_uint_ex. 23602 * util.c (string_to_uint_ex): New function. 23603 (string_to_uint): Change into a thin wrapper around string_to_uint_upto. 23604 * strace.c (init): Use string_to_uint_upto. 23605 * syscall.c (qualify_scno, qual_signal, qual_desc): Use 23606 string_to_uint_upto instead of string_to_uint. 23607 23608 2016-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 23609 23610 Split qual_syscall into separate functions. 23611 Split qual_syscall into qualify_scno, qualify_syscall_class, 23612 and qualify_syscall_name. 23613 This might be needed later to implement syscall fault injection. 23614 23615 * syscall.c (qualify_scno, qualify_syscall_class, qualify_syscall_name): 23616 New functions. 23617 (qual_syscall): Use them. 23618 23619 2016-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 23620 23621 xtensa: wire up new syscalls. 23622 * linux/xtensa/syscallent.h [342..347]: New entries. 23623 23624 2016-11-14 Dmitry V. Levin <ldv (a] altlinux.org> 23625 23626 arc: wire up new syscalls. 23627 * linux/arc/syscallent.h [247, 248]: New entries. 23628 23629 2016-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 23630 23631 tests: fix potential compilation warning in ioctl_block.c. 23632 ioctl_block.c:48: warning: 'init_magic' defined but not used 23633 23634 * tests/ioctl_block.c (init_magic): Define only for 23635 [BLKTRACESETUP && HAVE_STRUCT_BLK_USER_TRACE_SETUP]. 23636 23637 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23638 23639 Add support for pkey_mprotect, pkey_alloc, pkey_free syscalls. 23640 * linux/32/syscallent.h: Add syscall entries for pkey_* calls. 23641 * linux/64/syscallent.h: Likewise. 23642 * linux/arm/syscallent.h: Likewise. 23643 * linux/i386/syscallent.h: Likewise. 23644 * linux/mips/syscallent-n32.h: Likewise. 23645 * linux/mips/syscallent-n64.h: Likewise. 23646 * linux/mips/syscallent-o32.h: Likewise. 23647 * linux/x32/syscallent.h: Likewise. 23648 * linux/x86_64/syscallent.h: Likewise. 23649 * mem.c (do_mprotect): New function, common handler for mprotect and 23650 pkey_mprotect. 23651 (SYS_FUNC(mprotect)): Convert to wrapper around do_mprotect. 23652 (SYS_FUNC(pkey_mprotect)): New function. 23653 * xlat/pkey_access.in: New file. 23654 * pkeys.c: New file containing implementation of pkey_alloc and 23655 pkey_free. 23656 * Makefile.am: Add it. 23657 * NEWS: Mention this enhancement. 23658 * tests/.gitignore: Add pkey_alloc, pkey_free, and pkey_mprotect. 23659 * tests/Makefile.am (check_PROGRAMS): Likewise. 23660 (DECODER_TESTS): Add pkey_alloc.test, pkey_free.test, and 23661 pkey_mprotect.test. 23662 * tests/pkey_alloc.c: New file. 23663 * tests/pkey_free.c: Likewise. 23664 * tests/pkey_mprotect.c: Likewise. 23665 * tests/pkey_alloc.test: New test. 23666 * tests/pkey_free.test: Likewise. 23667 * tests/pkey_mprotect.test: Likewise. 23668 23669 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23670 23671 tests: fix "constant is too large" compilation warnings. 23672 alarm.c: In function 'main': 23673 alarm.c:41: warning: integer constant is too large for 'long' type 23674 aio.c: In function 'main': 23675 aio.c:162: warning: integer constant is too large for 'long' type 23676 btrfs.c: In function 'btrfs_test_sync_ioctls': 23677 btrfs.c:202: warning: integer constant is too large for 'long' type 23678 btrfs.c: In function 'btrfs_test_subvol_ioctls': 23679 btrfs.c:289: warning: integer constant is too large for 'long' type 23680 btrfs.c:290: warning: integer constant is too large for 'long' type 23681 dup2.c: In function 'main': 23682 dup2.c:12: warning: integer constant is too large for 'long' type 23683 dup2.c:13: warning: integer constant is too large for 'long' type 23684 dup3.c: In function 'main': 23685 dup3.c:13: warning: integer constant is too large for 'long' type 23686 dup3.c:14: warning: integer constant is too large for 'long' type 23687 epoll_create.c: In function 'main': 23688 epoll_create.c:12: warning: integer constant is too large for 'long' type 23689 epoll_ctl.c: In function 'invoke_syscall': 23690 epoll_ctl.c:14: warning: integer constant is too large for 'long' type 23691 faccessat.c: In function 'main': 23692 faccessat.c:13: warning: integer constant is too large for 'long' type 23693 fchdir.c: In function 'main': 23694 fchdir.c:12: warning: integer constant is too large for 'long' type 23695 struct_flock.c: In function 'invoke_test_syscall': 23696 struct_flock.c:48: warning: integer constant is too large for 'long' type 23697 struct_flock.c: In function 'test_flock_einval': 23698 struct_flock.c:58: warning: integer constant is too large for 'long' type 23699 struct_flock.c:59: warning: integer constant is too large for 'long' type 23700 fcntl64.c: In function 'test_flock64_einval': 23701 fcntl64.c:44: warning: integer constant is too large for 'long' type 23702 fcntl64.c:45: warning: integer constant is too large for 'long' type 23703 fcntl.c: In function 'test_flock64_einval': 23704 fcntl.c:44: warning: integer constant is too large for 'long' type 23705 fcntl.c:45: warning: integer constant is too large for 'long' type 23706 fdatasync.c: In function 'main': 23707 fdatasync.c:12: warning: integer constant is too large for 'long' type 23708 flock.c: In function 'main': 23709 flock.c:13: warning: integer constant is too large for 'long' type 23710 xstatx.c: In function 'main': 23711 xstatx.c:255: warning: integer constant is too large for 'long' type 23712 xstatx.c:290: warning: integer constant is too large for 'long' type 23713 xstatx.c:290: warning: integer constant is too large for 'long' type 23714 xstatx.c:290: warning: integer constant is too large for 'long' type 23715 xstatx.c:290: warning: integer constant is too large for 'long' type 23716 xstatx.c:290: warning: integer constant is too large for 'long' type 23717 xstatx.c:290: warning: integer constant is too large for 'long' type 23718 xstatx.c:290: warning: integer constant is too large for 'long' type 23719 xstatx.c:290: warning: integer constant is too large for 'long' type 23720 xstatx.c:290: warning: integer constant is too large for 'long' type 23721 xstatx.c:294: warning: integer constant is too large for 'long' type 23722 xstatx.c:294: warning: integer constant is too large for 'long' type 23723 xstatx.c:294: warning: integer constant is too large for 'long' type 23724 xstatx.c:294: warning: integer constant is too large for 'long' type 23725 xstatx.c:294: warning: integer constant is too large for 'long' type 23726 xstatx.c:294: warning: integer constant is too large for 'long' type 23727 xstatx.c:294: warning: integer constant is too large for 'long' type 23728 xstatx.c:294: warning: integer constant is too large for 'long' type 23729 xstatx.c:294: warning: integer constant is too large for 'long' type 23730 xstatfsx.c: In function 'main': 23731 xstatfsx.c:113: warning: integer constant is too large for 'long' type 23732 fsync.c: In function 'main': 23733 fsync.c:12: warning: integer constant is too large for 'long' type 23734 ftruncate64.c: In function 'main': 23735 ftruncate64.c:39: warning: integer constant is too large for 'long' type 23736 futimesat.c: In function 'main': 23737 futimesat.c:52: warning: integer constant is too large for 'long' type 23738 futimesat.c:59: warning: integer constant is too large for 'long' type 23739 get_mempolicy.c: In function 'main': 23740 get_mempolicy.c:83: warning: integer constant is too large for 'long' type 23741 get_mempolicy.c:84: warning: integer constant is too large for 'long' type 23742 get_mempolicy.c:85: warning: integer constant is too large for 'long' type 23743 get_mempolicy.c:86: warning: integer constant is too large for 'long' type 23744 getdents.c: In function 'main': 23745 getdents.c:109: warning: integer constant is too large for 'long' type 23746 getdents.c:110: warning: integer constant is too large for 'long' type 23747 getdents.c:114: warning: integer constant is too large for 'long' type 23748 getdents64.c: In function 'main': 23749 getdents64.c:114: warning: integer constant is too large for 'long' type 23750 getdents64.c:115: warning: integer constant is too large for 'long' type 23751 getdents64.c:119: warning: integer constant is too large for 'long' type 23752 xgetrlimit.c: In function 'main': 23753 xgetrlimit.c:71: warning: integer constant is too large for 'long' type 23754 ioctl_block.c:44: warning: integer constant is too large for 'long' type 23755 ioctl_block.c: In function 'main': 23756 ioctl_block.c:136: warning: integer constant is too large for 'long' type 23757 ioctl_block.c:137: warning: integer constant is too large for 'long' type 23758 ioctl_block.c:161: warning: integer constant is too large for 'long' type 23759 ioctl_block.c:170: warning: integer constant is too large for 'long' type 23760 ioctl_block.c:171: warning: integer constant is too large for 'long' type 23761 ioctl_evdev.c:42: warning: integer constant is too large for 'long' type 23762 ioctl_mtd.c:46: warning: integer constant is too large for 'long' type 23763 ioctl_rtc.c:40: warning: integer constant is too large for 'long' type 23764 ioperm.c: In function 'main': 23765 ioperm.c:12: warning: integer constant is too large for 'long' type 23766 ioctl_v4l2.c: In function 'main': 23767 ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type 23768 ipc.c: In function 'ipc_call': 23769 ipc.c:52: warning: integer constant is too large for 'long' type 23770 kill.c: In function 'main': 23771 kill.c:59: warning: integer constant is too large for 'long' type 23772 kill.c:62: warning: integer constant is too large for 'long' type 23773 kill.c:63: warning: integer constant is too large for 'long' type 23774 kill.c:68: warning: integer constant is too large for 'long' type 23775 linkat.c: In function 'main': 23776 linkat.c:14: warning: integer constant is too large for 'long' type 23777 linkat.c:15: warning: integer constant is too large for 'long' type 23778 mbind.c: In function 'main': 23779 mbind.c:41: warning: integer constant is too large for 'long' type 23780 mbind.c:43: warning: integer constant is too large for 'long' type 23781 mbind.c:44: warning: integer constant is too large for 'long' type 23782 migrate_pages.c: In function 'main': 23783 migrate_pages.c:41: warning: integer constant is too large for 'long' type 23784 In file included from mkdirat.c:10: 23785 umode_t.c: In function 'test_syscall': 23786 umode_t.c:47: warning: integer constant is too large for 'long' type 23787 mknod.c: In function 'call_mknod': 23788 mknod.c:16: warning: integer constant is too large for 'long' type 23789 mknod.c: In function 'main': 23790 mknod.c:23: warning: integer constant is too large for 'long' type 23791 mknod.c:49: warning: integer constant is too large for 'long' type 23792 mknod.c:56: warning: integer constant is too large for 'long' type 23793 mknodat.c:12: warning: integer constant is too large for 'long' type 23794 mknodat.c: In function 'call_mknodat': 23795 mknodat.c:17: warning: integer constant is too large for 'long' type 23796 mknodat.c: In function 'main': 23797 mknodat.c:24: warning: integer constant is too large for 'long' type 23798 mknodat.c:50: warning: integer constant is too large for 'long' type 23799 mknodat.c:57: warning: integer constant is too large for 'long' type 23800 mmap.c: In function 'main': 23801 mmap.c:51: warning: integer constant is too large for 'long' type 23802 move_pages.c: In function 'print_stat_pages': 23803 move_pages.c:139: warning: integer constant is too large for 'long' type 23804 move_pages.c: In function 'print_move_pages': 23805 move_pages.c:166: warning: integer constant is too large for 'long' type 23806 move_pages.c: In function 'main': 23807 move_pages.c:188: warning: integer constant is too large for 'long' type 23808 mq_sendrecv.c: In function 'main': 23809 mq_sendrecv.c:238: warning: integer constant is too large for 'long' type 23810 mq_sendrecv.c:401: warning: integer constant is too large for 'long' type 23811 mq_sendrecv.c:403: warning: integer constant is too large for 'long' type 23812 nsyscalls.c: In function 'test_syscall': 23813 nsyscalls.c:64: warning: integer constant is too large for 'long' type 23814 nsyscalls.c:65: warning: integer constant is too large for 'long' type 23815 nsyscalls.c:66: warning: integer constant is too large for 'long' type 23816 nsyscalls.c:67: warning: integer constant is too large for 'long' type 23817 nsyscalls.c:68: warning: integer constant is too large for 'long' type 23818 nsyscalls.c:69: warning: integer constant is too large for 'long' type 23819 preadv-pwritev.c: In function 'main': 23820 preadv-pwritev.c:162: warning: comparison between signed and unsigned 23821 prlimit64.c: In function 'main': 23822 prlimit64.c:65: warning: integer constant is too large for 'long' type 23823 prlimit64.c:70: warning: integer constant is too large for 'long' type 23824 remap_file_pages.c: In function 'main': 23825 remap_file_pages.c:42: warning: integer constant is too large for 'long' type 23826 remap_file_pages.c:43: warning: integer constant is too large for 'long' type 23827 remap_file_pages.c:45: warning: integer constant is too large for 'long' type 23828 renameat.c: In function 'main': 23829 renameat.c:15: warning: integer constant is too large for 'long' type 23830 renameat.c:16: warning: integer constant is too large for 'long' type 23831 rt_sigqueueinfo.c: In function 'main': 23832 rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type 23833 rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo': 23834 rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type 23835 rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type 23836 rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type 23837 rt_tgsigqueueinfo.c: In function 'main': 23838 rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type 23839 sendfile.c: In function 'main': 23840 sendfile.c:110: warning: integer constant is too large for 'long' type 23841 sendfile64.c: In function 'main': 23842 sendfile64.c:100: warning: integer constant is too large for 'long' type 23843 set_mempolicy.c: In function 'main': 23844 set_mempolicy.c:129: warning: integer constant is too large for 'long' type 23845 set_mempolicy.c:130: warning: integer constant is too large for 'long' type 23846 setrlimit.c: In function 'main': 23847 setrlimit.c:44: warning: integer constant is too large for 'long' type 23848 socketcall.c: In function 'test_socketcall': 23849 socketcall.c:58: warning: integer constant is too large for 'long' type 23850 splice.c: In function 'main': 23851 splice.c:41: warning: integer constant is too large for 'long' type 23852 splice.c:42: warning: integer constant is too large for 'long' type 23853 splice.c:45: warning: integer constant is too large for 'long' type 23854 splice.c:46: warning: integer constant is too large for 'long' type 23855 symlinkat.c: In function 'main': 23856 symlinkat.c:12: warning: integer constant is too large for 'long' type 23857 sync_file_range.c: In function 'main': 23858 sync_file_range.c:42: warning: integer constant is too large for 'long' type 23859 sync_file_range.c:43: warning: integer constant is too large for 'long' type 23860 syslog.c: In function 'main': 23861 syslog.c:14: warning: integer constant is too large for 'long' type 23862 tee.c: In function 'main': 23863 tee.c:41: warning: integer constant is too large for 'long' type 23864 tee.c:42: warning: integer constant is too large for 'long' type 23865 timer_create.c: In function 'main': 23866 timer_create.c:52: warning: integer constant is too large for 'long' type 23867 timer_create.c:84: warning: integer constant is too large for 'long' type 23868 timer_create.c:85: warning: integer constant is too large for 'long' type 23869 truncate64.c: In function 'main': 23870 truncate64.c:41: warning: integer constant is too large for 'long' type 23871 xgetrlimit.c: In function 'main': 23872 xgetrlimit.c:71: warning: integer constant is too large for 'long' type 23873 umode_t.c: In function 'test_syscall': 23874 umode_t.c:46: warning: integer constant is too large for 'long' type 23875 unlinkat.c: In function 'main': 23876 unlinkat.c:13: warning: integer constant is too large for 'long' type 23877 waitpid.c: In function 'main': 23878 waitpid.c:43: warning: integer constant is too large for 'long' type 23879 waitid.c: In function 'poison': 23880 waitid.c:141: warning: integer constant is too large for 'long' type 23881 xetpriority.c: In function 'main': 23882 xetpriority.c:15: warning: integer constant is too large for 'long' type 23883 xetpriority.c:19: warning: integer constant is too large for 'long' type 23884 xetpriority.c:20: warning: integer constant is too large for 'long' type 23885 xetpgid.c: In function 'main': 23886 xetpgid.c:43: warning: integer constant is too large for 'long' type 23887 xetpgid.c:47: warning: integer constant is too large for 'long' type 23888 xetpgid.c:48: warning: integer constant is too large for 'long' type 23889 23890 (SLES 11SP4, i386) 23891 23892 * tests/alarm.c (main): Add proper suffix to integer constant. 23893 * tests/aio.c (main): Likewise. 23894 * tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise. 23895 * tests/dup2.c (main): Likewise. 23896 * tests/dup3.c (main): Likewise. 23897 * tests/epoll_create.c (main): Likewise. 23898 * tests/epoll_ctl.c (invoke_syscall): Likewise. 23899 * tests/faccessat.c (main): Likewise. 23900 * tests/fchdir.c (main): Likewise. 23901 * tests/fcntl.c (test_flock64_einval): Likewise. 23902 * tests/fcntl64.c (test_flock64_einval): Likewise. 23903 * tests/fdatasync.c (main): Likewise. 23904 * tests/flock.c (main): Likewise. 23905 * tests/fstat64.c (SAMPLE_SIZE): Likewise. 23906 * tests/fstat.c (SAMPLE_SIZE): Likewise. 23907 * tests/fsync.c (main): Likewise. 23908 * tests/ftruncate64.c (main): Likewise. 23909 * tests/futimesat.c (main): Likewise. 23910 * tests/get_mempolicy.c (main): Likewise. 23911 * tests/getdents.c (main): Likewise. 23912 * tests/getdents64.c (main): Likewise. 23913 * tests/ioctl_block.c (lmagic, main): Likewise. 23914 * tests/ioctl_evdev.c (lmagic): Likewise. 23915 * tests/ioctl_mtd.c (lmagic): Likewise. 23916 * tests/ioctl_rtc.c (lmagic): Likewise. 23917 * tests/ioctl_v4l2.c (main): Likewise. 23918 * tests/ioperm.c (main): Likewise. 23919 * tests/ipc.c (ipc_call): Likewise. 23920 * tests/kill.c (main): Likewise. 23921 * tests/linkat.c (main): Likewise. 23922 * tests/lstat64.c (SAMPLE_SIZE): Likewise. 23923 * tests/lstat.c (SAMPLE_SIZE): Likewise. 23924 * tests/mbind.c (main): Likewise. 23925 * tests/migrate_pages.c (main): Likewise. 23926 * tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise. 23927 * tests/mknod.c (call_mknod, main): Likewise. 23928 * tests/mknodat.c (fd, call_mknodat, main): Likewise. 23929 * tests/mmap.c (main): Likewise. 23930 * tests/move_pages.c (print_stat_pages, print_move_pages): Likewise. 23931 * tests/mq_sendrecv.c (main): Likewise. 23932 * tests/nsyscalls.c (test_syscall): Likewise. 23933 * tests/prlimit64.c (main): Likewise. 23934 * tests/remap_file_pages.c (main): Likewise. 23935 * tests/renameat.c (main): Likewise. 23936 * tests/rt_sigqueueinfo.c (main): Likewise. 23937 * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise. 23938 * tests/sendfile.c (main): Likewise. 23939 * tests/sendfile64.c (main): Likewise. 23940 * tests/set_mempolicy.c (main): Likewise. 23941 * tests/setrlimit.c (main): Likewise. 23942 * tests/socketcall.c (test_socketcall): Likewise. 23943 * tests/splice.c (main): Likewise. 23944 * tests/stat64.c (SAMPLE_SIZE): Likewise. 23945 * tests/stat.c (SAMPLE_SIZE): Likewise. 23946 * tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise. 23947 * tests/symlinkat.c (main): Likewise. 23948 * tests/sync_file_range.c (main): Likewise. 23949 * tests/syslog.c (main): Likewise. 23950 * tests/tee.c (main): Likewise. 23951 * tests/timer_create.c (main): Likewise. 23952 * tests/truncate64.c (main): Likewise. 23953 * tests/umode_t.c (test_syscall): Likewise. 23954 * tests/unlinkat.c (main): Likewise. 23955 * tests/waitid.c (main): Likewise. 23956 * tests/waitpid.c (main): Likewise. 23957 * tests/xetpgid.c (main): Likewise. 23958 * tests/xetpriority.c (main): Likewise. 23959 * tests/xgetrlimit.c (main): Likewise. 23960 * tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise. 23961 * tests/xstatx.c (main): Likewise. 23962 23963 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 23964 23965 tests: fix "comparison between signed and unsigned" compilation warnings 23966 preadv-pwritev.c: In function 'main': 23967 preadv-pwritev.c:162: warning: comparison between signed and unsigned 23968 readv.c: In function 'main': 23969 readv.c:148: warning: comparison between signed and unsigned 23970 recvmsg.c: In function 'main': 23971 recvmsg.c:148: warning: comparison between signed and unsigned 23972 23973 * tests/preadv-pwritev.c (main): Cast r_len to int. 23974 * tests/readv.c (main): Likewise. 23975 * tests/recvmsg.c (main): Likewise. 23976 23977 2016-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 23978 23979 syscall.c: refactor getregs_old fallback in get_regs. 23980 This change moves remaining arch specific getregs_old code into 23981 appropriate arch subdirectories and removes unnecessary code 23982 duplication. 23983 23984 * linux/getregs_old.h: New file. 23985 * linux/powerpc/getregs_old.h: Likewise. 23986 * linux/powerpc64/getregs_old.h: Likewise. 23987 * linux/x86_64/getregs_old.h: Likewise. 23988 * Makefile.am (EXTRA_DIST): Add them. 23989 * syscall.c: Include "getregs_old.h". 23990 [X86_64 || POWERPC]: Remove. 23991 [ARCH_REGS_FOR_GETREGSET] (ptrace_getregset_or_getregs): Define 23992 to ptrace_getregset. 23993 [ARCH_REGS_FOR_GETREGS] (ptrace_getregset_or_getregs): Define 23994 to ptrace_getregs. 23995 (get_regs): Check for ptrace_getregset_or_getregs instead 23996 of ARCH_REGS_FOR_GETREGSET and ARCH_REGS_FOR_GETREGS. Use 23997 ptrace_getregset_or_getregs instead of ptrace_getregset and 23998 ptrace_getregs. Check for HAVE_GETREGS_OLD instead of X86_64 23999 and POWERPC. Use use_getregs_old instead of getregset_support 24000 and old_kernel. 24001 24002 2016-11-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24003 24004 Rename BUILD_BUG_ON_ZERO macro. 24005 In order to avoid name clash on distributions which decide to include 24006 kernel headers instead of UAPI ones. For example, on SLES 11SP4: 24007 24008 gcc -DHAVE_CONFIG_H -I./linux/x86_64 -I./linux -I. -Wall -O2 -c net.c 24009 In file included from /usr/include/linux/sysctl.h:25:0, 24010 from /usr/include/linux/netfilter.h:6, 24011 from /usr/include/linux/netfilter_arp.h:8, 24012 from /usr/include/linux/netfilter_arp/arp_tables.h:14, 24013 from net.c:60: 24014 net.c: In function 'print_packet_mreq': 24015 gcc_compat.h:59:27: error: negative width in bit-field '<anonymous>' 24016 # define MUST_BE_ARRAY(a) BUILD_BUG_ON_ZERO(!SAME_TYPE((a), &(a)[0])) 24017 ^ 24018 defs.h:76:53: note: in expansion of macro 'MUST_BE_ARRAY' 24019 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a)) 24020 ^ 24021 net.c:747:22: note: in expansion of macro 'ARRAY_SIZE' 24022 if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address)) 24023 ^ 24024 due to the fact BUILD_BUG_ON_ZERO is already defined in <linux/kernel.h>. 24025 24026 * gcc_compat.h (BUILD_BUG_ON_ZERO): Rename to FAIL_BUILD_ON_ZERO. 24027 (MUST_BE_ARRAY): Update usage. 24028 24029 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 24030 24031 syscall.c: factor out ptrace_getregs from get_regs. 24032 Move the code that calls ptrace(PTRACE_GETREGS) to a separate function. 24033 24034 * syscall.c (ptrace_getregs): New function. 24035 (get_regs): Use it. 24036 24037 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 24038 24039 syscall.c: rename get_regset to ptrace_getregset. 24040 * syscall.c (get_regset): Rename to ptrace_getregset. 24041 (get_regs): Rename get_regset to ptrace_getregset. 24042 24043 2016-11-12 Andreas Schwab <schwab (a] linux-m68k.org> 24044 24045 m68k: switch to PTRACE_GETREGS. 24046 * Makefile.am (EXTRA_DIST): Add linux/m68k/arch_regs.h, remove 24047 linux/m68k/get_syscall_result.c. 24048 * linux/m68k/arch_regs.c (m68k_d0, ARCH_PC_PEEK_ADDR): Don't 24049 define. 24050 (m68k_regs, m68k_usp_ptr, ARCH_PC_REG, ARCH_REGS_FOR_GETREGS): 24051 Define. 24052 * linux/m68k/arch_regs.h: New file. 24053 * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use m68k_usp_ptr. 24054 * linux/m68k/get_error.c (get_error): Use m68k_regs.d0. 24055 * linux/m68k/get_scno.c (arch_get_scno): Use m68k_regs.orig_d0. 24056 * linux/m68k/get_syscall_args.c (get_syscall_args): Use m68k_regs. 24057 * linux/m68k/get_syscall_result.c: Remove. 24058 24059 tests: do not run old_mmap test on m68k. 24060 * tests/old_mmap.c: Skip test on m68k. 24061 24062 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 24063 24064 syscall.c: introduce reallocate_vec function. 24065 This might be needed later to implement syscall fault injection. 24066 24067 * syscall.c (reallocate_vec): New function. 24068 (reallocate_qual): Use it. 24069 24070 2016-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 24071 24072 Fix prototypes of qual_desc, qual_signal, and qual_syscall functions. 24073 * syscall.c (qual_desc, qual_signal, qual_syscall): Fix prototypes. 24074 (struct qual_options): Fix type of "qualify" member. 24075 24076 2016-11-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24077 24078 linux/x32/syscallent.h: fix syscallent array initialisation on x32. 24079 Why gcc didn't complain about it? It is definitely an index clash. 24080 24081 * linux/x32/syscallent.h: Change initializer indices for empty records from 24082 [327 ... 511] to [329 ... 511]. 24083 24084 2016-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 24085 24086 Introduce upoke function. 24087 This will be needed to implement fault injection on those architectures 24088 that lack PTRACE_SETREGSET/PTRACE_SETREGS support. 24089 24090 * defs.h (upoke): New prototype. 24091 * upoke.c: New file. 24092 * Makefile.am (libstrace_a_SOURCES): Add it. 24093 24094 2016-11-11 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 24095 24096 Update ioctl entries from linux 4.9. 24097 * linux/32/ioctls_inc_align32.h: Update from linux v4.9 using ioctls_gen.sh. 24098 * linux/32/ioctls_inc_align64.h: Likewise. 24099 * linux/64/ioctls_inc.h: Likewise. 24100 * linux/x32/ioctls_inc0.h: Likewise. 24101 * NEWS: Mention this. 24102 24103 2016-11-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24104 24105 Update NEWS. 24106 24107 2016-11-10 Mikulas Patocka <mpatocka (a] redhat.com> 24108 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24109 24110 Add support for decoding of DM_* ioctl commands. 24111 * dm.c: New file. 24112 * xlat/dm_flags.in: Likewise. 24113 * Makefile.am (strace_SOURCES): Add dm.c. 24114 * configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h. 24115 * defs.h (dm_ioctl): New prototype. 24116 * ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl 24117 for 0xfd ioctl type. 24118 * tests/ioctl_dm.c: New file. 24119 * tests/ioctl_dm-v.c: Likewise. 24120 * tests/ioctl_dm.test: New test. 24121 * tests/ioctl_dm-v.test: Likewise. 24122 * tests/.gitignore: Add ioctl_dm and ioctl_dm-v. 24123 * tests/Makefile.am (check_PROGRAMS): Likewise. 24124 (DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test. 24125 24126 2016-11-10 Dmitry V. Levin <ldv (a] altlinux.org> 24127 24128 Introduce ALIGNOF macro. 24129 * gcc_compat.h (ALIGNOF): New macro. 24130 24131 2016-11-10 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24132 24133 util: add support for QUOTE_0_TERMINATED in user_style to ptrintstr_ex. 24134 This enables printing size-limited (expectedly) ASCIZ strings. 24135 24136 This is done by increasing umoven size limit for sized strings by one 24137 byte above max_strlen (enabling copying possible NUL byte in case len is 24138 greater than max_strlen) and decreasing size after copying by one byte 24139 in case QUOTE_0_TERMINATED is set (due to user_style or usage of len of 24140 -1). As a result, there is one excess byte for string_quote in case 24141 QUOTE_0_TERMINATED is set so string_quote can check for NUL termination 24142 of strings up to size bytes in size (which is len or max_strlen, whatever 24143 is greater). 24144 24145 The catch here is that when string is not properly NUL-terminated and 24146 QUOTE_0_TERMINATED is provided in user_style and len is less than 24147 max_strlen then last non-NUL byte is not printed. But ellipsis is 24148 printed instead, being indication that string is not terminated 24149 properly. QUOTE_OMIT_TRAILING_0 should be used instead in case this 24150 behaviour is not intended. 24151 24152 * util.c (printstr_ex): Copy one excess byte in case of non-negative len 24153 provided and it is more than max_strlen; handle case of max_strlen of 0 24154 in case QUOTE_0_TERMINATED is set separately; check for need of printing 24155 ellipsis by checking resulting style against QUOTE_0_TERMINATED. 24156 24157 2016-11-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24158 24159 tests: check decoding of mq_{notify,open,timedreceive,timedsend,unlink} 24160 * tests/mq_sendrecv.c: New file. 24161 * tests/mq_sendrecv-read.c: Likewise. 24162 * tests/mq_sendrecv-write.c: Likewise. 24163 * tests/mq_sendrecv.test: New test. 24164 * tests/mq_sendrecv-read.test: Likewise. 24165 * tests/mq_sendrecv-write.test: Likewise. 24166 * tests/.gitignore: Add mq_sendrecv, mq_sendrecv-read, 24167 and mq_sendrecv-write. 24168 * tests/Makefile.am (check_PROGRAMS): Likewise. 24169 (mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, mq_sendrecv_write_LDADD): 24170 New variables. 24171 (DECODER_TESTS): Add mq_sendrecv.test, mq_sendrecv-read.test, 24172 and mq_sendrecv-write.test. 24173 24174 2016-11-08 Dmitry V. Levin <ldv (a] altlinux.org> 24175 24176 tests: skip times.test if CLOCK_PROCESS_CPUTIME_ID does not work. 24177 * tests/times.c (main): Skip if clock_gettime consistenly returns zero 24178 for CLOCK_PROCESS_CPUTIME_ID timer. 24179 24180 2016-10-31 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24181 24182 tests: add tests for perf_event_attr structure decoding in perf_event_open 24183 * configure.ac: Add checks for presence of various fields of struct 24184 perf_event_attr defined in kernel headers. 24185 * tests/perf_event_open.c: New file. 24186 * tests/perf_event_open_unabbrev.c: Likewise. 24187 * tests/perf_event_open.test: New test. 24188 * tests/perf_event_open_unabbrev.test: Likewise. 24189 * tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev. 24190 * tests/Makefile.am (check_PROGRAMS): Likewise. 24191 (DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test. 24192 24193 Implement decoding of perf_event_attr structure in perf_event_open syscall 24194 * linux/perf_event_struct.h: New file, definition of struct perf_event_attr 24195 from Linux 4.8 24196 * Makefile.am (strace_SOURCES): Add it. 24197 * xlat/hw_breakpoint_len.in: New file. 24198 * xlat/hw_breakpoint_type.in: Likewise. 24199 * xlat/perf_attr_size.in: Likewise. 24200 * xlat/perf_branch_sample_type.in: Likewise. 24201 * xlat/perf_event_read_format.in: Likewise. 24202 * xlat/perf_event_sample_format.in: Likewise. 24203 * xlat/perf_hw_cache_id.in: Likewise. 24204 * xlat/perf_hw_cache_op_id.in: Likewise. 24205 * xlat/perf_hw_cache_op_result_id.in: Likewise. 24206 * xlat/perf_hw_id.in: Likewise. 24207 * xlat/perf_sw_ids.in: Likewise. 24208 * xlat/perf_type_id.in: Likewise. 24209 * perf.c [HAVE_LINUX_PERF_EVENT_H]: Remove inclusion of 24210 <linux/perf_event.h>. 24211 (PRINT_XLAT): New macro for simplifying printing values from 24212 sorted xlat. 24213 (printxlat_search): New function, wrapper for xlat_search with behaviour 24214 similar to printval. 24215 (print_perf_event_attr): New print_event_attr structure fetching and 24216 printing function. 24217 (SYS_FUNC(perf_event_open)): Use print_perf_event_attr for displaying 24218 attr argument contents. 24219 * tests/perf_event_open.c: Renamed to 24220 tests/perf_event_open_nonverbose.c. 24221 * tests/perf_event_open.test: add -e verbose=none in order to preserve 24222 output format being checked (in case verbose output is enabled, 24223 contents of attr arguments are shown now); rename to 24224 tests/perf_event_open_nonverbose.test; add -e trace=perf_event_open. 24225 24226 tests: fix name spelling. 24227 24228 2016-10-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24229 24230 tests: fix name spelling. 24231 24232 Update NEWS. 24233 24234 Fix typo in comment in tests/quotactl.h. 24235 24236 tests: fix invalid pointer checks in quotactl test. 24237 * tests/quotactl.h (bogus_special, bogus_addr): Move it... 24238 * tests/quotactl.c (main): ... here; remove static and const qualifiers, 24239 use memory after tail_alloc instead of magic numbers. 24240 * tests/quotactl-xfs.c (main): Likewise. 24241 24242 tests: fix invalid pointer checks in getcpu test. 24243 * test/getcpu.c (main): Replace magic numbers deemed invalid pointers 24244 with addresses after memory returned by tail_alloc. 24245 24246 tests: fix invalid pointer checks in request_key test. 24247 * test/request_key.c (main): Replace magic numbers deemed invalid pointers 24248 with addresses after memory returned by tail_alloc. 24249 24250 tests: fix invalid pointer checks in add_key test. 24251 * test/add_key.c (main): Replace magic numbers deemed invalid pointers 24252 with addresses after memory returned by tail_alloc. 24253 24254 statfs: use printxval_search. 24255 * print_statfs.c (print_statfs_type): Use printxval_search for printing 24256 FS magic xlat value. 24257 24258 util: add printing helper for sorted xlat arrays. 24259 * util.c (printxval_searchn): New function. 24260 * defs.h (printxval_searchn): New prototype. 24261 (printxval_search): New helper macro useful in conjunction with static 24262 xlat arrays. 24263 24264 defs: add check for argument being array to ARRAY_SIZE macro. 24265 * gcc_compat.h [GNUC_PREREQ(3, 0)] (BUILD_BUG_ON_ZERO): New macro. 24266 (SAME_TYPE, MUST_BE_ARRAY): Likewise. 24267 * defs.h (ARRAY_SIZE): Add MUST_BE_ARRAY for build-time type check. 24268 24269 tests: check decoding of oldfstat, oldlstat, and oldstat syscalls. 24270 * tests/oldfstat.c: New file. 24271 * tests/oldlstat.c: Likewise. 24272 * tests/oldstat.c: Likewise. 24273 * tests/oldfstat.test: New test. 24274 * tests/oldlstat.test: Likewise. 24275 * tests/oldstat.test: Likewise. 24276 * tests/xstatx.c [!OLD_STAT]: define OLD_STAT to 0. 24277 (print_stat) [OLD_STAT]: Print predefined values for 24278 st_blksize/st_blocks. 24279 (print_stat): Check for !OLD_STAT in nanosecond precision checks. 24280 (main) [OLD_STAT]: Ignore EOVERFLOW. 24281 (main): Test for successful rc in returned size value check; 24282 print address only on non-successful rc. 24283 * tests/.gitignore: Add oldfstat, oldlstat, and oldstat. 24284 * tests/Makefile.am (check_PROGRAMS): Likewise. 24285 (DECODER_TESTS): Add oldfstat.test, oldlstat.test, and oldstat.test. 24286 24287 tests: additional tests of stat decoders. 24288 * tests/fstatx.c (IS_FSTAT): Define to 1. 24289 * tests/fstatat64.c [__GLIBC__ && __sparc64__] (TEST_BOGUS_STRUCT_STAT): 24290 Define to 0. 24291 * tests/xstatx.c [!IS_STAT] (IS_STAT): Define to 0. 24292 [!TEST_BOGUS_STRUCT_STAT] (TEST_BOGUS_STRUCT_STAT): Define to 1. 24293 (main): Add a check for non-available pointer and a check 24294 for block device file. 24295 * tests/statx.sh: Add tracing of /dev/full file, specify alignment. 24296 * tests/fstat.test: Specify alignment. 24297 24298 2016-10-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24299 24300 tests: prepare for additional tests of stat decoders. 24301 PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace 24302 pair in order to save errno. PRINT_SYSCALL_FOOTER now uses sprintrc for 24303 printing rc/errno. 24304 24305 * tests/xstatx.c: Include <errno.h>. 24306 (main): Update PRINT_SYSCALL_FOOTER call convention. 24307 * tests/fstatat.c (PRINT_SYSCALL_HEADER): Add errno saving. 24308 (PRINT_SYSCALL_FOOTER): Restore errno. 24309 * tests/fstatx.c: Likewise. 24310 * tests/lstatx.c: Likewise. 24311 24312 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 24313 24314 Provide a safe definition of O_ACCMODE. 24315 Some libcs e.g. musl are guilty of messing up with O_ACCMODE. 24316 24317 * open.c (O_ACCMODE): Redefine to 03. 24318 24319 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24320 24321 Implement dumping of mq_timedsend and mq_timedreceive syscalls. 24322 * syscall.c (dumpio): Add SEN_mq_timedreceive and SEN_mq_timedsend. 24323 24324 mq: print msg_prio as a pointer, not as an immediate value. 24325 * mq.c (SYS_FUNC(mq_timedreceive)): Use printnum_int for printing 24326 msg_prio argument. 24327 24328 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24329 24330 mq: print msg payload only in case of successful mq_timedreceive call. 24331 Also, use u_rval for determining message size. 24332 24333 * mq.c (SYS_FUNC(mq_timedreceive)): Check for syserror and non-negative 24334 u_rval before calling printstr on msg_ptr argument, or use printaddr otherwise; 24335 provide u_rval as string size. 24336 24337 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24338 24339 mq: Print msg_prio parameter as unsigned int in mq_timedsend. 24340 * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%ld" 24341 to "%u", cast argument value to unsigned int. 24342 24343 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24344 24345 mq: Properly print mq_flags field. 24346 mq_flags field of struct mq_attr can contain only O_NONBLOCK flag (other 24347 flags are treated as invalid by mq_getsetattr). Moreover, this field is 24348 ignored by mq_open at all (O_NONBLOCK is set via oflag, not via attr 24349 attribute). 24350 24351 * xlat/mq_attr_flags.in: New file. 24352 * print_mq_attr.c: Include xlat/mq_attr_flags.h. 24353 (printmqattr): New parameter, bool decode_flags; cast members of struct 24354 mq_attr to long long type; use mq_attr_flags xlat for printing mq_flags; 24355 print mq_flags as flags only in case decode_flags parameter is set 24356 to true. 24357 * mq.c (SYS_FUNC(mq_open)): Specify value of false for decode_flags 24358 parameter of printmqattr call. 24359 (SYS_FUNC(mq_getsetattr)): Specify value of true for decode_flags 24360 parameter of printmqattr call. 24361 * tests/mq.expected: Update expected output. 24362 24363 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24364 24365 mq: Print msg_len parameter as kernel_ulong_t. 24366 * mq.c (SYS_FUNC(mq_timedsend)): Change conversion specifier from "%lu" 24367 to "%llu", use getarg_ull for obtaining msg_len parameter. 24368 (SYS_FUNC(mq_timedreceive)): Likewise. 24369 24370 print_mq_attr: fix typo. 24371 * print_mq_attr.c (printmqattr): Print field name "mq_curmsgs" 24372 instead of "mq_curmsg". 24373 * tests/mq.expected: Update expected output. 24374 24375 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24376 24377 mq: print mqdes parameter as int. 24378 It is defined as int in <linux/posix_types.h>. 24379 24380 * mq.c (SYS_FUNC(mq_timedsend)): Use "%d" conversion specifier instead 24381 of "%ld" for printing mqdes (0th parameter), cast parameter value to 24382 int. 24383 (SYS_FUNC(mq_timedreceive)): Likewise. 24384 (SYS_FUNC(mq_notify)): Likewise. 24385 (SYS_FUNC(mq_getsetattr)): Likewise. 24386 24387 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24388 24389 mq: curly brackets usage fix. 24390 Use curly brackets for denoting blocks in both of if branches if they 24391 are already used in at least one branch. 24392 24393 tests: additional name_to_handle_at/open_by_handle_at checks. 24394 * tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at 24395 checks. 24396 24397 tests: require only presence of __NR_* macros for file_handle test. 24398 * tests/file_handle.c: replace fcntl.h include with asm/unistd.h. 24399 [MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at 24400 && defined __NR_open_by_handle_at, add fcntl.h include 24401 [!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct 24402 file_handle. 24403 (main): Change name_to_handle_at and open_by_handle_at calls to syscall. 24404 24405 tests: proper type conversion in keyctl test. 24406 * tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t 24407 since kernel_ulong_t may be of different size. 24408 24409 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24410 24411 file_handle: use separate xlat for name_ta_handle_at flags. 24412 Since the only two flags supported are AT_SYMLINK_FOLLOW and 24413 AT_EMPTY_PATH. 24414 24415 * xlat/name_to_handle_at_flags.in: New file. 24416 * file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags 24417 for printing flags parameter. 24418 24419 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24420 24421 tests: check decoding of kexec_file_load and kexec_load syscalls. 24422 * tests/kexec_file_load.c: New file. 24423 * tests/kexec_load.c: Likewise. 24424 * tests/kexec_file_load.test: New test. 24425 * tests/kexec_load.test: Likewise. 24426 * tests/.gitignore: Add kexec_file_load and kexec_load. 24427 * tests/Makefile.am (check_PROGRAMS): Likewise. 24428 (DECODER_TESTS): Add kexec_file_load.test and kexec_load.test. 24429 24430 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24431 24432 kexec: use widen_to_ulong since kexec_load has compat on x32/n32. 24433 Curiously, kexec_load uses compat on x32/n32, so its parameters should 24434 be 4 bytes in size on these ABIs. 24435 24436 * kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting 24437 parameters to proper size on x32/n32. 24438 24439 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24440 24441 kexec: fix zeroing of higher bits of flags parameter in kexec_load. 24442 * kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before 24443 negation in order to properly negate higher bits of KEXEC_ARCH_MASK. 24444 24445 kexec: add printing of struct kexec_segment field names. 24446 * kexec.c (print_seg): Print field names of the kexec_segment structure. 24447 24448 tests: check decoding of unshare syscall. 24449 * tests/unshare.c: New file. 24450 * tests/unshare.test: New test. 24451 * tests/.gitignore: Add unshare. 24452 * tests/Makefile.am (check_PROGRAMS): Likewise. 24453 (DECODER_TESTS): Add unshare.test. 24454 24455 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24456 24457 clone: use kernel_ulong_t as type of flags parameter of unshare call. 24458 Kernel declares flags parameter as long and looks like x32 and n32 24459 implement no compat for this call. 24460 24461 * clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for 24462 obtaining and parsing flags parameter. 24463 24464 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24465 24466 clone: use separate flag list for unshare. 24467 Not all clone flags could be passed to unshare (see check_unshare_flags 24468 function in kernel/fork.c). 24469 24470 * xlat/unshare_flags.in: New file. 24471 * clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags 24472 parameter. 24473 24474 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24475 24476 tests: check decoding of setns syscall. 24477 * tests/setns.c: New file. 24478 * tests/setns.test: New test. 24479 * tests/.gitignore: Add setns. 24480 * tests/Makefile.am (check_PROGRAMS): Likewise. 24481 (DECODER_TESTS): Add setns.test. 24482 24483 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24484 24485 clone: use separate xlat for nstype parameter of setns syscall. 24486 nstype is not flag set but specific type value against which it is 24487 compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)). 24488 24489 * xlat/setns_types.in: New file. 24490 * clone.c: Use printxval and setns_types for nstype parameter. 24491 24492 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24493 24494 tests: check non-verbose capget/capset output. 24495 * tests/caps-abbrev.awk: New file. 24496 * tests/caps-abbrev.c: Likewise. 24497 * tests/caps-abbrev.test: New test. 24498 * tests/.gitignore: Add caps-abbrev. 24499 * tests/Makefile.am (check_PROGRAMS): Likewise. 24500 (DECODER_TESTS): Add caps-abbrev.test. 24501 (EXTRA_DIST): Add caps-abbrev.awk. 24502 24503 tests: additional capset decoder checks. 24504 * tests/caps.awk: Add patterns for additional checks. 24505 * tests/caps.c: Implement additional checks. 24506 24507 tests: check decoding of fanotify_init syscall. 24508 * tests/fanotify_init.c: New file. 24509 * tests/fanotify_init.test: New test. 24510 * tests/.gitignore: Add fanotify_init. 24511 * tests/Makefile.am (check_PROGRAMS): Likewise. 24512 (DECODER_TESTS): Add fanotify_init.test. 24513 24514 tests: some additional checks for fanotify_mark. 24515 * tests/fanotify_mark.c (do_call): New function. 24516 (main): Use it. 24517 24518 tests: use sprintrc in tests/fanotify_mark.c. 24519 * tests/fanotify.c (main): Use sprintrc. 24520 24521 tests: check decoding of {init,finit,delete}_module syscalls. 24522 * tests/delete_module.c: New file. 24523 * tests/finit_module.c: Likewise. 24524 * tests/init_delete_module.h: Likewise. 24525 * tests/init_module.c: Likewise. 24526 * tests/delete_module.test: New test. 24527 * tests/finit_module.test: Likewise. 24528 * tests/init_module.test: Likewise. 24529 * tests/.gitignore: Add delete_nodule, finit_module, and init_module. 24530 * tests/Makefile.am (check_PROGRAMS): Likewise. 24531 (DECODER_TESTS): Add delete_module.test, finit_module.test, 24532 and init_module.test. 24533 (EXTRA_DIST): Add init_delete_module.h. 24534 24535 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24536 24537 bjm: use getarg_ull for retrieving first two parameters of init_module syscall 24538 As init_module has no compat wrapper, its first parameter is a pointer 24539 and the second is length, they both have the same size as kernel_ulong_t 24540 type. 24541 24542 * bjm.c (SYS_FUNC(init_module)): Obtain first two parameters using 24543 getarg_ull, print address argument using printaddr_ull, print length 24544 argument using "%llu" conversion specifier. 24545 24546 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 24547 24548 Add printaddr_ull, change printaddr into a thin wrapper around it. 24549 * defs.h (printaddr_ull): New prototype. 24550 (printaddr): Change to a static inline wrapper around printaddr_ull. 24551 * util.c (printaddr): Rename to printaddr_ull, change argument type 24552 to unsigned long long, change print format to %#llx. 24553 24554 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24555 24556 xlat: add values for MODULE_INIT_* constants. 24557 * bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC): 24558 Remove. 24559 * xlat/module_init_flags.in: Add values for 24560 MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records. 24561 24562 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24563 24564 Remove parser of create_module syscall. 24565 Since create_module syscall is present only in kernels before Linux 2.6 24566 and strace does not support those kernels, there is no use to keep this 24567 parser any longer. 24568 24569 * bjm.c (SYS_FUNC(create_module)): Remove. 24570 * linux/dummy.h (sys_create_module): Add stub alias. 24571 24572 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24573 24574 tests: check decoding of process_vm_readv and process_vm_writev syscalls 24575 * tests/process_vm_readv.c: New file. 24576 * tests/process_vm_readv_writev.c: Likewise. 24577 * tests/process_vm_writev.c: Likewise. 24578 * tests/process_vm_readv.test: New test. 24579 * tests/process_vm_writev.test: Likewise. 24580 * tests/.gitignore: Add process_vm_readv and process_vm_writev. 24581 * tests/Makefile.am (check_PROGRAMS): Likewise. 24582 (DECODER_TESTS): Add process_vm_readv.test and process_vm_writev.test. 24583 (EXTRA_DIST): Add process_vm_readv_writev.c. 24584 24585 process_vm: use widen_to_ulong for local_iovcnt, renote_iovcnt, and flags 24586 * process_vm.c (SYS_FUNC(process_vm_readv), 24587 SYS_FUNC(process_vm_writev)): Use widen_to_ulong for local_iovcnt, 24588 renote_iovcnt, and flags parameters. 24589 24590 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24591 24592 defs: add widen_to_ulong macro. 24593 This is similar to widen_to_long, but for unsigned values. 24594 24595 * defs.h (widen_to_ulong): New macro. 24596 24597 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24598 24599 process_vm: print pid argument as int. 24600 * process_vm.c (SYS_FUNC(process_vm_readv), 24601 SYS_FUNC(process_vm_writev)): Change conversion specifier for pid 24602 argument from "%ld" to "%d". 24603 24604 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24605 24606 process_vm: remove syserror check for iovec printing. 24607 This check had been done by print_array inside tprint_iov anyway. 24608 24609 * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for 24610 printing local_iov; do not check for syserror, provide decode_iov 24611 parameter to tprint_iov{,_upto} based on its value instead. 24612 24613 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24614 24615 io: use umoven_or_printaddr_ignore_syserror as umove function in tprint_iov_upto 24616 This enables printing of iovec arrays even in case of failed syscall 24617 (failed syscall doesn't mean that iovec itself is inaccessible and 24618 useless). One caveat here is that we should explicitly provide proper 24619 IOV_DECODE_* value based on syserror value in case printing is performed 24620 on exiting; we can't simply override it to IOV_DECODE_ADDR on exiting 24621 when syserror is up, since this may be called by code which tries to 24622 print iovec containing local data, which should be perfectly accessible 24623 (on the other hand, there are no cases of such behaviour at the moment). 24624 24625 Since iovecs themselves are printed even if syscall has failed now, 24626 preadv test is updated to reflect this. It is notable, though, that this 24627 is the only place where this case is checked. 24628 24629 * io.c (tprint_iov_upto): Specify umoven_or_printaddr_ignore_syserror 24630 instead of umoven_or_printaddr as umoven_func parameter. 24631 (SYS_FUNC(readv), do_preadv): Specify decode_iov parameter value 24632 based on syserror(tcp) value. 24633 * scsi.c: (print_sg_io_v3_res, print_sg_io_v4_res): Likewise. 24634 * tests/preadv.c: Update expected output for the case when preadv 24635 with singe-item iovec failed. 24636 24637 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24638 24639 Move umoven_or_printaddr_ignore_syserror to util.c. 24640 * defs.h (umoven_or_printaddr_ignore_syserror): New prototype. 24641 * v4l2.c (umoven_or_printaddr_ignore_syserror): Move ... 24642 * util.c: ... here. 24643 24644 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24645 24646 v4l2: check for verbose flag in umoven_or_printaddr_ignore_syserror. 24647 This change makes behaviour of umoven_or_printaddr_ignore_syserror in 24648 line with umoven_or_printaddr when verbose flag is disabled. 24649 24650 * v4l2.c (umoven_or_printaddr_ignore_syserror): Simply call printaddr 24651 when verbose flag is unset. 24652 24653 2016-10-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24654 24655 tests: check decoding of kcmp syscall. 24656 * tests/kcmp.c: New file. 24657 * tests/kcmp.test: New test. 24658 * tests/.gitignore: Add kcmp. 24659 * tests/Makefile.am (check_PROGRAMS): Likewise. 24660 (DECODER_TESTS): Add kcmp.test. 24661 24662 2016-10-28 Dmitry V. Levin <ldv (a] altlinux.org> 24663 24664 kcmp: print index parameters of unknown commands as kernel_ulong_t. 24665 * lookup_dcookie.c (SYS_FUNC(kcmp)): Use getarg_ull to retrieve idx1 24666 and idx2, print them using %#llx format in case of unknown command. 24667 24668 2016-10-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24669 24670 tests: check decoding of inotify family syscalls. 24671 * tests/inotify.c: New file. 24672 * tests/inotify_init1.c: Likewise. 24673 * tests/inotify.test: New test. 24674 * tests/inotify_init1.test: Likewise. 24675 * tests/.gitignore: Add inotify and inotify_init1. 24676 * tests/Makefile.am (check_PROGRAMS): Likewise. 24677 (DECODER_TESTS): Add inotify.test and inotify_init1.test. 24678 24679 xlat: use IN_* prefix for inotify_init1 flag constants. 24680 * xlat/inotify_init_flags.in: Replace O_* prefix with IN_* prefix for 24681 O_NONBLOCK and O_CLOEXEC constants, provide fallback definitions. 24682 24683 tests: check decoding of lookup_dcookie syscall. 24684 * tests/lookup_dcookie.c: New file. 24685 * tests/lookup_dcookie.test: New test. 24686 * tests/.gitignore: Add lookup_dcookie. 24687 * tests/Makefile.am (check_PROGRAMS): Likewise. 24688 (DECODER_TESTS): Add lookup_dcookie.test. 24689 24690 2016-10-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24691 24692 lookup_dcookie: print len parameter as kernel_ulong_t. 24693 It is size_t and without compat on x32/n32. 24694 24695 * lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Change conversion 24696 specifier from "%lu" to "%llu", use getarg_ull for len argument 24697 retrieval. 24698 24699 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24700 24701 defs.h: add offsetofend macro. 24702 Analogous to offsetof but returns structure offset after the specified 24703 field. Useful for checking whether specific field is present in obtained 24704 data or specifying amount of data to copy based on the (last) field needed. 24705 24706 * defs.h (offsetofend): New macro. 24707 24708 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24709 24710 tests: move ARG_STR and similar macros to tests.h. 24711 * tests/add_key.c (_STR, ARG_STR): Move ... 24712 * tests/tests.h: ... here. 24713 (ARG_ULL_STR): New macro. 24714 * tests/keyctl.c (ARG_STR): Remove. 24715 * tests/quotactl.h (ARG_STR): Likewise. 24716 * tests/request_key.c (ARG_STR): Likewise. 24717 24718 tests: move LL_PAIR and LL_VAL_TO_PAIR macros to tests.h. 24719 * tests/fadvise.h (LL_PAIR, LL_VAL_TO_PAIR): Move ... 24720 * tests/tests.h: ... here. 24721 24722 tests: check decoding of ioprio_get and ioprio_set syscalls. 24723 * tests/ioprio.c: New file. 24724 * tests/ioprio.test: New test. 24725 * tests/.gitignore: Add ioprio. 24726 * tests/Makefile.am (check_PROGRAMS): Likewise. 24727 (DECODER_TESTS): Add ioprio.test. 24728 24729 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24730 24731 xlat: provide fallback definitions for CLOCK_* constants. 24732 Since new values have been added gradually over various kernel versions, 24733 it's better to define them explicitly in order to avoid situations when 24734 strace built with older kernel headers cannot decode some recently 24735 defined values. 24736 24737 * xlat/clocknames.in: Add values for constants. 24738 24739 2016-10-26 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24740 24741 tests: move fill_memory and fill_memory_ex into a separate file. 24742 * tests/fill_memory.c: New file. 24743 * tests/Makefile.am (libtests_a_SOURCES): Add it. 24744 * tests/quotactl.h (fill_memory, fill_memory_ex): Move to fill_memory.c. 24745 * tests/tests.h (fill_memory, fill_memory_ex): New prototypes. 24746 24747 tests: add period parameter to fill_memory_ex. 24748 * tests/quotactl.h (fill_memory_ex): Add period parameter, 24749 use it as a divisor in non-constant part of value. 24750 (fill_memory): Specify period of 0x80 to fill_memory_ex call. 24751 * tests/quotactl-xfs.c (main): Likewise. 24752 24753 2016-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 24754 24755 Post-release administrivia. 24756 * NEWS: Add a header line for the next release. 24757 * debian/changelog.in: Add a changelog entry for 4.14-1. 24758 * strace.spec.in: Likewise. 24759 24760 2016-10-04 Dmitry V. Levin <ldv (a] altlinux.org> 24761 24762 Prepare for 4.14 release. 24763 * NEWS: Update for 4.14 release. 24764 24765 Generate SEN numbers in a locale independent order. 24766 * generate_sen.sh: Sort SEN numbers using C collation rules. 24767 24768 2016-10-04 Dmitry V. Levin <ldv (a] altlinux.org> 24769 24770 Assume that offsetof is provided by stddef.h. 24771 According to C89, <stddef.h> shall define offsetof macro. 24772 24773 * defs.h: Include <stddef.h> unconditionally. 24774 [!offsetof]: Remove. 24775 24776 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24777 24778 tests: check decoding of add_key, keyctl, and request_key syscalls. 24779 * tests/add_key.c: New file. 24780 * tests/keyctl.c: Likewise. 24781 * tests/request_key.c: Likewise. 24782 * tests/add_key.test: New test. 24783 * tests/keyctl.test: Likewise. 24784 * tests/request_key.test: Likewise. 24785 * tests/.gitignore: Add add_key, keyctl, and request_key. 24786 * tests/Makefile.am (check_PROGRAMS): Likewise. 24787 (DECODER_TESTS): Add add_key.test, keyctl.test, and request_key.test. 24788 24789 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24790 24791 keyctl: use kernel_ulong_t and getarg_ull instead of long. 24792 This potentially fixes keyctl decoder for x32 personality. 24793 24794 * keyctl.c (keyctl_update_key, keyctl_read_key, keyctl_instantiate_key, 24795 keyctl_instantiate_key_iov, keyctl_dh_compute): Change addr and len 24796 arguments to kernel_ulong_t. Print len using %llu format. 24797 (keyctl_keyring_search): Change addr1 and addr2 arguments 24798 to kernel_ulong_t. 24799 (print_dh_params): Change addr argument to kernel_ulong_t. 24800 (SYS_FUNC(keyctl)): Retrieve arguments via getarg_ull, pass them 24801 to the appropriate handlers. 24802 24803 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24804 24805 keyctl: fix parameter signedness. 24806 * keyctl.c (keyctl_update_key): Change addr and len arguments 24807 to unsigned. 24808 (keyctl_read_key): Likewise. 24809 (keyctl_instantiate_key): Likewise. 24810 (keyctl_instantiate_key_iov): Likewise. 24811 (keyctl_dh_compute): Likewise. 24812 (keyctl_keyring_search): Change addr1 and addr2 arguments to unsigned. 24813 (keyctl_chown_key): Change user and group arguments to unsigned. 24814 (keyctl_get_persistent): Change uid argument to unsigned. 24815 24816 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24817 24818 keyctl: use printstr_ex for printing out buffer. 24819 keyctl_read_key had subtle bug by treating out buffer in KEYCTL_READ 24820 as NUL-terminated, which is not true. We fix it by adding parameter to 24821 keyctl_read_key signalising whether buffer is NUL-terminated and using 24822 printstr_ex for printing (expectedly) NUL-terminated strings. 24823 24824 * keyctl.c (keyctl_read_key): Add has_nul parameter. Do not use -1 as 24825 string len. Use printstr_ex for buffer output with user style depending 24826 on has_nul value. 24827 (SYS_FUNC(keyctl)): Specify has_nul parameter to keyctl_read_key 24828 by comparing cmd value with KEYCTL_READ. 24829 24830 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24831 24832 Add printstr_ex which allows for providing user quotation style. 24833 This is useful for providing QUOTE_OMIT_TRAILING_0 and maybe other 24834 flags. 24835 24836 * defs.h (printstr_ex): New prototype. 24837 (printstr): Change to a wrapper around printstr_ex with zero user style. 24838 * util.c (printstr): Rename to ... 24839 (printstr_ex) ... new function, add user_style argument which is or'ed 24840 with computed style. 24841 24842 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24843 24844 util: add quote_string flag signalising that string is NUL-terminated. 24845 It is useful in cases strings with size provided are expected to be 24846 NUL-terminated but are not trustworthy enough to call just plain 24847 printstr(str, -1). 24848 24849 * defs.h (QUOTE_OMIT_TRAILING_0): New constant definition. 24850 * util.c (string_quote): Swallow terminating NUL if 24851 QUOTE_OMIT_TRAILING_0 is set. 24852 24853 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24854 24855 keyctl: add support for KEYCTL_DH_COMPUTE. 24856 * keyctl.c (struct keyctl_dh_params): New structure. 24857 (print_dh_params, keyctl_dh_compute): New functions. 24858 (SYS_FUNC(keyctl)): Add support for KEYCTL_DH_COMPUTE cmd value. 24859 24860 2016-10-03 Dmitry V. Levin <ldv (a] altlinux.org> 24861 24862 x86_64: fix is_negated_errno for x32 personality. 24863 * syscall.c (is_negated_errno) [X86_64]: Do not truncate kernel_ulong_t 24864 to uint32_t for x32 personality. 24865 24866 tests: fix another regression in qual_syscall.test. 24867 * tests/qual_syscall.test: Fix pattern_nonabbrev_verbose pattern. 24868 (check_output_mismatch): Print the pattern that triggered match failure. 24869 24870 Use err_name, print unrecognized errno values as numbers. 24871 * syscall.c (trace_syscall_exiting): Use err_name() instead 24872 of open-coding it. Print unrecognized errno values using %lu format 24873 instead of ERRNO_%lu as the latter prodices an invalid constant. 24874 24875 2016-10-03 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24876 24877 keyctl: print errno name in KEYCTL_REJECT in case it is available. 24878 * keyctl.c (keyctl_reject_key): Get errno string via err_name 24879 and print it if it is not NULL. 24880 24881 Add function for getting errno string. 24882 * defs.h (err_name): New prototype. 24883 * syscall.c (err_name): New function. 24884 24885 2016-10-03 Dmitry V. Levin <ldv (a] altlinux.org> 24886 24887 struct tcb: change the type of u_error field from int to unsigned long. 24888 This is the type actually used for the error code on architectures 24889 that use a dedicated register. 24890 24891 * defs.h (struct tcb): Change the type of u_error to unsigned long. 24892 * syscall.c (trace_syscall_exiting): Change the type of u_error variable 24893 to unsigned long, print it using %lu format, drop no longer needed 24894 explicit cast to unsigned long. 24895 (saved_u_error): Change type to unsigned long. 24896 24897 2016-10-02 Dmitry V. Levin <ldv (a] altlinux.org> 24898 24899 Use tprints instead of tprintf in a few more places. 24900 * btrfs.c (btrfs_print_qgroup_inherit, btrfs_print_tree_search, 24901 btrfs_ioctl): Replace tprintf with tprints for printing strings without 24902 format specifiers. 24903 * net.c (print_group_req): Likewise. 24904 * scsi.c (scsi_ioctl): Likewise. 24905 * term.c (decode_termios, decode_termio): Likewise. 24906 * userfaultfd.c (uffdio_ioctl): Likewise. 24907 24908 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24909 24910 keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command. 24911 Since this command doesn't have any additional arguments, the comma does 24912 not needed. Since this is the only command which lacks additional 24913 arguments, it's better to add special case for it rather than add 24914 printing of comma to all other commands. 24915 24916 * keyctl.c (SYS_FUNC(keyctl)): Add check for command not being 24917 KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument 24918 from the rest. 24919 24920 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24921 24922 keyctl: use getarg_ull for printing generic arguments. 24923 Otherwise it is erroneous on x32, for example. 24924 24925 * keyctl.c (SYS_FUNC(keyctl)): Use "%#llx" conversion specifier 24926 and getarg_ull for fallback argument printing. 24927 24928 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24929 24930 keyctl: use printuid for printing UID/GID. 24931 UID/GID are unsigned except special -1 value (which is also special in 24932 context of specific keyctl commands), so special printing function 24933 should be used. 24934 24935 * keyctl.c (keyctl_chown_key, keyctl_get_persistent): Use printuid 24936 instead of printf with "%d" conversion for printing UID/GID. 24937 24938 2016-10-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24939 24940 io: handle data_size of -1 as unlimited data in print_iovec. 24941 Otherwise it can be depleted and print_iovec starts printing empty 24942 strings. 24943 24944 * io.c (print_iovec): Interpret c->data_size of -1 as unlimited data 24945 and do not decrease it in this case. 24946 24947 2016-10-01 Dmitry V. Levin <ldv (a] altlinux.org> 24948 24949 tests: fix typo in qual_syscall.test. 24950 Fix test regression introduced by commit v4.13-225-g55334ef. 24951 24952 * tests/qual_syscall.test: Fix typo. 24953 24954 2016-09-30 Dmitry V. Levin <ldv (a] altlinux.org> 24955 24956 Enhance -e abbrev=set, -e raw=set, and -e verbose=set. 24957 Enhance abbrev=, raw=, and verbose= to accept the same syntax as trace=. 24958 For example, this allows such syntax as -e verbose=file. 24959 24960 * syscall.c (lookup_class): Define before qual_syscall. 24961 (qualify): Move the loop based on lookup_class ... 24962 (qual_syscall): ... here. 24963 * tests/qual_syscall.test: Check it. 24964 24965 2016-09-30 Dmitry V. Levin <ldv (a] altlinux.org> 24966 24967 tests/qual_syscall.test: rewrite without ls. 24968 * tests/qual_syscall.test: Invoke ./umovestr instead of ls. 24969 Update expected output. 24970 24971 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24972 24973 tests: check decoding of fadvise64 and fadvise64_64 syscalls. 24974 * tests/fadvise.h: New file. 24975 * tests/fadvise64.c: Likewise. 24976 * tests/fadvise64_64.c: Likewise. 24977 * tests/fadvise64.test: New test. 24978 * tests/fadvise64_64.test: Likewise. 24979 * tests/.gitignore: Add fadvise64 and fadvise64_64. 24980 * tests/Makefile.am (check_PROGRAMS): Likewise. 24981 (DECODER_TESTS): Add fadvise64.test, fadvise64_64.test. 24982 (EXTRA_DIST): Add fadvise.h. 24983 24984 2016-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 24985 24986 mips o32: implement fetching the 7th subcall argument. 24987 * syscall.c [LINUX_MIPSO32] (decode_mips_subcall): Fetch the last 24988 argument of 7-arg syscalls. 24989 24990 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 24991 24992 x32: use proper decoder for fadvise64 syscall. 24993 fadvise_64_64 decoder used before this change prints different sign 24994 of the "len" argument (loff_t vs size_t). 24995 24996 * linux/x32/syscallent.h (fadvise64): Replace SEN(fadvise64_64) 24997 with SEN(fadvise64). 24998 24999 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25000 25001 fadvise: use getarg_ull for obtaining len argument of fadvise64 syscall. 25002 Since its type is size_t, it is 64-bit wide on x32 and special care 25003 should be taken in order to obtain it. 25004 25005 * fadvise.c (SYS_FUNC(fadvise64)): Use getarg_ull for obtaining value 25006 of "len" syscall argument. 25007 25008 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25009 25010 util: add getarg_ll and getarg_ull functions. 25011 These allow retrieving specific argument in full taking into account 25012 peculiarities of runtimes which employ tcp->ext_arg (e.g. x32). 25013 25014 * defs.h (getarg_ll, getarg_ull): New prototypes. 25015 * util.c (getarg_ll, getarg_ull): New functions. 25016 (printargs): Use getarg_ull. 25017 25018 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25019 25020 fadvise: change printing of len argument to unsigned in fadvise64 syscall 25021 The kernel declares fadvise64 as 25022 long sys_fadvise64(int fd, loff_t offset, size_t len, int advice); 25023 25024 * fadvise.c (SYS_FUNC(fadvise64)): Change conversion specifier from 25025 "%ld" to "%lu" for printing len argument since kernel expects argument 25026 of type size_t. 25027 25028 2016-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 25029 25030 sh64, sparc64: use proper decoder for fadvise64_64 syscall. 25031 This change is no-op yet, but things will change when decoder 25032 of fadvise64 syscall get fixed. 25033 25034 * linux/sh64/syscallent.h (fadvise64_64): Replace SEN(fadvise64) 25035 with SEN(fadvise64_64). 25036 * linux/sparc64/syscallent.h (fadvise64_64): Likewise. 25037 25038 2016-09-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25039 25040 tests: check decoding of fallocate syscall. 25041 * configure.ac (AC_CHECK_FUNCS): Add fallocate. 25042 * tests/fallocate.c: New file. 25043 * tests/fallocate.test: New test. 25044 * tests/.gitignore: Add fallocate. 25045 * tests/Makefile.am (check_PROGRAMS): Likewise. 25046 (DECODER_TESTS): Add fallocate.test. 25047 25048 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25049 25050 fallocate: change print format of offset and len arguments to signed. 25051 Since types of these arguments are off_t and kernel actually expects 25052 signed values in order to fail when negative values are provided, 25053 lets display these values as signed. 25054 25055 * fallocate.c (SYS_FUNC(fallocate)): Change conversion specifier for 25056 printing "offset" and "len" syscall arguments from %llu to %lld. 25057 25058 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25059 25060 xlat: add default values for falloc_flags constants. 25061 In order to avoid dependence of declared constants to headers available 25062 on build system. 25063 25064 * xlat/falloc_flags.in: Add default values for constants. 25065 25066 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25067 25068 tests: check decoding of getcpu syscall. 25069 * tests/getcpu.c: New file. 25070 * tests/getcpu.test: New test. 25071 * tests/.gitignore: Add getcpu. 25072 * tests/Makefile.am (check_PROGRAMS): Likewise. 25073 (DECODER_TESTS): Add getcpu.test. 25074 25075 tests: make magic values in ioctl_block test distinctive. 25076 * tests/ioctl.block (init_magic): Add iterator value to magic value 25077 in order to enable detection of potential 4-byte aligned shifts. 25078 25079 tests: additional getcwd decoding checks. 25080 * tests/getcwd.c (main): Add more checks for getcwd arguments decoding. 25081 25082 tests: check decoding of quotactl syscall. 25083 * configure.ac (AC_CHECK_HEADERS): Add linux/dqblk_xfs.h, linux/quota.h, 25084 and sys/quota.h. 25085 * tests/.gitignore: Add quotactl, quotactl-v, quotactl-xfs, 25086 and quotactl-xfs-v. 25087 * tests/Makefile.am (check_PROGRAMS): Likewise. 25088 (DECODER_TESTS): Add quotactl.test, quotactl-v.test, 25089 quotactl-xfs.test, and quotactl-xfs-v.test. 25090 (EXTRA_DIST): Add quotactl.h 25091 * quotactl.h: New file. 25092 * quotactl.c: Likewise. 25093 * quotactl-v.c: Likewise. 25094 * quotactl-xfs.c: Likewise. 25095 * quotactl-xfs-v.c: Likewise. 25096 * quotactl.test: New test. 25097 * quotactl-v.test: Likewise. 25098 * quotactl-xfs.test: Likewise. 25099 * quotactl-xfs-v.test: Likewise. 25100 25101 2016-09-27 Dmitry V. Levin <ldv (a] altlinux.org> 25102 25103 quota: ensure that names of structure fields are printed properly. 25104 * quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros. 25105 (decode_cmd_data): Use them to print structure fields. 25106 25107 Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros. 25108 * defs.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): 25109 Add support of char types. 25110 * tests/tests.h (zero_extend_signed_to_ull, sign_extend_unsigned_to_ll): 25111 Likewise. 25112 25113 quota: move Q_QUOTAON handling to subcommand switch statement. 25114 * quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ... 25115 (decode_cmd_data): ... here. 25116 25117 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25118 25119 quota: remove legacy subcommand decoding support code. 25120 Support for these quota subcommands by linux kernels has been dropped 25121 long time ago (between 2.5.16 and 2.5.17), so lets drop it in order 25122 to minimize amount of code which should be subjected to testing and 25123 structured conversion. 25124 25125 * quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo, 25126 struct v1_dqstats, struct v2_dqstats): Remove. 25127 (decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA, 25128 Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS, 25129 and Q_V2_GETSTATS subcommands. 25130 (SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand. 25131 25132 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25133 25134 quota: add realtime block limits fields to XFS disk quota printing code. 25135 * quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit 25136 and d_rtb_softlimit fields to struct xfs_dqblk printing code. 25137 25138 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25139 25140 quota: add packed attribute to struct if_dqblk definition. 25141 Since the only difference between 32-bit and 64-bit environments 25142 regarding this structure is its padding, lets just add packed attribute 25143 to its definition instead of going full mpers. 25144 25145 * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED. 25146 25147 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25148 25149 quota: Add decoding for Q_XQUOTARM subcommand. 25150 * quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand 25151 switch. 25152 25153 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25154 25155 quota: add dispatch of SYNC subcommands. 25156 Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway. 25157 25158 * quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand 25159 dispatch switch since id/addr arguments for these subcommands are known 25160 to be ignored. 25161 25162 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25163 25164 quota: add missing prefixes to struct field names. 25165 * quota.c (decode_cmd_data): Print field names in accordance with 25166 their definition. 25167 25168 quota: fix indentation inside subcommand dispatching switch statement. 25169 25170 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25171 25172 quota: avoid printing id argument for those commands that ignore it. 25173 As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO, 25174 Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF, 25175 Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and 25176 Q_V2_GETSTATS subcommands, do not print it for these subcommands. 25177 25178 * quota.c (decode_cmd_data): Add id argument parameter, add printing 25179 of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA, 25180 Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA, 25181 Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands. 25182 (SYS_FUNC(quotactl)): Remove printing of id argument, pass it 25183 to decode_cmd_data. 25184 25185 2016-09-27 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25186 25187 quota: use printuid for id parameter printing. 25188 * quota.c (SYS_FUNC(quotactl)): Since id call argument is used for 25189 user/group/project ID which all have special semantics for -1, 25190 print it the same way as UIDs are printed. 25191 25192 quota: display quota subcommand as a macro. 25193 * quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values 25194 (which also lacks shift of the left part) with QCMD macro call. 25195 25196 2016-09-26 Dmitry V. Levin <ldv (a] altlinux.org> 25197 25198 tests: use VERBOSE macro in waitid and waitid-v tests. 25199 * tests/waitid-v.c (VERBOSE_RUSAGE): Remove. 25200 (VERBOSE): Define to 1. 25201 * tests/waitid.c (sprint_rusage): Check VERBOSE instead 25202 of VERBOSE_RUSAGE. 25203 25204 tests: use VERBOSE macro in wait4 and wait4-v tests. 25205 * tests/wait4-v.c (VERBOSE_RUSAGE): Remove. 25206 (VERBOSE): Define to 1. 25207 * tests/wait4.c (sprint_rusage): Check VERBOSE instead 25208 of VERBOSE_RUSAGE. 25209 25210 tests: use VERBOSE macro in msg_control and msg_control-v tests. 25211 * tests/msg_control-v.c (VERBOSE_MSGHDR): Remove. 25212 (VERBOSE): Define to 1. 25213 * tests/msg_control.c (print_fds, print_ip_opts): Check VERBOSE instead 25214 of VERBOSE_MSGHDR. 25215 25216 tests: use VERBOSE macro in mmsg_name and mmsg_name-v tests. 25217 * tests/mmsg_name-v.c (VERBOSE_MMSGHDR): Remove. 25218 (VERBOSE): Define to 1. 25219 * tests/mmsg_name.c (test_mmsg_name): Check VERBOSE instead 25220 of VERBOSE_MMSGHDR. 25221 25222 tests: use VERBOSE macro in ioctl_rtc and ioctl_rtc-v tests. 25223 * tests/ioctl_rtc-v.c (VERBOSE_IOCTL): Remove. 25224 (VERBOSE): Define to 1. 25225 * tests/ioctl_rtc.c (print_rtc_time): Check VERBOSE instead 25226 of VERBOSE_IOCTL. 25227 25228 tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests. 25229 * tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove. 25230 (VERBOSE): Define to 1. 25231 * tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL. 25232 25233 tests: use VERBOSE macro in execveat and execveat-v tests. 25234 * tests/execveat-v.c (VERBOSE_EXECVEAT): Remove. 25235 (VERBOSE): Define to 1. 25236 * tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT. 25237 25238 tests: use VERBOSE macro in execve and execve-v tests. 25239 * tests/execve-v.c (VERBOSE_EXECVE): Remove. 25240 (VERBOSE): Define to 1. 25241 * tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE. 25242 25243 2016-09-26 Dmitry V. Levin <ldv (a] altlinux.org> 25244 25245 tests: add VERBOSE macro. 25246 Introduce VERBOSE macro (defaults to 0) that is expected to be defined 25247 to 1 by code testing "strace -v" output. 25248 25249 * tests/tests.h [!VERBOSE] (VERBOSE): New macro. 25250 25251 2016-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 25252 25253 decode_open: print the mode argument when O_TMPFILE flag is set. 25254 O_TMPFILE reqires the mode argument (just like O_CREAT), so print it. 25255 25256 * open.c (STRACE_O_TMPFILE): New macro. 25257 (decode_open): Print the mode argument when O_TMPFILE flag is set. 25258 * tests/open.c (main): Check it. 25259 Fixes RH#1377846. 25260 25261 2016-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 25262 25263 tests: use sprintrc in tests/ptrace.c. 25264 * tests/ptrace.c (errstr): New static variable. 25265 (do_ptrace): Initialize it using sprintrc. 25266 (test_peeksiginfo, main): Use errstr. 25267 25268 tests: use sprintrc in tests/netlink_protocol.c. 25269 * tests/netlink_protocol.c (main): Use sprintrc. 25270 25271 tests: use sprintrc in tests/fchownat.c. 25272 * tests/fchownat.c (main): Use sprintrc. 25273 25274 tests: use sprintrc in tests/fchmodat.c. 25275 * tests/fchmodat.c (main): Use sprintrc. Add more fchmodat decoding tests. 25276 25277 tests: use sprintrc in tests/fchmod.c. 25278 * tests/fchmod.c (main): Use sprintrc. Add more fchmod decoding tests. 25279 * tests/fchmod.test: Update the value specified for strace -a parameter. 25280 25281 tests: use sprintrc in tests/getgroups.c. 25282 * tests/getgroups.c (main): Use sprintrc. 25283 25284 tests: use sprintrc in tests/setgroups.c. 25285 * tests/setgroups.c (main): Use sprintrc. 25286 25287 2016-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 25288 25289 tests/utime.c: rewrite without assert. 25290 * tests/utime.c: Do not include <assert.h>. 25291 (main): Use sprintrc instead of assert. 25292 25293 tests/xattr.c: rewrite without assert. 25294 * tests/xattr.c: Do not include <assert.h>. 25295 (main): Use sprintrc instead of assert. 25296 25297 tests: use sprintrc in tests/xchownx.c. 25298 * tests/xchownx.c (main): Do not include <errno.h>. Use sprintrc. 25299 25300 tests/xstatfsx.c: fix potential errno clobbering. 25301 * tests/xstatfsx.c (main): Use sprintrc. 25302 25303 2016-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 25304 25305 Add more fs magic constants. 25306 Add *_MAGIC constants defined for some relatively widespread 25307 non-mainline filesystems. 25308 25309 * xlat/fsmagic.in: Add AUFS_SUPER_MAGIC, GPFS_SUPER_MAGIC, 25310 VZFS_SUPER_MAGIC, and ZFS_SUPER_MAGIC constants. 25311 25312 2016-09-15 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25313 25314 tests: fix whitespace for explicit type casts in futex test. 25315 25316 2016-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 25317 25318 Add more fs magic constants. 25319 Add *_MAGIC constants defined inside linux fs but not explicitly 25320 exported via linux uapi. 25321 25322 * xlat/fsmagic.in: Add HFS_SUPER_MAGIC, HFSPLUS_SUPER_MAGIC, 25323 EXOFS_SUPER_MAGIC, CEPH_SUPER_MAGIC, UBIFS_SUPER_MAGIC, JFS_SUPER_MAGIC, 25324 BEFS_SUPER_MAGIC, NTFS_SB_MAGIC, XFS_SB_MAGIC, CONFIGFS_MAGIC, 25325 FUSE_CTL_SUPER_MAGIC, FUSE_SUPER_MAGIC, AFS_FS_MAGIC, OCFS2_SUPER_MAGIC, 25326 VXFS_SUPER_MAGIC, LOGFS_MAGIC, SMB2_MAGIC_NUMBER, and CIFS_MAGIC_NUMBER 25327 constants. 25328 25329 2016-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 25330 25331 Update fs *_MAGIC constants. 25332 Add fs *_MAGIC constants exported by linux uapi. 25333 25334 * xlat/fsmagic.in: Add BFS_MAGIC, GFS2_MAGIC, and ROMFS_MAGIC constants 25335 defined in linux/bfs_fs.h, linux/gfs2_ondisk.h, and linux/romfs_fs.h, 25336 respectively. 25337 25338 2016-09-13 Dmitry V. Levin <ldv (a] altlinux.org> 25339 25340 tests: workaround limited semctl implementation in musl. 25341 musl libc forwards semctl command argument for 8 known commands only, 25342 for all the rest it passes 0 instead. 25343 25344 * tests/ipc_sem.c (main): Update semctl expected output. 25345 25346 2016-09-13 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25347 25348 tests: add more IPC decoding checks. 25349 * tests/ipc_msg.c: Additional msgget (parameter format) and msgctl 25350 (parameter format, decoding of struct msqid_ds in IPC_SET/IPC_STAT 25351 commands) checks. 25352 * tests/ipc_sem.c: Additional semget and semctl checks. 25353 * tests/ipc_shm.c: Additional shmget and shmctl checks. 25354 * tests/semop.c: Additional semop checks. Add checks for semtimedop. 25355 * tests/semop.test: Add explicit -e parameter in order to trace both 25356 semop and semtimedop. 25357 * tests/shmxt.c: Additional shmat and shmdt checks. 25358 25359 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 25360 25361 .mailmap: add addresses of Dr. David Alan Gilbert. 25362 * .mailmap: Add both addresses of Dr. David Alan Gilbert here to avoid 25363 duplications in CREDITS file. 25364 25365 2016-09-12 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25366 25367 .mailmap: add canonical name for Eugene Syromyatnikov. 25368 This is needed due to apparent deviation in spelling of commit author 25369 name in several commits. 25370 25371 * .mailmap: Add canonical name for Eugene Syromyatnikov. 25372 25373 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 25374 25375 Update generic ioctl entries from linux 4.8. 25376 * linux/64/ioctls_inc.h: Update from linux v4.8 using ioctls_gen.sh. 25377 * linux/32/ioctls_inc_align32.h: Likewise. 25378 * linux/32/ioctls_inc_align64.h: Likewise. 25379 25380 2016-09-12 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 25381 25382 x32: update ioctl entries from linux 4.8. 25383 * linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh. 25384 25385 maint: update for linux 4.8. 25386 * maint/ioctls_sym.sh: Add workarounds for linux/atm_zatm.h and 25387 xen/evtchn.h files. 25388 25389 2016-09-12 Dmitry V. Levin <ldv (a] altlinux.org> 25390 25391 tests: use sprintrc_grep in tests/ipc_shm.c. 25392 * tests/ipc_shm.c (main): Use sprintrc_grep. 25393 25394 tests: use sprintrc_grep in tests/ipc_sem.c. 25395 * tests/ipc_sem.c (main): Use sprintrc_grep. 25396 25397 2016-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 25398 25399 tests: use sprintrc_grep in tests/ipc_msg.c. 25400 * tests/ipc_msg.c (main): Use sprintrc_grep. 25401 25402 2016-09-10 Dmitry V. Levin <ldv (a] altlinux.org> 25403 25404 tests: use sprintrc in tests/chmod.c. 25405 * tests/chmod.c (main): Use sprintrc. Add more chmod decoding tests. 25406 25407 2016-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 25408 25409 ipc: fix printing of nsops argument of semop and semtimedop syscalls. 25410 According to POSIX, nsops argument of semop syscall has type size_t, 25411 but the kernel treats nsops argument of semop and semtimedop syscalls 25412 as unsigned int. 25413 25414 * ipc_sem.c (tprint_sembuf_array): Change type of "count" argument 25415 from unsigned long to unsigned int, print it using %u format. 25416 25417 2016-09-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25418 25419 tests/aio.c: bring indentation in conformance with the rest of the file. 25420 25421 2016-09-09 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25422 25423 tests: use predefined constant in aio_context_t checks in aio test. 25424 Also fix io_cancel and io_destroy checks which did not check correct 25425 printing of context argument properly. 25426 25427 * tests/aio.c (main): Update syscall checks in order to use newly 25428 defined bogus_ctx constant. 25429 25430 2016-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 25431 25432 Mark io_setup and io_destroy as memory mapping related syscalls. 25433 As io_setup syscall allocates some memory using do_mmap_pgoff, and 25434 io_destroy deallocates this memory using vm_munmap, set TRACE_MEMORY 25435 flag for all sysentries of io_setup and io_destroy using the following 25436 oneliner: 25437 sed -ri '/io_setup|io_destroy/ s/0,/TM,/' linux/*/syscallent*.h 25438 25439 * linux/*/syscallent*.h (io_setup, io_destroy): Change sys_flags to TM. 25440 25441 2016-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 25442 25443 travis: add x86 musl. 25444 * .travis.yml (matric): Add musl-gcc/x86. 25445 * travis-build.sh [TARGET == x86]: Specify --target along with --build 25446 to configure. 25447 * travis-install.sh [CC == musl-gcc && TARGET == x32]: Add -mx32 to $CC. 25448 [CC == musl-gcc && TARGET == x86]: Add -m32 to $CC. Specify --build 25449 and --target to musl configure invocation. 25450 25451 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25452 25453 tests: use PRI__*64 macros in aio test. 25454 It was incorrectly assumed that __*64 types are long long on all 25455 platforms, despite strace having specially crafted macros in order 25456 to handle precisely this architecture discrepancy. 25457 The commit fixes this oversight. 25458 25459 * tests/aio.c (main): Use PRI__*64 macros for correct format conversion 25460 specifiers for __*64-typed values. 25461 25462 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25463 25464 ipc: fix printing of integer arguments. 25465 * ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int 25466 by the kernel, cast it to int and print it using %d format. 25467 * ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise, 25468 for semid argument. 25469 (SYS_FUNC(semget)): Likewise, for nsems argument. 25470 (SYS_FUNC(semctl)): Likewise, for semid and semnum arguments. 25471 * ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument. 25472 * ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise. 25473 25474 2016-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 25475 25476 ipc: fix printing key_t arguments of msgget, semget, and shmget syscalls 25477 * ipc_msg.c (SYS_FUNC(msgget)): As key_t type in the kernel 25478 is __kernel_key_t (i.e. int), cast key_t argument to int 25479 and print it using %#x format. 25480 * ipc_sem.c (SYS_FUNC(semget)): Likewise. 25481 * ipc_shm.c (SYS_FUNC(shmget)): Likewise. 25482 * tests/ipc_msg.c (main): Test it. 25483 * tests/ipc_sem.c (main): Likewise. 25484 * tests/ipc_shm.c (main): Likewise. 25485 25486 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25487 25488 tests: add more sched_getattr and sched_setattr decoding checks. 25489 * tests/sched_xetattr.c (main): Add more sched_getattr and sched_setattr 25490 decoding checks. 25491 25492 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25493 25494 tests: change type of sched_nice field to signed in sched_xetattr test. 25495 Kernel headers declare this field as s32, and strace prints it with %d 25496 specifier. 25497 25498 * tests/sched_xetattr.c (main): Change type of sched_nice field of struct 25499 sched_attr to int32_t, update format specifiers accordingly. 25500 25501 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25502 25503 tests: add sprintrc_grep function to libtests. 25504 New sprintrc_grep function is sprintrc function equivalent suitable for 25505 tests where grep-base pattern matching is employed. 25506 25507 * tests/tests.h (sprintrc_grep): New prototype. 25508 * tests/sprintrc.c (enum sprintrc_fmt): New sprintrc format enumeration. 25509 (sprintrc_ex): New function, renamed from sprintrc and updated to 25510 support different formats. 25511 (sprintrc): Change to use sprintrc_ex with SPRINTRC_FMT_RAW. 25512 (sprintrc_grep): New function, calls sprintrc_ex with SPRINTRC_FMT_GREP. 25513 25514 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25515 25516 tests: perform more strict structure allocation in sched_xetattr test. 25517 Use tail_alloc with precise size of the structure. 25518 25519 * tests/sched_xetattr.c (main): Eliminate usage of anonymous union type. 25520 Rename sched to sched_attr. Change type of sched_attr to struct 25521 pointer. Use tail_alloc for sched_attr allocation, update printf 25522 statements accrodingly. 25523 25524 2016-09-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25525 25526 tests: split long lines in sched_xetattr test. 25527 * tests/sched_xetattr.c (main): Split long lines. 25528 25529 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 25530 25531 tests/aio.c: fix for x32 personality. 25532 * tests/aio.c (main): Do not pass 64-bit aio_context_t to io_submit 25533 and io_getevents until strace learns how to print 64-bit pointers on x32 25534 and on x86_64 for x32 personality. 25535 25536 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 25537 25538 aio: print aio_context_t as a pointer type. 25539 As aio_context_t is treated by the kernel as a pointer, 25540 print it using printaddr. 25541 25542 * aio.c (SYS_FUNC(io_setup)): Print the pointer to aio_context_t 25543 argument using printnum_ptr. 25544 (SYS_FUNC(io_destroy), SYS_FUNC(io_submit), SYS_FUNC(io_cancel), 25545 SYS_FUNC(io_getevents)): Print aio_context_t argument using printaddr. 25546 * tests/aio.c (sprint_aio_context_t): Remove. 25547 (main): Update expected output. 25548 25549 2016-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 25550 25551 tests/aio.c: rewrite without assert. 25552 * tests/aio.c: Do not include <assert.h>. 25553 (main): Use sprintrc instead of assert. 25554 25555 2016-09-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25556 25557 tests: add more aio decoding checks. 25558 * tests/aio.c (sprint_aio_context_t): New function. 25559 (main): Use it; add more checks. 25560 25561 2016-09-06 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25562 25563 tests: add suffix and cast to 64-bit constants in aio test. 25564 This helps to avoid warnings like 25565 "integer constant is too large for long type" 25566 reported by some versions of gcc on 32-bit platforms. 25567 25568 * tests/aio.c (main): Add ULL suffix to 64-bit constants 25569 and cast them to unsigned long. 25570 25571 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25572 25573 tests: check decoding of perf_event_open syscall. 25574 * tests/perf_event_open.c: New file. 25575 * tests/perf_event_open.test: New test. 25576 * tests/.gitignore: Add perf_event_open. 25577 * tests/Makefile.am (check_PROGRAMS): Likewise. 25578 (DECODER_TESTS): Add perf_event_open.test. 25579 25580 Makefile.am: use pwd instead of realpath. 25581 * Makefile.am (CODE_COVERAGE_GENHTML_OPTIONS): Use standard pwd(1) 25582 instead of less widespread realpath(1) utility from GNU coreutils. 25583 25584 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 25585 25586 tests: use sprintrc in tests/xetpriority.c. 25587 * tests/xetpriority.c (main): Use sprintrc. 25588 25589 tests: use sprintrc in vhangup.test. 25590 * tests/vhangup.c (main): Use sprintrc. 25591 25592 tests: use sprintrc in tests/sockname.c. 25593 * tests/sockname.c (test_sockname_syscall): Use sprintrc. 25594 25595 tests: use sprintrc in signalfd4.test. 25596 * tests/signalfd4.c (main): Use sprintrc. 25597 25598 tests: use sprintrc in setrlimit.test. 25599 * tests/setrlimit.c (main): Use sprintrc. 25600 25601 tests: use sprintrc in set_mempolicy.test. 25602 * tests/set_mempolicy.c (main, print_nodes): Use sprintrc. 25603 25604 tests: use sprintrc in openat.test. 25605 * tests/openat.c (main): Use sprintrc. 25606 25607 tests: use sprintrc in open.test. 25608 * tests/open.c (main): Use sprintrc. 25609 25610 tests: use sprintrc in move_pages.test. 25611 * tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc. 25612 25613 tests: use sprintrc in mlockall.test. 25614 * tests/mlockall.c (main): Use sprintrc. 25615 25616 tests: use sprintrc in mlock.test. 25617 * tests/mlock.c (main): Use sprintrc. 25618 25619 tests: use sprintrc in epoll_create1.test. 25620 * tests/epoll_create1.c (main): Use sprintrc. 25621 25622 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25623 25624 tests: fix printing of min_nr and nr arguments of io_getevents syscall. 25625 * tests/aio.c (main): Change output format for min_nr and nr arguments 25626 in io_getevents check to %ld, cast these arguments to long. 25627 25628 tests: use sprintrc for return code output in aio test. 25629 * tests/aio.c (main): Use sprintrc for return code output. 25630 25631 tests: add more tests for ched_rr_get_interval decoding. 25632 * tests/sched_rr_get_interval.c (main): Check decoding of invalid 25633 timespec pointer and successful syscall invocation. 25634 25635 tests: use sprintrc for return code output in sched_rr_get_interval test 25636 * tests/sched_rr_get_interval.c (main): Use sprintrc for return code 25637 output. 25638 25639 tests: add more tests for sched_getscheduler and sched_xetscheduler. 25640 * tests/sched_xetscheduler.c (main): Check for decoding of invalid PID 25641 in sched_getscheduler and sched_setscheduler, invalid address 25642 of sched_param structure, and invalid policy value. 25643 25644 tests: use sprintrc for return code output in sched_xetscheduler test. 25645 * tests/sched_xetscheduler.c (main): Use sprintrc for return code output. 25646 25647 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25648 25649 aio: use printfd for fd printing. 25650 struct iocb contains two fields with fd semantics: aio_fildes and 25651 aio_resfd. It is quite reasonable to use the appropriate function for 25652 printing them (apart from just "%d"). 25653 25654 * aio.c (print_common_flags): Add struct tcb pointer to parameter list; 25655 use printfd for printing aio_resfd field. 25656 (print_iocb_header): Add struct tcb pointer to parameter list; 25657 use printfd for printing aio_fildes field. 25658 (print_iocb): Provide tcp argument to print_iocb_header 25659 and print_common_flags. 25660 (SYS_FUNC(io_cancel)): Likewise. 25661 25662 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 25663 25664 sh64: wire up new syscalls. 25665 * linux/sh64/syscallent.h [380..393]: New entries. 25666 25667 2016-09-02 Dmitry V. Levin <ldv (a] altlinux.org> 25668 25669 sh: wire up new syscalls. 25670 * linux/sh/syscallent.h [369..382]: New entries. 25671 25672 2016-09-05 Dmitry V. Levin <ldv (a] altlinux.org> 25673 25674 avr32: wire up preadv2 and pwritev2 syscalls. 25675 * linux/avr32/syscallent.h [326]: Add preadv2 entry. 25676 [327]: Add pwritev2 entry. 25677 25678 2016-09-05 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25679 25680 tests: check decoding of readahead syscall. 25681 * configure.ac (AC_CHECK_FUNCS): Add readahead. 25682 * tests/readahead.c: New file. 25683 * tests/readahead.test: New test. 25684 * tests/.gitignore: Add readahead. 25685 * tests/Makefile.am (check_PROGRAMS): Likewise. 25686 (DECODER_TESTS): Add readahead.test. 25687 25688 2016-09-02 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25689 25690 tests: move sprintrc function to libtests. 25691 * tests/tests.h (sprintrc): New prototype. 25692 * tests/futex.c (sprintrc): Move to ... 25693 * tests/sprintrc.c: ... new file. 25694 * tests/Makefile.am (libtests_a_SOURCES): Add sprintrc.c. 25695 25696 tests/futex: add support to sprintrc for return codes other than 0 and -1 25697 * tests/futex.c (sprintrc): Print the actual return code provided, 25698 not just "0". Check snprintf return code. 25699 25700 tests/futex: increase sprintrc static buffer size. 25701 * tests/futex.c (sprintrc): Increase buffer size from 256 to 4096. 25702 25703 tests/futex: rename retstr to sprintrc. 25704 * tests/futex.c (retstr): Rename to sprintrc. 25705 (main): Convert all retstr calls to sprintrc. 25706 25707 2016-09-01 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25708 25709 readahead: fix print format for the "count" argument. 25710 According to documentation and kernel's syscalls.h, its type is size_t, 25711 so "%lu" format should be used instead of "%ld". 25712 25713 * readahead.c (SYS_FUNC(readahead)): Fix conversion specifier 25714 for the "count" argument. 25715 25716 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 25717 25718 tests/xstatx.c: use zero_extend_signed_to_ull/sign_extend_unsigned_to_ll 25719 Use zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros 25720 instead of explicit casts with unpredictable sign extension semantics. 25721 25722 * tests/xstatx.c (print_time, main): Use zero_extend_signed_to_ull 25723 instead of explicit cast. 25724 (print_stat): Use zero_extend_signed_to_ull and 25725 sign_extend_unsigned_to_ll instead of explicit casts. 25726 25727 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 25728 25729 tests: add sign_extend_unsigned_to_ll macro. 25730 * tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h. 25731 25732 2016-08-31 Eugene Syromiatnikov <evgsyr (a] gmail.com> 25733 25734 Refactor common sa_handler printing code. 25735 * xlat/sa_handler_values.in: New file. 25736 * signal.c: Include "xlat/sa_handler_values.h". 25737 (get_sa_handler_str, print_sa_handler): New functions. 25738 (SYS_FUNC(sigsetmask), SYS_FUNC(signal), decode_new_sigaction): Use them. 25739 25740 2016-08-31 Dmitry V. Levin <ldv (a] altlinux.org> 25741 25742 Update TCP* constants. 25743 * xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux 25744 kernel commit v4.8-rc1~140^2~226. 25745 25746 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25747 25748 Update SCTP_* constants. 25749 * xlat/socksctpoptions.in: Add SCTP_PR_SUPPORTED, SCTP_DEFAULT_PRINFO, 25750 and SCTP_PR_ASSOC_STATUS introduced by linux kernel commits 25751 v4.8-rc1~140^2~148^2~5, v4.8-rc1~140^2~148^2~4, and 25752 v4.8-rc1~140^2~148^2~3, respectively. 25753 25754 Update fs *_MAGIC constants. 25755 * xlat/fsmagic.in: Add BALLOON_KVM_MAGIC and ZSMALLOC_MAGIC introduced 25756 by linux kernel commits v4.8-rc1~147^2~82 and v4.8-rc1~147^2~74, 25757 respectively. 25758 25759 Update KEXEC_ARCH_* constants. 25760 * xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux 25761 kernel commit v4.8-rc1~16^2~41. 25762 25763 Update ETH_P_* constants. 25764 * xlat/ethernet_protocols.in: Add ETH_P_NCSI introduced by linux kernel 25765 commit v4.8-rc1~140^2~65^2~8. 25766 25767 Update BPF_* constants. 25768 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_CGROUP_ARRAY introduced 25769 by linux kernel commit v4.8-rc1~140^2~212^2~2. 25770 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_XDP introduced 25771 by linux kernel commit v4.8-rc1~140^2~64^2~10. 25772 25773 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25774 25775 Remove HAVE_SIGACTION checks. 25776 The syscall parsers guarded by HAVE_SIGACTION check have to be compiled 25777 regardless of libc sigaction function availability. 25778 25779 * configure.ac (AC_CHECK_FUNCS): Remove sigaction. 25780 * signal.c: Remove HAVE_SIGACTION checks. 25781 25782 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25783 25784 Remove obsolescent autoconf macro AC_TYPE_SIGNAL. 25785 All supported systems are expected to have C89 conforming sematics. 25786 25787 * configure.ac (AC_TYPE_SIGNAL): Remove. 25788 25789 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25790 25791 Remove obsolescent autoconf macro AC_C_CONST. 25792 All supported systems are expected to have the 'const' keyword. 25793 25794 * configure.ac (AC_C_CONST): Remove. 25795 25796 2016-08-30 Eugene Syromiatnikov <evgsyr (a] gmail.com> 25797 25798 tests: check decoding of futex syscall. 25799 * tests/futex.c: New file. 25800 * tests/futex.test: New test. 25801 * tests/.gitignore: Add futex. 25802 * tests/Makefile.am (check_PROGRAMS): Likewise. 25803 (DECODER_TESTS): Add futex.test. 25804 25805 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25806 25807 futex: do not pretend <linux/futex.h> is included. 25808 As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is 25809 never defined and therefore the inclusion of <linux/futex.h> guarded by 25810 HAVE_LINUX_FUTEX_H makes no sense. 25811 25812 Moreover, <linux/futex.h> used to have an incorrect definition 25813 of FUTEX_WAIT_BITSET_PRIVATE and FUTEX_WAKE_BITSET_PRIVATE: 25814 since kernel commit v2.6.24-6320-gcd68998 where these definitions 25815 were initially introduced and up to v2.6.31-7082-gf8d1e54 where they 25816 were finally fixed these macros had been incorrectly defined via 25817 FUTEX_WAIT_BITS and FUTEX_WAKE_BITS instead of FUTEX_WAIT_BITSET 25818 and FUTEX_WAKE_BITSET, and these incorrect definitions made their way 25819 into some distributions still in use. 25820 25821 * futex.c [HAVE_LINUX_FUTEX_H]: Remove. 25822 25823 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25824 25825 futex: avoid printing val when it is not used by the futex command. 25826 This is analogous to timeout argument omitting in FUTEX_WAKE_BITSET 25827 command. 25828 25829 * futex.c (SYS_FUNC(futex)): Remove common printing of val argument. 25830 Add printing of val argument for all futex commands except 25831 FUTEX_LOCK_PI, FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI. 25832 25833 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25834 25835 xlat: add FUTEX_WAIT* commands with FUTEX_CLOCK_REALTIME bit set. 25836 * xlat/futexops.in: Add FUTEX_WAIT|FUTEX_CLOCK_REALTIME and 25837 FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME values supported by linux kernel 25838 since commit v4.5-rc1~172^2. 25839 25840 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25841 25842 futex: fix formatting of unknown command argument. 25843 Use alternate form for printing hexadecimal numbers to avoid confusion. 25844 Use printaddr to print uaddr as the latter is interpreted as a pointer 25845 in all currently supported futex operations. 25846 25847 * futex.c (SYS_FUNC(futex)): Fix formatting of unknown command 25848 argument. 25849 25850 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25851 25852 futex: add handling of FUTEX_FD command. 25853 Since obsolete FUTEX_FD command is known and used to have some expected 25854 argument format, print FUTEX_FD using that format. 25855 25856 * futex.c (SYS_FUNC(futex)): Handle FUTEX_FD command. 25857 25858 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25859 25860 futex: fix formatting of val3 hexadecimal argument. 25861 * futex.c (SYS_FUNC(futex)): In FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET, 25862 print hexadecimal val3 argument in alternate form to avoid confusion. 25863 25864 2016-08-30 Eugene Syromyatnikov <evgsyr (a] gmail.com> 25865 25866 futex: fix FUTEX_WAKE_OP compare function mask. 25867 According to the initial and current (v4.7) kernel implementations, 25868 in FUTEX_WAKE_OP case the compare function does not have 25869 FUTEX_OP_OPARG_SHIFT flag and occupies 4 bits starting with bit 24. 25870 25871 * futex.c (SYS_FUNC(futex)): Do not print FUTEX_OP_OPARG_SHIFT 25872 for 27th bit of val3 in FUTEX_WAKE_OP case. 25873 25874 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25875 25876 tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c. 25877 * bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS. 25878 * tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: 25879 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 25880 to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC. 25881 [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: 25882 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 25883 to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC. 25884 [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]: 25885 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 25886 to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC. 25887 [USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]: 25888 Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC 25889 to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC. 25890 25891 Based on patch by James Clarke <jrtc27 (a] jrtc27.com>. 25892 25893 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25894 25895 Remove redundant check for PTRACE_LISTEN availability. 25896 As ptrace.h already ensures that PTRACE_LISTEN is defined, 25897 there is no need to check this fact in other places. 25898 25899 * strace.c (ptrace_restart): Do not check that PTRACE_LISTEN is defined. 25900 25901 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25902 25903 Remove unused autoconf macro AC_TYPE_GETGROUPS. 25904 strace code does not use GETGROUPS_T. 25905 25906 * configure.ac (AC_TYPE_GETGROUPS): Remove. 25907 25908 2016-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 25909 25910 Remove unused autoconf macro AC_TYPE_MODE_T. 25911 strace code already redefines mode_t. 25912 25913 * configure.ac (AC_TYPE_MODE_T): Remove. 25914 25915 2016-08-30 James Clarke <jrtc27 (a] jrtc27.com> 25916 25917 Use PTRACE_SUNDETACH everywhere on SPARC and SPARC64. 25918 SPARC has a different PTRACE_DETACH value correctly defined in 25919 sys/ptrace.h, but linux/ptrace.h clobbers it with the standard one. 25920 PTRACE_SUNDETACH is also defined to the correct value by sys/ptrace.h, 25921 so use that instead. 25922 25923 * strace.c (detach) [SPARC]: Move redefinition of PTRACE_DETACH 25924 to PTRACE_SUNDETACH ... 25925 * ptrace.h [SPARC || SPARC64]: ... here. 25926 25927 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 25928 25929 Remove obsolescent autoconf macro AC_HEADER_STDC. 25930 All systems supported by strace are expected to have C89 conforming 25931 header files. 25932 25933 * configure.ac (AC_HEADER_STDC): Remove. 25934 25935 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 25936 25937 Remove unneeded autoconf macro AC_HEADER_DIRENT. 25938 strace code already includes <dirent.h> unconditionally. 25939 25940 * configure.ac (AC_HEADER_DIRENT): Remove. 25941 25942 2016-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 25943 25944 Remove unneeded autoconf macro AC_HEADER_STDBOOL. 25945 strace code assumes C99. 25946 25947 * configure.ac (AC_HEADER_STDBOOL): Remove. 25948 * defs.h: Include <stdbool.h> unconditionally. 25949 25950 2016-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 25951 25952 Remove obsolescent autoconf macro AC_HEADER_STAT. 25953 No systems supported by strace are expected to have the bug workarounded 25954 by AC_HEADER_STAT macro. 25955 25956 * configure.ac (AC_HEADER_STAT): Remove. 25957 25958 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 25959 25960 Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally. 25961 glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated 25962 inclusion of <sys/sysmacros.h> by <sys/types.h>. The method used 25963 for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer 25964 defines MAJOR_IN_SYSMACROS, which consequently breaks build. 25965 25966 Let's assume that all systems supported by strace provide major, minor, 25967 and makedev macros via <sys/sysmacros.h>. 25968 25969 * configure.ac (AC_HEADER_MAJOR): Remove. 25970 * mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove. 25971 Include <sys/sysmacros.h> unconditionally. 25972 * print_struct_stat.c: Likewise. 25973 * tests/mknod.c: Likewise. 25974 * tests/mknodat.c: Likewise. 25975 * tests/xstatx.c: Likewise. 25976 25977 2016-08-29 Dmitry V. Levin <ldv (a] altlinux.org> 25978 25979 btrfs: mpersify struct btrfs_ioctl_vol_args_v2. 25980 This complements commit v4.11-719-gfb0c609. 25981 25982 * btrfs.c (struct_btrfs_ioctl_vol_args_v2): New type. Mpersify it. 25983 (btrfs_print_qgroup_inherit): Change qgi_addr type to unsigned long. 25984 (btrfs_ioctl): Replace struct btrfs_ioctl_vol_args_v2 with 25985 struct_btrfs_ioctl_vol_args_v2. 25986 25987 2016-08-29 Elvira Khabirova <lineprinter0 (a] gmail.com> 25988 25989 mpers.awk: relax union member name absence check. 25990 This fixes mpersing of unions containing nameless members, 25991 e.g. struct btrfs_ioctl_vol_args_v2. 25992 25993 * mpers.awk (what_is): Print names of union_type members as is. 25994 25995 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 25996 25997 Revert "tests/xstatx.c: fix stat syscall tests on mips64" 25998 Previous commit effectively changed types of st_atime, st_ctime, and 25999 st_mtime members of struct stat and struct stat64 to signed integers, 26000 making the mips64 workaround obsolete. 26001 26002 This reverts commit 3fb84bfc79949c145197c61fbf04ce18464e9112. 26003 26004 * tests/xstatx.c (create_sample) [__mips64]: Remove. 26005 26006 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26007 26008 Mpersify parsers of struct stat and struct stat64. 26009 On many architectures that support multiple personalities, 26010 struct stat differ between personalities. While old code could handle 26011 these differences, there are some architectures, e.g. sparc64, that also 26012 have different struct stat64. Rewrite parsers using mpers functionality 26013 to fix these issues. 26014 26015 * fetch_struct_stat.c: New file. 26016 * fetch_struct_stat64.c: Likewise. 26017 * print_struct_stat.c: Likewise. 26018 * oldstat.c: Likewise. 26019 * stat.c: Likewise. 26020 * stat.h: Likewise. 26021 * stat64.c: Likewise. 26022 * file.c: Remove. 26023 * printstat.h: Likewise. 26024 * linux/aarch64/stat32.h: Likewise. 26025 * linux/powerpc64/stat32.h: Likewise. 26026 * linux/riscv/stat32.h: Likewise. 26027 * linux/sparc64/stat32.h: Likewise. 26028 * linux/tile/stat32.h: Likewise. 26029 * linux/x32/stat32.h: Likewise. 26030 * linux/x86_64/stat32.h: Likewise. 26031 * Makefile.am (strace_SOURCES): Add fetch_struct_stat.c, 26032 fetch_struct_stat64.c, print_struct_stat.c, oldstat.c, stat.c, stat.h, 26033 and stat64.c. Remove file.c, printstat.h, linux/aarch64/stat32.h, 26034 linux/powerpc64/stat32.h, linux/riscv/stat32.h, linux/sparc64/stat32.h, 26035 linux/tile/stat32.h, linux/x32/stat32.h, and linux/x86_64/stat32.h. 26036 * configure.ac (AC_CHECK_MEMBERS): Add struct stat64.st_mtime_nsec. 26037 * defs.h (struct strace_stat): New declaration. 26038 (print_struct_stat): New prototype. 26039 * linux/dummy.h (sys_fstatat64): Remove. 26040 26041 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26042 26043 mpers.m4: check for struct stat64, struct stat, and their members. 26044 * m4/mpers.m4 (st_MPERS_STRUCT_STAT): New macro. 26045 (st_MPERS): Use it. 26046 26047 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26048 26049 mpers: add MPERS_IS_* to CFLAGS passed to mpers.sh. 26050 This allows testing of MPERS_IS_* macros in pre-MPERS_DEFS parts 26051 of source code. 26052 26053 * Makefile.am (mpers-m%.stamp): Add -DMPERS_IS_$(mpers_NAME) to CFLAGS 26054 passed to mpers.sh. 26055 * mpers_test.sh: Likewise. 26056 26057 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26058 26059 Move redefinition of stat types to asm_stat.h. 26060 * file.c: Move redefinition of types that might be used 26061 to define struct stat ... 26062 * linux/asm_stat.h: ... here. 26063 * tests/xstatx.c: Remove redefinition of stat types. 26064 26065 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26066 26067 x86_64: provide a replacement of <asm/stat.h> for x32 personality. 26068 For the reason described in commit v4.10-517-gcfde1e3, a correct 26069 definition of struct stat for x32 personality is necessary to enable 26070 "asm_stat.h" with -mx32 on x86_64. 26071 26072 * linux/x32/asm_stat.h: Rename to ... 26073 * linux/x86_64/asm_stat.h: ... new file. 26074 * Makefile.am (strace_SOURCES): Add it. 26075 * linux/x32/asm_stat.h: New file, include "x86_64/asm_stat.h". 26076 26077 2016-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 26078 26079 x32/asm_stat.h: provide definitions for i386 personality. 26080 This enables x32/asm_stat.h with -m32. 26081 26082 * linux/x32/asm_stat.h [__x86_64__ && __ILP32__]: Redirect stat. 26083 Include "linux/asm_stat.h". 26084 (struct stat): Define for [__x86_64__ && __ILP32__] only. 26085 (struct __old_kernel_stat): Remove. 26086 26087 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 26088 26089 Introduce a separate SEN entry for fstatat64 syscall. 26090 * linux/dummy.h (sys_fstatat64): Redirect to sys_newfstatat. 26091 * linux/32/syscallent.h: Replace SEN(newfstatat) with SEN(fstatat64). 26092 * linux/alpha/syscallent.h: Likewise. 26093 * linux/arm/syscallent.h: Likewise. 26094 * linux/avr32/syscallent.h: Likewise. 26095 * linux/bfin/syscallent.h: Likewise. 26096 * linux/hppa/syscallent.h: Likewise. 26097 * linux/i386/syscallent.h: Likewise. 26098 * linux/m68k/syscallent.h: Likewise. 26099 * linux/microblaze/syscallent.h: Likewise. 26100 * linux/mips/syscallent-o32.h: Likewise. 26101 * linux/powerpc/syscallent.h: Likewise. 26102 * linux/s390/syscallent.h: Likewise. 26103 * linux/sh/syscallent.h: Likewise. 26104 * linux/sh64/syscallent.h: Likewise. 26105 * linux/sparc/syscallent.h: Likewise. 26106 * linux/sparc64/syscallent.h: Likewise. 26107 * linux/xtensa/syscallent.h: Likewise. 26108 * pathtrace.c (pathtrace_match): Handle SEN_fstatat64. 26109 26110 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 26111 26112 Do not check for struct stat.st_{a,c}time_nsec. 26113 Assume that the check for struct stat.st_mtime_nsec is enough. 26114 Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec. 26115 26116 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec, 26117 struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec, 26118 and struct stat.st_ctim.tv_nsec. 26119 * file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC, 26120 HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove. 26121 * printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC, 26122 HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with 26123 HAVE_STRUCT_STAT_ST_MTIME_NSEC. 26124 * tests/xstatx.c: Likewise. 26125 26126 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 26127 26128 Add sign_extend_unsigned_to_ll macro. 26129 * defs.h (sign_extend_unsigned_to_ll): New macro, mirrors 26130 zero_extend_signed_to_ull. 26131 26132 zero_extend_signed_to_ull: add short int support. 26133 * defs.h (zero_extend_signed_to_ull): Add short int support. 26134 * tests/tests.h: Likewise. 26135 26136 Rename widen_to_ull to zero_extend_signed_to_ull. 26137 * defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull. 26138 All callers changed. 26139 * tests/tests.h: Likewise. 26140 26141 2016-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 26142 26143 sparc, sparc64: remove obsolete code. 26144 Remove remains of solaris personality support. 26145 This complements commit v4.10-45-gdf4dd8b. 26146 26147 * file.c [SPARC || SPARC64] (SYS_FUNC(xstat), SYS_FUNC(fxstat)): Remove. 26148 26149 2016-08-22 Dmitry V. Levin <ldv (a] altlinux.org> 26150 26151 sparc64: fix decoding of struct stat64 related syscalls. 26152 For some reason, struct stat and struct stat64 are different on sparc64. 26153 This change fixes decoding of struct stat64 related syscalls for sparc64 26154 personality, sparc32 personality on sparc64 needs more work. 26155 26156 * file.c (printstat64) [SPARC64]: Do not use printstat. 26157 (SYS_FUNC(newfstatat)): Likewise. 26158 26159 2016-08-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 26160 26161 tests: fill old_value argument in timer{,fd}_xettime tests. 26162 This is needed in order to differentiate it from the value returned 26163 by the call. As a consequence, it enables revealing possible bugs 26164 in syscall parsers, for example, when the value read on syscall 26165 entering and not on syscall exiting, as it was the case with 26166 timerfd_settime parser. 26167 26168 * tests/timer_xettime.c (main): Fill old.its field with value different 26169 from the expected one upon call return. 26170 * tests/timerfd_xettime.c: Likewise. 26171 26172 2016-08-22 Eugene Syromyatnikov <evgsyr (a] gmail.com> 26173 26174 Fix old_value argument retrieval in timerfd_settime parser. 26175 This is done similar to timer_settime syscall parser. 26176 26177 * time.c (SYS_FUNC(timerfd_settime)): Retrieve old_value argument 26178 on exiting and not on entering. Return 0 instead of RVAL_DECODED 26179 since the call hasn't been decoded in full on entering. 26180 26181 2016-08-21 Richard W.M. Jones <rjones (a] redhat.com> 26182 26183 Add RISC-V architecture support. 26184 The original port of strace was done by Palmer Dabbelt 26185 (eecs.berkeley.edu), based on strace 4.9. 26186 26187 * configure.ac: Define RISCV for riscv*. 26188 * clone.c [RISCV]: Define ARG_* macros as for OR1K. 26189 * defs.h [RISCV] (SUPPORTED_PERSONALITIES): Define to 2. 26190 [RISCV] (NEED_UID16_PARSERS): Define to 1. 26191 * linux/riscv/arch_regs.c: New file. 26192 * linux/riscv/errnoent1.h: Likewise. 26193 * linux/riscv/get_error.c: Likewise. 26194 * linux/riscv/get_scno.c: Likewise. 26195 * linux/riscv/get_syscall_args.c: Likewise. 26196 * linux/riscv/ioctls_arch0.h: Likewise. 26197 * linux/riscv/ioctls_arch1.h: Likewise. 26198 * linux/riscv/ioctls_inc0.h: Likewise. 26199 * linux/riscv/ioctls_inc1.h: Likewise. 26200 * linux/riscv/signalent1.h: Likewise. 26201 * linux/riscv/stat32.h: Likewise. 26202 * linux/riscv/syscallent.h: Likewise. 26203 * linux/riscv/syscallent1.h: Likewise. 26204 * Makefile.am (EXTRA_DIST): Add them. 26205 26206 2016-08-21 Eugene Syromyatnikov <evgsyr (a] gmail.com> 26207 26208 Move SH-specific argument number calculation to getllval. 26209 This change prevents scattering of ll-related hacks and simplifies 26210 pread/pwrite syscalls parsers' logic a bit. 26211 26212 * util.c (getllval): Add fixup for arg_no for SuperH when argument 26213 number is equal to 3. 26214 * io.c (PREAD_OFFSET_ARG): Remove. 26215 (SYS_FUNC(pread)): Always use argument number 3 for "count" argument 26216 printing. 26217 (SYS_FUNC(pwrite)): Likewise. 26218 26219 2016-08-21 Dmitry V. Levin <ldv (a] altlinux.org> 26220 26221 sparc64: fix sigreturn decoding for sparc personality. 26222 * linux/sparc/arch_sigreturn.c (arch_sigreturn): Parametrize 26223 member types of struct signal_frame. 26224 * linux/sparc64/arch_sigreturn.c (sparc64_arch_sigreturn, 26225 sparc32_arch_sigreturn): New functions. 26226 (arch_sigreturn): Use them. 26227 26228 2016-08-20 Dmitry V. Levin <ldv (a] altlinux.org> 26229 26230 Fix compat decoding of struct sigaction.sa_mask on big endian architectures 26231 * signal.c (decode_new_sigaction) [SUPPORTED_PERSONALITIES > 1 && 26232 SIZEOF_LONG > 4]: Use LONG_LONG to convert sa_mask from 32-bit 26233 struct sigaction to 64-bit struct sigaction. 26234 26235 2016-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 26236 26237 Fix decoding of indirect shmat's return code for non-native personalities 26238 * ipc_shm.c (SYS_FUNC(shmat)): Fetch current_wordsize bytes of data 26239 to obtain return code of indirect shmat subcall. 26240 26241 2016-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 26242 26243 sparc64: fix sparc personality decoding of mmap64's offset argument. 26244 * linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff. 26245 26246 2016-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 26247 26248 sparc64: fix decoding of the forth argument of semctl syscall. 26249 On sparc64, unlike all other architectures where semctl is an indirect 26250 ipc subcall, the forth argument is passed directly. 26251 26252 * ipc_sem.c (SYS_FUNC(semctl)) [SPARC64]: Print 4th argument without 26253 indirection in case of native personality. 26254 26255 2016-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 26256 26257 Add sparc64 specific ptrace constants. 26258 * xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64, 26259 PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64. 26260 26261 sparc64: fix sign extension bug of syscall args for sparc personality. 26262 * linux/sparc64/get_syscall_args.c (get_syscall_args): Zero-extend 26263 syscall args from 32 bit for sparc personality. 26264 26265 2016-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 26266 26267 sparc64: fix tty ioctl numbers. 26268 The structures defined in asm/termbits.h have the same size 26269 on sparc and sparc64. 26270 26271 * linux/sparc64/ioctls_arch0.h (TCGETS, TCGETS2, TCSETS, TCSETS2, 26272 TCSETSF, TCSETSF2, TCSETSW, TCSETSW2): Sync with 26273 linux/sparc/ioctls_arch0.h 26274 26275 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 26276 26277 evdev.c: fix typo in comment. 26278 26279 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 26280 26281 Drop support of dummy members of struct stat. 26282 As st_flags, st_fstype, and st_gen members of struct stat are not filled 26283 by the kernel, there is no use supporting them. 26284 26285 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_flags, 26286 struct stat.st_fstype, and struct stat.st_gen. 26287 * file.c [STAT32_PERSONALITY, HAVE_STRUCT_STAT64]: Do not undefine 26288 HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, 26289 and HAVE_STRUCT_STAT_ST_GEN. 26290 * printstat.h (DO_PRINTSTAT): Do not check for 26291 HAVE_STRUCT_STAT_ST_FLAGS, HAVE_STRUCT_STAT_ST_FSTYPE, 26292 and HAVE_STRUCT_STAT_ST_GEN. 26293 26294 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 26295 26296 Assume that struct stat contains st_blksize, st_blocks, and st_rdev. 26297 Our test suite already assumes that struct stat contains st_blksize, 26298 st_blocks, and st_rdev members, and there haven't been any complaints. 26299 26300 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_blksize, 26301 struct stat.st_blocks, and struct stat.st_rdev. 26302 * printstat.h (DO_PRINTSTAT): Do not check for 26303 HAVE_STRUCT_STAT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_BLOCKS, 26304 and HAVE_STRUCT_STAT_ST_RDEV. 26305 26306 2016-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 26307 26308 tests: fix pause.test when pause syscall is not available. 26309 * tests/pause.c (main): Fix expected output when pause syscall 26310 is not available. 26311 26312 2016-08-14 Dmitry V. Levin <ldv (a] altlinux.org> 26313 26314 powerpc64, sparc64: fix redefinitions of ARCH_PC_REG. 26315 This fixes compilation warning that ARCH_PC_REG is redefined. 26316 26317 * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Undefine before 26318 the new definition. 26319 * linux/sparc64/arch_regs.c (ARCH_PC_REG): Likewise. 26320 26321 2016-08-14 Dmitry V. Levin <ldv (a] altlinux.org> 26322 26323 s390x, x32: remove redundant definitions of ARCH_PC_REG. 26324 * linux/s390x/arch_regs.c (ARCH_PC_REG): Remove, it is already defined 26325 in just included linux/s390/arch_regs.c. 26326 * linux/x32/arch_regs.c (ARCH_PC_REG): Remove, it is already defined 26327 in just included linux/x86_64/arch_regs.c. 26328 26329 2016-08-13 Dmitry V. Levin <ldv (a] altlinux.org> 26330 26331 tests: check for leaks of placeholder descriptors. 26332 * tests/redirect-fds.c: New file. 26333 * tests/redirect-fds.test: New test. 26334 * tests/.gitignore: Add redirect-fds. 26335 * tests/Makefile.am (check_PROGRAMS): Likewise. 26336 (MISC_TESTS): Add redirect-fds.test. 26337 26338 tests/init.sh: print exit code of failed commands. 26339 * init.sh (run_prog, run_prog_skip_if_failed): When the program fails, 26340 add its exit code to the diagnostic message. 26341 (run_strace): When strace fails, add its exit code to the diagnostic 26342 message. 26343 (run_strace_merge): When strace-log-merge fails, add its exit code 26344 to the diagnostic message. 26345 26346 2016-08-13 Dmitry V. Levin <ldv (a] altlinux.org> 26347 26348 Fix leakage of placeholder descriptors to tracees. 26349 As a side effect of commit v4.11-211-g0736d4e, strace used to leak 26350 placeholders for standard descriptors to tracees thus affecting their 26351 behaviour. Fix this by setting close-on-exec flag on placeholder 26352 descriptors. 26353 26354 * strace.c (open_dummy_desc): Set close-on-exec flag on the descriptor 26355 that is going to be returned to the caller. 26356 (fd_is_placeholder): New array. 26357 (ensure_standard_fds_opened, redirect_standard_fds): New functions. 26358 (startup_child): Use redirect_standard_fds. 26359 (init): Use ensure_standard_fds_opened. 26360 26361 2016-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 26362 26363 sparc64: fix decoding of uid and gid-related syscalls. 26364 sparc64 has no native 16-bit uid/gid syscalls. 26365 26366 * linux/sparc64/syscallent.h (chown, lchown, setuid, getuid, setgid, 26367 getgid, geteuid, getegid, getgroups, setgroups, fchown, setreuid, 26368 setregid, setfsuid, setfsgid): Change handlers from 16-bit to 32-bit. 26369 26370 2016-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 26371 26372 tests: fix *stat64 tests on alpha. 26373 On some architectures including alpha, <asm/stat.h> provides a 26374 definition of struct stat that has no st_atime_nsec, st_mtime_nsec, and 26375 st_ctime_nsec fields. At the same time, struct stat64 always has these 26376 fields. Fix tests to take this difference into account. 26377 26378 * tests/fstat64.c (STRUCT_STAT_IS_STAT64): New macro, defined to 1. 26379 * tests/lstat64.c (STRUCT_STAT_IS_STAT64): Likewise. 26380 * tests/stat64.c (STRUCT_STAT_IS_STAT64): Likewise. 26381 * tests/xstatx.c [!STRUCT_STAT] (STRUCT_STAT_IS_STAT64): New macro, 26382 defined to 0. 26383 [USE_ASM_STAT && STRUCT_STAT_IS_STAT64]: 26384 (HAVE_STRUCT_STAT_ST_ATIME_NSEC, HAVE_STRUCT_STAT_ST_CTIME_NSEC, 26385 HAVE_STRUCT_STAT_ST_MTIME_NSEC): Redefine to 1. 26386 26387 2016-08-11 Dmitry V. Levin <ldv (a] altlinux.org> 26388 26389 tests: skip rt_tgsigqueueinfo.test when the syscall is not available. 26390 * tests/rt_tgsigqueueinfo.c (main): Skip the test when the syscall 26391 is not available. 26392 26393 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 26394 26395 tests/fcntl.c: fix fcntl test on mips64. 26396 On mips64 the F_GETLK and F_SETLKW64 constants have identical values which 26397 causes the "wrong" constant to be printed by strace. 26398 26399 tests/fcntl.c (test_flock64): Do not test F_SETLKW64 on mips64. 26400 26401 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 26402 26403 tests/nsyscalls.test: only trace the "syscall" syscall on mips o32. 26404 The "syscall" syscall only exists on o32 and causes strace to error out on 26405 64-bit mips ABIs. Pass MIPS_ABI from the configure script through to 26406 nsyscalls.test so the MIPS ABI can be checked. 26407 26408 * configure.ac (MIPS_ABI): Substitute into output files. 26409 * tests/Makefile.am (MIPS_ABI): Export via AM_TEST_LOG_FLAGS. 26410 * tests/nsyscalls.test: Restrict special mips handling to mips o32. 26411 26412 2016-08-11 James Cowgill <james410 (a] cowgill.org.uk> 26413 26414 tests/xstatx.c: fix stat syscall tests on mips64. 26415 For historical reasons the kernel struct stat represents times as unsigned 26416 32-bit integers on mips64. Therefore, while it's possible to give a file a 26417 timestamp before 1970 with futimens, reading the same timestamp through 26418 struct stat will give a positive time (around 2106). 26419 Workaround by using positive timestamps for testing on mips64. 26420 26421 * tests/xstatx.c (create_sample): Use positive timestamps on mips64. 26422 26423 2016-08-11 Dmitry V. Levin <ldv (a] altlinux.org> 26424 26425 tests/mlock2.c: fix test failure on mips64. 26426 * tests/mlock2.c (main): Pass unsigned long arguments to mlock2 syscall 26427 explicitly, to avoid unwanted sign extension issues. 26428 26429 Based on patch by James Cowgill <james410 (a] cowgill.org.uk> 26430 26431 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26432 26433 Use <asm/unistd.h> instead of <sys/syscall.h> 26434 There are no users of SYS_* macros provided by <sys/syscall.h>, 26435 and definitions of __NR_* macros could be obtained directly 26436 from <asm/unistd.h>. 26437 26438 * defs.h: Include <asm/unistd.h> instead of <sys/syscall.h>. 26439 * test/seccomp.c: Likewise. 26440 * test/threaded_execve.c: Likewise. 26441 * test/x32_lseek.c: Likewise. 26442 * test/x32_mmap.c: Likewise. 26443 * tests/_newselect.c: Likewise. 26444 * tests/access.c: Likewise. 26445 * tests/acct.c: Likewise. 26446 * tests/aio.c: Likewise. 26447 * tests/alarm.c: Likewise. 26448 * tests/attach-f-p.c: Likewise. 26449 * tests/bpf.c: Likewise. 26450 * tests/brk.c: Likewise. 26451 * tests/chmod.c: Likewise. 26452 * tests/chown.c: Likewise. 26453 * tests/chown32.c: Likewise. 26454 * tests/chroot.c: Likewise. 26455 * tests/clock_adjtime.c: Likewise. 26456 * tests/clock_nanosleep.c: Likewise. 26457 * tests/clock_xettime.c: Likewise. 26458 * tests/copy_file_range.c: Likewise. 26459 * tests/creat.c: Likewise. 26460 * tests/dup2.c: Likewise. 26461 * tests/dup3.c: Likewise. 26462 * tests/epoll_create.c: Likewise. 26463 * tests/epoll_create1.c: Likewise. 26464 * tests/epoll_ctl.c: Likewise. 26465 * tests/epoll_pwait.c: Likewise. 26466 * tests/epoll_wait.c: Likewise. 26467 * tests/eventfd.c: Likewise. 26468 * tests/execveat.c: Likewise. 26469 * tests/faccessat.c: Likewise. 26470 * tests/fchdir.c: Likewise. 26471 * tests/fchmod.c: Likewise. 26472 * tests/fchmodat.c: Likewise. 26473 * tests/fchown.c: Likewise. 26474 * tests/fchown32.c: Likewise. 26475 * tests/fchownat.c: Likewise. 26476 * tests/fcntl.c: Likewise. 26477 * tests/fcntl64.c: Likewise. 26478 * tests/fdatasync.c: Likewise. 26479 * tests/flock.c: Likewise. 26480 * tests/fstat.c: Likewise. 26481 * tests/fstat64.c: Likewise. 26482 * tests/fstatat64.c: Likewise. 26483 * tests/fstatfs.c: Likewise. 26484 * tests/fstatfs64.c: Likewise. 26485 * tests/fsync.c: Likewise. 26486 * tests/ftruncate.c: Likewise. 26487 * tests/ftruncate64.c: Likewise. 26488 * tests/futimesat.c: Likewise. 26489 * tests/get_mempolicy.c: Likewise. 26490 * tests/getcwd.c: Likewise. 26491 * tests/getdents.c: Likewise. 26492 * tests/getdents64.c: Likewise. 26493 * tests/getegid.c: Likewise. 26494 * tests/getegid32.c: Likewise. 26495 * tests/geteuid.c: Likewise. 26496 * tests/geteuid32.c: Likewise. 26497 * tests/getgid.c: Likewise. 26498 * tests/getgid32.c: Likewise. 26499 * tests/getgroups.c: Likewise. 26500 * tests/getgroups32.c: Likewise. 26501 * tests/getpgrp.c: Likewise. 26502 * tests/getrandom.c: Likewise. 26503 * tests/getresgid.c: Likewise. 26504 * tests/getresgid32.c: Likewise. 26505 * tests/getresuid.c: Likewise. 26506 * tests/getresuid32.c: Likewise. 26507 * tests/getrlimit.c: Likewise. 26508 * tests/getrusage.c: Likewise. 26509 * tests/getuid.c: Likewise. 26510 * tests/getuid32.c: Likewise. 26511 * tests/getxxid.c: Likewise. 26512 * tests/ioctl_uffdio.c: Likewise. 26513 * tests/ioperm.c: Likewise. 26514 * tests/iopl.c: Likewise. 26515 * tests/ipc.c: Likewise. 26516 * tests/kill.c: Likewise. 26517 * tests/lchown.c: Likewise. 26518 * tests/lchown32.c: Likewise. 26519 * tests/libmmsg.c: Likewise. 26520 * tests/libsocketcall.c: Likewise. 26521 * tests/link.c: Likewise. 26522 * tests/linkat.c: Likewise. 26523 * tests/llseek.c: Likewise. 26524 * tests/lseek.c: Likewise. 26525 * tests/lstat.c: Likewise. 26526 * tests/lstat64.c: Likewise. 26527 * tests/mbind.c: Likewise. 26528 * tests/membarrier.c: Likewise. 26529 * tests/memfd_create.c: Likewise. 26530 * tests/migrate_pages.c: Likewise. 26531 * tests/mkdir.c: Likewise. 26532 * tests/mkdirat.c: Likewise. 26533 * tests/mknod.c: Likewise. 26534 * tests/mknodat.c: Likewise. 26535 * tests/mlock.c: Likewise. 26536 * tests/mlock2.c: Likewise. 26537 * tests/move_pages.c: Likewise. 26538 * tests/newfstatat.c: Likewise. 26539 * tests/nsyscalls.c: Likewise. 26540 * tests/old_mmap.c: Likewise. 26541 * tests/oldselect.c: Likewise. 26542 * tests/open.c: Likewise. 26543 * tests/openat.c: Likewise. 26544 * tests/pause.c: Likewise. 26545 * tests/poll.c: Likewise. 26546 * tests/prctl-seccomp-filter-v.c: Likewise. 26547 * tests/prctl-seccomp-strict.c: Likewise. 26548 * tests/preadv2-pwritev2.c: Likewise. 26549 * tests/prlimit64.c: Likewise. 26550 * tests/pselect6.c: Likewise. 26551 * tests/ptrace.c: Likewise. 26552 * tests/readdir.c: Likewise. 26553 * tests/readlink.c: Likewise. 26554 * tests/readlinkat.c: Likewise. 26555 * tests/reboot.c: Likewise. 26556 * tests/remap_file_pages.c: Likewise. 26557 * tests/rename.c: Likewise. 26558 * tests/renameat.c: Likewise. 26559 * tests/renameat2.c: Likewise. 26560 * tests/rmdir.c: Likewise. 26561 * tests/rt_sigpending.c: Likewise. 26562 * tests/rt_sigprocmask.c: Likewise. 26563 * tests/rt_sigsuspend.c: Likewise. 26564 * tests/rt_sigtimedwait.c: Likewise. 26565 * tests/rt_tgsigqueueinfo.c: Likewise. 26566 * tests/sched_get_priority_mxx.c: Likewise. 26567 * tests/sched_rr_get_interval.c: Likewise. 26568 * tests/sched_xetaffinity.c: Likewise. 26569 * tests/sched_xetattr.c: Likewise. 26570 * tests/sched_xetparam.c: Likewise. 26571 * tests/sched_xetscheduler.c: Likewise. 26572 * tests/sched_yield.c: Likewise. 26573 * tests/seccomp-filter-v.c: Likewise. 26574 * tests/seccomp-filter.c: Likewise. 26575 * tests/seccomp-strict.c: Likewise. 26576 * tests/select.c: Likewise. 26577 * tests/sendfile.c: Likewise. 26578 * tests/sendfile64.c: Likewise. 26579 * tests/set_mempolicy.c: Likewise. 26580 * tests/setdomainname.c: Likewise. 26581 * tests/setfsgid.c: Likewise. 26582 * tests/setfsgid32.c: Likewise. 26583 * tests/setfsuid.c: Likewise. 26584 * tests/setfsuid32.c: Likewise. 26585 * tests/setgid.c: Likewise. 26586 * tests/setgid32.c: Likewise. 26587 * tests/setgroups.c: Likewise. 26588 * tests/setgroups32.c: Likewise. 26589 * tests/sethostname.c: Likewise. 26590 * tests/setregid.c: Likewise. 26591 * tests/setregid32.c: Likewise. 26592 * tests/setresgid.c: Likewise. 26593 * tests/setresgid32.c: Likewise. 26594 * tests/setresuid.c: Likewise. 26595 * tests/setresuid32.c: Likewise. 26596 * tests/setreuid.c: Likewise. 26597 * tests/setreuid32.c: Likewise. 26598 * tests/setrlimit.c: Likewise. 26599 * tests/setuid.c: Likewise. 26600 * tests/setuid32.c: Likewise. 26601 * tests/signalfd4.c: Likewise. 26602 * tests/socketcall.c: Likewise. 26603 * tests/splice.c: Likewise. 26604 * tests/stat.c: Likewise. 26605 * tests/stat64.c: Likewise. 26606 * tests/statfs.c: Likewise. 26607 * tests/statfs64.c: Likewise. 26608 * tests/swap.c: Likewise. 26609 * tests/symlink.c: Likewise. 26610 * tests/symlinkat.c: Likewise. 26611 * tests/sync.c: Likewise. 26612 * tests/sync_file_range.c: Likewise. 26613 * tests/sync_file_range2.c: Likewise. 26614 * tests/syslog.c: Likewise. 26615 * tests/tee.c: Likewise. 26616 * tests/time.c: Likewise. 26617 * tests/timer_create.c: Likewise. 26618 * tests/timer_xettime.c: Likewise. 26619 * tests/timerfd_xettime.c: Likewise. 26620 * tests/times-fail.c: Likewise. 26621 * tests/times.c: Likewise. 26622 * tests/truncate.c: Likewise. 26623 * tests/truncate64.c: Likewise. 26624 * tests/ugetrlimit.c: Likewise. 26625 * tests/umount.c: Likewise. 26626 * tests/umount2.c: Likewise. 26627 * tests/uname.c: Likewise. 26628 * tests/unix-pair-send-recv.c: Likewise. 26629 * tests/unlink.c: Likewise. 26630 * tests/unlinkat.c: Likewise. 26631 * tests/userfaultfd.c: Likewise. 26632 * tests/utimes.c: Likewise. 26633 * tests/vhangup.c: Likewise. 26634 * tests/vmsplice.c: Likewise. 26635 * tests/waitid.c: Likewise. 26636 * tests/waitpid.c: Likewise. 26637 * tests/xet_robust_list.c: Likewise. 26638 * tests/xetpgid.c: Likewise. 26639 * tests/xetpriority.c: Likewise. 26640 * tests/xettimeofday.c: Likewise. 26641 26642 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26643 26644 ia64: replace SYS_clone2 with __NR_clone2. 26645 Migrate to __NR_* the last user of SYS_* macros provided 26646 by <sys/syscall.h>. 26647 26648 * clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace 26649 SYS_clone2 with __NR_clone2. 26650 26651 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26652 26653 Make sure that tcp->s_ent and tcp->s_prev_ent do not point to freed memory 26654 This complements commit v4.13-33-g60d7ec8. 26655 26656 * syscall.c (sysent_buf): New structure. 26657 (free_sysent_buf): New function. 26658 (get_scno): Use them. 26659 26660 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26661 26662 file.c: move definitions of struct stat32 to separate files. 26663 * linux/aarch64/stat32.h: New file. 26664 * linux/powerpc64/stat32.h: Likewise. 26665 * linux/sparc64/stat32.h: Likewise. 26666 * linux/tile/stat32.h: Likewise. 26667 * linux/x32/stat32.h: Likewise. 26668 * linux/x86_64/stat32.h: Likewise. 26669 * Makefile.am (EXTRA_DIST): Add them. 26670 * file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions 26671 of struct stat32, include "stat32.h" instead. 26672 26673 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26674 26675 sparc, sparc64: remove obsolete code. 26676 Remove remains of solaris personality support. 26677 This complements commit v4.10-45-gdf4dd8b. 26678 26679 * file.c [SPARC || SPARC64]: Remove the code related to struct solstat. 26680 (printstat, printoldstat) [SPARC || SPARC64]: Remove. 26681 26682 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26683 26684 sparc64: fix decoding of stat family syscalls. 26685 This complements commit v4.13-28-gaebfe83. 26686 26687 * file.c [SPARC64]: Change STAT32_PERSONALITY to 1. 26688 26689 2016-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 26690 26691 Fix decoding of invalid syscalls mapped to indirect subcalls. 26692 When the syscall number returned by arch_get_scno is a mapped indirect 26693 subcall (i.e. mapped subcall of socketcall or ipc syscall), do not 26694 mistakenly treat it as a valid indirect subcall. 26695 26696 * defs.h (SCNO_IS_VALID): Treat scno with TRACE_INDIRECT_SUBCALL flag 26697 as invalid. 26698 * syscall.c (syscall_name): Do no shuffle scno. 26699 (trace_syscall_entering, trace_syscall_exiting): Use 26700 tcp->s_ent->sys_name instead of syscall_name. 26701 (get_scno): In case of invalid syscall, allocate a dynamic struct sysent 26702 containing an appropriate .sys_name. 26703 * tests/nsyscalls.c (main) [SYS_socket_subcall]: Check decoding 26704 of direct syscall number SYS_socket_subcall+1. 26705 (main) [SYS_ipc_subcall]: Check decoding of direct syscall number 26706 SYS_ipc_subcall+1. 26707 26708 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 26709 26710 linux/subcall.h: remove redundant definitions. 26711 * linux/subcall.h: Remove definitions of non-existent socket 26712 and ipc subcalls. 26713 26714 defs.h: simplify SUPPORTED_PERSONALITIES definition. 26715 * defs.h: Group definition of SUPPORTED_PERSONALITIES by value. 26716 26717 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 26718 26719 defs.h: simplify PERSONALITY1_WORDSIZE definition. 26720 Move definition of PERSONALITY1_WORDSIZE macro outside arch specific 26721 ifdefs. 26722 26723 * defs.h [SPARC64 || X86_64 || X32 || AARCH64 || POWERPC64 || TILE] 26724 (PERSONALITY1_WORDSIZE): Remove. 26725 [SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_WORDSIZE): Define to 4 26726 unconditionally. 26727 26728 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 26729 26730 defs.h: simplify PERSONALITY0_WORDSIZE definition. 26731 Move definition of PERSONALITY0_WORDSIZE macro outside arch specific 26732 ifdefs. 26733 26734 * defs.h (PERSONALITY0_WORDSIZE): Define to SIZEOF_LONG unconditionally. 26735 26736 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 26737 26738 sparc64: swap personality numbers. 26739 Fix inconsistency between syscall and ioctl entries on sparc64. 26740 Make layout of personalities on sparc64 the same as on other 26741 architectures that support two personalities. 26742 26743 * defs.h [SPARC64] (PERSONALITY0_WORDSIZE): Change to 8. 26744 [SPARC64] (PERSONALITY1_WORDSIZE): Change to 4. 26745 * linux/sparc64/get_scno.c (arch_get_scno): Swap personality numbers. 26746 * linux/sparc64/ioctls_arch1.h: Rename to ioctls_arch0.h. 26747 * linux/sparc64/ioctls_arch0.h: Rename to ioctls_arch1.h. 26748 * linux/sparc64/ioctls_inc0.h: Rename to ioctls_inc1.h. 26749 * linux/sparc64/ioctls_inc1.h: Rename to ioctls_inc0.h. 26750 26751 2016-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 26752 26753 defs.h: cleanup personality specific macro definitions. 26754 Move the code that defines PERSONALITY[12]_INCLUDE_FUNCS, 26755 PERSONALITY[12]_INCLUDE_PRINTERS_DECLS, 26756 PERSONALITY[12]_INCLUDE_PRINTERS_DEFS, and MPERS_{m,mx}32_IOCTL_MACROS 26757 macros outside arch specific ifdefs. 26758 26759 * defs.h [SPARC] (PERSONALITY0_WORDSIZE): Remove. 26760 [SPARC64 && HAVE_M32_MPERS]: Remove. 26761 [X86_64 && HAVE_M32_MPERS]: Remove. 26762 [X86_64 && HAVE_MX32_MPERS]: Remove. 26763 [X32 && HAVE_M32_MPERS]: Remove. 26764 [AARCH64 && HAVE_M32_MPERS]: Remove. 26765 [POWERPC64 && HAVE_M32_MPERS]: Remove. 26766 [TILE && HAVE_M32_MPERS]: Remove. 26767 (PERSONALITY0_INCLUDE_PRINTERS_DECLS, 26768 PERSONALITY0_INCLUDE_PRINTERS_DEFS): Define unconditionally. 26769 [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] 26770 (PERSONALITY1_INCLUDE_PRINTERS_DECLS, 26771 PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_FUNCS, 26772 MPERS_m32_IOCTL_MACROS): Define for 26773 [SUPPORTED_PERSONALITIES > 1 && HAVE_M32_MPERS] case. 26774 (PERSONALITY2_INCLUDE_PRINTERS_DECLS, 26775 PERSONALITY2_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_FUNCS, 26776 MPERS_mx32_IOCTL_MACROS): Define for 26777 [SUPPORTED_PERSONALITIES > 2 && HAVE_MX32_MPERS] case. 26778 26779 2016-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 26780 26781 Change #include guard trailing part comments. 26782 * defs.h: Change comment of the trailing part of #include guard. 26783 * flock.h: Likewise. 26784 * gcc_compat.h: Likewise. 26785 * ipc_defs.h: Likewise. 26786 * kernel_types.h: Likewise. 26787 * mpers_type.h: Likewise. 26788 * msghdr.h: Likewise. 26789 * printsiginfo.h: Likewise. 26790 * ptrace.h: Likewise. 26791 * regs.h: Likewise. 26792 * seccomp_fprog.h: Likewise. 26793 * sigevent.h: Likewise. 26794 * statfs.h: Likewise. 26795 * xlat.h: Likewise. 26796 26797 2016-08-08 Eugene Syromyatnikov <evgsyr (a] gmail.com> 26798 26799 Unify usage of #include guards. 26800 This commit is an attempt to unify usage of include guards (in top-level 26801 headers, at least). As a side note, different files with *.h extension 26802 have different semantics: for example, printargs.h is included multiple 26803 times in order to generate slightly varying code depending on values of 26804 macro definitions - maybe it's better to change extension of such files 26805 to something like *.inc. 26806 26807 * defs.h: Add #include guard. 26808 * flock.h: Likewise. 26809 * ipc_defs.h: Likewise. 26810 * mpers_type.h: Likewise. 26811 * printsiginfo.h: Likewise. 26812 * ptrace.h: Likewise. 26813 * regs.h: Likewise. 26814 * seccomp_fprog.h: Likewise. 26815 * gcc_compat.h: Rename the macro used for #include guard. 26816 * msghdr.h: Likewise. 26817 * sigevent.h: Likewise. 26818 * kernel_types.h: Comment the trailing part of #include guard. 26819 * xlat.h: Add missing macro definition for #include guard. 26820 26821 2016-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 26822 26823 tests: add #include guards. 26824 * tests/tests.h: Add #include guard. 26825 26826 2016-08-05 Dmitry V. Levin <ldv (a] altlinux.org> 26827 26828 linux: add #include guards. 26829 * linux/dummy.h: Add #include guard. 26830 * linux/inet_diag.h: Likewise. 26831 * linux/netlink_diag.h: Likewise. 26832 * linux/sock_diag.h: Likewise. 26833 * linux/syscall.h: Likewise. 26834 * linux/unix_diag.h: Likewise. 26835 26836 2016-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 26837 26838 tests/umode_t.c: guard against libc printf format errors. 26839 * tests/umode_t.c (test_syscall): Use different printf format specifiers 26840 to detect libc printf format errors. 26841 26842 2016-08-04 Dmitry V. Levin <ldv (a] altlinux.org> 26843 26844 travis: use a suitable musl revision. 26845 There seems to be no readily available binary packages of musl that are 26846 sufficiently up to date to be used to build and test strace, so prepare 26847 a suitable musl from source. 26848 26849 * travis-install.sh (musl-gcc): Do not add an extra repository, 26850 do not install musl-tools and linux-musl-dev packages. 26851 Download, build, and install a suitable musl revision instead. 26852 26853 2016-08-03 Dmitry V. Levin <ldv (a] altlinux.org> 26854 26855 Fix printing of mode_t, umode_t, and umask types. 26856 Print numeric umode_t type using %#03ho format. 26857 Print return value of umask syscall using %#03lo format. 26858 When printing symbolic mode_t type, always print lower 9 bits, 26859 and print the numeric part using %#03o format. 26860 26861 * defs.h (sprintmode): Remove. 26862 (print_symbolic_mode_t, print_numeric_umode_t, 26863 print_numeric_long_umask): New prototypes. 26864 * printmode.c (sprintmode): Remove. 26865 (print_symbolic_mode_t, print_numeric_umode_t, 26866 print_numeric_long_umask): New functions. 26867 * chmod.c (decode_chmod): Use print_numeric_umode_t. 26868 * ipc_msg.c (SYS_FUNC(msgget)): Likewise. 26869 * ipc_msgctl.c (print_msqid_ds): Likewise. 26870 * ipc_sem.c (SYS_FUNC(semget)): Likewise. 26871 * ipc_shm.c (SYS_FUNC(shmget)): Likewise. 26872 * ipc_shmctl.c (print_shmid_ds): Likewise. 26873 * mq.c (SYS_FUNC(mq_open)): Likewise. 26874 * open.c (decode_open, SYS_FUNC(creat)): Likewise. 26875 * umask.c (SYS_FUNC(umask)): Likewise. 26876 * mknod.c (decode_mknod): Use print_symbolic_mode_t. 26877 * printstat.h (DO_PRINTSTAT): Likewise. 26878 * syscall.c (trace_syscall_exiting): Use print_numeric_long_umask. 26879 * tests/umode_t.c: New file. 26880 * tests/Makefile.am (EXTRA_DIST): Add it. 26881 * tests/creat.c: Rewrite as a thin wrapper around umode_t.c 26882 * tests/mkdir.c: Likewise. 26883 * tests/mkdirat.c: Likewise. 26884 * tests/mknod.c: Extend test coverage of mknod syscall. 26885 * tests/mknodat.c: Extend test coverage of mknodat syscall. 26886 * tests/umask.c: Extend test coverage of umask syscall. 26887 * tests/creat.test: Update the value specified for strace -a parameter. 26888 * tests/mkdir.test: Likewise. 26889 * tests/mkdirat.test: Likewise. 26890 * tests/mknodat.test: Likewise. 26891 26892 2016-08-02 Dmitry V. Levin <ldv (a] altlinux.org> 26893 26894 tests: simplify attach-f-p.test. 26895 * tests/attach-f-p.c Simplify communications between threads 26896 by replacing per-thread timers with pipes. 26897 * tests/attach-f-p.test: Do not ignore signals. 26898 26899 tests: cleanup attach-p-cmd.test. 26900 * tests/attach-p-cmd-cmd.c (main): Cleanup expected output. 26901 * tests/attach-p-cmd-p.c (main): Print expected output. 26902 * tests/attach-p-cmd.test: Do not print expected output. 26903 26904 ip_mreq.test: rewrite from match_grep to match_diff. 26905 * tests/ip_mreq.c (main): Print expected output. 26906 * tests/ip_mreq.test: Use run_strace_match_diff. 26907 * tests/ip_mreq.expected: Remove. 26908 * tests/Makefile.am (EXTRA_DIST): Remove it. 26909 26910 fanotify_mark.test: rewrite from match_grep to match_diff. 26911 * tests/fanotify_mark.c (main): Print expected output. 26912 * tests/fanotify_mark.test: Use run_strace_match_diff. 26913 * tests/fanotify_mark.expected: Remove. 26914 * tests/Makefile.am (EXTRA_DIST): Remove it. 26915 26916 signalfd4.test: rewrite from match_grep to match_diff. 26917 * tests/signalfd4.c (get_sigset_size): New function. 26918 (main): Use it. Print expected output. 26919 * tests/signalfd4.test: Use run_strace_match_diff. 26920 * tests/signalfd4.expected: Remove. 26921 * tests/Makefile.am (EXTRA_DIST): Remove it. 26922 26923 2016-07-31 Dmitry V. Levin <ldv (a] altlinux.org> 26924 26925 tests: rename signalfd.test to signalfd4.test. 26926 * tests/signalfd.c: Rename to signalfd4.c. 26927 * tests/signalfd.test: Rename to signalfd4.test. 26928 * tests/signalfd.expected: Rename to signalfd4.expected. 26929 * tests/.gitignore: Replace signalfd with signalfd4. 26930 * tests/Makefile.am (check_PROGRAMS): Likewise. 26931 (DECODER_TESTS): Replace signalfd.test with signalfd4.test. 26932 (EXTRA_DIST): Replace signalfd.expected with signalfd4.expected. 26933 26934 2016-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 26935 26936 memfd_create.test: rewrite from match_grep to match_diff. 26937 * tests/memfd_create.c (main): Print expected output. 26938 * tests/memfd_create.test: Use run_strace_match_diff. 26939 * tests/memfd_create.expected: Remove. 26940 * tests/Makefile.am (EXTRA_DIST): Remove it. 26941 26942 2016-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 26943 26944 Set exit status to 1 if strace has not traced any processes. 26945 * strace.c (main): Initialize exit_code with 1 when no processes 26946 has been attached. 26947 * strace.1: Document it. 26948 * NEWS: Mention this change. 26949 26950 Attach to the target process before attempting to attach to its siblings 26951 * strace.c (attach_tcb): Attach to tcp->pid first. 26952 26953 Report the name of ptrace command when ptrace_attach_or_seize fails. 26954 * strace.c (ptrace_attach_cmd): New variable. 26955 (ptrace_attach_or_seize): Save last ptrace command's name 26956 to ptrace_attach_cmd. 26957 (attach_tcb, startup_child): Use it in error diagnostics. 26958 26959 strace.c: refactor startup_attach. 26960 * strace.c (startup_attach): Move the inner part of the big loop 26961 over tcbtab elements ... 26962 (attach_tcb): ... to this new function. 26963 26964 startup_attach: do not use atoi. 26965 * strace.c (startup_attach): Replace atoi with string_to_uint. 26966 26967 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 26968 26969 Do not enable mpers runtime checks if mpers is not enabled. 26970 * m4/mpers.m4 (HAVE_RUNTIME): Enable iff both mpers and runtime 26971 work properly. 26972 26973 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 26974 26975 linux/dummy_check.sh: remove obsolete script. 26976 Starting with commit v4.10-62-ga0bd374, function prototypes 26977 of syscall parsers are generated at build time. 26978 26979 * linux/dummy_check.sh: Remove. 26980 26981 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 26982 26983 generate_xlat_in.sh: remove obsolete script. 26984 This script has been created by commit v4.8-180-g0ed617b 26985 for the one-shot job of automatic convertion of xlat structures 26986 from *.c files to xlat/*.in files. 26987 26988 * generate_xlat_in.sh: Remove. 26989 26990 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 26991 26992 tests: use terse notation in designated initializers where appropriate. 26993 * tests/btrfs.c (btrfs_test_dev_replace_ioctl): Initialize 26994 struct btrfs_ioctl_dev_replace_args using terse notation. 26995 * tests/clock_nanosleep.c (main): Initialize struct timespec 26996 using terse notation. 26997 * tests/nanosleep.c (main): Likewise. 26998 26999 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 27000 27001 Consistently use extended regular expressions where appropriate. 27002 When grep or sed is used with basic regular expressions containing 27003 '(', ')', '{', '}', '|', '?', and '+' special characters, convert them 27004 to extended regular expressions for better portability and readability. 27005 27006 * generate_mpers_am.sh: Convert grep and sed BREs to EREs. 27007 * Makefile.am (ioctl_redefs%.h, m%_type_defs.h, m%_funcs.h, 27008 mpers_printer_decl_pattern, printers.h, %_printer_decls.h, 27009 %_printer_defs.h): Convert sed BREs to EREs. 27010 * generate_sen.sh: Likewise. 27011 * linux/mips/genstub.sh: Likewise. 27012 * make-dsc: Likewise. 27013 * mpers.sh: Likewise. 27014 * xlat/gen.sh: Likewise. 27015 * tests/Makefile.am (ksysent.h): Likewise. 27016 * tests/ksysent.sed: Likewise. 27017 * tests/pc.test: Likewise. 27018 * tests/strace-S.test: Likewise. 27019 * tests/strace-V.test: Likewise. 27020 * tests/strace-k.test: Likewise. 27021 27022 2016-07-28 Dmitry V. Levin <ldv (a] altlinux.org> 27023 27024 tests: fix extended regexps. 27025 * tests/adjtimex.c (main): Consistently quote curly braces 27026 in expected output. 27027 * tests/uio.expected: Likewise. 27028 27029 2016-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 27030 27031 Post-release administrivia. 27032 * NEWS: Add header line for the next release. 27033 * debian/changelog.in: Add a changelog entry for 4.13-1. 27034 * strace.spec.in: Likewise. 27035 27036 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 27037 27038 Prepare for 4.13 release. 27039 * NEWS: Update for 4.13 release. 27040 27041 Fix one more code pattern that might break gcc strict aliasing rules. 27042 * btrfs.c (btrfs_ioctl): Add one more expicit cast to "void *", 27043 to avoid breaking strict-aliasing rules reported by some gcc compilers. 27044 * syscall.c (decode_socket_subcall): Likewise. 27045 * util.c (next_set_bit): Likewise. 27046 * tests/btrfs.c (btrfs_test_send_ioctl): Likewise. 27047 27048 Fix casts of ptrace's third argument. 27049 * strace.c (maybe_allocate_tcb): Replace "(char *) 0" with NULL 27050 as ptrace's third argument. 27051 * linux/sparc64/get_scno.c (arch_get_scno): Cast third argument 27052 of ptrace to "void *'. 27053 * syscall.c (get_regs): Likewise. 27054 * upeek.c (upeek): Likewise. 27055 * util.c (umoven): Likewise. 27056 27057 tests/btrfs.c: do not include the same header file twice. 27058 * tests/btrfs.c: Do not include <sys/fcntl.h>, <fcntl.h> is enough. 27059 27060 tests: fix accept4.test on systems that lack SOCK_CLOEXEC definition. 27061 * tests/accept4.c: Check that O_CLOEXEC is defined. Use O_CLOEXEC 27062 instead of SOCK_CLOEXEC. 27063 27064 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 27065 27066 tests: fix vhangup.test. 27067 * tests/vhangup.c (main): Fix expected output for the case when 27068 the calling process has CAP_SYS_TTY_CONFIG capability. 27069 27070 Reported-by: Yun-Chih Chen <b03902074 (a] ntu.edu.tw> 27071 27072 2016-07-26 Dmitry V. Levin <ldv (a] altlinux.org> 27073 27074 tests: fix chown.test. 27075 * tests/chown.test: Fix the value specified for strace -a parameter. 27076 27077 Reported-by: Yun-Chih Chen <b03902074 (a] ntu.edu.tw> 27078 27079 2016-07-25 Dmitry V. Levin <ldv (a] altlinux.org> 27080 27081 x32: fix syscall entries for x86_64 variants of io_setup and io_submit. 27082 * linux/x32/syscallent.h (64:io_setup, 64:io_submit): Change handler 27083 to printargs. 27084 27085 tests/ipc.c: fix typo. 27086 27087 2016-07-24 Dmitry V. Levin <ldv (a] altlinux.org> 27088 27089 NEWS: Prepare for 4.13 release. 27090 27091 2016-07-23 Dmitry V. Levin <ldv (a] altlinux.org> 27092 27093 debian: add gcc-multilib to Build-Depends for relevant architectures. 27094 * debian/control (Build-Depends) [amd64, ppc64, sparc64, x32]: 27095 Add gcc-multilib to enable multiple personalities support. 27096 27097 2016-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 27098 27099 tests: check decoding of ipc syscall. 27100 * tests/ipc.c: New file. 27101 * tests/ipc.test: New test. 27102 * tests/.gitignore: Add ipc. 27103 * tests/Makefile.am (check_PROGRAMS): Likewise. 27104 (DECODER_TESTS): Add ipc.test. 27105 27106 Fix corner cases of ipc syscall decoding. 27107 * xlat/ipccalls.in: New file. 27108 * ipc.c: New file. 27109 * Makefile.am (libstrace_a_SOURCES): Add it. 27110 * linux/dummy.h (sys_ipc): Remove stub alias. 27111 * syscall.c (decode_ipc_subcall): Treat 1st argument of ipc syscall 27112 as "unsigned int". 27113 [S390 || S390X]: Skip ipc cubcalls that have non-zero version. 27114 [SPARC64]: Likewise, for the native personality. 27115 Save ipc cubcall version for later use by specific ipc parsers. 27116 * ipc_msg.c (SYS_FUNC(msgrcv)): Handle non-zero ipc subcall version. 27117 [SPARC64]: Handle non-ipc_kludge case for the native personality. 27118 * linux/subcall.h (msgrcv): Change nargs from 4 to 5. 27119 * linux/s390/syscallent.h (ipc): Change nargs from 6 to 5. 27120 * linux/s390x/syscallent.h (ipc): Likewise. 27121 27122 2016-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 27123 27124 tests: skip netlink_protocol.test on old systems. 27125 * tests/netlink_protocol.c: Check that HAVE_SYS_XATTR_H is defined. 27126 Include <stdlib.h> and <sys/xattr.h>. 27127 (main): Check that system.sockprotoname attribute is supported. 27128 27129 Do not print too many arguments of socketcall syscall. 27130 * socketcall.c (SYS_FUNC(socketcall)): Print just "call" and "args" 27131 syscall arguments. 27132 * tests/socketcall.c (test_socketcall): Update expected output. 27133 * tests/socketcall.test: Likewise. 27134 27135 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 27136 27137 tests/nsyscalls.c: change the type of syscall arguments to kernel_ulong_t 27138 As most syscalls on x32 and mips n32 are actually 64-bit, 27139 check that 64-bit syscall arguments are decoded properly. 27140 27141 This also workarounds x32 gcc sign extension bug 27142 reported by Eugene Syromyatnikov at 27143 https://sourceforge.net/p/strace/mailman/message/35150860/ 27144 27145 * tests/nsyscalls.c: Include "kernel_types.h". 27146 (main): Change the type of syscall arguments to kernel_ulong_t. 27147 27148 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 27149 27150 x32, mips n32: make printargs print full 64-bit syscall arguments. 27151 As most of x32 syscalls are regular x86_64 syscalls, they should be 27152 printed by default as 64-bit syscalls, and syscall parsers at their 27153 discretion might print syscalls differently. This is already 27154 implemented in 64-bit strace tracing x32 personality processes, 27155 and now x32 strace will also behave this way. 27156 27157 Similar reasoning applies to mips n32. 27158 27159 * util.c (printargs) [HAVE_STRUCT_TCB_EXT_ARG]: Print syscall arguments 27160 from ext_arg array using %llx format. 27161 27162 2016-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 27163 27164 tests: check decoding of socketcall syscall. 27165 * tests/socketcall.c: New file. 27166 * tests/socketcall.test: New test. 27167 * tests/.gitignore: Add socketcall. 27168 * tests/Makefile.am (check_PROGRAMS): Likewise. 27169 (DECODER_TESTS): Add socketcall.test. 27170 27171 Fix corner cases of socketcall syscall. 27172 * xlat/socketcalls.in: New file. 27173 * socketcall.c: New file. 27174 * Makefile.am (libstrace_a_SOURCES): Add it. 27175 * linux/dummy.h (sys_socketcall): Remove stub alias. 27176 * syscall.c (decode_socket_subcall): Treat 1st argument of socketcall 27177 as "int". Do not substitute syscall until all socketcall arguments 27178 have been fetched successfully. 27179 27180 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 27181 27182 tests: check decoding and dumping of send and recv syscalls. 27183 * tests/unix-pair-send-recv.c: New file. 27184 * tests/unix-pair-send-recv.expected: Likewise. 27185 * tests/unix-pair-send-recv.test: New test. 27186 * tests/.gitignore: Add unix-pair-send-recv. 27187 * tests/Makefile.am (check_PROGRAMS): Likewise. 27188 (DECODER_TESTS): Add unix-pair-send-recv.test. 27189 (EXTRA_DIST): Add unix-pair-send-recv.expected. 27190 27191 tests: rename unix-pair-send-recv to unix-pair-sendto-recvfrom. 27192 * dumpio.expected: Rename to unix-pair-sendto-recvfrom.expected. 27193 * dumpio.test: Rename to unix-pair-sendto-recvfrom.test. 27194 * unix-pair-send-recv.c: Rename to unix-pair-sendto-recvfrom.c 27195 * .gitignore: Rename unix-pair-send-recv to unix-pair-sendto-recvfrom. 27196 * Makefile.am (check_PROGRAMS): Likewise. 27197 (DECODER_TESTS): Add unix-pair-sendto-recvfrom.test. 27198 (MISC_TESTS): Remove dumpio.test. 27199 (EXTRA_DIST): Rename dumpio.expected 27200 to unix-pair-sendto-recvfrom.expected. 27201 27202 tests: check decoding of shutdown syscall. 27203 * tests/shutdown.c: New file. 27204 * tests/shutdown.test: New test. 27205 * tests/.gitignore: Add shutdown. 27206 * tests/Makefile.am (check_PROGRAMS): Likewise. 27207 (DECODER_TESTS): Add shutdown.test. 27208 27209 xlat/shutdown_modes.in: convert to modern syntax. 27210 * xlat/shutdown_modes.in: Replace open-coded xlat table with a list 27211 of constants. 27212 27213 tests: check silent decoding of sendmmsg and recvmmsg syscalls. 27214 * tests/mmsg-silent.c: New file. 27215 * tests/mmsg-silent.test: New test. 27216 * tests/.gitignore: Add mmsg-silent. 27217 * tests/Makefile.am (check_PROGRAMS): Likewise. 27218 (DECODER_TESTS): Add mmsg-silent.test. 27219 27220 Print unsent messages of failed sendmmsg syscall. 27221 * mmsghdr.c (decode_mmsgvec): Clear syserror for the time of printing 27222 struct mmsghdr array in !use_msg_len case. 27223 (SYS_FUNC(sendmmsg)): As failed sendmmsg syscall does not 27224 set msg_len fields, tell this to decode_mmsgvec. 27225 * tests/mmsg_name.c (test_mmsg_name): Check it. 27226 27227 Print unsent messages of sendmmsg syscall. 27228 * defs.h (decode_mmsgvec): Add int argument. 27229 * mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field. 27230 (print_struct_mmsghdr): Print struct mmsghdr.msg_len only for 27231 msg_len_vlen first elements of struct mmsghdr array. 27232 (decode_mmsgvec): Add msg_len_vlen argument. 27233 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec 27234 the number of elements of struct mmsghdr array that contain meaningful 27235 struct mmsghdr.msg_len. 27236 * tests/mmsg_name.c (test_mmsg_name): Check it. 27237 27238 tests: check verbose decoding of msg_name* fields of struct mmsghdr array 27239 * tests/mmsg_name-v.c: New file. 27240 * tests/mmsg_name-v.test: New test. 27241 * tests/.gitignore: Add mmsg_name-v. 27242 * tests/Makefile.am (check_PROGRAMS): Likewise. 27243 (DECODER_TESTS): Add mmsg_name-v.test. 27244 27245 tests: check decoding of msg_name* fields of struct mmsghdr array. 27246 * tests/mmsg_name.c: New file. 27247 * tests/mmsg_name.test: New test. 27248 * tests/.gitignore: Add mmsg_name. 27249 * tests/Makefile.am (check_PROGRAMS): Likewise. 27250 (DECODER_TESTS): Add mmsg_name.test. 27251 27252 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 27253 27254 Fix decoding of msg_name* fields of recvmmsg syscall's msghdr array argument 27255 As msg_namelen fields of recvmmsg syscall's struct msghdr array have 27256 the same read-write semantics as struct msghdr argument of recvmsg 27257 syscall, parser of recvmmsg syscall needs a similar fix. 27258 27259 * mmsghdr.c (print_struct_mmsghdr): Increment p_user_msg_namelen field. 27260 (mmsgvec_data): New structure. 27261 (free_mmsgvec_data, save_mmsgvec_namelen): New functions. 27262 (decode_mmsgvec): Take into account the data saved 27263 by save_mmsgvec_namelen function. 27264 (SYS_FUNC(recvmmsg)): Use save_mmsgvec_namelen. 27265 27266 2016-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 27267 27268 mmsghdr.c: rewrite decode_mmsgvec using print_array. 27269 * fetch_struct_mmsghdr.c (sizeof_struct_mmsghdr): New mpers printer. 27270 * mmsghdr.c: Include <limits.h>. 27271 (print_struct_mmsghdr_config): New structure. 27272 (fetch_struct_mmsghdr_or_printaddr, print_struct_mmsghdr): New functions. 27273 (decode_mmsgvec): Rewrite using them and print_array. 27274 27275 tests: check decoding of timeout argument of recvmmsg syscall. 27276 * tests/recvmmsg-timeout.c: New file. 27277 * tests/recvmmsg-timeout.test: New test. 27278 * tests/.gitignore: Add recvmmsg-timeout. 27279 * tests/Makefile.am (check_PROGRAMS): Likewise. 27280 (DECODER_TESTS): Add recvmmsg-timeout.test. 27281 27282 Fix printing of remaining timeout of recvmmsg syscall. 27283 * mmsghdr.c (SYS_FUNC(recvmmsg)): Do not print remaining timeout 27284 when the 5th syscall argument is NULL. 27285 * tests/mmsg.c (main): Update expected output. 27286 27287 Remove configure checks for recvmmsg and sendmmsg. 27288 * configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg. 27289 27290 tests: add recv_mmsg and send_mmsg functions to libtests. 27291 * tests/tests.h (recv_mmsg, send_mmsg): New prototype. 27292 * tests/libmmsg.c: New file. 27293 * tests/Makefile.am (libtests_a_SOURCES): Add it. 27294 * tests/mmsg.c Do not check for __NR_sendmmsg, __NR_recvmmsg, 27295 HAVE_SENDMMSG, and HAVE_RECVMMSG. Do not include unused headers. 27296 (recv_mmsg, send_mmsg): Remove. 27297 27298 tests: add socketcall function to libtests. 27299 * tests/tests.h (socketcall): New prototype. 27300 * tests/libsocketcall.c: New file. 27301 * tests/Makefile.am (libtests_a_SOURCES): Add it. 27302 27303 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 27304 27305 Use IOV_MAX instead of UIO_MAXIOV. 27306 IOV_MAX appears to be more portable than UIO_MAXIOV. 27307 27308 * msghdr.c: Include <limits.h>. Remove fallback defintion of UIO_MAXIOV. 27309 (get_optmem_max): Replace UIO_MAXIOV with IOV_MAX. 27310 * tests/msg_control.c: Likewise. 27311 27312 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 27313 27314 Unabuse struct tcb.auxstr. 27315 As we've got a proper mechanism that parsers can use for storing private 27316 data between entering and exiting stages, all cases of struct tcb.auxstr 27317 abuse should go. 27318 27319 * btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong 27320 instead of abusing tcp->auxstr. 27321 * file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise. 27322 * msghdr.c (SYS_FUNC(recvmsg)): Likewise. 27323 * net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise. 27324 * v4l2.c (print_v4l2_queryctrl): Likewise. 27325 27326 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 27327 27328 Fix race condition in decoding timeout argument of recvmmsg syscall. 27329 As the value returned by sprint_timespec points to a static area and may 27330 be overwritten by subsequent calls to sprint_timespec, it is not safe to 27331 save this value on entering syscall and use it later on exiting. 27332 27333 * mmsghdr.c (SYS_FUNC(recvmmsg)): On entering syscall, copy the value 27334 returned by sprint_timespec to a dynamically allocated memory, and save 27335 the pointer using set_tcb_priv_data. On exiting, restore it using 27336 get_tcb_priv_data. 27337 27338 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 27339 27340 Fix race condition in decoding rt_sigtimedwait's timeout argument. 27341 As the value returned by sprint_timespec points to a static area and may 27342 be overwritten by subsequent calls to sprint_timespec, it is not safe to 27343 save this value on entering syscall and use it later on exiting. 27344 27345 * signal.c (SYS_FUNC(rt_sigtimedwait)): On entering syscall, copy the 27346 value returned by sprint_timespec to a dynamically allocated memory, 27347 and save the pointer using set_tcb_priv_data. On exiting, restore it 27348 using get_tcb_priv_data. 27349 27350 2016-07-18 Patrik Jakobsson <patrik.jakobsson (a] linux.intel.com> 27351 27352 Add private data field to struct tcb. 27353 We need to be able to store private data in the struct tcb across it's 27354 lifetime. To ensure proper deallocation of this stored data a callback 27355 must be provided along with the data. The callback is executed 27356 automatically on exiting syscall, and when the life of the tcb ends. 27357 27358 * defs.h (struct tcb): Add _priv_data and _free_priv_data fields. 27359 (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): 27360 New prototypes. 27361 (get_tcb_priv_ulong, set_tcb_priv_ulong): New static inline functions. 27362 * strace.c (get_tcb_priv_data, set_tcb_priv_data, free_tcb_priv_data): 27363 New functions. 27364 (droptcb): Call free_tcb_priv_data. 27365 * syscall.c (trace_syscall_exiting): Call free_tcb_priv_data 27366 when clearing TCB_INSYSCALL flag. 27367 27368 2016-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 27369 27370 net.c: move parsers of sendmsg and recvmsg syscalls to msghdr.c. 27371 * defs.h (fetch_msghdr_namelen, decode_msghdr): Remove. 27372 * net.c (SYS_FUNC(sendmsg), SYS_FUNC(recvmsg)): Move ... 27373 * msghdr.c: ... here. 27374 (fetch_msghdr_namelen, decode_msghdr): Add static qualifier. 27375 27376 net.c: move parsers of sendmmsg and recvmmsg syscalls to mmsghdr.c. 27377 * defs.h (decode_mmsgvec): Remove. 27378 * net.c: Do not include "msghdr.h". 27379 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Move ... 27380 * mmsghdr.c: ... here. 27381 (decode_mmsgvec): Add static qualifier. 27382 27383 msghdr.c: move all mmsghdr parsers to a separate file. 27384 * msghdr.h (print_struct_msghdr): New prototype. 27385 * msghdr.c (print_msghdr): Rename to print_struct_msghdr, remove 27386 static qualifier, all callers changed. 27387 (decode_mmsghdr, decode_mmsgvec, dumpiov_in_mmsghdr): Move to ... 27388 * mmsghdr.c: ... new file. 27389 * Makefile.am (strace_SOURCES): Add it. 27390 27391 2016-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 27392 27393 tests: disable part of msg_name test on non-glibc systems. 27394 Sadly, musl recvmsg wrapper blindly dereferences 2nd argument, 27395 so limit the affected part of the test to glibc that doesn't. 27396 27397 * tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test 27398 with inaccessible 2nd argument. 27399 27400 2016-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 27401 27402 Print struct iovec as a regular structure. 27403 * io.c (print_iovec): Print names of iov_base and iov_len fields. 27404 * tests/aio.c (main): Update expected output. 27405 * tests/inet-cmsg.c (main): Likewise. 27406 * tests/mmsg.c (main): Likewise. 27407 * tests/msg_name.c (test_msg_name): Likewise. 27408 * tests/preadv-pwritev.c (main): Likewise. 27409 * tests/preadv2-pwritev2.c (main): Likewise. 27410 * tests/preadv.c (main): Likewise. 27411 * tests/pwritev.c (main): Likewise. 27412 * tests/readv.c (main): Likewise. 27413 * tests/recvmsg.c (main): Likewise. 27414 * tests/vmsplice.c (main): Likewise. 27415 * tests/scm_rights-fd.test: Likewise. 27416 * tests/uio.expected: Likewise. 27417 27418 tests: check decoding of msghdr.msg_name* arguments of recvmsg syscall. 27419 * tests/msg_name.c: New file. 27420 * tests/msg_name.test: New test. 27421 * tests/.gitignore: Add msg_name. 27422 * tests/Makefile.am (check_PROGRAMS): Likewise. 27423 (DECODER_TESTS): Add msg_name.test. 27424 27425 2016-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 27426 27427 Fix decoding of struct msghdr.msg_name* arguments of recvmsg syscall. 27428 As the msghdr.msg_namelen argument of recvmsg syscall has the same 27429 read-write semantics as the address length argument of recvfrom syscall, 27430 parser of recvmsg syscall needs a similar fix. 27431 27432 * defs.h (fetch_msghdr_namelen): New prototype. 27433 (decode_msghdr): Add "int *" argument. 27434 * msghdr.c (print_msghdr): Likewise. Treat it as a pointer to struct 27435 msghdr.msg_namelen passed to the kernel. Pass to decode_sockaddr 27436 the size of socket address actually returned by the kernel. 27437 Print both user and kernel address lengths when the value changes. 27438 (decode_msghdr, decode_mmsghdr): Add "int *" argument, 27439 forward it to print_msghdr. 27440 (decode_mmsgvec): Update decode_mmsghdr invocation. 27441 (fetch_msghdr_namelen): New function. 27442 * net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation. 27443 (SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save 27444 struct msghdr.msg_namelen. On exiting, pass the saved value 27445 to decode_msghdr. 27446 27447 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 27448 27449 Update generic ioctl entries from linux 4.7. 27450 * linux/64/ioctls_inc.h: Update from linux v4.7 using ioctls_gen.sh. 27451 * linux/32/ioctls_inc_align32.h: Likewise. 27452 * linux/32/ioctls_inc_align64.h: Likewise. 27453 27454 2016-07-12 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 27455 27456 x32: update ioctl entries from linux 4.7. 27457 * linux/x32/ioctls_inc0.h: Update from linux v4.7 using ioctls_gen.sh. 27458 27459 maint: update for linux 4.7. 27460 * maint/ioctls_sym.sh: Drop obsolete workarounds for linux/btrfs.h. 27461 27462 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 27463 27464 block.c: remove BLKDAXGET support. 27465 BLKDAXGET was removed by linux kernel commit v4.7-rc1~78^2^2~4. 27466 27467 * block.c: Do not define BLKDAXGET. 27468 (block_ioctl): Remove BLKDAXGET support. 27469 * tests/ioctl_block.c (main): Remove BLKDAXGET test. 27470 27471 2016-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 27472 27473 Fix printing of socklen argument of bind and sendto syscalls. 27474 * net.c (SYS_FUNC(bind)): Print 3rd syscall argument using %d format. 27475 (SYS_FUNC(sendto)): Print 6th syscall argument using %d format. 27476 27477 tests: check decoding of sockaddr related arguments of recvfrom syscall. 27478 * configure.ac (AC_CHECK_FUNCS): Add recvfrom. 27479 * tests/recvfrom.c: New file. 27480 * tests/recvfrom.test: New test. 27481 * tests/.gitignore: Add recvfrom. 27482 * tests/Makefile.am (check_PROGRAMS): Likewise. 27483 (DECODER_TESTS): Add recvfrom.test. 27484 27485 Fix decoding of sockaddr related arguments of recvfrom syscall. 27486 * net.c (SYS_FUNC(recvfrom)): Use fetch_socklen. Save the address 27487 length passed to the kernel and print it on error. Do not print more 27488 bytes of the socket address than actually returned by the kernel. 27489 Print both user and kernel address lengths when the returned address 27490 is truncated. 27491 27492 tests: check decoding of accept4 syscall. 27493 * configure.ac (AC_CHECK_FUNCS): Add accept4. 27494 * tests/accept4.c: New file. 27495 * tests/accept4.test: New test. 27496 * tests/.gitignore: Add accept4. 27497 * tests/Makefile.am (check_PROGRAMS): Likewise. 27498 (DECODER_TESTS): Add accept4.test. 27499 27500 tests: check decoding of accept syscall. 27501 * tests/accept.c: New file. 27502 * tests/accept.test: New test. 27503 * tests/.gitignore: Add accept. 27504 * tests/Makefile.am (check_PROGRAMS): Likewise. 27505 (DECODER_TESTS): Add accept.test. 27506 27507 tests: check decoding of getpeername syscall. 27508 * tests/getpeername.c: New file. 27509 * tests/getpeername.test: New test. 27510 * tests/.gitignore: Add getpeername. 27511 * tests/Makefile.am (check_PROGRAMS): Likewise. 27512 (DECODER_TESTS): Add getpeername.test. 27513 27514 tests: check decoding of getsockname syscall. 27515 * tests/getsockname.c: New file. 27516 * tests/getsockname.test: New test. 27517 * tests/sockname.c: New file. 27518 * tests/.gitignore: Add getsockname. 27519 * tests/Makefile.am (check_PROGRAMS): Likewise. 27520 (DECODER_TESTS): Add getsockname.test. 27521 (EXTRA_DIST): Add sockname.c. 27522 27523 Print both values of changing address length in sockname family syscalls 27524 * net.c (decode_sockname): Print both user and kernel address lengths 27525 when the value changes. 27526 * tests/net-y-unix.c (main): Update expected output. 27527 * tests/net-yy-unix.c (main): Likewise. 27528 * tests/net.expected: Likewise. 27529 27530 Enhance diagnostics of address truncation in sockname family syscalls. 27531 * net.c (decode_sockname): Print both user and kernel address lengths 27532 when the returned address is truncated. 27533 * tests/sun_path.expected: Update expected output. 27534 27535 Fix decoding of getsockname, getpeername, accept, and accept4 syscalls. 27536 * net.c (fetch_socklen): New function. 27537 (decode_sockname): Use it. On entering syscall, decode early 27538 and return RVAL_DECODED when possible. On error, print the address 27539 length passed to the kernel. Do not print more bytes of the socket 27540 address than actually returned by the kernel. 27541 27542 2016-07-11 Dmitry V. Levin <ldv (a] altlinux.org> 27543 27544 Prepare parsers of sockname family syscalls for the upcoming fix. 27545 * net.c (do_sockname): Rename to decode_sockname, drop second argument, 27546 do not print sock_type_flags, return RVAL_DECODED on exiting. 27547 (SYS_FUNC(accept), SYS_FUNC(getsockname)): Use decode_sockname instead 27548 of do_sockname, take its return code into account. 27549 (SYS_FUNC(accept4)): Likewise. Print sock_type_flags when 27550 decode_sockname returns RVAL_DECODED. 27551 27552 2016-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 27553 27554 netlink: handle multipart netlink messages. 27555 Handle multipart netlink messages made of multiple struct nlmsghdr 27556 headers with associated payload in one byte stream. 27557 27558 * netlink.c (fetch_nlmsghdr, print_nlmsghdr, 27559 decode_nlmsghdr_with_payload): New functions. 27560 (decode_netlink): Use them. 27561 * tests/netlink_parsing.c (send_query): Check them. 27562 27563 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 27564 27565 tests: extend netlink protocol check. 27566 * tests/netlink_protocol.c (send_query): Check that no part 27567 of netlink message is fetched beyond the end of message. 27568 Check decoding of zero address and zero length messages. 27569 Check decoding of messages with nlmsg_len exceeding message length. 27570 27571 2016-07-07 Fabien Siron <fabien.siron (a] epita.fr> 27572 27573 tests: check decoding of netlink protocol. 27574 * tests/netlink_protocol.test: New test. 27575 * tests/netlink_protocol.c: New file. 27576 * tests/.gitignore: Add netlink_protocol. 27577 * tests/Makefile.am (check_PROGRAMS): Likewise. 27578 (DECODER_TESTS): Add netlink_protocol.test. 27579 27580 2016-07-07 Fabien Siron <fabien.siron (a] epita.fr> 27581 27582 Add a general netlink socket parser. 27583 Introduce a general socket netlink parser which prints the header and 27584 a string for the remaining part of the buffer. It doesn't handle all 27585 the netlink flags and types yet because the parser needs more 27586 information, this will be implemented later. 27587 27588 * net.c (decode_sockbuf): New function. 27589 (SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)): 27590 Use it instead of printstr. 27591 * msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto() 27592 for netlink sockets. 27593 * netlink.c: New file. 27594 * Makefile.am (strace_SOURCES): Add it. 27595 * defs.h (decode_netlink, getfdproto): New prototypes. 27596 (iov_decode): Add IOV_DECODER_NETLINK. 27597 * io.c (print_iovec): Use decode_netlink(). 27598 * util.c (getfdproto): Remove static keyword. 27599 * xlat/netlink_flags.in: New file. 27600 * xlat/netlink_types.in: New file. 27601 27602 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 27603 27604 Update sigaltstack SS_* constants. 27605 * xlat/sigaltstack_flags.in: Add SS_AUTODISARM introduced 27606 by linux kernel commit v4.7-rc1~195^2. 27607 27608 Update fs *_MAGIC constants. 27609 * xlat/fsmagic.in: Add NSFS_MAGIC, TRACEFS_MAGIC, BPF_FS_MAGIC, 27610 and UDF_SUPER_MAGIC introduced by linux kernel commits 27611 v3.19-rc1~53^2~7^2~1, v4.1-rc1~147^2~4, v4.4-rc1~141^2~17^2~1, 27612 and v4.7-rc1~161^2, respectively. 27613 27614 2016-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 27615 27616 Update KEYCTL_* constants. 27617 * xlat/keyctl_commands.in: Add KEYCTL_DH_COMPUTE introduced 27618 by linux kernel commit v4.7-rc1~124^2~2^2~2^2. 27619 27620 Update input event constants. 27621 * xlat/evdev_keycode.in: Add KEY_* constants introduced 27622 by linux kernel commit v4.7-rc6~32^2~6^2. 27623 27624 2016-07-04 Dmitry V. Levin <ldv (a] altlinux.org> 27625 27626 Update RWF_* constants. 27627 * xlat/rwf_flags.in: Add RWF_DSYNC and RWF_SYNC introduced 27628 by linux kernel commit v4.7-rc1~158^2~1. 27629 27630 2016-07-07 Dmitry V. Levin <ldv (a] altlinux.org> 27631 27632 Update BPF_MAP_TYPE_* constants. 27633 * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_TRACEPOINT introduced 27634 by linux kernel commit v4.7-rc1~154^2~332^2~6. 27635 27636 2016-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 27637 27638 msghdr.c: limit output when printing excessively large messages. 27639 Limit output of struct msghdr.msg_control when 27640 struct msghdr.msg_controllen is greater than the maximum ancillary 27641 buffer size specified in /proc/sys/net/core/optmem_max file. 27642 27643 * configure.ac (AC_CHECK_FUNCS): Add open64. 27644 * defs.h (read_int_from_file): New prototype. 27645 * util.c (read_int_from_file): New function. 27646 * msghdr.c (get_optmem_max): New function based on read_int_from_file. 27647 (decode_msg_control): Use it to check control_len argument. 27648 * tests/msg_control.c (test_big_len): New function. 27649 (main): Use it to test printing of excessively large messages. 27650 27651 2016-07-03 Dmitry V. Levin <ldv (a] altlinux.org> 27652 27653 tests: add read_int_from_file function to libtests. 27654 * tests/overflowuid.c (read_int_from_file): New function. 27655 (check_overflow_id): Use it. 27656 * tests/tests.h (read_int_from_file): New prototype. 27657 27658 2016-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 27659 27660 msghdr.c: limit IP_RECVOPTS/IP_RETOPTS output in abbrev mode. 27661 * msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen 27662 bytes of ip options in abbrev mode. 27663 * tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN. 27664 (test_sol_ip): Test IP_RETOPTS output in abbrev mode. 27665 27666 msghdr.c: limit SCM_RIGHTS output in abbrev mode. 27667 * msghdr.c (print_scm_rights): Do not print more than max_strlen 27668 descriptors in abbrev mode. 27669 * tests/msg_control.c (DEFAULT_STRLEN): New macro. 27670 (print_fds): Use it. 27671 (test_scm_rights3): New function. 27672 (main): Use it to test SCM_RIGHTS output in abbrev mode. 27673 * tests/msg_control-v.c: New file. 27674 * tests/msg_control-v.test: New test. 27675 * tests/.gitignore: Add msg_control-v. 27676 * tests/Makefile.am (check_PROGRAMS): Likewise. 27677 (DECODER_TESTS): Add msg_control-v.test. 27678 27679 2016-07-01 Dmitry V. Levin <ldv (a] altlinux.org> 27680 27681 tests: check decoding of struct msghdr ancillary data. 27682 * tests/msg_control.c: New file. 27683 * tests/msg_control.test: New test. 27684 * tests/.gitignore: Add msg_control. 27685 * tests/Makefile.am (check_PROGRAMS): Likewise. 27686 (DECODER_TESTS): Add msg_control.test. 27687 27688 2016-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 27689 27690 msghdr.c: reorganize struct cmsghdr handler. 27691 * msghdr.c (sock_ee): New structure. 27692 (print_scm_rights, print_scm_creds, print_scm_security, 27693 print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_ip_opts, 27694 print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr): Remove data_len 27695 argument validity check, don't print ", cmsg_data=" prefix here. 27696 (print_cmsg_ip_tos): Likewise. Rename to print_cmsg_uint8_t. 27697 (cmsg_printer): New type. 27698 (cmsg_socket_printers, cmsg_ip_printers): New arrays. 27699 (print_cmsg_type_data): Use them to handle struct cmsghdr 27700 and its cmsg_data. 27701 27702 msghdr.c: merge print_cmsg_ip_ttl and print_cmsg_ip_checksum. 27703 * msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint. 27704 (print_cmsg_ip_checksum): Remove. 27705 (print_cmsg_type_data): Replace print_cmsg_ip_ttl 27706 and print_cmsg_ip_checksum with print_cmsg_uint. 27707 27708 msghdr.c: enhance representation of unprintable part of msg_control array 27709 * msghdr.c (decode_msg_control): When msg_control array has an 27710 unprintable part, print its address. 27711 27712 msghdr.c: apply a sane limit to the length of IP_ORIGDSTADDR address. 27713 * msghdr.c (print_cmsg_ip_origdstaddr): Limit address length to the size 27714 of struct sockaddr_storage. 27715 27716 msghdr.c: fix printing SCM_RIGHTS array. 27717 * msghdr.c (print_scm_rights): Do not print array elements outside 27718 bounds defined by struct cmsghdr.cmsg_len. 27719 27720 msghdr.c: print unrecognized struct cmsghdr.cmsg_type in hex. 27721 * msghdr.c (print_cmsg_type_data): Use %#x format when printing 27722 struct cmsghdr.cmsg_type as an integer. 27723 27724 msghdr.c: fix printing of struct in_pktinfo. 27725 * msghdr.c (print_cmsg_ip_pktinfo): Fix printing 27726 of struct in_pktinfo.ipi_addr. 27727 27728 msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays. 27729 * msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data 27730 as an array of hexadecimal integers. 27731 * tests/inet-cmsg.c (print_opts): Update expected output. 27732 27733 msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values. 27734 * msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos, 27735 print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an 27736 array element. 27737 * tests/inet-cmsg.c (print_ttl, print_tos): Update expected output. 27738 27739 msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name 27740 * msghdr.c (print_scm_rights, print_scm_creds, print_scm_security, 27741 print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, 27742 print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr, 27743 print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents. 27744 * tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts, 27745 print_origdstaddr): Update expected output. 27746 * tests/scm_rights-fd.test: Likewise. 27747 27748 2016-06-27 Dmitry V. Levin <ldv (a] altlinux.org> 27749 27750 msghdr.c: print struct mmsghdr as a regular structure. 27751 * msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields. 27752 * tests/mmsg.c (main): Update expected output. 27753 27754 net.c: move all msghdr and mmsghdr parsers to a separate file. 27755 * defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg): 27756 New prototypes. 27757 * msghdr.c: New file. 27758 * Makefile.am (strace_SOURCES): Add it. 27759 * net.c: Move all msghdr and mmsghdr parsers to msghdr.c. 27760 27761 Mpersify fetchers of struct msghdr and struct mmsghdr. 27762 * fetch_struct_msghdr.c: New file. 27763 * fetch_struct_mmsghdr.c: Likewise. 27764 * Makefile.am (strace_SOURCES): Add them. 27765 * net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32, 27766 fetch_msghdr, fetch_mmsghdr): Remove. 27767 (decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead 27768 of fetch_msghdr. 27769 (decode_mmsghdr): Change msg_len argument to use_msg_len. 27770 Use fetch_struct_mmsghdr instead of fetch_mmsghdr. 27771 Return fetch_struct_mmsghdr's return code. 27772 (decode_mmsg): Rename to decode_mmsgvec. Take addr and len arguments. 27773 Do not print vlen and flags. Check decode_mmsghdr's return code. 27774 Print mmsghdr array using square brackets. 27775 (dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr. 27776 (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead 27777 of decode_mmsg. Print vlen and flags. 27778 * tests/mmsg.c (main): Update expected output. 27779 27780 net.c: move fallback definition of struct mmsghdr to a separate file. 27781 * msghdr.h: New file. 27782 * Makefile.am (strace_SOURCES): Add it. 27783 * net.c: Include it. Move fallback definition of struct mmsghdr there. 27784 * tests/mmsg.c: Include "msghdr.h". Remove fallback definition 27785 of struct mmsghdr. 27786 27787 2016-06-26 Dmitry V. Levin <ldv (a] altlinux.org> 27788 27789 net.c: print struct msghdr as a regular structure. 27790 * net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov, 27791 and msg_iovlen fields like other regular fields. 27792 * tests/inet-cmsg.c (main): Update expected output. 27793 * tests/mmsg.c (main): Likewise. 27794 * tests/recvmsg.c (main): Likewise. 27795 * tests/scm_rights-fd.test: Likewise. 27796 27797 net.c: rename some internal functions for consistency and readability. 27798 * net.c (printcmsghdr): Rename to decode_msg_control. 27799 (do_msghdr): Rename to print_msghdr. 27800 (extractmsghdr): Rename to fetch_msghdr. 27801 (extractmmsghdr): Rename to fetch_mmsghdr. 27802 (printmsghdr): Rename to decode_msghdr. 27803 (printmmsghdr): Rename to decode_mmsghdr. 27804 All callers updated. 27805 27806 net.c: when printing struct msghdr.msg_control, also print its name. 27807 * net.c (printcmsghdr): Skip control messages of zero length. 27808 Always print "msg_control=" before the control message. 27809 (do_msghdr): Print control message before its length, not after. 27810 * tests/inet-cmsg.c (main): Update expected output. 27811 * tests/scm_rights-fd.test: Likewise. 27812 27813 Assume that libc provides struct msghdr.msg_control. 27814 * configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control. 27815 * net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check. 27816 27817 2016-06-25 Dmitry V. Levin <ldv (a] altlinux.org> 27818 27819 net.c: move all sockaddr parsers to a separate file. 27820 * sockaddr_ll.c: Rename to sockaddr.c 27821 (print_sockaddr_data_ll): Add static keyword. 27822 * Makefile.am (strace_SOURCES): Likewise. 27823 * defs.h (print_sockaddr_data_ll): Remove. 27824 (addrfams): New prototype. 27825 * net.c: Move all sockaddr parsers to sockaddr.c. 27826 27827 net.c: rename printsock to decode_sockaddr. 27828 * defs.h (printsock): Rename to decode_sockaddr. 27829 * net.c (printsock): Likewise. 27830 (do_msghdr, SYS_FUNC(bind), do_sockname, SYS_FUNC(sendto), 27831 SYS_FUNC(recvfrom)): Replace printsock with decode_sockaddr. 27832 27833 defs.h: remove unused prototype. 27834 * defs.h (print_sock_optmgmt): Remove. 27835 27836 tests: check decoding of sockaddr structures. 27837 * tests/net-sockaddr.c: New file. 27838 * tests/net-sockaddr.test: New test. 27839 * tests/.gitignore: Add net-sockaddr. 27840 * tests/Makefile.am (check_PROGRAMS): Likewise. 27841 (DECODER_TESTS): Add net-sockaddr.test. 27842 27843 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 27844 27845 net.c: fix printing AF_PACKET socket addresses. 27846 * defs.h (print_ifindex, print_sockaddr_data_ll): New prototypes. 27847 * net.c: Stop including "xlat/af_packet_types.h". 27848 (print_ifindex): Remove static keyword. 27849 (print_sockaddr_data_l): Remove. 27850 * sockaddr_ll.c: New file. 27851 * Makefile.am (strace_SOURCES): Add it. 27852 * xlat/arp_hardware_types.in: New file. 27853 * xlat/ethernet_protocols.in: Likewise. 27854 27855 net.c: skip details of too short socket addresses, part 2. 27856 * net.c (sa_printers): Add minimal address length for each socket family. 27857 (print_sockaddr): Call socket family specific sockaddr printer 27858 only when socket address length is greater or equal 27859 the minimal address length for the socket family. 27860 27861 net.c: fix printing AF_BLUETOOTH socket addresses. 27862 * xlat/hci_channels.in: New file. 27863 * net.c (print_sockaddr_data_raw): New function. 27864 (print_sockaddr): Use it. 27865 [HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/hci_channels.h". 27866 [HAVE_BLUETOOTH_BLUETOOTH_H] (print_sockaddr_data_bt): Fix printing 27867 sockaddr_hci, sockaddr_sco, sockaddr_rc, and sockaddr_l2 structures. 27868 27869 net.c: fix printing AF_IPX sockets addresses, part 2. 27870 * net.c (print_sockaddr_data_ipx): Print sockaddr_ipx.sipx_network 27871 using %#08x format. Print elements of sockaddr_ipx.sipx_node array 27872 and sockaddr_ipx.sipx_type using %#02x format. 27873 27874 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 27875 27876 net.c: fix printing AF_UNIX abstract socket addresses. 27877 AF_UNIX abstract socket address specified by sockaddr_un.sun_path 27878 is not a NUL-terminated string. 27879 27880 * net.c (SIZEOF_SA_FAMILY): New macro. 27881 (print_sockaddr_data_un): Use it. Specify actual address length 27882 in print_quoted_string calls. Do not set QUOTE_0_TERMINATED flag 27883 when printing an abstract socket address. 27884 27885 2016-06-24 Dmitry V. Levin <ldv (a] altlinux.org> 27886 27887 net.c: fix printing field names of struct sockaddr_nl. 27888 * net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups" 27889 to "nl_groups". Print sockaddr_nl.nl_groups using %#08x format. 27890 * tests/net-yy-netlink.c (main): Update. 27891 27892 net.c: fix printing struct sockaddr_in6.sin6_flowinfo. 27893 * net.c (print_sockaddr_data_in6): Convert sockaddr_in6.sin6_flowinfo 27894 from network order to host order before printing. 27895 27896 2016-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 27897 27898 net.c: do not print sockaddr_in6.sin6_scope_id unnecessarily. 27899 Prior to RFC2553, struct sockaddr_in6 had no sin6_scope_id field. 27900 As the kernel still accepts RFC2133 editions of struct sockaddr_in6, 27901 print sockaddr_in6.sin6_scope_id only when it is specified. 27902 27903 * net.c (SIN6_MIN_LEN): New macro. 27904 (print_sockaddr_data_in6): Print sockaddr_in6.sin6_scope_id only when 27905 socket address length exceeds SIN6_MIN_LEN. 27906 27907 2016-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 27908 27909 net.c: fix printing raw data of socket addresses. 27910 * net.c (print_sockaddr): When printing socket address raw data, read 27911 exactly the number of data bytes specified for the socket addess. 27912 27913 net.c: skip details of too short socket addresses. 27914 * net.c (print_sockaddr): Print socket address details only when 27915 the address size is greater than sizeof(struct sockaddr.sa_family). 27916 (print_sockaddr_data_un): Remove handling of addrlen == 2. 27917 * tests/net-y-unix.c (main): Update expected pattern. 27918 * tests/net-yy-unix.c (main): Likewise. 27919 * tests/net.expected: Likewise. 27920 27921 2016-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 27922 27923 Assume that libc provides struct sockaddr_in6.sin6_scope_id. 27924 * configure.ac (AC_CHECK_MEMBERS): Remove 27925 struct sockaddr_in6.sin6_scope_id. 27926 * net.c (print_sockaddr_data_in6): Remove 27927 HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check. 27928 27929 Split print_sockaddr. 27930 * net.c (sockaddr_buf_t): Remove. 27931 (sockaddr_printer): New type. 27932 (sa_printers): New array of sockaddr_printer. 27933 (print_sockaddr): Use it. Move printers of family specific 27934 sockaddr data to separate funcions. 27935 27936 2016-06-22 Fabien Siron <fabien.siron (a] epita.fr> 27937 27938 Add a enum for decoding to tprint_iov() and tprint_iov_upto() 27939 Introduce a new type iov_decode which will be used instead of the integer 27940 "decode" as a parameter. 27941 27942 * defs.h (iov_decode): New enum. 27943 (tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. 27944 * aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in 27945 tprint_iov() call. 27946 * keyctl.c (keyctl_instantiate_key_iov): Likewise. 27947 * process.c (ptrace): Likewise. 27948 * process_vm.c (process_vm_readv, process_vm_writev): Likewise. 27949 * io.c (writev, do_pwritev, vmsplice): Likewise. 27950 (print_iovec): Replace the condition with a switch. 27951 (tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. 27952 (readv, do_preadv): Change type of "decode_iov" to enum iov_decode in 27953 tprint_iov_upto() call. 27954 * scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 27955 print_sg_io_v4_res): Likewise. 27956 * net.c (do_msghdr): Adapt call of tprint_iov_upto(). 27957 27958 2016-06-22 Dmitry V. Levin <ldv (a] altlinux.org> 27959 27960 printsock: fix zero padding of sockaddr buffer. 27961 Before this change printsock used to erroneously clear the last byte 27962 of sockaddr buffer. 27963 27964 * net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer. 27965 Reserve additional byte after the sockaddr buffer for zero padding. 27966 Do not clear memory that is going to be overwritten by umoven. 27967 Clear the tail of sockaddr buffer that was not overwritten by umoven. 27968 27969 2016-06-21 Fabien Siron <fabien.siron (a] epita.fr> 27970 27971 Change printsock to return socket family. 27972 * defs.h (printsock): Change return type to int. 27973 * net.c (printsock): Likewise. Return socket family on success 27974 and -1 in case of an error. 27975 27976 2016-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 27977 27978 Unexport addrfams. 27979 * defs.h (addrfams): Remove. 27980 27981 sock.c: use print_sockaddr. 27982 * sock.c (print_ifreq_addr): Remove. 27983 (PRINT_IFREQ_ADDR): New macro. 27984 (print_ifreq, decode_ifconf): Use it instead of print_ifreq_addr. 27985 27986 Export print_sockaddr function. 27987 * defs.h (print_sockaddr): New prototype. 27988 * net.c (print_sockaddr): Remove static keyword. 27989 Change type of address pointer to "const void *". 27990 (print_cmsg_ip_recverr, print_group_req): Remove redundant casts 27991 in print_sockaddr invocations. 27992 27993 xlat/addrfams.in: provide fallback definitions. 27994 * xlat/addrfams.in: add fallback definitions for constants. 27995 27996 Update AF_* constants. 27997 * xlat/addrfams.in: Add AF_QIPCRTR. 27998 27999 Assume that libc provides inet_ntop and inet_pton. 28000 * configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton. 28001 * net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove 28002 HAVE_INET_NTOP checks. 28003 * tests/ip_mreq.c: Remove HAVE_INET_PTON check. 28004 28005 net.c: use SO_LINGER unconditionally. 28006 * net.c (print_linger, print_getsockopt, print_setsockopt): Do not check 28007 for SO_LINGER availability. 28008 28009 net.c: use AF_BLUETOOTH unconditionally. 28010 * net.c (print_sockaddr, SYS_FUNC(socket)): Do not check 28011 for AF_BLUETOOTH availability. 28012 28013 2016-06-20 Dmitry V. Levin <ldv (a] altlinux.org> 28014 28015 Consistently use AF_UNIX over AF_LOCAL. 28016 As these constants have the same value 1, let's use and print only one 28017 of them, e.g. AF_UNIX. 28018 28019 * xlat/addrfams.in (AF_LOCAL): Remove. 28020 * tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX. 28021 * tests/net-y-unix.c: Likewise. 28022 * tests/net-yy-unix.c: Likewise. 28023 * tests/netlink_unix_diag.c: Likewise. 28024 28025 2016-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 28026 28027 net.c: fix printing AF_IPX sockets. 28028 * net.c (print_sockaddr): Print sockaddr_ipx as a regular structure. 28029 (SYS_FUNC(socket)): Remove special handling of AF_IPX. 28030 28031 net.c: use AF_IPX unconditionally. 28032 * net.c (sockaddr_buf_t, print_sockaddr, SYS_FUNC(socket)): Do not check 28033 for AF_IPX availability. 28034 28035 Cleanup netipx/ipx.h availability check. 28036 * configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h. 28037 * net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__. 28038 28039 2016-06-19 Fabien Siron <fabien.siron (a] epita.fr> 28040 28041 Make getfdproto return enum instead of string. 28042 Introduce a new enum type sock_proto and use it instead of strings for socket 28043 protocols identification. 28044 28045 * defs.h (sock_proto): New enum. 28046 (get_proto_by_name): New function. 28047 * socketutils.c (protocols): New static table. 28048 (print_sockaddr_by_inode): Use it. Change type of "proto" argument 28049 to sock_proto. 28050 (get_proto_by_name): New function. 28051 * util.c (getfdproto): Use it. Change return type to sock_proto. 28052 (printfd): Update. 28053 28054 2016-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 28055 28056 Split travis-ci.sh. 28057 * travis-ci.sh: Split into travis-build.sh, travis-install.sh, 28058 and travis-success.sh files. 28059 * .travis.yml (before_install, after_success, git): New mappings. 28060 (script): Change to travis-build.sh. 28061 (addons, install): Remove. 28062 (env): Remove matrix. 28063 (matrix): Replace exclude list with include list. 28064 28065 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 28066 28067 Introduce HAVE_STRUCT_TCB_EXT_ARG macro. 28068 Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of 28069 "if defined LINUX_MIPSN32 || defined X32". 28070 28071 * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32. 28072 (struct tcb): Check it instead of LINUX_MIPSN32 || X32. 28073 (RVAL_LUDECIMAL): Likewise. 28074 * io.c (print_lld_from_low_high_val): Likewise. 28075 * lseek.c (SYS_FUNC(lseek)): Likewise. 28076 * mem.c (SYS_FUNC(mmap)): Likewise. 28077 * syscall.c (trace_syscall_exiting): Likewise. 28078 * util.c (getllval): Likewise. 28079 28080 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 28081 28082 btrfs: fix build with fresh linux/btrfs.h. 28083 Fix build with fresh <linux/btrfs.h> that provides a slightly different 28084 definition of struct btrfs_ioctl_defrag_range_args. 28085 28086 * btrfs.c (btrfs_ioctl): Cast "len" member of 28087 struct btrfs_ioctl_defrag_range_args to uint64_t. 28088 * tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len" 28089 members of struct btrfs_ioctl_defrag_range_args to uint64_t. 28090 28091 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 28092 28093 btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN* 28094 <linux/btrfs.h> was introduced in linux v3.9-rc1 while some 28095 of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN 28096 and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2, 28097 or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1. 28098 28099 * btrfs.c [!BTRFS_IOC_QUOTA_RESCAN] 28100 (struct btrfs_ioctl_quota_rescan_args): New structure. 28101 (BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros. 28102 [!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro. 28103 * tests/btrfs.c: Likewise. 28104 28105 Reported-by: Li Er <phoooyb (a] gmail.com> 28106 28107 2016-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 28108 28109 configure.ac: fix checks for btrfs specific structures. 28110 * configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for 28111 struct btrfs_ioctl_defrag_range_args.start and 28112 struct btrfs_ioctl_search_args_v2.buf_size. 28113 28114 2016-06-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 28115 28116 README: add system requirements and beautify the file. 28117 28118 2016-06-16 Fei Jie <feij.fnst (a] cn.fujitsu.com> 28119 28120 tests: add signal_receive.test. 28121 * tests/signal_receive.c: New file. 28122 * tests/signal_receive.test: New test. 28123 * tests/.gitignore: Add signal_receive. 28124 * tests/Makefile.am (check_PROGRAMS): Likewise. 28125 (MISC_TESTS): Add signal_receive.test. 28126 28127 tests: add signal2name function to libtests. 28128 * tests/tests.h (signal2name): New prototype. 28129 * tests/signal2name.c: New file. 28130 * tests/Makefile.am (libtests_a_SOURCES): Add it. 28131 28132 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 28133 28134 net.c: use AF_INET6 unconditionally. 28135 * net.c (SYS_FUNC(socket)): Do not check for AF_INET6 availability. 28136 28137 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 28138 28139 configure.ac: do not check for linux/in6.h. 28140 The last user of <linux/in6.h> was removed by commit v4.9-252-gf362a33. 28141 28142 * configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h. 28143 28144 2016-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 28145 28146 net.c: use AF_PACKET unconditionally. 28147 * net.c: Do not check for AF_PACKET availability. 28148 28149 net.c: include <linux/if_packet.h> unconditionally. 28150 * configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h. 28151 * net.c: Include <linux/if_packet.h> unconditionally. 28152 28153 net.c: use ICMP_FILTER unconditionally. 28154 * net.c: Do not check for ICMP_FILTER availability. 28155 28156 net.c: include <linux/icmp.h> unconditionally. 28157 * configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h. 28158 * net.c: Follow the example of tests/net-icmp_filter.c and include 28159 <linux/icmp.h> unconditionally. 28160 28161 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 28162 28163 net.c: use AF_NETLINK unconditionally. 28164 * net.c: Do not check for AF_NETLINK availability. 28165 28166 net.c: include <linux/netlink.h> unconditionally. 28167 * configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h. 28168 * net.c: Follow the example of socketutils.c and include 28169 <linux/netlink.h> unconditionally. 28170 28171 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 28172 28173 Remove UNDEFINED_SCNO. 28174 Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID 28175 and since tcp->s_ent can only be set to &sysent[tcp->scno] 28176 (or to &unknown, but only when !SCNO_IS_VALID), there is no need 28177 to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno). 28178 28179 * defs.h (UNDEFINED_SCNO): Remove. 28180 * syscall.c (get_scno, trace_syscall_entering, trace_syscall_exiting): 28181 Remove checks for UNDEFINED_SCNO. 28182 28183 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 28184 28185 tests/attach-f-p.c: fix typo in comment. 28186 28187 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 28188 28189 strace.c: fix style in function definition. 28190 * strace.c (kill_save_errno): Move the type of return value 28191 to another line. 28192 28193 Turn on more compiler warnings. 28194 * configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security, 28195 -Wignored-qualifiers, -Winit-self, -Wlogical-op, 28196 -Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration, 28197 -Wold-style-definition, -Wtype-limits. 28198 28199 strace.c: fix a warning reported by -Wold-style-definition. 28200 * strace.c (usage): Add void to the list of function argments. 28201 28202 2016-06-14 Dmitry V. Levin <ldv (a] altlinux.org> 28203 28204 tests/ioctl_evdev.c: fix typo in comment. 28205 28206 2016-06-14 Elvira Khabirova <lineprinter0 (a] gmail.com> 28207 28208 Move printargs* functions to util.c. 28209 * syscall.c (printargs, printargs_u, printargs_d): Move ... 28210 * util.c: ... here. 28211 28212 tests/xgetrlimit.c: fix a warning reported by -Wtype-limits. 28213 * tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants 28214 to the type of argument. 28215 28216 2016-06-11 Dmitry V. Levin <ldv (a] altlinux.org> 28217 28218 Consistently use printaddr for printing addresses. 28219 * bjm.c (SYS_FUNC(init_module)): Use printaddr. 28220 * clone.c (SYS_FUNC(clone)): Likewise. 28221 * evdev.c (ff_effect_ioctl): Likewise. 28222 * mtd.c (decode_mtd_oob_buf): Likewise. 28223 * net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)): 28224 Likewise. 28225 * print_sigevent.c (print_sigevent): Likewise. 28226 * printsiginfo.c (printsigval, print_si_info): Likewise. 28227 * signal.c (decode_new_sigaction): Likewise. 28228 * sysmips.c (SYS_FUNC(sysmips)): Likewise. 28229 * util.c (printpathn, printstr, umoven_or_printaddr): Likewise. 28230 * v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer, 28231 umoven_or_printaddr_ignore_syserror): Likewise. 28232 * tests/net-icmp_filter.c (main): Update. 28233 28234 Based on patch by Eugene Syromyatnikov <evgsyr (a] gmail.com>. 28235 28236 2016-06-10 Dmitry V. Levin <ldv (a] altlinux.org> 28237 28238 tests/attach-p-cmd-p.c: cleanup. 28239 * attach-p-cmd-p.c (handler): Move code ... 28240 (main): ... here. Unblock SIGALRM only. 28241 Use alarm() instead of setitimer(). 28242 Replace endless loop with a pause() call. 28243 Check that chdir() returns ENOENT. 28244 28245 tests: enhance test coverage of SIGCHLD siginfo_t. 28246 * tests/siginfo.c: New file. 28247 * tests/siginfo.test: New test. 28248 * tests/wait.c: Remove. 28249 * tests/wait.expected: Remove. 28250 * tests/wait.test: Remove. 28251 * tests/.gitignore: Add siginfo, remove wait. 28252 * tests/Makefile.am (check_PROGRAMS): Likewise. 28253 (DECODER_TESTS): Add siginfo.test, remove wait.test. 28254 (EXTRA_DIST): Remove wait.expected. 28255 28256 tests: extend test coverage of waitid syscall. 28257 * tests/waitid.c: New file. 28258 * tests/waitid-v.c: Likewise. 28259 * tests/waitid.test: New test. 28260 * tests/waitid-v.test: Likewise. 28261 * tests/.gitignore: Add waitid and waitid-v. 28262 * tests/Makefile.am (check_PROGRAMS): Likewise. 28263 (DECODER_TESTS): Add waitid.test and waitid-v.test. 28264 28265 tests: extend test coverage of wait4 syscall. 28266 * tests/wait4.c: New file. 28267 * tests/wait4-v.c: Likewise. 28268 * tests/wait4.test: New test. 28269 * tests/wait4-v.test: Likewise. 28270 * tests/.gitignore: Add wait4 and wait4-v. 28271 * tests/Makefile.am (check_PROGRAMS): Likewise. 28272 (DECODER_TESTS): Add wait4.test and wait4-v.test. 28273 28274 tests: add widen_to_ull macro to tests.h. 28275 * tests.h (widen_to_ull): New macro, copied from defs.h 28276 28277 Fix sign extension issues in the parser of struct rusage. 28278 * printrusage.c (printrusage): Do not cast members of struct rusage 28279 to type long, use widen_to_ull instead. 28280 28281 2016-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 28282 28283 tests: check decoding of waitpid syscall. 28284 * tests/waitpid.c: New file. 28285 * tests/waitpid.test: New test. 28286 * tests/.gitignore: Add waitpid. 28287 * tests/Makefile.am (check_PROGRAMS): Likewise. 28288 (DECODER_TESTS): Add waitpid.test. 28289 28290 2016-06-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 28291 28292 tests: add strace-E.test. 28293 * tests/strace-E.expected: New file. 28294 * tests/strace-E.test: New test. 28295 * tests/Makefile.am (MISC_TESTS): Add it. 28296 (EXTRA_DIST): Add strace-E.expected. 28297 28298 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 28299 28300 strace.spec.in: enable libunwind on more platforms. 28301 * strace.spec.in: Add libunwind-devel to BuildRequires for RHEL8 family. 28302 28303 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 28304 28305 make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec. 28306 Change make-dist to generate strace-*.tar.gz, strace.dsc, 28307 and strace.spec in addition to strace-*.tar.xz. 28308 28309 * configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip. 28310 * make-dsc: New file. 28311 * make-dist: Use it. 28312 * .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec. 28313 28314 2016-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 28315 28316 Parametrize debian/changelog. 28317 * configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME. 28318 (DEB_CHANGELOGTIME): New variable. 28319 (AC_CONFIG_FILES): Add debian/changelog. 28320 * strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME. 28321 * debian/changelog: Rename to ... 28322 * debian/changelog.in: ... this file. Add parametrized entry. 28323 * debian/.gitignore: New file. 28324 28325 git-version-gen: replace '-' with '.' in generated version. 28326 * git-version-gen: Replace '-' with '.' so version conforms to policies 28327 * configure.ac (SPEC_VERSION): Remove. 28328 * strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION. 28329 Remove %srcname. 28330 28331 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 28332 28333 Parametrize strace.spec. 28334 * configure.ac (SPEC_VERSION, CHANGELOGTIME): Define. 28335 (AC_CONFIG_FILES): Add strace.spec. 28336 * strace.spec: Rename to ... 28337 * strace.spec.in: ... this file. Parametrize Version, srcname, 28338 and the last %changelog entry. Initialize .tarball-version file. 28339 28340 strace.spec: adopt for OBS. 28341 * strace.spec: Parametrize libunwind-devel BRs, BuildRoot, and %defattr. 28342 28343 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 28344 28345 tests: remove obsolete strace-f.test. 28346 strace-f.test is too inexact while fork-f.test does the right thing. 28347 28348 * tests/strace-f.test: Remove. 28349 * tests/Makefile.am (MISC_TESTS): Remove it. 28350 * strace.spec (BuildRequires): Remove time. 28351 28352 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 28353 28354 tests: always distribute strace-k.test. 28355 Fix distribution of tests/strace-k.test file when configured 28356 without libunwind. 28357 28358 * tests/Makefile.am (EXTRA_DIST): Add strace-k.test. 28359 28360 2016-06-07 Dmitry V. Levin <ldv (a] altlinux.org> 28361 28362 make-dist: skip news-check for non-releases. 28363 * make-dist: Run news-check only when the commit being built 28364 matches a release tag. 28365 28366 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28367 28368 tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls. 28369 * tests/getrlimit.c: New file. 28370 * tests/setrlimit.c: Likewise. 28371 * tests/ugetrlimit.c: Likewise. 28372 * tests/xgetrlimit.c: Likewise. 28373 * tests/getrlimit.test: New test. 28374 * tests/setrlimit.test: Likewise. 28375 * tests/ugetrlimit.test: Likewise. 28376 * tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit. 28377 * tests/Makefile.am (check_PROGRAMS): Likewise. 28378 (DECODER_TESTS): Add getrlimit.test, setrlimit.test, 28379 and ugetrlimit.test. 28380 (EXTRA_DIST): Add xgetrlimit.c. 28381 28382 tests: check decoding of prlimit64 syscall. 28383 * tests/prlimit64.c: New file. 28384 * tests/prlimit64.test: New test. 28385 * tests/.gitignore: Add prlimit64. 28386 * tests/Makefile.am (check_PROGRAMS): Likewise. 28387 (DECODER_TESTS): Add prlimit64.test. 28388 28389 Fix decoding of pid_t argument of prlimit64 syscall. 28390 * resource.c (SYS_FUNC(prlimit64)): Print pid_t syscall 28391 argument using %d format. 28392 28393 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28394 28395 Do not check for old sysctl enums. 28396 Assume that sysctl enums defined since linux v2.6 are always defined, 28397 with a signle exception: check for CTL_PROC which definition was removed 28398 in v2.6.18 and restored later in v2.6.23. 28399 28400 * configure.ac (AC_CHECK_DECLS): Remove old constants. 28401 * xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT 28402 as unconditional. 28403 * xlat/sysctl_net.in: Mark constants older than NET_LLC 28404 as unconditional. 28405 * xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET 28406 as unconditional. 28407 * xlat/sysctl_net_ipv4.in: Mark constants older than 28408 NET_IPV4_IGMP_MAX_MSF as unconditional. 28409 * xlat/sysctl_net_ipv4_conf.in: Mark constants older than 28410 NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional. 28411 * xlat/sysctl_net_ipv4_route.in: Mark constants older than 28412 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional. 28413 * xlat/sysctl_net_ipv6.in: Mark constants older than 28414 NET_IPV6_MLD_MAX_MSF as unconditional. 28415 * xlat/sysctl_net_ipv6_route.in: Mark constants older than 28416 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional. 28417 * xlat/sysctl_net_unix.in: Mark all constants as unconditional. 28418 * xlat/sysctl_root.in: Mark constants older than CTL_ARLAN 28419 as unconditional. 28420 * xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT 28421 as unconditional. 28422 28423 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28424 28425 xlat: extend syntax. 28426 * xlat/gen.sh: Implement #conditional directive that turns on 28427 preprocessor checks turned off earlier by #unconditional directive. 28428 28429 2016-06-06 Elvira Khabirova <lineprinter0 (a] gmail.com> 28430 28431 mpers.awk: remove unnecessary type attribute retrieval. 28432 * mpers.awk (what_is): Do not retrieve "type" attribute 28433 for "enumeration_type". 28434 28435 tests/ptrace.c: fix fork() return value check. 28436 * tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value 28437 to pid_t. 28438 28439 .gitignore: add missing files that should be ignored. 28440 * .gitignore: Add ioctl_redefs[12].h and libstrace.a. 28441 28442 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28443 28444 debian: sync with the package. 28445 * debian/control (Build-Depends) [amd64]: Remove libunwind-dev. 28446 * debian/changelog: Sync with 4.12-3. 28447 * debian/rules: Likewise. 28448 28449 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28450 28451 tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace. 28452 * tests/strace-S.test: Measure wall clock time instead of system time. 28453 Use local "./readv" instead of system "date" as a sample executable. 28454 28455 Reported-by: Steve McIntyre <steve (a] einval.com> 28456 28457 2016-06-06 Dmitry V. Levin <ldv (a] altlinux.org> 28458 28459 tests/strace-S.test: enhance error diagnostics. 28460 * tests/strace-S.test: If strace output does not meet expectations, 28461 print the output. 28462 28463 2016-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 28464 28465 .gitignore: sort the list of ignored patterns. 28466 * .gitignore: Sort. 28467 28468 2016-06-01 Dmitry V. Levin <ldv (a] altlinux.org> 28469 28470 maint: post-release administrivia. 28471 * NEWS: Add header line for the next release. 28472 28473 2016-05-31 Dmitry V. Levin <ldv (a] altlinux.org> 28474 28475 Prepare for 4.12 release. 28476 * NEWS: Update for 4.12 release. 28477 * debian/changelog: 4.12-1. 28478 * strace.spec: 4.12-1. 28479 28480 Sync strace.spec and debian/changelog with packages. 28481 * debian/changelog: Sync with 4.11-1. 28482 * strace.spec: Sync with 4.11.0.163.9720-2. 28483 28484 2016-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 28485 28486 Mpersify hdio.c. 28487 * defs.h (hdio_ioctl): Remove. 28488 * hdio.c: Mpersify struct hd_geometry. 28489 (hdio_ioctl): Mpersify. 28490 28491 2016-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 28492 28493 loop.c: decode LOOP_SET_DIRECT_IO. 28494 * loop.c (loop_ioctl) [LOOP_SET_DIRECT_IO] : Handle LOOP_SET_DIRECT_IO. 28495 28496 loop.c: fix printing of arrays. 28497 * loop.c (decode_loop_info): Use square brackets to print 28498 struct loop_info.lo_init and struct loop_info.reserved arrays. 28499 (decode_loop_info64): Use square brackets to print 28500 struct loop_info64.lo_init array. 28501 28502 loop.c: fix printing of structure members' names. 28503 * loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_" 28504 prefix from printed names. 28505 28506 loop.c: optimize decoding of paired ioctls. 28507 * loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS 28508 and LOOP_[GS]ET_STATUS64 ioctl pairs. 28509 28510 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 28511 28512 tests/ioctl_evdev.c: check EVIOCGUNIQ decoding. 28513 * tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding. 28514 28515 tests/ioctl_mtd.c: fix build with musl. 28516 * tests/ioctl_mtd.c: Include <linux/ioctl.h>. 28517 28518 tests: check decoding of 'M' type ioctls. 28519 * tests/ioctl_mtd.c: New file. 28520 * tests/ioctl_mtd.test: New test. 28521 * tests/.gitignore: Add ioctl_mtd. 28522 * tests/Makefile.am (check_PROGRAMS): Likewise. 28523 (DECODER_TESTS): Add ioctl_mtd.test. 28524 28525 Mpersify mtd.c. 28526 * defs.h (mtd_ioctl): Remove. 28527 * mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers. 28528 (mtd_ioctl): Mpersify. 28529 28530 mtd.c: refactor. 28531 * mtd.c (mtd_ioctl): Move parsers of structures to separate functions. 28532 28533 Move parser of UBI_* ioctls to a separate file. 28534 * mtd.c (ubi_ioctl): Move to ... 28535 * ubi.c: ... new file. 28536 * Makefile.am (strace_SOURCES): Add it. 28537 28538 tests: check decoding of EVIOC* ioctls. 28539 * tests/ioctl_evdev.c: New file. 28540 * tests/ioctl_evdev-v.c: Likewise. 28541 * tests/ioctl_evdev.test: New test. 28542 * tests/ioctl_evdev-v.test: Likewise. 28543 * tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v. 28544 * tests/Makefile.am (check_PROGRAMS): Likewise. 28545 (DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test. 28546 28547 Mpersify EVIOC* ioctl parser. 28548 * defs.h (evdev_abs): New xlat prototype. 28549 (evdev_ioctl): Remove. 28550 * evdev.c: Do not include "xlat/evdev_abs.h". 28551 Mpersify struct ff_effect and ioctl numbers. 28552 (evdev_ioctl): Mpersify. 28553 * NEWS: Mention this enhancement. 28554 28555 evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT. 28556 * evdev.c (bit_ioctl): If event type is not unrecognized, 28557 print the argument as an address. 28558 28559 evdev.c: fix printing of EV_PWR's argument. 28560 * evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument. 28561 28562 evdev.c: fix indentation. 28563 * evdev.c: Fix indentation of print formats. 28564 28565 evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ. 28566 * evdev.c (evdev_read_ioctl): Fix printing of the string returned 28567 in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests. 28568 28569 evdev.c: fix EVIOCGVERSION decoding. 28570 * evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument 28571 using #x format. 28572 28573 evdev.c: fix EVIOCGMTSLOTS decoding. 28574 * evdev.c (mtslots_ioctl): Use umove_or_printaddr. 28575 28576 evdev.c: fix bitset decoding. 28577 * evdev.c (decode_bitset): Use umove_or_printaddr. 28578 28579 evdev.c: fix decoding of struct input_id. 28580 * evdev.c (getid_ioctl): Use umove_or_printaddr. 28581 28582 evdev.c: fix decoding of struct input_keymap_entry. 28583 * evdev.c (keycode_V2_ioctl): Use umove_or_printaddr. 28584 28585 evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE. 28586 * evdev.c (keycode_ioctl): Use umove_or_printaddr. 28587 28588 evdev.c: fix decoding of struct input_absinfo. 28589 * evdev.c (abs_ioctl): Use umove_or_printaddr. 28590 28591 evdev.c: fix decoding of struct ff_effect. 28592 * evdev.c (ff_effect_ioctl): Use umove_or_printaddr. 28593 Fix printing of struct ff_effect.u member names. 28594 28595 evdev.c: fix printing of struct ff_envelope.fade_level. 28596 * evdev.c (decode_envelope): Print struct ff_envelope.fade_level 28597 using #x format. 28598 28599 evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE. 28600 * evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB 28601 and EVIOCREVOKE as unsigned long. 28602 28603 evdev.c: fix EVIOCRMFF decoding. 28604 * evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int. 28605 28606 evdev.c: move handling of EVIOCGBIT to a separate function. 28607 * evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ... 28608 (bit_ioctl): ... new function. 28609 28610 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 28611 28612 evdev.c: reorder ioctl command checks. 28613 Change the order of ioctl command cheks to match the kernel: 28614 1st, check for fixed-number fixed-length commands, 28615 2nd, check for fixed-number variable-length commands, 28616 3rd, check for multi-number fixed-length commands, 28617 4thm check for multi-number variable-length commands. 28618 28619 * evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder 28620 ioctl command checks. 28621 28622 2016-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 28623 28624 evdev.c: decode all directions except _IOC_READ on entering syscall. 28625 * evdev.c (evdev_write_ioctl): Remove exiting check. 28626 (evdev_read_ioctl): Move entering check ... 28627 (evdev_ioctl): ... here. Add RVAL_DECODED to return code in _IOC_WRITE 28628 and default cases. 28629 28630 evdev.c: fix indentation of preprocessor directives. 28631 * evdev.c: Fix indentation of preprocessor directives. 28632 Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H]. 28633 28634 2016-05-28 Jeff Mahoney <jeffm (a] suse.com> 28635 28636 file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode. 28637 * file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first 28638 two elements of info array in abbrev mode. 28639 * tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly 28640 printed elements. 28641 28642 2016-05-27 Dmitry V. Levin <ldv (a] altlinux.org> 28643 28644 ioctl.c: fix typo in decoding of EVIOCSABS's parameter. 28645 * ioctl.c (evdev_decode_number): Fix typo in printxval default value. 28646 28647 2016-05-27 Jeff Mahoney <jeffm (a] suse.com> 28648 28649 tests: check decoding of btrfs RDWR ioctls returned data. 28650 * tests/btrfs-vw.test: New file. 28651 * tests/btrfs-w.test: New file. 28652 * tests/Makefile.am (DECODER_TESTS): Add them. 28653 28654 tests/btrfs.c: fix live btrfs_test_search_ioctls output. 28655 * tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf 28656 for BTRFS_IOC_TREE_SEARCH and fix missing whitespace. 28657 28658 btrfs.c: don't use print_array in btrfs_print_tree_search. 28659 * btrfs.c (btrfs_print_tree_search): Don't use print_array. The buffer 28660 represents a series of variable sized records, not an array. 28661 28662 btrfs.c: fix print_array usage in btrfs_print_logical_ino_container. 28663 * btrfs.c: (btrfs_print_logical_ino_container) Fix the element count 28664 to reflect the number of records rather than the number of items. 28665 28666 2016-05-26 Jeff Mahoney <jeffm (a] suse.com> 28667 28668 tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH. 28669 * tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference 28670 to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests. 28671 28672 2016-05-26 Fabien Siron <fabien.siron (a] epita.fr> 28673 28674 Fix -yy documentation. 28675 * strace.c (usage): Fix description of -yy option. 28676 * strace.1: Likewise. 28677 28678 2016-05-26 Dmitry V. Levin <ldv (a] altlinux.org> 28679 28680 tests/ioctl_block.c: tweak magic constants to make the test more reliable 28681 * tests/ioctl_block.c (main): Change bad pointer to make 28682 its lower 32-bit part closer to -1U. 28683 28684 tests/btrfs.c: check basic decoding of read-only ioctls. 28685 * tests/btrfs.c (btrfs_test_read_ioctls): New function. 28686 (main): Use it. 28687 28688 tests: check decoding of BLK* ioctls. 28689 * configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup. 28690 * tests/ioctl_block.c: New file. 28691 * tests/ioctl_block.test: New test. 28692 * tests/.gitignore: Add ioctl_block. 28693 * tests/Makefile.am (check_PROGRAMS): Likewise. 28694 (DECODER_TESTS): Add ioctl_block.test. 28695 28696 Mpersify BLK* ioctl parser. 28697 * defs.h (block_ioctl): Remove. 28698 * block.c: Mpersify struct blk_user_trace_setup, 28699 struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers. 28700 (block_ioctl): Mpersify. 28701 * NEWS: Mention this enhancement. 28702 28703 block.c: optimize decoding of paired ioctls. 28704 * block.c (block_ioctl): Optimize decoding of commands that return 28705 a signed int. 28706 28707 block.c: fix printing of uint64_t pairs. 28708 * block.c (block_ioctl): Print uint64_t values using PRIu64 format. 28709 28710 block.c: fix printing of struct blk_user_trace_setup. 28711 * block.c (block_ioctl): Fix printing of comma before 28712 struct blk_user_trace_setup.name on exiting syscall. 28713 28714 Move parser of 'X' type ioctls to a separate file. 28715 * fs_x_ioctl.c: New file. 28716 * Makefile.am (strace_SOURCES): Add it. 28717 * block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW 28718 to fs_x_ioctl.c. 28719 * defs.h (fs_x_ioctl): New prototype. 28720 * ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'. 28721 28722 Move parser of HDIO_* ioctls to a separate file. 28723 * hdio.c: New file. 28724 * Makefile.am (strace_SOURCES): Add it. 28725 * block.c: Do not include <linux/hdreg.h>. 28726 (block_ioctl): Move parser of HDIO_GETGEO to hdio.c. 28727 * defs.h (hdio_ioctl): New prototype. 28728 * ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03. 28729 28730 Fix explicit casts of signed integer types to unsigned long long. 28731 * defs.h (widen_to_ull): New macro. 28732 * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place 28733 of explicit casts to unsigned long long. 28734 * io.c (print_lld_from_low_high_val): Likewise. 28735 * lseek.c (SYS_FUNC(llseek)): Likewise. 28736 * printsiginfo.c (print_si_info): Likewise. 28737 * printstat.h (DO_PRINTSTAT): Likewise. 28738 * sysinfo.c (SYS_FUNC(sysinfo)): Likewise. 28739 * times.c (SYS_FUNC(times)): Likewise. 28740 * fetch_struct_statfs.c (ASSIGN_NUMBER): Remove. 28741 (fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER 28742 with widen_to_ull. 28743 28744 scsi.c: print __u64 types using PRI__u64 format. 28745 * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts 28746 to unsigned long long, print fields of type __u64 using PRI__u64 format. 28747 28748 2016-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 28749 28750 tests: check decoding of RTC_* ioctls. 28751 * configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc. 28752 * tests/ioctl_rtc.c: New file. 28753 * tests/ioctl_rtc-v.c: Likewise. 28754 * tests/ioctl_rtc.test: New test. 28755 * tests/ioctl_rtc-v.test: Likewise. 28756 * tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v. 28757 * tests/Makefile.am (check_PROGRAMS): Likewise. 28758 (DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test. 28759 28760 Mpersify RTC_* ioctl parser. 28761 * defs.h (rtc_ioctl): Remove. 28762 * rtc.c: Mpersify struct rtc_pll_info and ioctl numbers. 28763 (rtc_ioctl): Mpersify. 28764 * NEWS: Mention this enhancement. 28765 28766 rtc.c: fix decoding of struct rtc_wkalrm. 28767 * rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time. 28768 28769 file_ioctl.c: print file descriptors using printfd. 28770 * file_ioctl.c (print_file_dedupe_range_info): Print 28771 struct file_dedupe_range_info.dest_fd using printfd. 28772 (file_ioctl): Print struct file_clone_range.src_fd using printfd. 28773 28774 rtc.c: do not print argument of ioctls that have no arguments. 28775 * rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF} 28776 and RTC_VL_CLR ioctls. 28777 28778 rtc.c: decode RTC_PLL_GET and RTC_PLL_SET. 28779 * rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET 28780 28781 rtc.c: optimize decoding of paired ioctls. 28782 * rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET, 28783 RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs. 28784 28785 block.c: handle BLKDAXGET. 28786 * block.c [!BLKDAXGET] (BLKDAXGET): Define. 28787 (block_ioctl): Handle it. 28788 28789 tests: check decoding of mount syscall. 28790 * tests/mount.c: New file. 28791 * tests/mount.test: New test. 28792 * tests/.gitignore: Add mount. 28793 * tests/Makefile.am (check_PROGRAMS): Likewise. 28794 (DECODER_TESTS): Add mount. 28795 28796 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28797 28798 tests/vhangup.c: diassociate from the controlling terminal first. 28799 * tests/vhangup.c (main): Call setsid before vhangup. 28800 28801 2016-05-24 Fei Jie <feij.fnst (a] cn.fujitsu.com> 28802 28803 tests: add vhangup.test. 28804 * tests/vhangup.c: New file. 28805 * tests/vhangup.test: New test. 28806 * tests/.gitignore: Add vhangup. 28807 * tests/Makefile.am (check_PROGRAMS): Likewise. 28808 (DECODER_TESTS): Add vhangup.test. 28809 28810 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28811 28812 NEWS: Prepare for 4.12 release. 28813 28814 2016-05-24 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 28815 28816 tests/btrfs.c: fix build on x32. 28817 * tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino. 28818 28819 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28820 28821 tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL. 28822 * tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL 28823 is defined using unexported type "u64". 28824 28825 btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME. 28826 * btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case 28827 if this constant is not defined. 28828 * tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part 28829 of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined. 28830 28831 tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args. 28832 * tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members 28833 of struct btrfs_ioctl_clone_range_args using PRI__u64 format. 28834 28835 tests/btrfs.c: tweak magic constants to make the test more reliable. 28836 * tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val 28837 to 0xdeadbeefbadc0ded. 28838 (btrfs_test_subvol_ioctls): Likewise. Change bad_pointer 28839 to make their lower 32-bit parts closer to -1U. 28840 28841 btrfs.c: print file descriptors using printfd. 28842 * btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd, 28843 struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd 28844 using printfd. 28845 * tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls, 28846 btrfs_test_device_ioctls, btrfs_test_clone_ioctls, 28847 btrfs_test_send_ioctl): Update. 28848 28849 tests/btrfs.c: do not print errno in case of fs type mismatch. 28850 * tests/btrfs.c (main): Use error_msg_and_fail instead of 28851 perror_msg_and_fail when the fs type of the given directory 28852 is not BTRFS_SUPER_MAGIC. 28853 28854 tests/btrfs.c: fix indentation. 28855 * tests/btrfs.c: Fix indentation of preprocessor directives 28856 and function prototypes. 28857 28858 tests/btrfs.c: sort included headers. 28859 * tests/btrfs.c: Sort included headers. 28860 28861 tests/btrfs.c: do not use alloca. 28862 * tests/btrfs.c: Don't include <alloca.h>. 28863 (btrfs_test_subvol_ioctls): Allocate 28864 struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc. 28865 28866 tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h> 28867 * tests/btrfs.c: Include "tests.h" first. 28868 Skip the test if [!HAVE_LINUX_BTRFS_H]. Skip parts of the test 28869 that use struct fiemap if [!HAVE_LINUX_FIEMAP_H]. 28870 28871 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 28872 28873 tests: add testing for btrfs ioctls. 28874 * tests/btrfs.c: New file. 28875 * tests/btrfs.test: New test. 28876 * tests/btrfs-v.test: Likewise. 28877 * tests/.gitignore: Add btrfs. 28878 * tests/Makefile.am (check_PROGRAMS): Likewise. 28879 (DECODER_TESTS): Add btrfs.test and btrfs-v.test. 28880 28881 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28882 28883 tests/file_ioctl.c: use tail_alloc. 28884 * tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc. 28885 28886 tests/file_ioctl.c: fix build on systems without <linux/fiemap.h> 28887 * tests/file_ioctl.c: Include "tests.h" first. 28888 Skip the test if [!HAVE_LINUX_FIEMAP_H]. 28889 28890 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 28891 28892 tests: add testing for FS_IOC_FIEMAP. 28893 This is limited to FIEMAP. FICLONE* and FIDEDUPERANGE originated in 28894 btrfs and will be tested there. 28895 28896 * tests/file_ioctl.c: New file. 28897 * tests/file_ioctl.test: New test. 28898 * tests/.gitignore: Add file_ioctl. 28899 * tests/Makefile.am (check_PROGRAMS): Likewise. 28900 (DECODER_TESTS): Add file_ioctl.test. 28901 28902 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28903 28904 Mpersify btrfs.c. 28905 * btrfs.c: Mpersify 3 arch-specific structures 28906 and corresponding ioctl numbers. 28907 (btrfs_ioctl): Mpersify. 28908 * defs.h (btrfs_ioctl): Remove. 28909 28910 btrfs.c: use print_array. 28911 * btrfs.c (print_btrfs_data_container_logical_ino, 28912 print_btrfs_data_container_ino_path, print_uint64, 28913 print_btrfs_ioctl_search_header, print_objectid_callback, 28914 print_btrfs_ioctl_space_info): New functions. 28915 (btrfs_print_logical_ino_container, btrfs_print_ino_path_container): 28916 Rewrite printers of struct btrfs_data_container.val array 28917 using print_array. 28918 (btrfs_print_qgroup_inherit): Rewrite printer of 28919 struct btrfs_qgroup_inherit.qgroups array using print_array. 28920 (btrfs_print_tree_search): Rewrite printer of 28921 struct btrfs_ioctl_search_header array using print_array. 28922 (btrfs_ioctl): Rewrite printer of 28923 struct btrfs_ioctl_send_args.clone_sources and 28924 struct btrfs_ioctl_space_args.spaces using print_array. 28925 28926 btrfs.c: simplify BTRFS_IOC_GET_FSLABEL parser. 28927 * btrfs.c (btrfs_ioctl): Share code of parser of BTRFS_IOC_SET_FSLABEL 28928 with parser of BTRFS_IOC_GET_FSLABEL only on BTRFS_IOC_GET_FSLABEL's 28929 entering. 28930 28931 btrfs.c: fix BTRFS_IOC_TREE_SEARCH_V2 output. 28932 * btrfs.c (btrfs_ioctl): Fix BTRFS_IOC_TREE_SEARCH_V2 output 28933 in case of EOVERFLOW and failed umove. 28934 28935 btrfs.c: cleanup use of tcp->auxstr. 28936 * btrfs.c (btrfs_ioctl): Reset tcp->auxstr only if it is set. 28937 28938 btrfs.c: cleanup struct btrfs_ioctl_get_dev_stats.nr_items check. 28939 * btrfs.c (btrfs_ioctl): Cleanup check of iterator of 28940 btrfs_ioctl_get_dev_stats.values array. 28941 28942 btrfs.c: do not use BTRFS_SUBVOL_NAME_MAX. 28943 * btrfs.c [BTRFS_SUBVOL_NAME_MAX]: Remove. 28944 (btrfs_ioctl): Use sizeof(struct btrfs_ioctl_vol_args_v2.name) 28945 instead of BTRFS_SUBVOL_NAME_MAX + 1. 28946 28947 btrfs.c: mark some function arguments as const. 28948 * btrfs.c (btrfs_print_balance_args, btrfs_print_features, 28949 btrfs_print_qgroup_limit, btrfs_print_data_container_header, 28950 btrfs_print_logical_ino_container, btrfs_print_ino_path_container, 28951 btrfs_print_qgroup_inherit): Mark some function arguments as const. 28952 28953 btrfs.c: use umove instead of umoven. 28954 * btrfs.c: Use umove instead of umoven and umove_or_printaddr 28955 instead of umoven_or_printaddr. 28956 28957 btrfs.c: remove unused variable. 28958 * btrfs.c (btrfs_ioctl): Remove "ret" variable. 28959 28960 btrfs.c: use printxval/printxval64 instead of printxvals. 28961 * btrfs.c (btrfs_ioctl): Do not call printxvals directly, 28962 use printxval/printxval64 wrappers that do the right thing. 28963 28964 btrfs.c: fix indentation. 28965 * btrfs.c: Fix indentation of preprocessor directives and print formats. 28966 28967 xlat/btrfs_dev_stats_values.in: cleanup. 28968 * xlat/btrfs_dev_stats_values.in: Remove HAVE_DECL_* defines, 28969 use #unconditional instead. 28970 28971 file_ioctl.c: use print_array. 28972 * file_ioctl.c (file_ioctl): Rewrite printers of 28973 struct file_dedupe_range_info and struct fiemap_extent arrays 28974 using print_array. 28975 28976 file_ioctl.c: fix indentation. 28977 * file_ioctl.c: Fix indentation of preprocessor directives 28978 and print formats. 28979 28980 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28981 28982 file_ioctl.c: include <linux/ioctl.h> instead of <sys/ioctl.h> 28983 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 28984 no benefits for this parser. 28985 28986 * file_ioctl.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 28987 28988 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 28989 28990 file_ioctl.c: fix build on systems without <linux/fiemap.h> 28991 * configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h. 28992 * file_ioctl.c: Do not include <linux/fiemap.h> and xlat/fiemap_*.h 28993 if [!HAVE_LINUX_FIEMAP_H]. 28994 (file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H]. 28995 28996 ioctl.c: fix build. 28997 * ioctl.c (ioctl_decode): Move definition of "ret" variable 28998 to [ALPHA || POWERPC] case. 28999 [ALPHA || POWERPC]: Fix syntax error. 29000 29001 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 29002 29003 ioctl: add decoding for FS_IOC_FIEMAP. 29004 * file_ioctl.c: Include <linux/fiemap.h>, "xlat/fiemap_flags.h", 29005 and "xlat/fiemap_extent_flags.h". 29006 (file_ioctl): Handle FS_IOC_FIEMAP. 29007 * ioctl.c (ioctl_decode): Use file_ioctl for decoding 'f' code ioctls. 29008 29009 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 29010 29011 Add xlat/fiemap_flags.in and xlat/fiemap_extent_flags.in. 29012 * xlat/fiemap_flags.in: New file. 29013 * xlat/fiemap_extent_flags.in: Likewise. 29014 29015 2016-05-24 Jeff Mahoney <jeffm (a] suse.com> 29016 29017 ioctl: add decoding support for btrfs ioctls. 29018 * btrfs.c: New file. 29019 * file_ioctl.c: Likewise. 29020 * Makefile.am (strace_SOURCES): Add them. 29021 * configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h. 29022 (AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags, 29023 struct btrfs_ioctl_fs_info_args.nodesize, 29024 struct btrfs_ioctl_defrag_range_args.start, 29025 and struct btrfs_ioctl_search_args_v2.buf_size. 29026 (AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums. 29027 * defs.h (btrfs_ioctl, file_ioctl): New prototypes. 29028 * ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl. 29029 * xlat/btrfs_balance_args.in: New file. 29030 * xlat/btrfs_balance_ctl_cmds.in: Likewise. 29031 * xlat/btrfs_balance_flags.in: Likewise. 29032 * xlat/btrfs_balance_state.in: Likewise. 29033 * xlat/btrfs_compress_types.in: Likewise. 29034 * xlat/btrfs_defrag_flags.in: Likewise. 29035 * xlat/btrfs_dev_replace_cmds.in: Likewise. 29036 * xlat/btrfs_dev_replace_results.in: Likewise. 29037 * xlat/btrfs_dev_replace_state.in: Likewise. 29038 * xlat/btrfs_dev_stats_flags.in: Likewise. 29039 * xlat/btrfs_dev_stats_values.in: Likewise. 29040 * xlat/btrfs_features_compat.in: Likewise. 29041 * xlat/btrfs_features_compat_ro.in: Likewise. 29042 * xlat/btrfs_features_incompat.in: Likewise. 29043 * xlat/btrfs_key_types.in: Likewise. 29044 * xlat/btrfs_qgroup_ctl_cmds.in: Likewise. 29045 * xlat/btrfs_qgroup_inherit_flags.in: Likewise. 29046 * xlat/btrfs_qgroup_limit_flags.in: Likewise. 29047 * xlat/btrfs_qgroup_status_flags.in: Likewise. 29048 * xlat/btrfs_scrub_flags.in: Likewise. 29049 * xlat/btrfs_send_flags.in: Likewise. 29050 * xlat/btrfs_snap_flags_v2.in: Likewise. 29051 * xlat/btrfs_space_info_flags.in: Likewise. 29052 * xlat/btrfs_tree_objectids.in: Likewise. 29053 29054 2016-05-24 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 29055 29056 x32: update ioctl entries from linux 4.6. 29057 * linux/x32/ioctls_inc0.h: Update from linux v4.6 using ioctls_gen.sh. 29058 29059 2016-05-24 Dmitry V. Levin <ldv (a] altlinux.org> 29060 29061 tests/attach-f-p.c: sleep a bit more to let the tracer catch up. 29062 On noticeably lagging systems, the parent process may invoke its chdir 29063 call before the tracer gets notified about completion of its last child 29064 process. Add extra sleep in the parent process to win the race. 29065 29066 * tests/attach-f-p.c (main): Change timerid into a static array. 29067 Arm a timer in the parent process and wait for it. 29068 29069 2016-05-23 Dmitry V. Levin <ldv (a] altlinux.org> 29070 29071 tests/attach-p-cmd-cmd.c: fix potential errno clobbering. 29072 * tests/attach-p-cmd-cmd.c (main): Call getpid before chdir. 29073 29074 tests/net-yy-netlink.c: robustify against libc specific issues. 29075 * tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg 29076 as the latter has notible implementation differences that make 29077 the test unreliable. 29078 29079 tests/net-yy-netlink.c: robustify against os specific issues. 29080 * tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr 29081 as NULL doesn't work well on some systems. 29082 29083 tests/net-yy-{inet,netlink}.test: cleanup. 29084 * tests/net-yy-inet.test: Do not pass arguments to net-yy-inet 29085 as the latter does not accept them. 29086 * tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink 29087 as the latter does not accept them. 29088 29089 2016-05-22 Jeff Mahoney <jeffm (a] suse.com> 29090 29091 tests: define PRI__[dux]64 macros to print __s64 and __u64 values. 29092 Rather than cast every __u64 or __s64 before printing, 29093 define printing helpers for those types directly. 29094 29095 This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330. 29096 29097 * tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros. 29098 29099 2016-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 29100 29101 tests: remove manual creation of memory mapping holes. 29102 We used to call tail_alloc(1) to create memory mapping holes around 29103 regular tail_alloc allocations. This is no longer needed since regular 29104 tail_alloc allocations create additional memory mapping holes. 29105 29106 * tests/clock_adjtime.c (main): Remove creation of memory mapping holes 29107 using tail_alloc(1). 29108 * tests/futimesat.c (main): Likewise. 29109 * tests/get_mempolicy.c (print_nodes, main): Likewise. 29110 * tests/getgroups.c (main): Likewise. 29111 * tests/getresugid.c (main): Likewise. 29112 * tests/ioctl_uffdio.c (main): Likewise. 29113 * tests/ioctl_v4l2.c (main): Likewise. 29114 * tests/move_pages.c (main): Likewise. 29115 * tests/net-icmp_filter.c (main): Likewise. 29116 * tests/ptrace.c (test_peeksiginfo, main): Likewise. 29117 * tests/pwritev.c (main): Likewise. 29118 * tests/set_mempolicy.c (print_nodes): Likewise. 29119 * tests/setgroups.c (main): Likewise. 29120 * tests/umovestr3.c (main): Likewise. 29121 * tests/utimes.c (main): Likewise. 29122 * tests/xattr.c (main): Likewise. 29123 29124 2016-05-22 Dmitry V. Levin <ldv (a] altlinux.org> 29125 29126 tests: make tail_alloc create additional memory mapping holes. 29127 * tests/tail_alloc.c (tail_alloc): Create additional memory mapping 29128 holes before and after the allocated memory. 29129 29130 2016-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 29131 29132 mpers: add support of conditionally compiled printers. 29133 We used to declare and define all printers marked with 29134 MPERS_PRINTER_DECL, including ifdef'ed ones. That approach left us 29135 no way to conditionally compile mpersified printers, which was not 29136 a problem until btrfs ioctls appeared on the horizon. 29137 29138 With this change, those mpersified printers that are not going 29139 to be compiled are also won't be declared and won't be added to 29140 struct_printers. 29141 29142 This is implemented by filtering all source files containing 29143 MPERS_PRINTER_DECL markers through CPP. As a nice side effect, this 29144 also lifts an ugly requirement of writing all MPERS_PRINTER_DECL 29145 declarations in a single line. 29146 29147 * README-mpers: Update description of MPERS_PRINTER_DECL syntax. 29148 * defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into 29149 a recursive variadic macro. 29150 [!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro. 29151 All callers changed. 29152 * Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern): 29153 New variables. 29154 (CLEANFILES): Add $(mpers_preproc_files). 29155 (%.c.mpers.i): New rule. 29156 (printers.h, %_printer_decls.h, %_printer_defs.h): Use 29157 mpers_preproc_files instead of srcdir_mpers_source_files, 29158 use mpers_printer_decl_pattern. 29159 * .gitignore: Add /*.mpers.i. 29160 29161 2016-05-20 Dmitry V. Levin <ldv (a] altlinux.org> 29162 29163 Remove redundant declaration of v4l2_ioctl. 29164 There is no need to declare mpers printers in defs.h because 29165 they are already declared in printers.h or native_printer_decls.h. 29166 29167 This complements commit 1e56814f77594a22a74ddee629639eb0bb7edf3a. 29168 29169 * defs.h (v4l2_ioctl): Remove. 29170 29171 2016-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 29172 29173 Fix one more code pattern that might break gcc strict aliasing rules. 29174 * socketutils.c (receive_responses): Turn static buffer into a union 29175 to avoid breaking of gcc strict aliasing rules. 29176 * tests/netlink_inet_diag.c (check_responses): Likewise. 29177 * tests/netlink_netlink_diag.c (check_responses): Likewise. 29178 * tests/netlink_unix_diag.c (check_responses): Likewise. 29179 29180 2016-05-21 Fabien Siron <fabien.siron (a] epita.fr> 29181 29182 tests: add check for netlink protocol decoding with -yy option. 29183 * tests/netlink_netlink_diag.c: New file. 29184 * tests/net-yy-netlink.c: New file. 29185 * tests/net-yy-netlink.test: New test. 29186 * tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag 29187 * tests/Makefile.am (check_PROGRAMS): Likewise. 29188 (TESTS): Add net-yy-netlink.test. 29189 29190 2016-05-18 Fabien Siron <fabien.siron (a] epita.fr> 29191 29192 Add netlink domain sockets support to socketutils. 29193 * linux/netlink_diag.h: New file. 29194 * Makefile.am (EXTRA_DIST): Add it. 29195 * socketutils.c: Include it and "xlat/netlink_protocols.h". 29196 (netlink_send_query, netlink_parse_response, netlink_print): New 29197 functions. 29198 (print_sockaddr_by_inode): Hook up netlink_print. 29199 29200 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 29201 29202 tests/pread64-pwrite64.c: robustify against os specific issues. 29203 Do not assume that pwrite64 syscall fails when only part of the 29204 specified memory buffer is accessible. With some kernels, one 29205 accessible byte at the end of page is enough for pwrite64 syscall 29206 to return 1. 29207 29208 * tests/pread64-pwrite64.c (main): Tweak the test that can lead 29209 to a partial write. 29210 29211 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 29212 29213 tests/read-write.c: robustify against os specific issues. 29214 Do not assume that write syscall fails when only part of the specified 29215 memory buffer is accessible. With some kernels, one accessible byte 29216 at the end of page is enough for write syscall to return 1. 29217 29218 * tests/read-write.c (main): Tweak the test that can lead to a partial 29219 write. 29220 29221 2016-05-18 Dmitry V. Levin <ldv (a] altlinux.org> 29222 29223 umovestr3.test: extend test coverage. 29224 * tests/umovestr3.c: Include <sys/param.h>. 29225 (main): Test with each number between PATH_MAX-1 and 0. 29226 29227 tests/timer_create.c: robustify against os specific issues. 29228 * tests/timer_create.c (main): Do not assume any specific error code 29229 returned by timer_create, print whatever it is. 29230 29231 Fix some compilation warnings on older systems. 29232 * print_statfs.c (print_statfs_flags): Define only 29233 for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS]. 29234 * tests/inet-cmsg.c (print_origdstaddr): Define only 29235 for [IP_ORIGDSTADDR]. 29236 29237 Update generic ioctl entries from linux 4.6. 29238 * linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh. 29239 * linux/32/ioctls_inc_align32.h: Likewise. 29240 * linux/32/ioctls_inc_align64.h: Likewise. 29241 * NEWS: Mention this. 29242 29243 maint: update for linux 4.6. 29244 * maint/ioctls_sym.sh: Update workarounds for linux/kvm.h. 29245 29246 Update SOL_* constants. 29247 * xlat/socketlayers.in: Add SOL_KCM. 29248 29249 Update MSG_* constants. 29250 * xlat/msg_flags.in: Add MSG_BATCH. 29251 29252 Update AF_* constants. 29253 * xlat/addrfams.in: Add AF_KCM. 29254 29255 2016-05-17 Fei Jie <feij.fnst (a] cn.fujitsu.com> 29256 29257 tests: add brk.test. 29258 * tests/brk.c: New file. 29259 * tests/brk.test: New test. 29260 * tests/.gitignore: Add brk. 29261 * tests/Makefile.am (check_PROGRAMS): Likewise. 29262 (DECODER_TESTS): Add brk.test. 29263 29264 2016-05-17 Dmitry V. Levin <ldv (a] altlinux.org> 29265 29266 Fix printing of invalid arguments of term ioctls. 29267 * term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls 29268 using printxval_long. 29269 29270 mips: fix printing of invalid operations argument of sysmips syscall. 29271 * sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using 29272 printxval_long. 29273 29274 bfin: fix printing of invalid flags argument of sram_alloc syscall. 29275 * sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using 29276 printflags_long. 29277 29278 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29279 29280 Fix printing of invalid arguments of prctl syscall. 29281 * prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument 29282 of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL, 29283 and PR_SET_SECCOMP using printxval_long. 29284 Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long. 29285 Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using 29286 printxval_long. 29287 * tests/prctl-seccomp-strict.c (main): Update. 29288 29289 Fix printing of invalid flags argument of perf_event_open syscall. 29290 * numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall 29291 using printflags_long. 29292 29293 or1k: fix printing of invalid 1st argument of or1k_atomic syscall. 29294 * or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using 29295 printxval_long. 29296 29297 Fix printing of invalid flags argument of get_mempolicy syscall. 29298 * numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall 29299 using printxval_long. 29300 29301 Fix printing of invalid mode argument of mbind syscall. 29302 * numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall 29303 using printxval_long. 29304 * tests/mbind.c (main): Update. 29305 29306 Fix printing of invalid argument of MTDFILEMODE ioctl. 29307 * mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl 29308 using printflags_long. 29309 29310 Fix printing of invalid flags argument of mount syscall. 29311 * mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long. 29312 29313 Fix printing of invalid arguments of memory mapping related syscalls. 29314 * mem.c (print_mmap): Print 3rd and 4th arguments of syscall 29315 using printflags_long. 29316 (SYS_FUNC(mprotect)): Print 3rd argument of syscall using 29317 printflags_long. 29318 (SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long. 29319 (SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall 29320 using printflags_long. 29321 * tests/remap_file_pages.c (main): Update. 29322 29323 Fix printing of invalid flags argument of kexec_load and kexec_file_load 29324 * kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print 29325 flags argument using printflags_long. 29326 29327 Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall. 29328 * fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and 29329 F_ADD_SEALS operations using printflags_long. 29330 29331 Fix printing of invalid flags argument of unshare syscall. 29332 * clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long. 29333 29334 Introduce printflags_long and printxval_long. 29335 * defs.h (printflags_long, printxval_long): New static inline functions. 29336 29337 Fix printing of invalid struct xfs_dqblk.d_flags. 29338 * quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags 29339 to uint8_t to avoid potential sign-extension bug when printing 29340 invalid struct xfs_dqblk.d_flags. 29341 29342 Fix printing of invalid struct ubi_mkvol_req.vol_type. 29343 * mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type 29344 to unsigned short to avoid potential sign-extension bug when printing 29345 invalid struct ubi_mkvol_req.vol_type. 29346 29347 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29348 29349 Fix decoding of prctl/arch_prctl operation argument. 29350 Consistently treat operation argument of prctl/arch_prctl syscalls 29351 as int to match the kernel behaviour. 29352 29353 * prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument 29354 of syscalls to a variable of type unsigned int and use it in all 29355 subsequent checks and lookups. 29356 29357 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29358 29359 Fix printing of struct sched_attr.sched_flags. 29360 * sched.c (print_sched_attr): Print sched_flags using printflags64. 29361 29362 Fix printing of struct statfs.f_flags. 29363 * print_statfs.c (print_statfs_flags): Print flags using printflags64. 29364 29365 Fix printing of invalid struct ifreq.ifr_flags. 29366 * sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags 29367 to unsigned short to avoid potential sign-extension bug when printing 29368 invalid struct ifreq.ifr_flags. 29369 29370 Fix printing of invalid struct pollfd.events. 29371 * poll.c (print_pollfd): Explicitly cast struct pollfd.events 29372 to unsigned short to avoid potential sign-extension bug when printing 29373 invalid struct pollfd.events. 29374 29375 Fix printing of invalid struct sembuf.sem_flg. 29376 * ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg 29377 to unsigned short to avoid potential sign-extension bug when printing 29378 invalid struct sembuf.sem_flg. 29379 29380 Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls. 29381 * fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence 29382 fields to unsigned short to avoid potential sign-extension bug when 29383 printing invalid l_type or l_whence fields. 29384 29385 Fix printing of fanotify_mark mask argument. 29386 * fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64. 29387 29388 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29389 29390 Fix decoding of epoll_ctl operation argument. 29391 Consistently treat operation argument of epoll_ctl syscall as int 29392 to match the kernel behaviour. 29393 29394 * epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall 29395 to a variable of type unsigned int and use it in all subsequent 29396 checks and lookups. 29397 * tests/epoll_ctl.c (invoke_syscall): New function. 29398 (main): Use it. 29399 29400 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29401 29402 Fix printing of invalid d_type in getdents syscall. 29403 * dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid 29404 potential sign-extension bug when printing invalid d_type. 29405 29406 bfin: fix decoding of cacheflush syscall. 29407 * cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument 29408 using %lu format. Print 3rd argument as flags. 29409 29410 Fix decoding of BPF_MAP_UPDATE_ELEM flags. 29411 * bpf.c (bpf_map_update_elem): Print attr.flags using printxval64. 29412 29413 2016-05-16 Dmitry V. Levin <ldv (a] altlinux.org> 29414 29415 Fix decoding of fcntl/fcntl64 operation argument. 29416 Consistently treat operation argument of fcntl/fcntl64 syscalls as int 29417 to match the kernel behaviour. 29418 29419 * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign 29420 2nd argument of syscall to a variable of type unsigned int 29421 and use it in all subsequent checks and lookups. 29422 * tests/struct_flock.c (invoke_test_syscall): New function. 29423 (test_flock_einval, test_flock): Use it. 29424 * tests/fcntl.c (test_flock64_einval): Use it. 29425 * tests/fcntl64.c (test_flock64_einval, test_flock64): Use it. 29426 29427 2016-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 29428 29429 Rename sprintflags64 to sprintflags. 29430 * defs.h (sprintflags): Remove. 29431 (sprintflags64): Rename to sprintflags. 29432 * util.c (sprintflags64): Rename to sprintflags. 29433 29434 Prepare for transition from sprintflags64 to sprintflags. 29435 * fcntl.c (print_fcntl): Cast 3rd argument of sprintflags 29436 to unsigned long. 29437 * membarrier.c (SYS_FUNC(membarrier)): Likewise. 29438 * prctl.c (SYS_FUNC(prctl)): Likewise. 29439 * poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags 29440 to unsigned short. 29441 29442 2016-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 29443 29444 Rename xlookup64 to xlookup. 29445 * defs.h (xlookup): Remove. 29446 (xlookup64): Rename to xlookup. 29447 * util.c (xlookup64): Rename to xlookup. 29448 29449 Prepare for transition from xlookup64 to xlookup. 29450 * fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): 29451 Cast 2nd argument of xlookup to unsigned long. 29452 * prctl.c (SYS_FUNC(prctl)): Likewise. 29453 * sched.c (SYS_FUNC(sched_getscheduler)): Likewise. 29454 * time.c (do_adjtimex): Likewise. 29455 * ioprio.c (sprint_ioprio): Change type of the argument 29456 and local variables from int to unsigned int. 29457 * keyctl.c (print_keyring_serial_number): Cast 2nd argument 29458 of xlookup to unsigned int. 29459 * net.c (tprint_sock_type): Change type of the argument to unsigned int. 29460 * printmode.c (sprintmode): Likewise. 29461 * printsiginfo.c (printsigval): Change type of si_code argument 29462 to unsigned int. 29463 29464 2016-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 29465 29466 v4l2: fix build with old kernel headers. 29467 Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all 29468 required headers, resulting to omission of V4L2_* constants. 29469 29470 This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files 29471 because they already include all necessary headers themselves. 29472 29473 * configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>, 29474 and <linux/types.h> before <linux/videodev2.h>. 29475 29476 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29477 29478 configure.ac: do not check for sys/ioctl.h and ioctls.h. 29479 Since sys/ioctl.h is included unconditionally when needed 29480 and ioctls.h doesn't exist, these checks are redundant. 29481 29482 * configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h. 29483 29484 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29485 29486 sock.c: include <linux/ioctl.h> instead of <sys/ioctl.h> or <ioctls.h> 29487 Include <linux/ioctl.h> for <linux/sockios.h> on alpha, sh, and sh64 29488 architectures because their <asm/sockios.h> use _IOR and _IOW macros 29489 but don't include anything that would define these macros. 29490 29491 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 29492 no benefits in this case. <ioctls.h> simply doesn't exist. 29493 29494 * sock.c [ALPHA || SH || SH64]: Include <linux/ioctl.h> 29495 instead of <sys/ioctl.h> or <ioctls.h>. 29496 29497 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29498 29499 v4l2: include <linux/ioctl.h> instead of <sys/ioctl.h> 29500 Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings 29501 no benefits for parser of VIDIOC_* ioctls. 29502 29503 * v4l2.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 29504 29505 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29506 29507 printsiginfo: remove "verbose" argument. 29508 Remove erroneous use of verbose(tcp) as a printing limit 29509 for already fetched members of siginfo_t structure. 29510 29511 * printsiginfo.h (printsiginfo): Remove boolean argument. 29512 * printsiginfo.c (printsigval): Remove boolean argument, print 29513 si_int and si_ptr members unconditionally. All callers changed. 29514 (print_si_info): Remove boolean argument, print si_utime and si_stime 29515 members unconditionally. All callers changed. 29516 (printsiginfo): Remove boolean argument. All callers changed. 29517 29518 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29519 29520 tests/ptrace.c: tweak magic constants to make the test more reliable. 29521 * tests/ptrace.c (main): Change bad_request and bad_data to make they 29522 lower 32-bit parts closer to -1U. 29523 29524 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29525 29526 tests/ioctl_v4l2.c: fix build on older systems. 29527 Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or 29528 V4L2_CTRL_CLASS_CAMERA. 29529 29530 * tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the 29531 test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING]. 29532 Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER. 29533 29534 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29535 29536 Do not use htole32 function. 29537 htole32 function is not portable enough. 29538 29539 * v4l2.c (print_pixelformat): Rewrite initialization of pixel format 29540 union without using of htole32. 29541 * tests/ioctl_v4l2.c (main): Likewise. 29542 29543 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29544 29545 tests/ioctl_v4l2.c: fix typo. 29546 * tests/ioctl_v4l2.c (main) 29547 [!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected 29548 output string. 29549 29550 tests: check decoding of ptrace syscall. 29551 * tests/ptrace.c: New file. 29552 * tests/ptrace.test: New test. 29553 * tests/.gitignore: Add ptrace. 29554 * tests/Makefile.am (check_PROGRAMS): Likewise. 29555 (DECODER_TESTS): Add ptrace. 29556 29557 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29558 29559 ptrace: decode data argument of PTRACE_PEEKSIGINFO request. 29560 The data argument of PTRACE_PEEKSIGINFO request is a pointer 29561 to siginfo_t array. 29562 29563 * printsiginfo.c (print_siginfo_t): New function. 29564 (print_siginfo_array): New mpers printer. 29565 * process.c (SYS_FUNC(ptrace)): Print data argument of 29566 PTRACE_PEEKSIGINFO request using print_siginfo_array. 29567 29568 2016-05-13 Dmitry V. Levin <ldv (a] altlinux.org> 29569 29570 ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request. 29571 * process.c (SYS_FUNC(ptrace)): Print data argument of 29572 PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog. 29573 29574 ptrace: decode argument of PTRACE_GETEVENTMSG request. 29575 * process.c (SYS_FUNC(ptrace)): Print data argument of 29576 PTRACE_GETEVENTMSG request on exiting using printnum_ulong. 29577 29578 ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests. 29579 * process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK 29580 and PTRACE_SETSIGMASK requests using print_sigset_addr_len. 29581 29582 ptrace: return RVAL_DECODED for requests decoded on entering. 29583 * process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all 29584 ptrace requests except those that are partially decoded in exiting, 29585 29586 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29587 29588 ptrace: print PTRACE_O_* flags using printflags64. 29589 As flags argument has a long integer type, print it using printflags64 29590 because printflags takes unsigned int argument. 29591 29592 * process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags 29593 using printflags64. 29594 29595 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29596 29597 ptrace: print data argument of PTRACE_SEIZE et al requests as flags. 29598 * process.c (SYS_FUNC(ptrace)): Print data argument of 29599 PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags. 29600 29601 ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo 29602 * process.c (SYS_FUNC(ptrace)): Print data argument of 29603 PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests 29604 as a signal number. 29605 29606 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29607 29608 ptrace: decode addr argument of PTRACE_PEEKSIGINFO request. 29609 The addr argument of PTRACE_PEEKSIGINFO request is a pointer to 29610 a struct ptrace_peeksiginfo_args. 29611 29612 * process.c: Include "xlat/ptrace_peeksiginfo_flags.h". 29613 (SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request 29614 as a struct ptrace_peeksiginfo_args. 29615 * xlat/ptrace_peeksiginfo_flags.in: New file. 29616 29617 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29618 29619 ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests. 29620 For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument 29621 contains the size of the buffer pointed to by data argument. 29622 For PTRACE_SECCOMP_GET_FILTER request, addr argument contains 29623 an offset counter. 29624 29625 * process.c (SYS_FUNC(ptrace)): Print addr argument of 29626 PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER 29627 requests using %lu format. 29628 29629 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29630 29631 ptrace: do not print data argument of some requests on sparc. 29632 On sparc, kernel ignores data argument of PTRACE_GETREGS, 29633 PTRACE_SETREGS, PTRACE_GETFPREGS, and PTRACE_SETFPREGS requests. 29634 29635 * process.c (SYS_FUNC(ptrace)) [SPARC || SPARC64]: Return RVAL_DECODED 29636 right after printing addr argument if request is one of PTRACE_GETREGS, 29637 PTRACE_SETREGS, PTRACE_GETFPREGS, or PTRACE_SETFPREGS. 29638 29639 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29640 29641 ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests 29642 As kernel ignores addr and data arguments of PTRACE_ATTACH, 29643 PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request, 29644 we do not print them either. 29645 29646 * process.c (SYS_FUNC(ptrace)): After printing pid argument, return 29647 RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT, 29648 PTRACE_KILL, or PTRACE_LISTEN. 29649 29650 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29651 29652 ptrace: do not print arguments of PTRACE_TRACEME request. 29653 As kernel ignores arguments of PTRACE_TRACEME request, 29654 we do not print them either. 29655 29656 * process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME, 29657 return early with RVAL_DECODED. 29658 29659 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29660 29661 ptrace: print request using printxval64. 29662 As first argument of ptrace syscall has a long integer type, print 29663 it using printxval64 because printxval takes unsigned int argument. 29664 29665 * process.c (SYS_FUNC(ptrace)): Change type of "request" variable 29666 from "long" to "unsigned long", print it using printxval64 instead 29667 of printxval. 29668 29669 2016-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 29670 29671 Do not sign-extend siginfo_t.si_syscall. 29672 * printsiginfo.c (print_si_info): Explicitly cast si_syscall member 29673 of siginfo_t that has type "int" to "unsigned int", to avoid sign 29674 extension when passed to syscall_name function. 29675 29676 Export print_seccomp_fprog for further use in parser of ptrace syscall. 29677 * defs.h (print_seccomp_fprog): New prototype. 29678 * seccomp.c (print_seccomp_fprog): Remove "static" keyword. 29679 Move printing of struct seccomp_fprog fields ... 29680 (print_seccomp_filter): ... here. 29681 29682 2016-05-11 Fei Jie <feij.fnst (a] cn.fujitsu.com> 29683 29684 tests: add munlockall.test. 29685 * tests/munlockall.c: New file. 29686 * tests/munlockall.test: New test. 29687 * tests/.gitignore: Add munlockall. 29688 * tests/Makefile.am (check_PROGRAMS): Likewise. 29689 (DECODER_TESTS): Add munlockall.test. 29690 29691 tests: add link.test. 29692 * tests/link.c: New file. 29693 * tests/link.test: New test. 29694 * tests/.gitignore: Add link. 29695 * tests/Makefile.am (check_PROGRAMS): Likewise. 29696 (DECODER_TESTS): Add link.test. 29697 29698 2016-05-11 Dmitry V. Levin <ldv (a] altlinux.org> 29699 29700 tests: check decoding and dumping of preadv2 and pwritev2 syscalls. 29701 * tests/preadv2-pwritev2.c: New file. 29702 * tests/preadv2-pwritev2.test: New test. 29703 * tests/.gitignore: Add preadv2-pwritev2. 29704 * tests/Makefile.am (check_PROGRAMS): Likewise. 29705 (DECODER_TESTS): Add preadv2-pwritev2. 29706 29707 Implement decoding of preadv2 and pwritev2 syscalls. 29708 * io.c: Include "xlat/rwf_flags.h". 29709 (do_preadv, do_pwritev, SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): 29710 New functions. 29711 (SYS_FUNC(preadv)): Use do_preadv. 29712 (SYS_FUNC(pwritev)): Use do_pwritev. 29713 * linux/32/syscallent.h (preadv2, pwritev2): New entries. 29714 * linux/64/syscallent.h: Likewise. 29715 * linux/arm/syscallent.h: Likewise. 29716 * linux/hppa/syscallent.h: Likewise. 29717 * linux/i386/syscallent.h: Likewise. 29718 * linux/ia64/syscallent.h: Likewise. 29719 * linux/m68k/syscallent.h: Likewise. 29720 * linux/mips/syscallent-n32.h: Likewise. 29721 * linux/mips/syscallent-n64.h: Likewise. 29722 * linux/mips/syscallent-o32.h: Likewise. 29723 * linux/powerpc/syscallent.h: Likewise. 29724 * linux/powerpc64/syscallent.h: Likewise. 29725 * linux/s390/syscallent.h: Likewise. 29726 * linux/s390x/syscallent.h: Likewise. 29727 * linux/sparc/syscallent.h: Likewise. 29728 * linux/sparc64/syscallent.h: Likewise. 29729 * linux/x32/syscallent.h: Likewise. 29730 * linux/x86_64/syscallent.h: Likewise. 29731 * syscall.c (dumpio): Handle SEN_preadv2 and SEN_pwritev2. 29732 * xlat/rwf_flags.in: New file. 29733 * NEWS: Mention parsers of new syscalls. 29734 29735 2016-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 29736 29737 tests: extend test coverage of xattr family syscalls. 29738 * tests/xattr.c: Check decoding of all xattr family syscalls. 29739 * tests/xattr.test: Use run_strace_match_diff. 29740 * tests/xattr.expected: Remove. 29741 * tests/Makefile.am (EXTRA_DIST): Remove it. 29742 29743 tests: add print_quoted_memory function to libtests. 29744 * tests/print_quoted_string.c (print_quoted_memory): New function. 29745 (print_quoted_string): Use it. 29746 * tests/tests.h (print_quoted_memory): New prototype. 29747 29748 Fix corner cases of xattr family syscalls decoding. 29749 * xattr.c (print_xattr_val): Do not take insize into account, print it 29750 as unsigned long. 29751 Do not decode xattr values of size larger than XATTR_SIZE_MAX. 29752 Use static buffer for fetching xattr values. 29753 (print_xattr_list): Do not decode string when size is zero. 29754 29755 2016-05-10 Dr. David Alan Gilbert <dgilbert (a] redhat.com> 29756 29757 userfaultfd: Add ioctl tests. 29758 * tests/ioctl_uffdio.c: New file. 29759 * tests/ioctl_uffdio.test: New test. 29760 * tests/.gitignore: Add ioctl_uffdio. 29761 * tests/Makefile.am (check_PROGRAMS): Likewise. 29762 (DECODER_TESTS): Add ioctl_uffdio.test. 29763 29764 2016-05-10 Dr. David Alan Gilbert <dgilbert (a] redhat.com> 29765 29766 Decode UFFDIO_* ioctls. 29767 Decode the ioctls associated with the userfaultfd fd. 29768 Note that they tend to read from and also return result in it's data 29769 structure. 29770 29771 * configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h. 29772 * userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder. 29773 * defs.h (uffdio_ioctl): New prototype. 29774 * ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in 29775 uffdio_ioctl. 29776 * xlat/uffd_*.in: Create flag xlat for all the IOCTLs. 29777 29778 2016-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 29779 29780 Update AX_CODE_COVERAGE. 29781 * m4/ax_code_coverage.m4: Update to serial 16. 29782 * Makefile.am (CODE_COVERAGE_LCOV_OPTIONS): Remove. 29783 (CODE_COVERAGE_GENHTML_OPTIONS): Update, add prefix. 29784 (CODE_COVERAGE_BRANCH_COVERAGE): Set to 1. 29785 29786 strace-ff.test: fix race condition. 29787 * tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command. 29788 29789 tests/epoll_pwait.c: fix for x32. 29790 * tests/epoll_pwait.c (main): Explicitly cast last syscall argument 29791 to kernel_ulong_t. 29792 29793 strace-S.test: check "-S name" 29794 * tests/strace-S.test: Add a check for "-c -S name" output. 29795 29796 Fix NULL dereference in "-S name" when syscall table has holes. 29797 * count.c (syscall_cmp): Do not pass NULL to strcmp. 29798 29799 strace-S.test: cleanup. 29800 * tests/strace-S.test: Rewrite using sed. 29801 29802 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 29803 29804 tests: add strace-S.test. 29805 * tests/strace-S.test: New test. 29806 * tests/Makefile.am (MISC_TESTS): Add it. 29807 29808 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 29809 29810 strace-ff.test: check that -ff does not create unexpected output files. 29811 * tests/strace-ff.expected: New file. 29812 * tests/Makefile.am (EXTRA_DIST): Add it. 29813 * tests/strace-ff.test: Use it. Check that no other output files 29814 have been created. 29815 29816 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 29817 29818 tests: add strace-ff.test. 29819 * tests/strace-ff.test: New test. 29820 * tests/Makefile.am (MISC_TESTS): Add it. 29821 29822 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 29823 29824 strace-V.test: cleanup. 29825 * tests/strace-V.test: Move config.h parser to a function. 29826 Rename $OUT to $EXP, swap arguments passed to match_diff. 29827 29828 2016-05-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 29829 29830 tests: add strace-V.test. 29831 * tests/strace-V.test: New test. 29832 * tests/Makefile.am (MISC_TESTS): Add it. 29833 29834 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 29835 29836 tests: check decoding of epoll_pwait syscall. 29837 * tests/epoll_pwait.c: New file. 29838 * tests/epoll_pwait.test: New test. 29839 * tests/.gitignore: Add epoll_pwait. 29840 * tests/Makefile.am (check_PROGRAMS): Likewise. 29841 (DECODER_TESTS): Add epoll_pwait.test. 29842 29843 2016-05-09 Dmitry V. Levin <ldv (a] altlinux.org> 29844 29845 Assume that sys/epoll.h exists. 29846 This header file was added in glibc-2.3.2, 29847 so it's safe to assume its availability. 29848 29849 * configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h. 29850 * epoll.c: Include <sys/epoll.h> unconditionally. 29851 Compile [HAVE_SYS_EPOLL_H] code unconditionally. 29852 * tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H. 29853 * tests/epoll_wait.c: Likewise. 29854 29855 2016-05-08 Fabien Siron <fabien.siron (a] epita.fr> 29856 29857 Factorize send_query functions. 29858 * socketutils.c (send_query): New function. 29859 (inet_send_query, unix_send_query): Use it. 29860 29861 2016-05-08 Dmitry V. Levin <ldv (a] altlinux.org> 29862 29863 tests: relax timings. 29864 Allow nanosleep(2) to spend 10% more time to make the test suite 29865 more reliable on slow systems. 29866 29867 * tests/count.test: Treat 1.1 seconds as valid output. 29868 * tests/strace-T.expected: Likewise. 29869 * tests/strace-r.expected: Likewise. 29870 29871 2016-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 29872 29873 tests/attach-f-p.c: increase timeouts. 29874 Increase timeouts to make the test more reliable on slow systems. 29875 29876 * tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds, 29877 respectively. 29878 29879 2016-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 29880 29881 Remove unused functions. 29882 * defs.h (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): 29883 Remove. 29884 * util.c (umove_ulong_or_printaddr, umove_ulong_array_or_printaddr): 29885 Likewise. 29886 29887 v4l2.c: use print_array function. 29888 * v4l2.c (print_v4l2_ext_control, umoven_or_printaddr_ignore_syserror): 29889 New functions. 29890 (print_v4l2_ext_controls): Use them via print_array. 29891 29892 uid.c: use print_array function. 29893 * uid.c (print_gid): New function. 29894 (print_groups): Use it via print_array. 29895 29896 seccomp.c: use print_array function. 29897 * seccomp.c (decode_filter, decode_seccomp_fprog): Remove. 29898 (print_bpf_filter): New function. 29899 (print_seccomp_fprog): Use it via print_array. 29900 * tests/seccomp-filter-v.c (main): Update. 29901 29902 scsi.c: use print_array function. 29903 * scsi.c (print_uchar): New function. 29904 (print_sg_io_buffer): Use it via print_array. 29905 29906 poll.c: use print_array function. 29907 * poll.c (print_pollfd): Change for use as print_array callback. 29908 (decode_poll_entering): Use print_array. 29909 * tests/poll.c: Update. 29910 * tests/poll.test: Update. 29911 29912 numa.c: use print_array function. 29913 * numa.c (print_node): New function. 29914 (print_nodemask): Use it via print_array. 29915 (print_page_array, print_int_array): Remove. 29916 (print_addr): New function. 29917 (print_status, print_int): Change for use as print_array callback. 29918 (SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status 29919 via print_array. 29920 * tests/move_pages.c: Update. 29921 * tests/set_mempolicy.c: Likewise. 29922 * tests/set_mempolicy.test: Likewise. 29923 29924 mem.c: use print_array function. 29925 * mem.c [POWERPC] (print_protmap_entry): New function. 29926 [POWERPC] (SYS_FUNC(subpage_prot)): Use it via print_array. 29927 29928 kexec.c: use print_array function. 29929 * kexec.c (print_seg): Change for use as print_array callback. 29930 (print_kexec_segments): Use print_array. 29931 29932 ipc_sem.c: use print_array function. 29933 * ipc_sem.c (tprint_sembuf): Rename to print_sembuf, change signature 29934 for use as print_array callback. 29935 (tprint_sembuf_array): Use print_array. 29936 29937 io.c: use print_array function. 29938 * io.c (print_iovec_config): New structure. 29939 (print_iovec): New function. 29940 (tprint_iov_upto): Use print_array. 29941 * tests/preadv.c (main): Update. 29942 * tests/pwritev.c (print_iovec, main): Likewise. 29943 29944 epoll.c: use print_array function. 29945 * epoll.c (print_epoll_event): Change signature for use as print_array 29946 callback, all users updated. 29947 (print_epoll_event_array): Remove. 29948 (epoll_wait_common): Change to use print_array instead 29949 of print_epoll_event_array. 29950 29951 aio.c: use print_array function. 29952 * aio.c (print_iocbp): New function. 29953 (SYS_FUNC(io_submit)): Use it via print_array. Use widen_to_long 29954 to process long int argument. 29955 (print_io_event): Change to print struct io_event fetched elsewhere. 29956 (SYS_FUNC(io_cancel)): Update use of print_io_event. 29957 (SYS_FUNC(io_getevents)): Use print_io_event via print_array. 29958 Use widen_to_long to print long int arguments. 29959 * tests/aio.c (main): Check decoding of io_submit with negative "nr". 29960 29961 Introduce print_array function for consistent decoding of arrays. 29962 * defs.h (print_array): New prototype. 29963 * util.c (print_array): New function. 29964 29965 2016-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 29966 29967 Fix corner cases of ICMP_FILTER decoding. 29968 * net.c (print_icmp_filter): Print icmp_filter for any positive length. 29969 * tests/net-icmp_filter.c: New file. 29970 * tests/net-icmp_filter.test: New test. 29971 * tests/.gitignore: Add net-icmp_filter. 29972 * tests/Makefile.am (check_PROGRAMS): Likewise. 29973 (DECODER_TESTS): Add net-icmp_filter.test. 29974 29975 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 29976 29977 xlat: do not strip "1<<" prefix from xlat strings. 29978 * xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix 29979 from xlat strings to fix incorrect output. 29980 * tests/caps.awk: Update. 29981 29982 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 29983 29984 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 29985 29986 tests/xstatfsx.c: fix mips o32 support. 29987 mips o32 differs from all other 32-bit architectures by defining 29988 __kernel_fsid_t structure as an array of long ints. 29989 29990 * tests/xstatfsx.c (print_statfs): Explicitly cast elements 29991 of PRINT_F_FSID array to unsigned int. 29992 29993 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 29994 29995 Mpersify VIDIOC_* ioctl parser. 29996 * v4l2.c: Mpersify arch-specific structures. 29997 (v4l2_ioctl): Mpersify. 29998 * tests/ioctl_v4l2.c: New file. 29999 * tests/ioctl_v4l2.test: New test. 30000 * tests/.gitignore: Add ioctl_v4l2. 30001 * tests/Makefile.am (check_PROGRAMS): Likewise. 30002 (DECODER_TESTS): Add ioctl_v4l2.test. 30003 30004 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 30005 30006 Mpersify ioctl macros. 30007 As values of some ioctl macros differ between personalities, these 30008 personality specific ioctl macros should be properly defined for 30009 mpersified code. Implement this by redefining personality specific 30010 ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS. 30011 30012 * Makefile.am (ioctl_macros_h): New variable. 30013 (ioctl_macros%.h): New rule. 30014 (BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h). 30015 (m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS. 30016 * defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro. 30017 [HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise. 30018 30019 Acked-by: Elvira Khabirova <lineprinter0 (a] gmail.com> 30020 30021 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 30022 30023 Fix decoding of VIDIOC_* ioctls. 30024 * v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls. 30025 * tests/ioctl.c (main): Update. 30026 30027 2016-05-05 Dmitry V. Levin <ldv (a] altlinux.org> 30028 30029 nsyscalls.test: add mips o32 support. 30030 Out-of-range syscalls looks differently on mips o32. 30031 30032 * tests/nsyscalls.c (main): Handle LINUX_MIPSO32. 30033 * tests/nsyscalls.test: Trace syscall called "syscall" on mips. 30034 30035 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30036 30037 Remove initialization of big holes in syscallent.h files. 30038 There is no need to explicitly initialize big holes after conversion 30039 of syscallent.h files to use designated initializers. For architectures 30040 that have some data at the end of syscallent.h this initialization of 30041 big holes is no-op, for others it just inflates the table unnecessarily. 30042 30043 * linux/arc/syscallent.h: Remove initialization of arch specific block 30044 at the end of table. 30045 * linux/metag/syscallent.h: Likewise. 30046 * linux/nios2/syscallent.h: Likewise. 30047 * linux/or1k/syscallent.h: Likewise. 30048 * linux/tile/syscallent.h: Likewise. 30049 * linux/tile/syscallent1.h: Likewise. 30050 * linux/arm/syscallent.h: Remove explicit initialization of a big hole 30051 before socket subcalls. 30052 * linux/i386/syscallent.h: Likewise. 30053 * linux/m68k/syscallent.h: Likewise. 30054 * linux/mips/syscallent-n32.h: Likewise. 30055 * linux/powerpc/syscallent.h: Likewise. 30056 * linux/powerpc64/syscallent.h: Likewise. 30057 * linux/s390/syscallent.h: Likewise. 30058 * linux/s390x/syscallent.h: Likewise. 30059 * linux/sh/syscallent.h: Likewise. 30060 * linux/sh64/syscallent.h: Likewise. 30061 * linux/sparc/syscallent.h: Likewise. 30062 * linux/sparc64/syscallent.h: Likewise. 30063 * linux/mips/syscallent-compat.h: Remove explicit initialization 30064 of big holes between different mips ABIs. 30065 * linux/mips/syscallent-n64.h: Remove explicit initialization 30066 of big holes before socket subcalls and between different mips ABIs. 30067 * linux/mips/syscallent-o32.h: Likewise. 30068 30069 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30070 30071 xlat: make "1<<val" syntax work with 64-bit values. 30072 * xlat/gen.sh(cond_xlat, gen_header): Generate 1UUL<<val 30073 for 1<<val syntax. 30074 30075 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 30076 30077 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30078 30079 Fix typo in XLAT_TYPE_PAIR. 30080 * xlat.h (XLAT_TYPE_PAIR): Take "type" parameter. 30081 30082 Reported-by: Dr. David Alan Gilbert <dgilbert (a] redhat.com> 30083 30084 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30085 30086 Fix decoding of move_pages syscall. 30087 * numa.c (print_page_array, print_status, print_int, print_int_array): 30088 New functions. 30089 (SYS_FUNC(move_pages)): Rewrite using these functions. 30090 * tests/move_pages.c: New file. 30091 * tests/move_pages.test: New test. 30092 * tests/.gitignore: Add move_pages. 30093 * tests/Makefile.am (check_PROGRAMS): Likewise. 30094 (DECODER_TESTS): Add move_pages.test. 30095 30096 tests: check decoding of mbind syscall. 30097 * tests/mbind.c: New file. 30098 * tests/mbind.test: New test. 30099 * tests/.gitignore: Add mbind. 30100 * tests/Makefile.am (check_PROGRAMS): Likewise. 30101 (DECODER_TESTS): Add mbind.test. 30102 30103 2016-04-29 Jeff Mahoney <jeffm (a] suse.com> 30104 30105 Change type of struct xlat.val to uint64_t. 30106 Some ioctls have flags fields that are 64-bit. A 32-bit val means 30107 these flags will never be matched or printed. 30108 30109 * xlat.h: Include <stdint.h>. 30110 (struct xlat): Change type of val to uint64_t. 30111 30112 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30113 30114 xlat: extend syntax with #val_type directive. 30115 When #val_type directive is encountered, gen.sh starts using 30116 XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR, 30117 with #val_type's argument as a type. 30118 30119 For example, "#val_type uint64_t" means values of type uint64_t. 30120 30121 * xlat/gen.sh (gen_header, print_xlat, print_xlat_pair): 30122 Add val_type support. 30123 30124 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30125 30126 xlat/gen.sh: prepare for adding #val_type directive support. 30127 This is essentially a no-op change that makes the following change 30128 easier to read. 30129 30130 * xlat/gen.sh (print_xlat, print_xlat_pair): New functions. 30131 (cond_xlat, gen_header): Use them. 30132 30133 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30134 30135 Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros. 30136 * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts 30137 to the specified type instead of unsigned int. 30138 (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts 30139 to the specified type instead of unsigned int. 30140 30141 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30142 30143 xlat: generate xlat pairs using new XLAT_PAIR macro. 30144 Before this change there were two forms of xlat entries: those that use XLAT 30145 or XLAT_END macros, and others verbatim entries. This change converts 30146 the latter to use new XLAT_PAIR macro. 30147 30148 This is necessary for the upcoming change of xlat.val type. 30149 30150 * xlat.h (XLAT_PAIR): New macro. 30151 * xlat/gen.sh (cond_xlat, gen_header): Use it. 30152 30153 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30154 30155 Explicitly cast argument of XLAT macro to unsigned int. 30156 This is necessary for the upcoming change of xlat.val type. 30157 30158 * xlat.h (XLAT): Cast the argument to unsigned int. 30159 30160 2016-04-29 Dmitry V. Levin <ldv (a] altlinux.org> 30161 30162 Change type of {s,t}print_open_modes's argument to unsigned. 30163 As "flags" argument of sprint_open_modes and tprint_open_modes is 30164 involved only in bit operations, change its type to unsigned. 30165 30166 * defs.h.c (sprint_open_modes, tprint_open_modes): Change type 30167 to unsigned int. 30168 * open.c (sprint_open_modes, tprint_open_modes): Likewise. 30169 30170 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30171 30172 tests/remap_file_pages.c: fix for the upcoming change of xlat.val type. 30173 The "flags" argument of remap_file_page syscall has type "unsigned 30174 long", so it is not correct to load most significant bits with garbage 30175 ans assume they are going to be ignored. 30176 30177 * tests/remap_file_pages.c (main): Remove artificial garbage from flags. 30178 30179 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30180 30181 Introduce printflags64 function. 30182 This is necessary for the upcoming change of xlat.val type. 30183 30184 * defs.h (printflags): Rename to printflags64, change type of integer 30185 argument to uint64_t. 30186 (printflags): New static inline function. 30187 * util.c (printflags): Rename to printflags64, change type of integer 30188 argument to uint64_t. Print it using PRIx64 format. 30189 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 30190 30191 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30192 30193 Introduce sprintflags64 function. 30194 This is necessary for the upcoming change of xlat.val type. 30195 30196 * defs.h (sprintflags): Rename to sprintflags64, change type of integer 30197 argument to uint64_t. 30198 (sprintflags): New static inline function. 30199 * util.c (sprintflags): Rename to sprintflags64, change type of integer 30200 argument to uint64_t. Print it using PRIx64 format. 30201 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 30202 30203 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30204 30205 printxvals: change type of integer argument to uint64_t. 30206 This is necessary for the upcoming change of xlat.val type. 30207 All users of printxvals are already prepared for this change. 30208 30209 * defs.h (printxvals): Change type of integer argument to uint64_t. 30210 * util.c (printxvals): Likewise. Print it using PRIx64 format. 30211 Patch by Jeff Mahoney <jeffm (a] suse.com>. 30212 30213 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30214 30215 xlat_search: change type of integer argument to uint64_t. 30216 This is necessary for the upcoming change of xlat.val type. 30217 All users of addflags are already prepared for this change. 30218 30219 * defs.h (xlat_search): Change type of integer argument to uint64_t. 30220 * util.c (xlat_search): Likewise. Pass it by pointer. 30221 (xlat_bsearch_compare): Treat first argument as a pointer. 30222 Patch by Jeff Mahoney <jeffm (a] suse.com>. 30223 30224 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30225 30226 Introduce xlookup64 function. 30227 This is necessary for the upcoming change of xlat.val type. 30228 30229 * defs.h (xlookup): Rename to xlookup64, change type of integer argument 30230 to uint64_t. 30231 (xlookup): New static inline function. 30232 * util.c (xlookup): Rename to xlookup64, change type of integer 30233 argument to uint64_t. 30234 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 30235 30236 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30237 30238 addflags: change type of integer argument to uint64_t. 30239 This is necessary for the upcoming change of xlat.val type. 30240 All users of addflags are already prepared for this change. 30241 30242 * defs.h (addflags): Change type of integer argument to uint64_t. 30243 * util.c (addflags): Likewise. Print it using PRIx64 format. 30244 Based on patch by Jeff Mahoney <jeffm (a] suse.com>. 30245 30246 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30247 30248 Introduce printxval64 wrapper. 30249 This is necessary for the upcoming change of xlat.val type. 30250 30251 * defs.h (printxval64): New static inline function. 30252 30253 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30254 30255 Turn printxval macro into a static inline function. 30256 This is necessary for the upcoming change of xlat.val type. 30257 30258 * defs.h (printxval): Change to static inline function. 30259 30260 2016-04-28 Dmitry V. Levin <ldv (a] altlinux.org> 30261 30262 tests: check decoding of migrate_pages syscall. 30263 * tests/migrate_pages.c: New file. 30264 * tests/migrate_pages.test: New test. 30265 * tests/.gitignore: Add migrate_pages. 30266 * tests/Makefile.am (check_PROGRAMS): Likewise. 30267 (DECODER_TESTS): Add migrate_pages.test. 30268 30269 Fix decoding of migrate_pages syscall. 30270 * numa.c (SYS_FUNC(migrate_pages)): Print syscall arguments 30271 in the right order. 30272 30273 tests: check decoding of set_mempolicy syscall. 30274 * tests/set_mempolicy.c: New file. 30275 * tests/set_mempolicy.test: New test. 30276 * tests/.gitignore: Add set_mempolicy. 30277 * tests/Makefile.am (check_PROGRAMS): Likewise. 30278 (DECODER_TESTS): Add set_mempolicy.test. 30279 30280 tests: check decoding of get_mempolicy syscall. 30281 * tests/get_mempolicy.c: New file. 30282 * tests/get_mempolicy.test: New test. 30283 * tests/.gitignore: Add get_mempolicy. 30284 * tests/Makefile.am (check_PROGRAMS): Likewise. 30285 (DECODER_TESTS): Add get_mempolicy.test. 30286 30287 numa: fix decoding of nodemask arrays. 30288 * numa.c (get_nodes): Rewrite an rename to print_nodemask. 30289 All callers updated. 30290 (SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)): 30291 Print a delimiter before nodemask argument. 30292 30293 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 30294 30295 Fix decoding of policy argument of get_mempolicy syscall. 30296 * numa.c (SYS_FUNC(get_mempolicy)): Print policy argument in square 30297 brackets to indicate indirect access. 30298 30299 Fix decoding of pid_t argument of migrate_pages syscall. 30300 * numa.c (SYS_FUNC(migrate_pages)): Print pid_t syscall 30301 argument using %d format. 30302 30303 tests: add printxval function to libtests. 30304 * tests/tests.h (printxval): New prototype. 30305 * tests/printxval.c: New file. 30306 * tests/Makefile.am (libtests_a_SOURCES): Add it. 30307 30308 tests: check decoding of remap_file_pages syscall. 30309 * tests/remap_file_pages.c: New file. 30310 * tests/remap_file_pages.test: New test. 30311 * tests/.gitignore: Add remap_file_pages. 30312 * tests/Makefile.am (check_PROGRAMS): Likewise. 30313 (DECODER_TESTS): Add remap_file_pages.test. 30314 30315 2016-04-27 Fei Jie <feij.fnst (a] cn.fujitsu.com> 30316 30317 tests: add pause.test. 30318 * tests/pause.c: New file. 30319 * tests/pause.test: New test. 30320 * tests/.gitignore: Add pause. 30321 * tests/Makefile.am (check_PROGRAMS): Likewise. 30322 (DECODER_TESTS): Add pause.test. 30323 30324 tests: add kill.test. 30325 * tests/kill.c: New file. 30326 * tests/kill.test: New test. 30327 * tests/.gitignore: Add kill. 30328 * tests/Makefile.am (check_PROGRAMS): Likewise. 30329 (DECODER_TESTS): Add kill.test. 30330 30331 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 30332 30333 Fix decoding of pid_t arguments of kill and tgkill syscalls. 30334 * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Print pid_t syscall 30335 arguments using %d format. 30336 30337 2016-04-27 Fei Jie <feij.fnst (a] cn.fujitsu.com> 30338 30339 tests: add mlock.test. 30340 * tests/mlock.c: New file. 30341 * tests/mlock.test: New test. 30342 * tests/.gitignore: Add mlock. 30343 * tests/Makefile.am (check_PROGRAMS): Likewise. 30344 (DECODER_TESTS): Add mlock.test. 30345 30346 2016-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 30347 30348 Move parsers of NUMA related syscalls to numa.c. 30349 * mem.c (get_nodes, SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), 30350 SYS_FUNC(get_mempolicy), SYS_FUNC(migrate_pages), SYS_FUNC(move_pages)): 30351 Move ... 30352 * numa.c: ... here. 30353 * Makefile.am (strace_SOURCES): Add numa.c 30354 30355 tests/umovestr3.c: robustify against os specific issues. 30356 * tests/umovestr3.c (main): Create extra gap before unreadable page. 30357 30358 tests: extend test coverage of umovestr short read condition. 30359 * tests/umovestr3.c: New file. 30360 * tests/umovestr3.test: New test. 30361 * tests/.gitignore: Add umovestr3. 30362 * tests/Makefile.am (check_PROGRAMS): Likewise. 30363 (DECODER_TESTS): Add umovestr3.test. 30364 30365 tests: check decoding of out-of-range syscalls. 30366 * tests/nsyscalls.c: New file. 30367 * tests/nsyscalls.test: New test. 30368 * tests/.gitignore: Add nsyscalls. 30369 * tests/Makefile.am (check_PROGRAMS): Likewise. 30370 (DECODER_TESTS): Add nsyscalls.test. 30371 30372 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30373 30374 Fix decoding of 3rd argument of getdents/getdents64 syscalls. 30375 * dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument 30376 as unsigned int. 30377 * dirent64.c (SYS_FUNC(getdents64)): Likewise. 30378 * tests/getdents.c (main): Check it. 30379 * tests/getdents64.c (main): Likewise. 30380 30381 Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument. 30382 * reboot.c (SYS_FUNC(reboot)): Cast numeric arguments to unsigned int. 30383 30384 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30385 30386 .travis.yml: raise sleep delay. 30387 Previous sleep delay value seems to be not enough nowadays. 30388 30389 .travis.yml (SLEEP_A_BIT): Raise sleep delay. 30390 30391 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30392 30393 Move definitions of MPOL_* constants to xlat files. 30394 * mem.c (MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND, MPOL_INTERLEAVE): 30395 Move to xlat/policies.in. 30396 (MPOL_F_NODE, MPOL_F_ADDR): Move to xlat/mempolicyflags.in. 30397 (MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL): Move 30398 to xlat/mbindflags.in. 30399 30400 tests: check decoding of renameat2 syscall. 30401 * tests/renameat2.c: New file. 30402 * tests/renameat2.test: New test. 30403 * tests/.gitignore: Add renameat2. 30404 * tests/Makefile.am (check_PROGRAMS): Likewise. 30405 (DECODER_TESTS): Add renameat2.test. 30406 30407 Add default values for RENAME_* constants. 30408 * xlat/rename_flags.in: Add default values. 30409 30410 tests: check decoding of utimes syscall. 30411 * tests/utimes.c: New file. 30412 * tests/utimes.test: New test. 30413 * tests/.gitignore: Add utimes. 30414 * tests/Makefile.am (check_PROGRAMS): Likewise. 30415 (DECODER_TESTS): Add utimes.test. 30416 30417 tests: check decoding of futimesat syscall. 30418 * tests/futimesat.c: New file. 30419 * tests/futimesat.test: New test. 30420 * tests/.gitignore: Add futimesat. 30421 * tests/Makefile.am (check_PROGRAMS): Likewise. 30422 (DECODER_TESTS): Add futimesat.test. 30423 30424 tests: extend test coverage of mknod syscall. 30425 * mknod.c (main): Check more corner cases of mode_t parser. 30426 * mknod.test: Update. 30427 30428 2016-04-26 Fei Jie <feij.fnst (a] cn.fujitsu.com> 30429 30430 tests: add sched_yield.test. 30431 * tests/sched_yield.c: New file. 30432 * tests/sched_yield.test: New test. 30433 * tests/.gitignore: Add sched_yield. 30434 * tests/Makefile.am (check_PROGRAMS): Likewise. 30435 (DECODER_TESTS): Add sched_yield.test. 30436 30437 tests: add sync.test. 30438 * tests/sync.c: New file. 30439 * tests/sync.test: New test. 30440 * tests/.gitignore: Add sync. 30441 * tests/Makefile.am (check_PROGRAMS): Likewise. 30442 (DECODER_TESTS): Add sync.test. 30443 30444 tests: add mknodat.test. 30445 * tests/mknodat.c: New file. 30446 * tests/mknodat.test: New test. 30447 * tests/.gitignore: Add mknodat. 30448 * tests/Makefile.am (check_PROGRAMS): Likewise. 30449 (DECODER_TESTS): Add mknodat.test. 30450 30451 tests: add unlink.test. 30452 * tests/unlink.c: New file. 30453 * tests/unlink.test: New test. 30454 * tests/.gitignore: Add unlink. 30455 * tests/Makefile.am (check_PROGRAMS): Likewise. 30456 (DECODER_TESTS): Add unlink.test. 30457 30458 tests: add reboot.test. 30459 * tests/reboot.c: New file. 30460 * tests/reboot.test: New test. 30461 * tests/.gitignore: Add reboot. 30462 * tests/Makefile.am (check_PROGRAMS): Likewise. 30463 (DECODER_TESTS): Add reboot.test. 30464 30465 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30466 30467 Fix decoding of statfs family syscalls. 30468 Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls 30469 by rewriting them using mpers infrastructure. 30470 30471 * fetch_struct_statfs.c: New file. 30472 * fstatfs.c: Likewise. 30473 * fstatfs64.c: Likewise. 30474 * print_statfs.c: Likewise. 30475 * statfs.h: Likewise. 30476 * statfs64.c: Likewise. 30477 * statfs.c: Remove everything except SYS_FUNC(statfs). 30478 * configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>. 30479 Add checks for struct statfs and struct statfs64 in <asm/statfs.h>. 30480 Add checks for f_frsize and f_flags members of these structures. 30481 * defs.h (struct strace_statfs): New forward declaration. 30482 (print_struct_statfs, print_struct_statfs64): New prototypes. 30483 * Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c, 30484 statfs.c, and statfs64.c. 30485 (strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c, 30486 and statfs.h. 30487 * NEWS: Mention this fix. 30488 * tests/fstatfs.c: New file. 30489 * tests/fstatfs64.c: Likewise. 30490 * tests/statfs64.c: Likewise. 30491 * tests/xstatfs.c: Likewise. 30492 * tests/xstatfs64.c: Likewise. 30493 * tests/xstatfsx.c: Likewise. 30494 * tests/fstatfs.test: New test. 30495 * tests/fstatfs64.test: Likewise. 30496 * tests/statfs64.test: Likewise. 30497 * tests/statfs.c: Rewrite using xstatfs.c. 30498 * tests/statfs.test: Update. 30499 * tests/.gitignore: Add fstatfs, fstatfs64, and statfs64. 30500 * tests/Makefile.am (check_PROGRAMS): Likewise. 30501 (DECODER_TESTS): Add fstatfs.test, fstatfs64.test, and statfs64.test. 30502 (EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c. 30503 30504 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30505 30506 tests: add printflags function to libtests. 30507 * tests/printflags.c: New file. 30508 * tests/tests.h (printflags): New prototype. 30509 * tests/Makefile.am (libtests_a_SOURCES): Add it. 30510 30511 2016-04-26 Dmitry V. Levin <ldv (a] altlinux.org> 30512 30513 Move definition of struct xlat to a separate header file. 30514 Define struct xlat in a separate file so that it could be used later by 30515 tests without inclusion of defs.h header file. 30516 30517 * defs.h (struct xlat, XLAT, XLAT_END): Move ... 30518 * xlat.h: ... here. 30519 * Makefile.am (strace_SOURCES): Add xlat.h. 30520 30521 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 30522 30523 alpha: decode osf_statfs64 and osf_fstatfs64 syscalls. 30524 * linux/alpha/syscallent.h (osf_statfs64, osf_fstatfs64): Set nargs 30525 and handler. 30526 30527 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 30528 30529 alpha: fix decoding of osf_statfs and osf_fstatfs syscalls. 30530 Do not attempt to print struct osf_statfs as if it was the same as 30531 struct statfs. Since struct osf_statfs has never been decoded properly, 30532 it is probably too late to implement a decoder, so let's just print the 30533 pointer. 30534 30535 * statfs.c [ALPHA] (SYS_FUNC(osf_statfs), SYS_FUNC(osf_fstatfs)): Move ... 30536 * alpha.c: ... here. Replace printstatfs with printaddr. 30537 30538 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 30539 30540 statfs: print f_flags field only when ST_VALID flag is set. 30541 * statfs.c (print_statfs_flags): New function. 30542 (printstatfs, printstatfs64, printcompat_statfs64): Use it. 30543 * xlat/statfs_flags.in (ST_VALID): Move to the head of the list. 30544 * tests/statfs.expected: Update. 30545 30546 2016-04-25 Fei Jie <feij.fnst (a] cn.fujitsu.com> 30547 30548 tests: add symlink.test. 30549 * tests/symlink.c: New file. 30550 * tests/symlink.test: New test. 30551 * tests/.gitignore: Add symlink. 30552 * tests/Makefile.am (check_PROGRAMS): Likewise. 30553 (DECODER_TESTS): Add symlink.test. 30554 30555 tests: add rmdir.test. 30556 * tests/rmdir.c: New file. 30557 * tests/rmdir.test: New test. 30558 * tests/.gitignore: Add rmdir. 30559 * tests/Makefile.am (check_PROGRAMS): Likewise. 30560 (DECODER_TESTS): Add rmdir.test. 30561 30562 tests: add setdomainname.test. 30563 * tests/setdomainname.c: New file. 30564 * tests/setdomainname.test: New test. 30565 * tests/.gitignore: Add setdomainname. 30566 * tests/Makefile.am (check_PROGRAMS): Likewise. 30567 (DECODER_TESTS): Add setdomainname.test. 30568 30569 tests: add sched_rr_get_interval.test. 30570 * tests/sched_rr_get_interval.c: New file. 30571 * tests/sched_rr_get_interval.test: New test. 30572 * tests/.gitignore: Add sched_rr_get_interval. 30573 * tests/Makefile.am (check_PROGRAMS): Likewise. 30574 (DECODER_TESTS): Add sched_rr_get_interval.test. 30575 30576 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 30577 30578 statfs: decode f_flags field of struct statfs. 30579 * xlat/statfs_flags.in: New file. 30580 * statfs.c: Include "xlat/statfs_flags.h". 30581 (printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags. 30582 (printstatfs64) [_STATFS_F_FLAGS]: Likewise. 30583 (printcompat_statfs64): Likewise. 30584 * tests/statfs.expected: Update. 30585 30586 2016-04-25 Zev Weiss <zev (a] bewilderbeest.net> 30587 30588 statfs: don't quote f_type macro names. 30589 * statfs.c (sprintfstype): Don't add double-quotes to fs magic macros. 30590 * tests/statfs.expected: Remove double-quotes. 30591 30592 2016-04-25 Dmitry V. Levin <ldv (a] altlinux.org> 30593 30594 tests/shmxt.c: robustify against arch specific issues. 30595 Do not treat failed shmat(SHM_RND) as a test failure. 30596 This change partially reverts commit 30597 bea707377d2ee3e1950bfa43537ef928163a5fa6. 30598 30599 * tests/shmxt.c (main): Use SHM_RND in the second shmat call, 30600 do not treat its potential error as a test failure. 30601 30602 2016-04-23 Dmitry V. Levin <ldv (a] altlinux.org> 30603 30604 Rename PRI__s64 to PRI__d64. 30605 As PRI__*64 macros mirror PRI*64 macros from inttypes.h, follow the 30606 principle of least astonishment and name these macros the same way. 30607 30608 * defs.h (PRI__s64): Rename to PRI__d64. 30609 30610 2016-04-23 Dmitry V. Levin <ldv (a] altlinux.org> 30611 30612 Fix old_mmap output when mmap arguments are unfetchable. 30613 * mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven 30614 to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr 30615 fails. 30616 * tests/old_mmap.c (main): Check it. 30617 30618 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 30619 30620 aarch64: fix old_mmap output for arm personality. 30621 * mem.c (SYS_FUNC(old_mmap)) [AARCH64]: Fetch mmap arguments 30622 as 32-bit integers. 30623 30624 Define old_mmap parser only on architectures that use it. 30625 * mem.c (SYS_FUNC(old_mmap)): Define only on AARCH64, ARM, I386, X86_64, 30626 X32, M68K, S390, and S390X. 30627 30628 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 30629 30630 tests: extend test coverage of mmap syscall. 30631 Check decoding of "old mmap" edition of mmap syscall 30632 on those architectures that define it. 30633 30634 * tests/old_mmap.c: New file. 30635 * tests/old_mmap.test: New test. 30636 * tests/.gitignore: Add old_mmap. 30637 * tests/Makefile.am (check_PROGRAMS): Likewise. 30638 (DECODER_TESTS): Add old_mmap.test. 30639 30640 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 30641 30642 tests: extend test coverage of mincore syscall. 30643 * tests/mincore.c (print_mincore): New function. 30644 (test_mincore): Use it. Check mincore with invalid vec address. 30645 Check mincore with length argument not a multiple of the page size. 30646 (main): Check with DEFAULT_STRLEN pages. 30647 30648 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 30649 30650 Move parsers of sync_file_range and sync_file_range2 syscalls to libstrace 30651 For each given architecture only one of these two syscalls has a 30652 syscallent entry. When each parser is placed into a separate file, 30653 moving to libstrace ensures that only one of them that is need 30654 is linked into strace executable. 30655 30656 * sync_file_range.c (SYS_FUNC(sync_file_range2)): Move ... 30657 * sync_file_range2.c: ... here. 30658 * Makefile.am (strace_SOURCES): Move sync_file_range.c ... 30659 (libstrace_a_SOURCES): ... here. Add sync_file_range2.c. 30660 (strace_SOURCES_c): Add filtered libstrace_a_SOURCES. 30661 30662 2016-04-22 Dmitry V. Levin <ldv (a] altlinux.org> 30663 30664 tests: check decoding of clock_adjtime syscall. 30665 * tests/clock_adjtime.c: New file. 30666 * tests/clock_adjtime.test: New test. 30667 * tests/.gitignore: Add clock_adjtime. 30668 * tests/Makefile.am (check_PROGRAMS): Likewise. 30669 (DECODER_TESTS): Add clock_adjtime.test. 30670 30671 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 30672 30673 tests: do not include <assert.h> unnecessarily. 30674 Automatically change tests/*.c files using the following script: 30675 30676 for f in tests/*.c; do 30677 grep -q '\<assert(' "$f" || 30678 sed -i '/# *include *<assert\.h>/d' "$f" 30679 done 30680 30681 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 30682 30683 tests: do not include <errno.h> unnecessarily. 30684 Automatically change tests/*.c files using the following script: 30685 30686 for f in tests/*.c; do 30687 grep -Fv errno.h "$f" | 30688 grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' || 30689 sed -i '/# *include *<errno\.h>/d' "$f" 30690 done 30691 30692 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 30693 30694 tests/xetpriority.c: print syscall() result using %ld format. 30695 30696 tests/xetpgid.c: print syscall() result using %ld format. 30697 30698 tests/xchownx.c: use errno2name. 30699 30700 tests/userfaultfd.c: stop using assert. 30701 30702 tests/unlinkat.c: print syscall() result using %ld format. 30703 30704 tests/umount.c: use errno2name. 30705 30706 tests/truncate64.c: cleanup. 30707 * tests/truncate64.c (main): Use errno2name, stop using assert. 30708 30709 tests/truncate.c: cleanup. 30710 * tests/truncate.c (main): Use errno2name, stop using assert. 30711 30712 tests/tee.c: stop using assert. 30713 30714 tests/syslog.c: use errno2name. 30715 30716 tests/sync_file_range2.c: stop using assert. 30717 30718 tests/sync_file_range.c: stop using assert. 30719 30720 tests/symlinkat.c: cleanup. 30721 30722 tests/swap.c: cleanup. 30723 * tests/swap.c (error_msg): Remove. 30724 (main): Use errno2name. 30725 30726 tests/splice.c: stop using assert. 30727 30728 tests/setugid.c: cleanup. 30729 30730 tests/sethostname.c: use errno2name. 30731 30732 tests/setgroups.c: use errno2name. 30733 * tests/setgroups.c (errno2str): Remove. 30734 (main): Use errno2name. 30735 30736 tests/seccomp-strict.c: cleanup. 30737 * tests/seccomp-strict.c (main): Use errno2name, stop using assert. 30738 30739 tests/seccomp-filter.c: cleanup. 30740 * tests/seccomp-filter.c (main): Use errno2name, stop using assert. 30741 30742 tests/sched_xetscheduler.c: print syscall() result using %ld format. 30743 30744 tests/sched_xetparam.c: print syscall() result using %ld format. 30745 30746 tests/renameat.c: print syscall() result using %ld format. 30747 30748 tests/rename.c: print syscall() result using %ld format. 30749 30750 tests/readv.c: cleanup. 30751 30752 tests/pwritev.c: use errno2name. 30753 30754 tests/preadv-pwritev.c: cleanup. 30755 30756 tests/prctl-seccomp-strict.c: cleanup. 30757 * tests/prctl-seccomp-strict.c (main): Use errno2name, 30758 stop using assert. 30759 30760 tests/openat.c: use errno2name. 30761 30762 tests/open.c: use errno2name. 30763 30764 tests/mlockall.c: cleanup. 30765 30766 tests/mlock2.c: stop using assert. 30767 30768 tests/mknod.c: print syscall() result using %ld format. 30769 30770 tests/mkdirat.c: print syscall() result using %ld format. 30771 30772 tests/lseek.c: cleanup. 30773 * tests/lseek.c (main): Use errno2name, stop using assert. 30774 30775 tests/llseek.c: cleanup. 30776 * tests/llseek.c (main): Use errno2name, stop using assert. 30777 30778 tests/linkat.c: print syscall() result using %ld format. 30779 30780 tests/iopl.c: use errno2name. 30781 30782 tests/ioperm.c: use errno2name. 30783 30784 tests/getgroups.c: use errno2name. 30785 * tests/getgroups.c (errno2str): Remove. 30786 (main): Use errno2name. 30787 30788 tests/ftruncate64.c: cleanup. 30789 * tests/ftruncate64.c (main): Use errno2name, stop using assert. 30790 30791 tests/ftruncate.c: cleanup. 30792 * tests/ftruncate.c (main): Use errno2name, stop using assert. 30793 30794 tests/fsync.c: print syscall() result using %ld format. 30795 30796 tests/flock.c: print syscall() result using %ld format. 30797 30798 tests/file_handle.c: use errno2name. 30799 30800 tests/fdatasync.c: print syscall() result using %ld format. 30801 30802 tests/fchownat.c: use errno2name. 30803 30804 tests/fchmodat.c: use errno2name. 30805 30806 tests/fchmod.c: use errno2name. 30807 30808 tests/faccessat.c: print syscall() result using %ld format. 30809 30810 tests/epoll_wait.c: print syscall() result using %ld format. 30811 30812 tests/epoll_ctl.c: print syscall() result using %ld format. 30813 30814 tests/epoll_create1.c: cleanup. 30815 * tests/epoll_create1.c (main): Use errno2name, stop using assert. 30816 30817 tests/epoll_create.c: print syscall() result using %ld format. 30818 30819 tests/dup3.c: print syscall() result using %ld format. 30820 30821 tests/dup2.c: print syscall() result using %ld format. 30822 30823 tests/dup.c: cleanup. 30824 30825 tests/creat.c: stop using sys/stat.h. 30826 30827 tests/copy_file_range.c: stop using assert. 30828 30829 tests/chroot.c: use errno2name. 30830 30831 tests/aio.c: use errno2name. 30832 30833 tests: cleanup acct.test. 30834 * tests/acct.c (main): Use errno2name, stop using assert, 30835 change sample file name. 30836 * tests/acct.test: Update. 30837 30838 tests: use errno2name() 30839 Automatically change tests/*.c files using the following sed regexp: 30840 sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g' 30841 30842 tests/dup.c: include "tests.h" 30843 This is going to be necessary for the following commit. 30844 30845 2016-04-21 Fei Jie <feij.fnst (a] cn.fujitsu.com> 30846 30847 tests: add getpgrp.test. 30848 * tests/getpgrp.c: New file. 30849 * tests/getpgrp.test: New test. 30850 * tests/.gitignore: Add getpgrp. 30851 * tests/Makefile.am (check_PROGRAMS): Likewise. 30852 (DECODER_TESTS): Add getpgrp.test. 30853 30854 tests: add access.test. 30855 * tests/access.c: New file. 30856 * tests/access.test: New test. 30857 * tests/.gitignore: Add access. 30858 * tests/Makefile.am (check_PROGRAMS): Likewise. 30859 (DECODER_TESTS): Add access.test. 30860 30861 tests: add fchdir.test. 30862 * tests/fchdir.c: New file. 30863 * tests/fchdir.test: New test. 30864 * tests/.gitignore: Add fchdir. 30865 * tests/Makefile.am (check_PROGRAMS): Likewise. 30866 (DECODER_TESTS): Add fchdir.test. 30867 30868 tests: add mkdir.test. 30869 * tests/mkdir.c: New file. 30870 * tests/mkdir.test: New test. 30871 * tests/.gitignore: Add mkdir. 30872 * tests/Makefile.am (check_PROGRAMS): Likewise. 30873 (DECODER_TESTS): Add mkdir.test. 30874 30875 tests: add getsid.test. 30876 * tests/getsid.c: New file. 30877 * tests/getsid.test: New test. 30878 * tests/.gitignore: Add getsid. 30879 * tests/Makefile.am (check_PROGRAMS): Likewise. 30880 (DECODER_TESTS): Add getsid.test. 30881 30882 2016-04-21 Dmitry V. Levin <ldv (a] altlinux.org> 30883 30884 tests: add errno2name function to libtests. 30885 Add a simple translator of errno to its name, so one could 30886 simply use errno2name() instead of complex expressions like 30887 errno == EINVAL ? "EINVAL" : "EFAULT". 30888 30889 * tests.h (errno2name): New prototype. 30890 * errno2name.c: New file. 30891 * Makefile.am (libtests_a_SOURCES): Add it. 30892 30893 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30894 30895 hppa: rename ECANCELLED to ECANCELED. 30896 hppa seems to be the only architecture that defines ECANCELLED synonym 30897 for ECANCELED constant, other architectures just define ECANCELED. 30898 Change the way how this constant is printed on hppa to be in line 30899 with other architectures. 30900 30901 * linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED. 30902 30903 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30904 30905 Remove parser of unimplemented timerfd syscall. 30906 timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1 30907 it was replaced by timerfd_* syscall family. 30908 30909 * linux/avr32/syscallent.h (timerfd): Fix nargs. 30910 * linux/dummy.h (sys_timerfd): Add stub alias. 30911 * time.c (SYS_FUNC(timerfd)): Remove. 30912 30913 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30914 30915 tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test 30916 If kernel implementation of strict seccomp mode is buggy, test programs 30917 will be killed by SIGKILL. This is a known problem at least on 30918 x32 and mips. Skip affected tests if this is the case. 30919 30920 This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b. 30921 30922 * tests/seccomp-strict.c (main): Remove workaround for x32. 30923 * tests/prctl-seccomp-strict.c: Likewise. 30924 * tests/seccomp-strict.test: Skip the test if the test program 30925 has been killed by SIGKILL. 30926 * tests/prctl-seccomp-strict.test: Likewise. 30927 30928 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30929 30930 tests/shmxt.c: do not use SHM_RND, it is unreliable. 30931 * tests/shmxt.c (main): Do not set SHM_RND flag. 30932 30933 tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long) 30934 * tests/rt_sigsuspend.c (iterate): Do not assume that size will be less 30935 than sizeof(long) on the second iteration. 30936 30937 prctl-seccomp-strict.test: robustify against unrelated prctl invocations 30938 * tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls. 30939 30940 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30941 30942 tests: adjust rt_sigpending to older kernels. 30943 With linux kernels older than v3.9-rc1, compat rt_sigpending syscall 30944 could fail with EFAULT in cases where on later kernels it succeeds. 30945 Adjust the test to handle both cases properly. 30946 30947 * tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending 30948 failed with EFAULT. 30949 30950 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30951 30952 tests: adjust readv/writev and preadv/pwritev tests to older kernels. 30953 With linux kernels older than v3.16-rc1, iovec based compat syscalls may 30954 return EINVAL in some cases where on later kernels they return EFAULT. 30955 Adjust tests to handle both cases properly. 30956 30957 * tests/preadv-pwritev.c: Include <errno.h>. 30958 (main): Print either "EINVAL" or "EFAULT" depending on errno. 30959 * tests/pwritev.c: Likewise. 30960 * tests/readv.c: Likewise. 30961 30962 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30963 30964 tests: remove obsolete non-strict uid tests. 30965 Recently added strict tests for uid/gid related syscalls 30966 made old uid tests obsolete. 30967 30968 * tests/uid.awk: Remove. 30969 * tests/uid.c: Remove. 30970 * tests/uid.test: Remove. 30971 * tests/uid16.c: Remove. 30972 * tests/uid16.test: Remove. 30973 * tests/uid32.c: Remove. 30974 * tests/uid32.test: Remove. 30975 * tests/.gitignore: Remove uid, uid16, and uid32. 30976 * tests/Makefile.am (check_PROGRAMS): Likewise. 30977 (DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test. 30978 (EXTRA_DIST): Remove uid.awk. 30979 30980 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 30981 30982 tests: extend test coverage of getuid/getgid family syscalls. 30983 Add strict tests for getuid, getuid32, getgid, getgid32, geteuid, 30984 geteuid32, getegid, and getegid32 syscalls. 30985 30986 * tests/getegid.c: New file. 30987 * tests/getegid.test: New test. 30988 * tests/getegid32.c: New file. 30989 * tests/getegid32.test: New test. 30990 * tests/geteuid.c: New file. 30991 * tests/geteuid.test: New test. 30992 * tests/geteuid32.c: New file. 30993 * tests/geteuid32.test: New test. 30994 * tests/getgid.c: New file. 30995 * tests/getgid.test: New test. 30996 * tests/getgid32.c: New file. 30997 * tests/getgid32.test: New test. 30998 * tests/getuid.c: New file. 30999 * tests/getuid.test: New test. 31000 * tests/getuid32.c: New file. 31001 * tests/getuid32.test: New test. 31002 * tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid, 31003 * geteuid32, getegid, and getegid32. 31004 * tests/Makefile.am (check_PROGRAMS): Likewise. 31005 (DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test, 31006 geteuid32.test, getgid.test, getgid32.test, getuid.test, 31007 and getuid32.test. 31008 31009 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 31010 31011 tests: extend test coverage of getresgid32 syscall. 31012 * tests/getresgid32.c: New file. 31013 * tests/getresgid32.test: New test. 31014 * tests/.gitignore: Add getresgid32. 31015 * tests/Makefile.am (check_PROGRAMS): Likewise. 31016 (DECODER_TESTS): Add getresgid32.test. 31017 31018 tests: extend test coverage of getresgid syscall. 31019 * tests/getresgid.c: New file. 31020 * tests/getresgid.test: New test. 31021 * tests/.gitignore: Add getresgid. 31022 * tests/Makefile.am (check_PROGRAMS): Likewise. 31023 (DECODER_TESTS): Add getresgid.test. 31024 31025 tests: extend test coverage of getresuid32 syscall. 31026 * tests/getresuid32.c: New file. 31027 * tests/getresuid32.test: New test. 31028 * tests/.gitignore: Add getresuid32. 31029 * tests/Makefile.am (check_PROGRAMS): Likewise. 31030 (DECODER_TESTS): Add getresuid32.test. 31031 31032 tests: extend test coverage of getresuid syscall. 31033 * tests/getresugid.c: New file. 31034 * tests/getresuid.c: New file. 31035 * tests/getresuid.test: New test. 31036 * tests/.gitignore: Add getresuid. 31037 * tests/Makefile.am (check_PROGRAMS): Likewise. 31038 (DECODER_TESTS): Add getresuid.test. 31039 (EXTRA_DIST): Add getresugid.c. 31040 31041 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31042 31043 tests: add symlinkat.test. 31044 * tests/symlinkat.c: New file. 31045 * tests/symlinkat.test: New test. 31046 * tests/.gitignore: Add symlinkat. 31047 * tests/Makefile.am (check_PROGRAMS): Likewise. 31048 (DECODER_TESTS): Add symlinkat.test. 31049 31050 tests: add iopl.test. 31051 * tests/iopl.c: New file. 31052 * tests/iopl.test: New test. 31053 * tests/.gitignore: Add iopl. 31054 * tests/Makefile.am (check_PROGRAMS): Likewise. 31055 (DECODER_TESTS): Add iopl.test. 31056 31057 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 31058 31059 mips o32, powerpc, powerpc64: fix decoding of iopl syscall. 31060 * linux/mips/syscallent-o32.h (iopl): Fix nargs. 31061 * linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func. 31062 * linux/powerpc64/syscallent.h (iopl): Likewise. 31063 31064 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31065 31066 tests: add ioperm.test. 31067 * tests/ioperm.c: New file. 31068 * tests/ioperm.test: New test. 31069 * tests/.gitignore: Add ioperm. 31070 * tests/Makefile.am (check_PROGRAMS): Likewise. 31071 (DECODER_TESTS): Add ioperm.test. 31072 31073 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 31074 31075 Fix corner cases of getgroups and setgroups syscall decoders. 31076 * uid.c (print_groups): New function. 31077 (SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it. 31078 Print first syscall argument using %u format. 31079 * tests/getgroups.c: New file. 31080 * tests/getgroups.test: New test. 31081 * tests/getgroups32.c: New file. 31082 * tests/getgroups32.test: New test. 31083 * tests/setgroups.c: New file. 31084 * tests/setgroups.test: New test. 31085 * tests/setgroups32.c: New file. 31086 * tests/setgroups32.test: New test. 31087 * tests/.gitignore: Add getgroups, getgroups32, setgroups, 31088 and setgroups32. 31089 * tests/Makefile.am (check_PROGRAMS): Likewise. 31090 (DECODER_TESTS): Add getgroups.test, getgroups32.test, 31091 setgroups.test, and setgroups32.test. 31092 31093 Cleanup setfsuid syscall decoder. 31094 * uid.c (SYS_FUNC(setfsuid)): Remove redundant check. 31095 31096 tests: check decoding of setfsgid32 syscall. 31097 * tests/setfsgid32.c: New file. 31098 * tests/setfsgid32.test: New test. 31099 * tests/.gitignore: Add setfsgid32. 31100 * tests/Makefile.am (check_PROGRAMS): Likewise. 31101 (DECODER_TESTS): Add setfsgid32.test. 31102 31103 tests: check decoding of setfsgid syscall. 31104 * tests/setfsugid.c: New file. 31105 * tests/setfsgid.c: New file. 31106 * tests/setfsgid.test: New test. 31107 * tests/.gitignore: Add setfsgid. 31108 * tests/Makefile.am (check_PROGRAMS): Likewise. 31109 (DECODER_TESTS): Add setfsgid.test. 31110 (EXTRA_DIST): Add setfsugid.c. 31111 31112 tests: check decoding of setfsuid32 syscall. 31113 * tests/setfsuid32.c: New file. 31114 * tests/setfsuid32.test: New test. 31115 * tests/.gitignore: Add setfsuid32. 31116 * tests/Makefile.am (check_PROGRAMS): Likewise. 31117 (DECODER_TESTS): Add setfsuid32.test. 31118 31119 tests: check decoding of setfsuid syscall. 31120 * tests/setfsugid.c: New file. 31121 * tests/setfsuid.c: New file. 31122 * tests/setfsuid.test: New test. 31123 * tests/.gitignore: Add setfsuid. 31124 * tests/Makefile.am (check_PROGRAMS): Likewise. 31125 (DECODER_TESTS): Add setfsuid.test. 31126 (EXTRA_DIST): Add setfsugid.c. 31127 31128 tests: extend test coverage of setresgid32 syscall. 31129 * tests/setresgid32.c: New file. 31130 * tests/setresgid32.test: New test. 31131 * tests/.gitignore: Add setresgid32. 31132 * tests/Makefile.am (check_PROGRAMS): Likewise. 31133 (DECODER_TESTS): Add setresgid32.test. 31134 31135 tests: extend test coverage of setresgid syscall. 31136 * tests/setresgid.c: New file. 31137 * tests/setresgid.test: New test. 31138 * tests/.gitignore: Add setresgid. 31139 * tests/Makefile.am (check_PROGRAMS): Likewise. 31140 (DECODER_TESTS): Add setresgid.test. 31141 31142 tests: extend test coverage of setresuid32 syscall. 31143 * tests/setresuid32.c: New file. 31144 * tests/setresuid32.test: New test. 31145 * tests/.gitignore: Add setresuid32. 31146 * tests/Makefile.am (check_PROGRAMS): Likewise. 31147 (DECODER_TESTS): Add setresuid32.test. 31148 31149 tests: extend test coverage of setresuid syscall. 31150 * tests/setresugid.c: New file. 31151 * tests/setresuid.c: New file. 31152 * tests/setresuid.test: New test. 31153 * tests/.gitignore: Add setresuid. 31154 * tests/Makefile.am (check_PROGRAMS): Likewise. 31155 (DECODER_TESTS): Add setresuid.test. 31156 (EXTRA_DIST): Add setresugid.c. 31157 31158 tests: extend test coverage of setregid32 syscall. 31159 * tests/setregid32.c: New file. 31160 * tests/setregid32.test: New test. 31161 * tests/.gitignore: Add setregid32. 31162 * tests/Makefile.am (check_PROGRAMS): Likewise. 31163 (DECODER_TESTS): Add setregid32.test. 31164 31165 tests: extend test coverage of setregid syscall. 31166 * tests/setregid.c: New file. 31167 * tests/setregid.test: New test. 31168 * tests/.gitignore: Add setregid. 31169 * tests/Makefile.am (check_PROGRAMS): Likewise. 31170 (DECODER_TESTS): Add setregid.test. 31171 31172 tests: extend test coverage of setreuid32 syscall. 31173 * tests/setreuid32.c: New file. 31174 * tests/setreuid32.test: New test. 31175 * tests/.gitignore: Add setreuid32. 31176 * tests/Makefile.am (check_PROGRAMS): Likewise. 31177 (DECODER_TESTS): Add setreuid32.test. 31178 31179 tests: extend test coverage of setreuid syscall. 31180 * tests/setreugid.c: New file. 31181 * tests/setreuid.c: New file. 31182 * tests/setreuid.test: New test. 31183 * tests/.gitignore: Add setreuid. 31184 * tests/Makefile.am (check_PROGRAMS): Likewise. 31185 (DECODER_TESTS): Add setreuid.test. 31186 (EXTRA_DIST): Add setreugid.c. 31187 31188 tests: extend test coverage of setgid32 syscall. 31189 * tests/setgid32.c: New file. 31190 * tests/setgid32.test: New test. 31191 * tests/.gitignore: Add setgid32. 31192 * tests/Makefile.am (check_PROGRAMS): Likewise. 31193 (DECODER_TESTS): Add setgid32.test. 31194 31195 tests: extend test coverage of setgid syscall. 31196 * tests/setgid.c: New file. 31197 * tests/setgid.test: New test. 31198 * tests/.gitignore: Add setgid. 31199 * tests/Makefile.am (check_PROGRAMS): Likewise. 31200 (DECODER_TESTS): Add setgid.test. 31201 31202 tests: extend test coverage of setuid32 syscall. 31203 * tests/setuid32.c: New file. 31204 * tests/setuid32.test: New test. 31205 * tests/.gitignore: Add setuid32. 31206 * tests/Makefile.am (check_PROGRAMS): Likewise. 31207 (DECODER_TESTS): Add setuid32.test. 31208 31209 tests: extend test coverage of setuid syscall. 31210 * tests/setugid.c: New file. 31211 * tests/setuid.c: New file. 31212 * tests/setuid.test: New test. 31213 * tests/.gitignore: Add setuid. 31214 * tests/Makefile.am (check_PROGRAMS): Likewise. 31215 (DECODER_TESTS): Add setuid.test. 31216 (EXTRA_DIST): Add setugid.c. 31217 31218 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31219 31220 tests: add shmxt.test. 31221 * tests/shmxt.c: New file. 31222 * tests/shmxt.test: New test. 31223 * tests/.gitignore: Add shmxt. 31224 * tests/Makefile.am (check_PROGRAMS): Likewise. 31225 (DECODER_TESTS): Add shmxt.test. 31226 31227 2016-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 31228 31229 alpha: fix decoding of shmat syscall. 31230 On alpha, shmat syscall is known as osf_shmat. 31231 31232 * linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func. 31233 31234 2016-04-20 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31235 31236 tests: add semop.test. 31237 * tests/semop.c: New file. 31238 * tests/semop.test: New test. 31239 * tests/.gitignore: Add semop. 31240 * tests/Makefile.am (check_PROGRAMS): Likewise. 31241 (DECODER_TESTS): Add semop.test. 31242 31243 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 31244 31245 prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations 31246 * tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls. 31247 31248 Reported-by: Steve McIntyre <steve (a] einval.com> 31249 31250 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 31251 31252 tests/pselect6.c: fix potential output mismatch. 31253 * tests/pselect6.c (main): In the last case of printing pselect6 31254 syscall, print the last argument the same way as in other cases. 31255 31256 Reported-by: Steve McIntyre <steve (a] einval.com> 31257 31258 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 31259 31260 tests: check decoding of fchown32 syscall. 31261 * tests/fchown32.c: New file. 31262 * tests/fchown32.test: New test. 31263 * tests/.gitignore: Add fchown32. 31264 * tests/Makefile.am (check_PROGRAMS): Likewise. 31265 (DECODER_TESTS): Add fchown32.test. 31266 31267 tests: check decoding of fchown syscall. 31268 * tests/fchown.c: New file. 31269 * tests/fchown.test: New test. 31270 * tests/.gitignore: Add fchown. 31271 * tests/Makefile.am (check_PROGRAMS): Likewise. 31272 (DECODER_TESTS): Add fchown.test. 31273 31274 tests: check decoding of lchown32 syscall. 31275 * tests/lchown32.c: New file. 31276 * tests/lchown32.test: New test. 31277 * tests/.gitignore: Add lchown32. 31278 * tests/Makefile.am (check_PROGRAMS): Likewise. 31279 (DECODER_TESTS): Add lchown32.test. 31280 31281 tests: check decoding of lchown syscall. 31282 * tests/lchown.c: New file. 31283 * tests/lchown.test: New test. 31284 * tests/.gitignore: Add lchown. 31285 * tests/Makefile.am (check_PROGRAMS): Likewise. 31286 (DECODER_TESTS): Add lchown.test. 31287 31288 tests: check decoding of chown32 syscall. 31289 * tests/chown32.c: New file. 31290 * tests/chown32.test: New test. 31291 * tests/.gitignore: Add chown32. 31292 * tests/Makefile.am (check_PROGRAMS): Likewise. 31293 (DECODER_TESTS): Add chown32.test. 31294 31295 tests: check decoding of chown syscall. 31296 * tests/chown.c: New file. 31297 * tests/chown.test: New test. 31298 * tests/xchownx.c: New file. 31299 * tests/.gitignore: Add chown. 31300 * tests/Makefile.am (check_PROGRAMS): Likewise. 31301 (DECODER_TESTS): Add chown.test. 31302 (EXTRA_DIST): Add xchownx.c. 31303 31304 Fix decoding of 16-bit uid_t/git_t. 31305 * uid.c (printuid): Always cast value to uid_t. 31306 31307 2016-04-18 Dmitry V. Levin <ldv (a] altlinux.org> 31308 31309 tests: move kernel uid overflow check to libtests. 31310 This code used in two different places, so move it to the library. 31311 31312 * tests/overflowuid.c: New file. 31313 * tests/Makefile.am (libtests_a_SOURCES): Add it. 31314 * tests/tests.h (check_overflowuid, check_overflowgid): New prototypes. 31315 * tests/uid.c (main): Use check_overflowuid. 31316 * tests/uid16.c (main): Likewise. 31317 31318 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 31319 31320 tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32. 31321 As x86_64 kernel does not support x32 syscall numbers in 31322 SECCOMP_MODE_STRICT, skip affected tests on x32. 31323 31324 * tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out 31325 using error_msg_and_skip. 31326 * tests/prctl-seccomp-strict.c: Likewise. 31327 31328 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 31329 31330 tests: add seccomp-filter.test. 31331 * tests/seccomp-filter.c: New file. 31332 * tests/seccomp-filter.test: New test. 31333 * tests/.gitignore: Add seccomp-filter. 31334 * tests/Makefile.am (check_PROGRAMS): Likewise. 31335 (DECODER_TESTS): Add seccomp-filter.test. 31336 31337 2016-04-12 Dmitry V. Levin <ldv (a] altlinux.org> 31338 31339 seccomp: fix decoding of sock_fprog and sock_filter structures. 31340 Always print struct sock_fprog.len. 31341 Fix printing of unfetchable elements in sock_filter array. 31342 Fix printing of large sock_filter arrays. 31343 31344 * seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and 31345 print_seccomp_fprog. 31346 (print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog. 31347 * tests/prctl-seccomp-filter-v.c (main): Update. 31348 * tests/seccomp-filter-v.c: New file. 31349 * tests/seccomp-filter-v.test: New test. 31350 * tests/.gitignore: Add seccomp-filter-v. 31351 * tests/Makefile.am (check_PROGRAMS): Likewise. 31352 (DECODER_TESTS): Add seccomp-filter-v.test. 31353 31354 2016-04-11 Dmitry V. Levin <ldv (a] altlinux.org> 31355 31356 seccomp: print SECCOMP_* and BPF_* constants in a more compact way. 31357 * seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|". 31358 * tests/prctl-seccomp-filter-v.c: Update. 31359 31360 tests: rename seccomp.test to prctl-seccomp-filter-v.test. 31361 * tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v. 31362 * tests/Makefile.am (check_PROGRAMS): Likewise. 31363 (DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test. 31364 * tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c. 31365 * tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test. 31366 31367 tests: add seccomp-strict.test. 31368 * tests/seccomp-strict.c: New file. 31369 * tests/seccomp-strict.test: New test. 31370 * tests/.gitignore: Add seccomp-strict. 31371 * tests/Makefile.am (check_PROGRAMS): Likewise. 31372 (DECODER_TESTS): Add seccomp-strict.test. 31373 31374 tests: add prctl-seccomp-strict.test. 31375 * tests/prctl-seccomp-strict.c: New file. 31376 * tests/prctl-seccomp-strict.test: New test. 31377 * tests/.gitignore: Add prctl-seccomp-strict. 31378 * tests/Makefile.am (check_PROGRAMS): Likewise. 31379 (DECODER_TESTS): Add prctl-seccomp-strict.test. 31380 31381 tests: bring lists back to the sorted order. 31382 31383 2016-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 31384 31385 tests/epoll_create1.c: extend for the case of ENOSYS. 31386 * epoll_create1.c: Make the test work in case of epoll_create1 31387 returning ENOSYS. 31388 31389 tests/epoll_ctl.c: extend epoll_ctl coverage. 31390 * tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding. Check 31391 decoding of long int descriptors and NULL struct epoll_event pointer. 31392 31393 2016-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 31394 31395 tests: add mlockall.test. 31396 * tests/mlockall.c: New file. 31397 * tests/mlockall.test: New test. 31398 * tests/.gitignore: Add mlockall. 31399 * tests/Makefile.am (check_PROGRAMS): Likewise. 31400 (DECODER_TESTS): Add mlockall.test. 31401 31402 2016-04-08 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31403 31404 tests: add epoll_wait.test. 31405 * tests/epoll_wait.c: New file. 31406 * tests/epoll_wait.test: New test. 31407 * tests/.gitignore: Add epoll_wait. 31408 * tests/Makefile.am (check_PROGRAMS): Likewise. 31409 (DECODER_TESTS): Add epoll_wait.test. 31410 31411 tests: add epoll_ctl.test. 31412 * tests/epoll_ctl.c: New file. 31413 * tests/epoll_ctl.test: New test. 31414 * tests/.gitignore: Add epoll_ctl. 31415 * tests/Makefile.am (check_PROGRAMS): Likewise. 31416 (DECODER_TESTS): Add epoll_ctl.test. 31417 31418 tests: add epoll_create.test. 31419 * tests/epoll_create.c: New file. 31420 * tests/epoll_create.test: New test. 31421 * tests/.gitignore: Add epoll_create. 31422 * tests/Makefile.am (check_PROGRAMS): Likewise. 31423 (DECODER_TESTS): Add epoll_create.test. 31424 31425 2016-04-08 Dmitry V. Levin <ldv (a] altlinux.org> 31426 31427 tests/pread64-pwrite64.c: minor cleanup. 31428 * tests/pread64-pwrite64.c: Do not include <sys/uio.h>. 31429 31430 2016-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 31431 31432 Fix decoding of swapon flags. 31433 * swapon.c (SYS_FUNC(swapon)): Print priority regardless 31434 of SWAP_FLAG_PREFER flag being set. 31435 * tests/swap.c (error_msg): Handle EINVAL. 31436 (main): Check decoding of swapon flags. 31437 31438 tests/unlinkat.c: check AT_* decoding. 31439 * tests/unlinkat.c (main): Check decoding of AT_* constants. 31440 31441 tests/linkat.c: check AT_* decoding. 31442 * tests/linkat.c (main): Check decoding of AT_* constants. 31443 31444 2016-04-06 Elliott Hughes <enh (a] google.com> 31445 31446 Improve decoding of Android's PR_SET_VMA prctl. 31447 Before: 31448 31449 prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096, 31450 "atexit handlers") = 0 31451 31452 After: 31453 31454 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096, 31455 "atexit handlers") = 0 31456 31457 * prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA. 31458 * Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option. 31459 * xlat/prctl_options.in: Add PR_SET_VMA. 31460 31461 2016-04-06 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31462 31463 tests: add mkdirat.test. 31464 * tests/mkdirat.c: New file. 31465 * tests/mkdirat.test: New test. 31466 * tests/.gitignore: Add mkdirat. 31467 * tests/Makefile.am (check_PROGRAMS): Likewise. 31468 (DECODER_TESTS): Add mkdirat.test. 31469 31470 tests: add swap.test. 31471 * tests/swap.c: New file. 31472 * tests/swap.test: New test. 31473 * tests/.gitignore: Add swap. 31474 * tests/Makefile.am (check_PROGRAMS): Likewise. 31475 (DECODER_TESTS): Add swap.test. 31476 31477 tests: add unlinkat.test. 31478 * tests/unlinkat.c: New file. 31479 * tests/unlinkat.test: New test. 31480 * tests/.gitignore: Add unlinkat. 31481 * tests/Makefile.am (check_PROGRAMS): Likewise. 31482 (DECODER_TESTS): Add unlinkat.test. 31483 31484 tests: add linkat.test. 31485 * tests/linkat.c: New file. 31486 * tests/linkat.test: New test. 31487 * tests/.gitignore: Add linkat. 31488 * tests/Makefile.am (check_PROGRAMS): Likewise. 31489 (DECODER_TESTS): Add linkat.test. 31490 31491 2016-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 31492 31493 tests: add sync_file_range.test and sync_file_range2.test. 31494 * configure.ac (AC_CHECK_FUNCS): Add sync_file_range. 31495 * tests/sync_file_range.c: New file. 31496 * tests/sync_file_range2.c: Likewise. 31497 * tests/sync_file_range.test: New test. 31498 * tests/sync_file_range2.test: Likewise. 31499 * tests/.gitignore: Add sync_file_range and sync_file_range2. 31500 * tests/Makefile.am (check_PROGRAMS): Likewise. 31501 (DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test. 31502 31503 2016-04-05 Dmitry V. Levin <ldv (a] altlinux.org> 31504 31505 Add default values for SYNC_FILE_RANGE_* constants. 31506 * xlat/sync_file_range_flags.in: Add default values. 31507 31508 2016-04-05 Elliott Hughes <enh (a] google.com> 31509 31510 Fix sync_file_range2 output. 31511 Before: 31512 31513 sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| 31514 SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, ) 31515 31516 After: 31517 31518 sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| 31519 SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0) 31520 31521 * sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", " 31522 in the right place. 31523 31524 2016-04-04 Dmitry V. Levin <ldv (a] altlinux.org> 31525 31526 Replace PF_* constants with AF_* 31527 AF_* constants appear to be more standardized, and in practice there's 31528 always a one to one relationship between AF_* and PF_*, so let's 31529 use AF_* instead of PF_*. 31530 31531 * xlat/domains.in: Remove. 31532 * net.c: Do not define PF_UNSPEC. Stop including "xlat/domains.h". 31533 Replace PF_* with AF_*. Replace domains with addrfams. 31534 * tests/inet-cmsg.c: Replace PF_INET with AF_INET. 31535 * tests/net-yy-inet.c: Likewise. 31536 * tests/netlink_inet_diag.c: Likewise. 31537 * tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL. 31538 * tests/net-y-unix.c: Likewise. 31539 * tests/net-yy-unix.c: Likewise. 31540 * tests/netlink_unix_diag.c: Likewise. 31541 * tests/net.expected: Replace PF_ with AF_. 31542 31543 2016-04-03 Dmitry V. Levin <ldv (a] altlinux.org> 31544 31545 tests: add read-write.test. 31546 * tests/read-write.c: New file. 31547 * tests/read-write.test: New test. 31548 * tests/.gitignore: Add read-write. 31549 * tests/Makefile.am (check_PROGRAMS): Likewise. 31550 (DECODER_TESTS): Add read-write.test. 31551 31552 2016-04-02 Dmitry V. Levin <ldv (a] altlinux.org> 31553 31554 tests/pread64-pwrite64.test: extend dumpio coverage. 31555 * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump): 31556 New functions. 31557 (main): Use them to test dumping of various data. 31558 * tests/pread64-pwrite64.test: Update. 31559 31560 tests: add hexdump_memdup function to libtests. 31561 * tests/hexdump_strdup.c (hexdump_memdup): New function. 31562 (hexdump_strdup): Use it. 31563 * tests/tests.h (hexdump_memdup): New prototype. 31564 31565 tests: add fchownat.test. 31566 * tests/fchownat.c: New file. 31567 * tests/fchownat.test: New test. 31568 * tests/.gitignore: Add fchownat. 31569 * tests/Makefile.am (check_PROGRAMS): Likewise. 31570 (DECODER_TESTS): Add fchownat.test. 31571 31572 tests: add fchmodat.test. 31573 * tests/fchmodat.c: New file. 31574 * tests/fchmodat.test: New test. 31575 * tests/.gitignore: Add fchmodat. 31576 * tests/Makefile.am (check_PROGRAMS): Likewise. 31577 (DECODER_TESTS): Add fchmodat.test. 31578 31579 Fix printing of negative offsets in pread64 and pwrite64 syscalls. 31580 * io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset 31581 using %lld format string. 31582 * tests/pread64-pwrite64.c: New file. 31583 * tests/pread64-pwrite64.test: New test. 31584 * tests/.gitignore: Add pread64-pwrite64. 31585 * tests/Makefile.am (check_PROGRAMS): Likewise. 31586 (pread64_pwrite64_CPPFLAGS): New variable. 31587 (DECODER_TESTS): Add pread64-pwrite64. 31588 31589 tests/hexdump_strdup.c: add support for longer strings. 31590 * tests/hexdump_strdup.c (hexdump_strdup): Output extra space character 31591 before hexdumping of the 9th symbol. 31592 31593 tests/preadv-pwritev.c: fix typo in error diagnostics. 31594 * tests/preadv-pwritev.c (main): Fix typo in error message. 31595 31596 2016-04-01 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31597 31598 tests: add chroot.test. 31599 * tests/chroot.c: New file. 31600 * tests/chroot.test: New test. 31601 * tests/.gitignore: Add chroot. 31602 * tests/Makefile.am (check_PROGRAMS): Likewise. 31603 (DECODER_TESTS): Add chroot.test. 31604 31605 tests: add fdatasync.test. 31606 * tests/fdatasync.c: New file. 31607 * tests/fdatasync.test: New test. 31608 * tests/.gitignore: Add fdatasync. 31609 * tests/Makefile.am (check_PROGRAMS): Likewise. 31610 (DECODER_TESTS): Add fdatasync.test. 31611 31612 tests: add fsync.test. 31613 * tests/fsync.c: New file. 31614 * tests/fsync.test: New test. 31615 * tests/.gitignore: Add fsync. 31616 * tests/Makefile.am (check_PROGRAMS): Likewise. 31617 (DECODER_TESTS): Add fsync.test. 31618 31619 tests: add sethostname.test. 31620 * tests/sethostname.c: New file. 31621 * tests/sethostname.test: New test. 31622 * tests/.gitignore: Add sethostname. 31623 * tests/Makefile.am (check_PROGRAMS): Likewise. 31624 (DECODER_TESTS): Add sethostname.test. 31625 31626 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 31627 31628 Consistently handle unsigned arguments of mmap* and remap_file_pages. 31629 Explicitly declare first 4 arguments of mmap* and all remap_file_pages 31630 arguments as unsigned to avoid potential sign extension issues. 31631 31632 * mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall 31633 arguments to local variables of appropriate types. 31634 31635 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 31636 31637 Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned. 31638 The second (level) and third (optname) arguments of getsockopt and 31639 setsockopt syscalls are enums, so treat them consistently as enums: 31640 use "unsigned int" type to avoid potential sign extension issues. 31641 31642 * net.c (print_sockopt_fd_level_name, print_getsockopt, 31643 print_setsockopt): Change type of "level" and "name" arguments 31644 from "int" to "unsigned int". 31645 31646 2016-04-01 Dmitry V. Levin <ldv (a] altlinux.org> 31647 31648 Add sentinel attribute to printxvals. 31649 * gcc_compat.h (ATTRIBUTE_SENTINEL): New macro. 31650 * defs.h (printxvals): Add ATTRIBUTE_SENTINEL. 31651 31652 Cleanup parser of ptrace syscall. 31653 * process.c (print_user_offset_addr): New function for printing offset 31654 address in the tracee's USER area. 31655 (SYS_FUNC(ptrace)): Assign syscall arguments to local variables with 31656 appropriate types. Print pid argument as int. Use switch statement 31657 in the code that handles address argument. Use print_user_offset_addr 31658 to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests. 31659 31660 2016-03-31 Jeff Mahoney <jeffm (a] suse.com> 31661 31662 Define PRI__[uxs]64 macros to print __s64 and __u64 values. 31663 Rather than cast every __u64 or __s64 before printing, 31664 define printing helpers for those types directly. 31665 31666 * defs.h (PRI__s64, PRI__u64, PRI__x64): New macros. 31667 31668 2016-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 31669 31670 Implement dumping of preadv and pwritev syscalls. 31671 * syscall.c (dumpio): Add SEN_preadv and SEN_pwritev. 31672 * NEWS: Mention this. 31673 * tests/preadv-pwritev.c: New file. 31674 * tests/preadv-pwritev.test: New test. 31675 * tests/.gitignore: Add preadv-pwritev. 31676 * tests/Makefile.am (check_PROGRAMS): Likewise. 31677 (preadv_pwritev_CPPFLAGS): New variable. 31678 (DECODER_TESTS): Add preadv-pwritev. 31679 31680 2016-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 31681 31682 Fix decoding of preadv syscall in case of short read. 31683 * io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead 31684 of tprint_iov and specify syscall return value as a data size limit. 31685 * NEWS: Mention it. 31686 * tests/preadv.c (main): Add a test case for preadv short read. 31687 31688 Fix printing of negative offsets in preadv and pwritev syscalls. 31689 * io.c (print_llu_from_low_high_val): Rename to 31690 print_lld_from_low_high_val, all callers changed. 31691 Print value as a signed integer. 31692 * tests/preadv.c: New file. 31693 * tests/preadv.test: New test. 31694 * tests/pwritev.c: New file. 31695 * tests/pwritev.test: New test. 31696 * tests/.gitignore: Add preadv and pwritev. 31697 * tests/Makefile.am (check_PROGRAMS): Likewise. 31698 (preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables. 31699 (DECODER_TESTS): Add preadv.test and pwritev.test. 31700 31701 Fix printing of unreadable struct iovec. 31702 * io.c (tprint_iov_upto): If the first element of iovec array is 31703 unreadable, print its address without array markup. 31704 * tests/readv.c (main): Check it. 31705 31706 tests: factor out a part common to many simply organized test scripts. 31707 * tests/init.sh (run_strace_match_diff): New function. 31708 * tests/acct.test: Rewrite using run_strace_match_diff. 31709 * tests/aio.test: Likewise. 31710 * tests/alarm.test: Likewise. 31711 * tests/chmod.test: Likewise. 31712 * tests/clock_nanosleep.test: Likewise. 31713 * tests/clock_xettime.test: Likewise. 31714 * tests/copy_file_range.test: Likewise. 31715 * tests/creat.test: Likewise. 31716 * tests/dup.test: Likewise. 31717 * tests/dup2.test: Likewise. 31718 * tests/dup3.test: Likewise. 31719 * tests/epoll_create1.test: Likewise. 31720 * tests/execveat-v.test: Likewise. 31721 * tests/execveat.test: Likewise. 31722 * tests/fchmod.test: Likewise. 31723 * tests/fcntl.test: Likewise. 31724 * tests/file_handle.test: Likewise. 31725 * tests/flock.test: Likewise. 31726 * tests/fork-f.test: Likewise. 31727 * tests/ftruncate.test: Likewise. 31728 * tests/ftruncate64.test: Likewise. 31729 * tests/getcwd.test: Likewise. 31730 * tests/getdents.test: Likewise. 31731 * tests/getdents64.test: Likewise. 31732 * tests/getrandom.test: Likewise. 31733 * tests/getrusage.test: Likewise. 31734 * tests/getxxid.test: Likewise. 31735 * tests/inet-cmsg.test: Likewise. 31736 * tests/init.sh: Likewise. 31737 * tests/membarrier.test: Likewise. 31738 * tests/mincore.test: Likewise. 31739 * tests/mknod.test: Likewise. 31740 * tests/mlock2.test: Likewise. 31741 * tests/mmsg.test: Likewise. 31742 * tests/nanosleep.test: Likewise. 31743 * tests/open.test: Likewise. 31744 * tests/openat.test: Likewise. 31745 * tests/pselect6.test: Likewise. 31746 * tests/readdir.test: Likewise. 31747 * tests/readlink.test: Likewise. 31748 * tests/readv.test: Likewise. 31749 * tests/recvmsg.test: Likewise. 31750 * tests/rename.test: Likewise. 31751 * tests/renameat.test: Likewise. 31752 * tests/rt_sigpending.test: Likewise. 31753 * tests/rt_sigprocmask.test: Likewise. 31754 * tests/rt_sigqueueinfo.test: Likewise. 31755 * tests/rt_sigsuspend.test: Likewise. 31756 * tests/rt_sigtimedwait.test: Likewise. 31757 * tests/rt_tgsigqueueinfo.test: Likewise. 31758 * tests/sched_get_priority_mxx.test: Likewise. 31759 * tests/sched_xetaffinity.test: Likewise. 31760 * tests/sched_xetparam.test: Likewise. 31761 * tests/sched_xetscheduler.test: Likewise. 31762 * tests/seccomp.test: Likewise. 31763 * tests/select.test: Likewise. 31764 * tests/sendfile.test: Likewise. 31765 * tests/sendfile64.test: Likewise. 31766 * tests/splice.test: Likewise. 31767 * tests/statx.sh: Likewise. 31768 * tests/sysinfo.test: Likewise. 31769 * tests/syslog.test: Likewise. 31770 * tests/tee.test: Likewise. 31771 * tests/time.test: Likewise. 31772 * tests/timer_create.test: Likewise. 31773 * tests/timer_xettime.test: Likewise. 31774 * tests/timerfd_xettime.test: Likewise. 31775 * tests/times-fail.test: Likewise. 31776 * tests/times.test: Likewise. 31777 * tests/truncate.test: Likewise. 31778 * tests/truncate64.test: Likewise. 31779 * tests/umask.test: Likewise. 31780 * tests/umount.test: Likewise. 31781 * tests/umount2.test: Likewise. 31782 * tests/userfaultfd.test: Likewise. 31783 * tests/vmsplice.test: Likewise. 31784 * tests/xet_robust_list.test: Likewise. 31785 * tests/xetitimer.test: Likewise. 31786 * tests/xetpgid.test: Likewise. 31787 * tests/xetpriority.test: Likewise. 31788 * tests/xettimeofday.test: Likewise. 31789 31790 tests: introduce $NAME. 31791 * tests/init.sh (NAME): New variable, defined to ${ME_%.test}. 31792 (run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test} 31793 with $NAME. 31794 * tests/fcntl.test: Likewise. 31795 * tests/fstat.test: Likewise. 31796 * tests/mmap.test: Likewise. 31797 * tests/net-y-unix.test: Likewise. 31798 * tests/net-yy-inet.test: Likewise. 31799 * tests/net-yy-unix.test: Likewise. 31800 * tests/open.test: Likewise. 31801 * tests/openat.test: Likewise. 31802 * tests/poll.test: Likewise. 31803 * tests/ppoll.test: Likewise. 31804 * tests/readlink.test: Likewise. 31805 * tests/select.test: Likewise. 31806 * tests/statx.sh: Likewise. 31807 * tests/uname.test: Likewise. 31808 31809 2016-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 31810 31811 tests: move definitions of $OUT and $ERR to init.sh. 31812 As virtually every test defines either one or both of OUT and ERR 31813 variables and these definitions are exactly the same, move definitions 31814 of these variables from individual tests to init.sh. 31815 31816 * tests/init.sh (OUT, ERR): New variables. 31817 * tests/ipc.sh: Remove initialization of OUT variable. 31818 * tests/statx.sh: Likewise. 31819 * tests/*.test: Remove initialization of OUT and ERR variables. 31820 31821 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 31822 31823 tests: simplify sendfile.test and sendfile64.test. 31824 Use the executable itself for input by default. 31825 31826 * tests/sendfile.c (main): Use av[0] instead of av[1] for input. 31827 * tests/sendfile64.c (main): Likewise. 31828 * tests/sendfile.test: Invoke run_prog without arguments. 31829 * tests/sendfile64.test: Likewise. 31830 31831 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 31832 31833 open.test, openat.test: lift /proc requirement. 31834 While -P option needs /proc to match descriptors, it does not use 31835 /proc to match pathnames. As these tests do not need descriptor 31836 match, the /proc requirement can be safely lifted. 31837 31838 * tests/open.test: Lift /proc/self/fd/ requirement. 31839 * tests/openat.test: Likewise. 31840 31841 2016-03-29 Dmitry V. Levin <ldv (a] altlinux.org> 31842 31843 quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. 31844 * quota.c (if_nextdqblk): New structure. 31845 (decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA. 31846 31847 Update Q_* constants. 31848 * xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced 31849 by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6. 31850 31851 Update CLONE_* constants. 31852 * xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP. 31853 The former was removed by linux kernel commit v2.6.38-rc1~217. 31854 The latter was introduced by linux kernel commit v4.6-rc1~67^2~8. 31855 31856 Update BPF_MAP_TYPE_* constants. 31857 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH, 31858 BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by 31859 linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and 31860 v4.6-rc1~91^2~212^2~1, respectively. 31861 31862 Update SO_* constants. 31863 * xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel 31864 commit v4.6-rc1~91^2~176. 31865 31866 Update SEGV_* constants. 31867 * xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel 31868 commit v4.6-rc1~68^2~23. 31869 31870 avr32: wire up copy_file_range syscall. 31871 * linux/avr32/syscallent.h [325]: Add copy_file_range entry. 31872 31873 2016-03-28 JayRJoshi <jay.r.joshi100 (a] gmail.com> 31874 31875 tests/uname.test: check abbreviated output, use print_quoted_string. 31876 * tests/uname.c (main): Use print_quoted_string to print 31877 utsname members. Add abbrev check. 31878 * tests/uname.test: Add abbrev check. 31879 31880 2016-03-28 Dmitry V. Levin <ldv (a] altlinux.org> 31881 31882 faccessat.test: robustify against libcs invoking faccessat syscall on their own 31883 * tests/faccessat.c (TMP_FILE): Rename to sample, change its value 31884 to "faccessat.sample". 31885 * tests/faccessat.test: Rewrite using openat.test. 31886 31887 openat.test: robustify against libcs invoking openat syscall on their own 31888 * tests/openat.c (main): Rename fname to sample, change its value 31889 to "openat.sample". 31890 * tests/openat.test: Use -P option to filter out openat syscalls 31891 made by libc and dynamic linker. 31892 31893 tests: add open.test. 31894 * tests/open.c: New file. 31895 * tests/open.test: New test. 31896 * tests/.gitignore: Add open. 31897 * tests/Makefile.am (check_PROGRAMS): Likewise. 31898 (DECODER_TESTS): Add open.test. 31899 31900 2016-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 31901 31902 Update generic ioctl entries from linux 4.5. 31903 * linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh. 31904 * linux/32/ioctls_inc_align32.h: Likewise. 31905 * linux/32/ioctls_inc_align64.h: Likewise. 31906 * NEWS: Mention this. 31907 31908 2016-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 31909 31910 maint: update for linux 4.5. 31911 * maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files. 31912 Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files. 31913 Update path of saa6588.h and exynos-fimc.h files. 31914 31915 2016-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 31916 31917 Fix decoding of device numbers in mknod and mknodat syscalls. 31918 * mknod.c (decode_mknod): Treat device number argument as unsigned int. 31919 * tests/mknod.c: Include <sys/sysmacros.h> or <sys/mkdev.h> 31920 for definition of makedev macro. 31921 (main): Add a check for a character special file. 31922 31923 2016-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 31924 31925 sparc64: fix decoding of mknod and mknodat syscalls for sparc personality 31926 Remove remnants of solaris personality support in mknod parser 31927 that resulted to sparc personality being decoded as old solaris 31928 personality. This complements commit v4.10-45-gdf4dd8b and fixes 31929 commit v4.10-46-g588a90f. 31930 31931 * mknod.c (decode_mknod) [SPARC || SPARC64]: Remove. 31932 31933 2016-03-25 Katerina Koukiou <k.koukiou (a] googlemail.com> 31934 31935 tests: add openat.test. 31936 * tests/openat.c: New file. 31937 * tests/openat.test: New test. 31938 * tests/.gitignore: Add openat. 31939 * tests/Makefile.am (check_PROGRAMS): Likewise. 31940 (DECODER_TESTS): Add openat.test. 31941 31942 2016-03-25 Fei Jie <feij.fnst (a] cn.fujitsu.com> 31943 31944 tests: add renameat.test. 31945 * tests/renameat.c: New file. 31946 * tests/renameat.test: New test. 31947 * tests/.gitignore: Add renameat. 31948 * tests/Makefile.am (check_PROGRAMS): Likewise. 31949 (DECODER_TESTS): Add renameat.test. 31950 31951 tests: add faccessat.test. 31952 * tests/faccessat.c: New file. 31953 * tests/faccessat.test: New test. 31954 * tests/.gitignore: Add faccessat. 31955 * tests/Makefile.am (check_PROGRAMS): Likewise. 31956 (DECODER_TESTS): Add faccessat.test. 31957 31958 tests: add creat.test. 31959 * tests/creat.c: New file. 31960 * tests/creat.test: New test. 31961 * tests/.gitignore: Add creat. 31962 * tests/Makefile.am (check_PROGRAMS): Likewise. 31963 (DECODER_TESTS): Add creat.test. 31964 31965 tests: add mknod.test. 31966 * tests/mknod.c: New file. 31967 * tests/mknod.test: New test. 31968 * tests/.gitignore: Add mknod. 31969 * tests/Makefile.am (check_PROGRAMS): Likewise. 31970 (DECODER_TESTS): Add mknod.test. 31971 31972 tests: add syslog.test. 31973 * tests/syslog.c: New file. 31974 * tests/syslog.test: New test. 31975 * tests/.gitignore: Add syslog. 31976 * tests/Makefile.am (check_PROGRAMS): Likewise. 31977 (DECODER_TESTS): Add syslog.test. 31978 31979 2016-03-23 JayRJoshi <jay.r.joshi100 (a] gmail.com> 31980 31981 tests/scm_rights-fd.test: fix pathname regex. 31982 Pathname containing >, }, or non-printable characters was resulting 31983 in failing of the test. 31984 31985 * tests/scm_rights-fd.test: Fix pathname regex and simplify things. 31986 31987 2016-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 31988 31989 tests: add strace-r.test. 31990 * tests/strace-r.expected: New file. 31991 * tests/strace-r.test: New test. 31992 * tests/Makefile.am (MISC_TESTS): Add it. 31993 (EXTRA_DIST): Add strace-r.expected. 31994 31995 tests: add strace-ttt.test. 31996 * tests/strace-ttt.test: New test. 31997 * tests/Makefile.am (MISC_TESTS): Add it. 31998 31999 tests: add strace-tt.test. 32000 * tests/strace-tt.test: New test. 32001 * tests/Makefile.am (MISC_TESTS): Add it. 32002 32003 tests: add strace-t.test. 32004 * tests/strace-t.test: New test. 32005 * tests/Makefile.am (MISC_TESTS): Add it. 32006 32007 tests: add strace-T.test. 32008 * tests/strace-T.expected: New file. 32009 * tests/strace-T.test: New test. 32010 * tests/Makefile.am (MISC_TESTS): Add it. 32011 (EXTRA_DIST): Add strace-T.expected. 32012 32013 2016-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 32014 32015 tests: split out tests of specific decoders. 32016 Split TESTS into three groups: tests of specific decoders, libunwind 32017 tests, and all other tests. 32018 32019 * tests/Makefile.am (TESTS): Move attach-f-p.test, attach-p-cmd.test, 32020 bexecve.test, count-f.test, count.test, detach-running.test, 32021 detach-sleeping.test, detach-stopped.test, dumpio.test, 32022 filter-unavailable.test, fork-f.test, ksysent.test, opipe.test, 32023 pc.test, qual_syscall.test, redirect.test, restart_syscall.test, 32024 strace-f.test, and vfork-f.test to MISC_TESTS. 32025 Move remaining tests except $(LIBUNWIND_TESTS) to DECODER_TESTS. 32026 Add $(DECODER_TESTS) and $(MISC_TESTS). 32027 32028 2016-03-23 JayRJoshi <jay.r.joshi100 (a] gmail.com> 32029 32030 tests: add getcwd.test. 32031 * tests/getcwd.c: New file. 32032 * tests/getcwd.test: New test. 32033 * tests/.gitignore: Add getcwd. 32034 * tests/Makefile.am (check_PROGRAMS): Likewise. 32035 (TESTS): Add getcwd.test. 32036 32037 tests: add print_quoted_string function to libtests. 32038 * tests/tests.h (print_quoted_string): New prototype. 32039 * tests/print_quoted_string.c: New file. 32040 * tests/Makefile.am (libtests_a_SOURCES): Add it. 32041 32042 2016-03-17 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32043 32044 tests: add xetpriority.test. 32045 * resource.c (SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Print 32046 the second syscall argument using %d format. 32047 * tests/xetpriority.c: New file. 32048 * tests/xetpriority.test: New test. 32049 * tests/.gitignore: Add xetpriority. 32050 * tests/Makefile.am (check_PROGRAMS): Likewise. 32051 (TESTS): Add xetpriority.test. 32052 32053 2016-03-15 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32054 32055 tests: add flock.test. 32056 * tests/flock.c: New file. 32057 * tests/flock.test: New test. 32058 * tests/.gitignore: Add flock. 32059 * tests/Makefile.am (check_PROGRAMS): Likewise. 32060 (TESTS): Add flock.test. 32061 32062 tests: add sched_xetscheduler.test. 32063 * tests/sched_xetscheduler.c: New file. 32064 * tests/sched_xetscheduler.test: New test. 32065 * tests/.gitignore: Add sched_xetscheduler. 32066 * tests/Makefile.am (check_PROGRAMS): Likewise. 32067 (TESTS): Add sched_xetscheduler.test. 32068 32069 2016-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 32070 32071 alpha: fix SOCK_DIAG_BY_FAMILY tests. 32072 This complements commit v4.9-368-g301c65c. 32073 32074 * tests/netlink_inet_diag.c (check_responses): Align "buf" 32075 on sizeof(long) boundary. 32076 * tests/netlink_unix_diag.c (check_responses): Likewise. 32077 32078 2016-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 32079 32080 Update EPOLL* constants. 32081 * xlat/epollevents.in: Add EPOLLWAKEUP and EPOLLEXCLUSIVE. 32082 32083 2016-03-12 Dmitry V. Levin <ldv (a] altlinux.org> 32084 32085 tests: add count-f.test. 32086 * tests/count-f.c: New file. 32087 * tests/count-f.expected: Likewise. 32088 * tests/count-f.test: New test. 32089 * tests/.gitignore: Add count-f. 32090 * tests/Makefile.am (check_PROGRAMS): Likewise. 32091 (count_f_LDADD): New variable. 32092 (EXTRA_DIST): Add count-f.expected. 32093 (TESTS): Add count-f.test. 32094 32095 2016-02-21 Dmitry V. Levin <ldv (a] altlinux.org> 32096 32097 hppa: wire up copy_file_range syscall. 32098 * linux/hppa/syscallent.h [346]: Add copy_file_range entry. 32099 32100 2016-03-11 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32101 32102 tests: filter strace output in uname test. 32103 * tests/uname.test: Use uniq to filter strace output. 32104 32105 2016-03-10 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32106 32107 tests: add sched_xetparam.test. 32108 * tests/sched_xetparam.c: New file. 32109 * tests/sched_xetparam.test: New test. 32110 * tests/.gitignore: Add sched_xetparam. 32111 * tests/Makefile.am (check_PROGRAMS): Likewise. 32112 (TESTS): Add sched_xetparam.test. 32113 32114 tests: add sched_get_priority_mxx.test. 32115 * tests/sched_get_priority_mxx.c: New file. 32116 * tests/sched_get_priority_mxx.test: New test. 32117 * tests/.gitignore: Add sched_get_priority_mxx. 32118 * tests/Makefile.am (check_PROGRAMS): Likewise. 32119 (TESTS): Add sched_get_priority_mxx.test. 32120 32121 tests: add dup.test, dup2.test, and dup3.test. 32122 * tests/dup.c: New file. 32123 * tests/dup.test: New test. 32124 * tests/dup2.c: New file. 32125 * tests/dup2.test: New test. 32126 * tests/dup3.c: New file. 32127 * tests/dup3.test: New test. 32128 * tests/.gitignore: Add dup, dup2, and dup3. 32129 * tests/Makefile.am (check_PROGRAMS): Likewise. 32130 (TESTS): Add dup.test, dup2.test, and dup3.test. 32131 32132 2016-03-10 Fabien Siron <fabien.siron (a] epita.fr> 32133 32134 tests: add fchmod.test. 32135 * tests/fchmod.c: New file. 32136 * tests/fchmod.test: New test. 32137 * tests/.gitignore: Add fchmod. 32138 * tests/Makefile.am (check_PROGRAMS): Likewise. 32139 (TESTS): Add fchmod.test. 32140 32141 2016-03-09 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32142 32143 tests: add acct.test. 32144 * tests/acct.c: New file. 32145 * tests/acct.test: New test. 32146 * tests/.gitignore: Add acct. 32147 * tests/Makefile.am (check_PROGRAMS): Likewise. 32148 (TESTS): Add acct.test. 32149 32150 2016-03-07 Anchit Jain <anchitjain1234 (a] gmail.com> 32151 32152 tests: add chmod.test. 32153 * tests/chmod.c: New file. 32154 * tests/chmod.test: New test. 32155 * tests/.gitignore: Add chmod. 32156 * tests/Makefile.am (check_PROGRAMS): Likewise. 32157 (TESTS): Add chmod.test. 32158 32159 2016-03-05 Nahim El Atmani <naam (a] lse.epita.fr> 32160 32161 Reduce memory usage while managing tcbs allocation. 32162 * strace.c (init): Remove initial memory allocation for tcbtab. 32163 (expand_tcbtab): Do initial memory allocation when tcbtabsize == 0. 32164 32165 Reviewed-By: Gabriel Laskar <gabriel (a] lse.epita.fr> 32166 Reported-by: haris iqbal <haris.phnx (a] gmail.com> 32167 32168 2016-03-01 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32169 32170 tests: add umask.test. 32171 * tests/umask.c: New file. 32172 * tests/umask.test: New test. 32173 * tests/.gitignore: Add umask. 32174 * tests/Makefile.am (check_PROGRAMS): Likewise. 32175 (TESTS): Add umask.test. 32176 32177 tests: add rename.test. 32178 * tests/rename.c: New file. 32179 * tests/rename.test: New test. 32180 * tests/.gitignore: Add rename. 32181 * tests/Makefile.am (check_PROGRAMS): Likewise. 32182 (TESTS): Add rename.test. 32183 32184 tests: add uname.test. 32185 * tests/uname.c: New file. 32186 * tests/uname.test: New test. 32187 * tests/.gitignore: Add uname. 32188 * tests/Makefile.am (check_PROGRAMS): Likewise. 32189 (TESTS): Add uname.test. 32190 32191 2016-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 32192 32193 mips: wire up copy_file_range syscall. 32194 * linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry. 32195 * linux/mips/syscallent-n64.h [5320]: Likewise. 32196 * linux/mips/syscallent-o32.h [4360]: Likewise. 32197 32198 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 32199 32200 tests: add rt_sigsuspend.test. 32201 * tests/rt_sigsuspend.c: New file. 32202 * tests/rt_sigsuspend.test: New test. 32203 * tests/.gitignore: Add rt_sigsuspend. 32204 * tests/Makefile.am (check_PROGRAMS): Likewise. 32205 (TESTS): Add rt_sigsuspend.test. 32206 32207 Print pid_t arguments of rt_sigqueueinfo and rt_tgsigqueueinfo as int. 32208 * signal.c (SYS_FUNC(rt_sigqueueinfo)): Print first syscall argument 32209 using %d format. 32210 (SYS_FUNC(rt_tgsigqueueinfo)): Print first and second syscall arguments 32211 using %d format. 32212 * tests/rt_tgsigqueueinfo.c: New file. 32213 * tests/rt_tgsigqueueinfo.test: New test. 32214 * tests/.gitignore: Add rt_tgsigqueueinfo. 32215 * tests/Makefile.am (check_PROGRAMS): Likewise. 32216 (TESTS): Add rt_tgsigqueueinfo.test. 32217 32218 getrusage.test: fix build on x32. 32219 * tests/getrusage.c: Include <stdint.h> 32220 (main): Print members of struct timeval using %ju format. 32221 32222 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 32223 32224 getrusage.test: check that getrusage parser does not access extra memory 32225 Place struct rusage at the end of an allocated memory page followed by 32226 an inaccessible page. 32227 32228 * tests/getrusage.c (main): Use tail_alloc. 32229 32230 2016-02-19 Fei Jie <feij.fnst (a] cn.fujitsu.com> 32231 32232 tests: add getrusage.test. 32233 * tests/getrusage.c: New file. 32234 * tests/getrusage.test: New test. 32235 * tests/.gitignore: Add getrusage. 32236 * tests/Makefile.am (check_PROGRAMS): Likewise. 32237 (TESTS): Add getrusage.test. 32238 32239 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 32240 32241 Print rt_sigtimedwait return value as a signal name. 32242 * signal.c (SYS_FUNC(rt_sigtimedwait)): Decode return value. 32243 * tests/rt_sigtimedwait.c: New file. 32244 * tests/rt_sigtimedwait.test: New test. 32245 * tests/.gitignore: Add rt_sigtimedwait. 32246 * tests/Makefile.am (check_PROGRAMS): Likewise. 32247 (TESTS): Add rt_sigtimedwait.test. 32248 32249 tests: add rt_sigprocmask.test. 32250 * tests/rt_sigprocmask.c: New file. 32251 * tests/rt_sigprocmask.test: New test. 32252 * tests/.gitignore: Add rt_sigprocmask. 32253 * tests/Makefile.am (check_PROGRAMS): Likewise. 32254 (TESTS): Add rt_sigprocmask.test. 32255 32256 Fix corner cases of rt_sigpending syscall decoder. 32257 * signal (print_sigset_addr_len_limit): New function, cloned from 32258 print_sigset_addr_len with added minimal length argument. 32259 Treat length less than minimal length or greater than NSIG/8 as invalid. 32260 Do not align length to 4-byte boundary. Align destination buffer 32261 to 4-byte boundary and initialize it with zeroes so that subsequent 32262 call to sprintsigmask_n will not access uninitialized data. 32263 (print_sigset_addr_len): Turn into a wrapper around 32264 print_sigset_addr_len_limit with current_wordsize 32265 as a minimal length argument. 32266 (SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit 32267 instead of print_sigset_addr_len with 1 as a minimal length argument. 32268 * tests/rt_sigpending.c: New file. 32269 * tests/rt_sigpending.test: New test. 32270 * tests/.gitignore: Add rt_sigpending. 32271 * tests/Makefile.am (check_PROGRAMS): Likewise. 32272 (TESTS): Add rt_sigpending.test. 32273 32274 2016-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 32275 32276 Change unix_diag requests back to use full dump instead of exact match. 32277 Unfortunately, 64-bit linux kernel has a bug in matching inode numbers 32278 greater than INT_MAX, so unix_diag exact match is not reliable. 32279 32280 This partially reverts commit 69bfc89770152033d4aa0bc5673fc46e65d89838. 32281 32282 * socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags, 32283 remove initialization of udiag_cookie. 32284 * tests/netlink_unix_diag.c (send_query): Remove "inode" argument, 32285 add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino 32286 and udiag_cookie. 32287 (check_responses): Remove "inode" argument and its use. 32288 (main): Remove invocation of inode_of_sockfd and passing of listening 32289 socket inode to send_query and check_responses. 32290 32291 2016-02-19 Michael Shigorin <mike (a] altlinux.org> 32292 32293 tests: avoid using cpp -dD. 32294 -dD is less portable across some peculiar preprocessors. 32295 32296 tests/Makefile.am (ksysent.h): Use cpp -dM instead of cpp -dD. 32297 32298 2016-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 32299 32300 tests: add poll.test. 32301 * tests/poll.c: New file. 32302 * tests/poll.test: New test. 32303 * tests/.gitignore: Add poll. 32304 * tests/Makefile.am (check_PROGRAMS): Likewise. 32305 (TESTS): Add poll.test. 32306 32307 Fix abbreviated output of poll and ppoll decoders. 32308 * poll.c (decode_poll_entering, decode_poll_exiting): Fix corner cases 32309 of abbreviated output. 32310 * tests/ppoll-v.expected: Update. 32311 * tests/ppoll.expected: Update. 32312 * tests/ppoll.test: Update. 32313 32314 Print unfetchable address in poll and ppoll decoders. 32315 * poll.c (decode_poll_entering): Replace umove call with 32316 umove_or_printaddr. 32317 (decode_poll_exiting): Print unfetchable address when umove call fails. 32318 32319 Print offsets in lseek and _llseek syscalls as signed integers. 32320 * lseek.c (SYS_FUNC(lseek)): Print offset using %lld format. 32321 (SYS_FUNC(llseek)): Likewise. Treat high and low components of offset 32322 as unsigned long integers. 32323 * tests/llseek.c (main): Check that negative offset is printed properly. 32324 * tests/lseek.c (main): Likewise. 32325 32326 2016-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 32327 32328 tests: add xetpgid.test. 32329 * tests/xetpgid.c: New file. 32330 * tests/xetpgid.test: New test. 32331 * tests/.gitignore: Add xetpgid. 32332 * tests/Makefile.am (check_PROGRAMS): Likewise. 32333 (TESTS): Add xetpgid.test. 32334 32335 tests: add alarm.test. 32336 * tests/alarm.c: New file. 32337 * tests/alarm.test: New test. 32338 * tests/.gitignore: Add alarm. 32339 * tests/Makefile.am (check_PROGRAMS): Likewise. 32340 (TESTS): Add alarm.test. 32341 32342 Replace printargs_lu and printargs_ld with printargs_u and printargs_d. 32343 * defs.h (printargs_lu): Rename to printargs_u. 32344 (printargs_ld): Rename to printargs_d. 32345 * syscall.c (printargs_lu): Rename to printargs_u. Replace %lu with %u. 32346 (printargs_ld): Rename to printargs_d. Replace %ld with %d. 32347 * linux/dummy.h (sys_getpgrp): Change to printargs. 32348 (sys_alarm): Change to printargs_u. 32349 (sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp, 32350 sys_timer_delete, sys_timer_getoverrun): Change to printargs_d. 32351 32352 Change printargs_lu and printargs_ld to return RVAL_DECODED. 32353 * syscall.c (printargs_lu, printargs_ld): Return RVAL_DECODED. 32354 32355 redirect.test: fix the way how strace output is discarded. 32356 * tests/redirect.test: Disable tracing of syscalls, signals, 32357 and exit status instead of redirecting strace output to /dev/null. 32358 32359 tests: extend coverage of struct iovec arrays. 32360 * tests/readv.c (main): Check decoding of empty, inaccessible, 32361 and partially inaccessible iovec arrays. 32362 * tests/readv.test: Update. 32363 32364 Implement dumping of vmsplice syscall. 32365 * syscall.c (dumpio): Add SEN_vmsplice. 32366 * NEWS: Mention this. 32367 * tests/vmsplice.c: New file. 32368 * tests/vmsplice.test: New test. 32369 * tests/.gitignore: Add vmsplice. 32370 * tests/Makefile.am (check_PROGRAMS): Likewise. 32371 (TESTS): Add vmsplice.test. 32372 32373 tests: add tee.test. 32374 * tests/tee.c: New file. 32375 * tests/tee.test: New test. 32376 * tests/.gitignore: Add tee. 32377 * tests/Makefile.am (check_PROGRAMS): Likewise. 32378 (TESTS): Add tee.test. 32379 32380 Fix printing of negative offsets in splice syscall. 32381 * io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing 32382 offsets. 32383 * tests/splice.c: New file. 32384 * tests/splice.test: New test. 32385 * tests/.gitignore: Add splice. 32386 * tests/Makefile.am (check_PROGRAMS): Likewise. 32387 (TESTS): Add splice.test. 32388 32389 Implement copy_file_range syscall decoding. 32390 * copy_file_range.c: New file. 32391 * Makefile.am (strace_SOURCES): Add it. 32392 * linux/32/syscallent.h (copy_file_range): New entry. 32393 * linux/64/syscallent.h: Likewise. 32394 * linux/arm/syscallent.h: Likewise. 32395 * linux/i386/syscallent.h: Likewise. 32396 * linux/ia64/syscallent.h: Likewise. 32397 * linux/m68k/syscallent.h: Likewise. 32398 * linux/powerpc/syscallent.h: Likewise. 32399 * linux/powerpc64/syscallent.h: Likewise. 32400 * linux/s390/syscallent.h: Likewise. 32401 * linux/s390x/syscallent.h: Likewise. 32402 * linux/sparc/syscallent.h: Likewise. 32403 * linux/sparc64/syscallent.h: Likewise. 32404 * linux/x32/syscallent.h: Likewise. 32405 * linux/x86_64/syscallent.h: Likewise. 32406 * pathtrace.c (pathtrace_match): Add SEN_copy_file_range. 32407 * NEWS: Mention new syscall parser. 32408 * tests/copy_file_range.c: New file. 32409 * tests/copy_file_range.test: New test. 32410 * tests/.gitignore: Add copy_file_range. 32411 * tests/Makefile.am (check_PROGRAMS): Likewise. 32412 (TESTS): Add copy_file_range.test. 32413 32414 Update fs *_MAGIC constants. 32415 * xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC. 32416 32417 Update IPV6_* constants. 32418 * xlat/sockipv6options.in: Add IPV6_HDRINCL. 32419 32420 Update SO_* constants. 32421 * xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF 32422 and SO_ATTACH_REUSEPORT_EBPF. 32423 32424 Update MADV_* constants. 32425 * xlat/madvise_cmds.in: Add MAD_FREE. 32426 32427 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 32428 32429 tests: robustify execve and execveat tests. 32430 * tests/execve.c (main): Use one page gap between two mapped regions 32431 for an address that is more likely to be not yet mapped. 32432 * tests/execveat.c (main): Likewise. 32433 32434 tests: simplify execve test. 32435 * tests/execve.c (main): Simplify the test assuming that execve syscall 32436 never returns ENOSYS. 32437 32438 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 32439 32440 Fix numbers of syscall arguments in syscall tables. 32441 This semi-automatic change brings syscall tables in sync with kernel's 32442 include/linux/syscalls.h file. 32443 32444 * linux/aarch64/syscallent.h (recv): Fix nargs. 32445 * linux/alpha/syscallent.h (sigaltstack, init_module, 32446 sched_getscheduler, settimeofday): Likewise. 32447 * linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl, 32448 shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy, 32449 timerfd_create): Likewise. 32450 * linux/bfin/syscallent.h (signal, delete_module): Likewise. 32451 * linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler, 32452 io_cancel, set_tid_address, listxattr, llistxattr, flistxattr, 32453 removexattr, lremovexattr, fremovexattr): Likewise. 32454 * linux/i386/syscallent.h (signal, mmap): Likewise. 32455 * linux/ia64/syscallent.h (init_module, readv, writev, 32456 sched_getscheduler): Likewise. 32457 * linux/m68k/syscallent.h (signal, request_key): Likewise. 32458 * linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice): 32459 Likewise. 32460 * linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module, 32461 delete_module): Likewise. 32462 * linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module, 32463 delete_module): Likewise. 32464 * linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm, 32465 fstatfs64): Likewise. 32466 * linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise. 32467 * linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead, 32468 fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2, 32469 fallocate, preadv, pwritev, fanotify_mark): Likewise. 32470 * linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise. 32471 * linux/s390x/syscallent.h (signal, ipc): Likewise. 32472 * linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice): 32473 Likewise. 32474 * linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt, 32475 shmctl, fstatfs64, vmsplice): Likewise. 32476 * linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise. 32477 * linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64, 32478 readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc, 32479 sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise. 32480 * linux/x32/syscallent.h (64:recvmsg): Likewise. 32481 * linux/xtensa/syscallent.h (mremap, futex, reboot, init_module, 32482 delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat, 32483 futimesat, fchmodat, faccessat): Likewise. 32484 * NEWS: Mention this fix. 32485 32486 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 32487 32488 s390: decode fadvise64 and fadvise64_64. 32489 * linux/s390/syscallent.h (fadvise64): Set sys_func. 32490 (fadvise64_64): Set nargs and sys_func. 32491 32492 mips n64: use the most optimal parser for fadvise64 syscall. 32493 * linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64) 32494 with SEN(fadvise64). 32495 32496 ia64: decode fstatfs64 and statfs64. 32497 * linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func. 32498 32499 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 32500 32501 alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments. 32502 On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures 32503 pipe syscall does not take arguments. 32504 32505 * linux/alpha/syscallent.h (pipe): Change nargs to 0. 32506 * linux/ia64/syscallent.h (pipe): Likewise. 32507 * linux/mips/syscallent-n32.h (pipe): Likewise. 32508 * linux/mips/syscallent-n64.h (pipe): Likewise. 32509 * linux/mips/syscallent-o32.h (pipe): Likewise. 32510 * linux/sh/syscallent.h (pipe): Likewise. 32511 * linux/sh64/syscallent.h (pipe): Likewise. 32512 32513 2016-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 32514 32515 alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall. 32516 * net.c (do_pipe) [HAVE_GETRVAL2]: Remove. 32517 Always call decode_pair_fd on exiting. 32518 (SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe. 32519 32520 Fix pathtrace match for pipe2 syscall. 32521 * pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors 32522 or paths to test, move SEN_pipe2 to the appropriate category. 32523 32524 avr32: wire up missing syscalls. 32525 * linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier, 32526 and mlock2 entries. 32527 32528 2016-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 32529 32530 tests: check decoding of madvise, mlockall, mremap, and msync syscalls. 32531 * tests/mmap.c (main): Change output format from regexp to verbatim. 32532 Add tests for madvise, mlockall, mremap, and msync syscalls. 32533 * tests/mmap.test: Convert from match_grep to match_diff. 32534 Add madvise, mlockall, mremap, and msync syscalls to syscall filter. 32535 32536 2016-02-11 Dmitry V. Levin <ldv (a] altlinux.org> 32537 32538 Simplify decoding of waitpid and wait4 syscalls. 32539 * wait.c (printwaitn): Replace "n" and "bitness" integer arguments 32540 with a single print_rusage function pointer. All callers updated. 32541 32542 waitid: print pid argument as int. 32543 * wait.c (SYS_FUNC(waitid)): As the type of second syscall argument 32544 in the kernel is pid_t, print it as int. 32545 32546 waitid: always print 5th argument. 32547 * wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs 32548 as waitid syscall has 5 arguments. 32549 32550 socketutils: add const qualifier to variables. 32551 * socketutils.c (cache_and_print_inode_details): Make "details" 32552 parameter const. 32553 (print_sockaddr_by_inode_cached): Make "e" variable const. 32554 (inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2 32555 members const. Make "msg" variable const. 32556 (inet_parse_response): Make "data" parameter and diag_msg variable const. 32557 (receive_responses): Make "h" and "rc" variables const. 32558 (unix_send_query): Make struct nlmsghdr and struct unix_diag_req 32559 members const. Make "msg" variable const. 32560 (unix_print): Make all parameters const. 32561 (print_sockaddr_by_inode): Make proto_name parameter const. 32562 32563 print_sockaddr_by_inode: cleanup protocol lookup. 32564 * socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print, 32565 udp_v6_print): New functions. 32566 (print_sockaddr_by_inode): Make "protocols" array static, replace 32567 "family" and "protocol" members with "print" in its underlying 32568 structure. Iterate through protocols array when the protocol name 32569 is specified. 32570 32571 2016-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 32572 32573 tests: check that -f -p attaches to threads properly. 32574 Check that -f -p attaches and follows all threads of the given pid. 32575 32576 * tests/attach-f-p.c: New file. 32577 * tests/attach-f-p.test: New test. 32578 * tests/.gitignore: Add attach-f-p. 32579 * tests/Makefile.am (check_PROGRAMS): Likewise. 32580 (attach_f_p_LDADD): New variable. 32581 (TESTS): Add attach-f-p.test. 32582 32583 2016-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 32584 32585 Introduce libstrace.a for potentially conditional compilation units. 32586 Some files are used conditionally depending on architecture and 32587 configuration. Create a library for the purpose of keeping such 32588 compilation units. 32589 32590 * Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a. 32591 (libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS). 32592 (libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS). 32593 (libstrace_a_SOURCES): New variable, set to upeek.c. 32594 * util.c (upeek): Move ... 32595 * upeek.c: ... here. 32596 32597 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 32598 32599 travis-ci: pass more gcov arguments to codecov. 32600 32601 tests: extend coverage of struct itimerspec. 32602 * tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec 32603 pointer. 32604 32605 tests: extend coverage of utimensat syscall. 32606 * tests/utimensat.c (main): Check decoding of NULL struct timespec 32607 pointer. 32608 32609 tests: extend coverage of time syscall. 32610 * tests/time.c (main): Check decoding of NULL time_t pointer. 32611 32612 tests: extend coverage of struct sigevent. 32613 * tests/timer_create.c (main): Check decoding of NULL struct sigevent 32614 pointer. Check decoding of invalid sigev_notify value. 32615 32616 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 32617 32618 tests: extend coverage of execve and execveat syscalls. 32619 Check decoding of inaccessible or partially inaccessible arrays. 32620 32621 * tests/execve-v.c: New file. 32622 * tests/execveat-v.c: Likewise. 32623 * tests/execve-v.test: New test. 32624 * tests/execveat-v.test: Likewise. 32625 * tests/execve.c: Rewrite. 32626 * tests/execveat.c: Likewise. 32627 * tests/execve.test: Likewise. 32628 * tests/execveat.test: Likewise. 32629 * tests/execve.expected: Remove. 32630 * tests/execve-v.expected: Likewise. 32631 * tests/execveat.expected: Likewise. 32632 * tests/execveat-v.expected: Likewise. 32633 * tests/.gitignore: Add execve-v and execveat-v. 32634 * tests/Makefile.am (check_PROGRAMS): Likewise. 32635 (TESTS): Add execve-v.test and execveat-v.test. 32636 (EXTRA_DIST): Remove execve.expected, execve-v.expected, 32637 execveat.expected, and execveat-v.expected. 32638 32639 2016-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 32640 32641 Fix decoding of execve and execveat syscalls with invalid input. 32642 * execve.c (printargv): Fix decoding of inaccessible or partially 32643 inaccessible array. 32644 (printargc): Diagnose inaccessible or partially inaccessible array. 32645 (decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers. 32646 32647 tests: extend coverage of capget syscall. 32648 * tests/caps.c (main): Check decoding of inaccessible cap_user_header_t 32649 and/or cap_user_data_t. 32650 * tests/caps.awk: Update match patterns. 32651 * tests/caps.test: Update. 32652 32653 tests: extend coverage of sched_getaffinity syscall. 32654 * tests/sched_xetaffinity.c (main): Check decoding of pointer 32655 to inaccessible cpu_set_t. 32656 32657 tests: extend coverage of utime syscall. 32658 * tests/utime.c (main): Check decoding of NULL struct utimbuf pointer. 32659 Check decoding of struct utimbuf located at the end of page boundary. 32660 * tests/utime.test: Update. 32661 32662 tests: extend coverage of sysinfo syscall. 32663 * tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer. 32664 Check decoding of struct sysinfo located at the end of page boundary. 32665 * tests/sysinfo.test: Update. 32666 32667 tests: extend coverage of adjtimex syscall. 32668 * tests/adjtimex.c (main): Check decoding of NULL struct timex pointer. 32669 Check decoding of struct timex located at the end of page boundary. 32670 * tests/adjtimex.test: Update. 32671 32672 tests: check that strace does not retain stdin and stdout descriptors. 32673 * tests/redirect.test: New test. 32674 * tests/Makefile.am (TESTS): Add it. 32675 32676 Create a dummy pipe descriptor instead of opening /dev/null. 32677 * strace.c (open_dev_null): Rename to open_dummy_desc. All callers 32678 changed. Create a pipe and return its first descriptor instead of 32679 opening /dev/null. 32680 32681 2016-02-08 Denys Vlasenko <dvlasenk (a] redhat.com> 32682 32683 If stdin/stdout aren't open on startup, open them to /dev/null. 32684 Otherwise, -oLOGFILE may end up using one of them. This conflicts 32685 with the previous change, which closes stdin/out in strace. 32686 32687 * strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout, 32688 sanitize them: open /dev/null and dup it until fds 0,1,2 32689 are all used up. 32690 32691 2016-02-08 Denys Vlasenko <dvlasenk (a] redhat.com> 32692 32693 Close stdin/out after child is forked. 32694 Testcase: 32695 32696 { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9' 32697 32698 The writer (head) will be able to perform writes to write end of the pipe. 32699 With strace call removed, head will immediately get SIGPIPE. 32700 32701 This change fixes this: now writer immediately gets SIGPIPE with strace too. 32702 32703 * strace.c (startup_child): Close stdin/out and reopen them to /dev/null. 32704 32705 2016-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 32706 32707 tests: add opipe.test. 32708 Check that -o |pipe_command works. In particular, check that 32709 strace waits for completion of piped command. 32710 32711 * tests/opipe.test: New test. 32712 * tests/Makefile.am (TESTS): Add it. 32713 32714 2016-02-05 Keith Owens <kaos.ocs (a] gmail.com> 32715 32716 strace-graph: print the pid in the graph. 32717 * strace-graph: Prefix each command with its pid. 32718 32719 strace-graph: cope with clone immediately followed by exit. 32720 * strace-graph: A clone() followed by exit() with no intervening fork 32721 or execve resulted in the new pid having no seq key. That breaks when 32722 trying to use seq as an array reference. Ensure that clone populates 32723 the new pid with an empty seq entry. 32724 32725 strace-graph: handle recent strace output. 32726 * strace-graph: Fix regex for --SIG. Ignore '+++ exited with <n> +++' 32727 lines. Handle exit_group syscall as well as _exit. 32728 32729 strace-graph: handle strace -T. 32730 * strace-graph: Ignore extra ' <time.spent>' field added by strace -T. 32731 32732 strace-graph: use "strict" and "warnings" pragmas. 32733 * strace-graph: Set "use strict" and "use warnings" options. Fix errors 32734 detected by strict/warnings. $result is really a string, it can be "-1" 32735 followed by an error text. 32736 32737 2016-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 32738 32739 Add README.md file with links to build status and test coverage. 32740 32741 travis-ci: prepare and submit test coverage report. 32742 32743 tests: extend readlink and readlinkat coverage. 32744 * tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros. 32745 (main): Allocate memory for string and buffer passed to the syscall 32746 being tested using tail_alloc mechanism. Create and cleanup test 32747 symlink. Test syscall error path output. Print hexquoted strings 32748 using hexquote_strndup. 32749 * tests/readlinkat.c: Likewise. 32750 * tests/readlink.test: Remove creation and cleanup of test symlinks. 32751 32752 tests: add hexquote_strndup function to libtests. 32753 * tests/tests.h (hexquote_strndup): New prototype. 32754 * tests/hexquote_strndup.c: New file. 32755 * tests/Makefile.am (libtests_a_SOURCES): Add it. 32756 32757 readlinkat.test: use readlink.test. 32758 * tests/readlink.test (syscall): Initialize from $0. 32759 * tests/readlinkat.test: Source readlink.test. 32760 32761 2016-02-04 Gabriel Laskar <gabriel (a] lse.epita.fr> 32762 32763 Add configure --enable-code-coverage option. 32764 * m4/ax_code_coverage.m4: New file. 32765 * configure.ac: Use AX_CODE_COVERAGE. 32766 * Makefile.am: Add @CODE_COVERAGE_RULES@. 32767 (CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS, 32768 CODE_COVERAGE_IGNORE_PATTERN): New variables. 32769 (strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS). 32770 (strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS). 32771 (strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS). 32772 * .gitignore: Add *.gcda and *.gcno. 32773 32774 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32775 32776 Makefile.am: introduce strace_CFLAGS and derivatives. 32777 * Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS). 32778 (libmpers_CFLAGS): New variable, set to $(strace_CFLAGS). 32779 (libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables, 32780 set to $(libmpers_CFLAGS). 32781 32782 Makefile.am: use strace_CPPFLAGS consistently. 32783 * Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS) 32784 with $(strace_CPPFLAGS). 32785 32786 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32787 32788 tests: replace net-fd.test with net-y-unix.test. 32789 Unlike the former test that was based on match_grep, 32790 the new one uses match_diff and does more rigorous testing. 32791 32792 * tests/net-y-unix.c: New file. 32793 * tests/net-y-unix.test: New test. 32794 * tests/net-fd.test: Remove. 32795 * tests/net-fd.expected: Remove. 32796 * tests/.gitignore: Add net-y-unix. 32797 * tests/Makefile.am (check_PROGRAMS): Likewise. 32798 (TESTS): Replace net-fd.test with net-y-unix.test. 32799 (net-fd.log): Remove. 32800 (EXTRA_DIST): Remove net-fd.expected. 32801 32802 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32803 32804 Implement caching of print_sockaddr_by_inode. 32805 As -yy parser, compared to -y, needs to do at least 5 extra syscalls 32806 (getxattr, socket, sendmsg, recvmsg, close) to print socket details, 32807 caching results of netlink conversations between strace and kernel 32808 noticeably reduces amount of system time spent by strace. 32809 32810 The caching is safe since sockets do not change their addresses after 32811 successful bind or connect syscall. 32812 32813 * defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes. 32814 * socketutils.c (cache_entry): New type. 32815 (CACHE_SIZE, CACHE_MASK): New macros. 32816 (cache): New static array. 32817 (cache_and_print_inode_details): New static function. 32818 (print_sockaddr_by_inode_cached): New function. 32819 (inet_parse_response, unix_parse_response): Use 32820 cache_and_print_inode_details. 32821 * util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached. 32822 (string_quote): Remove static qualifier. 32823 * NEWS: Mention this improvement. 32824 * tests/unix-yy.c (main): Update. 32825 32826 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32827 32828 Change unix_diag requests to use exact match instead of full dump. 32829 * socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags, 32830 initialize udiag_cookie. 32831 * tests/netlink_unix_diag.c (send_query): Remove "family" and "proto" 32832 arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags, 32833 initialize udiag_ino and udiag_cookie. 32834 (check_responses): Add "inode" argument, check inode match. 32835 (main): Pass listening socket inode to send_query and check_responses. 32836 32837 Robustify netlink response parsers. 32838 * socketutils.c (inet_parse_response, unix_parse_response): Change 32839 return type from bool to int, return -1 on all parse errors except 32840 inode mismatch. 32841 (receive_responses): Stop on the first nlmsg_type that is not 32842 SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1. 32843 * tests/netlink_inet_diag.c (check_responses): Stop on short messages, 32844 on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose 32845 diagnostics for NLMSG_ERROR. 32846 * tests/netlink_unix_diag.c (check_responses): Likewise. 32847 32848 inet_parse_response: add a safety check. 32849 * socketutils.c (inet_parse_response): Check that netlink message 32850 is large enough to contain a inet_diag_msg structure. 32851 32852 receive_responses: avoid potential hangup. 32853 * socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after 32854 the first recvmsg call to avoid potential hangup. 32855 32856 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32857 32858 tests: replace net-yy.test with net-yy-inet.test. 32859 Unlike the former test that was based on match_awk, 32860 the new one uses match_diff and does more rigorous testing. 32861 32862 * tests/net-yy-inet.c: New file. 32863 * tests/net-yy-inet.test: New test. 32864 * tests/net-yy.test: Remove. 32865 * tests/net-yy-accept.awk: Remove. 32866 * tests/net-yy-connect.awk: Remove. 32867 * tests/inet-accept-connect-send-recv.c: Remove. 32868 * tests/.gitignore: Replace inet-accept-connect-send-recv 32869 with net-yy-inet. 32870 * tests/Makefile.am (check_PROGRAMS): Likewise. 32871 (TESTS): Replace net-yy.test with net-yy-inet.test. 32872 (EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk. 32873 32874 2016-02-03 Dmitry V. Levin <ldv (a] altlinux.org> 32875 32876 tests: replace unix-yy.test with net-yy-unix.test. 32877 Unlike the former test that was based on match_awk, 32878 the new one uses match_diff and does more rigorous testing. 32879 32880 * tests/net-yy-unix.c: New file. 32881 * tests/net-yy-unix.test: New test. 32882 * tests/unix-yy.test: Remove. 32883 * tests/unix-yy-accept.awk: Remove. 32884 * tests/unix-yy-connect.awk: Remove. 32885 * tests/.gitignore: Add net-yy-unix. 32886 * tests/Makefile.am (check_PROGRAMS): Likewise. 32887 (TESTS): Replace unix-yy.test with net-yy-unix.test. 32888 (EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk. 32889 32890 2016-02-02 Dmitry V. Levin <ldv (a] altlinux.org> 32891 32892 tests: add inode_of_sockfd function to libtests. 32893 * tests/tests.h (inode_of_sockfd): New prototype. 32894 * tests/inode_of_sockfd.c: New file. 32895 * tests/Makefile.am (libtests_a_SOURCES): Add it. 32896 32897 unix_parse_response: add a safety check. 32898 * socketutils.c (unix_parse_response): Check that netlink message 32899 is large enough to contain a unix_diag_msg structure. 32900 32901 2016-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 32902 32903 Fixed decoding of mincore syscall's last argument. 32904 * mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector 32905 that were written by the kernel. 32906 * NEWS: Mention this fix. 32907 * tests/mincore.c: New file. 32908 * tests/mincore.test: New test. 32909 * tests/Makefile.am (check_PROGRAMS): Add mincore. 32910 (TESTS): Add mincore.test. 32911 * tests/.gitignore: Add mincore. 32912 32913 2016-01-23 Dmitry V. Levin <ldv (a] altlinux.org> 32914 32915 Move fallback -yy socket print from printfd to print_sockaddr_by_inode. 32916 * util.c (printfd): In -yy mode, move fallback print of proto:[inode] ... 32917 * socketutils.c (to print_sockaddr_by_inode): ... here. 32918 32919 2016-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 32920 32921 Implement simultaneous use of -p option and tracing of a command. 32922 * strace.c (init): Allow -p option along with a command. 32923 (startup_child): In -D mode, record the parent of the tracer process 32924 as strace_child. 32925 (startup_attach): Save trace_tracer_pid before -D mode fork. 32926 When tracing a command in -f mode, do not check for the command's 32927 threads as it has no threads at this moment. 32928 Never attach to the tracer process. 32929 In -D mode, never attach to the parent of the tracer process, 32930 terminate that process only once at the end of startup_attach, 32931 and reset strace_child. 32932 * strace.1: Document that -p option can be used along with tracing 32933 of a command. 32934 * NEWS: Mention it. 32935 * tests/attach-p-cmd-cmd.c: New file. 32936 * tests/attach-p-cmd-p.c: Likewise. 32937 * tests/attach-p-cmd.test: New test. 32938 * tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p. 32939 * tests/Makefile.am (check_PROGRAMS): Likewise. 32940 (TESTS): Add attach-p-cmd.test. 32941 32942 This fixes Debian bug #549942. 32943 32944 2016-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 32945 32946 strace.1: fix format of -P description. 32947 * strace.1 (-P): Write trailing using regular font. 32948 32949 2016-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 32950 32951 tests: use local nanosleep based sleep utility replacement. 32952 * tests/sleep.c: New file. 32953 * tests/.gitignore: Add sleep. 32954 * tests/Makefile.am (check_PROGRAMS): Likewise. 32955 * tests/count.test: Use it instead of system sleep utility. 32956 32957 tests: add error_msg_and_fail function to libtests. 32958 * tests/tests.h (error_msg_and_fail): New prototype. 32959 * tests/error_msg.c (error_msg_and_fail): New function. 32960 32961 2016-01-20 Dmitry V. Levin <ldv (a] altlinux.org> 32962 32963 Fix dumping of recvmmsg syscall in case of short read. 32964 * net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov, 32965 pass data size limit to dumpiov_upto. 32966 * NEWS: Mention this fix. 32967 * tests/mmsg.c (main): Update. 32968 32969 Fix dumping of recvmsg syscall in case of short read. 32970 * defs.h (dumpiov_in_msghdr): Add unsigned long argument. 32971 * net.c (dumpiov_in_msghdr): Add data_size argument. Call dumpiov_upto 32972 instead of dumpiov, pass data_size to dumpiov_upto. 32973 * syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr. 32974 * NEWS: Mention this fix. 32975 * tests/recvmsg.c: New file. 32976 * tests/recvmsg.test: New test. 32977 * tests/Makefile.am (check_PROGRAMS): Add recvmsg. 32978 (TESTS): Add recvmsg.test. 32979 * tests/.gitignore: Add recvmsg. 32980 32981 Fix decoding and dumping of readv syscall in case of short read. 32982 * defs.h (dumpiov_upto): New prototype. 32983 (dumpiov): Change to a wrapper around dumpiov_upto. 32984 * util.c (dumpiov): Rename to dumpiov_upto, add and check data_size 32985 argument. 32986 * io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead 32987 of tprint_iov and specify syscall return value as a data size limit. 32988 * syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead 32989 of dumpiov and specify syscall return value as a data size limit. 32990 * NEWS: Mention this fix. 32991 * tests/readv.c: New file. 32992 * tests/readv.test: New test. 32993 * tests/Makefile.am (check_PROGRAMS): Add readv. 32994 (TESTS): Add readv.test. 32995 * tests/.gitignore: Add readv. 32996 32997 tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros. 32998 * tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros. 32999 * tests/aio.c (ARRAY_SIZE): Remove. 33000 * tests/mmsg.c (LENGTH_OF): Remove. 33001 33002 tests: add hexdump_strdup function to libtests. 33003 * tests/tests.h (hexdump_strdup): New prototype. 33004 * tests/hexdump_strdup.c: New file. 33005 * tests/Makefile.am (libtests_a_SOURCES): Add it. 33006 33007 tests: add tprintf function to libtests. 33008 * tests/tests.h (tprintf): New prototype. 33009 * tests/tprintf.c: New file. 33010 * tests/Makefile.am (libtests_a_SOURCES): Add it. 33011 * tests/mmsg.c: Use tprintf. 33012 33013 2016-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 33014 33015 quotactl: add Q_XGETQSTATV command decoding. 33016 * quota.c (fs_qfilestatv, fs_quota_statv): New structures. 33017 (decode_cmd_data): Handle Q_XGETQSTATV case. 33018 33019 quotactl: add decoding of if_dqinfo.dqi_flags constants. 33020 * xlat/if_dqinfo_flags.in: New file. 33021 * quota.c: Include "xlat/if_dqinfo_flags.h". 33022 (decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags. 33023 33024 quotactl: consistenly decode all write and unknown commands on entering. 33025 * quota.c (decode_cmd_data): Change return type to int. 33026 Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA, 33027 Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS, 33028 Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED 33029 for any other command. 33030 (SYS_FUNC(quotactl)): On entering, print third argument of any command. 33031 For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data 33032 and forward its return value. 33033 33034 quotactl: fix Q_QUOTAON command decoding. 33035 * quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path. 33036 33037 quotactl: print third argument as unsigned int. 33038 * quota.c (SYS_FUNC(quotactl)): Consistently print the third 33039 argument using "%u" format. 33040 33041 quotactl: fix Q_XQUOTAOFF command decoding. 33042 * quota.c (decode_cmd_data): Print xfs quota flags argument. 33043 33044 quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding. 33045 * quota.c (decode_cmd_data): As quota format value and xfs quota flags 33046 are in-memory constants, print it like an array of one element instead 33047 of a structure. 33048 33049 2016-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 33050 33051 Update quotactl constants. 33052 * xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1. 33053 * xlat/quotacmds.in: Add Q_XGETQSTATV. 33054 * xlat/quotatypes.in: Add PRJQUOTA. 33055 * xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD. 33056 33057 2016-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 33058 33059 Replace u_int{8,16,32,64} with uint{8,16,32,64} 33060 * util.c: Replace u_int{32,64} with uint{32,64}. 33061 * quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}. 33062 33063 Move definitions of quotactl constants to xlat files. 33064 * quota.c (Q_*): Move to xlat/quotacmds.in. 33065 (USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in. 33066 (QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in. 33067 (XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in. 33068 (XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in. 33069 (QIF_*): Move to xlat/if_dqblk_valid.in. 33070 (IIF_*): Move to xlat/if_dqinfo_valid.in. 33071 33072 2016-01-15 Dmitry V. Levin <ldv (a] altlinux.org> 33073 33074 llseek.test: robustify against libcs invoking _llseek syscall on their own 33075 * tests/llseek.test: Filter out _llseek calls made with non-negative 33076 descriptor arguments. 33077 33078 lseek.test: robustify against libcs invoking lseek syscall on their own. 33079 * tests/lseek.test: Filter out lseek calls made with non-negative 33080 descriptor arguments. 33081 33082 2016-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 33083 33084 mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce. 33085 This fixes the test on platforms where both __NR_sendmmsg and 33086 HAVE_SENDMMSG are defined but the former is not implemented by the 33087 kernel and the second is implemented as an indirect syscall. 33088 33089 * tests/mmsg.c (LENGTH_OF): New macro. 33090 (send_mmsg, recv_mmsg): Print expected output in case of ENOSYS. 33091 (main): Redirect stdout to a new descriptor. Use LENGTH_OF. 33092 Print expected output. 33093 * tests/mmsg.test: Update. 33094 * tests/mmsg.expected: Remove. 33095 * tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected. 33096 33097 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 33098 33099 aio.test: check memory access by aio decoders. 33100 * tests/aio.c (main): Place all objects passed to io_* syscalls 33101 at the end of memory pages followed by inaccessible pages. 33102 33103 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 33104 33105 s390, s390x: fix printing of syscalls unknown to the kernel. 33106 On s390/s390x, syscalls with NR up to 255 can be implemented 33107 directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used. 33108 The latter method is allowed for NR < 256, too. 33109 33110 When the syscall number specified directly or indirectly is recognized 33111 by the kernel, i.e. it is less than its NR_syscalls value, it is stored 33112 in %r2 and is available to arch_get_scno via s390_regset.gprs[2]. 33113 For syscall numbers >= NR_syscalls this register is set to 0, 33114 but %r1 remains unchanged and could be used by arch_get_scno 33115 via s390_regset.gprs[1] to decide what the syscall number is. 33116 33117 * linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero, 33118 take syscall number from s390_regset.gprs[1]. 33119 * NEWS: Mention this fix. 33120 33121 This fixes Debian bug #485979 and Fedora bug #1298294. 33122 33123 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 33124 33125 s390, s390x: print all syscall arguments for syscall number 0. 33126 * linux/s390/syscallent.h [0]: Set nargs to MA. 33127 * linux/s390x/syscallent.h: Likewise. 33128 33129 mips o32: alias sys_syscall to printargs. 33130 * linux/dummy.h (sys_syscall): Alias to printargs. 33131 * syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove. 33132 33133 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 33134 33135 travis-ci: update build matrix. 33136 Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix. 33137 33138 * .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc. 33139 (env): Add matrix, remove global ENABLE_GCC_WERROR. 33140 (matrix): Add exclude, remove include. 33141 * travis-ci.sh: Add support for clang and musl-gcc. 33142 Use --enable-gcc-Werror for gcc build unconditionally. 33143 33144 2016-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 33145 33146 mpers.awk: add support for DWARF files generated by clang. 33147 * mpers.awk: Define default_pointer_size. Initialize byte_size 33148 for DW_TAG_pointer_type to default_pointer_size. Set parent 33149 for DW_TAG_member only. Handle DW_AT_count as an alternative 33150 to DW_AT_upper_bound. 33151 33152 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33153 33154 configure.ac: reorder some statements for better readability. 33155 * configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*, 33156 AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS, 33157 and AC_CHECK_HEADERS. 33158 33159 scm_rights-fd.test: rewrite without fork. 33160 * tests/scm_rights.c (main): Rewrite without fork. 33161 Place all objects passed to sendmsg and recvmsg at the end 33162 of memory pages followed by inaccessible pages. 33163 * tests/scm_rights-fd.test: Update. 33164 33165 tests: fix clang "duplicate 'const' declaration specifier" warnings. 33166 * tests/ksysent.c (pstr_t): Remove second const specifier. 33167 * tests/mmsg.c (main): Remove second const specifier from one[], two[], 33168 and three[]. 33169 33170 tests/times.c: fix clang compilation warning. 33171 * tests/times.c (main): Initialize dummy variable. 33172 33173 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33174 33175 tests/mmsg.c: fix build on rhel6/ppc. 33176 There are weird platforms that define __NR_sendmmsg but at the same time 33177 do not define __NR_recvmmsg. Add a workaround for them. 33178 33179 * configure.ac (AC_CHECK_FUNCS): Add recvmmsg. 33180 * tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG. 33181 33182 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33183 33184 s390: fix sigreturn decoding on recent kernels. 33185 Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask 33186 of the compat signal frame, so remove the old workaround. 33187 33188 * linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove. 33189 33190 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33191 33192 Update PTRACE_* constants. 33193 * ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define. 33194 * xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER. 33195 33196 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33197 33198 Fix struct sigevent decoding for musl. 33199 Do not rely on "struct sigevent.__pad" being located at the same address 33200 as "struct sigevent.sigev_notify_thread_id", it's not the case with musl 33201 libc. Do not rely on struct sigevent definition at all to access 33202 sigev_notify_thread_id. 33203 33204 * configure.ac (AC_CHECK_MEMBERS): Remove struct sigevent._sigev_un._pad 33205 and struct sigevent.__pad. 33206 * sigevent.h: New file. 33207 * Makefile.am (strace_SOURCES): Add it. 33208 * print_sigevent.c: Include it. 33209 * print_sigevent.c (struct_sigevent): Remove. 33210 (print_sigevent): Update all struct_sigevent users. 33211 * tests/timer_create.c: Include "sigevent.h". 33212 (main): Use struct_sigevent instead of struct sigevent, 33213 all struct sigevent clients changed. 33214 33215 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33216 33217 syscall.c: include <signal.h> 33218 All users of NSIG macro must include <signal.h>. 33219 This complements commit v4.10-184-g0e946ab. 33220 33221 * syscall.c: Include <signal.h>. 33222 33223 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33224 33225 signal.c: fix musl libc compilation warning. 33226 musl libc defines SIGRTMAX to a function that returns signed int, 33227 which obviously makes gcc -Wsign-compare unhappy. 33228 33229 * signal.c (signame): Cast ASM_SIGRTMAX to unsigned int. 33230 33231 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33232 33233 tests: fix TEST_SYSCALL_{NR,STR} and STRUCT_STAT_STR macros for musl. 33234 The contents of TEST_SYSCALL_NAME and STRUCT_STAT macros was subject 33235 to macro expansion when used in definitions of TEST_SYSCALL_NR, 33236 TEST_SYSCALL_STR, and STRUCT_STAT_STR macros. 33237 33238 As some libcs, e.g. musl libc, define lfs64 names as macros 33239 (stat64 as stat, lstat64 as lstat, etc.), this might result to incorrect 33240 expansion of TEST_SYSCALL_NR, TEST_SYSCALL_STR, and STRUCT_STAT_STR 33241 macros. To avoid this problem, define these macros directly and remove 33242 TEST_SYSCALL_NAME macro. 33243 33244 * tests/_newselect.c (TEST_SYSCALL_NAME): Remove. 33245 (TEST_SYSCALL_NR, TEST_SYSCALL_STR): New macros. 33246 * tests/fcntl.c: Likewise. 33247 * tests/fcntl64.c: Likewise. 33248 * tests/fstat.c: Likewise. 33249 * tests/fstatat64.c: Likewise. 33250 * tests/lstat.c: Likewise. 33251 * tests/newfstatat.c: Likewise. 33252 * tests/select.c: Likewise. 33253 * tests/stat.c: Likewise. 33254 * tests/fstat64.c (TEST_SYSCALL_NAME): Remove. 33255 (TEST_SYSCALL_NR, TEST_SYSCALL_STR, STRUCT_STAT_STR): New macros. 33256 * tests/lstat64.c: Likewise. 33257 * tests/stat64.c: Likewise. 33258 * tests/fstatx.c (TEST_SYSCALL_NR, nrify, nrify_): Remove. 33259 * tests/lstatx.c: Likewise. 33260 * tests/struct_flock.c (TEST_SYSCALL_NR, TEST_SYSCALL_STR, nrify, 33261 nrify_, stringify, stringify_): Remove. 33262 * tests/xselect.c: Likewise. 33263 * tests/xstatx.c: Check TEST_SYSCALL_STR instead of TEST_SYSCALL_NAME. 33264 (STRUCT_STAT_STR, TEST_SYSCALL_STR, stringify, stringify_): Remove. 33265 [!STRUCT_STAT] (STRUCT_STAT_STR): New macro. 33266 33267 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33268 33269 tests/struct_flock.c: fix musl libc compilation warnings. 33270 The size of off_t is not something one can rely upon. For example, 33271 musl libc unconditionally defines it as an int64_t type on x86. 33272 A cast to the target type helps to avoid these libc differences. 33273 33274 * configure.ac: Call AC_C_TYPEOF. 33275 * tests/struct_flock.c (TYPEOF_FLOCK_OFF_T): New macro. 33276 (test_flock_einval): Use it instead of off_t. 33277 33278 2016-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 33279 33280 tests/inet-cmsg.c: fix musl libc compilation warnings. 33281 The types that are used to define msg_namelen member of struct msghdr 33282 and cmsg_len member of struct cmsghdr differ between libcs. 33283 For example, glibc defines them as size_t, while musl libc - as type 33284 socklen_t. Print these fields using %lu format to avoid issues caused 33285 by libc differences. 33286 33287 * tests/inet-cmsg.c (main): Cast mh.msg_controllen and c->cmsg_len 33288 to unsigned long and print them using %lu format. 33289 33290 2016-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 33291 33292 aio.test: include <fcntl.h> instead of <sys/fcntl.h> 33293 * tests/aio.c: Include <fcntl.h> instead of <sys/fcntl.h>. 33294 33295 mmsg.test: check memory access by sendmmsg and recvmmsg decoders. 33296 * tests/tests.h (tail_memdup): New prototype. 33297 * tests/tail_alloc.c (tail_memdup): New function. 33298 * tests/mmsg.c (main): Place all objects passed to sendmmsg and recvmmsg 33299 at the end of memory pages followed by inaccessible pages. 33300 33301 mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg. 33302 * tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg. 33303 Pass MSG_DONTWAIT to recvmmsg. 33304 * tests/mmsg.expected: Update. 33305 33306 2016-01-11 Dmitry V. Levin <ldv (a] altlinux.org> 33307 33308 mmsg.test: prefer direct sendmmsg/recvmmsg syscalls to libc wrappers. 33309 * tests/mmsg.c: Include <sys/syscall.h>. 33310 Check for __NR_sendmmsg as an alternative to HAVE_SENDMMSG. 33311 [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. 33312 (send_mmsg, recv_mmsg): New functions. 33313 (main): Use them instead of sendmmsg and recvmmsg. 33314 33315 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 33316 33317 2016-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 33318 33319 sigreturn.test: use RT_5 signal number instead of RT_2. 33320 Make the test compatible with musl libc that uses RT_2 internally. 33321 33322 * tests/sigreturn.c (main): Replace RT_2 with RT_5. 33323 * tests/sigreturn.test: Likewise. 33324 33325 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 33326 33327 2016-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 33328 33329 avr32: wire up accept4 syscall. 33330 * linux/avr32/syscallent.h [321]: Add accept4 entry. 33331 33332 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 33333 33334 sparc64: fix names of {s,g}etres{u,g}id syscalls. 33335 * linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names. 33336 33337 sparc64: remove sparc32 syscall entries. 33338 * linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77, 33339 82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign. 33340 33341 sparc: remove sparc64 syscall entries. 33342 * linux/sparc/syscallent.h [52, 163]: Unassign. 33343 33344 sparc64: clone syscallent.h from sparc. 33345 * linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h. 33346 33347 sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls 33348 * linux/sparc/syscallent.h [353]: Move mlock2 entry to 356. 33349 [353, 354, 355]: Add bind, listen, and setsockopt entries. 33350 * NEWS: Mention this. 33351 33352 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 33353 33354 tests: do not use settimeofday wrapper provided by libc. 33355 Workaround limitations of settimeofday wrapper provided by musl libc. 33356 33357 * tests/xettimeofday.c (main): Call settimeofday using syscall(). 33358 33359 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 33360 33361 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 33362 33363 ioctl.test: robustify against libcs invoking ioctl syscall on their own. 33364 * tests/ioctl.test: Filter out from the log ioctl calls with standard 33365 descriptor arguments. 33366 33367 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 33368 33369 2016-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 33370 33371 alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls. 33372 Print the second return value of getxpid, getxuid, and getxgid syscalls 33373 that return a pair of values using the same mechanism as pipe syscall. 33374 33375 * alpha.c: New file. 33376 * Makefile.am (strace_SOURCES): Add it. 33377 * linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid). 33378 [24]: Change SEN(getuid) to SEN(getxuid). 33379 [47]: Change SEN(getgid) to SEN(getxgid). 33380 * NEWS: Mention this enhancement. 33381 * tests/uid.awk: Update for getxgid output change. 33382 * tests/uid.test: Cleanup. 33383 * tests/getxxid.c: New file. 33384 * tests/getxxid.test: New test. 33385 * tests/Makefile.am (check_PROGRAMS): Add getxxid. 33386 (TESTS): Add getxxid.test. 33387 * tests/.gitignore: Add getxxid. 33388 33389 2016-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 33390 33391 Cleanup parser of getpagesize syscall. 33392 * mem.c (SYS_FUNC(getpagesize)): Decode on entering syscall. 33393 33394 alpha: alias getdtablesize to printargs. 33395 * linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs. 33396 * desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove. 33397 33398 2016-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 33399 33400 tests: change text marker in fork-f and vfork-f tests. 33401 Use chdir syscalls instead of pwrite64 syscalls as a method of inserting 33402 text markers into strace output because the former are more portable. 33403 33404 * tests/fork-f.c (logit): Rename to logit_. Use chdir instead of pwrite. 33405 (logit): New macro wrapper around logit_. 33406 (main): Update expected output. 33407 * tests/vfork-f.c: Likewise. 33408 * tests/fork-f.test: Update. 33409 33410 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 33411 33412 Fix printing of 32-bit times syscall return value on 64-bit architectures 33413 This change complements commit v4.9-359-gd93d9f8 by fixing 33414 RVAL_UDECIMAL case. 33415 The only syscall that appears to be affected is the times syscall. 33416 33417 * syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL, 33418 when current personality is 32-bit, print 32-bit return code. 33419 * NEWS: Mention this fix. 33420 33421 Reported-by: Steve McIntyre <steve (a] einval.com> 33422 33423 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 33424 33425 tests/vfork-f.c: support platforms without vfork. 33426 On some platforms, e.g. hppa glibc, vfork() is implemented using fork 33427 syscall, so the test cannot rely on the parent process remaining blocked 33428 until the child process either terminates or calls execve. 33429 33430 * tests/vfork-f.c (main): Explicitly block the parent until the child 33431 either terminates or calls execve. 33432 33433 2016-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 33434 33435 Fix and enhance decoding of sched_[gs]etaffinity syscalls. 33436 Print cpu_set_t as a set of integers, similar to the way 33437 fd_set is printed as a set of descriptors. 33438 33439 * affinity.c: Include <sched.h>. 33440 (get_cpuset_size): New function. 33441 (print_affinitylist): Rewrite using get_cpuset_size and next_set_bit. 33442 (sched_getaffinity, sched_setaffinity): Print first two args as ints. 33443 * NEWS: Mention this enhancement. 33444 * tests/sched_xetaffinity.c: New file. 33445 * tests/sched_xetaffinity.test: New test. 33446 * tests/Makefile.am (check_PROGRAMS): Add sched_xetaffinity. 33447 (TESTS): Add sched_xetaffinity.test. 33448 * tests/.gitignore: Add sched_xetaffinity. 33449 33450 Reported-by: Joe Korty <joe.korty (a] ccur.com> 33451 33452 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 33453 33454 tests: convert epoll_create1.test from match_grep to match_diff. 33455 * tests/epoll_create1.c (main): Print expected output. 33456 * tests/epoll_create1.test: Use match_diff instead of match_grep. 33457 * tests/epoll_create1.expected: Remove. 33458 * tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected. 33459 33460 tests/struct_flock.c: use libtests. 33461 * tests/struct_flock.c (create_sample): Return void, 33462 all callers changed. Use perror_msg_and_fail. 33463 * tests/fcntl.c: Use SKIP_MAIN_UNDEFINED. 33464 * tests/fcntl64.c: Likewise. 33465 33466 tests/file_handle.c: use libtests. 33467 * tests/file_handle.c: Use SKIP_MAIN_UNDEFINED. 33468 (main): Use assert and perror_msg_and_skip. 33469 33470 tests/uid32.c: use libtests. 33471 * tests/uid32.c: Use SKIP_MAIN_UNDEFINED. 33472 33473 tests/uid16.c: use libtests. 33474 * tests/uid16.c: Use SKIP_MAIN_UNDEFINED. 33475 (main): Use perror_msg_and_skip. 33476 33477 tests/uid.c: use libtests. 33478 * tests/uid.c: Use SKIP_MAIN_UNDEFINED. 33479 (main): Use perror_msg_and_skip. 33480 33481 tests/netlink_unix_diag.c: use libtests. 33482 * tests/netlink_unix_diag.c (send_query, check_responses, main): 33483 Use perror_msg_and_skip. 33484 33485 tests/netlink_inet_diag.c: use libtests. 33486 * tests/netlink_inet_diag.c (send_query, check_responses, main): 33487 Use perror_msg_and_skip. 33488 33489 tests/readdir.c: use libtests. 33490 * tests/readdir.c: Use SKIP_MAIN_UNDEFINED. 33491 (main): Use perror_msg_and_skip. 33492 33493 tests/getdents64.c: use libtests. 33494 * tests/getdents64.c: Use SKIP_MAIN_UNDEFINED. 33495 (main): Use perror_msg_and_skip. 33496 33497 tests/getdents.c: use libtests. 33498 * tests/getdents.c: Use SKIP_MAIN_UNDEFINED. 33499 (main): Use perror_msg_and_skip. 33500 33501 tests/ipc_shm.c: use libtests. 33502 * tests/ipc_shm.c (cleanup): New function. 33503 (main): Use it and perror_msg_and_skip. 33504 33505 tests/ipc_sem.c: use libtests. 33506 * tests/ipc_sem.c (cleanup): New function. 33507 (main): Use it and perror_msg_and_skip. 33508 33509 tests/ipc_msg.c: use libtests. 33510 * tests/ipc_msg.c (cleanup): New function. 33511 (main): Use it and perror_msg_and_skip. 33512 33513 tests/ipc_msgbuf.c: use libtests. 33514 * tests/ipc_msgbuf.c (cleanup): New function. 33515 (main): Use it and perror_msg_and_skip. 33516 33517 tests/mq.c: use libtests. 33518 * tests/mq.c: Use SKIP_MAIN_UNDEFINED. 33519 (main): Use perror_msg_and_skip. 33520 33521 tests/utimensat.c: use libtests. 33522 * tests/utimensat.c: Use SKIP_MAIN_UNDEFINED. 33523 (main): Use assert and perror_msg_and_skip. 33524 33525 tests/ppoll.c: use libtests. 33526 * tests/ppoll.c (main): Use assert, perror_msg_and_skip, 33527 and perror_msg_and_fail. 33528 33529 tests/mmsg.c: use libtests. 33530 * tests/mmsg.c: Use SKIP_MAIN_UNDEFINED. 33531 (main): Use perror_msg_and_skip. 33532 33533 tests/ip_mreq.c: use libtests. 33534 * tests/ip_mreq.c: Use SKIP_MAIN_UNDEFINED. 33535 (main): Use perror_msg_and_skip. 33536 33537 tests/ioctl.c: use libtests. 33538 * tests/ioctl.c: Use SKIP_MAIN_UNDEFINED. 33539 (main): Use %m printf format specifier. 33540 33541 tests/pipe.c: use libtests. 33542 * tests/pipe.c: Use SKIP_MAIN_UNDEFINED. 33543 (main): Use perror_msg_and_fail and perror_msg_and_skip. 33544 33545 tests/getrandom.c: use libtests. 33546 * tests/getrandom.c: Use SKIP_MAIN_UNDEFINED. 33547 (main): Use perror_msg_and_skip. 33548 33549 tests/signalfd.c: use libtests. 33550 * tests/signalfd.c: Use SKIP_MAIN_UNDEFINED. 33551 (main): Use perror_msg_and_skip. 33552 33553 tests/pc.c: use libtests. 33554 * tests/pc.c (main): Use assert, get_page_size, perror_msg_and_fail, 33555 and perror_msg_and_skip. 33556 33557 tests/uio.c: use libtests. 33558 * tests/uio.c: Use SKIP_MAIN_UNDEFINED. 33559 33560 tests/bpf.c: use libtests. 33561 * tests/bpf.c: Use SKIP_MAIN_UNDEFINED. 33562 (main) Use perror_msg_and_skip. 33563 33564 tests/aio.c: use libtests. 33565 * tests/aio.c: Use SKIP_MAIN_UNDEFINED. 33566 (main) Use perror_msg_and_skip. 33567 33568 tests/sched_xetattr.c: use libtests. 33569 * tests/sched_xetattr.c: Use SKIP_MAIN_UNDEFINED. 33570 (main) Use perror_msg_and_skip. 33571 33572 tests/wait.c: use libtests. 33573 * tests/wait.c (main): Use perror_msg_and_fail. 33574 33575 tests/vfork-f.c: use libtests. 33576 * tests/vfork-f.c (main): Use assert and perror_msg_and_fail. 33577 33578 tests/fork-f.c: use libtests. 33579 * tests/fork-f.c (main): Use assert and perror_msg_and_fail. 33580 33581 tests/userfaultfd.c: use libtests. 33582 * tests/userfaultfd.c: Use SKIP_MAIN_UNDEFINED. 33583 (main): Use assert. 33584 33585 tests/mlock2.c: use libtests. 33586 * tests/mlock2.c: Use SKIP_MAIN_UNDEFINED. 33587 (main): Use assert. 33588 33589 tests/membarrier.c: use libtests. 33590 * tests/membarrier.c: Use SKIP_MAIN_UNDEFINED. 33591 (main): Use assert. 33592 33593 tests/nanosleep.c: use libtests. 33594 * tests/nanosleep.c (main): Use assert, perror_msg_and_fail, 33595 and perror_msg_and_skip. 33596 33597 tests/timerfd_xettime.c: use libtests. 33598 * tests/timerfd_xettime.c: Use SKIP_MAIN_UNDEFINED. 33599 (main): Use perror_msg_and_skip. 33600 33601 tests/timer_xettime.c: use libtests. 33602 * tests/timer_xettime.c: Use SKIP_MAIN_UNDEFINED. 33603 (main): Use perror_msg_and_skip. 33604 33605 tests/timer_create.c: use libtests. 33606 * tests/timer_create.c: Use SKIP_MAIN_UNDEFINED. 33607 (main): Use perror_msg_and_skip. 33608 33609 tests/clock_xettime.c: use libtests. 33610 * tests/clock_xettime.c: Use SKIP_MAIN_UNDEFINED. 33611 (main): Use perror_msg_and_skip. 33612 33613 tests/clock_nanosleep.c: use libtests. 33614 * tests/clock_nanosleep.c (main): Use assert and perror_msg_and_skip. 33615 33616 tests/truncate64.c: use libtests. 33617 * tests/truncate64.c: Use SKIP_MAIN_UNDEFINED. 33618 (main): Use assert and perror_msg_and_skip. 33619 33620 tests/truncate.c: use libtests. 33621 * tests/truncate.c: Use SKIP_MAIN_UNDEFINED. 33622 (main): Use assert and perror_msg_and_skip. 33623 33624 tests/ftruncate64.c: use libtests. 33625 * tests/ftruncate64.c: Use SKIP_MAIN_UNDEFINED. 33626 (main): Use assert and perror_msg_and_skip. 33627 33628 tests/ftruncate.c: use libtests. 33629 * tests/ftruncate.c: Use SKIP_MAIN_UNDEFINED. 33630 (main): Use assert and perror_msg_and_skip. 33631 33632 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33633 33634 tests/llseek.c: use libtests. 33635 * tests/llseek.c: Use SKIP_MAIN_UNDEFINED. 33636 (main): Use assert and perror_msg_and_skip. 33637 33638 tests/lseek.c: use libtests. 33639 * tests/lseek.c: Use SKIP_MAIN_UNDEFINED. 33640 (main): Use assert and perror_msg_and_skip. 33641 33642 tests/readlinkat.c: use libtests. 33643 * tests/readlinkat.c: Use SKIP_MAIN_UNDEFINED. 33644 (main): Use perror_msg_and_skip. 33645 33646 tests/readlink.c: use libtests. 33647 * tests/readlink.c: Use SKIP_MAIN_UNDEFINED. 33648 (main): Use perror_msg_and_skip. 33649 33650 tests/xattr.c: use libtests. 33651 * tests/xattr.c: Use SKIP_MAIN_UNDEFINED. 33652 (main): Use perror_msg_and_skip. 33653 33654 tests/seccomp.c: use libtests. 33655 * tests/seccomp.c: Use SKIP_MAIN_UNDEFINED. 33656 (main): Use perror_msg_and_fail and perror_msg_and_skip. 33657 33658 tests/restart_syscall.c: use libtests. 33659 * tests/restart_syscall.c (main): Use assert, perror_msg_and_fail, 33660 and perror_msg_and_skip. 33661 33662 tests/inet-cmsg.c: use libtests. 33663 * tests/inet-cmsg.c (main): Use perror_msg_and_skip. 33664 33665 tests/eventfd.c: use libtests. 33666 * tests/eventfd.c: Use SKIP_MAIN_UNDEFINED. 33667 (main): Use perror_msg_and_skip. 33668 33669 tests/epoll_create1.c: use libtests. 33670 * tests/epoll_create1.c: Use SKIP_MAIN_UNDEFINED. 33671 (main): Use assert and perror_msg_and_skip. 33672 33673 tests/mmap.c: use libtests. 33674 * tests/mmap.c (main): Use get_page_size and perror_msg_and_fail. 33675 33676 tests/fanotify_mark.c: use libtests. 33677 * tests/fanotify_mark.c: Use SKIP_MAIN_UNDEFINED. 33678 33679 tests/inet-accept-connect-send-recv.c: use libtests. 33680 * tests/inet-accept-connect-send-recv.c (main): Use perror_msg_and_skip 33681 and perror_msg_and_fail. 33682 33683 tests/net-accept-connect.c: use libtests. 33684 * tests/net-accept-connect.c (main): Use perror_msg_and_skip 33685 and perror_msg_and_fail. 33686 33687 tests/unix-pair-send-recv.c: use libtests. 33688 * tests/unix-pair-send-recv.c (main): Use perror_msg_and_skip 33689 and perror_msg_and_fail. 33690 33691 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 33692 33693 tests/xselect.c: use libtests. 33694 * tests/xselect.c (main): Use assert, perror_msg_and_fail, 33695 and perror_msg_and_skip. 33696 33697 tests/pselect6.c: use libtests. 33698 * tests/pselect6.c: Use SKIP_MAIN_UNDEFINED. 33699 (main): Use assert, perror_msg_and_fail, and perror_msg_and_skip. 33700 33701 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33702 33703 tests/oldselect.c: use libtests. 33704 * tests/oldselect.c: Use SKIP_MAIN_UNDEFINED. 33705 (main): Use perror_msg_and_fail and perror_msg_and_skip. 33706 33707 tests/select.c: use libtests. 33708 * tests/select.c: Use SKIP_MAIN_UNDEFINED. 33709 33710 tests/_newselect.c: use libtests. 33711 * tests/_newselect.c: Use SKIP_MAIN_UNDEFINED. 33712 33713 tests/fstatat.c: use libtests. 33714 * tests/fstatat.c: Use SKIP_MAIN_UNDEFINED. 33715 33716 tests/newfstatat.c: use libtests. 33717 * tests/newfstatat.c: Use SKIP_MAIN_UNDEFINED. 33718 33719 tests/fstatat64.c: use libtests. 33720 * tests/fstatat64.c: Use SKIP_MAIN_UNDEFINED. 33721 33722 tests/xstatx.c: use libtests. 33723 * tests/xstatx.c: Use SKIP_MAIN_UNDEFINED. 33724 33725 tests/stat64.c: use libtests. 33726 * tests/stat64.c: Use SKIP_MAIN_UNDEFINED. 33727 33728 tests/stat.c: use libtests. 33729 * tests/stat.c: Use SKIP_MAIN_UNDEFINED. 33730 33731 tests/lstat64.c: use libtests. 33732 * tests/lstat64.c: Use SKIP_MAIN_UNDEFINED. 33733 33734 tests/lstat.c: use libtests. 33735 * tests/lstat.c: Use SKIP_MAIN_UNDEFINED. 33736 33737 tests/fstat64.c: use libtests. 33738 * tests/fstat64.c: Use SKIP_MAIN_UNDEFINED. 33739 33740 tests/fstat.c: use libtests. 33741 * tests/fstat.c: Use SKIP_MAIN_UNDEFINED. 33742 33743 tests/statfs.c: use libtests. 33744 * tests/statfs.c (main): Use perror_msg_and_fail. 33745 33746 2016-01-06 Dmitry V. Levin <ldv (a] altlinux.org> 33747 33748 tests/xettimeofday.c: use libtests. 33749 * tests/xettimeofday.c (main): Use assert and perror_msg_and_skip. 33750 33751 tests/utime.c: use libtests. 33752 * tests/utime.c (main): Use assert and perror_msg_and_skip. 33753 33754 tests/filter-unavailable.c: use libtests. 33755 * tests/filter-unavailable.c (main): Use perror_msg_and_fail. 33756 33757 tests/scm_rights.c: use libtests. 33758 * tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip. 33759 33760 tests/caps.c: use libtests. 33761 * tests/caps.c (main): Use perror_msg_and_skip. 33762 33763 tests/rt_sigqueueinfo.c: use libtests. 33764 * tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip. 33765 33766 tests/umount.c: use libtests. 33767 * tests/umount.c: Use SKIP_MAIN_UNDEFINED. 33768 (main): Use perror_msg_and_fail. 33769 33770 tests/umount2.c: use libtests. 33771 * tests/umount2.c (main): Use perror_msg_and_fail. 33772 33773 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33774 33775 tests/times.c: use libtests. 33776 * tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip. 33777 33778 2016-01-04 Dmitry V. Levin <ldv (a] altlinux.org> 33779 33780 tests/times-fail.c: use assert. 33781 * tests/times-fail.c (main): Use assert. 33782 33783 tests/memfd_create.c: use libtests. 33784 * tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED. 33785 33786 tests/execveat.c: use libtests. 33787 * tests/execveat.c: Use SKIP_MAIN_UNDEFINED. 33788 33789 tests/xetitimer.c: use libtests. 33790 * tests/xetitimer.c (main): Use perror_msg_and_skip. 33791 33792 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33793 33794 tests/sysinfo.c: use libtests. 33795 * tests/sysinfo.c (main): Use perror_msg_and_skip. 33796 33797 tests/sigaltstack.c: use libtests. 33798 * tests/sigaltstack.c (main): Use perror_msg_and_skip. 33799 33800 tests/adjtimex.c: use libtests. 33801 * tests/adjtimex.c (main): Use perror_msg_and_skip. 33802 33803 tests/xet_robust_list.c: use libtests. 33804 * tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED. 33805 (main): Use perror_msg_and_skip and tail_alloc. 33806 33807 tests/umovestr2.c: use libtests. 33808 * tests/umovestr2.c (main): Use get_page_size and tail_alloc. 33809 33810 tests/umovestr.c: use libtests. 33811 * tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc. 33812 33813 tests/time.c: use libtests. 33814 * tests/time.c: Use SKIP_MAIN_UNDEFINED. 33815 (main): Use perror_msg_and_skip and tail_alloc. 33816 33817 tests/sendfile64.c: use libtests. 33818 * tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED. 33819 (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, 33820 and tail_alloc. 33821 33822 tests/sendfile.c: use libtests. 33823 * tests/sendfile.c: Use SKIP_MAIN_UNDEFINED. 33824 (main): Use assert, perror_msg_and_fail, perror_msg_and_skip, 33825 and tail_alloc. 33826 33827 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33828 33829 tests: include tests.h instead of config.h. 33830 Automatically edit tests/*.c files using the following perl one-liner: 33831 33832 perl -0777 -pi -e \ 33833 's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \ 33834 tests/*.c 33835 33836 2016-01-05 Dmitry V. Levin <ldv (a] altlinux.org> 33837 33838 tests: introduce libtests. 33839 Introduce tests/libtests.a with common functions for use in tests. 33840 33841 * tests/tests.h: New file. 33842 * tests/error_msg.c: Likewise. 33843 * tests/tail_alloc.c: Likewise. 33844 * tests/get_page_size.c: Likewise. 33845 * tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS, 33846 check_LIBRARIES, LDADD): New variables. 33847 (clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD, 33848 pc_LDADD, times_LDADD): Add $(LDADD). 33849 * tests/.gitignore: Add libtests.a. 33850 33851 2016-01-01 Dmitry V. Levin <ldv (a] altlinux.org> 33852 33853 tests: enable strace-k.test only for --with-libunwind configurations. 33854 Also, since -k option does not support multiple personalities, 33855 add strace-k.test to XFAIL_TESTS when running mpers tests. 33856 33857 * tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_, 33858 XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables. 33859 [USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test. 33860 (TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS). 33861 * bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am. 33862 * tests/strace-k.test: Do not check for -k option availability. 33863 33864 2016-01-02 Dmitry V. Levin <ldv (a] altlinux.org> 33865 33866 Move gcc compat macros to gcc_compat.h. 33867 * defs.h: Include "gcc_compat.h". 33868 (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, 33869 ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, 33870 ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ... 33871 * gcc_compat.h: ... here. 33872 * Makefile.am (strace_SOURCES): Add gcc_compat.h. 33873 33874 2015-12-31 Dmitry V. Levin <ldv (a] altlinux.org> 33875 33876 Move defs.h from noinst_HEADERS to strace_SOURCES. 33877 * Makefile.am (noinst_HEADERS): Move defs.h ... 33878 (strace_SOURCES): ... here. 33879 33880 2015-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 33881 33882 test: remove fork.c and vfork.c. 33883 These manual tests are obsoleted by fork-f.test and vfork-f.test. 33884 33885 * test/fork.c: Remove. 33886 * test/vfork.c: Remove. 33887 * test/Makefile (PROGS): Remove fork and vfork. 33888 * test/.gitignore: Remove fork and vfork. 33889 33890 2015-12-30 Dmitry V. Levin <ldv (a] altlinux.org> 33891 33892 tests: add fork-f.test and vfork-f.test. 33893 Check how strace -f follows fork and vfork syscalls. 33894 33895 * tests/fork-f.c: New file. 33896 * tests/fork-f.test: New test. 33897 * tests/vfork-f.c: New file. 33898 * tests/vfork-f.test: New test. 33899 * tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f. 33900 (TESTS): Add fork-f.test and vfork-f.test. 33901 * tests/.gitignore: Add fork-f and vfork-f. 33902 33903 2015-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 33904 33905 Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall. 33906 * linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag. 33907 33908 2015-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 33909 33910 Set SYSCALL_NEVER_FAILS flag for umask syscall. 33911 Linux kernel always ANDs umask argument with 0700 and therefore 33912 this syscall never fails. 33913 33914 * linux/*/syscallent*.h (umask): Set NF flag. 33915 33916 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 33917 33918 alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error 33919 On architectures that use dedicated registers to report syscall errors, 33920 check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag 33921 in the syscall entry. On architectures that use negated errno 33922 semantics, there is no way to distinguish a syscall error from a valid 33923 return code that looks like a syscall error, and the check for 33924 SYSCALL_NEVER_FAILS flag remains the only way to tell one case 33925 from another. 33926 33927 * linux/alpha/get_error.c (get_error): Ignore check_errno. 33928 * linux/ia64/get_error.c: Likewise. 33929 * linux/mips/get_error.c: Likewise. 33930 * linux/nios2/get_error.c: Likewise. 33931 * linux/powerpc/get_error.c: Likewise. 33932 * linux/sparc/get_error.c: Likewise. 33933 * linux/sparc64/get_error.c: Likewise. 33934 33935 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 33936 33937 Handle unlikely errors from personality syscall. 33938 Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still 33939 might report a failure on some architectures due to obscure kernel 33940 bugs. Check for this unlikely case and let users know that their 33941 kernel has gone bananas. 33942 33943 * personality.c (SYS_FUNC(personality)): Do not parse syscall return 33944 value in case of syserror. 33945 33946 2015-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 33947 33948 Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls. 33949 This should not be a user visible change unless the kernel does 33950 something completely unexpected. In the latter case, let user see 33951 what is going on. 33952 33953 * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate 33954 tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED. 33955 33956 2015-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 33957 33958 Enhance personality syscall decoding. 33959 * xlat/personality_options.in: Split into ... 33960 * xlat/personality_types.in: ... personality types and ... 33961 * xlat/personality_flags.in: ... personality flags. 33962 * personality.c: Include "xlat/personality_types.h" 33963 and "xlat/personality_flags.h" instead of "xlat/personality_options.h". 33964 (SYS_FUNC(personality)): Print PER_MASK part of personality as 33965 a symbolic value, and the rest of personality as a set of flags. 33966 * tests/personality.c (main): Add more test cases. 33967 * tests/personality.test: Update. 33968 33969 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 33970 33971 sh, sh64: fix syscall flags in several syscall entries. 33972 * linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32): 33973 Set SYSCALL_NEVER_FAILS flag. 33974 (fchown32): Set TRACE_DESC flag. 33975 * linux/sh64/syscallent.h: Likewise. 33976 33977 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 33978 33979 Print personality value 0xffffffff properly. 33980 Value 0xffffffff of personality syscall first argument has a special 33981 meaning, it is not a set of personality flags. 33982 33983 * personality.c (SYS_FUNC(personality)): If personality equals 33984 to 0xffffffff, print it verbatim. 33985 * tests/personality.c (main): Test it. 33986 33987 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 33988 33989 tests: add personality.test. 33990 * tests/personality.c: New file. 33991 * tests/personality.test: New test. 33992 * tests/Makefile.am (check_PROGRAMS): Add personality. 33993 (TESTS): Add personality.test. 33994 * tests/.gitignore: Add personality. 33995 33996 Enhance personality syscall decoding. 33997 * personality.c (SYS_FUNC(personality)): On entering syscall, 33998 print first argument not as a hex value but as a set of flags. 33999 On exiting syscall, print return code as a set of flags. 34000 * NEWS: Mention this enhancement. 34001 34002 2015-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 34003 34004 Set SYSCALL_NEVER_FAILS flag for personality syscall. 34005 Starting with commit 34006 v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality 34007 syscall never fails to set the personality, but before commit 34008 v2.6.35-rc1-372-g485d527 it still could return an error. 34009 Starting with that commit, personality syscall never returns an error. 34010 34011 * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality 34012 syscall entries. 34013 34014 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 34015 34016 Add personality emulation flags. 34017 * xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE, 34018 FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC, 34019 ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS, 34020 and ADDR_LIMIT_3GB. 34021 34022 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 34023 34024 arc, metag, nios2, or1k, tile: fix build. 34025 Fix build regression introduced by commit 34026 34683e3926d8c2daa368afb805da422ee7043396. 34027 34028 * linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap. 34029 * linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff. 34030 * linux/nios2/syscallent.h: Likewise. 34031 * linux/or1k/syscallent.h: Likewise. 34032 * linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff. 34033 * pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap. 34034 * NEWS: Mention this build fix. 34035 34036 Reported-by: Alexey Brodkin <Alexey.Brodkin (a] synopsys.com> 34037 34038 2015-12-24 Dmitry V. Levin <ldv (a] altlinux.org> 34039 34040 packages: remove acl development library from build dependencies. 34041 Starting with commit v4.9-46-g681452b that removed all references 34042 to acl.h, we no longer use acl development library. 34043 34044 * .travis.yml (addons.apt.packages): Remove libacl1-dev. 34045 * strace.spec (BuildRequires): Remove libacl-devel. 34046 34047 2015-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 34048 34049 packages/x86_64: enable experimental -k option. 34050 * debian/control (Build-Depends) [amd64]: Add libunwind-dev. 34051 * strace.spec (BuildRequires) [x86_64]: Add libunwind-devel. 34052 34053 maint: post-release administrivia. 34054 * NEWS: Add header line for the next release. 34055 34056 2015-12-21 Dmitry V. Levin <ldv (a] altlinux.org> 34057 34058 Prepare for 4.11 release. 34059 * NEWS: Update for 4.11 release. 34060 * debian/changelog: 4.11-1. 34061 * strace.spec: 4.11-1. 34062 34063 2015-12-20 Dmitry V. Levin <ldv (a] altlinux.org> 34064 34065 Sync strace.spec and debian/ with packages. 34066 * debian/changelog: Sync with 4.10-3. 34067 * debian/control: Likewise. 34068 * debian/rules: Likewise. 34069 * strace.spec: Sync with 4.10-3. 34070 34071 .mailmap: add addresses of Kirill A. Shutemov. 34072 * .mailmap: Add both addresses of Kirill A. Shutemov here 34073 to avoid duplications in CREDITS file. 34074 34075 2015-12-19 Dmitry V. Levin <ldv (a] altlinux.org> 34076 34077 NEWS: Prepare for 4.11 release. 34078 34079 2015-12-18 Dmitry V. Levin <ldv (a] altlinux.org> 34080 34081 ia64: wire up mlock2 syscall. 34082 * linux/ia64/syscallent.h [1346]: Add mlock2 entry. 34083 34084 2015-12-17 Dmitry V. Levin <ldv (a] altlinux.org> 34085 34086 Add copyright headers to some files which lack them. 34087 Before this change, all files that exist since 20th century had 34088 copyright headers, while most files that appeared later didn't. This 34089 change fixes the inconsistency by adding missing copyright headers. 34090 34091 It doesn't mean that copyright headers became maintained. In my view, 34092 git history provides much better information on this subject and is much 34093 more accurate than copyright headers. 34094 34095 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 34096 34097 tests/aio.c: include <time.h> 34098 * tests/aio.c: Include <time.h> for struct timespec. 34099 34100 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 34101 34102 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 34103 34104 mpers.sh: switch to DWARF version 2 format for better portability. 34105 * mpers.sh (CFLAGS): Replace -gdwarf-4 with -gdwarf-2. 34106 34107 mpers.awk: add support for DWARF version 2 format. 34108 * mpers.awk: Handle DW_AT_data_member_location in DWARF v2 format. 34109 34110 2015-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 34111 34112 Replace %Ld/%Lu printf format specifiers with %lld/%llu. 34113 As %Ld and %Lu printf format specifiers are not quite portable, 34114 replace them with %lld and %llu, respectively. 34115 34116 * desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu. 34117 * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise. 34118 * times.c (SYS_FUNC(times)): Likewise. 34119 * fcntl.c (print_struct_flock64): Replace %Ld with %lld. 34120 * tests/ftruncate.c (main): Replace %Lu with %llu. 34121 * tests/ftruncate64.c (main): Likewise. 34122 * tests/getdents.c (print_dirent): Likewise. 34123 * tests/llseek.c (main): Likewise. 34124 * tests/lseek.c (main): Likewise. 34125 * tests/truncate.c (main): Likewise. 34126 * tests/truncate64.c (main): Likewise. 34127 * tests/xstatx.c (main): Likewise. 34128 * tests/pselect6.c (main): Replace %Ld with %lld. 34129 * tests/xselect.c(main): Likewise. 34130 34131 Reported-by: Szabolcs Nagy <nsz (a] port70.net> 34132 34133 2015-12-16 Szabolcs Nagy <nsz (a] port70.net> 34134 34135 Fix SYS_FUNC and SEN macros for musl. 34136 The syscall_name argument was subject to macro expansion because 34137 it was passed down to other macros before it was prefixed. 34138 34139 musl libc defines lfs64 names as macros (e.g. fstat64 as fstat) 34140 so SYS_FUNC(fstat64) was expanded to sys_fstat. 34141 34142 This change adds the prefix before the name is passed to other macros, 34143 i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_. 34144 34145 * defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument. 34146 (SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument. 34147 * linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix 34148 to MPERS_FUNC_NAME's argument. 34149 * syscall.c (SEN_NAME): Remove. 34150 (SEN): Replace SEN_NAME call with its definition. Add sys_ prefix 34151 to SYS_FUNC_NAME's argument. 34152 34153 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 34154 34155 tests/times.test: workaround libc bug on x32. 34156 As glibc times wrapper on x32 is known to wrongly truncate and then sign 34157 extend the syscall return value, invoke the syscall directly on x32. 34158 34159 * tests/times.c (main) [__NR_times && __x86_64__ && __ILP32__]: 34160 Invoke times syscall using inline asm. 34161 34162 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 34163 34164 mpers.awk: make fillers added to the output structure more predictable. 34165 * mpers.awk (array_seq): New function. 34166 (what_is): Use it for printing filler names. Tweak return types. 34167 * mpers_test.sh: Use a more complicated sample type to test mpers 34168 machinery. 34169 34170 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 34171 34172 Robustify mpers.awk against input containing index loops. 34173 Make mpers.awk check for potential index loops. Such loops should not 34174 normally happen, but mpers.awk will not go into infinite recursion if 34175 they do. 34176 34177 * mpers.awk (enter, leave): New functions. 34178 (what_is): Use them. 34179 34180 2015-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 34181 34182 Robustify mpers.awk against invalid input. 34183 Make mpers.awk check that accessed elements of the main array that 34184 are expected to have non-empty values really meet this requirement. 34185 34186 * mpers.awk (array_get): New function. 34187 (what_is, END): Use it. 34188 * mpers_test.sh: Use a more complicated type to test mpers machinery. 34189 34190 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 34191 34192 2015-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 34193 34194 Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN. 34195 * defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG. 34196 * configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove. 34197 * m4/long_long.m4: Remove. 34198 34199 2015-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 34200 34201 Remove unused parser of xmknod syscall. 34202 The last reference to this parser was removed by commit 34203 v4.10-45-gdf4dd8b. 34204 34205 * mknod.c [SPARC || SPARC64] (SYS_FUNC(xmknod)): Remove. 34206 34207 2015-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 34208 34209 tests/restart_syscall: add a workaround for old arm kernels. 34210 As arm kernels used to overwrite ARM_r0 with -EINTR after 34211 ERESTART_RESTARTBLOCK, update regexp to workaround this. 34212 34213 * tests/restart_syscall.c (main) [__arm__]: Add 0xfffffffc as a valid 34214 alternative value for the first argument of restarted nanosleep syscall. 34215 34216 2015-12-12 Dmitry V. Levin <ldv (a] altlinux.org> 34217 34218 tests/.gitignore: add ksysent.h. 34219 tests/ksysent.h is a generated file listed in CLEANFILES. 34220 This change complements commit v4.10-566-gbab4ef4. 34221 34222 * tests/.gitignore: Add ksysent.h. 34223 34224 2015-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 34225 34226 aarch64: make arm registers unsigned. 34227 Follow the x86_64 example and define registers in arm_pt_regs 34228 as unsigned, to avoid potential sign extension bugs. 34229 34230 This also fixes --enable-gcc-Werror build. 34231 34232 * linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type 34233 from int to uint32_t. 34234 34235 Reported-by: Sergey Bolshakov <sbolshakov (a] altlinux.org> 34236 34237 2015-12-10 Dmitry V. Levin <ldv (a] altlinux.org> 34238 34239 tests: add ksysent.test. 34240 Check that syscall names and numbers defined in syscallent files 34241 match kernel __NR_* constants defined by <asm/unistd.h>. 34242 34243 Tested on various platforms, including the following combinations 34244 of architectures and kernel headers: 34245 34246 x86_64: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.12, 3.11, 34247 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel 34248 i386: 4.4-rc, 4.3, 4.2, 4.1, 3.19, 3.17, 3.16, 3.11, 34249 3.10-rhel, 2.6.32-rhel, 2.6.27-sle, 2.6.18-rhel 34250 aarch64: 4.4-rc 34251 alpha: 4.3 34252 arm eabi: 4.4-rc, 4.2, 4.1 34253 hppa: 3.18 34254 ia64: 3.18 34255 mips o32: 4.1 34256 ppc: 3.18 34257 ppc64: 3.10-rhel, 2.6.32-rhel 34258 s390: 3.18 34259 s390x: 3.18 34260 sparc: 4.1 34261 sparc: 3.18 34262 x32: 3.19 34263 34264 The only platform which is known at this moment to fail the test 34265 is CentOS-5 provided by OBS. On x86_64 instance it fails with 34266 error: "prlimit64" syscall #300 is "fanotify_init" in syscallent.h 34267 and on i586 it similarly fails with 34268 error: "prlimit64" syscall #338 is "fanotify_init" in syscallent.h 34269 So this is a real platform bug that is not likely to be worked around 34270 on the strace side. 34271 34272 * tests/ksysent.c: New file. 34273 * tests/ksysent.sed: Likewise. 34274 * tests/ksysent.test: New test. 34275 * tests/Makefile.am (AM_CPPFLAGS): Add -I$(builddir). 34276 (check_PROGRAMS): Add ksysent. 34277 (TESTS): Add ksysent.test. 34278 (EXTRA_DIST): Add ksysent.sed. 34279 (ksysent.h): New rule. 34280 (BUILT_SOURCES, CLEANFILES): Add ksysent.h. 34281 * tests/.gitignore: Add ksysent. 34282 34283 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 34284 34285 Document that syscall names match kernel __NR_* constants. 34286 * strace.1: Note syscall naming difference between architectures 34287 and the rule of choosing the right syscall name in each case. 34288 34289 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 34290 34291 ia64: print all ia32 syscalls using printargs. 34292 Printing of ia32 syscalls on ia64 must have been broken for a long time. 34293 Do not pretend that it works, print ia32 syscalls using printargs 34294 instead. 34295 34296 * linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros. 34297 Stop including"../dummy.h". Include "../i386/syscallent.h" with 34298 SYS_FUNC_NAME macro temporarily redirected to printargs. 34299 34300 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 34301 34302 Fix build on architectures for which arch_sigreturn is not implemented. 34303 This complements commit 527b42ff8da3f52fa7c48eb766b2b57fb0f0b977. 34304 34305 * linux/arch_sigreturn.c (arch_sigreturn): Define. 34306 34307 2015-12-09 Dmitry V. Levin <ldv (a] altlinux.org> 34308 34309 aarch64: swap 64-bit and 32-bit personalities. 34310 Let native 64-bit personality be personality 0, and 32-bit personality 34311 be personality 1, to follow the traditional layout used for other 34312 architectures. 34313 34314 * defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and 34315 PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY. 34316 [AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*. 34317 * file.c [AARCH64 || defined X86_64 || defined X32]: Define 34318 STAT32_PERSONALITY for AARCH64 as well. 34319 * syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES. 34320 * linux/aarch64/errnoent1.h: Adjust comment. 34321 * linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check. 34322 * linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise. 34323 * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise. 34324 * linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality 34325 invocations. 34326 * linux/aarch64/ioctls_arch0.h: Swap with ... 34327 * linux/aarch64/ioctls_arch1.h: ... this file. 34328 * linux/aarch64/ioctls_inc0.h: Swap with ... 34329 * linux/aarch64/ioctls_inc1.h: ... this file. 34330 * linux/aarch64/syscallent.h: Swap with ... 34331 * linux/aarch64/syscallent1.h: ... this file. 34332 34333 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34334 34335 mips: fix fadvise64 syscall entries. 34336 * linux/mips/syscallent-n32.h [6216]: Change syscall handler 34337 from fadvise64 to fadvise64_64. 34338 * linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64" 34339 to "fadvise64" 34340 * linux/mips/syscallent-o32.h [4254]: Likewise. 34341 34342 xtensa: wire up syncfs syscall. 34343 * linux/xtensa/syscallent.h [179]: Add syncfs entry. 34344 34345 sh, sh64: fix syscall entries. 34346 * linux/sh/syscallent.h [322]: Fix timerfd_create entry. 34347 * linux/sh64/syscallent.h [350]: Likewise. 34348 [0]: Fix restart_syscall entry. 34349 34350 powerpc, powerpc64: wire up mlock2 syscall. 34351 * linux/powerpc/syscallent.h [378]: Add mlock2 entry. 34352 * linux/powerpc64/syscallent.h: Likewise. 34353 34354 hppa: fix syscall entries. 34355 * linux/hppa/syscallent.h: Swap [343] and [344] entries. 34356 34357 avr32: update syscall entries. 34358 * linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall. 34359 [284 ... 320]: New entries. 34360 34361 m68k: fix syscall names. 34362 * linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32" 34363 to "atomic_cmpxchg_32". 34364 34365 sparc: update syscall names. 34366 * linux/sparc/syscallent.h [160]: Rename "sched_setaffinity" 34367 to "sched_set_affinity". 34368 [161]: Rename "sched_getaffinity" to "sched_get_affinity". 34369 34370 powerpc, powerpc64: update syscall names. 34371 * linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer". 34372 [225]: Rename "tux" to "tuxcall". 34373 [256]: Rename "debug_setcontext" to "sys_debug_setcontext". 34374 * linux/powerpc64/syscallent.h: Likewise. 34375 34376 alpha: update syscall entries. 34377 * linux/alpha/syscallent.h [224 ... 228]: Add stub entries. 34378 [100]: Rename "osf_getpriority" to "getpriority". 34379 [255]: Rename "osf_subsysinfo" to "osf_subsys_info". 34380 [303]: Rename "adjtimex32" to "old_adjtimex". 34381 [319]: Rename "sysctl" to "_sysctl". 34382 [320]: Remove. 34383 34384 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34385 34386 Fix mmap syscall entries. 34387 Change syscall names to match kernel __NR_* constants. 34388 34389 * linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2". 34390 * linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap". 34391 * linux/i386/syscallent.h: Likewise. 34392 * linux/m68k/syscallent.h: Likewise. 34393 * linux/microblaze/syscallent.h: Likewise. 34394 * linux/sh/syscallent.h: Likewise. 34395 * linux/sh64/syscallent.h: Likewise. 34396 * tests/mmap.c (main): Remove old_mmap from expected output. 34397 * tests/mmap.test: Remove old_mmap from the list of mmap syscalls. 34398 34399 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34400 34401 Fix select and _newselect syscall entries. 34402 Change syscall names to match kernel __NR_* constants. 34403 This reverts commit ddcf54969d253582ab2cfdcab8ede9cdae3fb171. 34404 34405 * linux/arm/syscallent.h [82]: Rename "oldselect" to "select". 34406 [142]: Rename "select" to "_newselect". 34407 * linux/bfin/syscallent.h: Likewise. 34408 * linux/i386/syscallent.h: Likewise. 34409 * linux/m68k/syscallent.h: Likewise. 34410 * linux/microblaze/syscallent.h: Likewise. 34411 * linux/powerpc/syscallent.h [82]: Likewise. 34412 * linux/powerpc64/syscallent.h: Likewise. 34413 * linux/sh/syscallent.h: Likewise. 34414 * linux/sh64/syscallent.h: Likewise. 34415 * linux/hppa/syscallent.h [142]: Rename "select" to "_newselect". 34416 * linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect". 34417 * linux/mips/syscallent-n64.h [5022]: Likewise. 34418 * linux/mips/syscallent-o32.h [4142]: Likewise. 34419 * linux/s390/syscallent.h [142]: Rename "select" to "_newselect". 34420 * linux/sparc/syscallent.h [230]: Rename "select" to "_newselect". 34421 * tests/oldselect.test: Rename oldselect to select. Convert 34422 from match_grep to match_diff. 34423 * tests/oldselect.expected: Likewise. 34424 * xselect.c: New file, based on select.c. 34425 * tests/_newselect.c: New file. 34426 * tests/select.c: Replace with a wrapper around xselect.c. 34427 * tests/select.test: Parametrize. 34428 * tests/_newselect.test: New test. 34429 * tests/Makefile.am (check_PROGRAMS): Add _newselect. 34430 (TESTS): Add _newselect.test. 34431 (EXTRA_DIST): Add xselect.c. 34432 * tests/.gitignore: Add _newselect. 34433 34434 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34435 34436 Fix exit syscall entries. 34437 Change syscall names to match kernel __NR_* constants. 34438 34439 * linux/avr32/syscallent.h [1]: Rename "_exit" to "exit". 34440 * linux/bfin/syscallent.h: Likewise. 34441 * linux/i386/syscallent.h: Likewise. 34442 * linux/m68k/syscallent.h: Likewise. 34443 * linux/microblaze/syscallent.h: Likewise. 34444 * linux/sh/syscallent.h: Likewise. 34445 * linux/sh64/syscallent.h: Likewise. 34446 * linux/x32/syscallent.h [60]: Rename "_exit" to "exit". 34447 * linux/x86_64/syscallent.h: Likewise. 34448 34449 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34450 34451 Fix pread64 and pwrite64 syscall entries. 34452 Change syscall names to match kernel __NR_* constants. 34453 34454 * linux/alpha/syscallent.h [349]: Rename "pread" to "pread64". 34455 [350]: Rename "pwrite" to "pwrite64". 34456 * linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64". 34457 [1149]: Rename "pwrite" to "pwrite64". 34458 * linux/sh/syscallent.h [180]: Rename "pread" to "pread64". 34459 [181]: Rename "pwrite" to "pwrite64". 34460 * linux/sh64/syscallent.h: Likewise. 34461 * linux/x32/syscallent.h [17]: Rename "pread" to "pread64". 34462 [18]: Rename "pwrite" to "pwrite64". 34463 * linux/x86_64/syscallent.h: Likewise. 34464 34465 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34466 34467 tests: sort the list of tests. 34468 * tests/Makefile.am (TESTS): Sort the list of regular tests. 34469 * tests/.gitignore: Sort. 34470 34471 ia64: fix remap_file_pages syscall entry. 34472 * linux/ia64/syscallent.h (1125): Set to remap_file_pages. 34473 34474 bfin, i386: remove sysentry for nonexistent security syscall. 34475 * linux/bfin/syscallent.h (223): Remove. 34476 * linux/i386/syscallent.h: Likewise. 34477 34478 build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS. 34479 * tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS, 34480 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34481 (fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS, 34482 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34483 (ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS, 34484 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34485 (lstat64_CFLAGS): Rename to lstat64_CPPFLAGS, 34486 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34487 (mmap64_CFLAGS): Rename to mmap64_CPPFLAGS, 34488 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34489 (newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS, 34490 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34491 (stat64_CFLAGS): Rename to stat64_CPPFLAGS, 34492 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34493 (statfs_CFLAGS): Rename to statfs_CPPFLAGS, 34494 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34495 (truncate64_CFLAGS): Rename to truncate64_CPPFLAGS, 34496 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34497 (uio_CFLAGS): Rename to uio_CPPFLAGS, 34498 replace $(AM_CFLAGS) with $(AM_CPPFLAGS). 34499 34500 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34501 34502 Move x32 <asm/stat.h> replacement to x32 specific directory. 34503 As tests-m*32/Makefile.am files now refer to proper arch specific 34504 directories, it's possible to relocate x32 <asm/stat.h> replacement 34505 to its arch specific directory. 34506 34507 * linux/x86_64/asm_stat.h: Move ... 34508 * linux/x32/asm_stat.h: ... here, remove x32 guard. 34509 * Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h. 34510 34511 2015-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 34512 34513 build: set arch specific -m switches in tests-m*32/Makefile.am files properly 34514 * tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables. 34515 (AM_CPPFLAGS): Use ARCH_MFLAGS. 34516 * bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am, 34517 add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS. 34518 34519 build: initialize ARCH variable in tests-m*32/Makefile.am files properly 34520 * configure.ac (arch_m32): Set to sparc on sparc64, powerpc on 34521 powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases. 34522 (arch_mx32): Set to x32 on x86_64, $arch in other cases. 34523 (AC_SUBST): Add arch_m32 and arch_mx32. 34524 * bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am. 34525 Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am. 34526 34527 2015-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 34528 34529 tests: add umount.test and umount2.test. 34530 * tests/umount.c: New file. 34531 * tests/umount2.c: Likewise. 34532 * tests/umount.test: New test. 34533 * tests/umount2.test: Likewise. 34534 * tests/Makefile.am (check_PROGRAMS): Add umount and umount2. 34535 (TESTS): Add umount.test and umount2.test. 34536 * tests/.gitignore: Add umount and umount2. 34537 34538 avr32: fix umount2 syscall entry. 34539 * linux/avr32/syscallent.h: Rename umount to umount2. 34540 34541 Update umount2 flags. 34542 * umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ... 34543 * xlat/umount_flags.in: ... here. Add UMOUNT_NOFOLLOW. 34544 34545 2015-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 34546 34547 Print the first argument of umount2 syscall as a path. 34548 * umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr. 34549 34550 This fixes Debian bug #785050. 34551 34552 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 34553 34554 prctl: add PR_CAP_AMBIENT parser. 34555 * xlat/pr_cap_ambient.in: New file. 34556 * prctl.c: Include "xlat/pr_cap_ambient.h". 34557 (SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT. 34558 34559 prctl: finish decoding of several commands on entering syscall. 34560 * prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of 34561 PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, 34562 PR_GET_TIMING, and PR_CAPBSET_READ commands. 34563 34564 Fix build on systems that lack EM_FRV definition. 34565 * xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check. 34566 34567 times.test: workaround buggy libc. 34568 * tests/times.c: Include <sys/syscall.h>. 34569 (main): On systems where user's and kernel's long types are the same, 34570 prefer direct times syscall over libc's times function because 34571 the latter is more prone to return value truncation. 34572 34573 times.test: reduce cpu time consumption, increase struct tms diversity. 34574 * tests/times.c (main): Reduce cpu time consumption fourfold, 34575 make the parent process consume less cpu time than the child process 34576 so that members of the structure returned by times syscall would be 34577 more likely to contain different values. 34578 34579 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 34580 34581 mips n32, x32: fix printing of times syscall return value. 34582 As times syscall returns kernel's long value, it has to be printed as 34583 RVAL_LUDECIMAL on systems where long type is less than kernel's long. 34584 34585 * times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]: 34586 Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL. 34587 34588 2015-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 34589 34590 unix-yy.test: fix portability issue. 34591 * tests/unix-yy-connect.awk (r_close_listen): Quote square brackets 34592 that are not part of a bracket expression. 34593 34594 inet-cmsg.test: skip the test when the network is not functional. 34595 * tests/inet-cmsg.c (main): Return 77 if inet datagram socket 34596 cannot be bound to INADDR_LOOPBACK. 34597 34598 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 34599 34600 fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser 34601 As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands 34602 in fcntl64 syscall only, do not parse their structures in fcntl parser. 34603 34604 * xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ... 34605 * xlat/fcntl64cmds.in: ... here. 34606 * fcntl.c: Include "xlat/fcntl64cmds.h". 34607 (print_fcntl): Move printing of first two syscall arguments 34608 and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ... 34609 (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here. 34610 * tests/fcntl.c: New file, based on struct_flock.c. 34611 * tests/fcntl64.c: Likewise. 34612 * tests/struct_flock.c (test_flock_einval, create_sample): New functions. 34613 (test_flock): Use test_flock_einval. 34614 (test_flock64, main): Remove. 34615 * tests/fcntl.test: New test. 34616 * tests/fcntl64.test: Likewise. 34617 * tests/struct_flock.test: Remove. 34618 * tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64, 34619 remove struct_flock. 34620 (TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test. 34621 (EXTRA_DIST) Add struct_flock.c. 34622 * tests/.gitignore: Add fcntl and fcntl64, remove struct_flock. 34623 34624 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 34625 34626 print_fcntl: finish with unrecognized commands on entering syscall. 34627 * fcntl.c (print_fcntl): Merge two switch statements. 34628 34629 2015-12-04 Elvira Khabirova <lineprinter0 (a] gmail.com> 34630 34631 fcntl: create a separate parser for fcntl64 syscall. 34632 * fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl). 34633 (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it. 34634 * linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64). 34635 * linux/arm/syscallent.h: Likewise. 34636 * linux/avr32/syscallent.h: Likewise. 34637 * linux/bfin/syscallent.h: Likewise. 34638 * linux/hppa/syscallent.h: Likewise. 34639 * linux/i386/syscallent.h: Likewise. 34640 * linux/m68k/syscallent.h: Likewise. 34641 * linux/microblaze/syscallent.h: Likewise. 34642 * linux/mips/syscallent-n32.h: Likewise. 34643 * linux/mips/syscallent-o32.h: Likewise. 34644 * linux/powerpc/syscallent.h: Likewise. 34645 * linux/s390/syscallent.h: Likewise. 34646 * linux/sh/syscallent.h: Likewise. 34647 * linux/sh64/syscallent.h: Likewise. 34648 * linux/sparc/syscallent.h: Likewise. 34649 * linux/xtensa/syscallent.h: Likewise. 34650 34651 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 34652 34653 travis-ci: add build matrix. 34654 34655 tests: replace old stat tests with stat.test and stat64.test. 34656 * tests/stat.c: Replace with a wrapper around lstatx.c 34657 * tests/stat.test: Replace with a wrapper around statx.sh. 34658 * tests/stat32-v.test: Remove. 34659 * tests/stat32.c: Remove. 34660 * tests/stat64-v.test: Remove. 34661 * tests/stat64.c: New file. 34662 * tests/stat64.test: New test. 34663 * tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64. 34664 (stat_CFLAGS): Rename to stat64_CFLAGS. 34665 (TESTS): Replace stat32-v.test and stat64-v.test with stat64.test. 34666 * tests/.gitignore: Replace stat32 with stat64. 34667 34668 tests: add lstat.test and lstat64.test. 34669 * tests/lstat.c: New file. 34670 * tests/lstat64.c: Likewise. 34671 * tests/lstatx.c: Likewise. 34672 * tests/lstat.test: New test. 34673 * tests/lstat64.test: Likewise. 34674 * tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64. 34675 (lstat64_CFLAGS): Define. 34676 (TESTS): Add lstat.test and lstat64.test. 34677 (EXTRA_DIST): Add lstatx.c. 34678 * tests/.gitignore: Add lstat and lstat64. 34679 34680 tests: add fstat.test and fstat64.test. 34681 * tests/fstat.c: New file. 34682 * tests/fstat64.c: Likewise. 34683 * tests/fstatx.c: Likewise. 34684 * tests/fstat.test: New test. 34685 * tests/fstat64.test: Likewise. 34686 * tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64. 34687 (fstat64_CFLAGS): Define. 34688 (TESTS): Add fstat.test and fstat64.test. 34689 (EXTRA_DIST): Add fstatx.c. 34690 * tests/.gitignore: Add fstat and fstat64. 34691 34692 2015-12-05 Dmitry V. Levin <ldv (a] altlinux.org> 34693 34694 tests: prepare for detailed testing of stat family syscalls. 34695 Parametrize code from fstatat.c to support <asm/stat.h> 34696 as an alternative to <sys/stat.h> and move it to a separate file. 34697 34698 * tests/statx.sh: New file, based on fstatat64.test. 34699 * tests/fstatat64.test: Use it. 34700 * tests/newfstatat.test: Likewise. 34701 * tests/xstatx.c: New file, based on fstatat.c. 34702 * tests/fstatat.c: Use it. 34703 * tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c. 34704 * tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME. 34705 * tests/newfstatat.c: Likewise. 34706 34707 2015-12-04 Gabriel Laskar <gabriel (a] lse.epita.fr> 34708 34709 ioctl: allow to stop decoding number. 34710 For some ioctls, like from drm, the identification of the correct ioctl 34711 is done by custom code. Specifying IOCTL_NUMBER_STOP_LOOKUP on 34712 return of ioctl_decode_command_number() disables further calls to 34713 ioctl_lookup(). 34714 34715 * defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED, 34716 IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state 34717 decoding. 34718 * ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when 34719 ioctl_decode_command_number() returns a value with 34720 IOCTL_NUMBER_STOP_LOOKUP flag is set. 34721 34722 Suggested-by: Patrik Jakobsson <patrik.r.jakobsson (a] gmail.com> 34723 34724 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 34725 34726 tests: skip restart_syscall.test on x32. 34727 The syscall number of restart_syscall returned by the kernel in case 34728 of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see 34729 https://lkml.org/lkml/2015/11/30/790 34730 34731 Until that improves, skip the test on x32. 34732 34733 * tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77. 34734 34735 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 34736 34737 x32: fix decoding of i386 personality lseek syscall. 34738 On x32, tcp->ext_arg is not initialized for i386 personality, 34739 so tcp->u_arg has to be used instead. 34740 34741 * lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case. 34742 34743 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 34744 34745 x86_64, x32: add a replacement for <asm/stat.h> 34746 Some old kernel headers, Ubuntu 14.04 in particular, provide 34747 <asm/stat.h> editions that are completely wrong for x32. 34748 Workaround this issue by providing a replacement. 34749 34750 * linux/x86_64/asm_stat.h: New file. 34751 * linux/x32/asm_stat.h: Likewise. 34752 * Makefile.am (strace_SOURCES): Add them. 34753 34754 2015-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 34755 34756 Add a wrapper around <asm/stat.h> 34757 * linux/asm_stat.h: New file. 34758 * Makefile.am (strace_SOURCES): Add it. 34759 * file.c: Use it. 34760 34761 kernel_types.h: protect from double inclusion. 34762 * kernel_types.h: Add #include guard. 34763 34764 2015-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 34765 34766 fstatat64.test: lift /proc requirement. 34767 While -P option needs /proc to match descriptors, it does not use 34768 /proc to match pathnames. As this test does not need descriptor 34769 match, the /proc requirement can be safely lifted. 34770 34771 * tests/fstatat64.test: Lift /proc/self/fd/ requirement. 34772 34773 2015-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 34774 34775 tests: add fstatat64.test and newfstatat.test. 34776 * configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens. 34777 * tests/fstatat.c: New file. 34778 * tests/fstatat64.c: Likewise. 34779 * tests/newfstatat.c: Likewise. 34780 * tests/fstatat64.test: New test. 34781 * tests/newfstatat.test: Likewise. 34782 * tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat. 34783 (fstatat64_CFLAGS, newstatat_CFLAGS): Define. 34784 (TESTS): Add fstatat64.test and newfstatat.test. 34785 (EXTRA_DIST): Add fstatat.c. 34786 * tests/.gitignore: Add fstatat64 and newfstatat. 34787 34788 2015-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 34789 34790 alpha, ppc, sh, sh64: fix fstatat64 syscall entries. 34791 * linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64. 34792 * linux/powerpc/syscallent.h: Likewise. 34793 * linux/sh/syscallent.h: Likewise. 34794 * linux/sh64/syscallent.h: Likewise. 34795 34796 ppc64: clone syscallent.h from ppc. 34797 * linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h 34798 with entries for numbers 192..197, 204, 226, and 254 unassigned. 34799 34800 tests: add lseek.test and llseek.test. 34801 * tests/llseek.c: New file. 34802 * tests/lseek.c: Likewise. 34803 * tests/llseek.test: New test. 34804 * tests/lseek.test: Likewise. 34805 * tests/Makefile.am (check_PROGRAMS): Add llseek and lseek. 34806 (TESTS): Add llseek.test and lseek.test. 34807 * tests/.gitignore: Add llseek and lseek. 34808 34809 tests: add ftruncate64.test and truncate64.test. 34810 * tests/ftruncate64.c: New file. 34811 * tests/truncate64.c: Likewise. 34812 * tests/ftruncate64.test: New test. 34813 * tests/truncate64.test: Likewise. 34814 * tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64. 34815 (ftruncate64_CFLAGS, truncate64_CFLAGS): Define. 34816 (TESTS): Add ftruncate64.test and truncate64.test. 34817 * tests/.gitignore: Add ftruncate64 and truncate64. 34818 34819 tests: add ftruncate.test and truncate.test. 34820 * tests/ftruncate.c: New file. 34821 * tests/truncate.c: Likewise. 34822 * tests/ftruncate.test: New test. 34823 * tests/truncate.test: Likewise. 34824 * tests/Makefile.am (check_PROGRAMS): Add ftruncate and truncate. 34825 (TESTS): Add ftruncate.test and truncate.test. 34826 * tests/.gitignore: Add ftruncate and truncate. 34827 34828 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34829 34830 build: robustify linux/fcntl.h check. 34831 * configure.ac (AC_CHECK_TYPES): Support older linux kernel headers 34832 by including <sys/types.h> before <linux/fcntl.h>. 34833 34834 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34835 34836 syscall.c: move inclusion of arch specific files to the end of file. 34837 Move inclusion of arch specific files that define static functions to 34838 the end of syscall.c. 34839 34840 * syscall.c (get_syscall_result_regs, get_error, getregs_old): 34841 New forward declarations. 34842 (arch_get_scno): Move forward. 34843 Move inclusion of "get_scno.c", "get_syscall_args.c", 34844 "get_syscall_result.c", "get_error.c", and "getregs_old.c" 34845 to the end of file. 34846 34847 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34848 34849 x86_64: change getregs_old to forward ptrace return code. 34850 * linux/x86_64/getregs_old.c (getregs_old): Change to return ptrace 34851 return code. 34852 * syscall.c (get_regs) [ARCH_REGS_FOR_GETREGSET && X86_64]: Use 34853 getregs_old return code. 34854 34855 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34856 34857 Cleanup print_pc. 34858 Apparently, there are only two types of instruction pointer printers 34859 depending on the architecture: those that print a register that was 34860 fetched earlier, and those that fetch a register themselves using upeek. 34861 With this change, architectures of the first type have ARCH_PC_REG 34862 defined in their arch_regs.c file, architectures of the first type 34863 have ARCH_PC_PEEK_ADDR defined there, and the common code in syscall.c 34864 uses these macros to print the instruction pointer. 34865 34866 * Makefile.am (EXTRA_DIST): Remove linux/*/print_pc.c. 34867 * linux/*/print_pc.c: Remove. 34868 * linux/aarch64/arch_regs.c(ARCH_PC_REG): Define macro. 34869 * linux/arc/arch_regs.c(ARCH_PC_REG): Likewise. 34870 * linux/arm/arch_regs.c(ARCH_PC_REG): Likewise. 34871 * linux/avr32/arch_regs.c(ARCH_PC_REG): Likewise. 34872 * linux/i386/arch_regs.c(ARCH_PC_REG): Likewise. 34873 * linux/ia64/arch_regs.c(ARCH_PC_REG): Likewise. 34874 * linux/metag/arch_regs.c(ARCH_PC_REG): Likewise. 34875 * linux/mips/arch_regs.c(ARCH_PC_REG): Likewise. 34876 * linux/nios2/arch_regs.c(ARCH_PC_REG): Likewise. 34877 * linux/or1k/arch_regs.c(ARCH_PC_REG): Likewise. 34878 * linux/powerpc64/arch_regs.c(ARCH_PC_REG): Likewise. 34879 * linux/powerpc/arch_regs.c(ARCH_PC_REG): Likewise. 34880 * linux/s390/arch_regs.c(ARCH_PC_REG): Likewise. 34881 * linux/s390x/arch_regs.c(ARCH_PC_REG): Likewise. 34882 * linux/sparc64/arch_regs.c(ARCH_PC_REG): Likewise. 34883 * linux/sparc/arch_regs.c(ARCH_PC_REG): Likewise. 34884 * linux/tile/arch_regs.c(ARCH_PC_REG): Likewise. 34885 * linux/x32/arch_regs.c(ARCH_PC_REG): Likewise. 34886 * linux/x86_64/arch_regs.c(ARCH_PC_REG): Likewise. 34887 * linux/alpha/arch_regs.c(ARCH_PC_PEEK_ADDR): Define macro. 34888 * linux/bfin/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34889 * linux/crisv10/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34890 * linux/crisv32/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34891 * linux/hppa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34892 * linux/m68k/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34893 * linux/microblaze/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34894 * linux/sh64/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34895 * linux/sh/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34896 * linux/xtensa/arch_regs.c(ARCH_PC_PEEK_ADDR): Likewise. 34897 * syscall.c (print_pc): Stop including "print_pc.c". 34898 Use ARCH_PC_REG or ARCH_PC_PEEK_ADDR. 34899 34900 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34901 34902 cleanup: make get_scno.c files more readable. 34903 Make get_scno.c files more self-contained. While they are still 34904 being included by syscall.c, the latter no longer provides 34905 a function framework for them. 34906 34907 * linux/aarch64/get_scno.c (arch_get_scno): Define. 34908 * linux/alpha/get_scno.c: Likewise. 34909 * linux/arc/get_scno.c: Likewise. 34910 * linux/arm/get_scno.c: Likewise. 34911 * linux/avr32/get_scno.c: Likewise. 34912 * linux/bfin/get_scno.c: Likewise. 34913 * linux/crisv10/get_scno.c: Likewise. 34914 * linux/hppa/get_scno.c: Likewise. 34915 * linux/i386/get_scno.c: Likewise. 34916 * linux/ia64/get_scno.c: Likewise. 34917 * linux/m68k/get_scno.c: Likewise. 34918 * linux/metag/get_scno.c: Likewise. 34919 * linux/microblaze/get_scno.c: Likewise. 34920 * linux/mips/get_scno.c: Likewise. 34921 * linux/nios2/get_scno.c: Likewise. 34922 * linux/or1k/get_scno.c: Likewise. 34923 * linux/powerpc/get_scno.c: Likewise. 34924 * linux/powerpc64/get_scno.c: Likewise. 34925 * linux/s390/get_scno.c: Likewise. 34926 * linux/sh/get_scno.c: Likewise. 34927 * linux/sh64/get_scno.c: Likewise. 34928 * linux/sparc/get_scno.c: Likewise. 34929 * linux/sparc64/get_scno.c: Likewise. 34930 * linux/tile/get_scno.c: Likewise. 34931 * linux/x86_64/get_scno.c: Likewise. 34932 * linux/xtensa/get_scno.c: Likewise. 34933 * syscall.c (arch_get_scno): New declaration. 34934 Include "get_scno.c" in file scope. 34935 (get_scno): Use arch_get_scno. 34936 34937 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 34938 34939 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34940 34941 cleanup: make get_syscall_args.c files more readable. 34942 Make get_syscall_args.c files more self-contained. While they are 34943 still being included by syscall.c, the latter no longer defines 34944 get_syscall_args function. 34945 34946 * linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c" 34947 with get_syscall_args temporarily defined to arm_get_syscall_args. 34948 (get_syscall_args): Define. 34949 * linux/alpha/get_syscall_args.c (get_syscall_args): Define. 34950 * linux/arc/get_syscall_args.c: Likewise. 34951 * linux/arm/get_syscall_args.c: Likewise. 34952 * linux/avr32/get_syscall_args.c: Likewise. 34953 * linux/bfin/get_syscall_args.c: Likewise. 34954 * linux/crisv10/get_syscall_args.c: Likewise. 34955 * linux/hppa/get_syscall_args.c: Likewise. 34956 * linux/i386/get_syscall_args.c: Likewise. 34957 * linux/ia64/get_syscall_args.c: Likewise. 34958 * linux/m68k/get_syscall_args.c: Likewise. 34959 * linux/metag/get_syscall_args.c: Likewise. 34960 * linux/microblaze/get_syscall_args.c: Likewise. 34961 * linux/mips/get_syscall_args.c: Likewise. 34962 * linux/nios2/get_syscall_args.c: Likewise. 34963 * linux/or1k/get_syscall_args.c: Likewise. 34964 * linux/powerpc/get_syscall_args.c: Likewise. 34965 * linux/s390/get_syscall_args.c: Likewise. 34966 * linux/sh/get_syscall_args.c: Likewise. 34967 * linux/sh64/get_syscall_args.c: Likewise. 34968 * linux/sparc/get_syscall_args.c: Likewise. 34969 * linux/tile/get_syscall_args.c: Likewise. 34970 * linux/x86_64/get_syscall_args.c: Likewise. 34971 * linux/xtensa/get_syscall_args.c: Likewise. 34972 * syscall.c (get_syscall_args): Remove. 34973 Include "get_syscall_args.c" in file scope. 34974 34975 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 34976 34977 2015-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 34978 34979 cleanup: make get_syscall_result.c files more readable. 34980 Make get_syscall_result.c files more self-contained. While they are 34981 still being included by syscall.c, the latter no longer provides 34982 a function framework for them. 34983 34984 * linux/alpha/get_syscall_result.c (get_syscall_result_regs): Define. 34985 * linux/bfin/get_syscall_result.c: Likewise. 34986 * linux/crisv10/get_syscall_result.c: Likewise. 34987 * linux/hppa/get_syscall_result.c: Likewise. 34988 * linux/m68k/get_syscall_result.c: Likewise. 34989 * linux/microblaze/get_syscall_result.c: Likewise. 34990 * linux/sh/get_syscall_result.c: Likewise. 34991 * linux/sh64/get_syscall_result.c: Likewise. 34992 * linux/xtensa/get_syscall_result.c: Likewise. 34993 * syscall.c [!ARCH_REGS_FOR_GETREGSET && !ARCH_REGS_FOR_GETREGS]: 34994 Define USE_GET_SYSCALL_RESULT_REGS macro. 34995 [USE_GET_SYSCALL_RESULT_REGS]: Include "get_syscall_result.c". 34996 (get_syscall_result) [USE_GET_SYSCALL_RESULT_REGS]: Stop including 34997 "get_syscall_result.c". Call get_syscall_result_regs. 34998 34999 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 35000 35001 2015-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 35002 35003 cleanup: make get_error.c files more readable. 35004 Make get_error.c files more self-sustained. While they are still being 35005 included by syscall.c, the latter no longer defines get_error function. 35006 35007 * linux/aarch64/get_error.c: Include "arm/get_error.c" with get_error 35008 temporarily defined to arm_get_error. 35009 (get_error): Define. 35010 * linux/alpha/get_error.c (get_error): Define. 35011 * linux/arc/get_error.c: Likewise. 35012 * linux/arm/get_error.c: Likewise. 35013 * linux/avr32/get_error.c: Likewise. 35014 * linux/bfin/get_error.c: Likewise. 35015 * linux/crisv10/get_error.c: Likewise. 35016 * linux/hppa/get_error.c: Likewise. 35017 * linux/i386/get_error.c: Likewise. 35018 * linux/ia64/get_error.c: Likewise. 35019 * linux/m68k/get_error.c: Likewise. 35020 * linux/metag/get_error.c: Likewise. 35021 * linux/microblaze/get_error.c: Likewise. 35022 * linux/mips/get_error.c: Likewise. 35023 * linux/nios2/get_error.c: Likewise. 35024 * linux/or1k/get_error.c: Likewise. 35025 * linux/powerpc/get_error.c: Likewise. 35026 * linux/s390/get_error.c: Likewise. 35027 * linux/sh/get_error.c: Likewise. 35028 * linux/sh64/get_error.c: Likewise. 35029 * linux/sparc/get_error.c: Likewise. 35030 * linux/sparc64/get_error.c: Likewise. 35031 * linux/tile/get_error.c: Likewise. 35032 * linux/x86_64/get_error.c: Likewise. 35033 * linux/xtensa/get_error.c: Likewise. 35034 * syscall.c: Include "get_error.c" in file scope. 35035 (get_error): Remove. Move arch independent code ... 35036 (get_syscall_result): ... here. Update get_error invocation. 35037 35038 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 35039 35040 2015-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 35041 35042 cleanup: make arch_sigreturn.c files more readable. 35043 Make arch_sigreturn.c files more self-sustained. While they are 35044 still being included by sigreturn.c, the latter no longer defines 35045 arch_sigreturn function. 35046 35047 * linux/alpha/arch_sigreturn.c (arch_sigreturn): Define. 35048 * linux/arm/arch_sigreturn.c: Likewise. 35049 * linux/crisv10/arch_sigreturn.c: Likewise. 35050 * linux/i386/arch_sigreturn.c: Likewise. 35051 * linux/ia64/arch_sigreturn.c: Likewise. 35052 * linux/m68k/arch_sigreturn.c: Likewise. 35053 * linux/microblaze/arch_sigreturn.c: Likewise. 35054 * linux/mips/arch_sigreturn.c: Likewise. 35055 * linux/powerpc/arch_sigreturn.c: Likewise. 35056 * linux/s390/arch_sigreturn.c: Likewise. 35057 * linux/sparc/arch_sigreturn.c: Likewise. 35058 * linux/tile/arch_sigreturn.c: Likewise. 35059 * linux/x32/arch_sigreturn.c: Remove code. 35060 Include "x86_64/arch_sigreturn.c". 35061 * linux/x86_64/arch_sigreturn.c: Stop including "x32/arch_sigreturn.c". 35062 Include "i386/arch_sigreturn.c" with arch_sigreturn temporarily defined 35063 to i386_arch_sigreturn. 35064 (arch_sigreturn): Define. Add x32 personality support there. 35065 * sigreturn.c: Remove arch_sigreturn header and footer. 35066 35067 Requested-by: Denys Vlasenko <dvlasenk (a] redhat.com> 35068 35069 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35070 35071 Add initial Travis CI support. 35072 * .travis.yml: New file. 35073 * travis-ci.sh: Likewise. 35074 35075 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 35076 35077 tests: remove temporary files left after two tests. 35078 * tests/net-yy.test: Remove "$LOG"-connect and "$LOG"-accept. 35079 * tests/unix-yy.test: Likewise. 35080 35081 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 35082 35083 tests: skip stat32-v.test on x32. 35084 Explicitly skip 32-bit stat test on x32 even if libc pretends 35085 to support it. 35086 35087 * tests/stat.c (main) [__x86_64__ && __ILP32__]: Skip. 35088 35089 2015-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 35090 35091 tests: fix ipc_msgbuf.test on x32. 35092 * tests/ipc_msgbuf.c: Include "config.h" and "kernel_types.h". 35093 (main): Replace "long" with "kernel_long_t" in struct msgbuf. 35094 35095 x32: fix pselect6 decoding. 35096 * desc.c: Include "kernel_types.h". 35097 (umove_kulong_array_or_printaddr): New function. 35098 (SYS_FUNC(pselect6)): Use it. 35099 35100 x32: fix sigreturn decoding. 35101 * linux/x32/arch_sigreturn.c: Implement x32_rt_sigreturn decoding. 35102 * linux/x86_64/arch_sigreturn.c: Handle (current_personality == 0) 35103 case only. 35104 Include "x32/arch_sigreturn.c" instead of "i386/arch_sigreturn.c". 35105 35106 x32: fix struct dirent decoding. 35107 * kernel_types.h: New file. 35108 * Makefile.am (strace_SOURCES): Add it. 35109 * configure.ac (AC_CHECK_TYPES): Check for __kernel_long_t 35110 and __kernel_ulong_t in <asm/posix_types.h>. 35111 * dirent.c: Stop including <dirent.h>. 35112 (kernel_dirent): Remove. 35113 Include "kernel_types.h". 35114 (print_old_dirent, SYS_FUNC(getdents)): Print variables 35115 of kernel_ulong_t type using %Lu format. 35116 * syscall.c (kernel_long_t, kernel_ulong_t): Remove. 35117 Include "kernel_types.h". 35118 * tests/getdents.c (kernel_dirent): Remove. 35119 Include "kernel_types.h". 35120 (print_dirent): Print variables of kernel_ulong_t type using %Lu format. 35121 35122 2015-11-26 Elvira Khabirova <lineprinter0 (a] gmail.com> 35123 35124 Refer to -h on incorrect usage. 35125 * defs.h (error_msg_and_help): New prototype. 35126 * strace.c (error_msg_and_help): New function. 35127 (error_opt_arg, init): Use it. 35128 (usage): Remove unnecessary arguments. 35129 * count.c: Use the new function. 35130 35131 Rearrange flags descriptions in the usage text. 35132 * strace.c (usage): Rearrange descriptions. 35133 * tests/strace-k.test: Change the option detecting regexp accordingly. 35134 35135 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35136 35137 tests: run in "set -x" mode if VERBOSE variable is non-null. 35138 * tests/init.sh: Enter "set -x" mode if $VERBOSE is non-null. 35139 35140 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35141 35142 tests: fix match_diff usage. 35143 Fix argument order in match_diff invocations: 35144 the first argument has to be actual output, 35145 the second argument has to be expected output. 35146 35147 * tests/aio.test: Swap match_diff arguments. 35148 * tests/clock_nanosleep.test: Likewise. 35149 * tests/clock_xettime.test: Likewise. 35150 * tests/file_handle.test: Likewise. 35151 * tests/getdents.test: Likewise. 35152 * tests/getdents64.test: Likewise. 35153 * tests/getrandom.test: Likewise. 35154 * tests/inet-cmsg.test: Likewise. 35155 * tests/ioctl.test: Likewise. 35156 * tests/membarrier.test: Likewise. 35157 * tests/mlock2.test: Likewise. 35158 * tests/nanosleep.test: Likewise. 35159 * tests/pselect6.test: Likewise. 35160 * tests/readdir.test: Likewise. 35161 * tests/readlink.test: Likewise. 35162 * tests/readlinkat.test: Likewise. 35163 * tests/rt_sigqueueinfo.test: Likewise. 35164 * tests/seccomp.test: Likewise. 35165 * tests/select.test: Likewise. 35166 * tests/sendfile.test: Likewise. 35167 * tests/sendfile64.test: Likewise. 35168 * tests/struct_flock.test: Likewise. 35169 * tests/sysinfo.test: Likewise. 35170 * tests/time.test: Likewise. 35171 * tests/timer_create.test: Likewise. 35172 * tests/timer_xettime.test: Likewise. 35173 * tests/timerfd_xettime.test: Likewise. 35174 * tests/times-fail.test: Likewise. 35175 * tests/times.test: Likewise. 35176 * tests/umovestr2.test: Likewise. 35177 * tests/userfaultfd.test: Likewise. 35178 * tests/utime.test: Likewise. 35179 * tests/utimensat.test: Likewise. 35180 * tests/xet_robust_list.test: Likewise. 35181 * tests/xetitimer.test: Likewise. 35182 * tests/xettimeofday.test: Likewise. 35183 35184 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35185 35186 x86_64: fix x32 personality support in print_llu_from_low_high_val. 35187 x86 is the only personality supported on x86_64 35188 that has 32-bit syscall arguments. 35189 35190 * io.c (print_llu_from_low_high_val) [X86_64]: Fix 35191 current_personality == 2 case. 35192 35193 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35194 35195 x86_64: fix x32 personality support in getllval. 35196 x86 is the only personality supported on x86_64 35197 that has 32-bit syscall arguments. 35198 35199 * util.c (getllval) [X86_64]: Fix current_personality == 2 case. 35200 35201 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35202 35203 tests/file_handle: fix expected output. 35204 * tests/file_handle.c (main): Parametrize handle_type 35205 in open_by_handle_at parser output. 35206 35207 startup_attach: fix compilation warning. 35208 * strace.c (startup_attach): Split single error_msg statement with 35209 variable number of arguments to silence a compilation warning. 35210 35211 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35212 35213 .gitignore: add mpers_xlat.h. 35214 Ignore mpers_xlat.h generated since commit v4.10-454-g5cb45b2. 35215 35216 * .gitignore: Add /mpers_xlat.h. 35217 35218 Reported-by: Elvira Khabirova <lineprinter0 (a] gmail.com> 35219 35220 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35221 35222 tests: add struct_flock.test. 35223 * tests/struct_flock.c: New file. 35224 * tests/struct_flock.test: New test. 35225 * tests/Makefile.am (check_PROGRAMS): Add struct_flock. 35226 (TESTS): Add struct_flock.test. 35227 * tests/.gitignore: Add struct_flock. 35228 35229 Convert parsers of flock structures to new mpers infrastructure. 35230 * fetch_struct_flock.c: New file. 35231 * Makefile.am (strace_SOURCES): Add it. 35232 * fcntl.c (print_struct_flock64): New function. 35233 (printflock64): Use fetch_struct_flock64 and print_struct_flock64. 35234 (printflock): Use fetch_struct_flock and print_struct_flock64. 35235 35236 fcntl.c: implement decoding for all known operations. 35237 * xlat/f_owner_types.in: New file. 35238 * xlat/f_seals.in: Likewise. 35239 * fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h". 35240 (print_f_owner_ex): New function. 35241 (SYS_FUNC(fcntl)): Use it. 35242 Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW, 35243 F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG, 35244 F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG. 35245 35246 fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag. 35247 * fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code 35248 for F_DUPFD and F_DUPFD_CLOEXEC operations. 35249 35250 fcntl.c: remove redundant ifdefs. 35251 * fcntl.c (USE_PRINTFLOCK64): Remove macro. 35252 (printflock64): Define unconditionally. 35253 (SYS_FUNC(fcntl)): Do not check for USE_PRINTFLOCK64, 35254 F_DUPFD_CLOEXEC, F_NOTIFY, F_SETLEASE, and F_GETLEASE macros. 35255 35256 Update F_* constants. 35257 * xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS, 35258 F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK. 35259 Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD, 35260 F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK, 35261 F_RSETLKW, F_SHARE, and F_UNSHARE. 35262 Add default values. 35263 35264 Update LOCK_* constants. 35265 * xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW. 35266 Add default values. 35267 35268 2015-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 35269 35270 fcntl.c: use <linux/fcntl.h> instead of <fcntl.h> 35271 Include <linux/fcntl.h> for proper definitions of F_* constants 35272 and flock structures. 35273 35274 * configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64, 35275 struct __kernel_flock, and struct __kernel_flock64 in <linux/fcntl.h>. 35276 * flock.h: New file. 35277 * Makefile.am (strace_SOURCES): Add it. 35278 * fcntl.c: Include it instead of <fcntl.h>. 35279 (struct flock64): Remove. 35280 (printflock): Use struct_kernel_flock instead of struct flock. 35281 (printflock64): Use struct_kernel_flock64 instead of struct flock64. 35282 35283 2015-11-26 Elvira Khabirova <lineprinter0 (a] gmail.com> 35284 35285 mpers: fix compound types with arbitrary member alignments. 35286 * mpers.sh: Compound types are now represented as packed 35287 with character arrays as explicit fillers inbetween members 35288 and at the end. 35289 35290 2015-11-26 Mike Frysinger <vapier (a] gentoo.org> 35291 35292 Support C libraries without System V shared memory/ipc. 35293 Some systems (like Bionic) omit support for SysV related code. That 35294 means no C library headers for strace to include. Add configure tests 35295 to probe the headers from the kernel and use them when they are 35296 available. 35297 35298 It might make more sense to never rely on the C library's headers as 35299 there is no guarantee or requirement that the structure layout between 35300 apps and the C library match that what is passed to the kernel. 35301 35302 * configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h, 35303 linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h, 35304 sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h. 35305 * ipc_defs.h: Include <sys/ipc.h> or <linux/ipc.h> depending 35306 on what is available. 35307 * ipc_msg.c: Replace <sys/ipc.h> with "ipc_defs.h". 35308 Fallback to <linux/msg.h> when available. 35309 * ipc_msgctl.c: Include <sys/msg.h>, <asm/msgbuf.h>, or <linux/msg.h> 35310 based on what is available. Note missing support for old ipc structs. 35311 * ipc_sem.c: Include <sys/sem.h> or <linux/sem.h> depending 35312 on what is available. Only decode sembuf when available. 35313 * ipc_shm.c: Fallback to <linux/shm.h> when available. 35314 * ipc_shmctl.c: Include <sys/shm.h>, <asm/shmbuf.h>, or <linux/shm.h> 35315 based on what is available. Note missing support for old ipc structs. 35316 * print_mq_attr.c: Fallback to <linux/mqueue.h> when available. 35317 35318 2015-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 35319 35320 CREDITS.in: add Jian Zhen. 35321 Thanks to Jian Zhen for donation of https://github.com/strace/ and 35322 strace.io. 35323 35324 * CREDITS.in: Add Jian Zhen. 35325 35326 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 35327 35328 Fix syscall entries of unimplemented getpmsg and putpmsg syscalls. 35329 * linux/ia64/syscallent.h (getpmsg): Change SEN(printargs) 35330 to SEN(getpmsg). 35331 (putpmsg): Change SEN(printargs) to SEN(putpmsg). 35332 * linux/mips/syscallent-n32.h: Likewise. 35333 * linux/mips/syscallent-n64.h: Likewise. 35334 * linux/mips/syscallent-o32.h: Likewise. 35335 * linux/arm/syscallent.h (getpmsg, putpmsg): Set sys_flags to TN. 35336 * linux/bfin/syscallent.h (getpmsg, putpmsg): Likewise. 35337 * linux/hppa/syscallent.h (getpmsg, putpmsg): Likewise. 35338 * linux/i386/syscallent.h (getpmsg, putpmsg): Likewise. 35339 * linux/m68k/syscallent.h (getpmsg, putpmsg): Likewise. 35340 * linux/microblaze/syscallent.h (getpmsg, putpmsg): Likewise. 35341 * linux/powerpc/syscallent.h (getpmsg, putpmsg): Likewise. 35342 * linux/s390/syscallent.h (getpmsg, putpmsg): Likewise. 35343 * linux/s390x/syscallent.h (getpmsg, putpmsg): Likewise. 35344 * linux/x32/syscallent.h (getpmsg, putpmsg): Likewise. 35345 * linux/x86_64/syscallent.h (getpmsg, putpmsg): Likewise. 35346 35347 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 35348 35349 Remove parsers of getpmsg and putpmsg syscalls. 35350 These system calls are not implemented in the Linux kernel. 35351 35352 * linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated 35353 syscalls. 35354 * Makefile.am (strace_SOURCES): Remove stream.c. 35355 * stream.c: Remove. 35356 * xlat/pmsgflags.in: Remove. 35357 35358 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 35359 35360 Remove parser of query_module syscall. 35361 Since query_module syscall is present only in kernels before Linux 2.6 35362 and strace does not support those kernels, there is no use to keep this 35363 parser any longer. 35364 35365 * bjm.c: Do not include <sys/*>, "xlat/qm_which.h", 35366 and "xlat/modflags.h". 35367 (MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)): 35368 Remove. 35369 * linux/dummy.h (sys_query_module): Add stub alias. 35370 * xlat/modflags.in: Remove. 35371 * xlat/qm_which.in: Remove. 35372 35373 2015-11-24 Dmitry V. Levin <ldv (a] altlinux.org> 35374 35375 Fix syscall entries of deprecated sysfs syscall. 35376 * linux/alpha/syscallent.h (sysfs): Change nargs from 5 to 3. 35377 * linux/hppa/syscallent.h (sysfs): Likewise. 35378 * linux/mips/syscallent-n32.h (sysfs): Likewise. 35379 * linux/mips/syscallent-n64.h (sysfs): Likewise. 35380 35381 Move sysfs syscall to deprecated category. 35382 * linux/dummy.h (sys_sysfs): Move to the list of deprecated syscalls. 35383 35384 Fix syscall entries of deprecated bdflush syscall. 35385 * linux/alpha/syscallent.h (bdflush): Change nargs from 0 to 2. 35386 * linux/arm/syscallent.h (bdflush): Likewise. 35387 * linux/avr32/syscallent.h (bdflush): Likewise. 35388 * linux/bfin/syscallent.h (bdflush): Likewise. 35389 * linux/hppa/syscallent.h (bdflush): Likewise. 35390 * linux/i386/syscallent.h (bdflush): Likewise. 35391 * linux/ia64/syscallent.h (bdflush): Likewise. 35392 * linux/m68k/syscallent.h (bdflush): Likewise. 35393 * linux/microblaze/syscallent.h (bdflush): Likewise. 35394 * linux/powerpc/syscallent.h (bdflush): Likewise. 35395 * linux/s390/syscallent.h (bdflush): Likewise. 35396 * linux/s390x/syscallent.h (bdflush): Likewise. 35397 * linux/sh/syscallent.h (bdflush): Likewise. 35398 * linux/sh64/syscallent.h (bdflush): Likewise. 35399 * linux/sparc/syscallent.h (bdflush): Likewise. 35400 35401 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 35402 35403 Implement name_to_handle_at and open_by_handle_at syscalls decoding. 35404 * file_handle.c: New file. 35405 * Makefile.am (strace_SOURCES): Add it. 35406 * linux/dummy.h (sys_name_to_handle_at, sys_open_by_handle_at): 35407 Remove stub aliases. 35408 * pathtrace.c (pathtrace_match): Add SEN_name_to_handle_at. 35409 * tests/file_handle.c: New file. 35410 * tests/file_handle.test: New test. 35411 * tests/Makefile.am (check_PROGRAMS): Add file_handle. 35412 (TESTS): Add file_handle.test. 35413 * tests/.gitignore: Add file_handle. 35414 35415 Implement lookup_dcookie syscall decoding. 35416 * lookup_dcookie.c: New file. 35417 * Makefile.am (strace_SOURCES): Add it. 35418 * linux/dummy.h (sys_lookup_dcookie): Remove stub alias. 35419 35420 Implement kexec_file_load syscall decoding. 35421 * xlat/kexec_file_load_flags.in: New file. 35422 * kexec.c: Include "xlat/kexec_file_load_flags.h". 35423 (SYS_FUNC(kexec_file_load)): New function. 35424 * linux/dummy.h (sys_kexec_file_load): Remove stub alias. 35425 * pathtrace.c (pathtrace_match): Add SEN_kexec_file_load. 35426 35427 Implement kcmp syscall decoding. 35428 * kcmp.c: New file. 35429 * Makefile.am (strace_SOURCES): Add it. 35430 * linux/dummy.h (sys_kcmp): Remove stub alias. 35431 * xlat/kcmp_types.in: New file. 35432 35433 Implement iopl syscall decoding. 35434 * iopl.c: New file. 35435 * Makefile.am (strace_SOURCES): Add it. 35436 * linux/dummy.h (sys_iopl): Remove stub alias. 35437 35438 Implement ioperm syscall decoding. 35439 * ioperm.c: New file. 35440 * Makefile.am (strace_SOURCES): Add it. 35441 * linux/dummy.h (sys_ioperm): Remove stub alias. 35442 35443 net: fix printing of IP_RECVOPTS/IP_RETOPTS cmsg options. 35444 * net.c (print_cmsg_ip_opts): Print each byte as unsigned char. 35445 35446 userfaultfd: fix pathtrace support. 35447 * pathtrace.c (pathtrace_match): Add SEN_userfaultfd. 35448 35449 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 35450 35451 Implement IPPROTO_IP control messages decoding. 35452 * net.c: Include "xlat/ip_cmsg_types.h". 35453 (print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos, 35454 print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum, 35455 print_cmsg_ip_origdstaddr): New functions. 35456 (print_cmsg_type_data): Add generic SOL_IP level decoding. 35457 Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS, 35458 IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM, 35459 and SCM_SECURITY type messages. 35460 * xlat/ip_cmsg_types.in: New file. 35461 * xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS. 35462 * tests/inet-cmsg.c: New file. 35463 * tests/inet-cmsg.test: New test. 35464 * tests/Makefile.am (check_PROGRAMS): Add inet-cmsg. 35465 (TESTS): Add inet-cmsg.test. 35466 * tests/.gitignore: Add inet-cmsg. 35467 35468 Suggested-by: Orion Poplawski <orion (a] cora.nwra.com> 35469 35470 2015-11-22 Dmitry V. Levin <ldv (a] altlinux.org> 35471 35472 Simplify control messages printers. 35473 Do not pass sizeof(struct cmsghdr) to every cmsg printer. 35474 35475 * net.c (printcmsghdr): Pass pointer to cmsg_data and length 35476 of cmsg_data to print_cmsg_type_data. 35477 (print_cmsg_type_data): Update prototype. Pass pointer to cmsg_data 35478 and length of cmsg_data to cmsg printers. 35479 (print_scm_rights, print_scm_creds, print_scm_security): Update. 35480 35481 2015-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 35482 35483 net: factor out address printing code to a separate function. 35484 * net.c (sockaddr_buf_t): New type. 35485 (print_sockaddr): New function. 35486 (printsock, print_group_req): Use it. 35487 35488 2015-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 35489 35490 mpers: skip xlat struct definitions in mpers mode. 35491 Avoid duplicate definitions of xlat structures in files 35492 compiled in mpers mode. 35493 35494 Each xlat file defines the corresponding xlat struct with 35495 either global or local visibility using the following rules: 35496 35497 - if xlat struct declaration is available in defs.h, 35498 a global definition is provided in regular mode, 35499 and nothing is provided in mpers mode; 35500 - otherwise, if xlat file is included by a mpers source file, 35501 a global definition is provided in regular mode 35502 (unless no mpers mode is supported on this architecture, 35503 in that case, a local definition is provided instead), 35504 and a declaration is provided in mpers mode; 35505 - otherwise, a local definition is provided in regular mode, 35506 and an error message is printed in mpers mode. 35507 35508 Fallback definitions of constants provided by xlat files 35509 remain available in all modes. 35510 35511 * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh. 35512 * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove. 35513 * generate_mpers_am.sh: Generate mpers_xlat.h. 35514 * Makefile.am (EXTRA_DIST): Add mpers_xlat.h. 35515 * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally. 35516 * print_timex.c: Include "xlat/adjtimex_modes.h" and 35517 "xlat/adjtimex_status.h" unconditionally. 35518 * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ... 35519 (cond_def): ... here. 35520 (gen_header): Check also mpers_xlat.h for global declarations 35521 of xlat structures. 35522 Process input file twice, first time print directives 35523 only, second time print everything. 35524 Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif. 35525 * xlat/getrandom_flags.in: Cleanup. 35526 35527 2015-11-20 Dmitry V. Levin <ldv (a] altlinux.org> 35528 35529 tests: rewrite getdents test in C for better coverage. 35530 * tests/getdents.awk: Remove. 35531 * tests/getdents.out: Remove. 35532 * tests/getdents.c: New file. 35533 * tests/getdents.test: Rewrite. 35534 * tests/getdents64.c: New file. 35535 * tests/getdents64.test: New test. 35536 * tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64. 35537 (TESTS): Add getdents64.test. 35538 (EXTRA_DIST): Remove getdents.awk and getdents.out. 35539 * tests/.gitignore: Add getdents and getdents64. 35540 35541 2015-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 35542 35543 tests: add readdir.test. 35544 * tests/readdir.c: New file. 35545 * tests/readdir.test: New test. 35546 * tests/Makefile.am (check_PROGRAMS): Add readdir. 35547 (TESTS): Add readdir.test. 35548 * tests/.gitignore: Add readdir. 35549 35550 Mpersify parsers of readdir and getdents syscalls. 35551 * defs.h (dirent_types): New xlat prototype. 35552 * dirent.c: Stop including "xlat/direnttypes.h". 35553 (kernel_dirent): New typedef. Mpersify it. 35554 (print_old_dirent): Use it instead of old_dirent_t. 35555 (SYS_FUNC(getdents)): Use it instead of struct kernel_dirent. 35556 Rename direnttypes to dirent_types. 35557 (SYS_FUNC(getdents64)): Move ... 35558 * dirent64.c: ... here. Rename direnttypes to dirent_types. 35559 Include "xlat/dirent_types.h". 35560 * Makefile.am (strace_SOURCES): Add dirent64.c. 35561 * xlat/direnttypes.in: Rename to xlat/dirent_types.in. 35562 35563 2015-11-19 Gabriel Laskar <gabriel (a] lse.epita.fr> 35564 35565 getdents: fix typos in array output. 35566 Array should be enclosed by square brakets, and elements should be 35567 separated by commas. 35568 35569 * dirent.c (SYS_FUNC(getdents), SYS_FUNC(getdents64)): Fix typos 35570 in array output. 35571 * tests/getdents.awk: Update regexps to match fixed output. 35572 * tests/getdents.out: Update output. 35573 35574 2015-11-19 Dmitry V. Levin <ldv (a] altlinux.org> 35575 35576 printcmsghdr: move type and data decoders to a separate function. 35577 * net.c (print_scm_rights, print_scm_creds, print_scm_security): Change 35578 to return void. Move printing of struct cmsghdr closing '}' ... 35579 (printcmsghdr): ... here. Move type and data decoders to ... 35580 (print_cmsg_type_data): ... new function. 35581 35582 2015-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 35583 35584 Assume that libc provides sendmsg. 35585 Starting with commit v4.6-281-g7af9f35, we implicitly assume that 35586 HAVE_SENDMSG is always defined. Therefore, the check for sendmsg 35587 availability is redundant and could be safely removed. 35588 35589 * configure.ac (AC_CHECK_FUNCS): Remove sendmsg. 35590 * linux/dummy.h [!HAVE_SENDMSG] (sys_recvmsg, sys_sendmsg): Remove 35591 stub aliases. 35592 * net.c [HAVE_SENDMSG]: Define unconditionally. 35593 * syscall.c (dumpio) [HAVE_SENDMSG]: Likewise. 35594 35595 2015-11-18 Dmitry V. Levin <ldv (a] altlinux.org> 35596 35597 net.c: move fallback definition of SCM_SECURITY to xlat/ 35598 * net.c: Move fallback definition of SCM_SECURITY ... 35599 * xlat/scmvals.in: ... here. 35600 35601 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 35602 35603 Implement mlock2 syscall decoding. 35604 * mem.c: Include "xlat/mlock_flags.h". 35605 (SYS_FUNC(mlock2)): New function. 35606 * xlat/mlock_flags.in: New file. 35607 * xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values. 35608 * linux/dummy.h (mlock2): Remove. 35609 * tests/mlock2.c: New file. 35610 * tests/mlock2.test: New test. 35611 * tests/Makefile.am (check_PROGRAMS): Add mlock2. 35612 (TESTS): Add mlock2.test. 35613 * tests/.gitignore Add mlock2. 35614 35615 Implement membarrier syscall decoding. 35616 * membarrier.c: New file. 35617 * Makefile.am (strace_SOURCES): Add it. 35618 * xlat/membarrier_cmds.in: New file. 35619 * linux/dummy.h (membarrier): Remove. 35620 * tests/membarrier.c: New file. 35621 * tests/membarrier.test: New test. 35622 * tests/Makefile.am (check_PROGRAMS): Add membarrier. 35623 (TESTS): Add membarrier.test. 35624 * tests/.gitignore: Add membarrier. 35625 35626 Implement userfaultfd syscall decoding. 35627 * userfaultfd.c: New file. 35628 * Makefile.am (strace_SOURCES): Add it. 35629 * xlat/uffd_flags.in: New file. 35630 * linux/dummy.h (userfaultfd): Remove. 35631 * tests/userfaultfd.c: New file. 35632 * tests/userfaultfd.test: New test. 35633 * tests/Makefile.am (check_PROGRAMS): Add userfaultfd. 35634 (TESTS): Add userfaultfd.test. 35635 * tests/.gitignore: Add userfaultfd. 35636 35637 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 35638 35639 ia64: wire up kcmp syscall. 35640 ia64 has kcmp syscall starting with linux kernel commit 35641 v4.3-rc7-1-gd305c47. 35642 35643 * linux/ia64/syscallent.h (kcmp): New entry. 35644 35645 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 35646 35647 powerpc: wire up direct sysv ipc syscalls. 35648 Starting with linux commit v4.3-rc3-33-ga342361, powerpc has 35649 direct sysv ipc syscalls in addition to traditional ipc syscall. 35650 35651 * linux/powerpc/syscallent.h (semop, semget, semctl, semtimedop, msgsnd, 35652 msgrcv, msgget, msgctl, shmat, shmdt, shmget, shmctl): New entries. 35653 35654 2015-11-17 Dmitry V. Levin <ldv (a] altlinux.org> 35655 35656 Wire up userfaultfd, membarrier, and mlock2 syscalls. 35657 * linux/dummy.h (membarrier, mlock2, userfaultfd): New stub aliases. 35658 * linux/32/syscallent.h (userfaultfd, membarrier, mlock2): New entries. 35659 * linux/64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35660 * linux/arm/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35661 * linux/hppa/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35662 * linux/i386/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35663 * linux/ia64/syscallent.h (userfaultfd, membarrier): Likewise. 35664 * linux/m68k/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35665 * linux/microblaze/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35666 * linux/mips/syscallent-n32.h (userfaultfd, membarrier, mlock2): Likewise. 35667 * linux/mips/syscallent-n64.h (userfaultfd, membarrier, mlock2): Likewise. 35668 * linux/mips/syscallent-o32.h (userfaultfd, membarrier, mlock2): Likewise. 35669 * linux/powerpc/syscallent.h (userfaultfd, membarrier): Likewise. 35670 * linux/s390/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35671 * linux/s390x/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35672 * linux/sparc/syscallent.h (membarrier, userfaultfd, mlock2): Likewise. 35673 * linux/x32/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35674 * linux/x86_64/syscallent.h (userfaultfd, membarrier, mlock2): Likewise. 35675 35676 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 35677 35678 sprintflags: skip zero flags. 35679 Tweak sprintflags behaviour to match printflags. 35680 35681 * util.c (sprintflags): Skip zero flags unless the value passed 35682 to sprintflags is also zero. 35683 35684 2015-11-16 Mike Frysinger <vapier (a] gentoo.org> 35685 35686 printflags: handle empty xlats. 35687 If the set of headers are unable to produce a valid list, printflags 35688 will try to pass NULL to tprints which crashes. Add a sanity check 35689 for this edge case. 35690 35691 * util.c (printflags): Check xlat->str is not NULL. 35692 35693 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 35694 35695 mpers: forward mpers_DEFS to mpers.sh. 35696 mpers_DEFS has to be forwarded to mpers.sh so that config.h would be 35697 properly included by defs.h at preprocessor stage. 35698 35699 * Makefile.am (mpers-m%.stamp): Add the whole $(mpers_sh_opts) set of 35700 options to mpers.sh's CPPFLAGS. 35701 35702 2015-11-16 Dmitry V. Levin <ldv (a] altlinux.org> 35703 35704 tests/ioctl: workaround glibc ioctl wrapper on powerpc. 35705 * tests/ioctl.c (main) [POWERPC] Disable TCGETS test. 35706 35707 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 35708 35709 powerpc: wire up switch_endian syscall. 35710 powerpc has switch_endian syscall starting with linux commit 35711 v4.0-rc4-67-g529d235. 35712 35713 * linux/powerpc/syscallent.h (switch_endian): New entry. 35714 35715 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 35716 35717 sparc: reserve more space for new syscalls. 35718 Move socket subcalls further down the table to make room 35719 for new syscalls. 35720 35721 * linux/sparc/syscallent.h (SYS_socket_subcall): Raise from 353 to 400. 35722 35723 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 35724 35725 m68k: wire up direct socket syscalls. 35726 Starting with linux commit v4.3-rc3-1-g5b3f33e, m68k has direct 35727 socket syscalls in addition to traditional socketcall syscall. 35728 35729 * linux/m68k/syscallent.h (socket, socketpair, bind, connect, listen, 35730 accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, 35731 sendmsg, recvfrom, recvmsg, shutdown, recvmmsg, sendmmsg): New entries. 35732 35733 2015-11-15 Dmitry V. Levin <ldv (a] altlinux.org> 35734 35735 i386: wire up direct socket syscalls. 35736 Starting with linux commit v4.2-rc1-64-g9dea5dc, x86 has direct 35737 socket syscalls in addition to traditional socketcall syscall. 35738 35739 * linux/i386/syscallent.h (socket, socketpair, bind, connect, listen, 35740 accept4, getsockopt, setsockopt, getsockname, getpeername, sendto, 35741 sendmsg, recvfrom, recvmsg, shutdown): New entries. 35742 35743 2015-11-11 Heiko Carstens <heiko.carstens (a] de.ibm.com> 35744 35745 s390, s390x: update syscall tables. 35746 * linux/s390/syscallent.h: Add new syscalls available with kernel 4.3.0. 35747 * linux/s390x/syscallent.h: Likewise. 35748 35749 2015-11-07 Dmitry V. Levin <ldv (a] altlinux.org> 35750 35751 Fix *_printer_defs.h rules ambiguousness. 35752 There is an ambiguousness in *_printer_defs.h rules definition: 35753 35754 $ grep '^[^ ]*_defs\.h: ' Makefile.am 35755 m%_defs.h: $(srcdir_mpers_source_files) 35756 %_printer_defs.h: $(srcdir_mpers_source_files) 35757 35758 While it appears to work with GNU make, it has to be fixed nevertheless. 35759 35760 * Makefile.am (m%_defs.h): Rename to m%_type_defs.h. 35761 (mpers_m32_targets): Rename m32_defs.h to m32_type_defs.h. 35762 (mpers_mx32_targets): Rename mx32_defs.h to mx32_type_defs.h. 35763 * mpers_type.h: Rename m32_defs.h to m32_type_defs.h, 35764 mx32_defs.h to mx32_type_defs.h. 35765 * .gitignore: Likewise. 35766 35767 Reported-by: Elliott Hughes <enh (a] google.com> 35768 35769 2015-10-09 Dmitry V. Levin <ldv (a] altlinux.org> 35770 35771 fcntl.c: make use of RVAL_DECODED. 35772 * fcntl.c (SYS_FUNC(fcntl)): Return RVAL_DECODED for write-only operations. 35773 35774 2015-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 35775 35776 desc.c: move parser of fcntl syscall to a separate file. 35777 * fcntl.c: New file. 35778 * Makefile.am (strace_SOURCES): Add it. 35779 * desc.c (printflock64, printflock, SYS_FUNC(fcntl)): Move to fcntl.c. 35780 35781 desc.c: move parser of flock syscall to a separate file. 35782 * flock.c: New file. 35783 * Makefile.am (strace_SOURCES): Add it. 35784 * desc.c (SYS_FUNC(flock)): Move to flock.c. 35785 35786 2015-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 35787 35788 tests: fix false uio.test failures. 35789 * tests/uio.c (main): Use descriptor number 0 in pread/pwrite 35790 and preadv/pwritev syscalls. 35791 * tests/uio.expected: Update regexps. 35792 35793 Reported-by: Lennart Sorensen <lsorense (a] csclub.uwaterloo.ca> 35794 35795 2015-10-01 Gabriel Laskar <gabriel (a] lse.epita.fr> 35796 35797 Fix make -j builds. 35798 In files generated by mpers scripts, includes directives are taken from 35799 original files where the type definition was done. This causes to 35800 include defs.h in multiple files. defs.h includes printers.h header, 35801 which is a generated header. 35802 35803 This patch add an explicit dependency to printers.h for the mpers 35804 scripts. 35805 35806 * Makefile.am (mpers-m%.stamp): Add printers.h to order-only 35807 prerequisites. 35808 35809 2015-09-29 Mike Frysinger <vapier (a] gentoo.org> 35810 35811 mpers: fix shell code to conform better to POSIX. 35812 The `echo -n` behavior is non-portable, so use printf instead. 35813 35814 * generate_mpers_am.sh: Change `echo -n` to `printf`. 35815 35816 2015-09-23 Gabriel Laskar <gabriel (a] lse.epita.fr> 35817 35818 ioctl: fix ioctl command number decoding in case of conflicts. 35819 When a command number was decoded through ioctl_decode_command_number(), 35820 there was no check for conflicts with other potential ioctls numbers. 35821 35822 For example: 35823 ioctl(fd, MCE_GET_RECORD_LEN, &i); 35824 output: 35825 ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0 35826 instead of: 35827 ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0 35828 35829 * ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding 35830 in case of conflicts. 35831 * tests/ioctl.c (main): Add a case for command number conflicts. 35832 35833 2015-09-23 Dmitry V. Levin <ldv (a] altlinux.org> 35834 35835 tests: convert ioctl.test from match_grep to match_diff. 35836 * tests/ioctl.c (main): Print expected output. 35837 * tests/ioctl.test: Use match_diff instead of match_grep. 35838 * tests/ioctl.expected: Remove. 35839 * tests/Makefile.am (EXTRA_DIST): Remove ioctl.expected. 35840 35841 2015-09-20 Dmitry V. Levin <ldv (a] altlinux.org> 35842 35843 Convert parser of seccomp filter program to new mpers infrastructure. 35844 * seccomp_fprog.h: New file. 35845 * fetch_seccomp_fprog.c: New file. 35846 * Makefile.am (strace_SOURCES): Add them. 35847 * seccomp.c: Include "seccomp_fprog.h". 35848 (print_seccomp_filter): Use fetch_seccomp_fprog. 35849 35850 2015-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 35851 35852 tests/init.sh: enhance match_grep error diagnostics. 35853 * tests/init.sh (match_grep): Check patterns one by one, 35854 output only those patterns that didn't match. 35855 35856 tests/init.sh: fix comment. 35857 * tests/init.sh (match_awk): Fix usage description. 35858 35859 tests: add one more case to select.test. 35860 * tests/select.c (main): Check how timeout is printed 35861 on exiting syscall. 35862 35863 tests: uncouple pselect6 from select.test. 35864 * tests/select.c Do not include <string.h>. 35865 Include <sys/syscall.h>. 35866 [!__NR_select]: Skip the test. 35867 (main): Remove pselect6 support, test just select syscall. 35868 * tests/select.test: Remove all pselect6 checks, test just 35869 select syscall. 35870 35871 tests: robustify select test. 35872 * tests/select.c: Do not include <assert.h>. 35873 (main): Skip the test instead of assertions. 35874 Add some padding to the timeval structure. 35875 35876 tests: add one more case to pselect6.test. 35877 * tests/pselect6.c (main): Check how timeout is printed 35878 on exiting syscall. 35879 35880 tests: robustify pselect6 test. 35881 * tests/pselect6.c: Do not include <assert.h> and <string.h>. 35882 Include <sys/syscall.h>. 35883 [!__NR_pselect6]: Skip the test. 35884 (main): Skip the test instead of assertions. 35885 Add some padding to the timespec structure. 35886 35887 Convert another parser of struct timeval to new mpers infrastructure. 35888 * print_time.c (sprint_timeval): New mpers printer. 35889 [ALPHA] (sprint_timeval32): New function. 35890 * defs.h [ALPHA] (sprint_timeval32): New prototype. 35891 (bitness_t, TIMEVAL_TEXT_BUFSIZE, printtv_bitness, sprinttv): Remove. 35892 * desc.c (decode_select): Replace bitness parameter with two printers. 35893 Use them instead of printtv_bitness and sprinttv. 35894 (sys_oldselect, sys_select): Pass print_timeval and sprint_timeval 35895 to decode_select. 35896 [ALPHA] (sys_osf_select): Pass print_timeval32 and sprint_timeval32 35897 to decode_select. 35898 (pselect6): Pass print_timespec and sprint_timespec to decode_select. 35899 * time.c (UTIME_NOW, UTIME_OMIT, current_time_t_is_compat, 35900 struct timeval32, printtv_bitness, do_sprinttv, sprinttv): Remove. 35901 35902 Convert another parser of struct timespec to new mpers infrastructure. 35903 * print_time.c (sprint_timespec): New mpers printer. 35904 * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. 35905 (sprint_timespec): Remove. 35906 * time.c (sprint_timespec): Remove. 35907 * net.c (sys_recvmmsg): Update callers. 35908 * poll.c (decode_poll_exiting): Likewise. 35909 35910 tests: add another case to pselect6 test. 35911 * tests/pselect6.c: Include <sys/time.h>. 35912 (handler): New function. 35913 (main): Install an interval timer. 35914 Use it to check how ERESTARTNOHAND is printed. 35915 35916 Fix decoding of gettimeofday and settimeofday. 35917 * time.c (print_timezone): new function. 35918 (sys_gettimeofday, sys_settimeofday): Use it instead of print_timeval 35919 to print struct timezone. 35920 [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): Use it 35921 instead of print_timeval32 to print struct timezone. 35922 * tests/xettimeofday.c: New file. 35923 * tests/xettimeofday.test: New test. 35924 * tests/Makefile.am (check_PROGRAMS): Add xettimeofday. 35925 (TESTS): Add xettimeofday. 35926 * tests/.gitignore: Add xettimeofday. 35927 35928 Convert parser of struct timeval to new mpers infrastructure. 35929 * defs.h (printtv, printtv_special): Remove. 35930 [ALPHA] (print_timeval32, print_timeval32_pair): New prototypes. 35931 * print_time.c (print_timeval): New mpers printer. 35932 [ALPHA] (print_timeval32, print_timeval32_pair): New functions. 35933 * time.c (sys_gettimeofday, sys_settimeofday): Use print_timeval 35934 instead of printtv. 35935 [ALPHA] (sys_osf_gettimeofday, sys_osf_settimeofday): 35936 Use print_timeval32 instead of printtv_bitness. 35937 * utimes.c [ALPHA] (sys_osf_utimes): Use print_timeval32_pair 35938 instead of printtv_bitness. 35939 35940 Convert parser of struct timespec to new mpers infrastructure. 35941 * defs.h (print_timespec): Remove. 35942 * print_time.c (print_timespec): New mpers printer. 35943 * futex.c (sys_futex): Use print_timespec instead of printtv. 35944 * ipc_sem.c (sys_semtimedop): Likewise. 35945 * mq.c (sys_mq_timedsend, sys_mq_timedreceive): Likewise. 35946 * time.c (clock_settime, clock_gettime, clock_nanosleep): Likewise. 35947 (print_timespec): Remove. 35948 35949 Remove unused parser of adjtime syscall. 35950 * time.c (sys_adjtime): Remove. 35951 35952 Fix decoding of clock_nanosleep. 35953 * time.c (sys_clock_nanosleep): Use is_erestart, 35954 temporarily_clear_syserror, and restore_cleared_syserror. 35955 * tests/clock_nanosleep.c: New file. 35956 * tests/clock_nanosleep.test: New test. 35957 * tests/Makefile.am (check_PROGRAMS): Add clock_nanosleep. 35958 (TESTS): Add clock_nanosleep.test. 35959 * tests/.gitignore: Add clock_nanosleep. 35960 35961 Add is_erestart helper function. 35962 * defs.h (is_erestart): New prototype. 35963 * syscall.c (is_erestart): New function. 35964 * time.c (sys_nanosleep): Use is_erestart, 35965 temporarily_clear_syserror, and restore_cleared_syserror. 35966 35967 Add helper functions to clear/restore syserror. 35968 * defs.h (temporarily_clear_syserror, restore_cleared_syserror): 35969 New prototypes. 35970 * syscall.c (saved_u_error): New variable. 35971 (temporarily_clear_syserror, restore_cleared_syserror): New functions. 35972 * aio.c (sys_io_getevents): Use temporarily_clear_syserror 35973 and restore_cleared_syserror. 35974 * mq.c (sys_mq_timedreceive): Likewise. 35975 * signal.c (sys_rt_sigtimedwait): Likewise. 35976 35977 tests: add nanosleep.test. 35978 * tests/nanosleep.c: New file. 35979 * tests/nanosleep.test: New test. 35980 * tests/Makefile.am (check_PROGRAMS): Add nanosleep. 35981 (TESTS): Add nanosleep.test. 35982 * tests/.gitignore: Add nanosleep. 35983 35984 tests: rewrite restart_syscall in C. 35985 * tests/restart_syscall.c: New file. 35986 * tests/restart_syscall.expected: Remove. 35987 * tests/restart_syscall_unknown.expected: Remove. 35988 * tests/restart_syscall.test: Update to use restart_syscall. 35989 * tests/Makefile.am (check_PROGRAMS): Add restart_syscall. 35990 (EXTRA_DIST): Remove restart_syscall.expected 35991 and restart_syscall_unknown.expected. 35992 * tests/.gitignore: Add restart_syscall. 35993 35994 Properly initialize siginfo_t object passed to print_stopped function. 35995 * strace.c (trace): Clear the whole siginfo_t variable before passing it 35996 to ptrace(PTRACE_GETSIGINFO) because the latter may initialize only a 35997 part of the structure. 35998 35999 tests: add clock_xettime.test. 36000 * tests/clock_xettime.c: New file. 36001 * tests/clock_xettime.test: New test. 36002 * tests/Makefile.am (check_PROGRAMS): Add clock_xettime. 36003 (TESTS): Add clock_xettime.test. 36004 * tests/.gitignore: Add clock_xettime. 36005 36006 Convert parser of struct itimerval to new mpers infrastructure. 36007 * defs.h [ALPHA] (print_itimerval32): New prototype. 36008 * print_time.c (print_itimerval): New mpers printer. 36009 [ALPHA] (timeval32_t): New typedef. 36010 [ALPHA] (print_timeval32_t, print_itimerval32): New functions. 36011 * time.c (sys_getitimer, sys_setitimer): Use print_itimerval instead 36012 of printitv. 36013 [ALPHA] (sys_osf_getitimer, sys_osf_setitimer): Use print_itimerval32 36014 instead of printitv_bitness. 36015 (tprint_timeval32, tprint_timeval, printitv_bitness, printitv): Remove. 36016 36017 tests: add xetitimer.test. 36018 * tests/xetitimer.c: New file. 36019 * tests/xetitimer.test: New test. 36020 * tests/Makefile.am (check_PROGRAMS): Add xetitimer. 36021 (TESTS): Add xetitimer.test. 36022 * tests/.gitignore: Add xetitimer. 36023 36024 Convert parser of struct itimerspec to new mpers infrastructure. 36025 * print_time.c (print_itimerspec): New mpers printer. 36026 * time.c (sys_timer_settime, sys_timer_gettime, sys_timerfd, 36027 sys_timerfd_settime, sys_timerfd_gettime): Use it instead of printitv. 36028 36029 2015-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 36030 36031 print_time.c: introduce print_timespec_t helper. 36032 * print_time.c (time_fmt): New constant string. 36033 (print_timeval_t): Use it. 36034 (print_timespec_t): New function. 36035 (print_timespec_t_utime): Use it. 36036 36037 tests: add timerfd_xettime.test. 36038 * tests/timerfd_xettime.c: New file. 36039 * tests/timerfd_xettime.test: New test. 36040 * tests/Makefile.am (check_PROGRAMS): Add timerfd_xettime. 36041 (TESTS): Add timerfd_xettime.test. 36042 * tests/.gitignore: Add timerfd_xettime. 36043 36044 tests: add timer_xettime.test. 36045 * tests/timer_xettime.c: New file. 36046 * tests/timer_xettime.test: New test. 36047 * tests/Makefile.am (check_PROGRAMS): Add timer_xettime. 36048 (TESTS): Add timer_xettime.test. 36049 * tests/.gitignore: Add timer_xettime. 36050 36051 time.c: move parser of time syscall to print_time.c. 36052 * time.c (current_time_t_is_int32): Remove. 36053 (sys_time): Move ... 36054 * print_time.c: ... here. Mpersify time_t. 36055 36056 print_time.c: remove unused function parameters. 36057 * print_time.c (print_timespec_t_utime, print_timeval_t): Remove 36058 "struct tcb *" parameter. 36059 (print_timespec_utime_pair, print_timeval_pair): Update callers. 36060 36061 Add struct timex.tai support. 36062 * configure.ac (AC_CHECK_MEMBERS): Add struct timex.tai. 36063 * print_timex.c (print_timex) [HAVE_STRUCT_TIMEX_TAI]: Print tai field. 36064 * tests/adjtimex.c (main) [HAVE_STRUCT_TIMEX_TAI]: Likewise. 36065 36066 Convert parser of struct timex to new mpers infrastructure. 36067 * defs.h (adjtimex_modes, adjtimex_status): New xlat prototypes. 36068 * print_timex.c (struct_timex): New typedef. Mpersify it. 36069 [IN_MPERS]: Do not include "xlat/adjtimex_modes.h" 36070 and "xlat/adjtimex_status.h". 36071 [SUPPORTED_PERSONALITIES > 1]: Remove. 36072 (tprint_timeval): Remove. 36073 (tprint_timex): Rename to print_timex. Mpersify it. 36074 * time.c (do_adjtimex): Rename tprint_timex to print_timex. 36075 * tests/adjtimex.c: New file. 36076 * tests/adjtimex.test: New test. 36077 * tests/Makefile.am (check_PROGRAMS): Add adjtimex. 36078 (TESTS): Add adjtimex.test. 36079 * tests/.gitignore: Add adjtimex. 36080 36081 Move parser of struct timex to a separate file. 36082 * print_timex.c: New file. 36083 * Makefile.am (strace_SOURCES): Add it. 36084 * time.c (tprint_timex32, tprint_timex): Move to print_timex.c. 36085 36086 Enhance parser of struct sigevent. 36087 * print_sigevent.c (print_sigevent): Always print names 36088 of struct_sigevent fields along with their values. 36089 Print signal name of sigev_signo for those sigev_notify values 36090 that require valid signal numbers. 36091 * tests/timer_create.c: New file. 36092 * tests/timer_create.test: New test. 36093 * tests/Makefile.am (check_PROGRAMS): Add timer_create. 36094 (TESTS): Add timer_create.test. 36095 * tests/.gitignore: Add timer_create. 36096 36097 2015-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 36098 36099 Convert parser of struct sigevent to new mpers infrastructure. 36100 * defs.h (sigev_value): New prototype. 36101 (printsigevent): Remove. 36102 * print_sigevent.c (struct_sigevent): New typedef. Mpersify it. 36103 [IN_MPERS]: Do not include "xlat/sigev_value.h". 36104 (printsigevent32): Remove. 36105 (printsigevent): Rename to print_sigevent. Mpersify it. 36106 * mq.c (sys_mq_notify): Rename printsigevent to print_sigevent. 36107 * time.c (sys_timer_create): Likewise. 36108 36109 Move parser of struct sigevent to a separate file. 36110 * print_sigevent.c: New file. 36111 * Makefile.am (strace_SOURCES): Add it. 36112 * time.c (printsigevent32, printsigevent): Move to print_sigevent.c. 36113 36114 time.c: move fallback definitions of SIGEV_* values to xlat/ 36115 * time.c: Move fallback definitions of SIGEV_* values ... 36116 * xlat/sigev_value.in: ... here. 36117 36118 Simplify use of mpers printers. 36119 * native_defs.h: New file. 36120 * syscall.c: Include it. 36121 * mpers_type.h [!IN_MPERS] (MPERS_DEFS): Change to "native_defs.h". 36122 * defs.h (MPERS_PRINTER_NAME): Remove. 36123 [SUPPORTED_PERSONALITIES > 1] (MPERS_PRINTER_NAME, printers): Move ... 36124 * Makefile.am (printers.h): ... here. 36125 Add macro definitions for mpers printers. 36126 (m%_defs.h): Add redefinition of MPERS_PRINTER_NAME and inclusion 36127 of "$(mpers_PREFIX)printer_decls.h". 36128 (strace_SOURCES): Add native_defs.h. 36129 * README-mpers: Update instructions for using mpers printers. 36130 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Call tprint_msgbuf directly. 36131 * mq.c (sys_mq_open, mq_getsetattr): Call printmqattr directly. 36132 * process.c (sys_ptrace): Call printsiginfo_at directly. 36133 * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Likewise. 36134 * resource.c (sys_getrusage): Call printrusage directly. 36135 * utimes.c (sys_utimensat): Call print_timespec_utime_pair directly. 36136 (sys_utimes, sys_futimesat): Call print_timeval_pair directly. 36137 * wait.c (printwaitn): Call printrusage directly. 36138 (sys_waitid): Call printrusage and printsiginfo_at directly. 36139 36140 2015-09-15 Dmitry V. Levin <ldv (a] altlinux.org> 36141 36142 Add a new helper function umove_ulong_array_or_printaddr. 36143 * defs.h (umove_ulong_array_or_printaddr): New prototype. 36144 * util.c (umove_ulong_array_or_printaddr): New function. 36145 * desc.c (sys_pselect6): Use it instead of open-coding 36146 a proxy struct parser for different personalities. 36147 * io.c (tprint_iov_upto): Use it instead of open-coding 36148 a struct iovec parser for different personalities. 36149 * kexec.c (print_kexec_segments): Use it instead of open-coding 36150 a struct kexec_segment parser for different personalities. 36151 (print_seg): Pass arguments using an array. 36152 36153 tests: add pselect6.test. 36154 * tests/pselect6.c: New file. 36155 * tests/pselect6.test: New test. 36156 * tests/Makefile.am (check_PROGRAMS): Add pselect6. 36157 (TESTS): Add pselect6.test. 36158 * tests/.gitignore: Add pselect6. 36159 36160 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 36161 36162 Rename umove_long_or_printaddr to umove_ulong_or_printaddr. 36163 Rename the recently added function to reflect what kind of data type 36164 it actually deals with: unsigned long int, without sign extension. 36165 36166 * defs.h (umove_long_or_printaddr): Rename to umove_ulong_or_printaddr, 36167 chage 3rd argument to unsigned long *. 36168 * util.c (umove_long_or_printaddr): Likewise. 36169 * aio.c (sys_io_submit): Update callers. 36170 36171 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 36172 36173 aarch64, ppc64, sparc64, tile: hook up mpers printers. 36174 * defs.h [AARCH64 && HAVE_M32_MPERS]: Define PERSONALITY0_INCLUDE_FUNCS, 36175 PERSONALITY0_INCLUDE_PRINTERS_DECLS, 36176 and PERSONALITY0_INCLUDE_PRINTERS_DEFS. 36177 [POWERPC64 && HAVE_M32_MPERS]: Define PERSONALITY1_INCLUDE_FUNCS, 36178 PERSONALITY1_INCLUDE_PRINTERS_DECLS, 36179 and PERSONALITY1_INCLUDE_PRINTERS_DEFS. 36180 [SPARC64 && HAVE_M32_MPERS]: Likewise. 36181 [TILE && HAVE_M32_MPERS]: Likewise. 36182 36183 2015-09-14 Anton Blanchard <anton (a] samba.org> 36184 36185 Add PowerPC specific ptrace constants. 36186 * xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants. 36187 36188 2015-09-14 Dmitry V. Levin <ldv (a] altlinux.org> 36189 36190 Update SCTP_* constants. 36191 * xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF, 36192 SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO, 36193 SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3, 36194 and SCTP_GET_ASSOC_STATS. 36195 36196 Update F_* constants. 36197 * xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS, 36198 and F_GET_SEALS. 36199 36200 Update RENAME_* constants. 36201 * xlat/rename_flags.in: Add RENAME_WHITEOUT. 36202 36203 Update SO_* constants. 36204 * xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS, 36205 SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU, 36206 SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL, 36207 SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS. 36208 36209 Update INPUT_PROP_* constants. 36210 * xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER. 36211 36212 Update KEY_* constants. 36213 * xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A, 36214 KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D. 36215 36216 Update FALLOC_FL_* constants. 36217 * xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE. 36218 36219 Update AF_* and PF_* constants. 36220 * xlat/addrfams.in: Add AF_IB and AF_MPLS. 36221 * xlat/domains.in: Add PF_IB and PF_MPLS. 36222 36223 Update TCP_* constants. 36224 * xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO, 36225 TCP_SAVE_SYN, and TCP_SAVED_SYN. 36226 36227 Update PACKET_* constants. 36228 * xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP, 36229 PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS, 36230 PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA. 36231 36232 Update BPF_MAP_TYPE_* constants. 36233 * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY. 36234 36235 Update IPPROTO_* constants. 36236 * xlat/inet_protocols.in: Add IPPROTO_MPLS. 36237 36238 Update IP_* constants. 36239 * xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT. 36240 36241 Update PTRACE_O_* constants. 36242 * ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP. 36243 * xlat/ptrace_setoptions_flags.in: Add it. 36244 36245 Update PR_* constants. 36246 * xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE, 36247 and PR_CAP_AMBIENT. 36248 36249 Update SECBIT_* constants. 36250 * xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE 36251 and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED. 36252 36253 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36254 36255 mpers.m4: workaround missing gnu/stubs-*.h files. 36256 On some systems missing gnu/stubs-*.h files make -m32/-mx32 compilation 36257 checks fail. As we want to support multiple personalities despite of 36258 this limitation, workaround the check by creating empty gnu stub files 36259 if necessary. 36260 36261 * m4/mpers.m4 (st_MPERS): Check for the gnu stub file. Create an empty 36262 gnu stub file if the system one is missing. 36263 * Makefile.am (DISTCLEANFILES): Add gnu/stubs-32.h and gnu/stubs-x32.h. 36264 36265 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36266 36267 tests: add times-fail.test. 36268 * tests/times-fail.c: New file. 36269 * tests/times-fail.test: New test. 36270 * tests/Makefile.am (check_PROGRAMS): Add times-fail. 36271 (TESTS): Add times-fail.test. 36272 * tests/.gitignore: Add times-fail. 36273 36274 2015-08-28 Eugene Syromyatnikov <evgsyr (a] gmail.com> 36275 36276 tests: add times.test. 36277 * tests/times.c: New file. 36278 * tests/times.test: New test. 36279 * tests/Makefile.am (check_PROGRAMS): Add times. 36280 (TESTS): Add times.test. 36281 (times_LDADD): Define. 36282 * tests/.gitignore: Add times. 36283 36284 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36285 36286 Mpersify parser of times syscall. 36287 Fix multiple personalities support in parser of times syscall by 36288 mpersifying struct tms. 36289 36290 * times.c (tms_t): New typedef. Mpersify it. 36291 (sys_times): Use it instead of struct tms. 36292 36293 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36294 36295 tests: add sysinfo.test. 36296 * tests/sysinfo.c: New file. 36297 * tests/sysinfo.test: New test. 36298 * tests/Makefile.am (check_PROGRAMS): Add sysinfo. 36299 (TESTS): Add sysinfo.test. 36300 * tests/.gitignore: Add sysinfo. 36301 36302 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36303 36304 Mpersify parser of sysinfo syscall. 36305 Fix multiple personalities support in parser of sysinfo syscall by 36306 mpersifying struct sysinfo. 36307 36308 * sysinfo.c (sysinfo_t): New typedef. Mpersify it. 36309 (sys_sysinfo): Use it instead of struct sysinfo. 36310 36311 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36312 36313 Enhance msgctl syscall decoding. 36314 Make parser of msgctl syscall print struct msqid_ds. 36315 36316 * ipc_msgctl.c (msqid_ds_t): New typedef. Mpersify it. 36317 (print_msqid_ds): New function. Use msqid_ds_t. 36318 (sys_msgctl): Use print_msqid_ds. 36319 * tests/ipc_msg.c: Update for struct msqid_ds support. 36320 36321 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36322 36323 Enhance shmctl syscall decoding. 36324 Make parser of shmctl syscall print struct shmid_ds. 36325 36326 * ipc_shmctl.c (shmid_ds_t): New typedef. Mpersify it. 36327 (print_shmid_ds): New function. Use shmid_ds_t. 36328 (sys_shmctl): Use print_shmid_ds. 36329 * tests/ipc_shm.c: Update for struct shmid_ds support. 36330 36331 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36332 36333 tests: add ipc_msgbuf.test. 36334 * tests/ipc_msgbuf.c: New file. 36335 * tests/ipc_msgbuf.expected: Likewise. 36336 * tests/ipc_msgbuf.test: New test. 36337 * tests/Makefile.am (check_PROGRAMS): Add ipc_msgbuf. 36338 (TESTS): Add ipc_msgbuf.test. 36339 (EXTRA_DIST): Add ipc_msgbuf.expected. 36340 * tests/.gitignore: Add ipc_msgbuf. 36341 36342 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36343 36344 Mpersify tprint_msgsnd and tprint_msgrcv. 36345 Fix multiple personalities support in tprint_msgsnd and tprint_msgrcv 36346 by converting tprint_msgbuf into a mpersified printer. 36347 36348 * print_msgbuf.c (msgbuf_t): New typedef. Mpersify it. 36349 (tprint_msgbuf): Use it instead of long. 36350 Wrap function name into MPERS_PRINTER_DECL. 36351 * ipc_msg.c (tprint_msgsnd, tprint_msgrcv): Use mpersified 36352 tprint_msgbuf. 36353 36354 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36355 36356 tests: add mq.test. 36357 * tests/mq.c: New file. 36358 * tests/mq.expected: Likewise. 36359 * tests/mq.test: New test. 36360 * tests/Makefile.am (check_PROGRAMS): Add mq. 36361 (TESTS): Add mq.test. 36362 (EXTRA_DIST): Add mq.expected. 36363 (mq_LDADD): Add -lrt. 36364 * tests/.gitignore: Add mq. 36365 36366 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36367 36368 Mpersify parsers of mq_open and mq_getsetattr syscalls. 36369 Fix multiple personalities support in parsers of mq_open and 36370 mq_getsetattr by converting printmqattr into a mpersified printer. 36371 36372 * print_mq_attr.c (mq_attr_t): New typedef. Mpersify it. 36373 (printmqattr): Use it instead of struct mq_attr. Wrap function name 36374 into MPERS_PRINTER_DECL. 36375 * mq.c (mq_open, mq_getsetattr): Use mpersified printmqattr. 36376 36377 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36378 36379 tests: add wait.test. 36380 * tests/wait.c: New file. 36381 * tests/wait.expected: Likewise. 36382 * tests/wait.test: New test. 36383 * tests/Makefile.am (check_PROGRAMS): Add wait. 36384 (TESTS): Add wait.test. 36385 (EXTRA_DIST): Add wait.expected. 36386 * tests/.gitignore: Add wait. 36387 36388 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36389 36390 Mpersify parsers of getrusage, waitpid, wait4, and waitid syscalls. 36391 Fix multiple personalities support in parsers of getrusage, waitpid, 36392 wait4, and waitid syscalls by converting printrusage into a mpersified 36393 printer. 36394 36395 * defs.h (printrusage): Remove. 36396 * printrusage.c (rusage_t): New typedef. Mpersify it. 36397 (printrusage): Use it instead of struct rusage. 36398 Wrap function name into MPERS_PRINTER_DECL. 36399 * resource.c (sys_getrusage): Use mpersified printrusage. 36400 * wait.c (printwaitn, sys_waitid): Likewise. 36401 36402 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36403 36404 tests: add rt_sigqueueinfo.test. 36405 * tests/rt_sigqueueinfo.c: New file. 36406 * tests/rt_sigqueueinfo.test: New test. 36407 * tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo. 36408 (TESTS): Add rt_sigqueueinfo.test. 36409 * tests/.gitignore: Add rt_sigqueueinfo. 36410 36411 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36412 36413 Mpersify printsiginfo_at printer. 36414 Fix multiple personalities support in parsers of ptrace, 36415 rt_sigqueueinfo, rt_tgsigqueueinfo, rt_sigtimedwait and waitid syscalls 36416 by converting printsiginfo_at into a mpersified printer. 36417 36418 * printsiginfo.c (siginfo_t): Mpersify. 36419 (printsiginfo_at): Wrap function name into MPERS_PRINTER_DECL. 36420 * defs.h (printsiginfo_at): Remove. 36421 * signal.c (print_sigqueueinfo, sys_rt_sigtimedwait): Use mpersified 36422 printsiginfo_at. 36423 * process.c (sys_ptrace): Likewise. 36424 * wait.c (sys_waitid): Likewise. 36425 36426 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36427 36428 Mpersify parser of sigaltstack syscall. 36429 Fix multiple personalities support in parser of sigaltstack syscall by 36430 mpersifying stack_t typedef. 36431 36432 * sigaltstack.c (stack_t): Mpersify. 36433 (print_stack_t): Use it. 36434 36435 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36436 36437 Mpersify parser of utime syscall. 36438 Fix multiple personalities support in parser of utime syscall by using 36439 mpersified utimbuf_t typedef. 36440 36441 * utime.c (utimbuf_t): New typedef. Mpersify it. 36442 (sys_utime): Use it instead of a locally defined union. 36443 36444 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36445 36446 tests: add utimensat.test. 36447 * tests/utimensat.c: New file. 36448 * tests/utimensat.test: New test. 36449 * tests/Makefile.am (check_PROGRAMS): Add utimensat. 36450 (TESTS): Add utimensat.test. 36451 * configure.ac (AC_CHECK_FUNCS): Add utimensat. 36452 * tests/.gitignore: Add utimensat. 36453 36454 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36455 36456 Mpersify parsers of utimes, futimesat, and utimensat syscalls. 36457 Fix multiple personalities support in parsers of utimes, futimesat, 36458 and utimensat syscalls by introducing two mpersified printers: 36459 print_timeval_pair and print_timespec_utime_pair. 36460 36461 * print_time.c: New file. 36462 * Makefile.am (strace_SOURCES): Add it. 36463 * utimes.c (decode_utimes): Remove. 36464 (sys_utimes, sys_futimesat): Use print_timeval_pair instead 36465 of decode_utimes. 36466 (sys_utimensat): Use print_timespec_utime_pair instead of decode_utimes. 36467 36468 2015-08-28 Elvira Khabirova <lineprinter0 (a] gmail.com> 36469 36470 Add mpers support. 36471 Add a subsystem for semi-automatical definition of how parsers should 36472 work with personality-dependent (mpers) types of tracee's data. Create 36473 auxiliary libraries containing mpers syscall parsers and printer 36474 functions, one library for each possible nonnative target personality. 36475 36476 Currently some parsers do not handle differences in definitions of data 36477 types between personalities, namely LP64 and ILP32. When 36478 this is the case, long integers, pointers, and all compound 36479 types containing long and pointer members may be printed incorrectly, 36480 because of differences in sizes, offsets and alignments. 36481 36482 Since in most cases these are the only differences in desired behaviour 36483 of parsers and printers for different personalities, a correct way 36484 would be to compile one source code into multiple parsers, differing 36485 only in definitions of mpers types. 36486 36487 To get a definition of a given type for nonnative personality 36488 a very basic .c file containing a declaration of a variable of this type 36489 is being compiled for this personality (using -m32 or -mx32 compiler 36490 flag). Information about the type is then being extracted from 36491 this binary's DWARF debug info with an awk script and put 36492 into a corresponding header file. Resulting headers are being used to 36493 compile mpers variations of syscall parsers and printer functions. 36494 36495 In addition to syscall parsers, there can occur a need to create mpers 36496 printing functions, which then can be called from many places 36497 in the code (for example, printsiginfo_at). Such functions (printers) 36498 are marked in a special manner. 36499 36500 For each possible nonnative target personality a library is being 36501 created, containing mpers variations of syscall parsers and printers. 36502 Only syscall parsers from files marked in a special manner and specially 36503 marked functions from such files are being recompiled and included 36504 in these libraries. 36505 36506 generate_mpers_am.sh is called by bootstrap to find the files 36507 from strace_SOURCES which include MPERS_DEFS. During compilation, 36508 these files are being inspected for inclusions of DEF_MPERS_TYPE, 36509 and nonnative variations of each included type are being generated 36510 by an awk script. 36511 36512 Mpers parser names are being modified during inclusions of syscallent 36513 headers for nonnative personalities. Pointers to printers are 36514 being stored in structs struct_printers, and a master 36515 pointer printers is being updated on every set_personality. 36516 36517 * README-mpers: New README explaining how to use mpers support. 36518 * empty.h: New empty file. 36519 * generate_mpers_am.sh: New file. 36520 * mpers.awk: Likewise. 36521 * mpers.sh: Likewise. 36522 * mpers_test.sh: Likewise. 36523 * mpers_type.h: Likewise. 36524 * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. 36525 (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning 36526 of the file. 36527 (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. 36528 (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. 36529 (BUILT_SOURCES, CLEANFILES): Add new generated files: 36530 native_printer_decls.h, native_printer_defs.h, printers.h, 36531 [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] 36532 $(mpers_mx32_targets). 36533 (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, 36534 mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, 36535 libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. 36536 (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, 36537 %_printer_decls.h, %_printer_defs.h, clean-local, 36538 native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): 36539 New targets. 36540 * bootstrap: Add generate_mpers_am.sh. 36541 * configure.ac: Add AC_PROG_RANLIB. 36542 * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. 36543 * defs.h: Include mpers_type.h. 36544 Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. 36545 Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. 36546 [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, 36547 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS 36548 for X86_64, X32. 36549 [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, 36550 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS 36551 for X86_64. 36552 Add fallback definitions of 36553 PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, 36554 PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, 36555 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, 36556 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. 36557 * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, 36558 PERSONALITY2_INCLUDE_FUNCS, 36559 PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, 36560 PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, 36561 PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. 36562 (printers): New struct. Update it when needed. 36563 * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, 36564 m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, 36565 mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, 36566 mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, 36567 native_printer_decls.h, native_printer_defs.h, and printers.h. 36568 36569 2015-08-28 Dmitry V. Levin <ldv (a] altlinux.org> 36570 36571 tests: convert readlink.test and readlinkat.test from match_awk to match_diff 36572 * tests/readlink.c (main): Print expected output. 36573 * tests/readlinkat.c (main): Likewise. 36574 * tests/readlink.test: Use match_diff instead of match_awk. 36575 * tests/readlinkat.test: Likewise. 36576 * tests/readlink.awk: Remove. 36577 * tests/readlinkat.awk: Likewise. 36578 * tests/Makefile.am (EXTRA_DIST): Remove readlink.awk and readlinkat.awk. 36579 36580 tests: convert getrandom.test from match_awk to match_diff. 36581 * tests/getrandom.c (main): Print expected output. 36582 * tests/getrandom.test: Use match_diff instead of match_awk. 36583 * tests/getrandom.awk: Remove. 36584 * tests/Makefile.am (EXTRA_DIST): Remove getrandom.awk. 36585 36586 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 36587 36588 tests: convert select.test from match_awk to match_diff. 36589 * tests/select.c (main): Print expected output. 36590 * tests/select.test: Use match_diff instead of match_awk. 36591 * tests/select.awk: Remove. 36592 * tests/Makefile.am (EXTRA_DIST): Remove select.awk. 36593 36594 tests: convert several tests from match_grep to match_diff. 36595 * tests/sendfile.test: Use match_diff instead of match_grep. 36596 * tests/sendfile64.test: Likewise. 36597 * tests/time.test: Likewise. 36598 * tests/utime.test: Likewise. 36599 * tests/xet_robust_list.test: Likewise. 36600 * tests/sendfile.c (main): Update match patterns for match_diff. 36601 * tests/sendfile64.c (main): Likewise. 36602 * tests/time.c (main): Likewise. 36603 * tests/utime.c (main): Likewise. 36604 * tests/xet_robust_list.c (main): Likewise. 36605 36606 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 36607 36608 tests: fix match_diff usage. 36609 The first argument of match_diff should be the file with expected 36610 output, the second argument - the file with actual output. 36611 36612 * tests/aio.test: Swap match_diff arguments. 36613 * tests/restart_syscall.test: Likewise. 36614 * tests/seccomp.test: Likewise. 36615 * tests/umovestr2.test: Likewise. 36616 36617 2015-08-27 Dmitry V. Levin <ldv (a] altlinux.org> 36618 36619 build: fix -I options. 36620 * configure.ac (AM_INIT_AUTOMAKE): Add nostdinc. 36621 * Makefile.am (AM_CPPFLAGS): Append -I$(builddir) and -I$(srcdir). 36622 * tests/Makefile.am (AM_CPPFLAGS): Likewise. 36623 36624 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 36625 36626 aio: rewrite from libaio.h to linux/aio_abi.h. 36627 * configure.ac (AC_CHECK_HEADERS): Remove libaio.h. 36628 * aio.c: Assume that <linux/aio_abi.h> is available, 36629 include it instead of <libaio.h>. 36630 [!IOCB_RESFD]: Remove. 36631 (enum iocb_sub): Remove SUB_POLL. 36632 (tprint_lio_opcode): Update. 36633 (print_common_flags): Use IOCB_FLAG_RESFD instead of IOCB_RESFD, 36634 rename fields of struct iocb. 36635 (iocb_is_valid, print_iocb_header, print_iocb): New functions. 36636 (sys_io_submit): Use print_iocb. 36637 (print_io_event): Fix struct io_event decoding. 36638 (sys_io_cancel): Use print_iocb_header. 36639 * strace.spec (BuildRequires): Remove libaio-devel. 36640 * tests/aio.c (main): Test IOCB_CMD_PREADV, io_cancel, 36641 and struct io_event decoding. 36642 * tests/aio.test (syscalls): Add io_cancel. 36643 36644 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 36645 36646 Fix multiple personalities support in parser of io_submit syscall. 36647 Introduce a new helper function to fetch tracee's long integers 36648 and use it to fix multiple personalities support in io_submit parser. 36649 36650 * defs.h (umove_long_or_printaddr): New prototype. 36651 * util.c (umove_long_or_printaddr): New function. 36652 * aio.c (sys_io_submit): Use it to fetch tracee's pointers. 36653 * tests/aio.c: New file. 36654 * tests/aio.test: New test. 36655 * tests/Makefile.am (check_PROGRAMS): Add aio. 36656 (TESTS): Add aio.test. 36657 * tests/.gitignore: Add aio. 36658 36659 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 36660 36661 tests: fix build on systems that lack O_CLOEXEC definition. 36662 * tests/epoll_create1.c (main): Check that O_CLOEXEC is defined. 36663 * tests/eventfd.c (main): Likewise. 36664 * tests/signalfd.c (main): Likewise. 36665 36666 tests: fix build on systems that lack AT_FDCWD definition. 36667 * tests/readlinkat.c: Stop including <fcntl.h>. 36668 (main): Replace AT_FDCWD with -100. 36669 36670 Fix printing of io_getevents first argument. 36671 * aio.c (sys_io_getevents): Print first argument using "%lu" format. 36672 36673 2015-08-26 Mike Frysinger <vapier (a] gentoo.org> 36674 36675 decode extend getsockopt/setsockopt options. 36676 Currently the code assumes the set of valid options between getsockopt 36677 and setsockopt are exactly the same and thus maintains one list. The 36678 kernel unfortunately does not do this -- it allows for different opts 36679 between the get and set functions. See the {g,s}et_opt{min,max} fields 36680 in the various netfilter subcores. 36681 36682 To support this, extend the printxval function to take multiple sets of 36683 xlats as varargs. Then we add the new get/set lists, and pass them down 36684 in the net code when decoding things. 36685 36686 A simple example is iptables; before: 36687 getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0 36688 getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0 36689 after: 36690 getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0 36691 getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0 36692 36693 If these were setsockopt calls, then 0x40 & 0x41 would be 36694 IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS. 36695 36696 * configure.ac: Check for netfilter headers. 36697 * defs.h (printxvals): New prototype. 36698 (printxval): Change to a define. 36699 * net.c: Include netfilter headers and new sockopts headers. 36700 (print_sockopt_fd_level_name): Add a is_getsockopt argument. Change SOL_IP 36701 and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more 36702 xlats down. 36703 (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true. 36704 (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false. 36705 * util.c (printxval): Rename to ... 36706 (printxvals): ... this. Rewrite to be varargs based. 36707 * xlat/getsockipoptions.in: New xlat list. 36708 * xlat/getsockipv6options.in, xlat/setsockipoptions.in, 36709 xlat/setsockipv6options.in: Likewise. 36710 36711 2015-08-26 Dmitry V. Levin <ldv (a] altlinux.org> 36712 36713 Fix build on systems that lack VIDIOC_CREATE_BUFS definition. 36714 * v4l2.c (v4l2_ioctl): Check that v4l2_ioctl is defined. 36715 36716 Fix build on systems that lack EM_ARM/EM_OPENRISC definitions. 36717 * xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB 36718 with EM_ARM check. Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check. 36719 36720 2015-08-25 Dmitry V. Levin <ldv (a] altlinux.org> 36721 36722 Fix build on systems that lack UBI_IOCVOLCRBLK/UBI_IOCVOLRMBLK definitions 36723 * mtd.c (ubi_ioctl): Check that UBI_IOCVOLCRBLK and UBI_IOCVOLRMBLK 36724 are defined. 36725 36726 Fix build on systems that lack O_CLOEXEC definition. 36727 * xlat/efd_flags.in: Check that O_CLOEXEC is defined. 36728 * xlat/epollflags.in: Likewise. 36729 * xlat/sfd_flags.in: Likewise. 36730 * xlat/timerfdflags.in: Fix O_CLOEXEC check. 36731 36732 2015-08-21 Elvira Khabirova <lineprinter0 (a] gmail.com> 36733 36734 printsiginfo.c: fix integer conversions. 36735 * printsiginfo.c (printsigsource): Print si_pid and si_uid as unsigned 36736 integers. 36737 (printsigval): Print si_int as signed int. 36738 36739 2015-08-20 Dmitry V. Levin <ldv (a] altlinux.org> 36740 36741 Fix decoding of times syscall return value. 36742 Always print return value of successful times syscall 36743 as unsigned long integer. 36744 36745 * times.c (sys_times): Return RVAL_UDECIMAL unless syserror. 36746 36747 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 36748 36749 mq.c: remove repeated code. 36750 * mq.c (sys_mq_open): Use printmqattr instead of implementing it again. 36751 [HAVE_MQUEUE_H]: Remove. 36752 36753 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 36754 36755 ipc_msg.c: fix multiple personalities support in msgrcv ipc subcall. 36756 When msgrcv syscall is an ipc subcall, msgp (pointer to struct msgbuf) 36757 and msgtyp (message type) syscall arguments are passed via proxy 36758 structure which definition significantly depends on tracee's 36759 wordsize. 36760 36761 * ipc_msg.c (fetch_msgrcv_args): New function. 36762 (sys_msgrcv): Use it. 36763 36764 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 36765 36766 ipc.c: split into separate files. 36767 In preparation for upcoming mpers-related changes, 36768 split ipc.c into independent groups of parsers. 36769 36770 * ipc_defs.h: New file. 36771 * ipc_msg.c: Likewise. 36772 * ipc_msgctl.c: Likewise. 36773 * ipc_sem.c: Likewise. 36774 * ipc_shm.c: Likewise. 36775 * ipc_shmctl.c: Likewise. 36776 * mq.c: Likewise. 36777 * print_mq_attr.c: Likewise. 36778 * print_msgbuf.c: Likewise. 36779 * ipc.c: Remove. 36780 (sys_mq_open, sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, 36781 sys_mq_getsetattr): Move to mq.c. 36782 (sys_msgget, tprint_msgsnd, sys_msgsnd, tprint_msgrcv, sys_msgrcv): Move 36783 to ipc_msg.c. 36784 (sys_msgctl): Move to ipc_msgctl.c. 36785 (tprint_sembuf, tprint_sembuf_array, sys_semop, sys_semtimedop, 36786 sys_semget, syssemctl): Move to ipc_sem.c. 36787 (sys_shmget, sys_shmat, sys_shmdt): Move to ipc_shm.c. 36788 (sys_shmctl): Move to ipc_shmctl.c. 36789 (printmqattr): Move to print_mq_attr.c. 36790 (tprint_msgbuf): Move to print_msgbuf.c. 36791 (IPC_64, PRINTCTL): Move to ipc_defs.h. 36792 * defs.h (struct xlat resource_flags): New prototype. 36793 * Makefile.am (strace_SOURCES): Remove ipc.c. Add ipc_defs.h, mq.c, 36794 ipc_msg.c, ipc_msgctl.c, ipc_sem.c, ipc_shm.c, ipc_shmctl.c, 36795 print_mq_attr.c, and print_msgbuf.c. 36796 36797 2015-08-20 Elvira Khabirova <lineprinter0 (a] gmail.com> 36798 36799 .gitignore: add sen.h and sys_func.h. 36800 36801 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 36802 36803 tests: add sendfile.test and sendfile64.test. 36804 * tests/sendfile.c: New file. 36805 * tests/sendfile64.c: New file. 36806 * tests/sendfile.test: New test. 36807 * tests/sendfile64.test: New test. 36808 * tests/Makefile.am (check_PROGRAMS): Add sendfile and sendfile64. 36809 (TESTS): Add sendfile.test and sendfile64.test. 36810 * tests/.gitignore: Add sendfile and sendfile64. 36811 36812 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 36813 36814 sendfile: decode file offset both on entering and exiting syscall. 36815 When sendfile is called with a valid pointer to a file offset variable, 36816 kernel updates this variable on successfull exit from syscall. 36817 36818 * sendfile.c (sys_sendfile, sys_sendfile64): Print tcp->u_arg[2] 36819 on exiting syscall as well as on entering. 36820 36821 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 36822 36823 io.c: move sendfile parsers to a separate file. 36824 * sendfile.c: New file. 36825 * Makefile.am (strace_SOURCES): Add it. 36826 * io.c (sys_sendfile, sys_sendfile64): Move to sendfile.c 36827 36828 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 36829 36830 Make printnum_* functions return boolean status. 36831 With this change, printnum_* functions return true iff they 36832 successfully fetched necessary data from tracee's memory. 36833 36834 * defs.h (printnum_short, printnum_int, printnum_int64, 36835 printnum_long_int, printpair_int, printpair_int64): Return bool. 36836 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. 36837 36838 2015-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 36839 36840 mips: print _MIPS_SIM in configure.ac for debug purposes. 36841 * configure.ac [MIPS]: Print _MIPS_SIM. 36842 36843 xtensa: fix several syscall entries. 36844 * linux/xtensa/syscallent.h: Fix nargs in splice, tee, vmsplice, 36845 pselect6, ppoll, epoll_pwait, and set_robust_list syscall entries. 36846 36847 ia64: fix syscall numbers for set_robust_list, get_robust_list, and splice syscalls 36848 * linux/ia64/syscallent.h: Place syscall entries for set_robust_list, 36849 get_robust_list, and splice in correct order. 36850 36851 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 36852 36853 tests: add a test for get_robust_list and set_robust_list decoding. 36854 * tests/xet_robust_list.c: New file. 36855 * tests/xet_robust_list.test: New test. 36856 * tests/Makefile.am (check_PROGRAMS): Add xet_robust_list. 36857 (TESTS): Add xet_robust_list.test. 36858 * tests/.gitignore: Add xet_robust_list. 36859 36860 Simplify printing of get_robust_list first argument. 36861 * get_robust_list.c (sys_get_robust_list): Print first argument 36862 using "%d" format. 36863 36864 2015-08-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 36865 36866 Fix io_setup first argument printing. 36867 * aio.c (sys_io_setup): Print first argument using "%u" format. 36868 36869 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 36870 36871 Fix printing tracee's long integers. 36872 Replace ambiguous printnum_long that used to fetch native long integers 36873 from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong 36874 that fetch tracee's pointer, signed long, and unsigned long integers. 36875 36876 * defs.h (printnum_long, printpair_long): Remove prototypes. 36877 (printnum_int64, printpair_int64): Remove macros, declare functions 36878 unconditionally. 36879 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): 36880 New prototype. 36881 (printnum_ptr, printnum_slong, printnum_ulong): New macros. 36882 * aio.c (sys_io_setup): Use printnum_ulong. 36883 * block.c (block_ioctl): Use printnum_slong and printnum_ulong. 36884 * get_robust_list.c (sys_get_robust_list): Use printnum_ptr 36885 and printnum_ulong. 36886 * io.c (print_off_t): Remove. 36887 (sys_sendfile): Use printnum_ulong. 36888 * ipc.c (sys_semctl): Use printnum_ptr. 36889 * prctl.c (sys_prctl): Likewise. 36890 * process.c (sys_ptrace): Likewise. 36891 * rtc.c (rtc_ioctl): Use printnum_ulong. 36892 * util.c (printnum_long, printpair_long): Remove. 36893 (printnum_int64, printpair_int64): Define unconditionally. 36894 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int): 36895 New function. 36896 36897 2015-08-18 Dmitry V. Levin <ldv (a] altlinux.org> 36898 36899 Fix time syscall decoding for some personalities. 36900 * time.c (current_time_t_is_int32): Define. 36901 (sys_time): Use it, printnum_int, and printnum_int64 instead 36902 of printnum_long. 36903 * tests/time.c: New file. 36904 * tests/time.test: New test. 36905 * tests/Makefile.am (check_PROGRAMS): Add time. 36906 (TESTS): Add time.test. 36907 * tests/.gitignore: Add time. 36908 36909 2015-08-18 Mike Frysinger <vapier (a] gentoo.org> 36910 36911 signal: SIGSYS: decode si_syscall & si_arch fields. 36912 When receiving SIGSYS, the si_syscall & si_arch fields are set to known 36913 values, so make sure we decode their values into the symbol settings. 36914 This makes stracing seccomp failures much easier. 36915 36916 * defs.h (syscall_name): New prototype. 36917 * printsiginfo.c: Include linux/audit.h and xlat/audit_arch.h. 36918 (print_si_info): Decode si_syscall & si_arch for SIGSYS. 36919 * syscall.c (undefined_scno_name): Delete. 36920 (syscall_name): New function. 36921 (trace_syscall_entering): Change undefined_scno_name to syscall_name. 36922 (trace_syscall_exiting): Likewise. 36923 * xlat/audit_arch.in: New file. 36924 36925 2015-08-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 36926 36927 ipc.c: remove unnecesarry #ifdef IPC_64. 36928 * ipc.c (PRINTCTL): Remove #ifdef IPC_64 check as IPC_64 is always 36929 defined at this point. 36930 36931 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 36932 36933 resource.c: move times parser to a separate file. 36934 * times.c: New file. 36935 * Makefile.am (strace_SOURCES): Add it. 36936 * resource.c (sys_times): Move to times.c. 36937 36938 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 36939 36940 sysctl.c: remove KERN_JAVA_* defines handling. 36941 This has been obsoleted by binfmt_misc since Linux 2.1.43. 36942 36943 * sysctl.c (sys_sysctl): Remove KERN_JAVA_INTERPRETER 36944 and KERN_JAVA_APPLETVIEWER. 36945 36946 2015-08-16 Elvira Khabirova <lineprinter0 (a] gmail.com> 36947 36948 sysinfo.c: remove obsolete code. 36949 struct sysinfo members totalhigh, freehigh and mem_unit are present 36950 since Linux 2.3.48. 36951 36952 * configure.ac (AC_CHECK_MEMBERS): Remove struct sysinfo checks. 36953 * sysinfo.c (sys_sysinfo): Remove HAVE_STRUCT_SYSINFO_* checks. 36954 36955 2015-08-15 Gleb Fotengauer-Malinovskiy <glebfm (a] altlinux.org> 36956 36957 tests: add readlink.test and readlinkat.test. 36958 * tests/readlink.c: New file. 36959 * tests/readlink.awk: Likewise. 36960 * tests/readlinkat.c: Likewise. 36961 * tests/readlinkat.awk: Likewise. 36962 * tests/readlink.test: New test. 36963 * tests/readlinkat.test: Likewise. 36964 * tests/Makefile.am (check_PROGRAMS): Add readlink and readlinkat. 36965 (TESTS): Add readlink.test and readlinkat.test. 36966 (EXTRA_DIST): Add readlink.awk and readlinkat.awk. 36967 * tests/.gitignore: Add readlink and readlinkat. 36968 36969 2015-08-09 Dmitry V. Levin <ldv (a] altlinux.org> 36970 36971 Print nanoseconds along with seconds in stat family syscalls. 36972 * configure.ac (AC_CHECK_MEMBERS): Add stat.st_atim.tv_nsec, 36973 stat.st_ctim.tv_nsec, stat.st_mtim.tv_nsec, stat.st_atime_nsec, 36974 stat.st_atime_csec, and stat.st_mtime_nsec. 36975 * file.c: Explicitly define HAVE_STRUCT_STAT_ST_ATIME_NSEC, 36976 HAVE_STRUCT_STAT_ST_CTIME_NSEC and HAVE_STRUCT_STAT_ST_MTIME_NSEC 36977 for locally defined types. 36978 * printstat.h (DO_PRINTSTAT): Print st_atime_nsec, st_ctime_nsec, 36979 and st_mtime_nsec members. 36980 * tests/stat.c [_FILE_OFFSET_BITS == 64]: Use st_atime_nsec, 36981 st_ctime_nsec, and st_mtime_nsec via st_atim.tv_nsec, st_ctim.tv_nsec, 36982 and st_mtim.tv_nsec. 36983 (main): Print st_atime_nsec, st_ctime_nsec, and st_mtime_nsec members. 36984 36985 This fixes Fedora bug #1251176. 36986 36987 2015-08-03 Dmitry V. Levin <ldv (a] altlinux.org> 36988 36989 signalfd4: fix flags decoding. 36990 * configure.ac (AC_CHECK_FUNCS): Add eventfd. 36991 (AC_CHECK_HEADERS): Add sys/signalfd.h. 36992 * signalfd.c: Include <fcntl.h>. 36993 [HAVE_SYS_SIGNALFD_H] Include <sys/signalfd.h>. 36994 Include "xlat/sfd_flags.h". 36995 (do_signalfd): Use sfd_flags for flags decoding. 36996 * xlat/sfd_flags.in: New file. 36997 * tests/signalfd.c: Likewise. 36998 * tests/signalfd.expected: Likewise. 36999 * tests/signalfd.test: New test. 37000 * tests/Makefile.am (check_PROGRAMS): Add signalfd. 37001 (TESTS): Add signalfd.test. 37002 (EXTRA_DIST): Add signalfd.expected. 37003 * tests/.gitignore: Add signalfd. 37004 37005 signalfd, signalfd4: mark return code with RVAL_FD flag. 37006 * signalfd.c (do_signalfd): Set RVAL_FD flag in the return code. 37007 37008 signal.c: move signalfd parsers to a separate file. 37009 * signalfd.c: New file. 37010 * Makefile.am (strace_SOURCES): Add it. 37011 * signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c 37012 37013 perf_event_open: mark return code with RVAL_FD flag. 37014 * perf.c (sys_perf_event_open): Set RVAL_FD flag in the return code. 37015 37016 pipe, pipe2, socketpair: print returned descriptors using printfd. 37017 * net.c (printpair_fd, decode_pair_fd): New functions. 37018 (do_pipe, sys_socketpair): Use them. 37019 37020 socket: mark return code with RVAL_FD flag. 37021 * net.c (sys_socket): Set RVAL_FD flag in the return code. 37022 * tests/net-yy-accept.awk: Update socket and bind regexps. 37023 * tests/unix-yy-accept.awk: Likewise. 37024 * tests/net-yy-connect.awk: Update socket and connect regexps. 37025 * tests/unix-yy-connect.awk: Likewise. 37026 37027 timerfd, timerfd_create: mark return code with RVAL_FD flag. 37028 * time.c (sys_timerfd, sys_timerfd_create): Set RVAL_FD flag 37029 in the return code. 37030 37031 2015-08-02 Dmitry V. Levin <ldv (a] altlinux.org> 37032 37033 inotify_init1: mark return code with RVAL_FD flag. 37034 * inotify.c (sys_inotify_init1): Set RVAL_FD flag in the return code. 37035 37036 fanotify_init: mark return code with RVAL_FD flag. 37037 * fanotify.c (sys_fanotify_init): Set RVAL_FD flag in the return code. 37038 37039 Fix epoll_create syscall decoding. 37040 * epoll.c (sys_epoll_create): New function. 37041 * linux/dummy.h (sys_epoll_create): Remove. 37042 37043 epoll_create1: mark return code with RVAL_FD flag. 37044 * epoll.c (sys_epoll_create1): Set RVAL_FD flag in the return code. 37045 37046 epoll_create1: fix pathtrace support. 37047 * pathtrace.c (pathtrace_match): Add SEN_epoll_create1. 37048 37049 epoll_create1: fix flags decoding. 37050 * xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition 37051 for EPOLL_CLOEXEC. 37052 * tests/epoll_create1.c: New file. 37053 * tests/epoll_create1.expected: Likewise. 37054 * tests/epoll_create1.test: New test. 37055 * tests/Makefile.am (check_PROGRAMS): Add epoll_create1. 37056 (TESTS): Add epoll_create1.test. 37057 (EXTRA_DIST): Add epoll_create1.expected. 37058 * tests/.gitignore: Add epoll_create1. 37059 37060 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 37061 37062 desc.c: move epoll parsers to a separate file. 37063 * epoll.c: New file. 37064 * Makefile.am (strace_SOURCES): Add it. 37065 * desc.c (sys_epoll_create1, print_epoll_event, sys_epoll_ctl, 37066 print_epoll_event_array, epoll_wait_common, epoll_wait, epoll_pwait): 37067 Move to epoll.c. 37068 37069 eventfd2: fix flags decoding. 37070 * configure.ac (AC_CHECK_HEADERS): Add sys/eventfd.h. 37071 * eventfd.c: Include <fcntl.h>. 37072 [HAVE_SYS_EVENTFD_H] Include <sys/eventfd.h>. 37073 Include "xlat/efd_flags.h". 37074 (do_eventfd): Use efd_flags for flags decoding. 37075 * xlat/efd_flags.in: New file. 37076 * tests/eventfd.c: New file. 37077 * tests/eventfd.expected: Likewise. 37078 * tests/eventfd.test: New test. 37079 * tests/Makefile.am (check_PROGRAMS): Add eventfd. 37080 (TESTS): Add eventfd.test. 37081 (EXTRA_DIST): Add eventfd.expected. 37082 * tests/.gitignore: Add eventfd. 37083 37084 eventfd: print first argument as unsigned int. 37085 * eventfd.c (do_eventfd): Explicitly cast initial value to unsigned int. 37086 37087 Mark eventfd return code with RVAL_FD flag. 37088 * eventfd.c (do_eventfd): Set RVAL_FD flag in the return code. 37089 37090 desc.c: move eventfd parsers to a separate file. 37091 * eventfd.c: New file. 37092 * Makefile.am (strace_SOURCES): Add it. 37093 * desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c. 37094 37095 Update PERF_FLAG_* constants. 37096 * xlat/perf_event_open_flags.in: Add PERF_FLAG_FD_CLOEXEC, 37097 provide fallback definitions. 37098 37099 desc.c: move perf_event_open parser to a separate file. 37100 * perf.c: New file. 37101 * Makefile.am (strace_SOURCES): Add it. 37102 * desc.c (sys_perf_event_open): Move to perf.c. 37103 37104 2015-08-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 37105 37106 time.c: remove obsolete code from adjtimex parser. 37107 Linux versions 1.3.28 and below are not supported. 37108 37109 * time.c (tprint_timex) [LINUX_VERSION_CODE < 66332]: Remove. 37110 37111 2015-08-01 Elvira Khabirova <lineprinter0 (a] gmail.com> 37112 37113 ipc.c: move fallback definitions of msg, sem, and shm constants to xlat/ 37114 * ipc.c: Move MSG_STAT and MSG_INFO definitions to xlat/msgctl_flags.in. 37115 Move SHM_STAT and SHM_INFO definitions to xlat/shmctl_flags.in. 37116 Move SEM_STAT and SEM_INFO definitions to xlat/semctl_flags.in. 37117 37118 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 37119 37120 tests/ppoll: replace SIGABRT with SIGHUP. 37121 Use SIGHUP instead of SIGABRT, the number of the former 37122 is more portable across architectures. 37123 37124 * tests/ppoll.c (test2): Replace SIGABRT with SIGHUP. 37125 * tests/ppoll.expected: Update regexp. 37126 * tests/ppoll-v.expected: Likewise. 37127 37128 2015-08-01 Dmitry V. Levin <ldv (a] altlinux.org> 37129 37130 decode_poll_exiting: reserve more space in output buffer. 37131 * poll.c (decode_poll_exiting): Reserve more space in output buffer. 37132 37133 2015-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 37134 37135 Cleanup poll/ppoll decoders. 37136 * poll.c (decode_poll): Split into print_pollfd, decode_poll_entering, 37137 and decode_poll_exiting. 37138 (sys_poll, sys_ppoll): Update callers. 37139 * tests/ppoll.c: New file. 37140 * tests/ppoll.expected: Likewise. 37141 * tests/ppoll-v.expected: Likewise. 37142 * tests/ppoll.test: New test. 37143 * tests/Makefile.am (check_PROGRAMS): Add ppoll. 37144 (TESTS): Add ppoll.test. 37145 (EXTRA_DIST): Add ppoll.expected and ppoll-v.expected. 37146 * tests/.gitignore: Add ppoll. 37147 37148 poll: print timeout argument as int. 37149 * poll.c (sys_poll): Explicitly cast timeout argument to int. 37150 37151 stream.c: move poll and ppoll parsers to a separate file. 37152 * poll.c: New file. 37153 * Makefile.am (strace_SOURCES): Add it. 37154 * stream.c (decode_poll, sys_poll, sys_ppoll): Move to poll.c. 37155 37156 Assume that <poll.h> is available. 37157 * configure.ac (AC_CHECK_HEADERS): Remove poll.h and sys/poll.h. 37158 * pathtrace.c: Include <poll.h> unconditionally. 37159 * stream.c: Likewise. 37160 [HAVE_SYS_POLL_H]: Compile unconditionally. 37161 [!HAVE_SYS_POLL_H]: Remove. 37162 37163 tests: add oldselect.test. 37164 * tests/oldselect.c: New file. 37165 * tests/oldselect.expected: Likewise. 37166 * tests/oldselect.test: New test. 37167 * tests/Makefile.am (check_PROGRAMS): Add oldselect. 37168 (TESTS): Add oldselect.test. 37169 (EXTRA_DIST): Add oldselect.expected. 37170 * tests/.gitignore: Add oldselect. 37171 37172 2015-07-30 Elvira Khabirova <lineprinter0 (a] gmail.com> 37173 37174 Fix oldselect decoding on 64-bit architectures. 37175 As struct sel_arg_struct is an array of 32-bit values, 37176 fetch it using an intermediate array on 64-bit architectures. 37177 37178 * desc.c (sys_oldselect): Rename args to long_args. 37179 [SIZEOF_LONG == 4] Alias oldselect_args to long_args. 37180 [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args. 37181 * linux/sh64/syscallent.h (oldselect): Remove. 37182 37183 2015-07-30 Dmitry V. Levin <ldv (a] altlinux.org> 37184 37185 net.c: use printaddr. 37186 * net.c (printsock, sys_recvfrom): Use printaddr. 37187 37188 2015-07-30 Denys Vlasenko <dvlasenk (a] redhat.com> 37189 37190 net.c: recvfrom fixes. 37191 This change fixes these three problems (before/after is shown): 37192 37193 On interrupted syscall, flags are not decoded: 37194 37195 -recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS 37196 +recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS 37197 37198 If peer address is unavalable (example: anon sockets from socketpair()), 37199 kernel returns socklen of 0, but we ignore that and show bogus sockaddr data: 37200 37201 -recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10 37202 +recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10 37203 37204 SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock(): 37205 37206 - printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]); 37207 + printsock(tcp, tcp->u_arg[4], fromlen); 37208 37209 2015-07-29 Elliott Hughes <enh (a] google.com> 37210 37211 prctl: decode Android-specific PR_SET_VMA. 37212 Android kernels have a prctl to name VMAs. 37213 37214 * prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA. 37215 37216 2015-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 37217 37218 mips: fix stub files. 37219 This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. 37220 37221 * linux/mips/genstub.sh: Output SEN(printargs) instead of printargs. 37222 37223 Reported-by: Elliott Hughes <enh (a] google.com> 37224 37225 2015-07-29 Dmitry V. Levin <ldv (a] altlinux.org> 37226 37227 tests/bpf: fix build with incompatibly old linux/bpf.h and/or gcc. 37228 * configure.ac: Check how union bpf_attr.log_buf initialization works. 37229 * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_LOG_BUF. 37230 37231 Implement sched_getattr and sched_setattr syscalls decoding. 37232 * xlat/sched_flags.in: New file. 37233 * sched.c: Include "xlat/sched_flags.h". 37234 (print_sched_attr, sys_sched_setattr, sys_sched_getattr): New functions. 37235 * linux/dummy.h (sys_sched_getattr, sys_sched_setattr): Remove. 37236 * tests/sched_xetattr.c: New file. 37237 * tests/sched_xetattr.test: New test. 37238 * tests/Makefile.am (check_PROGRAMS): Add sched_xetattr. 37239 (TESTS): Add sched_xetattr.test. 37240 * tests/.gitignore: Add sched_xetattr. 37241 37242 Implement memfd_create syscall decoding. 37243 * memfd_create.c: New file. 37244 * Makefile.am (strace_SOURCES): Add it. 37245 * linux/dummy.h (sys_memfd_create): Remove. 37246 * pathtrace.c (pathtrace_match): Add SEN_memfd_create. 37247 * xlat/memfd_create_flags.in: New file. 37248 * tests/memfd_create.c: New file. 37249 * tests/memfd_create.expected: Likewise. 37250 * tests/memfd_create.test: New test. 37251 * tests/Makefile.am: (check_PROGRAMS): Add memfd_create. 37252 (TESTS): Add memfd_create.test. 37253 (EXTRA_DIST): Add memfd_create.expected. 37254 * tests/.gitignore: Add memfd_create. 37255 37256 2015-07-28 Elliott Hughes <enh (a] google.com> 37257 37258 Fix builds where HAVE_MQUEUE_H isn't defined. 37259 Android doesn't have <mqueue.h>. 37260 37261 * ipc.c (sys_mq_open) [!HAVE_MQUEUE_H]: Fix printaddr invocation. 37262 37263 2015-07-27 Dmitry V. Levin <ldv (a] altlinux.org> 37264 37265 tests/restart_syscall: skip if nanosleep looks uninterrupted. 37266 * tests/restart_syscall.test: Skip if restart_syscall is not detected 37267 and nanosleep syscall looks uninterrupted. 37268 37269 Implement execveat syscall decoding. 37270 * execve.c (decode_execve): New function. 37271 (sys_execve): Use it. 37272 (sys_execveat): New function. 37273 * linux/dummy.h (sys_execveat): Remove. 37274 * tests/execveat.c: New file. 37275 * tests/execveat.expected: Likewise. 37276 * tests/execveat-v.expected: Likewise. 37277 * tests/execveat.test: New test. 37278 * tests/Makefile.am (check_PROGRAMS): Add execveat. 37279 (TESTS): Add execveat.test. 37280 (EXTRA_DIST): Add execveat.expected and execveat-v.expected. 37281 * tests/.gitignore: Add execveat. 37282 37283 execve: fix support of personalities with different word size. 37284 * execve.c (printargc): Do not assume that host and target pointers have 37285 the same size. 37286 * tests/execve.c: New file. 37287 * tests/execve.expected: Likewise. 37288 * tests/execve-v.expected: Likewise. 37289 * tests/execve.test: New test. 37290 * tests/Makefile.am (check_PROGRAMS): Add execve. 37291 (TESTS): Add execve.test. 37292 (EXTRA_DIST): Add execve.expected and execve-v.expected. 37293 * tests/.gitignore: Add execve. 37294 37295 Implement bpf syscall decoding. 37296 * bpf.c: New file. 37297 * Makefile.am (strace_SOURCES): Add it. 37298 * configure.ac (AC_CHECK_HEADERS): Add linux/bpf.h. 37299 * linux/dummy.h (sys_bpf): Remove. 37300 * pathtrace.c (pathtrace_match): Add SEN_bpf. 37301 * xlat/bpf_commands.in: New file. 37302 * xlat/bpf_map_types.in: New file. 37303 * xlat/bpf_map_update_elem_flags.in: New file. 37304 * xlat/bpf_prog_types.in: New file. 37305 * tests/bpf.c: New file. 37306 * tests/bpf.test: New test. 37307 * tests/Makefile.am (check_PROGRAMS): Add bpf. 37308 (TESTS): Add bpf.test. 37309 * tests/.gitignore: Add bpf. 37310 37311 2015-07-25 Dmitry V. Levin <ldv (a] altlinux.org> 37312 37313 prctl: fix decoding of unrecognized commands. 37314 The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong: 37315 when the first argument is already printed, printargs cannot be called. 37316 37317 * prctl.c (print_prctl_args): New function. 37318 (sys_prctl): Use it. 37319 37320 2015-07-23 Dmitry V. Levin <ldv (a] altlinux.org> 37321 37322 Macroize -m32/-mx32 configure checks. 37323 Prepare for additional configure checks that would be needed 37324 for new multiple personalities support. 37325 37326 * m4/mpers.m4: New file. 37327 * configure.ac: Use it. 37328 37329 2015-07-22 Dmitry V. Levin <ldv (a] altlinux.org> 37330 37331 tests/uid: import uid overflow check from tests/uid16. 37332 * tests/uid.c (main): Skip if the uid returned by getuid matches 37333 /proc/sys/kernel/overflowuid. 37334 37335 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 37336 37337 sh64: fix inotify_{add,rm}_watch syscall entries. 37338 * linux/sh64/syscallent.h (inotify_add_watch, inotify_rm_watch): 37339 Set sys_func. 37340 37341 microblaze: fix several syscall entries. 37342 * linux/microblaze/syscallent.h (signalfd4, eventfd2, epoll_create1, 37343 dup3, pipe2, inotify_init1, recvmmsg): Set sys_func. 37344 37345 hppa: fix several syscall entries. 37346 * linux/hppa/syscallent.h (remap_file_pages, mq_open, mq_unlink, 37347 mq_timedsend, mq_timedreceive, mq_notify, mq_getsetattr, 37348 clock_nanosleep, signalfd, timerfd): Set sys_func. 37349 37350 ia64: fix getpagesize syscall entry. 37351 * linux/ia64/syscallent.h (getpagesize): Fux nargs. 37352 37353 avr32: fix fstatat64 syscall entry. 37354 * linux/avr32/syscallent.h (fstatat64): Set sys_func. 37355 37356 alpha: fix 2 dummy osf syscall entries. 37357 * linux/alpha/syscallent.h (osf_set_program_attributes): Fix nargs. 37358 (osf_sigstack): Fix nargs and sys_name. 37359 37360 alpha, arm, ia64, mips, sh64: fix semop syscall entries. 37361 * linux/alpha/syscallent.h (semop): Fix nargs, set sys_func. 37362 * linux/ia64/syscallent.h (semop): Set sys_func. 37363 * linux/mips/syscallent-n32.h (semop): Likewise. 37364 * linux/mips/syscallent-n64.h (semop): Likewise. 37365 * linux/arm/syscallent.h (semop): Fix nargs. 37366 * linux/sh64/syscallent.h (semop): Likewise. 37367 37368 m68k: fix getpagesize decoding. 37369 * linux/m68k/syscallent.h (getpagesize): Set sys_func. 37370 * mem.c [M68K] (sys_getpagesize): Define. 37371 37372 tests/ip_mreq: skip if basic setsockopt operations fail. 37373 * tests/ip_mreq.c (main): Return 77 if basic 37374 IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP options cannot be set. 37375 37376 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 37377 37378 tests: use -lpthread instead of -pthread. 37379 On some obscure systems, -lpthread is more likely to work than -pthread. 37380 37381 * tests/Makefile.am (filter_unavailable_LDFLAGS): Rename to 37382 filter_unavailable_LDADD and change to -lpthread. 37383 37384 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 37385 37386 mips o32: fix utimensat syscall entry. 37387 * linux/mips/syscallent-o32.h (utimensat): set sys_flags and sys_func. 37388 37389 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 37390 37391 linux/mips/syscallent-compat.h: use designated initializers. 37392 Change linux/mips/syscallent-compat.h to use designated initializers 37393 like normal syscallent.h files. 37394 37395 * linux/mips/syscallent-compat.h: Use designated initializers. 37396 37397 2015-07-21 Dmitry V. Levin <ldv (a] altlinux.org> 37398 37399 linux/mips/syscallent-compat.h: fix initalization of empty entries. 37400 This complements commit 140ecf876686d49085c6eb3a2306e2ea6ea641bc. 37401 37402 * linux/mips/syscallent-compat.h: Fix initalization of empty entries. 37403 37404 2015-07-20 Dmitry V. Levin <ldv (a] altlinux.org> 37405 37406 Remove unused parsers of getmsg and putmsg. 37407 * stream.c [SPARC || SPARC64] (sys_putmsg, sys_getmsg): Remove. 37408 Stop including "xlat/msgflags.h". 37409 * xlat/msgflags.in: Remove. 37410 37411 sigreturn: make use of RVAL_DECODED. 37412 * sigreturn.c (arch_sigreturn): New function. 37413 (sys_sigreturn): Use it. Return RVAL_DECODED. 37414 * linux/alpha/arch_sigreturn.c: Update. 37415 * linux/crisv10/arch_sigreturn.c: Likewise. 37416 * linux/m68k/arch_sigreturn.c: Likewise. 37417 * linux/microblaze/arch_sigreturn.c: Likewise. 37418 * linux/x86_64/arch_sigreturn.c: Likewise. 37419 37420 or1k_atomic.c: make use of RVAL_DECODED. 37421 * or1k_atomic.c (sys_or1k_atomic): Update for RVAL_DECODED. 37422 37423 Update openat parser for the RVAL_DECODED change. 37424 * open.c (sys_openat): Update for RVAL_DECODED. 37425 37426 bjm.c: make use of RVAL_DECODED. 37427 * bjm.c (sys_create_module, sys_delete_module, sys_init_module, 37428 sys_finit_module): Update for RVAL_DECODED. 37429 37430 access.c: make use of RVAL_DECODED. 37431 * access.c (decode_access, sys_faccessat): Update for RVAL_DECODED. 37432 37433 affinity.c: make use of RVAL_DECODED. 37434 * affinity.c (sys_sched_setaffinity): Update for RVAL_DECODED. 37435 37436 affinity.c: use printaddr and umove_or_printaddr. 37437 * affinity.c (print_affinitylist): Use printaddr and umove_or_printaddr. 37438 (sys_sched_getaffinity): Remove redundant u_rval check. 37439 37440 aio.c: enhance io_* syscalls decoding. 37441 * aio.c (sys_io_setup): Use printnum_int64 and printnum_long. 37442 (sys_io_destroy, sys_io_submit): Update for RVAL_DECODED. 37443 (sys_io_submit): Use umove_or_printaddr and printaddr. 37444 Enclose iocb array in square brackets. 37445 Change to traditional structure output format. 37446 (print_io_event): New function. 37447 (sys_io_cancel, sys_io_getevents): Use it. 37448 (sys_io_cancel): Use umove_or_printaddr and printaddr. 37449 (sys_io_getevents): Use printaddr. 37450 37451 cacheflush.c: make use of RVAL_DECODED. 37452 * cacheflush.c (sys_cacheflush): Update for RVAL_DECODED. 37453 37454 cacheflush.c: use printaddr. 37455 * cacheflush.c (sys_cacheflush): Use printaddr. 37456 37457 capability.c: make use of RVAL_DECODED. 37458 * capability.c (sys_capset): Update for RVAL_DECODED. 37459 37460 capability.c: use printaddr and umove_or_printaddr. 37461 * capability.c (get_cap_header): Use printaddr. 37462 (print_cap_data): Use printaddr and umove_or_printaddr. 37463 37464 chdir.c: make use of RVAL_DECODED. 37465 * chdir.c (sys_chdir): Update for RVAL_DECODED. 37466 37467 chmod.c: make use of RVAL_DECODED. 37468 * chmod.c (decode_chmod): Change to return void. 37469 (sys_chmod, sys_fchmodat): Update callers. Update for RVAL_DECODED. 37470 (sys_fchmod): Update for RVAL_DECODED. 37471 37472 clone.c: make use of RVAL_DECODED. 37473 * clone.c (sys_setns, sys_unshare, sys_fork): Update for RVAL_DECODED. 37474 37475 Alias sys_epoll_create to printargs_ld. 37476 * desc.c (sys_epoll_create): Remove. 37477 * linux/dummy.h (sys_epoll_create): Alias to printargs_ld. 37478 37479 desc.c: make use of RVAL_DECODED. 37480 * desc.c (sys_flock, sys_close, sys_dup, do_dup2, sys_epoll_create1, 37481 sys_epoll_ctl, do_eventfd, sys_perf_event_open): Update 37482 for RVAL_DECODED. 37483 37484 desc.c: do not use xmalloc, use umove_or_printaddr and printaddr. 37485 * desc.c (printflock64, printflock): Use umove_or_printaddr. 37486 (decode_select): Do not use xmalloc. Use umoven_or_printaddr 37487 and printaddr. 37488 (sys_oldselect): Use printaddr. 37489 (sys_epoll_ctl): Use umoven_or_printaddr and printaddr. 37490 (print_epoll_event_array): New function. 37491 (sys_epoll_wait_common): Use it. 37492 (sys_pselect6): Use umove_or_printaddr. 37493 (sys_eventfd2): Use printaddr. 37494 37495 xlat/epollctls.in: add default values. 37496 * xlat/epollctls.in (EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD): Add 37497 default values. 37498 37499 dirent.c: do not use xmalloc. 37500 * dirent.c (print_old_dirent): Use umove_or_printaddr. 37501 (sys_readdir): Use printaddr. 37502 (sys_getdents, sys_getdents64): Do not use xmalloc for dirents, 37503 treat malloc failure the same way as umoven failure. Use printaddr. 37504 37505 execve.c: make use of RVAL_DECODED. 37506 * execve.c (sys_execve, sys_execv): Update for RVAL_DECODED. 37507 37508 execve.c: use printaddr and umove_or_printaddr. 37509 * execve.c (printargv): Use umoven_or_printaddr. 37510 (sys_execve, sys_execv): Use printaddr. 37511 37512 fadvise.c: make use of RVAL_DECODED. 37513 * fadvise.c (sys_fadvise64, sys_fadvise64_64): Update for RVAL_DECODED. 37514 37515 fallocate.c: make use of RVAL_DECODED. 37516 * fallocate.c (sys_fallocate): Update for RVAL_DECODED. 37517 37518 fanotify.c: make use of RVAL_DECODED. 37519 * fanotify.c (sys_fanotify_init, sys_fanotify_mark): Update 37520 for RVAL_DECODED. 37521 37522 fchownat.c: make use of RVAL_DECODED. 37523 * fchownat.c (sys_fchownat): Update for RVAL_DECODED. 37524 37525 file.c: use umove_or_printaddr. 37526 * file.c (printstat32, printstatsol): Remove. 37527 (printstat, printstat64, printoldstat): Use umove_or_printaddr. 37528 37529 futex.c: enhance futex syscall decoding. 37530 * futex.c (sys_futex): Use switch statement. Use printaddr. 37531 Print uint32_t syscall arguments using %u format. 37532 Update for RVAL_DECODED. 37533 37534 get_robust_list.c: use printnum_long. 37535 * get_robust_list.c (sys_get_robust_list): Use printnum_long. 37536 37537 getcpu.c: use printnum_int and printaddr. 37538 * getcpu.c (sys_getcpu): Use printnum_int and printaddr. 37539 37540 getcwd.c: use printaddr. 37541 * getcwd.c (sys_getcwd): Use printaddr. 37542 37543 getrandom.c: use printaddr. 37544 * getrandom.c (sys_getrandom): Use printaddr. 37545 37546 hostname.c: make use of RVAL_DECODED. 37547 * hostname.c (sys_sethostname): Update for RVAL_DECODED. 37548 37549 hostname.c: use printaddr. 37550 * hostname.c (sys_gethostname): Use printaddr. 37551 37552 inotify.c: make use of RVAL_DECODED. 37553 * inotify.c (sys_inotify_add_watch, sys_inotify_rm_watch, 37554 sys_inotify_init1): Update for RVAL_DECODED. 37555 37556 io.c: make use of RVAL_DECODED. 37557 * io.c (sys_write, sys_writev, sys_pwrite, sys_pwritev, sys_sendfile, 37558 sys_sendfile64, sys_tee, sys_splice, sys_vmsplice): Update 37559 for RVAL_DECODED. 37560 37561 Use printnum_int64 instead of print_loff_t. 37562 * defs.h (print_loff_t): Remove. 37563 * io.c (print_loff_t): Remove. 37564 (sys_sendfile64, sys_splice): Use printnum_int64 instead of print_loff_t. 37565 * mtd.c (mtd_ioctl): Likewise. 37566 37567 io.c: use printaddr and umove_or_printaddr. 37568 * io.c (sys_read, sys_pread): Use printaddr. 37569 (tprint_iov_upto): Do not fetch data in case of syserror. 37570 Use printaddr. 37571 (sys_readv, sys_preadv): Remove redundant check for syserror. 37572 (print_off_t): Use printnum_int and printnum_long. 37573 (print_loff_t): Use umove_or_printaddr. 37574 37575 ioprio.c: make use of RVAL_DECODED. 37576 * ioprio.c (sys_ioprio_set): Update for RVAL_DECODED. 37577 37578 ipc.c: use printaddr and umove_or_printaddr. 37579 * ipc.c (sys_msgctl): Use printaddr. 37580 (tprint_msgbuf): New function. 37581 (tprint_msgsnd, tprint_msgrcv): Use it. 37582 (sys_msgrcv): Use umove_or_printaddr. 37583 (tprint_sembuf): Rename to tprint_sembuf_array. 37584 (tprint_sembuf): New function. 37585 (tprint_sembuf_array): Use it. 37586 (sys_semop, sys_semtimedop): Update callers. 37587 (sys_shmctl, sys_shmat, sys_shmdt): Use printaddr. 37588 (sys_mq_open, printmqattr): Use printaddr and umove_or_printaddr. 37589 * tests/ipc_msg.c (main): Update msgctl IPC_RMID regexp. 37590 * tests/ipc_shm.c (main): Update shmctl IPC_RMID regexp. 37591 37592 kexec.c: use printaddr and umove_or_printaddr. 37593 * kexec.c (print_seg): New function. 37594 (print_kexec_segments): Use it. Use printaddr and umove_or_printaddr. 37595 (kexec_load): Use printaddr. Update for RVAL_DECODED. 37596 37597 keyctl.c: make use of RVAL_DECODED. 37598 * keyctl.c (sys_add_key, sys_request_key): Update for RVAL_DECODED. 37599 (keyctl_join_session_keyring, keyctl_handle_key, 37600 keyctl_set_reqkey_keyring): Remove. 37601 (keyctl_get_keyring_id, keyctl_update_key, keyctl_handle_key_key, 37602 keyctl_read_key, keyctl_keyring_search, keyctl_chown_key, 37603 keyctl_instantiate_key, keyctl_instantiate_key_iov, keyctl_negate_key, 37604 keyctl_reject_key, keyctl_set_timeout, keyctl_get_persistent, 37605 keyctl_setperm_key): Change to return void. 37606 Update for RVAL_DECODED. 37607 (sys_keyctl): Update callers. Update for RVAL_DECODED. 37608 37609 keyctl.c: use printaddr. 37610 * keyctl.c (keyctl_read_key): Use printaddr. 37611 37612 ldt.c: make use of RVAL_DECODED. 37613 * ldt.c (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): 37614 Update for RVAL_DECODED. 37615 37616 ldt.c: use printaddr and umove_or_printaddr. 37617 * ldt.c [I386 || X86_64 || X32] (print_user_desc): 37618 Use umove_or_printaddr. 37619 [I386 || X86_64 || X32] (sys_modify_ldt): Use printaddr. 37620 [(M68K || MIPS] (set_thread_area): Likewise. 37621 [I386 || X86_64 || X32] (set_thread_area): Do not fetch data 37622 if !verbose. 37623 [I386 || X86_64 || X32] (get_thread_area): Remove redundant check 37624 for syserror. 37625 37626 link.c: make use of RVAL_DECODED. 37627 * link.c (sys_link, sys_linkat, sys_unlinkat, sys_symlinkat): Update 37628 for RVAL_DECODED. 37629 37630 lseek.c: make use of RVAL_DECODED. 37631 * lseek.c (sys_lseek): Update for RVAL_DECODED. 37632 37633 lseek.c: use printnum_int64. 37634 * lseek.c (sys_llseek): Use printnum_int64. 37635 37636 mem.c: make use of RVAL_DECODED. 37637 * mem.c (print_mmap): Change to return void. 37638 Update for RVAL_DECODED. 37639 (sys_old_mmap, sys_old_mmap_pgoff, sys_mmap, sys_mmap_pgoff, 37640 sys_mmap_4koff): Update callers. Update for RVAL_DECODED. 37641 (sys_brk, sys_munmap, sys_mprotect, sys_mremap, sys_madvise, 37642 sys_mlockall, sys_msync, sys_remap_file_pages, sys_mbind, 37643 sys_set_mempolicy, sys_migrate_pages, [POWERPC] subpage_prot): 37644 Update for RVAL_DECODED. 37645 37646 mem.c: use printaddr and umove_or_printaddr. 37647 * mem.c (sys_brk, print_mmap, sys_munmap, sys_mprotect, sys_mremap, 37648 sys_madvise, sys_msync, sys_mincore, sys_remap_file_pages, get_nodes, 37649 sys_mbind, [POWERPC] sys_subpage_prot): Use printaddr. 37650 (sys_get_mempolicy): Use printaddr and umove_or_printaddr. 37651 37652 mknod.c: make use of RVAL_DECODED. 37653 * mknod.c (decode_mknod): Change to return void. 37654 Update for RVAL_DECODED. 37655 (sys_mknod, sys_mknodat): Update callers. Update for RVAL_DECODED. 37656 [SPARC || SPARC64] (xmknod): Update for RVAL_DECODED. 37657 37658 mount.c: make use of RVAL_DECODED. 37659 * mount.c (sys_mount): Update for RVAL_DECODED. 37660 37661 mount.c: use printaddr. 37662 * mount.c (sys_mount): Use printaddr. 37663 37664 Alias sys_connect to sys_bind. 37665 * linux/dummy.h (sys_connect): Alias to sys_bind. 37666 * net.c (sys_connect): Remove. 37667 37668 net.c: make use of RVAL_DECODED. 37669 * net.c (sys_socket, sys_bind, sys_listen, sys_send, sys_sendto, 37670 sys_sendmsg, sys_shutdown, sys_setsockopt): Update for RVAL_DECODED. 37671 37672 net.c: use printaddr and umove_or_printaddr. 37673 * net.c (printsock): Use printaddr and umove_or_printaddr. 37674 (printcmsghdr, printmsghdr, printmmsghdr, decode_mmsg, do_sockname, 37675 sys_recv, sys_recvfrom, sys_recvmsg, do_pipe, print_linger, print_ucred, 37676 print_tpacket_stats, print_icmp_filter, print_getsockopt, 37677 print_group_req, print_tpacket_req, print_packet_mreq, 37678 print_setsockopt): Use printaddr. 37679 (print_mreq, print_mreq6): Use umove_or_printaddr. 37680 37681 2015-07-18 Elvira Khabirova <lineprinter0 (a] gmail.com> 37682 37683 tests: add sigaltstack.test. 37684 * tests/sigaltstack.c: New file. 37685 * tests/sigaltstack.expected: Likewise. 37686 * tests/sigaltstack.test: New test. 37687 * tests/Makefile.am (check_PROGRAMS): Add sigaltstack. 37688 (TESTS): Add sigaltstack.test. 37689 (EXTRA_DIST): sigaltstack.expected. 37690 * tests/.gitignore: Add sigaltstack. 37691 37692 bootstrap: delete personality test directories beforehand. 37693 * bootstrap: Delete tests-m32 and tests-mx32 directories 37694 before creating them. 37695 37696 2015-07-18 Dmitry V. Levin <ldv (a] altlinux.org> 37697 37698 defs.h: do not include <signal.h> 37699 * printsiginfo.h: New file. 37700 * Makefile.am (strace_SOURCES): Add it. 37701 * defs.h: Do not include <signal.h>. 37702 (printsiginfo): Remove. 37703 * printsiginfo.c: Include <signal.h> and "printsiginfo.h". 37704 * strace.c: Likewise. 37705 * sigaltstack.c: Include <signal.h>. 37706 * signal.c: Likewise. 37707 * sigreturn.c: Likewise. 37708 * time.c: Likewise. 37709 37710 resource.c: move printrusage and printrusage32 to a separate file. 37711 * printrusage.c: New file. 37712 * Makefile.am (strace_SOURCES): Add it. 37713 * resource.c (printrusage, [ALPHA] printrusage32): Move 37714 to printrusage.c. 37715 37716 open.c: make use of RVAL_DECODED. 37717 * open.c (decode_open, sys_creat): Update for RVAL_DECODED. 37718 37719 personality.c: make use of RVAL_DECODED. 37720 * personality.c (sys_personality): Update for RVAL_DECODED. 37721 37722 printsiginfo.c: use umove_or_printaddr. 37723 * printsiginfo.c (printsiginfo_at): Use umove_or_printaddr. 37724 37725 prctl.c: make use of RVAL_DECODED. 37726 * prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl. 37727 (sys_prctl, sys_arch_prctl): Update for RVAL_DECODED. 37728 37729 prctl.c: use printaddr and umove_or_printaddr. 37730 * prctl.c (prctl_exit): Use printaddr and umove_or_printaddr. 37731 37732 process.c: use printaddr. 37733 * process.c (sys_ptrace): Use printaddr. 37734 37735 process_vm.c: make use of RVAL_DECODED. 37736 * process_vm.c (sys_process_vm_writev): Update for RVAL_DECODED. 37737 37738 process_vm.c: use printaddr. 37739 * process_vm.c (sys_process_vm_readv): Use printaddr. 37740 37741 reboot.c: make use of RVAL_DECODED. 37742 * reboot.c (sys_reboot): Update for RVAL_DECODED. 37743 37744 Enhance quotactl decoding. 37745 * quota.c (decode_cmd_data): Use umove_or_printaddr. 37746 (sys_quotactl): Do not disable the parser in verbose mode. 37747 Decode all "set" commands on entering syscall. 37748 37749 readahead.c: make use of RVAL_DECODED. 37750 * readahead.c (sys_readahead.c): Update for RVAL_DECODED. 37751 37752 readlink.c: use printaddr. 37753 * readlink.c (decode_readlink): Use printaddr. 37754 37755 renameat.c: make use of RVAL_DECODED. 37756 * renameat.c (sys_renameat, sys_renameat2): Update for RVAL_DECODED. 37757 37758 resource.c: make use of RVAL_DECODED. 37759 * resource.c (sys_setrlimit, sys_getpriority, sys_setpriority): 37760 Update for RVAL_DECODED. 37761 37762 resource.c: use umove_or_printaddr. 37763 * resource.c (print_rlimit64, print_rlimit32, printrusage32, 37764 printrusage, sys_times): Use umove_or_printaddr. 37765 (decode_rlimit64): Remove. 37766 (decode_rlimit): Remove redundant checks. 37767 [defined(current_wordsize) && current_wordsize != 4] (decode_rlimit): 37768 Define to print_rlimit64. 37769 (sys_prlimit64): Replace decode_rlimit64 with print_rlimit64. 37770 37771 sched.c: make use of RVAL_DECODED. 37772 * sched.c (sys_sched_setscheduler, sys_sched_setparam, 37773 sys_sched_get_priority_min): Update for RVAL_DECODED. 37774 37775 sched.c: use printnum_int and printaddr. 37776 * sched.c (sys_sched_setscheduler, sys_sched_getparam, 37777 sys_sched_setparam): Use printnum_int for sched_param decoding. 37778 (sched_rr_get_interval): Use printaddr. 37779 37780 scsi.c: use printaddr. 37781 * scsi.c (print_sg_io_buffer): Use printaddr. 37782 37783 2015-07-17 Dmitry V. Levin <ldv (a] altlinux.org> 37784 37785 seccomp.c: make use of RVAL_DECODED. 37786 * seccomp.c (sys_seccomp): Update for RVAL_DECODED. 37787 37788 seccomp.c: use printaddr and umove_or_printaddr. 37789 * seccomp.c (decode_fprog, decode_seccomp_set_mode_strict): 37790 Use printaddr. 37791 (print_seccomp_filter): Use umove_or_printaddr. 37792 37793 sigaltstack.c: use printaddr and umove_or_printaddr. 37794 * sigaltstack.c (print_stack_t): Use umove_or_printaddr and printaddr. 37795 37796 signal.c: make use of RVAL_DECODED. 37797 * signal.c (sys_sigsuspend, sys_kill, sys_tgkill, sys_rt_sigsuspend, 37798 sys_rt_sigqueueinfo, sys_rt_tgsigqueueinfo, sys_restart_syscall, 37799 do_signalfd): Update for RVAL_DECODED. 37800 37801 signal.c: use printaddr and umove_or_printaddr. 37802 * signal.c (print_sigset_addr_len, decode_old_sigaction): 37803 Use printaddr and umove_or_printaddr. 37804 (sys_signal): Use printaddr. 37805 (sys_sigprocmask, sys_sigpending, sys_rt_sigprocmask, 37806 sys_rt_sigpending): Remove redundant checks for syserror. 37807 (decode_new_sigaction): Use umove_or_printaddr. 37808 37809 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 37810 37811 sram_alloc.c: make use of RVAL_DECODED. 37812 * sram_alloc.c [BFIN] (sys_sram_alloc): Update for RVAL_DECODED. 37813 37814 statfs.c: use umove_or_printaddr. 37815 * statfs.c (printstatfs, printstatfs64, printcompat_statfs64): 37816 Use umove_or_printaddr. 37817 37818 swapon.c: make use of RVAL_DECODED. 37819 * swapon.c (sys_swapon): Update for RVAL_DECODED. 37820 37821 swapon.c: move fallback definitions of swap options to xlat/ 37822 * swapon.c: Move definitions of SWAP_FLAG_* flags ... 37823 * xlat/swap_flags.in: ... here. 37824 37825 sync_file_range2: fix typo in flags decoding. 37826 * sync_file_range.c (sys_sync_file_range2): Fix typo in flags decoding. 37827 37828 sync_file_range.c: make use of RVAL_DECODED. 37829 * sync_file_range.c (sys_sync_file_range, sys_sync_file_range2): Update 37830 for RVAL_DECODED. 37831 37832 syslog.c: use umove_or_printaddr and RVAL_DECODED. 37833 * sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED. 37834 37835 sysinfo.c: use umove_or_printaddr. 37836 * sysinfo.c (sys_sysinfo): Use umove_or_printaddr. 37837 37838 syslog.c: make use of RVAL_DECODED. 37839 * syslog.c (sys_syslog): Update for RVAL_DECODED. 37840 37841 syslog.c: use printaddr. 37842 * syslog.c (sys_syslog): Use printaddr. 37843 37844 sysmips.c: cleanup. 37845 * sysmips.c [MIPS] (sys_sysmips): Use switch statement. Use printaddr. 37846 Fix misprinted ", " delimiter. 37847 37848 sysmips.c: make use of RVAL_DECODED. 37849 * sysmips.c [MIPS] (sys_sysmips): Update for RVAL_DECODED. 37850 37851 time.c: make use of RVAL_DECODED. 37852 * time.c (sys_settimeofday, sys_osf_settimeofday, sys_clock_settime, 37853 sys_timerfd, sys_timerfd_create, sys_timerfd_settime): Update 37854 for RVAL_DECODED. 37855 (timerfd_gettime): Decode struct itimerspec argument on exiting syscall. 37856 37857 time.c: use printaddr, printnum_int, and umoven_or_printaddr. 37858 * time.c (sys_nanosleep): Use printaddr. 37859 (printitv_bitness, tprint_timex32, tprint_timex, printsigevent32, 37860 printsigevent): Use umoven_or_printaddr. 37861 (sys_timer_create): Use printnum_int. 37862 (sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer, 37863 do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove 37864 redundant checks for syserror. 37865 37866 sprinttv: do not fetch data in case of syserror. 37867 * time.c (sprinttv): Do not fetch data in case syserror. 37868 Print address instead of {...} in case of umove failure. 37869 (sys_gettimeofday, sys_osf_gettimeofday, sys_adjtime, sys_clock_gettime, 37870 clock_nanosleep): Remove now redundant checks for syserror. 37871 37872 truncate.c: make use of RVAL_DECODED. 37873 * truncate.c (sys_truncate, sys_truncate64, sys_ftruncate, 37874 sys_ftruncate64): Update for RVAL_DECODED. 37875 37876 umask.c: make use of RVAL_DECODED. 37877 * umask.c (sys_umask): Update for RVAL_DECODED. 37878 37879 umount.c: make use of RVAL_DECODED. 37880 * umount.c (sys_umount2): Update for RVAL_DECODED. 37881 37882 utimes.c: make use of RVAL_DECODED. 37883 * utimes.c (decode_utimes): Change to return void. 37884 Update for RVAL_DECODED. 37885 (sys_utimes, sys_futimesat, sys_utimensat, sys_osf_utimes): 37886 Update callers. Update for RVAL_DECODED. 37887 37888 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 37889 37890 tests/uid.test: adopt for alpha. 37891 Make the test work on alpha that has getxuid syscall instead of getuid. 37892 37893 * tests/uid.awk (BEGIN): Update getuid regexp to match both getuid 37894 and getxuid syscalls. 37895 * tests/uid.c (main): Allow __NR_getxuid as an alternative 37896 to __NR_getuid. 37897 * tests/uid.test: If getuid syscall is not available, probe for 37898 getxuid syscall. 37899 37900 2015-07-16 Dmitry V. Levin <ldv (a] altlinux.org> 37901 37902 uid.c: make use of RVAL_DECODED. 37903 * uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown, 37904 sys_setgroups): Update for RVAL_DECODED. 37905 37906 uid.c: use printaddr and umoven_or_printaddr. 37907 * uid.c (get_print_uid): Use umoven_or_printaddr. 37908 (sys_getresuid): Do not check for syserror, get_print_uid now does 37909 the right thing. 37910 (sys_setgroups, sys_getgroups): Add const qualifier to local variables 37911 that are assigned once. Use printaddr. 37912 37913 ia64: wire up utimensat syscall. 37914 * linux/ia64/syscallent.h (utimensat): New entry. 37915 37916 decode_utimes: enclose timespec array in square brackets. 37917 * utimes.c (decode_utimes): enclose timespec array in square brackets 37918 instead of curly brackets. 37919 37920 uname.c: use umove_or_printaddr. 37921 * uname.c (sys_uname): Use umove_or_printaddr. 37922 37923 tests: add utime.test. 37924 * tests/utime.c: New file. 37925 * tests/utime.test: New test. 37926 * tests/Makefile.am (check_PROGRAMS): Add utime. 37927 (TESTS): Add utime.test. 37928 * tests/.gitignore: Add utime. 37929 37930 utime.c: make use of RVAL_DECODED. 37931 * utime.c (sys_utime): Update for RVAL_DECODED. 37932 37933 utime.c: use umoven_or_printaddr. 37934 * utime.c (sys_utime): Use umoven_or_printaddr. 37935 37936 2015-07-15 Dmitry V. Levin <ldv (a] altlinux.org> 37937 37938 wait.c: use printaddr and umove_or_printaddr. 37939 * wait.c (waitid): Do not check for NULL the address passed 37940 to printrusage. 37941 (printwaitn): Likewise. 37942 Use printaddr and umove_or_printaddr for fetching wait status. 37943 37944 wait: move fallback definitions of wait options to xlat/ 37945 * wait.c: Move definitions of __W* flags ... 37946 * xlat/wait4_options.in: ... here. 37947 37948 tests: add xattr.test. 37949 * tests/xattr.c: New file. 37950 * tests/xattr.expected: Likewise. 37951 * tests/xattr.test: New test. 37952 * tests/Makefile.am (check_PROGRAMS): Add xattr. 37953 (TESTS): Add xattr.test. 37954 (EXTRA_DIST): Add xattr.expected. 37955 * tests/.gitignore: Add xattr. 37956 37957 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 37958 37959 xattr.c: make use of RVAL_DECODED. 37960 * xattr.c (sys_setxattr, sys_fsetxattr, sys_removexattr, 37961 sys_fremovexattr): Update for RVAL_DECODED. 37962 37963 print_xattr_val: do not fetch data in case of !verbose || syserror. 37964 * xattr.c (print_xattr_val): Do not fetch data in case 37965 of !verbose || syserror. Use printaddr. 37966 37967 print_xattr_list: use printaddr. 37968 * xattr.c (print_xattr_list): Use printaddr. 37969 37970 print_xattr_val: remove unused argument. 37971 * xattr.c (print_xattr_val): Remove unused "failed" argument. 37972 (sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Update 37973 all callers. 37974 37975 print_xattr_list: remove redundant address check. 37976 * xattr.c (print_xattr_list): Do not check for NULL the address passed 37977 to printstr. 37978 37979 ipc.c: make use of RVAL_DECODED. 37980 * ipc.c (sys_mq_notify, sys_mq_open, sys_mq_timedreceive, 37981 sys_mq_timedsend, sys_msgctl, sys_msgget, sys_msgsnd, sys_semctl, 37982 sys_semget, sys_semop, sys_semtimedop, sys_shmctl, sys_shmdt, 37983 sys_shmget): Update for RVAL_DECODED. 37984 (sys_shmat): Decode all arguments on entering syscall. 37985 37986 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 37987 37988 umoven_or_printaddr: do not fetch data if not in verbose mode. 37989 After this change, umoven_or_printaddr and its callers, including 37990 printnum_* and printpair_*, will not fetch data in !verbose mode. 37991 37992 * util.c (umoven_or_printaddr): Do not call umoven if !verbose. 37993 37994 2015-07-14 Dmitry V. Levin <ldv (a] altlinux.org> 37995 37996 Change printnum_* printers to honor syserror. 37997 With this change, printnum_* printers will not attempt to fetch data 37998 in case of exiting(tcp) && syserror(tcp). 37999 All "at exiting" decoders that call these printers have been made 38000 ready for this change in previous commits. 38001 38002 * util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr. 38003 * prctl.c (prctl_exit): Use printnum_int and printnum_long. 38004 (sys_arch_prctl): Do not check for syserror. 38005 38006 2015-07-13 Dmitry V. Levin <ldv (a] altlinux.org> 38007 38008 term.c: enhance tty ioctl parser. 38009 Decode as much data on entering syscall as possible. 38010 38011 * term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize, 38012 decode_modem_flags): New functions. 38013 (term_ioctl): Use them. Update for RVAL_DECODED. 38014 38015 2015-07-12 Elvira Khabirova <lineprinter0 (a] gmail.com> 38016 38017 Change comparisons with function pointers to comparisons with SENs. 38018 * pathtrace.c (pathtrace_match): Change all comparisons with function 38019 pointers to a single SEN based switch. 38020 * syscall.c (dumpio, trace_syscall_entering): Change all comparisons 38021 with function pointers to comparisons with SENs. 38022 * ipc.c (sys_ipc): Remove. 38023 * sock.c (sys_socketcall): Likewise. 38024 * linux/dummy.h (sys_ipc, sys_socketcall): New aliases. 38025 38026 Add unique syscall entry numbers (SENs) 38027 * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sen.h. 38028 (syscallent_names, syscallent_patterns, syscallent_files): New variables. 38029 (sen.h): New rule. 38030 * defs.h (struct sysent): Add sen field. 38031 * generate_sen.sh: New file. 38032 * linux/syscall.h: Include "sen.h". 38033 * syscall.c (SEN_NAME): New temporary macro. 38034 (SEN): Use it to prepend syscall entry number. 38035 38036 Introduce SEN macro. 38037 * syscall.c (SEN): New temporary macro. 38038 * linux/dummy.h (sys_printargs): New macro. 38039 * linux/subcall.h: Wrap all sys_func entries using SEN. 38040 * linux/*/syscallent*.h: Likewise. 38041 38042 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 38043 38044 scsi.c: enhance SG_IO ioctl parser. 38045 Fix SG_IO ioctl output in case of failed umove 38046 38047 * scsi.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 38048 Update for RVAL_DECODED. 38049 (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 38050 print_sg_io_v4_res): Do not print address in case of failed umove. 38051 (scsi_ioctl): Use printaddr. 38052 38053 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 38054 38055 ptp.c: enhance ptp ioctl parser. 38056 * ptp.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 38057 Update for RVAL_DECODED. 38058 (ptp_ioctl): Use umove_or_printaddr. 38059 38060 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 38061 38062 mtd.c: enhance mtd and ubi ioctl parsers. 38063 Decode as much data on entering syscall as possible. 38064 38065 * xlat/mtd_file_mode_options.in: New file. 38066 * mtd.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 38067 Include "xlat/mtd_file_mode_options.h". 38068 Update for RVAL_DECODED. 38069 (mtd_ioctl, ubi_ioctl): Use printnum_int and umove_or_printaddr. 38070 38071 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 38072 38073 sock.c: enhance socket ioctl parser. 38074 Decode as much data on entering syscall as possible. 38075 38076 * sock.c: Update for RVAL_DECODED. 38077 (print_addr): Remove. 38078 (print_ifreq_addr, print_ifreq, print_ifc_len, decode_ifconf): New 38079 functions. 38080 (sock_ioctl) Use them. Use umove_or_printaddr. 38081 38082 2015-07-10 Dmitry V. Levin <ldv (a] altlinux.org> 38083 38084 block.c: enhance block ioctl parser. 38085 * block.c: Update for RVAL_DECODED. 38086 Define BLKROTATIONAL and BLKZEROOUT. 38087 (block_ioctl): Decode them. Use printnum_short, printnum_int, 38088 printnum_long, printpair_int64, and umove_or_printaddr. 38089 (print_blkpg_req, block_ioctl): Use umove_or_printaddr. 38090 38091 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38092 38093 blkpg_ops: add BLKPG_RESIZE_PARTITION constant. 38094 * xlat/blkpg_ops.in: Add BLKPG_RESIZE_PARTITION. 38095 38096 Reported-by: Christian Neukirchen <chneukirchen (a] gmail.com> 38097 38098 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38099 38100 loop.c: enhance loop ioctl parser. 38101 Decode as much data on entering syscall as possible. 38102 38103 * loop.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>. 38104 Update for RVAL_DECODED. 38105 (decode_loop_info, decode_loop_info64): New functions. 38106 (loop_ioctl): Use them. Decode LOOP_SET_STATUS, LOOP_SET_STATUS64, 38107 LOOP_SET_FD, LOOP_CHANGE_FD, LOOP_CTL_ADD and LOOP_CTL_REMOVE on 38108 entering syscall. 38109 Print LOOP_SET_FD and LOOP_CHANGE_FD arguments using printfd. 38110 38111 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38112 38113 rtc.c: enhance rtc ioctl parser. 38114 * rtc.c: Update for RVAL_DECODED. 38115 (print_rtc): Rename to print_rtc_time. 38116 (decode_rtc_time, decode_rtc_wkalrm): New functions. 38117 (rtc_ioctl): Use them. 38118 [RTC_VL_READ]: Decode RTC_VL_READ. 38119 Use printnum_long for RTC_IRQP_READ and RTC_EPOCH_READ decoding. 38120 38121 Use printpair_int. 38122 * evdev.c (repeat_ioctl): Use printpair_int. 38123 * net.c (do_pipe, sys_socketpair): Likewise. 38124 38125 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38126 38127 Add several generic integer pairs printing functions. 38128 Add functions to fetch and print pairs of integer types. 38129 Note that these printers do not attempt to fetch data 38130 in case of exiting(tcp) && syserror(tcp). 38131 38132 printnum_* printers will follow as soon as all callers are made ready 38133 for this change. 38134 38135 * defs.h (printpair_int, printpair_long, printpair_int64): New 38136 prototypes. 38137 * util.c (DEF_PRINTPAIR): New macro. 38138 (printpair_int, printpair_long, printpair_int64): New functions. 38139 38140 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38141 38142 Add two generic integer printing functions. 38143 Add printnum_short and printnum_int64 in addition to already existing 38144 printnum_int and printnum_long. 38145 38146 * defs.h (printnum_short, printnum_int64): New prototypes. 38147 * util.c (DEF_PRINTNUM): New macro. 38148 (printnum_int, printnum_long): Use DEF_PRINTNUM. 38149 (printnum_short, printnum_int64): New functions. 38150 38151 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38152 38153 Add address printing functions. 38154 printaddr is a simple function implementing "print NULL or address" 38155 idiom. 38156 umoven_or_printaddr is a wrapper around umoven that has the same return 38157 value semantics as umoven but also prints the address when the data 38158 is not going to be fetched (in case of exiting(tcp) && syserror(tcp)) 38159 or cannot be fetched (umoven fails). 38160 umove_or_printaddr is a macro wrapper around umoven_or_printaddr that 38161 mirrors umove wrapper around umoven. 38162 38163 * defs.h (printaddr, umoven_or_printaddr): New prototypes. 38164 (umove_or_printaddr): New macro. 38165 * util.c (printaddr, umoven_or_printaddr): New functions. 38166 38167 2015-07-09 Dmitry V. Levin <ldv (a] altlinux.org> 38168 38169 Implement RVAL_DECODED flag. 38170 Implement a method for "on entering" parsers to return 38171 "done with decoding" information to their callers. 38172 38173 If a syscall parser called from trace_syscall_entering returns a value 38174 with RVAL_DECODED bit set, record this value in tcp->sys_func_rval 38175 and use it in trace_syscall_exiting instead of calling the parser on 38176 exiting syscall. 38177 38178 If an ioctl parser returned RVAL_DECODED, this would tell 38179 SYS_FUNC(ioctl) that the decoding is finished but fallback printing of 38180 the ioctl command argument is needed, while e.g. RVAL_DONE+1 would mean 38181 that the decoding is finished and no fallback decoding is needed. 38182 38183 * defs.h (struct tcb): Add sys_func_rval. 38184 (RVAL_DECODED): New macro. 38185 * syscall.c (trace_syscall_entering): Initialize tcp->sys_func_rval 38186 along with setting TCB_INSYSCALL flag. 38187 (trace_syscall_exiting): Use tcp->sys_func_rval instead of calling 38188 tcp->s_ent->sys_func when the former has RVAL_DECODED flag set. 38189 Reset tcp->sys_func_rval along with clearing TCB_INSYSCALL flag. 38190 * ioctl.c (sys_ioctl): Set RVAL_DECODED flag on exiting. 38191 Print ioctl argument iff RVAL_DECODED is set and fallback decoding 38192 is requested. 38193 38194 2015-07-05 Dmitry V. Levin <ldv (a] altlinux.org> 38195 38196 time.c: move rtc ioctl parser to a separate file. 38197 * rtc.c: new file 38198 * Makefile.am (strace_SOURCES): Add it. 38199 * time.c (print_rtc, rtc_ioctl): Move to rtc.c. 38200 38201 term.c: fix typo. 38202 * term.c: Rename TCLFLSH to TCFLSH. 38203 38204 Do not include sys/filio.h. 38205 * configure.ac (AC_CHECK_HEADERS): Remove sys/filio.h. 38206 * term.c: Do not include <sys/filio.h>. 38207 38208 2015-07-02 Dmitry V. Levin <ldv (a] altlinux.org> 38209 38210 ioctl: prepare ioctl_decode_command_number for future changes. 38211 * ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*. 38212 (sys_ioctl): Update callers. 38213 38214 ioctl: simplify ioctl_decode signature. 38215 * ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters. 38216 (sys_ioctl): Update callers. 38217 38218 ioctl: consistently use name "code" for ioctl request code. 38219 * ioctl.c (evdev_decode_number, hiddev_decode_number, 38220 ioctl_decode_command_number): Rename "arg" to "code". 38221 38222 Move ioctl syscall parser to ioctl.c. 38223 * io.c (sys_ioctl): Move ... 38224 * ioctl.c: ... here. 38225 (ioctl_lookup, ioctl_next_match, ioctl_print_code, ioctl_decode, 38226 ioctl_decode_command_number): Declare as static. 38227 * defs.h (ioctl_lookup, ioctl_next_match, ioctl_print_code, 38228 ioctl_decode, ioctl_decode_command_number): Remove. 38229 38230 ioctl: remove obsolete registry of ioctl characters. 38231 * ioctl.c: Remove registry of ioctl characters. 38232 38233 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 38234 38235 Fix filtering of <unavailable> syscalls. 38236 * syscall.c (trace_syscall_exiting): Skip filtered syscalls also in case 38237 of get_regs or get_syscall_result failure. 38238 * tests/filter-unavailable.c: New file. 38239 * tests/filter-unavailable.expected: Likewise. 38240 * tests/filter-unavailable.test: New test. 38241 * tests/Makefile.am (check_PROGRAMS): Add filter-unavailable. 38242 (filter_unavailable_LDFLAGS): Add -pthread. 38243 (TESTS): Add filter-unavailable.test. 38244 (EXTRA_DIST): Add filter-unavailable.expected. 38245 * tests/.gitignore: Add filter-unavailable. 38246 38247 Reported-by: Bryan Matsuo <bryan.matsuo (a] gmail.com> 38248 38249 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 38250 38251 Fix -qq option in conjunction with -o option. 38252 This change makes -qq option work in conjunction with -o option, 38253 thus complementing commit v4.7-222-g01997cf. 38254 38255 * strace.c (init): Do not reset qflag. 38256 38257 2015-06-30 Dmitry V. Levin <ldv (a] altlinux.org> 38258 38259 xtensa: wire up new syscalls. 38260 * linux/xtensa/syscallent.h (bpf, execveat): New entries. 38261 38262 bfin: wire up new syscalls. 38263 * linux/bfin/syscallent.h (kcmp, finit_module, sched_setattr, 38264 sched_getattr, renameat2, seccomp, getrandom, memfd_create, 38265 bpf, execveat): New entries. 38266 38267 alpha: wire up new syscalls. 38268 * linux/alpha/syscallent.h (getrandom, memfd_create, execveat): 38269 New entries. 38270 38271 2015-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 38272 38273 tests: skip stat32 test if struct stat is defined incorrectly. 38274 If stat.st_mode returned by syscall is 0, it means that the definition 38275 of struct stat in <asm/stat.h> is incorrect. This is the case e.g. on 38276 mips n32 where the only available stat syscall is 64-bit but at the same 38277 time struct stat defined by <asm/stat.h> is 32-bit. 38278 38279 * tests/stat.c (main) [NR_stat]: Return 77 if st_mode is 0. 38280 38281 2015-06-17 Dmitry V. Levin <ldv (a] altlinux.org> 38282 38283 Consistenly use #ifdef to check for AC_DEFINE'd macros. 38284 * aio.c (print_common_flags): Use #ifdef in the check for 38285 HAVE_STRUCT_IOCB_U_C_FLAGS. 38286 * defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG. 38287 * net.c: Use #ifdef in the check for HAVE_SENDMSG. 38288 * syscall.c (dumpio): Likewise. 38289 * printstat.h (DO_PRINTSTAT): Use #ifdef in checks for 38290 HAVE_STRUCT_STAT_ST_* macros. 38291 * util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H. 38292 38293 xattr: move fallback definitions of xattr flags to xlat/ 38294 * xattr.c: Include <sys/xattr.h> insread of <linux/xattr.h>. 38295 Move definitions of XATTR_* flags ... 38296 * xlat/xattrflags.in: ... here. 38297 38298 link: move fallback definitions of AT_* constants to xlat/ 38299 * link.c: Move definitions of AT_* constants ... 38300 * xlat/at_flags.in: ... here. 38301 38302 net: move fallback definitions of SOL_* constants to xlat/ 38303 * net.c: Move definitions of SOL_* constants ... 38304 * xlat/socketlayers.in: ... here. 38305 38306 futex: move fallback definitions of futex constants to xlat/ 38307 * futex.c: Move definitions of FUTEX_OP_CMP_* constants ... 38308 * xlat/futexwakecmps.in: ... here. 38309 * futex.c: Move definitions of other FUTEX_OP_* constants ... 38310 * xlat/futexwakeops.in: ... here. 38311 * futex.c: Move definitions of remaining FUTEX_* constants except 38312 FUTEX_PRIVATE_FLAG and FUTEX_CLOCK_REALTIME flags ... 38313 * xlat/futexops.in: ... here. 38314 38315 clone: move definitions of cloning flags to xlat/ 38316 * clone.c: Include <sched.h>. Move definitions of CLONE_* flags ... 38317 * xlat/clone_flags.in: ... here. 38318 38319 2015-06-16 Dmitry V. Levin <ldv (a] altlinux.org> 38320 38321 Update mount flags constants. 38322 * mount.c: Remove definitions of mount flags constants. 38323 * xlat/mount_flags.in: Update from linux v4.0, add default values. 38324 38325 mount: update parser to match kernel behaviour. 38326 * mount.c (sys_mount): Do not decode type and data strings for 38327 MS_SHARED, MS_PRIVATE, MS_SLAVE, and MS_UNBINDABLE mount flags 38328 that do not imply valid strings. 38329 38330 mount: robustify MS_MGC_VAL decoding. 38331 * mount.c (sys_mount): When printing mount flags, do not assume that 38332 (flags & MS_MGC_MSK) == MS_MGC_VAL. 38333 38334 2015-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 38335 38336 net: decode setsockopt() multicast arguments. 38337 * configure.ac (AC_CHECK_FUNCS): Add inet_pton. 38338 * net.c (print_mreq, print_mreq6): New functions. 38339 (print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP, 38340 IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, 38341 IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST. 38342 * tests/ip_mreq.c: New file. 38343 * tests/ip_mreq.expected: Likewise. 38344 * tests/ip_mreq.test: New test. 38345 * tests/Makefile.am (check_PROGRAMS): Add ip_mreq. 38346 (TESTS): Add ip_mreq.test. 38347 (EXTRA_DIST): ip_mreq.expected. 38348 * tests/.gitignore: Add ip_mreq. 38349 38350 Based on patch by Ben Noordhuis <info (a] bnoordhuis.nl>. 38351 38352 2015-06-08 Dmitry V. Levin <ldv (a] altlinux.org> 38353 38354 Update IPV6 socket options constants. 38355 * xlat/sockipv6options.in: Update from linux v4.0. 38356 38357 2015-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 38358 38359 net: factor out interface index printing code. 38360 * net.c (print_ifindex): New function. 38361 (printsock) [HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID]: Use it. 38362 38363 2015-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 38364 38365 Consistently use error_msg instead of fprintf(stderr) 38366 * linux/alpha/get_scno.c: Use error_msg. 38367 * linux/arm/get_scno.c: Likewise. 38368 * linux/mips/get_scno.c: Likewise. 38369 * linux/sh/get_scno.c: Likewise. 38370 * linux/x86_64/get_scno.c: Likewise. 38371 * exit.c (sys_exit): Likewise. 38372 * pathtrace.c (pathtrace_select, pathtrace_match): Likewise. 38373 * strace.c (alloctcb, droptcb, detach, startup_attach, 38374 test_ptrace_seize, init, cleanup, print_debug_info, 38375 maybe_allocate_tcb, startup_tcb, trace): Likewise. 38376 * syscall.c (update_personality, trace_syscall_exiting, 38377 get_scno): Likewise. 38378 * unwind.c (DPRINTF): Likewise. 38379 * tests/bexecve.test: Update patterns. 38380 * tests/detach-stopped.test: Likewise. 38381 38382 Consistently print OOM diagnostic messages. 38383 * bjm.c (sys_query_module): Use error_msg to print OOM diagnostics. 38384 * util.c (dumpiov, dumpstr): Likewise. 38385 38386 2015-05-25 Dmitry V. Levin <ldv (a] altlinux.org> 38387 38388 Introduce memory allocation wrappers. 38389 Introduce wrappers to the following functions that do memory allocation: 38390 malloc, calloc, realloc, strdup. 38391 38392 This commit is a follow-up to the related discussions in strace-devel ML: 38393 http://sourceforge.net/p/strace/mailman/message/33618180/ 38394 http://sourceforge.net/p/strace/mailman/message/33733470/ 38395 38396 * defs.h (xmalloc, xcalloc, xreallocarray, xstrdup): New prototypes. 38397 * xmalloc.c: New file. 38398 * Makefile.am (strace_SOURCES): Add it. 38399 * count.c (count_syscall, call_summary_pers): Use xcalloc. 38400 * desc.c (decode_select): Use xmalloc. 38401 * dirent.c (sys_getdents, sys_getdents64): Likewise. 38402 * net.c (sys_recvmmsg): Use xstrdup. 38403 * pathtrace.c (storepath): Use xreallocarray. 38404 (pathtrace_match): Use xmalloc. 38405 * strace.c (die_out_of_memory): Move to xmalloc.c. 38406 (expand_tcbtab): Use xcalloc and xreallocarray. 38407 (startup_child): Use xstrdup. 38408 (init): Use xmalloc, xcalloc, and xstrdup. 38409 * syscall.c (reallocate_qual): Use xreallocarray. 38410 (qualify): Use xstrdup. 38411 * unwind.c (unwind_tcb_init): Use xmalloc. 38412 (build_mmap_cache): Use xcalloc, xreallocarray, and xstrdup. 38413 (get_symbol_name): Use xreallocarray. 38414 (stacktrace_walk, queue_put): Use xmalloc. 38415 * util.c (printstr): Use xmalloc. 38416 * vsprintf.c (strace_vfprintf): Likewise. 38417 38418 2015-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 38419 38420 Fix ioctl entries on 32-bit architectures with 64-bit aligned structures 38421 Some ioctl constants are defined to different values on those 32-bit 38422 architectures where structures containing a 64-bit field are aligned on 38423 a 8-byte boundary and have a size multiple of 8 bytes, and on other 38424 32-bit architectures. 38425 38426 * configure.ac: Check the size of a structure containing a 64-bit field. 38427 * linux/32/ioctls_inc.h: Rename to ... 38428 * linux/32/ioctls_inc_align32.h: ... this. 38429 * linux/32/ioctls_inc_align64.h: New file. 38430 * linux/32/ioctls_inc.h: Include either 32/ioctls_inc_align32.h 38431 or ioctls_inc_align64.h depending on SIZEOF_STRUCT_I64_I32. 38432 * Makefile.am (EXTRA_DIST): Add linux/32/ioctls_inc_align32.h and 38433 * linux/32/ioctls_inc_align64.h. 38434 * tests/ioctl.c (main): Test for VIDIOC_ENUMINPUT. 38435 * tests/ioctl.expected: Check VIDIOC_ENUMINPUT decoding. 38436 38437 Reported-by: Philippe De Muyter <phdm (a] macqel.be> 38438 38439 2015-05-21 Dmitry V. Levin <ldv (a] altlinux.org> 38440 38441 maint: make linux/kvm.h parseable on arm. 38442 * maint/ioctls_sym.sh [AARCH64 || ARM]: Add missing definitions for 38443 structures referenced from linux/kvm.h. 38444 38445 2015-05-21 Philippe De Muyter <phdm (a] macqel.be> 38446 38447 v4l2: add decoding for VIDIOC_S_CROP's arg. 38448 * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_S_CROP's arg. 38449 38450 2015-05-19 Ezequiel Garcia <ezequiel (a] vanguardiasur.com.ar> 38451 38452 Add support for Altera's Nios-II softcore architecture. 38453 This commit adds strace support for Altera's Nios-II. The architecture 38454 is supported by Linux since v3.19, and it implements the generic syscall 38455 ABI. 38456 38457 * configure.ac: Add nios2 support. 38458 * cacheflush.c [NIOS2] (sys_cacheflush): New function. 38459 * linux/nios2/*: New Nios-II specific files. 38460 * Makefile.am (EXTRA_DIST): Add them. 38461 38462 2015-05-19 Philippe De Muyter <phdm (a] macqel.be> 38463 38464 v4l2: VIDIOC_CROPCAP: add missing braces around arg printout. 38465 * v4l2.c (v4l2_ioctl): case VIDIOC_CROPCAP: add missing braces around arg 38466 printout. 38467 38468 2015-05-19 Dmitry V. Levin <ldv (a] altlinux.org> 38469 38470 maint: avoid effects of locale when sorting files. 38471 * maint/ioctls_gen.sh: Invoke sort with LC_COLLATE=C. 38472 * maint/ioctls_hex.sh: Likewise. 38473 * maint/ioctls_sym.sh: Likewise. 38474 38475 Reported-by: Philippe De Muyter <phdm (a] macqel.be> 38476 38477 2015-04-18 Philippe De Muyter <phdm (a] macqel.be> 38478 38479 v4l2: add decoding for VIDIOC_CREATE_BUFS's arg. 38480 * v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg. 38481 38482 2015-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 38483 38484 mips o32: decode indirect syscall. 38485 Implement decoding of MIPS O32 specific indirect syscall. 38486 38487 * syscall.c [LINUX_MIPSO32] (decode_mips_subcall, sys_syscall): 38488 New functions. 38489 (trace_syscall_entering) [LINUX_MIPSO32]: Use decode_mips_subcall. 38490 * linux/mips/syscallent-o32.h (4000): Change sys_func to sys_syscall. 38491 38492 Reported-and-tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez (a] gmail.com> 38493 38494 2015-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 38495 38496 debian: add gawk to Build-Depends. 38497 * debian/control (Build-Depends): Add gawk. 38498 Patch by Reiner Herrmann <reiner (a] reiner-h.de>. 38499 38500 This fixes Debian bug #780992. 38501 38502 2015-04-14 Dmitry V. Levin <ldv (a] altlinux.org> 38503 38504 tests: fix bexecve.test for the case of mixed personalities. 38505 Fix bexecve.test when the executable being run does not match the 38506 native architecture. 38507 38508 * tests/bexecve.test: Use "set_ptracer_any" instead of "sh". 38509 Allow for a personality switch notification in the strace output. 38510 38511 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 38512 38513 tests: add a test for "resuming interrupted nanosleep" 38514 * tests/restart_syscall.test: New test. 38515 * tests/restart_syscall.expected: New file. 38516 * tests/restart_syscall_unknown.expected: Likewise. 38517 * tests/Makefile.am (TESTS): Add restart_syscall.test. 38518 (EXTRA_DIST): Add restart_syscall.expected 38519 (TEST_LOG_COMPILER): Change to "env". 38520 (OS, ARCH, AM_TEST_LOG_FLAGS): Define. 38521 and restart_syscall_unknown.expected. 38522 38523 tests: strip executable bit from *.expected files. 38524 38525 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 38526 38527 Declare syscall parsers using SYS_FUNC macro. 38528 Introduce SYS_FUNC macro to declare and define all syscall parsers. 38529 38530 * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. 38531 (sys_func.h): New rule. 38532 * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. 38533 * linux/syscall.h: Include "sys_func.h". 38534 [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. 38535 Remove other declarations. 38536 * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs 38537 and osf_fstatfs syscall parsers. 38538 * *.c: Use SYS_FUNC to define syscall parsers. 38539 38540 2015-04-07 Denys Vlasenko <dvlasenk (a] redhat.com> 38541 38542 Fix confusing "resuming interrupted unknown" message. 38543 Dmitry reported seeing the following: 38544 38545 $ sleep 2 & sleep 1; ./strace -erestart_syscall -p $! 38546 [1] 12345 38547 Process 12345 attached 38548 restart_syscall(<... resuming interrupted unknown ...>) = 0 38549 38550 Fixing it by replacing "unknown" with "system call". 38551 38552 2015-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 38553 38554 tests: workaround old gawk versions that do not provide @include support 38555 Some of our tests use GNU awk @include extension, but not all currently 38556 used versions of GNU awk support it. Skip these tests if gawk does not 38557 provide @include support. 38558 38559 * tests/init.sh (check_gawk): New function. 38560 (match_awk): Use it. 38561 38562 2015-04-06 Dmitry V. Levin <ldv (a] altlinux.org> 38563 38564 tests: rewrite umovestr2.test without using grep. 38565 The regular expression generated by umovestr2.c on systems with large 38566 page size is too big for GNU grep. Rewrite the test to use diff 38567 instead of grep. 38568 38569 * tests/umovestr2.test: Use match_diff instead of match_grep. 38570 * tests/umovestr2.c (main): Convert output from regexp to plain text. 38571 38572 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 38573 38574 Cleanup process_vm_writev syscall decoding. 38575 * process_vm.c (sys_process_vm_writev): Do not check for syserror, 38576 it is not applicable on entering syscall. 38577 38578 umovestr: read chunks of memory up to pagesize at a time. 38579 * defs.h (get_pagesize): New prototype. 38580 * mem.c (get_pagesize) Make global. 38581 * util.c (PAGMASK): Remove. 38582 (vm_read_mem): New process_vm_readv proxy function. 38583 (umoven, umovestr): Use it. 38584 (umovestr): Read chunks up to pagesize at a time. 38585 38586 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 38587 38588 umovestr: fix short read bug. 38589 * util.c (umovestr): Check the right address. 38590 * tests/umovestr.c: New file. 38591 * tests/umovestr2.c: Likewise. 38592 * tests/umovestr.expected: Likewise. 38593 * tests/umovestr.test: New test. 38594 * tests/umovestr2.test: Likewise. 38595 * tests/Makefile.am (check_PROGRAMS): Add umovestr and umovestr2. 38596 (TESTS): Add umovestr.test and umovestr2.test. 38597 (EXTRA_DIST): Add umovestr.expected. 38598 * tests/.gitignore: Add umovestr and umovestr2. 38599 38600 Reported-by: Josef T. Burger <bolo (a] cs.wisc.edu> 38601 38602 2015-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 38603 38604 When process_vm_readv fails with EPERM, try PTRACE_PEEKDATA. 38605 process_vm_readv() and ptrace(PTRACE_PEEKDATA) have inconsistent access 38606 control rules wrt traced processes: process_vm_readv() is more likely to 38607 fail with EPERM than ptrace(PTRACE_PEEKDATA) when tracing a process that 38608 has execve'd a privileged executable. 38609 38610 * util.c (umoven, umovestr): If process_vm_readv returned EPERM, 38611 fall back to ptrace(PTRACE_PEEKDATA). 38612 38613 Reported-by: Andrew Guertin <lists (a] dolphinling.net> 38614 38615 2015-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 38616 38617 Use macros for gcc attributes. 38618 * defs.h (error_msg, perror_msg, error_msg_and_die, perror_msg_and_die, 38619 die_out_of_memory, printllval, printnum_int, printnum_long, tprintf): 38620 Use ATTRIBUTE_* macros for gcc attributes. 38621 * file.c (struct stat64): Likewise. 38622 * statfs.c (struct compat_statfs64): Likewise. 38623 * strace.c (die, exec_or_die, init): Likewise. 38624 * linux/sparc/arch_sigreturn.c: Likewise. 38625 * linux/ubi-user.h: Likewise. 38626 38627 2015-03-30 Dmitry V. Levin <ldv (a] altlinux.org> 38628 38629 Introduce macros for gcc attributes. 38630 Define macros for gcc attributes that are already in use 38631 or going to be used soon. 38632 38633 * defs.h (GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, 38634 ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, 38635 ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): New macros. 38636 38637 2015-03-28 Felix Janda <felix.janda (a] posteo.de> 38638 38639 Include <linux/ioctl.h> for _IOC_* macros. 38640 Fix a compilation failure with musl libc. 38641 38642 * evdev.c: Include <linux/ioctl.h>. 38643 * ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>. 38644 * ioctlsort.c: Likewise. 38645 38646 Reported-by: Dima Krasner <dima (a] dimakrasner.com> 38647 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 38648 38649 2015-03-28 Felix Janda <felix.janda (a] posteo.de> 38650 38651 Include <sys/stat.h> for S_I* macros. 38652 Fix a compilation failure with musl libc. 38653 38654 * mknod.c: Include <sys/stat.h>. 38655 * printmode.c: Likewise. 38656 38657 Reported-by: Dima Krasner <dima (a] dimakrasner.com> 38658 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 38659 38660 2015-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 38661 38662 signal.c: move siginfo_t parsers to a separate file. 38663 * printsiginfo.c: New file. 38664 * Makefile.am (strace_SOURCES): Add it. 38665 * defs.h (printsiginfo): Change second argument's type from int to bool. 38666 * signal.c: Stop defining siginfo_t related constants. 38667 Move inclusion of xlat/sig*_codes.h files to printsiginfo.c 38668 (printsigsource, printsigval, printsiginfo_at): Move to printsiginfo.c. 38669 (printsiginfo): Change second argument's type from int to bool, 38670 split, and move to printsiginfo.c. 38671 38672 Update siginfo_t constants. 38673 * xlat/sigbus_codes.in: Add BUS_MCEERR_AR and BUS_MCEERR_AO, 38674 add default values. 38675 * xlat/sigtrap_codes.in: Add TRAP_BRANCH and TRAP_HWBKPT, 38676 add default values. 38677 * xlat/sigsegv_codes.in: Add SEGV_BNDERR, add default values. 38678 * xlat/sigchld_codes.in: Add default values. 38679 * xlat/sigemt_codes.in: Likewise. 38680 * xlat/sigfpe_codes.in: Likewise. 38681 * xlat/sigill_codes.in: Likewise. 38682 * xlat/siginfo_codes.in: Likewise. 38683 * xlat/sigpoll_codes.in: Likewise. 38684 * xlat/sigsys_codes.in: Likewise. 38685 38686 2015-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 38687 38688 signal.c: move sigaltstack parser to a separate file. 38689 * sigaltstack.c: New file. 38690 * Makefile.am (strace_SOURCES): Add it. 38691 * signal.c (print_stack_t, sys_sigaltstack): Move to sigaltstack.c. 38692 * xlat/sigaltstack_flags.in: Add default values. 38693 38694 2015-03-25 Denys Vlasenko <dvlasenk (a] redhat.com> 38695 38696 Move sparc64 get_scno() code where it belongs. 38697 38698 sparc: rename personality 2 files to personality 1. 38699 Run-tested in qemu 32-bit sparc. 38700 38701 2015-03-25 Denys Vlasenko <dvlasenk (a] redhat.com> 38702 38703 sparc: delete personality 1. 38704 Personality 1 for sparc and sparc64 appears to be an old attempt 38705 to support stracing Solaris binaries. 38706 38707 It stalled after the only syscall, solaris_open, was covered: 38708 all other solaris_foo's are printargs. 38709 38710 This change deletes personality 1. Now sparc is an one-personality 38711 arch, and sparc64 is a two-personality one. 38712 38713 For clarity, pure renaming of personality 2 files to personality 1 for sparc64 38714 is performed in the next commit - this prevents a state where syscallent1.h 38715 seems to indergo a lot of changes, where in fact in is deleted, and then 38716 replaced by syscallent2.h 38717 38718 Therefore, tree at this commit will not build. 38719 38720 2015-03-24 Denys Vlasenko <dvlasenk (a] redhat.com> 38721 38722 qemu_multiarch_testing/*: make it easier to do debug in sandboxes. 38723 38724 2015-03-24 Denys Vlasenko <dvlasenk (a] redhat.com> 38725 38726 sparc: fix v4.10-25-g8497b62 fallout. 38727 Before: 38728 38729 $ sleep 3 & ./strace -p $! 38730 Process 8703 attached 38731 syscall: unknown syscall trap 1a800003 00025d58 38732 syscall_516(0, 0x40080000, 0, 0xfc000f00, 0x28, 0xefc03b18) = 0 38733 exit_group(0) = ? 38734 +++ exited with 0 +++ 38735 38736 After: 38737 38738 $ sleep 3 & ./strace -p $! 38739 Process 8725 attached 38740 restart_syscall(<... resuming interrupted nanosleep ...>) = 0 38741 exit_group(0) = ? 38742 +++ exited with 0 +++ 38743 38744 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 38745 38746 get_scno: add diagnostics for invalid syscall numbers. 38747 * syscall.c (get_scno): Print a debug level message 38748 for !SCNO_IS_VALID syscall numbers. 38749 38750 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 38751 38752 arm: fix v4.10-25-g8497b62 fallout. 38753 Starting with commit v4.10-25-g8497b62, 38754 38755 arm$ ./strace true 38756 pid 1234 stray syscall exit 38757 Segmentation fault 38758 38759 Fix this by updating ARM syscall sanity check. 38760 In particular, get_scno() should not set TCB_INSYSCALL flag because 38761 other code assumes that s_ent is properly initialized when this flag 38762 is set. 38763 38764 * linux/arm/get_scno.c: Check syscall number after fetching. 38765 Do not apply the check to SCNO_IN_RANGE syscalls. 38766 Do not set TCB_INSYSCALL flag. 38767 Extend diagnostics and move it to debug level. 38768 38769 2015-03-24 Dmitry V. Levin <ldv (a] altlinux.org> 38770 38771 mips: fix pipe syscall decoding. 38772 * linux/mips/arch_getrval2.c: New file. 38773 * Makefile.am (EXTRA_DIST): Add it. 38774 * defs.h [MIPS] (HAVE_GETRVAL2): Define. 38775 38776 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 38777 38778 sigreturn.c: split arch specific code into separate arch files. 38779 Split code that use arch-specific registers to separate arch files. 38780 38781 * sigreturn.c (sys_sigreturn): Move arch-specific code 38782 to linux/*/arch_sigreturn.c, include "arch_sigreturn.c". 38783 * linux/arch_sigreturn.c: New file. 38784 * Makefile.am (EXTRA_DIST): Add linux/arch_sigreturn.c 38785 and linux/*/arch_sigreturn.c files. 38786 38787 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 38788 38789 syscall.c: split arch specific code into separate arch files. 38790 Split code that use arch-specific registers to separate arch files. 38791 38792 * syscall.c: Move definitions of variables containing fetched registers 38793 to linux/*/arch_regs.c files. 38794 [HAVE_GETRVAL2] (getrval2): Move arch-specific code 38795 to linux/*/arch_getrval2.c, include "arch_getrval2.c". 38796 (print_pc): Move arch-specific code to linux/*/print_pc.c files, 38797 include "print_pc.c". 38798 [X86_64] (x86_64_getregs_old): Rename to getregs_old, move to 38799 linux/x86_64/getregs_old.c, include "getregs_old.c". 38800 [POWERPC] (powerpc_getregs_old): Rename to getregs_old, move to 38801 linux/powerpc/getregs_old.c, include "getregs_old.c". 38802 (get_regs) [X86_64, POWERPC]: Update callers. 38803 (get_scno): Move arch-specific code to linux/*/get_scno.c, 38804 include "get_scno.c". 38805 (get_syscall_args): Move arch-specific code 38806 to linux/*/get_syscall_args.c, include "get_syscall_args.c". 38807 (get_error): Move arch-specific code to linux/*/get_error.c, 38808 include "get_error.c". 38809 (get_syscall_result): Move arch-specific code 38810 to linux/*/get_syscall_result.c, include "get_syscall_result.c". 38811 * Makefile.am (EXTRA_DIST): Add new linux/*/*.c files. 38812 38813 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 38814 38815 syscall.c: prepare for the split. 38816 Move functions that use arch-specific registers to the end of file. 38817 38818 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 38819 38820 Move get_regs error check from trace_syscall_entering to get_scno. 38821 Starting with commit v4.10-25-g8497b62, get_scno() can be called outside 38822 trace_syscall_entering(), so move the get_regs_error check from 38823 trace_syscall_entering() to get_scno(). 38824 38825 * syscall.c (trace_syscall_entering): Move get_regs_error check ... 38826 (get_scno): ... here. 38827 38828 2015-03-23 Dmitry V. Levin <ldv (a] altlinux.org> 38829 38830 alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding. 38831 Fix pipe syscall decoding on alpha. 38832 Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64. 38833 38834 * configure.ac (AC_CHECK_FUNCS): Add pipe2. 38835 * defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2): 38836 Define. 38837 * net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros. 38838 Do not use getrval2 for pipe2 decoding. 38839 Print address if umove call fails. 38840 * syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture 38841 macros. Implement for [ALPHA]. 38842 * tests/pipe.c: New file. 38843 * tests/pipe.expected: New file. 38844 * tests/pipe.test: New test. 38845 * tests/Makefile.am (check_PROGRAMS): Add pipe. 38846 (TESTS): Add pipe.test. 38847 (EXTRA_DIST): Add pipe.expected. 38848 * tests/.gitignore: Add pipe. 38849 38850 2015-03-22 Dmitry V. Levin <ldv (a] altlinux.org> 38851 38852 decode_socket_subcall: fetch all arguments with a single umoven call. 38853 * syscall.c (decode_socket_subcall): Replace umoven fetch loop 38854 with a single umoven call. 38855 38856 2015-03-21 Denys Vlasenko <dvlasenk (a] redhat.com> 38857 38858 New test: test/many_looping_threads.c. 38859 38860 test/.gitignore: add missing test targets. 38861 38862 Trivial optimization in sys_sigreturn() 38863 38864 Change last parameter of umoven() from char* to void* 38865 Saves tons of casts. 38866 38867 Remove unused struct tcb::inst field. 38868 It is unused since we dropped support for kernels without PTRACE_SETOPTIONS. 38869 38870 test/Makefile: add missing test targets. 38871 38872 Move the comment about termination logic where it belongs. 38873 38874 startup_tcb() never fails, remove code which checks for failures. 38875 38876 2015-03-21 Denys Vlasenko <dvlasenk (a] redhat.com> 38877 38878 Show the syscall name in "resuming interrupted call" message. 38879 When signal is received, or if we have attached to a process, 38880 current syscall (if process is in one) gets restarted. 38881 38882 Some syscalls are restarted via "restart_syscall()" mechanism. 38883 On such sycalls, we don't show _which_ syscall gets restarted. 38884 38885 IOW: users want to see "resuming interrupted nanosleep" 38886 instead of "resuming interrupted call" when they attach to "sleep 999". 38887 38888 Kernel does expose this information. The only thing we need is 38889 to fetch syscall# on attach, and save it. 38890 38891 This patch does this. It adds tcp->s_prev_ent, which is 38892 a pointer to struct_sysent of the previous syscall of this tracee. 38893 It can be NULL. 38894 38895 sys_restart_syscall() is made to use it when the message is generated. 38896 38897 To similarly handle restart_syscall() *after signals*, not just 38898 on attach, on each syscall exit patch saves exited syscall's data 38899 in the same member (tcp->s_prev_ent). 38900 38901 Example: 38902 38903 $ sleep 3 & strace -p $! 38904 Process 8728 attached 38905 restart_syscall(<... resuming interrupted nanosleep ...>) = 0 38906 _exit(0) = ? 38907 +++ exited with 0 +++ 38908 38909 2015-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 38910 38911 tests: add a test for mmap/mprotect/munmap decoding. 38912 * tests/mmap.c: New file. 38913 * tests/mmap64.c: New file. 38914 * tests/mmap.test: New test. 38915 * tests/mmap64.test: New test. 38916 * tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64. 38917 (mmap64_CFLAGS): Define. 38918 (TESTS): Add mmap.test and mmap64.test. 38919 * tests/.gitignore: Add mmap and mmap64. 38920 38921 sparc, sparc64: fix decoding of mmap2. 38922 * linux/sparc/syscallent.h (mmap2): Decode with sys_mmap_4koff, 38923 not sys_mmap. 38924 * linux/sparc64/syscallent2.h (mmap2): Decode with sys_mmap_pgoff, 38925 not sys_mmap. 38926 38927 2015-03-19 Dmitry V. Levin <ldv (a] altlinux.org> 38928 38929 tests: add a test for SECCOMP_MODE_FILTER decoding. 38930 * tests/seccomp.c: New file. 38931 * tests/seccomp.test: New test. 38932 * tests/Makefile.am (check_PROGRAMS): Add seccomp. 38933 (TESTS): Add seccomp.test. 38934 * tests/.gitignore: Add seccomp. 38935 38936 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 38937 38938 tests: factor out common awk code. 38939 Factor out awk code used in several tests to match.awk. 38940 38941 * tests/match.awk: New file. 38942 * tests/Makefile.am (EXTRA_DIST): Add it. 38943 * tests/caps.awk: Use it. 38944 * tests/getdents.awk: Likewise. 38945 * tests/getrandom.awk: Likewise. 38946 * tests/select.awk: Likewise. 38947 * tests/sigaction.awk: Likewise. 38948 * tests/init.sh (match_awk): Use gawk not awk. Define AWKPATH. 38949 * tests/getdents.test: Likewise. 38950 38951 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 38952 38953 tests: skip netlink based tests when resources are not available. 38954 * tests/netlink_inet_diag.c (main): Return 77 if socket, bind, 38955 or listen syscall fail. 38956 * tests/netlink_unix_diag.c (main): Likewise. 38957 38958 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 38959 38960 aarch64, arm: decode extra padded compat struct statfs64. 38961 According to arch/arm/kernel/sys_oabi-compat.c, 38962 struct statfs64 has extra padding with EABI. 38963 38964 * statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE): 38965 Define. 38966 (do_statfs64_fstatfs64): New function, factored out from sys_statfs64. 38967 [COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to 38968 sizeof(struct compat_statfs64). 38969 (sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64. 38970 38971 Reported-and-tested-by: Elliott Hughes <enh (a] google.com> 38972 38973 2015-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 38974 38975 tests: factor out common shell code to functions. 38976 Factor out shell code used in several tests to common functions. 38977 38978 * tests/fanotify_mark.expected: New file. 38979 * tests/ioctl.expected: New file. 38980 * tests/net-fd.expected: New file. 38981 * tests/net.expected: New file. 38982 * tests/statfs.expected: New file. 38983 * tests/sun_path.expected: New file. 38984 * tests/uio.expected: New file. 38985 * tests/ipc.sh: New file. 38986 * tests/Makefile.am (EXTRA_DIST): Add them. 38987 * tests/init.sh (dump_log_and_fail_with, run_prog, 38988 run_prog_skip_if_failed, run_strace, run_strace_merge, 38989 match_awk, match_diff, match_grep): New functions. 38990 * tests/*.test: Use them. 38991 38992 2015-03-18 Elliott Hughes <enh (a] google.com> 38993 38994 Show f_flags field in printstatfs. 38995 printstatfs64 was right, but printstatfs was missing f_flags. 38996 Noticed on aarch64. 38997 38998 * statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags. 38999 39000 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 39001 39002 tests/uid*: use fchown* instead of chown* 39003 Newer architectures have no chown syscall, so use fchown* syscalls 39004 for testing printuid. 39005 39006 * tests/uid.test: Use fchown instead of chown. 39007 * tests/uid.c: Test __NR_fchown instead of __NR_chown. 39008 (main): Use __NR_fchown instead of __NR_chown. 39009 * tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32. 39010 (main): Use __NR_fchown32 instead of __NR_chown32. 39011 * tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead 39012 of __NR_chown and __NR_chown32. 39013 (main): Use __NR_fchown instead of __NR_chown. 39014 * tests/uid.awk: Update regexp. 39015 39016 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 39017 39018 stat64-v.test: add newfstatat syscall support. 39019 Newer architectures have no stat syscall, so stat() is implemented there 39020 using newfstatat syscall. 39021 39022 * tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers. 39023 [_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support. 39024 (main) [!NR_stat]: Add newfstatat support. 39025 39026 Reported-by: Andreas Schwab <schwab (a] suse.de> 39027 39028 2015-03-16 Andreas Schwab <schwab (a] suse.de> 39029 39030 aarch64: properly decode generic syscalls. 39031 * linux/aarch64/syscallent1.h: Don't override entries 277 to 1023. 39032 39033 tests: verify that all patterns match. 39034 * tests/ipc_msg.test: Count matches to verify that all patterns match. 39035 * tests/ipc_sem.test: Likewise. 39036 * tests/ipc_shm.test: Likewise. 39037 * tests/stat32-v.test: Likewise. 39038 * tests/stat64-v.test: Likewise. 39039 39040 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 39041 39042 Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t. 39043 STRUCT_STAT.st_[acm]time are declared as unsigned int for some 39044 personalities, while time_t is signed. 39045 39046 * printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int, 39047 explicitly cast them to int. 39048 * tests/stat64-v.test: Test that negative time_t is decoded properly. 39049 39050 Reported-by: Andreas Schwab <schwab (a] suse.de> 39051 39052 2015-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 39053 39054 semctl: fix indirect syscall decoding. 39055 On architectures where the semctl call is implemented by the ipc syscall 39056 the 4th argument is passed by reference. 39057 39058 * ipc.c (sys_semctl): Handle the indirect ipc subcall case. 39059 * tests/ipc_sem.c (main): Optionally match indirection 39060 in the 4th argument of semctl calls. 39061 39062 Reported-by: Andreas Schwab <schwab (a] suse.de> 39063 39064 2015-03-16 Andreas Schwab <schwab (a] suse.de> 39065 39066 tests/ipc_*: match IPC_64 flag. 39067 * tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third 39068 argument of the ipc call. 39069 * tests/ipc_sem.c (main): Likewise. 39070 * tests/ipc_shm.c (main): Likewise. 39071 39072 2015-03-16 Andreas Schwab <schwab (a] suse.de> 39073 39074 Fix crash in ipc_sem test. 39075 Properly use union semun as argument of semctl. 39076 39077 * tests/ipc_sem.c (main): Properly use union semun as argument of 39078 semctl. Don't handle EFAULT specially. 39079 * tests/ipc_sem.test: Revert last change. 39080 39081 2015-03-16 Andreas Schwab <schwab (a] suse.de> 39082 39083 m68k: fix sigreturn decoding. 39084 * sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the 39085 signal mask from the proper place. 39086 39087 aarch64: fix ioctl decoding. 39088 * linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h. 39089 * linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h. 39090 * linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h. 39091 * linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h. 39092 39093 2015-03-12 Andreas Schwab <schwab (a] suse.de> 39094 39095 tests/select.test: handle architectures using pselect6 syscall. 39096 * tests/select.awk (BEGIN): Update regexps to match both select 39097 and pselect6 syscalls. 39098 * tests/select.test: Probe for both select and pselect6 syscall. 39099 39100 Distribute linux/aarch64/arch_regs.h. 39101 * Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h. 39102 39103 Fix decoding of mmap2 for arm. 39104 * syscallent.h (mmap2): Decode with sys_mmap_4koff, not 39105 sys_mmap_pgoff. 39106 39107 2015-03-12 Andreas Schwab <schwab (a] suse.de> 39108 39109 m68k: define HAVE_SA_RESTORER. 39110 On m68k the kernel sigaction structure has the sa_restorer member for 39111 historical reasons. 39112 39113 * signal.c (HAVE_SA_RESTORER): Define for M68K. 39114 39115 2015-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 39116 39117 aarch64: fix rt_sigreturn decoding. 39118 * sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check. 39119 39120 2015-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 39121 39122 maint: post-release administrivia. 39123 * NEWS: Add header line for next release. 39124 39125 2015-03-06 Dmitry V. Levin <ldv (a] altlinux.org> 39126 39127 Prepare for 4.10 release. 39128 * NEWS: Update for 4.10 release. 39129 * debian/changelog: 4.10-1. 39130 * strace.spec: 4.10-1. 39131 39132 Move sigreturn/rt_sigreturn parser to a separate file. 39133 * sigreturn.c: New file. 39134 * Makefile.am (strace_SOURCES): Add it. 39135 * defs.h (sprintsigmask_n): New prototype. 39136 (tprintsigmask_addr): New macro. 39137 * signal.c (sprintsigmask_n): Make global. 39138 (tprintsigmask_addr): Remove. 39139 (sys_sigreturn): Move to sigreturn.c. 39140 39141 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39142 39143 ia64: use PTRACE_GETREGS to fetch registers. 39144 * linux/ia64/arch_regs.h: Stop including <asm/rse.h>. 39145 (ia64_frame_ptr): New declaration. 39146 * signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr. 39147 * syscall.c [IA64]: Include <asm/rse.h>. 39148 [IA64] (ia64_regs, ia64_frame_ptr): New variable. 39149 [IA64] (ARCH_REGS_FOR_GETREGS): New macro. 39150 [IA64] (ia64_ia32mode): Convert to macro. 39151 [IA64] (ia64_r8, ia64_r10): Remove. 39152 (getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]: 39153 Use ia64_regs. 39154 (get_syscall_result) [IA64]: Remove. 39155 39156 s390, s390x: use PTRACE_GETREGSET to fetch registers. 39157 * linux/s390/arch_regs.h: New file. 39158 * linux/s390x/arch_regs.h: New file. 39159 * Makefile.am (EXTRA_DIST): Add them. 39160 * signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr. 39161 * syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable. 39162 [S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro. 39163 (print_pc) [S390 || S390X]: Use s390_regset. 39164 (get_scno) [S390 || S390X]: Likewise. 39165 (get_syscall_args) [S390 || S390X]: Likewise. 39166 (get_error) [S390 || S390X]: Likewise. 39167 (get_syscall_result) [S390 || S390X]: Remove. 39168 39169 qemu_multiarch_testing: update. 39170 * qemu_multiarch_testing/README: Update statistics. 39171 39172 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39173 39174 tests: robustify unix-yy.test. 39175 Implement additional synchronization between parent and child processes 39176 to guarantee that the child starts closing connected socket only after 39177 exiting of the parent's accept() syscall. 39178 This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER 39179 messages from NETLINK_SOCK_DIAG interface. 39180 39181 * tests/net-accept-connect.c: Implement additional synchronization 39182 between parent and child processes. 39183 * tests/unix-yy-connect.awk: Update. 39184 39185 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39186 39187 Use SIGRTMIN from kernel headers. 39188 * configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>. 39189 * signal.c: Use ASM_SIGRTMIN instead of constants provided by libc. 39190 * tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value. 39191 Use lower RT_* numbers to support pre-3.18 hppa kernels. 39192 * tests/sigreturn.test: Update regexp. 39193 39194 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39195 39196 ppc64: fix compilation warning. 39197 Fix compilation warning introduced by commit 39198 577be2593d4895ef941e1c4e5e1608f7dd13610d 39199 39200 * signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal 39201 mask on 32bit personality. 39202 39203 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39204 39205 aarch64: fix compilation warnings. 39206 Fix compilation warnings introduced by commit 39207 5b9b7e1d347eb4556084cdccad75e8247c535ed5: 39208 39209 signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare] 39210 syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default] 39211 39212 * syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast. 39213 [AARCH64] (arm_sp_ptr): Change pointer type to unsigned. 39214 * linux/aarch64/arch_regs.h (arm_sp_ptr): Update. 39215 39216 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 39217 39218 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39219 39220 i386: simplify sigreturn decoding. 39221 * signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define 39222 i386_sigcontext_struct and i386_fpstate structures. 39223 39224 2015-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 39225 39226 tests: add a test for sigreturn/rt_sigreturn decoding. 39227 Convert test/sigreturn.c into a regular test. 39228 39229 * test/Makefile (PROGS): Remove sigreturn. 39230 * test/.gitignore: Likewise. 39231 * test/sigreturn.c: Rewrite to ... 39232 * tests/sigreturn.c: ... new file. 39233 * tests/sigreturn.test: New test. 39234 * tests/Makefile.am (check_PROGRAMS): Add sigreturn. 39235 (TESTS): Add sigreturn.test. 39236 * tests/.gitignore: Add sigreturn. 39237 39238 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 39239 39240 sigreturn: print signal mask as a syscall argument. 39241 Although sigreturn takes signal mask via frame pointer, 39242 it's more convenient to display signal mask as a syscall argument 39243 rather than an outstanding object of unknown nature: 39244 39245 Before this change: 39246 sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0 39247 39248 After this change: 39249 sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0 39250 39251 * signal.c (sys_sigreturn): Display signal mask as a syscall argument. 39252 39253 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 39254 39255 aarch64: implement rt_sigreturn decoding. 39256 * linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn 39257 decoding. 39258 * syscall.c [ARM] (arm_regs): Make static. 39259 [ARM] (arm_sp_ptr): New variable. 39260 [AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables. 39261 * linux/aarch64/arch_regs.h: New file. 39262 * linux/arm/arch_regs.h (arm_regs): Remove. 39263 (arm_sp_ptr): New declaration. 39264 * signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr. 39265 [AARCH64]: Print signal mask. 39266 39267 arm: simplify sigreturn decoding. 39268 * signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext 39269 structures, fetch signal mask only, use print_sigset_addr_len. 39270 39271 s390: fix sigreturn decoding. 39272 * signal.c (sys_sigreturn) [S390]: Fix signal mask decoding. 39273 39274 mips o32: fix sigreturn decoding. 39275 * signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask. 39276 [MIPS] Use print_sigset_addr_len to print signal mask. 39277 39278 x86_64, x32: implement rt_sigreturn decoding. 39279 * syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable. 39280 * linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration. 39281 * linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn 39282 decoding. 39283 * linux/x32/syscallent.h (513): Likewise. 39284 * signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask 39285 for non-i386 personalities. 39286 39287 sparc, sparc64: fix sigreturn decoding. 39288 * linux/sparc/arch_regs.h (U_REG_FP): New macro. 39289 * signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding 39290 of upper 32 bits of the sigmask. 39291 39292 ppc, ppc64: fix sigreturn decoding. 39293 * signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits 39294 of the sigmask. 39295 39296 sigreturn: issue a less innocuous warning. 39297 * signal.c (sys_sigreturn): Issue a less innocuous warning on 39298 architectures for which signal mask decoding is not implemented yet. 39299 39300 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 39301 39302 bootstrap: do not link Makefile* files. 39303 * bootstrap: Do not symlink any Makefile* files, not just Makefile.am 39304 and Makefile.in. 39305 39306 Reported-by: Christopher Covington <cov (a] codeaurora.org> 39307 39308 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 39309 39310 ia64: fix sigreturn decoding. 39311 * signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask. 39312 Use print_sigset_addr_len to print signal mask. 39313 39314 2015-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 39315 39316 ia64: use generic signalent. 39317 This complements commit v4.9-321-gfcf7f8d. 39318 39319 * linux/ia64/signalent.h: Remove. 39320 * Makefile.am (EXTRA_DIST): Remove it. 39321 39322 2015-03-04 Giedrius Statkeviius <giedrius.statkevicius (a] gmail.com> 39323 39324 Document that -k is available only with libunwind. 39325 Without this users might get confused why `man strace` describes 39326 an option that doesn't work. 39327 39328 * strace.1: Note that -k is available only if strace is built 39329 with libunwind. 39330 39331 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 39332 39333 debian: update control file. 39334 * debian/control (strace, strace-udeb): Add mips64 and mips64el 39335 to architecture list. 39336 Patch by James Cowgill <james410 (a] cowgill.org.uk> 39337 39338 This fixes Debian bug #773375. 39339 39340 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 39341 39342 debian: sync with 4.9-2 package. 39343 * debian/changelog: Sync with 4.9-2. 39344 * debian/control: Likewise. 39345 39346 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 39347 39348 Add arch-specific PTRACE_* constants. 39349 * xlat/ptrace_cmds.in: Add arch-specific ptrace commands. 39350 * xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile. 39351 * xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile. 39352 39353 This fixes Debian bug #734554. 39354 39355 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 39356 39357 Clarify bootstrap-vs-autoreconf usage. 39358 * README-hacking: Tell people to run ./bootstrap. 39359 39360 2015-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 39361 39362 mips n32: fix preadv/pwritev offset decoding. 39363 In mips n32 abi, like in most of 32-bit architectures, offset 39364 is passed to preadv/pwritev syscalls using two syscall arguments. 39365 39366 * io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove. 39367 39368 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 39369 39370 tests: skip ipc_sem.test on broken kernels. 39371 Rather than trigger an ERROR which fails `make check`, go with SKIP 39372 instead. We don't want the testsuite failing due to kernel bugs. 39373 39374 * tests/ipc_sem.c (main): Change 99 to 77. 39375 39376 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 39377 39378 tests: skip pc.test on s390. 39379 The s390 hardware can't support an exact si_addr, and the current kernels 39380 don't handle text addresses correctly at all. Until that improves, skip 39381 the test on s390. 39382 39383 * tests/pc.c (main): Return 77 on s390 systems. 39384 39385 2015-03-03 Mike Frysinger <vapier (a] gentoo.org> 39386 39387 tests: note the kernel configs for -yy options. 39388 * tests/net-yy.test: Note CONFIG_INET_TCP_DIAG. 39389 * tests/unix-yy.test: Note CONFIG_UNIX_DIAG. 39390 39391 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 39392 39393 alpha: fix -yy decoding. 39394 * socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary. 39395 39396 Reported-and-tested-by: Mike Frysinger <vapier (a] gentoo.org> 39397 39398 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 39399 39400 aarch64, x32: fix decoding of compat personality statfs64/fstatfs64. 39401 * statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same 39402 attributes as on X86_64. 39403 39404 mips: fix compilation warning. 39405 * syscall.c (get_scno) [MIPS]: Fix harmless compilation warning 39406 about comparison between signed and unsigned integer expressions. 39407 39408 x32: fix compilation warnings. 39409 * sysinfo.c (sys_sysinfo): Use ll length format modifier 39410 instead of l and cast kernel ulong types to unsigned long long. 39411 39412 aarch64: add -i option support. 39413 * syscall.c (print_pc): Add aarch64 support. 39414 39415 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 39416 39417 ioctl: use x32 specific ioctl entries on x32 personality. 39418 As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h 39419 (by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32 39420 specific ioctl entries on x32 personality. 39421 39422 * linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh. 39423 * linux/x86_64/ioctlent2.h: Remove. 39424 * linux/x86_64/ioctls_arch2.h: New file. 39425 * linux/x86_64/ioctls_inc2.h: New file. 39426 * Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add 39427 linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h. 39428 39429 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 39430 39431 tests/uid16: skip if real uid is larger than 16bit. 39432 * tests/uid16.c (main): Skip if the uid returned by getuid matches 39433 /proc/sys/kernel/overflowuid. 39434 39435 2015-03-02 Dmitry V. Levin <ldv (a] altlinux.org> 39436 39437 tests: fix uid tests on big endian architectures. 39438 * tests/uid.c (main): Ignore uids returned by getresuid to avoid 39439 16bit vs 32bit issues on big endian architectures. 39440 Change real UID instead of effective UID in setresuid test. 39441 * tests/uid16.c (main): Likewise. 39442 * tests/uid32.c (main): Change real UID instead of effective UID 39443 in setresuid test to match uid.c 39444 * tests/uid.awk: Update setresuid regexp. 39445 39446 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 39447 39448 2015-03-01 Mike Frysinger <vapier (a] gentoo.org> 39449 39450 tests/getdents: handle older getdents calls. 39451 If the tools we use call older getdents syscalls where d_type isn't 39452 passed back, or the arch is old (like Alpha) and can't pass back in 39453 either version, make sure we don't fail. 39454 39455 * tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN. 39456 39457 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 39458 39459 Fix multiple personalities support in decoding syscall return values. 39460 * syscall.c (trace_syscall_exiting): When current personality is 32bit, 39461 print 32bit return code. 39462 39463 Update generic 64-bit ioctlent from linux v3.19. 39464 * linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh. 39465 39466 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 39467 39468 sparc, sparc64: fix rt_sigaction decoding. 39469 Fix regression introduced by commit v4.9-9-gc3a5c01. 39470 39471 * signal.c (HAVE_SA_RESTORER): New macro. 39472 [HPPA || IA64]: Do not undefine SA_RESTORER. 39473 (old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER 39474 instead of SA_RESTORER to check whether to define sa_restorer. 39475 (decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in 39476 addition to SA_RESTORER to check whether to use sa_restorer. 39477 39478 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 39479 39480 Fix stack buffer overflow when specified command is too long. 39481 * strace.c (startup_child): Check that the length of the command strace 39482 is going to execute does not exceed PATH_MAX limit. 39483 39484 Reported-by: Cheolung Lee <chpie (a] grayhash.com> 39485 39486 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 39487 39488 build: include ptrace.h after regs.h. 39489 Restore the order of including <sys/reg.h> and <linux/ptrace.h> 39490 headers that was inadvertently changed by commit v4.9-280-g5503dd2. 39491 39492 This should fix build on platforms like m68k where some constants 39493 are defined simultaneously as enums by <sys/reg.h> and as macros 39494 by <asm/ptrace.h>. 39495 39496 * process.c: Include "ptrace.h" after "regs.h". 39497 * signal.c: Likewise. 39498 * syscall.c: Likewise. 39499 * util.c: Likewise. 39500 39501 2015-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 39502 39503 x32: fix decoding of timeval, timespec, and timex structures. 39504 As time_t is a 64-bit type in x32 personality, it is not correct to 39505 treat it as a long int type. 39506 39507 * time.c (current_time_t_is_compat): New macro. 39508 (sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it. 39509 (tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t 39510 when printing tv_sec/tv_usec. 39511 (tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex 39512 members of type kernel_long_t. 39513 39514 2015-02-28 Mike Frysinger <vapier (a] gentoo.org> 39515 39516 tests/ipc_sem: detect broken kernels. 39517 When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc 39518 logic wrongly returns errors. Detect that and throw an error. 39519 39520 * tests/ipc_sem.c: Return 99 when errno is EFAULT. 39521 * tests/ipc_sem.test: Save output to $OUT and show it when failing. 39522 Handle exit status 99 to throw an ERROR. 39523 39524 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 39525 39526 build: do not link strace with -ldl. 39527 * configure.ac: Fix dladdr check. 39528 39529 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 39530 39531 Handle broken PTRACE_EVENT_STOP values. 39532 For a few linux releases (3.1 through 3.3), this define in the exported 39533 headers were broken. Redefine if that's the case. 39534 39535 * ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7. 39536 39537 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 39538 39539 bootstrap: always set up test dirs. 39540 When files get updated, the bootstrap script should make sure the 39541 parallel dirs are kept in sync. 39542 39543 * bootstrap: Always generate the test$m. Clean up symlinks first. 39544 Don't link in Makefile.in files. 39545 39546 2015-02-27 Mike Frysinger <vapier (a] gentoo.org> 39547 39548 Fix cross-compiling of ioctlsort. 39549 Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross 39550 compiling. This way ioctlsort uses the build tools all the time. 39551 39552 * configure.ac: Call AX_PROG_CC_FOR_BUILD. 39553 * Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD. 39554 (ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD. 39555 (ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD. 39556 (ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD. 39557 (ioctlsort_LD): Delete. 39558 (ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT). Use ioctlsort_CFLAGS. 39559 * m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package. 39560 39561 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 39562 39563 tests: robustify pc.test. 39564 * configure.ac: Check for dladdr in -ldl. 39565 * tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS). 39566 * tests/pc.c: Include "config.h" and <dlfcn.h>. 39567 (main): Use dladdr to find the address to unmap. 39568 39569 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 39570 39571 tests: drop support for alternative names of select syscall. 39572 This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824. 39573 39574 * tests/select.awk: Drop _newselect support. 39575 * tests/select.test: Skip if select syscall is not supported. 39576 39577 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 39578 39579 Rename _newselect to select. 39580 As an exception to the general rules that syscall names should match 39581 __NR_* constants defined in kernel headers, show select as "select" 39582 and old select as "oldselect". 39583 39584 * linux/arm/syscallent.h (82): Change name to oldselect. 39585 * linux/hppa/syscallent.h (142): Change name to select. 39586 * linux/mips/syscallent-n32.h (6022): Likewise. 39587 * linux/mips/syscallent-n64.h (5022): Likewise. 39588 * linux/mips/syscallent-o32.h (4142): Likewise. 39589 * linux/sparc/syscallent.h (230): Likewise. 39590 39591 2015-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 39592 39593 sparc: sync syscall entries with kernel headers. 39594 * linux/sparc/syscallent.h: Fix syscall entries for vmsplice, 39595 inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch, 39596 ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and 39597 sched_setaffinity. 39598 (67, 68, 202, 230): Change syscall names to match __NR_* constants 39599 defined in arch/sparc/include/uapi/asm/unistd.h. 39600 39601 2015-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 39602 39603 s390, s390x: sync syscall entry names with kernel headers. 39604 * linux/s390/syscallent.h (1, 180, 181): Change syscall names to match 39605 __NR_* constants defined in arch/s390/include/uapi/asm/unistd.h. 39606 * linux/s390x/syscallent.h: Likewise. 39607 39608 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39609 39610 xlat: avoid fork bombing the build system. 39611 When there were fewer xlat headers, this didn't matter as much. 39612 But now with >200, trying to run them all in parallel can easily 39613 fork bomb smaller systems. 39614 39615 * xlat/gen.sh (main): Do not more jobs than # of cpus. 39616 39617 2015-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 39618 39619 arm: sync syscall entry names with kernel. 39620 * linux/arm/syscallent.h (82, 90, 180, 181, 327): 39621 Change syscall names to match __NR_* constants defined 39622 in arch/arm/include/uapi/asm/unistd.h. 39623 39624 arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries 39625 * linux/arm/syscallent.h (320, 321, 350): Fix names and handlers. 39626 39627 hppa: sync syscall entry names with kernel. 39628 * linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280): 39629 Change syscall names to match __NR_* constants defined in 39630 arch/parisc/include/uapi/asm/unistd.h. 39631 39632 subcall.h: add sendmmsg entry. 39633 * linux/subcall.h: Add sys_sendmmsg entry. 39634 (SYS_socket_nsubcalls): Update. 39635 39636 arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition. 39637 * linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall. 39638 39639 ia64: parametrize i386 syscallent size check. 39640 * linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls) 39641 instead of numeric constant. 39642 39643 Cleanup linux/subcall.h. 39644 * linux/subcall.h: Use SYS_ipc_subcall. 39645 39646 alpha: fix statfs decoding. 39647 * statfs.c (printstatfs) [ALPHA]: Remove faulty code. 39648 39649 x32: fix build regression. 39650 * linux/x32/arch_regs.h: New file. 39651 * Makefile.am (EXTRA_DIST): Add it. 39652 39653 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39654 39655 hppa: fix fanotify_mark decoding. 39656 The parisc kernel has some legacy baggage here and decodes the 64bit 39657 field in the reverse order. Handle it in strace too. 39658 39659 * fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits. 39660 39661 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39662 39663 ia64: fix decoding of getresuid/getresgid/setresgid. 39664 Looks like the similarity of these names caused confusion when generating 39665 the syscall table. getresgid was wired to the wrong output while the other 39666 two were wired up to printargs instead of the real printer. 39667 39668 * linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to 39669 sys_getresgid, and setresgid to sys_setresgid. 39670 39671 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39672 39673 ia64: fix up builds after 16bit uid support. 39674 The ia64 port pulls in the i386 syscall table so it can decode 39675 32bit apps, so we need to enable the 16bit uid parsers for it. 39676 39677 * defs.h (NEED_UID16_PARSERS): Define to 1 for IA64. 39678 * linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings. 39679 39680 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39681 39682 v4l2: use uintmax_t for times. 39683 There is no guarantee that the backing value for the various time fields 39684 are ints or longs which makes printfs annoying. Lets cast them to the 39685 uintmax_t type so we can use the j flag and not worry about truncation. 39686 39687 * v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec. 39688 39689 2015-02-26 Mike Frysinger <vapier (a] gentoo.org> 39690 39691 ignore core/compile files. 39692 Newer autotools includes a compile helper script. 39693 39694 * .gitignore: Add /compile and core. 39695 39696 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 39697 39698 NEWS: Prepare for 4.10 release. 39699 39700 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 39701 39702 Remove support for systems without PTRACE_SETOPTIONS. 39703 Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS 39704 and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE 39705 are universally available. 39706 39707 This change removes all code that implemented post-execve SIGTRAP 39708 handling and fork/vfork/clone->CLONE_PTRACE substitution. 39709 39710 * defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros. 39711 (need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations. 39712 * strace.c (need_fork_exec_workarounds, 39713 test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all): 39714 Remove. 39715 (syscall_trap_sig): Set to (SIGTRAP | 0x80). 39716 (ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC). 39717 (detach): Do not test for TCB_BPTSET. 39718 (init): Do not call test_ptrace_setoptions_followfork and 39719 test_ptrace_setoptions_for_all. Do not test for TCB_BPTSET. 39720 * syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec, 39721 syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove. 39722 (trace_syscall_entering): Do not test for TCB_WAITEXECVE. Do not call 39723 syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec. 39724 (trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and 39725 syscall_fixup_for_fork_exec. 39726 [IA64] (ia64_ia32mode): Make static. 39727 * linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration. 39728 * util.c: Do not include "syscall.h". 39729 (arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0, 39730 restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt): 39731 Remove. 39732 * tests/ptrace_setoptions.test: Remove. 39733 * tests/Makefile.am (TESTS): Remove it. 39734 39735 2015-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 39736 39737 tests: robustify pc.test. 39738 * tests/pc.c (main): Unmap larger memory region. 39739 Dump process map for debug purposes. 39740 * tests/pc.test: Update regexps to take CLD_DUMPED child process 39741 into account. 39742 39743 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 39744 39745 tests: fix "make dist" regression. 39746 * tests/Makefile.am (EXTRA_DIST): Add getrandom.awk. 39747 39748 tests: workaround broken awk. 39749 * tests/getdents.out: New file. 39750 * tests/Makefile.am (EXTRA_DIST): Add it. 39751 * tests/getdents.test: Check whether awk is capable of matching long 39752 regular expressions. 39753 39754 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 39755 39756 Fix compilation warnings about incompatible print formats. 39757 On some platforms printing of __s64 types with "%lld" format, 39758 or __u64 types with "%llu" or "%llx" formats causes a warning 39759 that __s64/__u64 type is not compatible with long long format. 39760 From my PoV, this is nonsense, but the workaround costs nothing. 39761 39762 * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types 39763 to (unsigned long long). 39764 * v4l2.c (v4l2_ioctl): Likewise. Cast __s64 type to (long long). 39765 39766 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 39767 39768 powerpc64: fix build regression. 39769 * linux/powerpc64/arch_regs.h: New file. 39770 * Makefile.am (EXTRA_DIST): Add it. 39771 39772 signalent: update from linux v3.19. 39773 * linux/alpha/signalent.h: Update from linux v3.19 signalent.sh. 39774 * linux/hppa/signalent.h: Likewise. 39775 * linux/mips/signalent.h: Likewise. 39776 * linux/sparc/signalent.h: Likewise. 39777 39778 Cleanup auxiliary signalent files. 39779 * linux/aarch64/signalent1.h: Include "signalent.h". 39780 * linux/powerpc64/signalent1.h: Likewise. 39781 * linux/sparc64/signalent2.h: Likewise. 39782 * linux/tile/signalent1.h: Likewise. 39783 * linux/x32/signalent1.h: Likewise. 39784 * linux/x86_64/signalent1.h: Likewise. 39785 * linux/x86_64/signalent2.h: Likewise. 39786 * linux/sparc64/signalent.h: Include "sparc/signalent.h". 39787 * linux/sparc64/signalent1.h: Include "sparc/signalent1.h". 39788 * linux/x32/signalent.h: Remove. 39789 * Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h. 39790 39791 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 39792 39793 x86_64, x32: fix sys_sigreturn. 39794 On x86_64/x32, sys_sigreturn is defined only for i386 personality. 39795 39796 * signal.c (sys_sigreturn): Define for X32. 39797 (sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only. 39798 39799 2015-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 39800 39801 sparc, x32: fix build regression. 39802 * syscall.c (print_pc): Use current_wordsize iff it is defined. 39803 39804 Change errnoent.h files to use designated initializers. 39805 * signal.c (printsiginfo): Allow elements of errnoent array to be zero. 39806 * syscall.c (trace_syscall_exiting): Likewise. 39807 * errnoent.sh: Output designated initializers. 39808 * linux/errnoent.h: Regenerated. 39809 * linux/alpha/errnoent.h: Regenerated. 39810 * linux/hppa/errnoent.h: Regenerated. 39811 * linux/mips/errnoent.h: Regenerated. 39812 * linux/sparc/errnoent.h: Regenerated. 39813 * linux/sparc/errnoent1.h: Regenerated. 39814 * linux/powerpc/errnoent.h: New file. 39815 * linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h". 39816 * Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h 39817 and linux/powerpc64/errnoent.h. 39818 39819 errnoent: update from linux v3.19. 39820 * linux/errnoent.h: Update from linux v3.19 using errnoent.sh. 39821 * linux/alpha/errnoent.h: Likewise. 39822 * linux/hppa/errnoent.h: Likewise. 39823 * linux/mips/errnoent.h: Likewise. 39824 * linux/sparc/errnoent.h: Likewise. 39825 39826 Cleanup auxiliary errnoent files. 39827 * linux/aarch64/errnoent1.h: Include "errnoent.h". 39828 * linux/powerpc64/errnoent1.h: Likewise. 39829 * linux/sparc64/errnoent2.h: Likewise. 39830 * linux/tile/errnoent1.h: Likewise. 39831 * linux/x32/errnoent1.h: Likewise. 39832 * linux/x86_64/errnoent1.h: Likewise. 39833 * linux/x86_64/errnoent2.h: Likewise. 39834 * linux/sparc64/errnoent.h: Include "sparc/errnoent.h". 39835 * linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h". 39836 * linux/x32/errnoent.h: Remove. 39837 * Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h. 39838 39839 2015-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 39840 39841 evdev: update constants from linux v3.19. 39842 * xlat/evdev_keycode.in: Update from linux v3.19. 39843 * xlat/evdev_prop.in: Likewise. 39844 39845 evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands. 39846 * evdev.c (keycode_V2_ioctl): Use evdev_keycode to print 39847 input_keymap_entry.keycode. 39848 39849 evdev: fix build with old kernel headers. 39850 * configure.ac: Check whether struct input_absinfo.resolution is defined 39851 in <linux/input.h>. 39852 * evdev.c (SYN_MAX): Add fallback definition. 39853 (abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check. 39854 (keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks. 39855 (evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW, 39856 EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW. 39857 (evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP, 39858 EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE. 39859 39860 2015-02-22 Etienne Gemsa <etienne.gemsa (a] lse.epita.fr> 39861 39862 Add decoding for evdev ioctls. 39863 This patch introduces decoding for evdev ioctls. For EVIOCSFF the five 39864 first members are decoded, the union is not. The code was compiled and 39865 tested on x86_64 with Linux 3.13. 39866 39867 * evdev.c: New file. 39868 * Makefile.am (strace_SOURCES): Add it. 39869 * defs.h (evdev_ioctl): New prototype. 39870 * ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands. 39871 * xlat/evdev_autorepeat.in: New file. 39872 * xlat/evdev_ff_status.in: New file. 39873 * xlat/evdev_ff_types.in: New file. 39874 * xlat/evdev_keycode.in: New file. 39875 * xlat/evdev_leds.in: New file. 39876 * xlat/evdev_misc.in: New file. 39877 * xlat/evdev_mtslots.in: New file. 39878 * xlat/evdev_prop.in: New file. 39879 * xlat/evdev_relative_axes.in: New file. 39880 * xlat/evdev_snd.in: New file. 39881 * xlat/evdev_switch.in: New file. 39882 * xlat/evdev_sync.in: New file. 39883 39884 2015-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 39885 39886 Fix build with old kernel headers. 39887 * strace.c (print_debug_info, maybe_allocate_tcb, print_signalled, 39888 print_exited): Remove "const" qualifier from status variable to 39889 workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED 39890 macros. 39891 * v4l2.c: Include <linux/types.h>. 39892 (v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS 39893 macros are defined. 39894 * tests/Makefile.am (AM_CPPFLAGS): Define. 39895 39896 Fix "make dist" regression. 39897 * Makefile.am (EXTRA_DIST): Remove README-linux. 39898 39899 2015-02-20 Elliott Hughes <enh (a] google.com> 39900 39901 test/sfd.c: add missing includes. 39902 39903 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 39904 39905 Remove linux/fanotify.h. 39906 * linux/fanotify.h: Remove. 39907 * Makefile.am (EXTRA_DIST): Remove it. 39908 * fanotify.c: Do not include <linux/fanotify.h>. 39909 * xlat/fan_classes.in: Add default values. 39910 * xlat/fan_event_flags.in: Likewise. 39911 * xlat/fan_init_flags.in: Likewise. 39912 * xlat/fan_mark_flags.in: Likewise. 39913 39914 Remove linux/keyctl.h. 39915 * linux/keyctl.h: Remove. 39916 * Makefile.am (EXTRA_DIST): Remove it. 39917 * keyctl.c: Do not include <linux/keyctl.h>. 39918 * xlat/key_perms.in: Add default values. 39919 * xlat/key_reqkeys.in: Likewise. 39920 * xlat/key_spec.in: Likewise. 39921 * xlat/keyctl_commands.in: Likewise. 39922 39923 Remove linux/kexec.h. 39924 * linux/kexec.h: Remove. 39925 * Makefile.am (EXTRA_DIST): Remove it. 39926 * kexec.c: Do not include <linux/kexec.h>. 39927 * xlat/kexec_arch_values.in: Add default values. 39928 * xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default 39929 values. 39930 39931 Remove linux/inotify.h. 39932 * linux/inotify.h: Remove. 39933 * Makefile.am (EXTRA_DIST): Remove it. 39934 * inotify.c: Do not include <linux/inotify.h>. 39935 * xlat/inotify_flags.in: Add default values. 39936 39937 Remove linux/reboot.h. 39938 * linux/reboot.h: Remove. 39939 * Makefile.am (EXTRA_DIST): Remove it. 39940 * reboot.c: Do not include <linux/reboot.h>. 39941 * xlat/bootflags1.in: Add default values. 39942 * xlat/bootflags2.in: Likewise. 39943 * xlat/bootflags3.in: Likewise. 39944 39945 seccomp: fix fallback definitions of some SECCOMP_* constants. 39946 * seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER, 39947 SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions. 39948 * xlat/seccomp_filter_flags.in: Add default value. 39949 * xlat/seccomp_ops.in: Add default values. 39950 39951 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 39952 39953 is_negated_errno: sync MAX_ERRNO with the kernel. 39954 Linux kernel used to guarantee that the largest errno value will not 39955 exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit 39956 v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently 39957 broke it. The guarantee is back with kernel commit 39958 v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d. 39959 39960 * syscall.c (is_negated_errno): Set maximum errno value to 4095. 39961 39962 2015-02-19 Mike Frysinger <vapier (a] gentoo.org> 39963 39964 README-linux: punt. 39965 Considering we're requiring linux-2.6 era kernels, the discussion of 39966 header troubles that plagued 2.2 and 2.4 are no longer relevant. 39967 39968 * README-linux: Delete. 39969 39970 2015-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 39971 39972 Improve prctl decoding. 39973 * configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h. 39974 * prctl.c (sys_prctl): Implement full decoding of all PR_* constants 39975 as defined in linux v3.19. 39976 (sys_arch_prctl): Fix decoding of unknown commands. 39977 * xlat/cap.in: New file. 39978 * xlat/pr_mce_kill.in: New file. 39979 * xlat/pr_mce_kill_policy.in: New file. 39980 * xlat/pr_set_mm.in: New file. 39981 * xlat/pr_tsc.in: New file. 39982 * xlat/pr_unalign_flags.in: New file. 39983 * xlat/secbits.in: New file. 39984 * xlat/prctl_options.in: Remove non-linux constants, add fallback 39985 definitions. 39986 * xlat/seccomp_mode.in: Add fallback definitions. 39987 39988 xlat: extend syntax. 39989 * xlat/gen.sh (gen_header): If the name of constant is specified with a 39990 value, generate a default definition for the constant using this value. 39991 * xlat/timerfdflags.in: Use extended syntax. 39992 39993 Move CAP_* definitions out to header files. 39994 * Makefile.am (strace_SOURCES): Add caps0.h and caps1.h. 39995 * caps0.h: New file. 39996 * caps1.h: New file. 39997 * capability.c: Remove CAP_* definitions, include "caps0.h" 39998 and "caps1.h" instead. 39999 Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h". 40000 Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h". 40001 (print_cap_bits): Update callers. 40002 * xlat/capabilities.in: Rename to xlat/cap_mask0.in. 40003 * xlat/capabilities1.in: Rename to xlat/cap_mask1.in. 40004 40005 2015-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 40006 40007 Declare all format printers with printf format attribute. 40008 * defs.h (printllval, printnum_int, printnum_long): Mark with 40009 format(printf) attribute. 40010 * sock.c (sock_ioctl): Fix format string. 40011 40012 2015-02-17 Dmitry V. Levin <ldv (a] altlinux.org> 40013 40014 Rename printnum to printnum_long to avoid confusion. 40015 * defs.h (printnum): Rename to printnum_long. 40016 * util.c (printnum): Likewise. 40017 * process.c (sys_ptrace): Likewise. 40018 * time.c (sys_time): Likewise. 40019 40020 Use printnum_int consistently. 40021 * sock.c (sock_ioctl): Use printnum_int instead of printnum to print 40022 integer type. 40023 * stream.c (sys_getpmsg): Likewise. 40024 40025 2015-02-16 Dmitry V. Levin <ldv (a] altlinux.org> 40026 40027 print_pc: fix multiple personalities support. 40028 * syscall.c (print_pc): Choose instruction pointer format depending 40029 on current_wordsize, not the size of long integer type. 40030 * tests/pc.c: New file. 40031 * tests/pc.test: New test. 40032 * tests/Makefile.am (check_PROGRAMS): Add pc. 40033 (TESTS): Add pc.test. 40034 * tests/.gitignore: Add pc. 40035 40036 mips: use PTRACE_GETREGS to fetch all registers. 40037 * linux/mips/arch_regs.h (struct mips_regs): New structure. 40038 (mips_REG_*): New macros. 40039 * signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP. 40040 * syscall.c [MIPS] (struct mips_regs): New variable. 40041 [MIPS] (ARCH_REGS_FOR_GETREGS): New macro. 40042 (mips_a3, mips_r2): Remove. 40043 (print_pc) [MIPS]: Use mips_REG_EPC. 40044 (get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3. 40045 (get_syscall_args) [MIPS]: Use mips_REG_A[0-5]. 40046 (get_syscall_result) [MIPS]: Remove. 40047 (get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0. 40048 40049 mips: move ABI check to configure.ac. 40050 * configure.ac [MIPS]: Check for MIPS ABI. 40051 * defs.h [MIPS]: Remove MIPS ABI check. 40052 * ioctlsort.c: Likewise. 40053 40054 tests: support alternative names of select syscall. 40055 * tests/select.awk: Recognize "_newselect" as another name of "select". 40056 * tests/select.test: Try alternative names of select syscall. 40057 40058 2015-02-15 Dmitry V. Levin <ldv (a] altlinux.org> 40059 40060 i386: fix compilation warning. 40061 Some gcc versions complain about assigning long* to uint32_t* on i386. 40062 40063 * syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*. 40064 * linux/i386/arch_regs.h (i386_esp_ptr): Likewise. 40065 * linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h". 40066 (i386_esp_ptr): New prototype. 40067 40068 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 40069 40070 Do not reset get_regs_error unnecessarily. 40071 As get_regs() is now guaranteed to set get_regs_error, 40072 there is no need to reset get_regs_error before get_regs() call. 40073 40074 * strace.c (trace): Call clear_regs() iff !WIFSTOPPED. 40075 40076 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 40077 40078 get_syscall_result: remove redundant ifdefs. 40079 As get_regs() is now guaranteed to fetch registers when either 40080 ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can 40081 safely replace all checks for architectures where these macros are defined 40082 with a single check for these macros. 40083 40084 * syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET || 40085 ARCH_REGS_FOR_GETREGS]. Remove all checks for architectures where 40086 nothing has to be done after get_regs(). 40087 40088 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 40089 40090 get_regs: define for all architectures. 40091 * defs.h (get_regs_error): Remove. 40092 (clear_regs): Update prototype, declare unconditionally. 40093 (get_regs): Declare unconditionally. 40094 * syscall.c (clear_regs): New function. 40095 (get_regs): Define unconditionally. 40096 (get_regs_error): Define unconditionally, change scope to static. 40097 40098 get_regs: unify code for architectures that use PTRACE_GETREGS. 40099 * syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE] 40100 (ARCH_REGS_FOR_GETREGS): New macro. 40101 (get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures. 40102 40103 get_regset: define iff PTRACE_GETREGSET is used. 40104 * syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET, 40105 ARCH_IOVEC_FOR_GETREGSET): New macros. 40106 (get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change 40107 return type to long, return ptrace() return code instead of assigning it 40108 to get_regs_error; do not list individual architectures, implement 40109 constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET. 40110 (get_regs): Assign get_regset() return code to get_regs_error. 40111 40112 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 40113 40114 arm, i386: switch back to use PTRACE_GETREGS. 40115 PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and 40116 i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS 40117 is a bit more costly, so choose the method that costs less. 40118 This partially reverts commit v4.7-149-gfaa177e. 40119 40120 * syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove. 40121 (get_regset) [ARM || I386]: Remove. 40122 (get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally. 40123 40124 2015-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 40125 40126 syscall.c: remove obsolete ifdefs. 40127 * syscall.c (get_regset, get_regs): Do not check for availability 40128 of PTRACE_GETREGSET and NT_PRSTATUS macros. 40129 40130 syscall.c: ensure that NT_PRSTATUS is defined. 40131 * syscall.c: Do not include <elf.h>. 40132 (NT_PRSTATUS): New macro. 40133 40134 2015-02-13 Dmitry V. Levin <ldv (a] altlinux.org> 40135 40136 Move regs-related macros and declarations from defs.h to regs.h. 40137 * regs.h: New file. 40138 * Makefile.am (strace_SOURCES): Add it. 40139 * linux/arch_regs.h: New file. 40140 * linux/alpha/arch_regs.h: Likewise. 40141 * linux/arm/arch_regs.h: Likewise. 40142 * linux/hppa/arch_regs.h: Likewise. 40143 * linux/i386/arch_regs.h: Likewise. 40144 * linux/ia64/arch_regs.h: Likewise. 40145 * linux/mips/arch_regs.h: Likewise. 40146 * linux/powerpc/arch_regs.h: Likewise. 40147 * linux/sh64/arch_regs.h: Likewise. 40148 * linux/sparc/arch_regs.h: Likewise. 40149 * linux/sparc64/arch_regs.h: Likewise. 40150 * linux/tile/arch_regs.h: Likewise. 40151 * linux/x86_64/arch_regs.h: Likewise. 40152 * Makefile.am (EXTRA_DIST): Add them. 40153 * defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*, 40154 and ARM_* macros. 40155 Remove declarations of struct pt_regs variables. 40156 [SPARC]: Do not include <asm/psr.h>. 40157 [SPARC64]: Do not include <asm/psrcompat.h>. 40158 * bjm.c: Do not include <sys/user.h>. 40159 * process.c: Include "regs.h". 40160 Do not include <sys/user.h> and <sys/reg.h>. 40161 [IA64]: Do not include <asm/ptrace_offsets.h> and <asm/rse.h>. 40162 * util.c: Likewise. 40163 * syscall.c: Likewise. 40164 [AARCH64]: Define struct arm_pt_regs and ARM_* macros. 40165 [SPARC]: Include <asm/psr.h>. 40166 [SPARC64]: Include <asm/psrcompat.h>. 40167 * signal.c: Include "regs.h". 40168 Do not include <sys/user.h> and <sys/reg.h>. 40169 [IA64]: Do not include <asm/ptrace_offsets.h>. 40170 * strace.c [IA64]: Do not include <asm/ptrace_offsets.h>. 40171 40172 Move all ptrace-related macros and declarations from defs.h to ptrace.h. 40173 * ptrace.h: New file. 40174 * Makefile.am (strace_SOURCES): Add it. 40175 * configure.ac (AC_CHECK_HEADERS): Remove linux/ptrace.h and sys/ptrace.h. 40176 * defs.h: Do not include <sys/ptrace.h> and <asm/ptrace.h>. 40177 Remove definitions of PTRACE_* macros. 40178 * process.c: Remove <linux/ptrace.h> workarounds, include "ptrace.h". 40179 * signal.c: Likewise. 40180 * syscall.c: Likewise. 40181 * util.c: Likewise. 40182 * strace.c: Include "ptrace.h". 40183 * wait.c: Likewise. 40184 40185 2015-02-12 Dmitry V. Levin <ldv (a] altlinux.org> 40186 40187 Enhance wait status decoding. 40188 * xlat/ptrace_events.in: New file. 40189 * wait.c: Include "xlat/ptrace_events.h". 40190 (printstatus): In case of WIFSTOPPED, print 0x80 flag separately from 40191 the stop signal name. 40192 [WIFCONTINUED]: Add WIFCONTINUED support. 40193 Decode PTRACE_EVENT_* events. 40194 40195 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 40196 40197 scsi: add bsg support. 40198 The Linux kernel supports two different versions of the SG_IO API, 40199 namely v3 and v4. This patch adds support for version 4 of this API. 40200 At least the sg3_utils package supports version 4 of this API. Version 40201 4 of this API is used if /dev/bsg/H:C:I:L is used as device name. 40202 40203 This patch has been tested by inspecting the output of the following 40204 commands: 40205 40206 modprobe scsi_debug dev_size_mb=16 delay=0 40207 dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p') 40208 ./strace -eioctl -s256 sg_inq $dev 40209 echo 'Test XDWRITEREAD(10)' 40210 bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p') 40211 dd if=/dev/zero bs=512 count=1 | 40212 ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00 40213 40214 * configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h. 40215 * xlat/bsg_protocol.in: New file. 40216 * xlat/bsg_subprotocol.in: Likewise. 40217 * scsi.c: Include them and <linux/bsg.h>. 40218 (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, 40219 print_sg_io_v4_res): New functions. 40220 (print_sg_io_req, print_sg_io_res): Use them. 40221 (scsi_ioctl): Update callers. 40222 40223 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 40224 40225 scsi: Add iovec support. 40226 * scsi.c (print_sg_io_req, print_sg_io_res): Add support for decoding 40227 iovecs passed via the SG I/O v3 interface. Decode the "data in" and 40228 "data out" buffers in hex instead of in ASCII. 40229 40230 scsi: on exit, print only initialized part of the buffer. 40231 * scsi.c (print_sg_io_res): Only print that part of the data in buffer 40232 that has been initialized by the SCSI LLD driver. 40233 40234 scsi: make print_sg_io_buffer() print square brackets instead of its callers 40235 * scsi.c (print_sg_io_buffer): Print square brackets in this function. 40236 (print_sg_io_req, print_sg_io_res): Update callers. 40237 40238 2015-02-08 Bart Van Assche <bart.vanassche (a] sandisk.com> 40239 40240 scsi: improve consistency with other decoding functions. 40241 Pass pointers to tracee's memory as integers instead of pointers. 40242 40243 * scsi.c (print_sg_io_buffer): Change second argument's type to 40244 unsigned long. 40245 (print_sg_io_req, print_sg_io_res): Update callers. 40246 40247 2015-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 40248 40249 tests: extend getdents to support all filesystems regardless of file order 40250 * tests/getdents.awk: Include all 6 possible permutations of 3 40251 direntries to regexps. 40252 40253 2015-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 40254 40255 print_setsockopt: fix fall-through bug in SOL_IP switch case. 40256 This fixes the bug introduced by commit v4.9-250-ga0a4909. 40257 40258 * net.c (print_setsockopt): Separate SOL_IP case from SOL_PACKET. 40259 40260 Reported-by: Ben Noordhuis <info (a] bnoordhuis.nl> 40261 40262 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 40263 40264 Do not watch for post-execve SIGTRAP if PTRACE_O_TRACEEXEC is enabled. 40265 If PTRACE_O_TRACEEXEC option is enabled, then post-execve SIGTRAPs are 40266 suppressed and we can safely skip -ENOSYS heuristics. This partially 40267 reverts commits v4.9-258-g8e398b6 and v4.9-261-gd70c41d. 40268 40269 * syscall.c (syscall_fixup_on_sysenter): Skip if PTRACE_O_TRACEEXEC 40270 flag is set in ptrace_setoptions. Remove all SECCOMP_RET_ERRNO 40271 workarounds as they are not needed when PTRACE_O_TRACEEXEC is not 40272 supported by the kernel. 40273 40274 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 40275 40276 When the process stared by strace exits/terminates, forget its pid. 40277 The process stared by strace can exit/terminate only once. When this 40278 happens, forget its pid, so that any other event or action related to a 40279 process with the same pid as the pid of that first process would not be 40280 confused with that first process. 40281 40282 * strace.c (print_signalled, print_exited): Clear strace_child when it 40283 equals to the given pid. 40284 40285 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 40286 40287 -b execve: avoid misleading warning about unknown pid. 40288 * strace.c (maybe_allocate_tcb): If detach_on_execve is set, do not warn 40289 about !WIFSTOPPED process with pid == strace_child. 40290 * tests/bexecve.test: New test. 40291 * tests/Makefile.am (TESTS): Add it. 40292 40293 -b execve: do not use struct tcb after detach. 40294 * strace.c (trace): Do not proceed after detach. 40295 40296 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 40297 40298 trace: split into several functions. 40299 This change moves the main loop back to main() and splits trace() 40300 into several functions. There are no algorithmic changes. 40301 40302 * strace.c (print_debug_info, maybe_allocate_tcb, maybe_switch_tcbs, 40303 print_signalled, print_exited, print_stopped, startup_tcb): New 40304 functions. 40305 (trace) Use them. Move the main loop ... 40306 (main): ... here. 40307 40308 2015-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 40309 40310 printsiginfo: constify the first argument. 40311 * signal.c (printsiginfo): Make the first argument a pointer to a const type. 40312 * defs.h (printsiginfo): Likewise. 40313 (printsiginfo, printsiginfo_at): Always define these prototypes. 40314 * configure.ac (AC_CHECK_TYPES): Remove siginfo_t, as HAVE_SIGINFO_T 40315 is no longer used. 40316 40317 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40318 40319 test: add a manual test for seccomp decoding. 40320 * test/.gitignore: Add seccomp. 40321 * test/Makefile (PROGS): Likewise. 40322 * test/seccomp.c: New file. 40323 * test/README: Mention ../tests/. 40324 40325 Implement seccomp decoding. 40326 * configure.ac (AC_CHECK_HEADERS): Add linux/filter.h 40327 and linux/seccomp.h. 40328 * defs.h (print_seccomp_filter): New prototype. 40329 * linux/dummy.h (sys_seccomp): Remove. 40330 * linux/syscall.h (sys_seccomp): New prototype. 40331 * prctl.c: Include <linux/seccomp.h>. 40332 (sys_prctl): Decode PR_SET_SECCOMP. 40333 * seccomp.c: New file. 40334 * Makefile.am (strace_SOURCES): Add it. 40335 * xlat/bpf_class.in: New file. 40336 * xlat/bpf_miscop.in: Likewise. 40337 * xlat/bpf_mode.in: Likewise. 40338 * xlat/bpf_op_alu.in: Likewise. 40339 * xlat/bpf_op_jmp.in: Likewise. 40340 * xlat/bpf_rval.in: Likewise. 40341 * xlat/bpf_size.in: Likewise. 40342 * xlat/bpf_src.in: Likewise. 40343 * xlat/seccomp_filter_flags.in: Likewise. 40344 * xlat/seccomp_mode.in: Likewise. 40345 * xlat/seccomp_ops.in: Likewise. 40346 * xlat/seccomp_ret_action.in: Likewise. 40347 40348 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40349 40350 is_negated_errno: support large errno values. 40351 Thanks to SECCOMP_RET_DATA == 0xffff, abnormally large errno 40352 values could be easily seen when a seccomp filter is used, e.g. 40353 BPF_STMT(BPF_RET, SECCOMP_RET_ERRNO | SECCOMP_RET_DATA) 40354 40355 * syscall.c (is_negated_errno): Allow errno values as large as 0xffff. 40356 40357 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40358 40359 x86, x32, x86_64: print SECCOMP_RET_ERRNO filtered syscalls. 40360 This is required to process SECCOMP_RET_ERRNO filtered syscalls on 40361 systems where linux kernel does not change the syscall number to -1. 40362 40363 * syscall.c (is_negated_errno): Move before syscall_fixup_on_sysenter. 40364 (syscall_fixup_on_sysenter) [I386 || X32 || X86_64] : Use it to check 40365 AX register. 40366 40367 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40368 40369 is_negated_errno: merge x86_64 and x32 definitions. 40370 * syscall.c (kernel_long_t, kernel_ulong_t): New types. 40371 (is_negated_errno): Merge [X32] and [!X32] definitions. 40372 (get_error): Merge [X86_64] and [X32] code. 40373 40374 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40375 40376 x32: rename is_negated_errno_x32 to is_negated_errno. 40377 Use the same function name on all architectures. 40378 40379 * syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno. 40380 (get_error) [X32]: Update callers. 40381 40382 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40383 40384 x86, x32, x86_64: do not skip syscall number -1. 40385 Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. 40386 40387 * syscall.c (syscall_fixup_on_sysenter) [I386 || X32 || X86_64]: 40388 Do not skip syscalls that have number -1. 40389 40390 2015-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 40391 40392 x86_64: do not interpet syscall number -1 as a x32 personality syscall. 40393 Syscall number -1 might be a side effect of SECCOMP_RET_ERRNO filtering. 40394 40395 * syscall.c (get_scno) [X86_64]: Handle the case of scno == -1. 40396 40397 2015-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 40398 40399 Implement getrandom syscall decoding. 40400 * getrandom.c: New file. 40401 * Makefile.am (strace_SOURCES): Add it. 40402 * linux/dummy.h (sys_getrandom): Remove. 40403 * linux/syscall.h (sys_getrandom): New prototype. 40404 * xlat/getrandom_flags.in: New file. 40405 * tests/getrandom.c: New file. 40406 * tests/getrandom.awk: New file. 40407 * tests/getrandom.test: New test. 40408 * tests/Makefile.am (check_PROGRAMS): Add getrandom. 40409 (TESTS): Add getrandom.test. 40410 (EXTRA_DIST): Add getrandom.awk. 40411 * tests/.gitignore: Add getrandom. 40412 40413 2015-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 40414 40415 tests: add a test for select syscall decoding. 40416 Convert test/select.c into a regular test. 40417 40418 * test/Makefile (PROGS): Remove select. 40419 * test/.gitignore: Likewise. 40420 * test/select.c: Rewrite to ... 40421 * tests/select.c: ... new file. 40422 * tests/select.awk: New file. 40423 * tests/select.test: New test. 40424 * tests/Makefile.am (check_PROGRAMS): Add select. 40425 (TESTS): Add select.test. 40426 (EXTRA_DIST): Add select.awk. 40427 * tests/.gitignore: Add select. 40428 40429 2015-02-01 Dmitry V. Levin <ldv (a] altlinux.org> 40430 40431 tests: add a test for the latest dumpio fix. 40432 * tests/dumpio.expected: New file. 40433 * tests/unix-pair-send-recv.c: New file. 40434 * tests/dumpio.test: New test. 40435 * tests/Makefile.am (check_PROGRAMS): Add unix-pair-send-recv. 40436 (TESTS): Add dumpio.test. 40437 (EXTRA_DIST): Add dumpio.expected. 40438 * tests/.gitignore: Add unix-pair-send-recv. 40439 40440 2015-02-01 Aurelien Jacobs <aurel (a] gnuage.org> 40441 40442 Fix simultaneous -e read and -e write usage. 40443 This allows using both -e read=FD and -e write=FD at the same time 40444 with the same FD. 40445 Without this patch, the -e write=FD is ignored if -e read=FD is used 40446 at the same time. 40447 40448 2015-01-31 Dmitry V. Levin <ldv (a] altlinux.org> 40449 40450 net.c: remove unused HAVE_SIN6_SCOPE_ID_LINUX-based code. 40451 The AC_SIN6_SCOPE_ID autoconf macro that was able to define 40452 HAVE_SIN6_SCOPE_ID_LINUX was removed by commit v4.4-98-g64f793a. 40453 40454 * net.c [HAVE_SIN6_SCOPE_ID_LINUX]: Remove. 40455 40456 2015-01-30 Dmitry V. Levin <ldv (a] altlinux.org> 40457 40458 printsock: do not fetch sockaddr.sa_data twice. 40459 * net.c (printsock): Print addrbuf.sa.sa_data using print_quoted_string. 40460 40461 setsockopt: add decoding of MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP. 40462 * net.c (print_group_req): New function. 40463 (print_setsockopt): Use it. 40464 40465 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 40466 40467 tests: add a test for sockaddr_un.sun_path decoding. 40468 * tests/net-accept-connect.c: Allow long socket addresses. 40469 * tests/sun_path.test: New test. 40470 * tests/Makefile.am (TESTS): Add it. 40471 40472 printsock: print the whole sockaddr_un.sun_path. 40473 * net.c (printsock): If sockaddr_un.sun_path is not NUL-terminated, 40474 do not omit the last byte of sockaddr_un.sun_path array. 40475 40476 printsock: do not fetch sockaddr_un.sun_path twice. 40477 * net.c (printsock): Print addrbuf.sau.sun_path using 40478 print_quoted_string. 40479 40480 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 40481 40482 net: define all SOL_* constants. 40483 Ensure that all known SOL_* constants are defined. 40484 Sync the list of known SOL_* constants with linux/socket.h. 40485 40486 * net.c: Provide definitions for all SOL_* constants. 40487 Remove all SOL_* preprocessor conditionals. 40488 (socketlayers): Disconnect from inet_protocols. 40489 * xlat/socketlayers.in: Remove SOL_ICMP, add SOL_ALG and SOL_NFC. 40490 40491 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 40492 40493 setsockopt: decode PACKET_ADD_MEMBERSHIP. 40494 * xlat/packet_mreq_type.in: New file. 40495 * net.c: Include "xlat/packet_mreq_type.h". 40496 (print_packet_mreq): New function. 40497 (print_setsockopt): Use it. 40498 40499 2015-01-29 Dmitry V. Levin <ldv (a] altlinux.org> 40500 40501 getsockopt, setsockopt: do not decode structures in non-verbose mode. 40502 Move the code that is common between getsockopt and setsockopt parsers 40503 to a separate function. 40504 Move printers specific to getsockopt and setsockopt to separate 40505 functions, choose appropriate parsers depending on verbose mode. 40506 Move parsers of specific socket options to separate functions. 40507 40508 * net.c (printicmpfilter): Rename to print_icmp_filter. 40509 (printsockopt): Remove. 40510 (print_sockopt_fd_level_name, print_linger, print_ucred, 40511 print_tpacket_stats, print_getsockopt, print_tpacket_req, 40512 print_packet_mreq, print_setsockopt): New functions. 40513 (sys_getsockopt, sys_setsockopt): Use them. 40514 40515 2015-01-28 Dmitry V. Levin <ldv (a] altlinux.org> 40516 40517 sendmsg: do not decode msghdr in non-verbose mode. 40518 * net.c (printmsghdr): Do not decode struct msghdr in non-verbose mode. 40519 40520 decode_select: do not allocate unused memory. 40521 * desc.c (decode_select): On entering syscall, do not allocate memory 40522 in non-verbose mode. 40523 40524 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 40525 40526 xattr: quote using print_quoted_string. 40527 * xattr.c (print_xattr_val): Drop local quoting code, use 40528 print_quoted_string. 40529 40530 v4l2: quote pixelformat. 40531 * v4l2.c (print_pixelformat): Output in quoted v4l2_fourcc() format. 40532 40533 v4l2: quote strings. 40534 * v4l2.c (v4l2_ioctl): Print strings using print_quoted_string. 40535 40536 mips: quote sysmips nodename. 40537 * sysmips.c (sys_sysmips): Print nodename using print_quoted_string. 40538 40539 block_ioctl: quote strings. 40540 * block.c (print_blkpg_req): Print blkpg_partition.devname and 40541 blkpg_partition.volname using print_quoted_string. 40542 (block_ioctl): Print blk_user_trace_setup.name using print_quoted_string. 40543 40544 sys_uname: quote struct utsname members. 40545 * uname.c (PRINT_UTS_MEMBER): New macro. 40546 (sys_uname): Use them. 40547 40548 sock_ioctl: quote network interface names. 40549 * sock.c (print_ifname): New function. 40550 (sock_ioctl): Use it to quote ifr_name, ifru_newname, and ifru_slave. 40551 40552 printsock: quote network interface names. 40553 * net.c (printsock): Print network interface names returned by 40554 if_indextoname() using print_quoted_string. 40555 40556 getdents, getdents64: quote filenames. 40557 * dirent.c (print_old_dirent): Fix quoting. 40558 (sys_getdents): Print d_name using print_quoted_string. 40559 (sys_getdents64): Likewise. 40560 * tests/getdents.test: Test it. 40561 * tests/getdents.awk: Update. 40562 40563 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 40564 40565 printfd: quote pathnames. 40566 Change printfd() behaviour in show_fd_path mode to quote pathnames 40567 the same way printpathn() does. 40568 40569 * util.c (printfd): Print non-socket paths using print_quoted_string. 40570 * tests/scm_rights-fd.test: Test it. 40571 * tests/scm_rights.c: Update. 40572 40573 2015-01-26 Dmitry V. Levin <ldv (a] altlinux.org> 40574 40575 Rework string_quote API. 40576 string_quote() has proven to be too hard to use, replace it with 40577 print_quoted_string() that does memory allocation and prints the result. 40578 40579 * defs.h (string_quote): Remove. 40580 (QUOTE_0_TERMINATED, QUOTE_OMIT_LEADING_TRAILING_QUOTES): New macros. 40581 (print_quoted_string): New prototype. 40582 * util.c (string_quote): Make static; take "style" flags instead 40583 of "len", treat QUOTE_0_TERMINATED style flag as former (len == -1); 40584 add QUOTE_OMIT_LEADING_TRAILING_QUOTES style flag support. 40585 (ALLOCA_CUTOFF, use_alloca): New macros. 40586 (print_quoted_string): New function. 40587 (printpathn, printstr): Update to new API. 40588 * loop.c (loop_ioctl): Likewise. 40589 * mtd.c (ubi_ioctl): Likewise. 40590 * net.c (print_scm_security): Likewise. 40591 * socketutils.c (unix_parse_response): Likewise. 40592 40593 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 40594 40595 avr32: fix typo in sys_timerfd syscall entry. 40596 * linux/avr32/syscallent.h (timerfd): Change sys_name to "timerfd". 40597 40598 hppa: fix typos in getresuid and getresgid syscall entries. 40599 * linux/hppa/syscallent.h (getresuid): Change sys_func to sys_getresuid. 40600 (getresgid): Change sys_func to sys_getresgid. 40601 40602 2015-01-24 Helge Deller <deller (a] gmx.de> 40603 40604 hppa: fix typo in getpeername syscall entry. 40605 This fixes an obvious typo which prints "lock" instead of "getpeername" 40606 for the getpeername syscall. 40607 40608 * linux/hppa/syscallent.h (getpeername): Change sys_name to "getpeername". 40609 40610 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 40611 40612 Impove struct cmsghdr decoding. 40613 Print all cmsghdr structures in msg_control array, 40614 not just the first one. 40615 Change output format to be consistent with other parts of strace 40616 where structures and arrays are printed. 40617 Implement decoder for SCM_SECURITY message type. 40618 40619 * net.c (print_scm_rights, print_scm_creds, print_scm_security): 40620 New functions. 40621 (printcmsghdr): Use them. Iterate over all members of the array. 40622 * xlat/scmvals.in: Add SCM_SECURITY. 40623 * tests/scm_rights.c (main): Pass one more descriptor to the receiver. 40624 Set SO_PASSCRED on the receiver part. Reserve enough space to receive 40625 SCM_CREDENTIALS and SCM_RIGHTS. 40626 * tests/scm_rights-fd.test: Update. 40627 40628 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 40629 40630 Update SO_* constants. 40631 * xlat/sockoptions.in: Add SO_DOMAIN, SO_MARK, SO_NOFCS, SO_PASSSEC, 40632 SO_PROTOCOL, SO_RCVBUFFORCE, SO_SNDBUFFORCE, SO_TIMESTAMPING, 40633 and SO_TIMESTAMPNS. 40634 40635 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 40636 40637 tests: run tests for each supported personality. 40638 When strace supports more than one personality, run test suite 40639 for each personality supported by the host system. 40640 40641 * bootstrap: Create tests-m32 and tests-mx32 subtrees from tests. 40642 * configure.ac: Check for -m32 and -mx32 runtime support. 40643 (AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile. 40644 * Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define. 40645 [HAVE_MX32_RUNTIME] (TESTS_MX32): Define. 40646 (SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32). 40647 * .gitignore: Add /tests-m32 and /tests-mx32. 40648 40649 2015-01-24 Dmitry V. Levin <ldv (a] altlinux.org> 40650 40651 Fix ILP32 personality struct cmsghdr decoding on LP64 architectures. 40652 * net.c (union_cmsghdr): New union. 40653 [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (cmsghdr32): New structure. 40654 (printcmsghdr): Properly handle the case of current_wordsize < sizeof(long). 40655 40656 Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures 40657 * io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG 40658 && SUPPORTED_PERSONALITIES > 1]: Properly handle the case of 40659 current_wordsize < sizeof(long). 40660 40661 2015-01-22 Dmitry V. Levin <ldv (a] altlinux.org> 40662 40663 ioctl: take all 32 bits of ioctl commands into account. 40664 Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl 40665 commands were used for decoding, which was the source for numerous 40666 annoying collisions like this: 40667 40668 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 40669 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) 40670 40671 The solution is to use all 32 bits for decoding, not just "number" and 40672 "type", but also "size" and "direction". 40673 40674 As some architectures override defaults that come from asm-generic/ and 40675 provide alternative definitions for some ioctl commands, we support 40676 per-architecture ioctl definitions and merge them with common 40677 definitions at build time. During the merge, we used to keep both 40678 generic and architecture-specific definitions, now architecture-specific 40679 definitions have precedence over generic ones -- ioctlsort omits 40680 definitions from asm-generic/ for those ioctl names that have different 40681 definitions in asm/. 40682 40683 Additional bits of "direction" are architecture specific -- the number 40684 of bits and their values differ between architectures. To reduce 40685 architecture differences in the source code, we keep "direction" in 40686 symbolic form and compile it in ioctlsort. 40687 40688 Additional bits of "size" are also architecture specific -- not only the 40689 number of bits differ between architectures, but sizes of many types 40690 depend on sizeof(long). To reduce architecture differences in the 40691 source code, we keep 32-bit and 64-bit versions of common ioctl 40692 definitions, and use the appropriate version for each architecture and 40693 personality. 40694 40695 To implement this, the tools for generating ioctl definitions from 40696 kernel headers have been rewritten, and the source format of ioctl 40697 definitions has been extended. The final ioctlent*.h files that are 40698 included by syscall.c are now generated from source ioctls_inc*.h and 40699 ioctls_arch*.h files at build time with ioctlsort. 40700 40701 * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. 40702 * ioctlsort.c: Rewritten. 40703 * linux/32/ioctls_inc.h: New file. 40704 * linux/64/ioctls_inc.h: New file. 40705 * linux/aarch64/ioctls_arch0.h: New file. 40706 * linux/aarch64/ioctls_arch1.h: New file. 40707 * linux/aarch64/ioctls_inc0.h: New file. 40708 * linux/aarch64/ioctls_inc1.h: New file. 40709 * linux/alpha/ioctls_arch0.h: New file. 40710 * linux/alpha/ioctls_inc0.h: New file. 40711 * linux/arc/ioctls_arch0.h: New file. 40712 * linux/arc/ioctls_inc0.h: New file. 40713 * linux/arm/ioctls_arch0.h: New file. 40714 * linux/arm/ioctls_inc0.h: New file. 40715 * linux/avr32/ioctls_arch0.h: New file. 40716 * linux/avr32/ioctls_inc0.h: New file. 40717 * linux/bfin/ioctls_arch0.h: New file. 40718 * linux/bfin/ioctls_inc0.h: New file. 40719 * linux/hppa/ioctls_arch0.h: New file. 40720 * linux/hppa/ioctls_inc0.h: New file. 40721 * linux/i386/ioctls_arch0.h: New file. 40722 * linux/i386/ioctls_inc0.h: New file. 40723 * linux/ia64/ioctls_arch0.h: New file. 40724 * linux/ia64/ioctls_inc0.h: New file. 40725 * linux/m68k/ioctls_arch0.h: New file. 40726 * linux/m68k/ioctls_inc0.h: New file. 40727 * linux/metag/ioctls_arch0.h: New file. 40728 * linux/metag/ioctls_inc0.h: New file. 40729 * linux/microblaze/ioctls_arch0.h: New file. 40730 * linux/microblaze/ioctls_inc0.h: New file. 40731 * linux/mips/ioctls_arch0.h: New file. 40732 * linux/mips/ioctls_inc0.h: New file. 40733 * linux/or1k/ioctls_arch0.h: New file. 40734 * linux/or1k/ioctls_inc0.h: New file. 40735 * linux/powerpc/ioctls_arch0.h: New file. 40736 * linux/powerpc/ioctls_inc0.h: New file. 40737 * linux/powerpc64/ioctls_arch0.h: New file. 40738 * linux/powerpc64/ioctls_arch1.h: New file. 40739 * linux/powerpc64/ioctls_inc0.h: New file. 40740 * linux/powerpc64/ioctls_inc1.h: New file. 40741 * linux/s390/ioctls_arch0.h: New file. 40742 * linux/s390/ioctls_inc0.h: New file. 40743 * linux/s390x/ioctls_arch0.h: New file. 40744 * linux/s390x/ioctls_inc0.h: New file. 40745 * linux/sh/ioctls_arch0.h: New file. 40746 * linux/sh/ioctls_inc0.h: New file. 40747 * linux/sh64/ioctls_arch0.h: New file. 40748 * linux/sh64/ioctls_inc0.h: New file. 40749 * linux/sparc/ioctls_arch0.h: New file. 40750 * linux/sparc/ioctls_inc0.h: New file. 40751 * linux/sparc64/ioctls_arch0.h: New file. 40752 * linux/sparc64/ioctls_arch2.h: New file. 40753 * linux/sparc64/ioctls_inc0.h: New file. 40754 * linux/sparc64/ioctls_inc2.h: New file. 40755 * linux/tile/ioctls_arch0.h: New file. 40756 * linux/tile/ioctls_arch1.h: New file. 40757 * linux/tile/ioctls_inc0.h: New file. 40758 * linux/tile/ioctls_inc1.h: New file. 40759 * linux/x32/ioctls_arch0.h: New file. 40760 * linux/x32/ioctls_arch1.h: New file. 40761 * linux/x32/ioctls_inc0.h: New file. 40762 * linux/x32/ioctls_inc1.h: New file. 40763 * linux/x86_64/ioctls_arch0.h: New file. 40764 * linux/x86_64/ioctls_arch1.h: New file. 40765 * linux/x86_64/ioctls_inc0.h: New file. 40766 * linux/x86_64/ioctls_inc1.h: New file. 40767 * linux/xtensa/ioctls_arch0.h: New file. 40768 * linux/xtensa/ioctls_inc0.h: New file. 40769 * linux/aarch64/ioctlent.h.in: Remove. 40770 * linux/aarch64/ioctlent1.h: Remove. 40771 * linux/alpha/ioctlent.h.in: Remove. 40772 * linux/arc/ioctlent.h.in: Remove. 40773 * linux/arm/ioctlent.h.in: Remove. 40774 * linux/avr32/ioctlent.h.in: Remove. 40775 * linux/bfin/ioctlent.h.in: Remove. 40776 * linux/hppa/ioctlent.h.in: Remove. 40777 * linux/i386/ioctlent.h.in: Remove. 40778 * linux/ia64/ioctlent.h.in: Remove. 40779 * linux/ioctlent.h.in: Remove. 40780 * linux/ioctlent.sh: Remove. 40781 * linux/m68k/ioctlent.h.in: Remove. 40782 * linux/metag/ioctlent.h.in: Remove. 40783 * linux/microblaze/ioctlent.h.in: Remove. 40784 * linux/mips/ioctlent.h.in: Remove. 40785 * linux/mips/ioctlent.sh: Remove. 40786 * linux/or1k/ioctlent.h.in: Remove. 40787 * linux/powerpc/ioctlent.h.in: Remove. 40788 * linux/powerpc64/ioctlent.h: Remove. 40789 * linux/powerpc64/ioctlent1.h: Remove. 40790 * linux/s390/ioctlent.h.in: Remove. 40791 * linux/s390x/ioctlent.h.in: Remove. 40792 * linux/sh/ioctlent.h.in: Remove. 40793 * linux/sh64/ioctlent.h.in: Remove. 40794 * linux/sparc/ioctlent.h.in: Remove. 40795 * linux/sparc64/ioctlent.h.in: Remove. 40796 * linux/sparc64/ioctlent2.h: Remove. 40797 * linux/tile/ioctlent.h.in: Remove. 40798 * linux/tile/ioctlent1.h: Remove. 40799 * linux/x32/ioctlent.h.in: Remove. 40800 * linux/x32/ioctlent1.h: Remove. 40801 * linux/x86_64/ioctlent.h.in: Remove. 40802 * linux/x86_64/ioctlent1.h: Remove. 40803 * linux/xtensa/ioctlent.h.in: Remove. 40804 * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. 40805 * syscall.c (struct_ioctlent ioctlent0): Likewise. 40806 * Makefile.am: Remove all ioctlent-related definitions. 40807 Define the list of ioctlent*.h files that have to be generated by 40808 presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. 40809 Add rules for ioctlent*.h files generation. 40810 (EXTRA_DIST): Update. 40811 * maint/ioctls_gen.sh: New file. 40812 * maint/ioctls_hex.sh: New file. 40813 * maint/ioctls_sym.sh: New file. 40814 * maint/print_ioctlent.c: New file. 40815 * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. 40816 * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. 40817 * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h 40818 and linux/mmtimer.h for tests. 40819 * tests/ioctl.c: New file. 40820 * tests/ioctl.test: New test. 40821 * tests/Makefile.am (check_PROGRAMS): Add ioctl. 40822 (TESTS): Add ioctl.test. 40823 * tests/.gitignore: Add ioctl. 40824 40825 2015-01-21 Gabriel Laskar <gabriel (a] lse.epita.fr> 40826 40827 ioctl: add decoding for parametrized command names. 40828 Some ioctl commands from evdev, hiddev, mixer, uinput, spi, and joystick 40829 are parametrized by a size or a number that are variable. This change 40830 implements printing of these parametrized ioctl command names. 40831 40832 * configure.ac (AC_CHECK_HEADERS): Add linux/input.h. 40833 * defs.h (ioctl_decode_number): New prototype. 40834 * io.c (sys_ioctl): Use ioctl_decode_number. 40835 * ioctl.c (ioctl_decode_number): New function. 40836 * xlat/evdev_abs.in: New file. 40837 * xlat/evdev_ev.in: New file. 40838 40839 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 40840 40841 Update auxiliary maintainer mode build tools. 40842 * git-set-file-times: Update from rsync. 40843 * git-version-gen: Update from gnulib. 40844 * gitlog-to-changelog: Likewise. 40845 40846 Update warnings.m4. 40847 * m4/warnings.m4: Update from gnulib. 40848 40849 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 40850 40851 powerpc64: maintain own linux/powerpc64 subdirectory. 40852 Most architectures supported by strace have their own subdirectory in 40853 linux directory, but powerpc64 didn't, causing inconveniences. 40854 40855 * configure.ac (arch): Define to "powerpc64" on powerpc64. 40856 * linux/powerpc/errnoent1.h: Move to linux/powerpc64/. 40857 * linux/powerpc/ioctlent1.h: Likewise. 40858 * linux/powerpc/signalent1.h: Likewise. 40859 * linux/powerpc/syscallent1.h: Likewise. 40860 * linux/powerpc64/ioctlent.h: New file. 40861 * linux/powerpc64/syscallent.h: Likewise. 40862 * linux/powerpc64/userent.h: Likewise. 40863 * Makefile.am (EXTRA_DIST): Remove linux/powerpc/ioctlent1.h, 40864 linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, and 40865 linux/powerpc/signalent1.h; added linux/powerpc64/errnoent1.h, 40866 linux/powerpc64/ioctlent.h, linux/powerpc64/ioctlent1.h, 40867 linux/powerpc64/signalent1.h, linux/powerpc64/syscallent.h, 40868 linux/powerpc64/syscallent1.h, and linux/powerpc64/userent.h. 40869 40870 2015-01-21 Dmitry V. Levin <ldv (a] altlinux.org> 40871 40872 configure.ac: remove unused AC_INCLUDEDIR. 40873 * configure.ac (AC_INCLUDEDIR): Remove. 40874 * m4/includedir.m4: Remove. 40875 40876 ioctl: print unrecognized ioctl codes in _IOC(dir,type,nr,size) format. 40877 * defs.h (ioctl_print_code): New prototype. 40878 * ioctl.c: Include xlat/ioctl_dirs.h. 40879 (ioctl_print_code): New function. 40880 * io.c (sys_ioctl): Use it. 40881 * xlat/ioctl_dirs.in: New file. 40882 40883 2015-01-20 Dmitry V. Levin <ldv (a] altlinux.org> 40884 40885 ioctl: assume that all ioctl commands have unsigned int type. 40886 In linux, ioctl command number has a 32-bit unsigned integer type: 40887 fs/ioctl.c:SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) 40888 If the kernel completely ignores other bits on 64-bit architectures, 40889 why should strace care? 40890 Let's follow the kernel and treat it as unsigned int. 40891 40892 * defs.h (struct_ioctlent): Change "code" type to "unsigned int". 40893 (ioctl_decode, ioctl_lookup, block_ioctl, loop_ioctl, mtd_ioctl, 40894 ubi_ioctl, ptp_ioctl, scsi_ioctl, sock_ioctl, term_ioctl, rtc_ioctl, 40895 v4l2_ioctl): Likewise. 40896 * ioctl.c (ioctl_decode, ioctl_lookup, compare, ioctl_next_match): 40897 Likewise. 40898 * block.c (block_ioctl): Likewise. 40899 * loop.c (loop_ioctl): Likewise. 40900 * mtd.c (mtd_ioctl, ubi_ioctl): Likewise. 40901 * ptp.c (ptp_ioctl): Likewise. 40902 * scsi.c (scsi_ioctl): Likewise. 40903 * sock.c (sock_ioctl): Likewise. 40904 * term.c (term_ioctl): Likewise. 40905 * time.c (rtc_ioctl): Likewise. 40906 * v4l2.c (v4l2_ioctl): Likewise. 40907 * ioctlsort.c (struct ioctlent, compare, main): Likewise. 40908 40909 2015-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 40910 40911 ioctlent.sh: cleanup regexps that are used to fetch bases. 40912 40913 ioctlent.sh: sync lookup regexps that are used in grep and sed. 40914 ioctlent.sh looks for ioctl command names using grep, and fetches them 40915 with their definitions using sed. Historically, lookup regexps used in 40916 grep and sed are slightly different, which makes the script more 40917 complicated than necessary. 40918 40919 qemu_multiarch_testing: update. 40920 * qemu_multiarch_testing/.gitignore: New file. 40921 * qemu_multiarch_testing/README: Update statistics. 40922 * qemu_multiarch_testing/hdc.dir/init2: Run "make check". 40923 * qemu_multiarch_testing/make-hdc-img.sh: Robustify, 40924 automatically calculate hdc image size. 40925 * qemu_multiarch_testing/parallel-build-hdc-img.sh: Reduce 40926 hdb image size. Report completion of each parallelized task. 40927 40928 2015-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 40929 40930 tests: add IPC_STAT to ipc tests, workaround limitiations of old kernels 40931 * tests/ipc_msg.c: Include <errno.h>. 40932 (main): Add a test call with IPC_STAT, handle old kernels MSG_STAT behaviour. 40933 * tests/ipc_sem.c: Include <errno.h>. 40934 (main): Add a test call with IPC_STAT, handle old kernels SEM_STAT behaviour. 40935 * tests/ipc_shm.c: Include <errno.h>. 40936 (main): Add a test call with IPC_STAT, handle old kernels SHM_STAT behaviour. 40937 40938 Change length type of umoven and umovestr to unsigned. 40939 * defs.h (umoven, umovestr): Change type of 3rd argument from "int" 40940 to "unsigned int". 40941 * util.c (umoven, umovestr): Likewise. Adjust the code appropriately. 40942 40943 tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel 40944 * tests/mmsg.c: #include <errno.h> 40945 (main): Return 77 if sendmmsg failed with ENOSYS. 40946 40947 tests: skip ip network tests when the network is not functional. 40948 * tests/inet-accept-connect-send-recv.c (main): Return 77 if inet stream 40949 socket cannot be created or it cannot be bound to INADDR_LOOPBACK. 40950 * tests/net-yy.test: Skip the test if inet-accept-connect-send-recv 40951 returns 77. 40952 40953 tests: handle the case when all 64 process capability bits are set. 40954 * tests/caps.awk: Handle the case when all bits of 64-bit capability 40955 word are set. 40956 40957 tests: explicitly request gawk when using gawk features. 40958 * tests/uid.test: Check for gawk availability and invoke gawk instead of 40959 plain awk because the test uses gawk's match() feature. 40960 40961 tests: skip detach tests if kill does not work. 40962 * tests/detach-running.test: Skip if "kill -0" does not work. 40963 * tests/detach-sleeping.test: Likewise. 40964 * tests/detach-stopped.test: Likewise. 40965 40966 ARM OABI: fix potential compilation warning. 40967 * syscall.c (get_scno) [!__ARM_EABI__ || ENABLE_ARM_OABI]: Fix 40968 "comparison between signed and unsigned" warning reported by some 40969 gcc versions. 40970 40971 powerpc: fix potential compilation warning. 40972 * mem.c [POWERPC] (sys_subpage_prot): Fix "comparison between signed 40973 and unsigned" warning reported by some gcc versions. 40974 40975 2015-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 40976 40977 sparc, sparc64: remove ioctl header file names from solaris ioctl entries 40978 Starting with commit v4.9-27-g3e252ca, header file names should not be 40979 part of ioctlent files included by syscall.c 40980 40981 * linux/sparc/ioctlent1.h: Remove ioctl header file names. 40982 * linux/sparc64/ioctlent2.h: Remove all entries, include "ioctlent.h". 40983 40984 2015-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 40985 40986 mips: enable indirect ipc subcall support. 40987 * linux/mips/syscallent-n32.h [LINUX_MIPSN32]: Define SYS_socket_subcall, 40988 include "subcall.h". 40989 * linux/mips/syscallent-n64.h [LINUX_MIPSN64]: Likewise. 40990 * linux/mips/syscallent-o32.h [LINUX_MIPSO32]: Likewise. 40991 40992 mips: remove stub entries from syscallent files, generate stubs at build time 40993 * linux/mips/genstub.sh: New file. 40994 * Makefile.am (EXTRA_DIST): Add it. 40995 * configure.ac [MIPS]: Use it to generate syscallent stubs. 40996 * linux/mips/.gitignore: Add syscallent stubs. 40997 * linux/mips/syscallent-n32.h: Remove stub entries, include 40998 the stub file instead. 40999 * linux/mips/syscallent-n64.h: Likewise. 41000 * linux/mips/syscallent-o32.h: Likewise. 41001 41002 build: add $(builddir)/$(OS)/$(ARCH) to the headers search list. 41003 * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS)/$(ARCH) before 41004 -I$(srcdir)/$(OS)/$(ARCH). 41005 41006 build: fix build if siginfo_t lacks si_timerid/si_overrun. 41007 * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_timerid and 41008 siginfo_t.si_overrun. 41009 * signal.c (printsiginfo) [SI_TIMER]: Check HAVE_SIGINFO_T_SI_TIMERID 41010 and HAVE_SIGINFO_T_SI_OVERRUN. 41011 41012 configure.ac: remove unused AM_CONDITIONAL expressions. 41013 * configure.ac (AM_CONDITIONAL): Remove I386, X86_64, X32. 41014 41015 tests: portability fixes. 41016 * tests/stat.test: dd obs= is not portable, use bs= instead. 41017 * tests/stat32-v.test: Likewise. 41018 * tests/stat64-v.test: Likewise. 41019 * tests/net.test: Use $* instead of $@ in the quoted string. 41020 * tests/net-fd.test: Likewise. 41021 * tests/statfs.test: Quote { and } in regexps. 41022 * tests/caps.awk: Likewise. 41023 * tests/getdents.awk: Likewise. 41024 * tests/net-yy-accept.awk: Likewise. 41025 * tests/net-yy-connect.awk: Likewise. 41026 * tests/sigaction.awk: Likewise. 41027 * tests/unix-yy-accept.awk: Likewise. 41028 * tests/unix-yy-connect.awk: Likewise. 41029 41030 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41031 41032 Wire up new syscalls. 41033 * linux/dummy.h (sys_bpf, sys_execveat, sys_getrandom, 41034 sys_kexec_file_load, sys_memfd_create, sys_seccomp): New stub aliases. 41035 * linux/32/syscallent.h (seccomp, getrandom, memfd_create, bpf, 41036 execveat): New entries. 41037 * linux/64/syscallent.h: Likewise. 41038 * linux/arm/syscallent.h: Likewise. 41039 * linux/hppa/syscallent.h: Likewise. 41040 * linux/i386/syscallent.h: Likewise. 41041 * linux/microblaze/syscallent.h: Likewise. 41042 * linux/mips/syscallent-n32.h: Likewise. 41043 * linux/mips/syscallent-n64.h: Likewise. 41044 * linux/mips/syscallent-o32.h: Likewise. 41045 * linux/powerpc/syscallent.h: Likewise. 41046 * linux/sparc/syscallent.h: Likewise. 41047 * linux/ia64/syscallent.h (getrandom, memfd_create, bpf, execveat): 41048 New entries. 41049 * linux/m68k/syscallent.h: Likewise. 41050 * linux/s390/syscallent.h: (seccomp, getrandom, memfd_create, bpf, 41051 s390_pci_mmio_write, s390_pci_mmio_read, execveat): New entries. 41052 * linux/s390x/syscallent.h: Likewise. 41053 * linux/x86_64/syscallent.h (seccomp, getrandom, memfd_create, 41054 kexec_file_load, bpf, execveat): New entries. 41055 * linux/x32/syscallent.h: Likewise. 41056 * linux/xtensa/syscallent.h (seccomp, getrandom, memfd_create): 41057 New entries. 41058 41059 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41060 41061 s390x: adjust some syscall entries. 41062 According to linux/arch/s390/include/uapi/asm/unistd.h, readdir is 41063 defined both on s390 and s390x, while getrlimit, _llseek, sendfile64, 41064 and fadvise64_64 are defined on s390 only. 41065 41066 * linux/s390x/syscallent.h (readdir): Add. 41067 (getrlimit, _llseek, sendfile64, fadvise64_64): Remove. 41068 41069 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41070 41071 Change syscallent.h files to use designated initializers. 41072 Automatically convert all linux syscallent.h files to a form that uses 41073 designated initializers, with subsequent correction of whitespace 41074 indentation. 41075 41076 * linux/alpha/syscallent.h: Use designated initializers. 41077 * linux/arm/syscallent.h: Likewise. 41078 * linux/avr32/syscallent.h: Likewise. 41079 * linux/bfin/syscallent.h: Likewise. 41080 * linux/hppa/syscallent.h: Likewise. 41081 * linux/i386/syscallent.h: Likewise. 41082 * linux/ia64/syscallent.h: Likewise. 41083 * linux/m68k/syscallent.h: Likewise. 41084 * linux/microblaze/syscallent.h: Likewise. 41085 * linux/mips/syscallent-n32.h: Likewise. 41086 * linux/mips/syscallent-n64.h: Likewise. 41087 * linux/mips/syscallent-o32.h: Likewise. 41088 * linux/powerpc/syscallent.h: Likewise. 41089 * linux/s390/syscallent.h: Likewise. 41090 * linux/s390x/syscallent.h: Likewise. 41091 * linux/sh/syscallent.h: Likewise. 41092 * linux/sh64/syscallent.h: Likewise. 41093 * linux/sparc/syscallent.h: Likewise. 41094 * linux/x32/syscallent.h: Likewise. 41095 * linux/x86_64/syscallent.h: Likewise. 41096 * linux/xtensa/syscallent.h: Likewise. 41097 41098 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41099 41100 Create generic 32-bit syscallent.h. 41101 Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and 41102 tile/syscallent1.h share a lot of identical syscall entries described in 41103 <asm-generic/unistd.h>, move these entries to a new file 32/syscallent.h 41104 using the following automated conversion with subsequent correction of 41105 whitespace indentation: 41106 41107 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 41108 41109 * linux/32/syscallent.h: New file. 41110 * Makefile.am (EXTRA_DIST): Add it. 41111 * linux/arc/syscallent.h: Include "32/syscallent.h", 41112 remove generic 32-bit syscall entries, use designated initializers. 41113 * linux/metag/syscallent.h: Likewise. 41114 * linux/or1k/syscallent.h: Likewise. 41115 * linux/tile/syscallent1.h: Likewise. 41116 41117 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41118 41119 tile: fix syscall entries. 41120 * linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3. 41121 (pread64, pwrite64): Change nargs to 5. 41122 (llseek): Change sys_name to _llseek. 41123 41124 s390: fix fadvise64 and fadvise64_64 syscall entries. 41125 * linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to 41126 printargs until special parsers for 31-bit 31 s390 emulation wrappers 41127 are written. 41128 41129 alpha: fix fadvise64 syscall entry. 41130 * linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64. 41131 41132 tile: fix fadvise64_64 syscall entry. 41133 * linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func, 41134 and sys_name. 41135 41136 Fix getrlimit and ugetrlimit syscall entries. 41137 * linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name. 41138 * linux/i386/syscallent.h: Likewise. 41139 * linux/m68k/syscallent.h: Likewise. 41140 * linux/microblaze/syscallent.h: Likewise. 41141 * linux/powerpc/syscallent.h: Likewise. 41142 * linux/avr32/syscallent.h (getrlimit): Fix sys_name. 41143 * linux/or1k/syscallent.h: Likewise. 41144 * linux/s390/syscallent.h (ugetrlimit): Fix sys_name. 41145 * linux/sh/syscallent.h: Likewise. 41146 * linux/sh64/syscallent.h: Likewise. 41147 41148 Fix umount and umount2 syscall entries. 41149 * linux/aarch64/syscallent1.h (umount): Change nargs to 1. 41150 * linux/avr32/syscallent.h: Likewise. 41151 * linux/xtensa/syscallent.h: Likewise. 41152 * linux/ia64/syscallent.h (umount2): Change nargs to 2. 41153 * linux/arm/syscallent.h (umount, umount2): Fix sys_name. 41154 * linux/bfin/syscallent.h: Likewise. 41155 * linux/i386/syscallent.h: Likewise. 41156 * linux/m68k/syscallent.h: Likewise. 41157 * linux/microblaze/syscallent.h: Likewise. 41158 * linux/powerpc/syscallent.h: Likewise. 41159 * linux/s390/syscallent.h: Likewise. 41160 * linux/s390x/syscallent.h: Likewise. 41161 * linux/sh/syscallent.h: Likewise. 41162 * linux/sh64/syscallent.h: Likewise. 41163 * linux/sparc/syscallent.h: Likewise. 41164 * linux/metag/syscallent.h: (umount2): Fix sys_name. 41165 * linux/or1k/syscallent.h: Likewise. 41166 * linux/x32/syscallent.h: Likewise. 41167 * linux/x86_64/syscallent.h: Likewise. 41168 41169 Fix sendfile64 syscall entries. 41170 * linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64. 41171 * linux/metag/syscallent.h: Likewise. 41172 * linux/or1k/syscallent.h: Likewise. 41173 41174 Fix number of arguments in ipc family syscall entries. 41175 * linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget, 41176 shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls. 41177 * linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl, 41178 shmdt, shmget, semtimedop): Likewise. 41179 * linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat, 41180 shmget, shmdt, shmctl): Likewise. 41181 * linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat, 41182 * shmctl, shmdt, shmget, semtimedop): Likewise. 41183 * linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl, 41184 semtimedop): Likewise. 41185 * linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl, 41186 msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise. 41187 * linux/ia64/syscallent.h (semtimedop): Likewise. 41188 * linux/mips/syscallent-n32.h (semtimedop): Likewise. 41189 * linux/mips/syscallent-n64.h (semtimedop): Likewise. 41190 * linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop, 41191 semop, shmget, shmctl, shmat, shmdt): Likewise. 41192 * linux/sh64/syscallent.h (semget, msgget, shmget): Likewise. 41193 * linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget, 41194 shmctl, shmat, shmdt): Likewise. 41195 * linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt, 41196 msgget, semtimedop): Likewise. 41197 * linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop, 41198 shmdt, msgget, semtimedop): Likewise. 41199 * linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop, 41200 semget, semop, msgget, msgrcv, msgctl): Likewise. 41201 41202 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41203 41204 Create generic 64-bit syscallent.h. 41205 Since aarch64/syscallent1.h and tile/syscallent.h share a lot of 41206 identical syscall entries described in <asm-generic/unistd.h>, move 41207 these entries to a new file 64/syscallent.h using the following 41208 automated conversion with subsequent correction of whitespace 41209 indentation: 41210 41211 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 41212 41213 * linux/64/syscallent.h: New file. 41214 * Makefile.am (EXTRA_DIST): Add it. 41215 * linux/aarch64/syscallent1.h: Include "64/syscallent.h", 41216 remove generic 64-bit syscall entries, use designated initializers. 41217 * linux/tile/syscallent.h: Likewise. 41218 41219 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41220 41221 Fix nfsservctl syscall entries. 41222 * linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name. 41223 * linux/metag/syscallent.h: Likewise. 41224 41225 Add missing syscall entries for sched_[gs]etattr and renameat2. 41226 * linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2): 41227 New syscall entries. 41228 * linux/arc/syscallent.h: Likewise. 41229 * linux/metag/syscallent.h: Likewise. 41230 * linux/or1k/syscallent.h: Likewise. 41231 * linux/tile/syscallent.h: Likewise. 41232 * linux/tile/syscallent1.h: Likewise. 41233 41234 Fix NUMA related syscall entries. 41235 * linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy): 41236 Set sys_func. 41237 * linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy): 41238 Fix nargs, set sys_func. 41239 * linux/microblaze/syscallent.h (mbind): Fix nargs. 41240 * linux/mips/syscallent-n32.h (move_pages): Set sys_func. 41241 * linux/mips/syscallent-n64.h (move_pages): Likewise. 41242 * linux/mips/syscallent-o32.h (mbind): Fix nargs. 41243 * linux/or1k/syscallent.h (migrate_pages): Likewise. 41244 * linux/powerpc/syscallent.h (migrate_pages): Likewise. 41245 * linux/sh/syscallent.h (mbind): Likewise. 41246 * linux/sh64/syscallent.h (mbind): Likewise. 41247 41248 xtensa: fix syscall entries. 41249 * linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name. 41250 (restart_syscall, io_setup, io_destroy, io_submit, io_getevents, 41251 io_cancel, add_key, request_key, keyctl): Set sys_func. 41252 (migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages, 41253 fstatat64): Fix nargs. 41254 (renameat2): New entry. 41255 41256 Fix sched_setparam syscall entries. 41257 * linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2. 41258 * linux/arm/syscallent.h (sched_setparam): Likewise. 41259 * linux/avr32/syscallent.h (sched_setparam): Likewise. 41260 * linux/bfin/syscallent.h (sched_setparam): Likewise. 41261 * linux/i386/syscallent.h (sched_setparam): Likewise. 41262 * linux/m68k/syscallent.h (sched_setparam): Likewise. 41263 * linux/microblaze/syscallent.h (sched_setparam): Likewise. 41264 * linux/s390/syscallent.h (sched_setparam): Likewise. 41265 * linux/s390x/syscallent.h (sched_setparam): Likewise. 41266 * linux/sh/syscallent.h (sched_setparam): Likewise. 41267 * linux/sh64/syscallent.h (sched_setparam): Likewise. 41268 * linux/tile/syscallent.h (sched_setparam): Likewise. 41269 * linux/tile/syscallent1.h (sched_setparam): Likewise. 41270 * linux/x32/syscallent.h (sched_setparam): Likewise. 41271 * linux/x86_64/syscallent.h (sched_setparam): Likewise. 41272 41273 arc: fix fanotify_mark syscall entry. 41274 * linux/arc/syscallent.h (fanotify_mark): Change nargs to 6. 41275 41276 ia64: add fallocate syscall entry. 41277 * linux/ia64/syscallent.h (fallocate): Add syscall entry. 41278 41279 Fix lookup_dcookie syscall entries. 41280 * linux/s390/syscallent.h (lookup_dcookie): Add syscall entry. 41281 * linux/s390x/syscallent.h (lookup_dcookie): Likewise. 41282 * linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3. 41283 * linux/x32/syscallent.h (lookup_dcookie): Likewise. 41284 41285 aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate. 41286 * linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate): 41287 Use correct syscall names. 41288 41289 aarch64: fix mlock syscall entry. 41290 * linux/aarch64/syscallent1.h (mlock): Change to mlock entry. 41291 41292 sh, sh64: fix mlock syscall entry. 41293 * linux/sh/syscallent.h (mlock): Change nargs to 2. 41294 * linux/sh64/syscallent.h (mlock): Likewise. 41295 41296 tile: fix swapon syscall entries. 41297 * linux/tile/syscallent.h (swapon): Change nargs to 2. 41298 * linux/tile/syscallent1.h (swapon): Likewise. 41299 41300 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41301 41302 ARM EABI: reserve some space for new syscalls. 41303 Reserve the same space for new syscalls on EABI as it is already 41304 reserved on OABI. 41305 41306 * linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL): 41307 Raise to 400. 41308 41309 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41310 41311 arm: rewrite shuffle_scno in a bit more readable way. 41312 * linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of 41313 ARM_LAST_ORDINARY_SYSCALL. 41314 * syscall.c [ARM || AARCH64] (shuffle_scno): Update. 41315 41316 tests: add tests for ipc syscalls decoding. 41317 * tests/ipc_msg.c: New file. 41318 * tests/ipc_sem.c: Likewise. 41319 * tests/ipc_shm.c: Likewise. 41320 * tests/ipc_msg.test: New test. 41321 * tests/ipc_sem.test: Likewise. 41322 * tests/ipc_shm.test: Likewise. 41323 * tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm. 41324 (TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test. 41325 * tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm. 41326 41327 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41328 41329 Fix indirect ipc subcall handling. 41330 indirect_ipccall used to guess whether currently decoded ipc syscall is 41331 an indirect subcall or not based on generic knowledge, while there is a 41332 robust method to identify indirect ipc subcalls. 41333 41334 * defs.h (TRACE_INDIRECT_SUBCALL): New flag. 41335 * ipc.c (indirect_ipccall): Check it. 41336 * linux/subcall.h: Set it. 41337 41338 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41339 41340 Move socket and ipc subcall entries to subcall.h. 41341 Syscall entries for socket and ipc subcalls are the same on all 41342 architectures, or at least they should be the same, so move them 41343 to the single file. 41344 41345 * linux/subcall.h: Add syscall entries for socket and ipc subcalls. 41346 * linux/arm/syscallent.h: Remove entries for socket and ipc subcalls. 41347 * linux/i386/syscallent.h: Likewise. 41348 * linux/m68k/syscallent.h: Likewise. 41349 * linux/powerpc/syscallent.h: Likewise. 41350 * linux/s390/syscallent.h: Likewise. 41351 * linux/s390x/syscallent.h: Likewise. 41352 * linux/sh/syscallent.h: Likewise. 41353 * linux/sh64/syscallent.h: Likewise. 41354 * linux/sparc/syscallent.h: Likewise. 41355 41356 2015-01-12 Dmitry V. Levin <ldv (a] altlinux.org> 41357 41358 sh: fix typo introduced by commit v4.9-121-gd535b8b. 41359 * linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name. 41360 41361 2015-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 41362 41363 Fix fanotify_mark decoding on 32-bit architectures. 41364 The fanotify_mark syscall takes a 64-bit mask, and on 32-bit 41365 architectures it is split up into two syscall arguments. 41366 41367 * configure.ac (AC_CHECK_FUNCS): Add fanotify_mark. 41368 (AC_CHECK_HEADERS): Add sys/fanotify.h. 41369 * defs.h (getllval): New prototype. 41370 * util.c (getllval): New function based on printllval. 41371 (printllval): Use getllval. 41372 * fanotify.c (sys_fanotify_mark): Use getllval to properly decode 41373 64-bit mask and two syscall arguments followed by it. 41374 * tests/fanotify_mark.c: New file. 41375 * tests/fanotify_mark.test: New test. 41376 * tests/Makefile.am (check_PROGRAMS): Add fanotify_mark. 41377 (TESTS): Add fanotify_mark.test. 41378 * tests/.gitignore: Add fanotify_mark. 41379 41380 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 41381 41382 v4l2: fix build on systems with older kernel headers. 41383 * v4l2.c (print_v4l2_format_fmt): Do not use 41384 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined. 41385 (v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and 41386 VIDIOC_ENUM_FRAMEINTERVALS unless they are defined. 41387 41388 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 41389 41390 tests: fix build with awk that does not support switch-case. 41391 The switch-case statement is a gawk-specific feature which is not 41392 necessarily available, let's use traditional if-else statements instead. 41393 41394 * tests/uid.awk: Rewrite without switch-case statements. 41395 41396 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 41397 41398 Fix build on systems that lack O_CLOEXEC definition. 41399 * xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined. 41400 41401 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 41402 41403 Fix build on systems that lack NETLINK_SOCK_DIAG definition. 41404 NETLINK_INET_DIAG was introduced in linux v2.6.14, 41405 NETLINK_SOCK_DIAG was added much later in linux v3.3. 41406 41407 * net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG] 41408 (NETLINK_SOCK_DIAG): Define. 41409 * socketutils.c: Likewise. 41410 * tests/netlink_unix_diag.c: Likewise. 41411 41412 2015-01-09 Dmitry V. Levin <ldv (a] altlinux.org> 41413 41414 Cleanup local copy of linux/fanotify.h. 41415 * linux/fanotify.h: Remove macros and structures not used by 41416 fanotify_init and fanotify_mark parsers. 41417 41418 Fix "make dist" regression introduced by commit v4.9-125-g120e5db. 41419 * Makefile.am (EXTRA_DIST): Add linux/unix_diag.h. 41420 41421 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 41422 41423 tests: fix build with fresh glibc. 41424 * tests/netlink_unix_diag.c: Include <stdint.h>. 41425 41426 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 41427 41428 ioctlent.sh: handle linux/aufs_type.h properly. 41429 Before this change, ioctlent.sh could not recognize unusual constants 41430 defined by linux/aufs_type.h, resulting to ioctls.h with references to 41431 these constants without appropriate definitions in ioctldefs.h. 41432 41433 * linux/ioctlent.sh: Update the regexp that is used to lookup constants 41434 referenced by generated ioctls.h. 41435 41436 2015-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 41437 41438 tests: fix distcheck. 41439 * tests/stat32-v.test: Remove work files if the test is skipped. 41440 41441 Fix printing of time_t values set in the distant future. 41442 * util.c (sprinttime): Increase buffer size. 41443 * tests/stat64-v.test: Try to set modification time of the sample file 41444 to a value set in the distant future. 41445 41446 Use AC_CHECK_TYPES to check for struct statfs64. 41447 * m4/statfs.m4: Remove. 41448 * configure.ac (AC_STATFS64): Remove. 41449 (AC_CHECK_TYPES): Add struct statfs64. 41450 * statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64. 41451 41452 Use AC_CHECK_TYPES to check for struct stat64. 41453 * m4/stat.m4: Remove. 41454 * configure.ac (AC_STAT64): Remove. 41455 (AC_CHECK_TYPES): Add struct stat64. 41456 * file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64. 41457 41458 file.c: fix 32-bit stat decoding on 64-bit architectures. 41459 * file.c [SPARC || SPARC64] (struct stat): Remove, use generic 41460 definition from <asm/stat.h>. 41461 [SPARC64] (struct stat_sparc64, printstat_sparc64): Remove. 41462 [AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32, 41463 STAT32_PERSONALITY): Define. 41464 [STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32. 41465 [STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32. 41466 (printstat) [STAT32_PERSONALITY]: Call printstat32 when 41467 current_personality == STAT32_PERSONALITY. 41468 [HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when 41469 current_personality != STAT32_PERSONALITY. 41470 [!HAVE_STAT64] (sys_stat64): Fallback to sys_stat. 41471 [!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat. 41472 41473 sparc: reuse struct stat parser code for struct solstat decoding. 41474 * printstat.h: Parametrize major() and minor(). 41475 * file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating 41476 printstat.h template. 41477 [SPARC || SPARC64] (printstatsol): Use do_printstat_sol. 41478 41479 ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding. 41480 * file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h 41481 template. 41482 [POWERPC64] (printstat_powerpc32): Use do_printstat32. 41483 41484 file.c: group related parsers together. 41485 * file.c (sys_stat, sys_fstat): Collect in one place right before 41486 the definition of printstat64. 41487 (sys_stat64, sys_fstat64): Collect in one place right after the 41488 definition of printstat64. 41489 41490 file.c: collect scattered __old_kernel_stat related code. 41491 * file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat, 41492 sys_oldstat, sys_oldfstat): Collect functions in one place. 41493 41494 Use the same source code for struct stat/stat64 decoding. 41495 * file.c: Define do_printstat64 by instantiating printstat.h template. 41496 (printstat64): Use do_printstat64. 41497 41498 x32: use generic printstat/printstat64 parsers. 41499 * file.c (printstat) [X32]: Define. 41500 (printstat64) [X32]: Use "struct stat64" instead of "struct stat". 41501 Use printstat for x32 personality processes. 41502 (printstat64_x32): Remove. 41503 (sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of 41504 printstat64_x32. 41505 41506 x32: remove redundant definitions. 41507 * file.c [X32]: Do not define "struct stat" and "struct 41508 __old_kernel_stat" locally, use definitions provided by <asm/stat.h>. 41509 Do not define "struct stat64" exclusively, reuse another definition 41510 added earlier for X86_64. 41511 41512 Convert do_printstat to a template function. 41513 * printstat.h: New file. 41514 * Makefile.am (strace_SOURCES): Add it. 41515 * file.c: Include "printstat.h". 41516 (do_printstat): Move to printstat.h, parametrize its name 41517 and struct stat. 41518 41519 file.c: prepare realprintstat for parametrization. 41520 * file.c (realprintstat): Adjust format strings so that all 64-bit 41521 integer fields are printed with %llu format, and %u format is used for 41522 all the rest. Rename to do_printstat. 41523 (printstat, printoldstat): Update callers. 41524 41525 tests: cleanup stat.test. 41526 * tests/stat.test: Rewrite in a more readable way. 41527 41528 tests: check verbose decoding of 32-bit and 64-bit struct stat. 41529 * tests/stat.c: New file. 41530 * tests/stat32.c: Likewise. 41531 * tests/stat32-v.test: New file. 41532 * tests/stat64-v.test: Likewise. 41533 * tests/Makefile.am (check_PROGRAMS): Add stat and stat32. 41534 (stat_CFLAGS): Define. 41535 (TESTS): Add stat32-v.test and stat64-v.test. 41536 * tests/.gitignore: Add stat and stat32. 41537 41538 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 41539 41540 Cleanup struct stat.st_flags decoding. 41541 There are no symbolic constants defined for struct stat.st_flags, 41542 so decode this rare field as unsigned int. 41543 41544 * xlat/fileflags.in: Remove. 41545 * file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]: 41546 Decode struct stat.st_flags as unsigned int. 41547 41548 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 41549 41550 Drop struct stat.st_aclcnt and stat.st_level support. 41551 Remove the code that supports struct stat.st_aclcnt and stat.st_level 41552 decoding -- these fields are not defined in system headers. 41553 41554 * configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and 41555 struct stat.st_level. 41556 * file.c (realprintstat, printstat64) 41557 [HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove. 41558 41559 2015-01-07 Dmitry V. Levin <ldv (a] altlinux.org> 41560 41561 tests: fix race condition in net-accept-connect based tests. 41562 Change all net-accept-connect based tests to use different unix domain 41563 socket addresses, so that these tests could be safely run in parallel. 41564 41565 * tests/net-accept-connect.c: Parametrize unix domain socket address. 41566 * tests/net-fd.test: Pass socket address to net-accept-connect. 41567 * tests/net.test: Likewise. 41568 * tests/unix-yy.test: Likewise. 41569 * tests/unix-yy-accept.awk: Update regexps. 41570 * tests/unix-yy-connect.awk: Likewise. 41571 41572 2014-12-31 Mike Frysinger <vapier (a] gentoo.org> 41573 41574 timerfd: update flags decoding. 41575 The current code only decodes TFD_TIMER_ABSTIME when the kernel has 41576 a bunch of newer flags. We have to handle fallbacks for all of them 41577 since the kernel doesn't currently export things to userspace. 41578 41579 * time.c: Include fcntl.h for O_* defines. 41580 (TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in. 41581 * xlat/timerfdflags.in: Add more definitions. 41582 41583 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 41584 41585 sparc: fix fxstat decoding. 41586 * file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor 41587 using printfd. 41588 41589 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 41590 41591 sparc: drop _STAT64_VER support. 41592 Starting with commit v4.6-240-g5afdf12, nobody compiles this 41593 non-Linux code. 41594 41595 * file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove 41596 _STAT64_VER code. 41597 41598 2014-12-29 Dmitry V. Levin <ldv (a] altlinux.org> 41599 41600 sparc: remove redundant sys_lxstat. 41601 * file.c [SPARC || SPARC64] (sys_lxstat): Remove. 41602 * linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat. 41603 * linux/sparc64/dummy2.h (solaris_lxstat): Likewise. 41604 41605 2014-12-28 Dmitry V. Levin <ldv (a] altlinux.org> 41606 41607 file.c: do not include unused headers. 41608 * file.c: Do not include <fcntl.h>. 41609 41610 2014-12-27 Dmitry V. Levin <ldv (a] altlinux.org> 41611 41612 Cleanup UTIME_NOW/UTIME_OMIT decoding. 41613 Move the code that's present in two copies from sprinttv() 41614 to a new helper function. 41615 41616 * time.c (do_sprinttv): New function. 41617 (sprinttv): Use it. 41618 41619 2014-12-27 Elliott Hughes <enh (a] google.com> 41620 41621 Fix UTIME_NOW/UTIME_OMIT decoding. 41622 The kernel doesn't actually care what tv_sec is set to --- it only checks 41623 tv_nsec when looking for the special values. 41624 41625 2014-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 41626 41627 Make -yy output for inet sockets consistent with unix domain sockets. 41628 Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their 41629 protocol name obtained using getxattr. 41630 41631 * socketutils.c (inet_parse_response): Add proto_name argument. 41632 Print proto_name for connected and unconnected sockets. 41633 (receive_responses): Add proto_name argument, pass it to the parser. 41634 (inet_print): Add proto_name argument, pass it to receive_responses. 41635 (unix_parse_response): Add proto_name argument. 41636 (print_sockaddr_by_inode): Pass protocol name to inet_print calls. 41637 * tests/net-yy-accept.awk: Update to match new output format. 41638 * tests/net-yy-connect.awk: Likewise. 41639 41640 2014-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 41641 41642 tests: robustify unix domain socket decoding test. 41643 Unix domain socket address family name is not universally decoded as 41644 AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms. 41645 Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL. 41646 41647 Some test regexps have to be properly initialized before they could 41648 be used, so make sure they are initialized before use. 41649 41650 2014-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 41651 41652 tests: fix unix domain socket decoding availability test. 41653 Since inet_diag and unix_diag interfaces are implemented by different 41654 kernel modules, they have to be tested separately. 41655 41656 * tests/netlink_unix_diag.c: New file. 41657 * tests/unix-yy.test: Use it. 41658 * tests/Makefile.am (check_PROGRAMS): Add it. 41659 * tests/.gitignore: Likewise. 41660 41661 2014-12-25 Masatake YAMATO <yamato (a] redhat.com> 41662 41663 tests: add a test for decoding unix domain socket addresses. 41664 * tests/unix-yy-accept.awk: New file. 41665 * tests/unix-yy-connect.awk: New file. 41666 * tests/unix-yy.test: New test. 41667 * tests/Makefile.am (TESTS): Add it. 41668 (EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk. 41669 41670 2014-12-25 Masatake YAMATO <yamato (a] redhat.com> 41671 41672 Support unix domain sockets in -yy option. 41673 This change extends -yy option to handle unix domain sockets: 41674 their peer addresses will be printed, similar to inet sockets. 41675 41676 For a listening socket, its socket inode and socket path are printed. 41677 For an accepted socket, its socket inode, the peer inode, and the 41678 socket path are printed. 41679 For a client socket, its socket inode and the peer inode are printed. 41680 41681 An example of a server side communication using netcat: 41682 41683 $ ./strace -yy -e network nc -l -U /tmp/example.sock 41684 socket(PF_LOCAL, SOCK_STREAM, 0) = 3 41685 setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 41686 bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 41687 listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0 41688 accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]> 41689 recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6 41690 INPUT 41691 41692 An example of a client side communication using netcat: 41693 41694 $ ./strace -yy -e network nc -U /tmp/example.sock 41695 socket(PF_LOCAL, SOCK_STREAM, 0) = 3 41696 connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0 41697 getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 41698 INPUT 41699 ... 41700 sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6 41701 41702 * linux/unix_diag.h: New file. 41703 * socketutils.c (send_query): Rename to inet_send_query. 41704 (parse_response): Rename to inet_parse_response. 41705 (unix_print, unix_send_query, unix_parse_response): New functions. 41706 (receive_responses): Add a new argument named parser: a function for 41707 handling protocol specific data parts of diag messages. 41708 (print_sockaddr_by_inode): Call unix_print. 41709 Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal 41710 but NETLINK_SOCK_DIAG looks more generic. 41711 41712 2014-12-16 Masatake YAMATO <yamato (a] redhat.com> 41713 41714 Use the protocol name of a socket as a hint for peer address resolution. 41715 To resolve the peer address of socket, all combinations of families 41716 (AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried. 41717 This change utilizes the protocol name obtained via getxattr to specify 41718 the right combination. 41719 41720 * socketutils.c (inet_print): New helper function. 41721 (print_sockaddr_by_inode): Use it. Utilize the protocol name 41722 associated with the given inode for resolving the peer socket 41723 address. If the protocol name is NULL, resolve the address 41724 by trying combinations of families and protocols as before. 41725 * defs.h (print_sockaddr_by_inode): Update prototype. 41726 * util.c (printfd): Pass the protocol name associated with 41727 the given path to print_sockaddr_by_inode as the 2nd argument. 41728 41729 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 41730 41731 Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls 41732 Convert parsers of these syscalls to the same scheme as were applied to 41733 parsers of other uid/gid related syscalls. 41734 That is, define two sets of parsers on architectures that support 41735 (either directly or via multiarch) 16-bit and 32-bit gid getgroups 41736 and setgroups syscalls simultaneously, and reuse essentially the same 41737 code by parametrizing uid_t and names of parser functions. 41738 41739 * groups.c: Remove. 41740 (sys_getgroups, sys_setgroups): Move ... 41741 * uid.c: ... here and parametrize their names. 41742 * Makefile.am (strace_SOURCES): Remove groups.c. 41743 * linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove. 41744 [NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes. 41745 * linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16, 41746 rename sys_[gs]etgroups32 to sys_[gs]etgroups. 41747 * linux/bfin/syscallent.h: Likewise. 41748 * linux/i386/syscallent.h: Likewise. 41749 * linux/m68k/syscallent.h: Likewise. 41750 * linux/microblaze/syscallent.h: Likewise. 41751 * linux/s390/syscallent.h: Likewise. 41752 * linux/sh/syscallent.h: Likewise. 41753 * linux/sh64/syscallent.h: Likewise. 41754 * linux/sparc/syscallent.h: Likewise. 41755 * tests/uid.c: Test for getgroups. 41756 * tests/uid16.c: Likewise. 41757 * tests/uid32.c: Test for getgroups32. 41758 * tests/uid.awk: Test for getgroups/getgroups32 decoding. 41759 * tests/uid.test: Trace getgroups/getgroups32 syscalls. 41760 41761 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 41762 41763 Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls. 41764 Define two sets of parsers on architectures that support (either 41765 directly or via multiarch) 16-bit and 32-bit uid/gid syscalls 41766 simultaneously. Since the code in these two sets is essentially 41767 the same and the key difference between them is the size of uid_t, 41768 implement it by parametrizing uid_t and names of parser functions. 41769 41770 * defs.h (NEED_UID16_PARSERS): New macro. 41771 * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16, 41772 sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16, 41773 sys_setreuid16, sys_setuid16): New prototypes. 41774 * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16. 41775 (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16, 41776 sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding 41777 sys_*uid16 functions. 41778 * uid.c: Stop including <asm/posix_types.h>. 41779 Parametrize uid_t and names of all exported functions. 41780 (get_print_uid): New function. 41781 (sys_getresuid): Use it. 41782 (printuid): Check for (uid_t) -1. 41783 * uid16.c: New file. 41784 * Makefile.am (strace_SOURCES): Add it. 41785 * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16, 41786 sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16, 41787 sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16, 41788 sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16, 41789 and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries. 41790 * linux/bfin/syscallent.h: Likewise. 41791 * linux/i386/syscallent.h: Likewise. 41792 * linux/m68k/syscallent.h: Likewise. 41793 * linux/microblaze/syscallent.h: Likewise. 41794 * linux/s390/syscallent.h: Likewise. 41795 * linux/sparc/syscallent.h: Likewise. 41796 * linux/sh/syscallent.h: Likewise. 41797 * linux/sh64/syscallent.h: Likewise. 41798 * tests/uid16.c: New file. 41799 * tests/uid16.test: New test. 41800 * tests/Makefile.am (CHECK_PROGRAMS): Add uid16. 41801 (TESTS): Add uid16.test. 41802 * tests/.gitignore: Add uid16. 41803 41804 2014-12-16 Dmitry V. Levin <ldv (a] altlinux.org> 41805 41806 sh, sh64: fix uid/gid syscall entries. 41807 * linux/sh/syscallent.h: Replace printargs with real syscall 41808 parsers in *chown32 and [gs]et*[gu]id32 syscall entries. 41809 * linux/sh64/syscallent.h: Likewise. 41810 41811 s390: fix uid/gid syscall entries. 41812 * linux/s390/syscallent.h: Add "32" suffix to names of *chown32 41813 and [gs]et*[gu]id32 syscalls #198..216. 41814 41815 sparc: fix uid/gid syscall entries. 41816 * linux/sparc/syscallent.h: Add "32" suffix to names 41817 of [gs]etres[gu]id32 syscalls #108..112. 41818 Fix entry for syscall #112 from setresgid32 to setregid32. 41819 41820 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 41821 41822 chown.c: split into separate files. 41823 This will make further uid/gid fixes simpler. 41824 41825 * fchownat.c: New file. 41826 * chown.c (sys_fchownat: Move to fchownat.c. 41827 (sys_chown, sys_fchown): Move to uid.c. 41828 * Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c. 41829 41830 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 41831 41832 util.c: move printuid to uid.c. 41833 This will make further uid/gid fixes simpler. 41834 41835 * util.c (printuid): Move 41836 * uid.c: ... here. 41837 41838 2014-12-15 Dmitry V. Levin <ldv (a] altlinux.org> 41839 41840 tests/uid.awk: rewrite in a more maintainable style. 41841 Since the test is virtually a FSM, rewrite it as a FSM. 41842 41843 2014-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 41844 41845 printuid: fix uid_t decoding on 64-bit architectures. 41846 It was not a good idea to treat uid_t as a long int type because 41847 the latter is twice larger than uid_t on 64-bit architectures. 41848 41849 * defs.h (printuid): Change uid argument type from "unsigned long" 41850 to "unsigned int". 41851 * util.c (printuid): Likewise. When uid equals to -1, print "-1". 41852 * tests/uid.awk: New file. 41853 * tests/uid.c: New file. 41854 * tests/uid32.c: Likewise. 41855 * tests/uid.test: New test. 41856 * tests/uid32.test: Likewise. 41857 * tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32. 41858 (TESTS): Add uid.test and uid32.test. 41859 (EXTRA_DIST): Add uid.awk. 41860 * tests/.gitignore: Add uid and uid32. 41861 41862 2014-12-13 Dmitry V. Levin <ldv (a] altlinux.org> 41863 41864 Update PTRACE_* constants. 41865 * xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK, 41866 and PTRACE_SETSIGMASK. 41867 41868 Update SWAP_FLAG_* constants. 41869 * swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and 41870 SWAP_FLAG_DISCARD_PAGES are defined. 41871 * xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and 41872 SWAP_FLAG_DISCARD_PAGES. 41873 41874 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 41875 41876 Update SCHED_* constants. 41877 * xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and 41878 SCHED_DEADLINE. 41879 41880 Update prctl PR_* constants. 41881 * xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE, 41882 PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT. 41883 41884 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 41885 41886 Always compile sys_prctl parser. 41887 Since sys_prctl is referenced by syscallent files unconditionally, 41888 conditional compilation of sys_prctl depending on prctl availability is 41889 pointless. 41890 41891 * prctl.c (unalignctl_string, sys_prctl): Compile unconditionally. 41892 41893 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 41894 41895 process.c: split struct_user_offsets into architecture-specific include files 41896 * Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h, 41897 linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h, 41898 linux/crisv10/userent.h, linux/crisv32/userent.h, 41899 linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h, 41900 linux/m68k/userent.h, linux/microblaze/userent.h, 41901 linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h, 41902 linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h, 41903 linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h, 41904 linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h, 41905 linux/tile/userent.h, linux/userent.h, linux/userent0.h, 41906 linux/x32/userent.h, linux/x86_64/userent.h, and 41907 linux/xtensa/userent.h. 41908 * process.c (struct_user_offsets): Split into architecture-specific 41909 include files, inculde userent.h. 41910 41911 process.c: include less headers. 41912 * process.c: Do not include <fcntl.h> and <sys/stat.h>. 41913 Reorder inclusion of xlat header files. 41914 41915 Unexport struct_user_offsets. 41916 * defs.h (struct_user_offsets): Remove. 41917 * process.c (struct_user_offsets): Make static. 41918 41919 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 41920 41921 process.c: introduce XLAT_UOFF macro. 41922 Introduce XLAT_UOFF macro and use it to automatically transform 41923 struct_user_offsets array into a more readable and compact form. 41924 41925 for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do 41926 sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c 41927 done 41928 41929 * process.c (XLAT_UOFF): New macro. 41930 (struct_user_offsets): Use it. 41931 41932 2014-12-11 Dmitry V. Levin <ldv (a] altlinux.org> 41933 41934 process.c: move sethostname and gethostname parsers to a separate file. 41935 * hostname.c: New file. 41936 * Makefile.am (strace_SOURCES): Add it. 41937 * process.c (sys_sethostname, sys_gethostname): Move to hostname.c. 41938 41939 process.c: move exit parser to a separate file. 41940 * exit.c: New file. 41941 * Makefile.am (strace_SOURCES): Add it. 41942 * process.c (sys_exit): Move to exit.c. 41943 41944 process.c: move clone, setns, unshare, and fork parsers to a separate file 41945 * clone.c: New file. 41946 * Makefile.am (strace_SOURCES): Add it. 41947 * process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and 41948 related code to clone.c. 41949 41950 process.c: move get*uid and set*uid parsers to a separate file. 41951 * uid.c: New file. 41952 * Makefile.am (strace_SOURCES): Add it. 41953 * process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid, 41954 sys_setreuid, sys_setresuid): Move to uid.c. 41955 41956 process.c: move getgroups* and setgroups* parsers to a separate file. 41957 * groups.c: New file. 41958 * Makefile.am (strace_SOURCES): Add it. 41959 * process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32, 41960 sys_getgroups32, and related code to groups.c. 41961 41962 process.c: move execve and execv parsers to a separate file. 41963 * execve.c: New file. 41964 * Makefile.am (strace_SOURCES): Add it. 41965 * process.c: Move sys_execve, sys_execv, and related code to execve.c. 41966 41967 process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file 41968 * wait.c: New file. 41969 * Makefile.am (strace_SOURCES): Add it. 41970 * process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and 41971 related code to wait.c. 41972 41973 process.c: move uname parser to a separate file. 41974 * uname.c: New file. 41975 * Makefile.am (strace_SOURCES): Add it. 41976 * process.c (sys_uname): Move to uname.c. 41977 41978 process.c: move futex parser to a separate file. 41979 * futex.c: New file. 41980 * Makefile.am (strace_SOURCES): Add it. 41981 * process.c: Move sys_futex and related code to futex.c. 41982 41983 process.c: move get_robust_list parser to a separate file. 41984 * get_robust_list.c: New file. 41985 * Makefile.am (strace_SOURCES): Add it. 41986 * process.c (sys_get_robust_list): Move to get_robust_list.c. 41987 41988 process.c: move sched_* parsers to a separate file. 41989 * sched.c: New file. 41990 * Makefile.am (strace_SOURCES): Add it. 41991 * process.c: Move sys_sched_getscheduler, sys_sched_setscheduler, 41992 sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min, 41993 sys_sched_rr_get_interval, and related code to sched.c. 41994 41995 process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file 41996 * affinity.c: New file. 41997 * Makefile.am (strace_SOURCES): Add it. 41998 * process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move 41999 to affinity.c. 42000 42001 process.c: move prctl and arch_prctl parsers to a separate file. 42002 * prctl.c: New file. 42003 * Makefile.am (strace_SOURCES): Add it. 42004 * process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c. 42005 42006 process.c: move getcpu parser to a separate file. 42007 * getcpu.c: New file. 42008 * Makefile.am (strace_SOURCES): Add it. 42009 * process.c (sys_getcpu): Move to getcpu.c. 42010 42011 process.c: move process_vm_readv and process_vm_writev parsers to a separate file 42012 * process_vm.c: New file. 42013 * Makefile.am (strace_SOURCES): Add it. 42014 * process.c (sys_process_vm_readv, sys_process_vm_writev): Move 42015 to process_vm.c. 42016 42017 Implement decoding of fallocate FALLOC_FL_* flags. 42018 * xlat/falloc_flags.in: New file. 42019 * configure.ac (AC_CHECK_HEADERS): Add linux/falloc.h. 42020 * fallocate.c [HAVE_LINUX_FALLOC_H]: Include <linux/falloc.h>. 42021 Include xlat/falloc_flags.h. 42022 (sys_fallocate): Decode flags. 42023 42024 Fix decoding of renameat2 RENAME_* flags. 42025 * renameat.c: Include <linux/fs.h> where RENAME_NOREPLACE, 42026 RENAME_EXCHANGE, and RENAME_WHITEOUT are usually defined. 42027 42028 file.c: move open, openat, and creat parsers to a separate file. 42029 * open.c: New file. 42030 * Makefile.am (strace_SOURCES): Add it. 42031 * file.c: Move sys_open, sys_openat, sys_creat, and related code 42032 to open.c. 42033 42034 file.c: move access and faccessat parsers to a separate file. 42035 * access.c: New file. 42036 * Makefile.am (strace_SOURCES): Add it. 42037 * file.c: Move sys_access, sys_faccessat and related code to access.c. 42038 42039 file.c: move umask parser to a separate file. 42040 * umask.c: New file. 42041 * Makefile.am (strace_SOURCES): Add it. 42042 * file.c (sys_umask): Move to umask.c. 42043 42044 file.c: move lseek and llseek parsers to a separate file. 42045 * lseek.c: New file. 42046 * Makefile.am (strace_SOURCES): Add it. 42047 * file.c: Move sys_lseek, sys_llseek, and related code to lseek.c. 42048 42049 file.c: move readahead parser to a separate file. 42050 * readahead.c: New file. 42051 * Makefile.am (strace_SOURCES): Add it. 42052 * file.c (sys_readahead): Move to readahead.c. 42053 42054 file.c: move truncate, truncate64, ftruncate, and ftruncate64 parsers to a separate file 42055 * truncate.c: New file. 42056 * Makefile.am (strace_SOURCES): Add it. 42057 * file.c (sys_truncate, sys_truncate64, sys_ftruncate, sys_ftruncate64): 42058 Move to truncate.c. 42059 42060 file.c: move chdir parser to a separate file. 42061 * chdir.c: New file. 42062 * Makefile.am (strace_SOURCES): Add it. 42063 * file.c (sys_chdir): Move to chdir.c. 42064 42065 file.c: move link, linkat, unlinkat, and symlinkat parsers to a separate file 42066 * link.c: New file. 42067 * Makefile.am (strace_SOURCES): Add it. 42068 * file.c: Move sys_link, sys_linkat, sys_unlinkat, sys_symlinkat, and 42069 related code to link.c. 42070 42071 file.c: move readlink and readlinkat parsers to a separate file. 42072 * readlink.c: New file. 42073 * Makefile.am (strace_SOURCES): Add it. 42074 * file.c (decode_readlink, sys_readlink, sys_readlinkat): Move 42075 to readlink.c. 42076 42077 file.c: move renameat and renameat2 parsers to a separate file. 42078 * renameat.c: New file. 42079 * Makefile.am (strace_SOURCES): Add it. 42080 * file.c: Move sys_renameat, sys_renameat2, and related code 42081 to renameat.c. 42082 42083 file.c: move chown, fchown, and fchownat parsers to a separate file. 42084 * chown.c: New file. 42085 * Makefile.am (strace_SOURCES): Add it. 42086 * file.c (sys_chown, sys_fchownat, sys_fchown): Move to chown.c. 42087 42088 Export at_flags. 42089 * defs.h (at_flags): New prototype. 42090 42091 file.c: move chmod, fchmod, and fchmodat parsers to a separate file. 42092 * chmod.c: New file. 42093 * Makefile.am (strace_SOURCES): Add it. 42094 * file.c (sys_chmod, sys_fchmodat, sys_fchmod): Move to chmod.c. 42095 42096 file.c: move utimes, futimesat, utimensat, and osf_utimes parsers to a separate file 42097 * utimes.c: New file. 42098 * Makefile.am (strace_SOURCES): Add it. 42099 * file.c (decode_utimes, sys_utimes, sys_futimesat, sys_utimensat, 42100 sys_osf_utimes): Move to utimes.c. 42101 42102 file.c: move utime parser to a separate file. 42103 * utime.c: New file. 42104 * Makefile.am (strace_SOURCES): Add it. 42105 * file.c (sys_utime): Move to utime.c. 42106 42107 Export sprinttime. 42108 * defs.h (sprinttime): New prototype. 42109 * file.c (sprinttime): Make global and move to util.c. 42110 42111 file.c: move mknod, mknodat, and xmknod parsers to a separate file. 42112 * mknod.c: New file. 42113 * Makefile.am (strace_SOURCES): Add it. 42114 * file.c: Move sys_mknod, sys_mknodat, sys_xmknod, and related code 42115 to mknod.c. 42116 42117 file.c: export sprintmode and move it to a separate file. 42118 * printmode.c: New file. 42119 * Makefile.am (strace_SOURCES): Add it. 42120 * defs.h (sprintmode): New prototype. 42121 * file.c (sprintmode): Make global and move to printmode.c. 42122 42123 file.c: move getcwd parser to a separate file. 42124 * getcwd.c: New file. 42125 * Makefile.am (strace_SOURCES): Add it. 42126 * file.c (sys_getcwd): Move to getcwd.c. 42127 42128 file.c: move *xattr parsers to a separate file. 42129 * xattr.c: New file. 42130 * Makefile.am (strace_SOURCES): Add it. 42131 * file.c: Move sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr, 42132 sys_listxattr, sys_flistxattr, sys_removexattr, sys_fremovexattr, 42133 and related code to xattr.c. 42134 42135 file.c: move fadvise64 and fadvise64_64 parsers to a separate file. 42136 * fadvise.c: New file. 42137 * Makefile.am (strace_SOURCES): Add it. 42138 * file.c: Move sys_fadvise64, sys_fadvise64_64, and related code 42139 to fadvise.c. 42140 42141 file.c: move sync_file_range and sync_file_range2 parsers to a separate file 42142 * sync_file_range.c: New file. 42143 * Makefile.am (strace_SOURCES): Add it. 42144 * file.c: Move sys_sync_file_range, sys_sync_file_range2, and related 42145 code to sync_file_range.c. 42146 42147 file.c: move fallocate parser to a separate file. 42148 * fallocate.c: New file. 42149 * Makefile.am (strace_SOURCES): Add it. 42150 * file.c (sys_fallocate): Move to fallocate.c. 42151 42152 file.c: move swapon parser to a separate file. 42153 * swapon.c: New file. 42154 * Makefile.am (strace_SOURCES): Add it. 42155 * file.c: Move sys_swapon and related code to swapon.c. 42156 42157 2014-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 42158 42159 Implement full decoding of 64-bit capabilities. 42160 Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but 42161 before this change only lower 32 capability bits were decoded for 42162 v2 and v3. 42163 42164 * xlat/capabilities1.in: New file. 42165 * capability.c: Define v2/v3 CAP_* constants. 42166 Include xlat/capabilities1.h. 42167 (get_cap_header): New function. 42168 (print_cap_header): Update to use get_cap_header result. 42169 (print_cap_data): Decoder higher capability bits for v2 and v3. 42170 (sys_capget, sys_capset): Use get_cap_header, update print_cap_header 42171 and print_cap_data calls. 42172 * tests/caps.c: New file. 42173 * tests/caps.awk: New file. 42174 * tests/caps.test: New test. 42175 * tests/Makefile.am (CHECK_PROGRAMS): Add caps. 42176 (TESTS): Add caps.test. 42177 (EXTRA_DIST): Add caps.awk. 42178 42179 2014-12-06 Dmitry V. Levin <ldv (a] altlinux.org> 42180 42181 Make parsers of capget and capset syscalls self-contained. 42182 Various versions of <linux/capability.h> used to require different 42183 workarounds to avoid conflicts with types defined by libc headers. 42184 Define all required types and constants locally to fix this issue. 42185 42186 * configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h. 42187 * capability.c: Do not include <linux/capability.h>, remove workarounds 42188 for problematic versions of <linux/capability.h> file. 42189 Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums. 42190 (struct __user_cap_header_struct, struct __user_cap_data_struct): Define. 42191 * xlat/cap_version.in: Add #unconditional. 42192 * xlat/capabilities.in: Likewise. 42193 42194 2014-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 42195 42196 Remove system.c. 42197 All disjoint parts of system.c have been moved to separate files. 42198 42199 * system.c: Remove. 42200 * Makefile.am (strace_SOURCES): Remove it. 42201 42202 2014-12-04 Dmitry V. Levin <ldv (a] altlinux.org> 42203 42204 Move mount parser to a separate file. 42205 * mount.c: New file. 42206 * Makefile.am (strace_SOURCES): Add it. 42207 * system.c: Move sys_mount and related code to mount.c. 42208 42209 Move umount2 parser to a separate file. 42210 * umount.c: New file. 42211 * Makefile.am (strace_SOURCES): Add it. 42212 * system.c: Move sys_umount2 and related code to umount.c. 42213 42214 Move personality parser to a separate file. 42215 * personality.c: New file. 42216 * Makefile.am (strace_SOURCES): Add it. 42217 * system.c: Move sys_personality and related code to personality.c. 42218 42219 Move syslog parser to a separate file. 42220 * syslog.c: New file. 42221 * Makefile.am (strace_SOURCES): Add it. 42222 * system.c: Move sys_syslog and related code to syslog.c. 42223 42224 Move cacheflush parser to a separate file. 42225 * cacheflush.c: New file. 42226 * Makefile.am (strace_SOURCES): Add it. 42227 * system.c: Move inclusion of <asm/cachectl.h> to cacheflush.c. 42228 [M68K, BFIN, SH]: Move to cacheflush.c. 42229 42230 bfin: move sram_alloc parser to a separate file. 42231 * sram_alloc.c: New file. 42232 * Makefile.am (strace_SOURCES): Add it. 42233 * system.c [BFIN]: Move sys_sram_alloc and related code to sram_alloc.c. 42234 42235 Move capget and capset parsers to a separate file. 42236 * capability.c: New file. 42237 * Makefile.am (strace_SOURCES): Add it. 42238 * system.c: Move inclusion of headers and macro definitions related 42239 to capget and capset decoding to capability.c. 42240 (print_cap_header, print_cap_data, sys_capget, sys_capset): Move 42241 to capability.c. 42242 42243 2014-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 42244 42245 Move sysctl parser to a separate file. 42246 * sysctl.c: New file. 42247 * Makefile.am (strace_SOURCES): Add it. 42248 * system.c: Move sys_sysctl and related code to sysctl.c. 42249 42250 mips: move sysmips parser to a separate file. 42251 * sysmips.c: New file. 42252 * Makefile.am (strace_SOURCES): Add it. 42253 * system.c: Fix typo in the check for <linux/utsname.h>. 42254 Move inclusions of <linux/utsname.h> and <asm/sysmips.h> to sysmips.c. 42255 [MIPS]: Likewise. 42256 42257 or1k: move or1k_atomic parser to a separate file. 42258 * or1k_atomic.c: New file. 42259 * Makefile.am (strace_SOURCES): Add it. 42260 * system.c [OR1K]: Move to or1k_atomic.c. 42261 42262 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 42263 42264 Alias sys_setdomainname to sys_sethostname. 42265 Since parsers for setdomainname and sethostname syscalls are identical, 42266 replace sys_setdomainname with an alias to sys_sethostname. 42267 42268 * linux/dummy.h (sys_setdomainname): Alias to sys_sethostname. 42269 * linux/syscall.h (sys_setdomainname): Remove. 42270 * process.c (sys_setdomainname): Remove. 42271 42272 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 42273 42274 Alias sys_getpeername to sys_getsockname. 42275 Since parsers for getpeername and getsockname syscalls are identical, 42276 replace sys_getpeername with an alias to sys_getsockname. 42277 42278 * linux/dummy.h (sys_getpeername): Alias to sys_getsockname. 42279 * linux/syscall.h (sys_getpeername): Remove. 42280 * net.c (sys_getpeername): Remove. 42281 42282 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 42283 42284 Alias sys_stime to sys_time. 42285 Since parsers for stime and time syscalls are identical, 42286 replace sys_stime with an alias to sys_time. 42287 42288 * linux/dummy.h (sys_stime): Alias to sys_time. 42289 * linux/syscall.h (sys_stime): Remove. 42290 * time.c (sys_stime): Remove. 42291 42292 2014-12-02 Dmitry V. Levin <ldv (a] altlinux.org> 42293 42294 Remove unused sys_mctl. 42295 Starting with commit v4.6-240-g5afdf12, nobody compiles this 42296 non-Linux code. 42297 42298 * mem.c [MC_SYNC]: Remove. 42299 * xlat/mctl_funcs.in: Remove. 42300 * xlat/mctl_lockas.in: Remove. 42301 42302 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 42303 42304 Alias sys_mkdir and sys_mkdirat to sys_chmod and sys_fchmodat. 42305 Special parsers for mkdir and mkdirat are redundant because 42306 sys_chmod and sys_fchmodat implement the same decoding. 42307 42308 * file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove. 42309 * linux/dummy.h (sys_mkdir): Alias to sys_chmod. 42310 (sys_mkdirat): Alias to sys_fchmodat. 42311 * linux/syscall.h (sys_mkdir, sys_mkdirat): Remove. 42312 * pathtrace.c (pathtrace_match): Do not check for sys_mkdirat. 42313 42314 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 42315 42316 Remove unused <sys/acl.h> based code. 42317 Starting with commit v4.6-240-g5afdf12, nobody compiles this 42318 non-Linux code. 42319 42320 * configure.ac (AC_CHECK_HEADERS): Remove sys/acl.h. 42321 * file.c [HAVE_SYS_ACL_H]: Remove. 42322 * xlat/aclcmds.in: Remove. 42323 42324 2014-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 42325 42326 Remove unused <sys/asynch.h> based code. 42327 Starting with commit v4.6-240-g5afdf12, nobody compiles this 42328 non-Linux code. 42329 42330 * configure.ac (AC_CHECK_HEADERS): Remove sys/asynch.h. 42331 * file.c [HAVE_SYS_ASYNCH_H]: Remove. 42332 42333 2014-11-27 Masatake YAMATO <yamato (a] redhat.com> 42334 42335 Print protocol name of socket descriptors with -yy option. 42336 For those socket descriptors that have no associated ip:port pairs 42337 (or when this information is not available), -yy option prints 42338 the same <socket:[INODE]> information as -y option, e.g. 42339 42340 $ strace -e sendto -yy ip l > /dev/null 42341 sendto(3<socket:[23456789]>, ... 42342 42343 This change makes -yy output more informative: instead of just 42344 printing "socket", the name of protocol behind the socket descriptor 42345 will be printed, e.g. 42346 42347 sendto(3<NETLINK:[23456789]>, ... 42348 42349 * configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h. 42350 * tests/net-yy-accept.awk: Update to support protocol names. 42351 * tests/net-yy-connect.awk: Likewise. 42352 * util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>. 42353 (getfdproto): New function. 42354 (printfd): Use it. 42355 42356 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 42357 42358 Replace MAXPATHLEN with PATH_MAX. 42359 MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter. 42360 42361 * strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX. 42362 * util.c (printpathn, printpath): Likewise. 42363 42364 2014-11-21 Mike Frysinger <vapier (a] gentoo.org> 42365 42366 Decode FIFREEZE/FITHAW/FITRIM ioctls. 42367 The freeze/thaw ones are simple, but the trim is an interesting struct. 42368 42369 * block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM. 42370 * ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl. 42371 42372 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 42373 42374 Include <sys/uio.h> unconditionally. 42375 Since <sys/uio.h> is standardized by POSIX and is present in all 42376 available versions of glibc, it's safe to assume that any usable 42377 libc implementation provides this header file. 42378 42379 * configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h. 42380 * io.c: Include <sys/uio.h> unconditionally. 42381 (tprint_iov_upto, tprint_iov, sys_readv, sys_writev, 42382 print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define 42383 unconditionally. 42384 * net.c: Include <sys/uio.h> unconditionally. 42385 * util.c: Include <sys/uio.h> unconditionally. 42386 (dumpiov): Define unconditionally. 42387 42388 2014-11-21 Dmitry V. Levin <ldv (a] altlinux.org> 42389 42390 Consistently use C99 designated initializers in the new netlink code. 42391 * socketutils.c (send_query, receive_responses): Use designated 42392 initializers for sockaddr_nl, nlmsghdr, and inet_diag_req_v2 structures. 42393 * tests/netlink_inet_diag.c (send_query, check_responses): Likewise. 42394 42395 2014-11-20 Mike Frysinger <vapier (a] gentoo.org> 42396 42397 Decode open's O_TMPFILE. 42398 * xlat/open_mode_flags.in: Add O_TMPFILE definition. 42399 42400 2014-11-11 Helge Deller <deller (a] gmx.de> 42401 42402 hppa: update error codes and signal numbers. 42403 There are two important changes in here: 42404 42405 1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa 42406 folks had problems with EWOULDBLOCK != EAGAIN, this was changed in 42407 kernel 3.14. 42408 42409 2. Starting with kernel 3.18, hppa folks changed some signal numbers in 42410 such a way that we end up with SIGRTMIN == 32, which brings hppa in sync 42411 with other linux ports. 42412 42413 Both were incompatible changes which basically broke hppa ABI, but since 42414 they have been merged into the kernel, we have to follow. 42415 42416 2014-11-11 Thomas De Schampheleire <thomas.de.schampheleire (a] gmail.com> 42417 42418 stack trace support: fix check on symbol name presence. 42419 The output format of the stack trace is supposed to be different 42420 depending on whether symbol names are available in the build. 42421 42422 However, the check only verified the validity of the pointer, not of the 42423 string pointed to (which could be empty). 42424 42425 This commit fixes the check so that the original output: 42426 42427 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 42428 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] 42429 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] 42430 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] 42431 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] 42432 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] 42433 > /bin/busybox(+0x0) [0x62c60] 42434 > /bin/busybox(+0x0) [0x4940] 42435 > /bin/busybox(+0x0) [0x499c] 42436 > /bin/busybox(+0x0) [0x4e08] 42437 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] 42438 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] 42439 42440 becomes: 42441 42442 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000 42443 > /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38] 42444 > /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574] 42445 > /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c] 42446 > /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac] 42447 > /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c] 42448 > /bin/busybox() [0x62c60] 42449 > /bin/busybox() [0x4940] 42450 > /bin/busybox() [0x499c] 42451 > /bin/busybox() [0x4e08] 42452 > /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c] 42453 > /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8] 42454 42455 Acked-by: Masatake YAMATO <yamato (a] redhat.com> 42456 42457 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 42458 42459 tests: add a test for decoding and dumping of recvmmsg/sendmmsg. 42460 * configure (AC_CHECK_FUNCS): Add sendmmsg. 42461 * tests/mmsg.c: New file. 42462 * tests/mmsg.expected: New file. 42463 * tests/mmsg.test: New test. 42464 * tests/.gitignore: Add mmsg. 42465 * tests/Makefile.am (CHECK_PROGRAMS): Add mmsg. 42466 (TESTS): Add mmsg.test. 42467 (EXTRA_DIST): Add mmsg.expected. 42468 42469 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 42470 42471 Add functions for dumping iovecs in mmsghdr used in sendmmsg and recvmmsg 42472 This patch is similar to what I did in commit 42473 02f9f6b386741a52f58e1b31ad4e7fff60781ef8. 42474 That commit was for sendmsg and recvmsg system calls. 42475 This one is for sendmmsg and recvmmsg system calls. 42476 42477 * defs.h (dumpiov_in_mmsghdr): New declaration. 42478 * net.c (extractmmsghdr): New function derived from printmmsghdr. 42479 (printmmsghdr): Use it. 42480 (dumpiov_in_mmsghdr): New function. 42481 * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr 42482 for recvmmsg and sendmmsg syscalls. 42483 42484 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 42485 42486 Use the definition of struct mmsghdr if it is defined in build environment 42487 mmsghrd structure type is defined locally in printmmsghdr function. 42488 42489 However, more functions will refer the definition in modifications for 42490 supporting "-e write=set" and "-e read=set" option for sendmmsg and 42491 recvmmsg system calls. 42492 42493 After this change, the system definition of struct mmsghdr will be used 42494 if configure reports it is available, falling back to the old local 42495 definition. 42496 42497 * configure.ac (AC_CHECK_TYPES): Add struct mmsghdr. 42498 * net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define. 42499 (printmmsghdr): Use previously defined struct mmsghdr. 42500 42501 2014-11-11 Masatake YAMATO <yamato (a] redhat.com> 42502 42503 Introduce a separate function to copy from msghdr32 to msghdr. 42504 This patch is an initial step for supporting "-e write=set" and 42505 "-e read=set" option for sendmmsg and recvmmsg system calls. 42506 42507 Coverting a data of msghdr32 to msghdr is needed both for 42508 {send,recv}msg and {send,recv}mmsg to decode parameters. 42509 To share the copying code in both decoders, a separate 42510 function named copy_from_msghdr32 is introduced. 42511 42512 * net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] 42513 (copy_from_msghdr32): New function. 42514 (extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it. 42515 42516 2014-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 42517 42518 ioctlsort: rewrite build rules using noinst_PROGRAMS. 42519 * linux/ioctlsort.c: Rename to ioctlsort.c 42520 * Makefile.am (EXTRA_DIST): Rename linux/ioctlsort.c to ioctlsort.c. 42521 [MAINTAINER_MODE] (noinst_PROGRAMS): Add ioctlsort. 42522 (ioctlsort_SOURCES): Add ioctlsort.c. 42523 (nodist_ioctlsort_SOURCES): Add ioctls.h and ioctldefs.h. 42524 (CLEANFILES): Add $(nodist_ioctlsort_SOURCES). 42525 (ioctlsort.$(OBJEXT)): Likewise. 42526 (ioctlsort): Remove. 42527 42528 2014-11-11 Lubomir Rintel <lkundrak (a] v3.sk> 42529 42530 Makefile.am: look for ioctl definitions in the kernel build tree by default 42531 While most of ioctl-related kernel headers are now exported by kernel's 42532 headers_install, some are still modules_install only. The kernel's 42533 headers installed into /usr/include/ are usually headers_install'ed and 42534 therefore don't contain some internal headers we need. The solution is 42535 to look for modules_install'ed headers for the running kernel, and fall 42536 back to old behavior if they aren't found. 42537 42538 2014-11-04 Lubomir Rintel <lkundrak (a] v3.sk> 42539 42540 Dump details for Bluetooth socket operations. 42541 * configure.ac (AC_CHECK_HEADERS): Add bluetooth/bluetooth.h. 42542 * xlat/bt_protocols.in: New file. 42543 * net.c [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include bluetooth 42544 headers. 42545 [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h". 42546 (printsock) [AF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Dump details 42547 for AF_BLUETOOTH sockets. 42548 (sys_socket) [PF_BLUETOOTH && HAVE_BLUETOOTH_BLUETOOTH_H]: Decode 42549 protocol for PF_BLUETOOTH sockets. 42550 42551 2014-11-04 Philippe De Muyter <phdm (a] macqel.be> 42552 42553 Implement Video4Linux video-input ioctls decoder. 42554 Introduce v4l2.c, a decoder for the arguments of the video-input subset 42555 of the v4l2 ioctl's. This is a combination of 42556 - previous work by Peter Zotov <whitequark (a] whitequark.org>, found at 42557 https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch 42558 - previous work by William Manley <will (a] williammanley.net>, found at 42559 http://marc.info/?l=strace&m=139395588520675 42560 - forward port, additions and fixes by Philippe De Muyter <phdm (a] macqel.be> 42561 42562 As v4l2 is a moving target, I have made v4l2.c compilable with ancient 42563 linux kernels by testing the availability of some macros. It has been 42564 succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and 42565 succesfully used on linux 3.10 with a camera device. 42566 42567 * configure.ac: Check for availabilty of V4L2_* enum constants. 42568 * Makefile.am (strace_SOURCES): Add v4l2.c. 42569 * defs.h (v4l2_ioctl): New prototype. 42570 * ioctl.c (ioctl_decode): Use v4l2_ioctl. 42571 * v4l2.c: New file. 42572 * xlat/v4l2_*.in: New files. 42573 42574 Cc: Peter Zotov <whitequark (a] whitequark.org> 42575 Cc: William Manley <will (a] williammanley.net> 42576 42577 2014-11-04 Dmitry V. Levin <ldv (a] altlinux.org> 42578 42579 Update ioctl entries. 42580 * linux/ioctlent.h.in: Regenerate from v3.17 headers. 42581 42582 Remove ioctl header file names from the executable. 42583 * defs.h (struct ioctlent): Remove "doth" field. 42584 * Makefile.am ($(ioctlent_h)): Remove 1st field. 42585 42586 2014-11-04 Dmitry V. Levin <ldv (a] altlinux.org> 42587 42588 Filter out redundant ioctl entries early. 42589 For two ioctl entries with the same code, if one's name is a prefix 42590 to another's name, keep the entry with a shorter name. Filter out 42591 redundant ioctl entries at ioctlsort stage so that distributed 42592 ioctlent.h.in files will be already filtered. 42593 42594 * linux/ioctlsort.c (is_not_prefix): New function. 42595 (main): Use it. 42596 * linux/ioctlent-filter.awk: Remove. 42597 * Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk. 42598 ($(ioctlent_h)): Don't use linux/ioctlent-filter.awk. 42599 42600 2014-11-03 Dmitry V. Levin <ldv (a] altlinux.org> 42601 42602 ioctlent.sh: update the list of directories exported by headers_install. 42603 * linux/ioctlent.sh: Add drm, mtd, rdma, video, and xen directories. 42604 42605 2014-11-01 Masatake YAMATO <yamato (a] redhat.com> 42606 42607 Add a function for dumping iovec in msghdr used in sendmsg and recvmsg. 42608 Here is an example session: 42609 42610 $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null 42611 sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(... 42612 * 40 bytes in buffer 0 42613 | 00000 28 00 00 00 10 00 05 00 d0 d9 aa 53 00 00 00 00 (..........S.... | 42614 | 00010 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ | 42615 | 00020 08 00 04 00 dd 05 00 00 ........ | 42616 ... 42617 42618 $ ./strace -e read=all ip link show > /dev/null 42619 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"... 42620 * 8192 bytes in buffer 0 42621 | 00000 34 00 00 00 02 00 00 00 00 00 00 00 ff 23 00 00 4............#.. | 42622 | 00010 ff ff ff ff 20 00 00 00 10 00 05 00 00 00 00 00 .... ........... | 42623 ... 42624 42625 * defs.h (dumpiov_in_msghdr): New prototype. 42626 * net.c (extractmsghdr): New function derived from printmsghdr. 42627 (printmsghdr): Use extractmsghdr. 42628 (dumpiov_in_msghdr): New function. 42629 * syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg 42630 and sendmsg syscalls. 42631 42632 2014-10-31 Maarten ter Huurne <maarten (a] treewalker.org> 42633 42634 Include <linux/ptrace.h> regardless of <sys/reg.h> existence. 42635 This fixes compilation with musl libc. 42636 This approach was already used in process.c, so I assume it is safe. 42637 42638 * signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check. 42639 * syscall.c: Likewise. 42640 * util.c: Likewise. 42641 42642 2014-10-31 Dmitry V. Levin <ldv (a] altlinux.org> 42643 42644 sock: decode SIOCSIFNAME on entering syscall. 42645 * sock.c (sock_ioctl): Handle SIOCSIFNAME on entering syscall. 42646 42647 2014-10-31 Mike Frysinger <vapier (a] gentoo.org> 42648 42649 sock: fix decoding of SIOCSIFNAME. 42650 The decoding of SIOCSIFNAME is incorrect. It does not use 42651 the ifr_index field to look things up, but ifr_newname. 42652 42653 * sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and 42654 display ifr_newname. 42655 42656 2014-10-31 Mike Frysinger <vapier (a] gentoo.org> 42657 42658 sock: fix decoding of struct ifreq.ifr_name. 42659 The ifr name fields of the ifreq structure might not be NUL terminated. 42660 If the user makes an ioctl call where they aren't, then strace ends up 42661 reading random content from its own stack. Limit the printf lengths. 42662 42663 * sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs. 42664 42665 2014-10-03 Elliott Hughes <enh (a] google.com> 42666 42667 Don't risk truncating open flags by using mode_t. 42668 On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short) 42669 as their mode_t. The open(2) flags are actually an int, so high ones 42670 like O_CLOEXEC get truncated if you coerce them to mode_t. 42671 42672 * defs.h (tprint_open_modes, sprint_open_modes): Change argument type 42673 from mode_t to int. 42674 * file.c (tprint_open_modes, sprint_open_modes): Likewise. 42675 42676 2014-09-29 Dmitry V. Levin <ldv (a] altlinux.org> 42677 42678 Enhance sysinfo decoding. 42679 * configure.ac (AC_CHECK_MEMBERS): Check for struct sysinfo.totalhigh, 42680 struct sysinfo.freehigh, and struct sysinfo.mem_unit. 42681 * sysinfo.c (sys_sysinfo): Treat failed umove() call as syserror(). 42682 Print totalhigh, freehigh, and mem_unit members when struct sysinfo 42683 supports them. 42684 42685 Move sysinfo parser to a separate file. 42686 * sysinfo.c: New file. 42687 * Makefile.am (strace_SOURCES): Add it. 42688 * resource.c (sys_sysinfo): Move to sysinfo.c. 42689 42690 2014-09-29 Dmitry V. Levin <ldv (a] altlinux.org> 42691 42692 Fix build with musl libc. 42693 * resource.c: Include <sys/sysinfo.h> for struct sysinfo definition. 42694 42695 Reported-by: Steven Honeyman <stevenhoneyman (a] gmail.com> 42696 42697 2014-09-23 Dmitry V. Levin <ldv (a] altlinux.org> 42698 42699 tests: cleanup checks for basic programs. 42700 * tests/init.sh: Check for cat and rm. 42701 * tests/getdents.test: Check for awk. 42702 * tests/ptrace_setoptions.test: Check for grep. 42703 * tests/net-fd.test: Do not check for rm. 42704 * tests/net.test: Likewise. 42705 * tests/scm_rights-fd.test: Likewise. 42706 * tests/stat.test: Likewise. 42707 * tests/uio.test: Likewise. 42708 42709 tests: add a test for -yy option. 42710 * tests/net-yy.test: New test. 42711 * tests/inet-accept-connect-send-recv.c: New file. 42712 * tests/netlink_inet_diag.c: Likewise. 42713 * tests/net-yy-accept.awk: Likewise. 42714 * tests/net-yy-connect.awk: Likewise. 42715 * tests/.gitignore: Add inet-accept-connect-send-recv, 42716 netlink_inet_diag, *.tmp-*, and *.tmp.*. 42717 * tests/Makefile.am (check_PROGRAMS): Add inet-accept-connect-send-recv 42718 and netlink_inet_diag. 42719 (TESTS): Add net-yy.test. 42720 (EXTRA_DIST): Add net-yy-accept.awk and net-yy-connect.awk. 42721 42722 2014-09-22 Dmitry V. Levin <ldv (a] altlinux.org> 42723 42724 Move statfs related parsers to a separate file. 42725 * statfs.c: New file. 42726 * Makefile.am (strace_SOURCES): Add it. 42727 * file.c (sprintfstype, printstatfs, sys_statfs, sys_fstatfs): Move 42728 to statfs.c. 42729 [HAVE_STATFS64] (printstatfs64, printcompat_statfs64, sys_statfs64, 42730 sys_fstatfs64): Likewise. 42731 [ALPHA] (osf_statfs, osf_fstatfs): Likewise. 42732 42733 fsmagic: sort array by value and use bsearch for faster lookup. 42734 * defs.h (xlat_search): New prototype. 42735 * util.c (xlat_bsearch_compare, xlat_search): New functions. 42736 * file.c (sprintfstype): Use xlat_search for fsmagic lookup. 42737 * xlat/fsmagic.in: Sort by value and mark as not NULL-terminated. 42738 * tests/statfs.c: New file. 42739 * tests/statfs.test: New test. 42740 * tests/Makefile.am (check_PROGRAMS): Add statfs. 42741 (statfs_CFLAGS): Define. 42742 (TESTS): Add statfs.test. 42743 * tests/.gitignore: Add statfs. 42744 42745 2014-09-21 Dmitry V. Levin <ldv (a] altlinux.org> 42746 42747 fsmagic: update from <linux/magic.h> 42748 * xlat/fsmagic.in: Add new constants from <linux/magic.h>. 42749 Reported by Elliott Hughes. 42750 42751 2014-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 42752 42753 Add -yy option: print ip and port associated with socket descriptors. 42754 When two ore more -y options are given, print local and remote ip:port 42755 pairs associated with socket descriptors. This implementation uses 42756 NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch 42757 prepared by Zubin Mithra as a part of his GSoC 2014 strace project. 42758 42759 * Makefile.am (strace_SOURCES): Add socketutils.c 42760 (EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h. 42761 * defs.h (print_sockaddr_by_inode): New prototype. 42762 * linux/inet_diag.h: New file. 42763 * linux/sock_diag.h: Likewise. 42764 * socketutils.c: Likewise. 42765 * strace.1: Document -yy option. 42766 * strace.c (usage): Likewise. 42767 * util.c (printfd): Use print_sockaddr_by_inode. 42768 42769 2014-09-17 Vicente Olivert Riera <vincent (a] gentoo.org> 42770 42771 sigaction: wrap sa_restorer in #ifdef SA_RESTORER consistently. 42772 Wrap sa_restorer member definitions in #ifdef SA_RESTORER to be 42773 consistent with their use. 42774 If an architecture does not provide sa_restorer members but still 42775 defines SA_RESTORER macro, the latter has to be explicitly undefined. 42776 42777 This change fixes compilation failures like this one: 42778 signal.c: In function 'decode_old_sigaction': 42779 signal.c:631:21: error: 'struct old_sigaction' has no member named 'sa_restorer' 42780 signal.c: In function 'decode_new_sigaction': 42781 signal.c:1224:21: error: 'struct new_sigaction' has no member named 'sa_restorer' 42782 42783 * signal.c (struct old_sigaction, struct old_sigaction32, 42784 struct new_sigaction, struct new_sigaction32): 42785 Wrap sa_restorer member in #ifdef SA_RESTORER. 42786 (decode_old_sigaction, decode_new_sigaction): 42787 Wrap use of sa32.sa_restorer in #ifdef SA_RESTORER. 42788 42789 2014-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 42790 42791 Fix compilation warnings reported by gcc -Wsign-compare. 42792 * configure.ac (gl_WARN_ADD): Add -Wsign-compare. 42793 * defs.h (struct tcb): Change 'currpers' type to unsigned. 42794 (struct xlat): Change 'val' type to unsigned 42795 (signame): Add 'const' qualifier to its argument. 42796 (xlookup, printxval): Add 'const' qualifier to the 2nd argument and 42797 change its type to unsigned. 42798 (printpathn): Change the 3rd argument type to unsigned. 42799 (ioctl_lookup): Change 1st argument type to unsigned. 42800 * count.c (call_summary_pers, call_summary): Change 'i' type to unsigned. 42801 * file.c (print_xattr_list): Fix comparisons between signed and unsigned 42802 long values. 42803 * ioctl.c (compare): Fix cast. 42804 (ioctl_lookup): Change 1st argument type to to unsigned. 42805 (ioctl_next_match): Change 'code' type to unsigned. 42806 * mem.c (sys_move_pages): Change 'i' type to unsigned. 42807 * mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned. 42808 Print 'i' using %u format string. 42809 * process.c (sys_prctl): Change 'i' type to unsigned. 42810 (printargv): Change 'n' type to unsigned. 42811 (sys_ptrace): Change 'addr' type to unsigned. 42812 * scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument 42813 and change its type to unsigned. Change 'i' and 'allocated' types 42814 to unsigned. 42815 * signal.c (signame): Add 'const' qualifier to its argument. 42816 Fix comparisons between signed and unsigned values. 42817 (sprintsigmask_n, printsiginfo): Fix comparisons between signed and 42818 unsigned values. 42819 * sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned. 42820 * strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned. 42821 (detach): Change 'sig' type to unsigned. 42822 (startup_attach): Change 'tcbi' type to unsigned. 42823 (startup_child): Change 'm', 'n', and 'len' types to unsigned. 42824 (init): Use new variable to iterate 'tcbtab'. 42825 (pid2tcb): Change 'i' type to unsigned. 42826 (cleanup): Change 'i' and 'sig' types to unsigned. 42827 * syscall.c (update_personality): Change 'personality' argument type 42828 to unsigned. 42829 (struct qual_options): Change 'bitflag' type to unsigned. 42830 (reallocate_qual): Add 'const' qualifier to its argument and change its 42831 type to unsigned. 42832 (qualify_one): Change 'n' and 'bitflag' arguments types to unsigned. 42833 Add 'const' qualifier to 'n', 'not', and 'pers' arguments. 42834 Change 'p' type to signed int. 42835 (qual_syscall): Change 'bitflag' argument type to unsigned. 42836 Add 'const' qualifier to 'bitflag' and 'not' arguments. 42837 Change 'p' type to signed int. 42838 (qual_signal): Change 'bitflag' argument type to unsigned. 42839 Add 'const' qualifier to 'bitflag' and 'not' arguments. 42840 Change 'i' type to unsigned. 42841 (qual_desc): Change 'bitflag' argument type to unsigned. 42842 Add 'const' qualifier to 'bitflag' and 'not' arguments. 42843 (qualify): Change 'i' type to unsigned. 42844 (get_scno): Change 'currpers' type to unsigned. 42845 Fix a comparison between signed and unsigned values. 42846 * system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned. 42847 Fix comparisons between signed and unsigned values. 42848 * util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument 42849 and change its type to unsigned. 42850 (printuid): Fix a comparison between signed and unsigned values. 42851 (printpathn): Change 'n' argument type to unsigned. 42852 (printstr): Change 'size' type to unsigned. 42853 Fix a comparison between signed and unsigned values. 42854 (setbpt): Change 'i' type to unsigned. 42855 * net.c (printsock): Silence a compilation warning. 42856 * reboot.c (sys_reboot): Likewise. 42857 42858 2014-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 42859 42860 Move dirent related parsers to a separate file. 42861 * dirent.c: New file. 42862 * Makefile.am (strace_SOURCES): Add it. 42863 * file.c (print_old_dirent, sys_readdir, sys_getdents, sys_getdents64): 42864 Move to dirent.c. 42865 42866 getdents, getdents64: fix potential out-of-bounds read issues. 42867 * file.c (sys_getdents): Check for invalid d_reclen. 42868 Avoid reading from uninitialized memory. 42869 (sys_getdents64): Likewise. 42870 * tests/getdents.awk: New file. 42871 * tests/getdents.test: New test. 42872 * tests/Makefile.am (TESTS): Add it. 42873 (EXTRA_DIST): Add getdents.awk. 42874 42875 2014-09-10 Dmitry V. Levin <ldv (a] altlinux.org> 42876 42877 tprint_sock_type: remove unused parameter. 42878 * net.c (tprint_sock_type): Remove unused parameter 'tcp'. 42879 (sys_socket, sys_socketpair): Update callers. 42880 42881 printsock: fix decoding of unrecognized AF_PACKET packet types. 42882 * net.c (printsock): Fix fallback string for AF_PACKET packet types. 42883 42884 2014-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 42885 42886 decode_select: fix potential use of an uninitialized variable. 42887 A pointer to fd_set was used uninitialized when nfds == 0. 42888 42889 * desc.c (decode_select): Initialize fds. 42890 42891 Reported-by: Zubin Mithra <zubin.mithra (a] gmail.com> 42892 42893 2014-09-08 Dmitry V. Levin <ldv (a] altlinux.org> 42894 42895 Use external libaio.h. 42896 Stop using an outdated partial copy of libaio.h, switch back to external 42897 libaio.h from libaio. 42898 This partially reverts commit 2df03c494eb3c36c4178eba35c374831031d1a58. 42899 42900 * aio.c: Drop a partial copy of libaio.h, include <libaio.h> instead. 42901 (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS. 42902 (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and 42903 HAVE_DECL_IO_CMD_PWRITEV. 42904 * configure.ac: Check for libaio.h and declaration it provides. 42905 42906 2014-08-19 Dmitry V. Levin <ldv (a] altlinux.org> 42907 42908 maint: post-release administrivia. 42909 * NEWS: Add header line for next release. 42910 42911 2014-08-15 Dmitry V. Levin <ldv (a] altlinux.org> 42912 42913 Prepare for 4.9 release. 42914 * NEWS: Update for 4.9 release. 42915 * debian/changelog: 4.9-1. 42916 * strace.spec: 4.9-1. 42917 42918 Sync strace.spec and debian/ with packages. 42919 * debian/changelog: Sync with 4.8-1.1. 42920 * debian/control: Likewise. 42921 * debian/rules: Likewise. 42922 * strace.spec: Sync with 4.8-5. 42923 42924 NEWS: Update for 4.9 release. 42925 42926 2014-08-15 Mike Frysinger <vapier (a] gentoo.org> 42927 42928 Update syscall tables to the point where they include renameat2. 42929 * linux/dummy.h: Add printargs aliases for sys_sched_getattr and 42930 sys_sched_setattr. 42931 * linux/aarch64/syscallent1.h: Add kcmp/finit_module/sched_setattr/ 42932 sched_getattr/renameat2. 42933 * linux/alpha/syscallent.h: Add kcmp/finit_module. 42934 * linux/arm/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 42935 * linux/hppa/syscallent.h: Add sched_setattr/sched_getattr/utimes/renameat2. 42936 * linux/i386/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 42937 * linux/ia64/syscallent.h: Likewise. 42938 * linux/m68k/syscallent.h: Likewise. 42939 * linux/microblaze/syscallent.h: Likewise. 42940 * linux/mips/syscallent-n32.h: Likewise. 42941 * linux/mips/syscallent-n64.h: Add getdents64/sched_setattr/sched_getattr/ 42942 renameat2. 42943 * linux/mips/syscallent-o32.h: Add sched_setattr/sched_getattr/renameat2. 42944 * linux/powerpc/syscallent.h: Fix finit_module/kcmp order. Add sched_setattr/ 42945 sched_getattr/renameat2. 42946 * linux/s390/syscallent.h: Add sched_setattr/sched_getattr/renameat2. 42947 * linux/s390x/syscallent.h: Likewise. 42948 * linux/sparc/syscallent.h: Likewise. 42949 * linux/x32/syscallent.h: Likewise. 42950 * linux/x86_64/syscallent.h: Likewise. 42951 * linux/xtensa/syscallent.h: Add sched_setattr/sched_getattr. 42952 42953 renameat2: add decoding support. 42954 * file.c (decode_renameat, sys_renameat2): New functions. 42955 (sys_renameat): Use decode_renameat. 42956 * pathtrace.c (pathtrace_match): Handle sys_renameat2. 42957 * linux/syscall.h (sys_renameat2): New prototype. 42958 * xlat/rename_flags.in: New file. 42959 42960 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 42961 42962 CREDITS: fix generation in out of tree builds. 42963 The {...} code changes the working dir with `cd`, but the commands outside 42964 of that block expects to be in the original dir. Change to a subshell so 42965 the path outside of this block remains unchanged. 42966 42967 * Makefile.am ($(srcdir)/CREDITS): Change {...} to (...). 42968 42969 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 42970 42971 ia64: add missing syscalls. 42972 When the preadv/pwritev syscalls were added, the ones before it in the 42973 ia64 list were missed, so all the syscalls there and later were not in 42974 the right location (causing things to be decoded incorrectly). 42975 42976 Add the missing syscalls before preadv which also re-aligns all the 42977 syscalls after that point. This fixes the uio.test. 42978 42979 * linux/ia64/syscallent.h: Add syscalls 1310 through 1318. 42980 42981 2014-08-14 Mike Frysinger <vapier (a] gentoo.org> 42982 42983 ia64: fix sigaction decoding. 42984 Looks like ia64 doesn't have sa_restorer either, yet still defines 42985 SA_RESTORER. Deploy the same trick that HPPA is using to make the 42986 test pass. 42987 42988 * signal.c (SA_RESTORER): Undefine when IA64 is defined. 42989 (struct new_sigaction) [IA64]: Disable sa_restorer. 42990 42991 2014-08-12 Dmitry V. Levin <ldv (a] altlinux.org> 42992 42993 tests: skip detach-stopped.test when PTRACE_SEIZE doesn't work. 42994 detach-stopped.test is known to fail when PTRACE_SEIZE is not available, 42995 so skip the test in that case. 42996 42997 * tests/detach-stopped.test: Check for "strace -d" output and skip the 42998 test when it says that PTRACE_SEIZE doesn't work. 42999 43000 2014-08-11 Erik Johansson <erik (a] ejohansson.se> 43001 43002 sh: fix syscall numbering for recv and sendto. 43003 * linux/sh/syscallent.h: Swap recv and sendto syscall entries. 43004 43005 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 43006 43007 tests: fix uio building w/out preadv/pwritev. 43008 The preadv/pwritev symbols weren't added to glibc until the 2.10 release, 43009 so trying to build the uio test leads to link failures. Add configure 43010 tests and update uio.test to handle this. 43011 43012 * configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev. 43013 * tests/uio.c: Include config.h. 43014 (main): Check for HAVE_PREADV and HAVE_PWRITEV. 43015 * tests/uio.test: Check exit status of uio helper. 43016 43017 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 43018 43019 tests: ignore *.tmp files. 43020 The tests like to generate random .tmp files, so ignore them. 43021 43022 * tests/.gitignore: Add *.tmp. 43023 43024 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 43025 43026 tests: fix shell errors in detach tests. 43027 The current detach test code does: 43028 set -e 43029 ... 43030 cleanup() { 43031 set +e 43032 kill ... 43033 wait ... 43034 } 43035 ... 43036 cleanup 43037 exit 0 43038 43039 The problem is that while `set -e` is disabled for the body of the 43040 cleanup function, it isn't necessarily disabled in the caller scope. 43041 So if the return value of the cleanup function (`wait` in this case) 43042 is non-zero, the script ends up failing overall. 43043 43044 Add an explicit return 0 to the cleanup function so that we don't kill 43045 the overall test pipeline. 43046 43047 * tests/detach-running.test (cleanup): Add return 0. 43048 * tests/detach-sleeping.test (cleanup): Likewise. 43049 * tests/detach-stopped.test (cleanup): Likewise. 43050 43051 2014-08-11 Mike Frysinger <vapier (a] gentoo.org> 43052 43053 set_ptracer_any: add a little documentation. 43054 This way I don't have to keep reading up on these options and wondering 43055 why the code isn't aborting when the call fails. 43056 43057 * tests/set_ptracer_any.c (main): Note prctl failures are ok. 43058 43059 2014-08-10 Mike Frysinger <vapier (a] gentoo.org> 43060 43061 signal: fix thinko in sa_restorer. 43062 Previous commit here re-added the bugs trying to be fixed due to a 43063 logic thinko. The patches were tested in isolation and hand merged 43064 later. Oops. 43065 43066 * signal.c (struct new_sigaction): Change || to &&. 43067 43068 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 43069 43070 sigaction test: support arches w/out SA_RESTORER and swapped args. 43071 Running Linux 3.15 (sparc64) and glibc 2.17 (sparc32) triggers a 43072 rt_sigaction call that does not use SA_RESTORER and has an order 43073 where it inserts a restorer and a size. The current tests don't 43074 support that ordering, so add another regex. 43075 43076 * tests/sigaction.awk: Support no SA_RESTORER and swapped args. 43077 43078 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 43079 43080 alpha/sparc: fix arg count for rt_sigaction. 43081 Both these arches have a rt_sigaction syscall that takes 5 args, not 4. 43082 43083 * linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5. 43084 * linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5. 43085 43086 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 43087 43088 hppa: fix sigaction decoding. 43089 Since the rt_sigaction syscall on hppa doesn't have a sa_restorer, 43090 do not include it in the kernel struct. 43091 43092 We also have to undefine SA_RESTORER so that code doesn't try to 43093 use it. The headers will export this, but the syscall doesn't 43094 actually respect it. 43095 43096 * signal.c (SA_RESTORER): Undefine when HPPA is defined. 43097 (struct new_sigaction): Disable sa_restorer on hppa. 43098 43099 2014-08-09 Mike Frysinger <vapier (a] gentoo.org> 43100 43101 alpha: fix sigaction decoding. 43102 Since the rt_sigaction syscall on alpha doesn't have a sa_restorer, 43103 do not include it in the kernel struct. 43104 43105 * signal.c (struct new_sigaction): Disable sa_restorer on alpha. 43106 43107 2014-08-08 Dmitry V. Levin <ldv (a] altlinux.org> 43108 43109 Prepare for -yy option support. 43110 * defs.h (show_fd_path): Change type to unsigned int. 43111 * strace.c (show_fd_path): Likewise. 43112 (init): Handle repeated -y option. 43113 43114 2014-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 43115 43116 Fix preadv/pwritev offset decoding on ILP32 architectures. 43117 This fixes regression introduced by the previous commit. 43118 43119 * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]: 43120 Cast argument to unsigned long before casting it to unsigned long long. 43121 43122 2014-08-07 Dmitry V. Levin <ldv (a] altlinux.org> 43123 43124 Fix preadv/pwritev offset decoding on bigendian architectures. 43125 This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560. 43126 43127 * util.c (printllval): Remove align argument. 43128 * defs.h (printllval): Update prototype. 43129 (printllval_aligned, printllval_unaligned): Remove. 43130 * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, 43131 sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, 43132 sys_fallocate): Replace printllval_aligned call with printllval. 43133 * io.c (sys_pread, sys_pwrite): Likewise. 43134 (print_llu_from_low_high_val): New function. 43135 (sys_preadv, sys_pwritev): Use it instead of printllval_unaligned. 43136 43137 2014-08-06 Dmitry V. Levin <ldv (a] altlinux.org> 43138 43139 Decode file descriptors returned by accept and accept4 syscalls. 43140 * net.c (do_accept): Rename to do_sockname. 43141 (sys_accept, sys_accept4): Update callers, return RVAL_FD. 43142 (sys_getsockname, sys_getpeername): Call do_sockname directly. 43143 * tests/net-fd.test: Update. 43144 43145 2014-08-01 Mike Frysinger <vapier (a] gentoo.org> 43146 43147 x32: update io_{setup,submit} syscalls. 43148 Starting in 3.16, these two syscalls have gotten their own entry 43149 point for x32. See linux 7fd44dacdd803c0bbf38bf478d51d280902bb0f1. 43150 43151 * linux/x32/syscallent.h: Change existing io_{setup,submit} to 64bit, 43152 and add new entry points for x32 specifically. 43153 43154 2014-06-18 Max Filippov <jcmvbkbc (a] gmail.com> 43155 43156 xtensa: sort values in struct_user_offsets. 43157 Otherwise ptrace syscall argument decoding is wrong: 43158 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0 43159 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0 43160 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0 43161 instead of 43162 ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0 43163 ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0 43164 ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0 43165 43166 * process.c (struct_user_offsets) [XTENSA]: Sort values. 43167 43168 2014-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 43169 43170 Document -k option as experimental. 43171 strace -k does not produce a reliable output on all supported 43172 configurations yet, even basic strace-k.test is known to fail 43173 on some of them. 43174 43175 * strace.c (usage): Document -k option as experimental. 43176 * strace.1: Likewise. 43177 * NEWS: Likewise. 43178 43179 2014-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 43180 43181 tests: robustify -k test. 43182 Split stack-fcall.c into several compilation units so that intermediate 43183 function calls would not be optimized out by compiler. 43184 43185 * tests/stack-fcall.c: Move intermediate functions to ... 43186 * tests/stack-fcall-*.c: ... new files. 43187 * tests/Makefile.am (stack_fcall_SOURCES): Add stack-fcall-*.c. 43188 43189 2014-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 43190 43191 tests: enhance -k test. 43192 Add two more function calls to the stack. Suggested by Masatake YAMATO. 43193 43194 * tests/stack-fcall.c (f1): Rename to f3. 43195 (f1, f2): New functions. 43196 * tests/strace-k.test: Update. 43197 43198 2014-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 43199 43200 unwind: ignore memory mappings that have no PROT_EXEC bit set. 43201 * unwind.c (build_mmap_cache): For each memory mapping being scanned, 43202 save its PROT_EXEC bit and skip the mapping if it is not set. 43203 43204 unwind: cleanup build_mmap_cache. 43205 * unwind.c (build_mmap_cache): Move local variables to the code branch 43206 where they are used. Check return code of sscanf and strdup. Do not 43207 treat unusual memory mappings as fatal errors. Do not skip memory 43208 mappings with path names starting with "[". 43209 43210 unwind: remove unused field from mmap_cache_t. 43211 * unwind.c (mmap_cache_t): Remove "deleted" field. 43212 (build_mmap_cache): Remove initialization of "deleted" field. 43213 43214 2014-06-12 Dmitry V. Levin <ldv (a] altlinux.org> 43215 43216 unwind: refactor stacktrace_walk. 43217 * unwind.c (stacktrace_walk): Move stack frame printing code 43218 to separate function print_stack_frame. 43219 43220 unwind: constify binary_filename and symbol_name functions arguments. 43221 * unwind.c (call_action_fn, print_call_cb, sprint_call_or_error, 43222 queue_put, queue_put_call): Add const qualifier to binary_filename and 43223 symbol_name arguments. 43224 43225 2014-06-11 Luca Clementi <luca.clementi (a] gmail.com> 43226 43227 unwind: disable stack trace with multiple personalities. 43228 * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, 43229 unwind_capture_stacktrace): Disable stack tracing of non-default 43230 personality processes. 43231 43232 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 43233 43234 unwind: rename function_off_set to function_offset. 43235 * unwind.c (call_action_fn, stacktrace_walk, STACK_ENTRY_SYMBOL_FMT, 43236 print_call_cb, sprint_call_or_error, queue_put, queue_put_call): 43237 Rename function_off_set to function_offset. 43238 43239 unwind: fix a bug in range updating of binary search. 43240 * unwind.c (print_stacktrace): Fix another off-by-one error in binary search. 43241 43242 unwind: use fopen64 instead of fopen. 43243 * unwind.c (fopen_for_input): Define to fopen64 iff 43244 [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen. 43245 (build_mmap_cache): Use fopen_for_input instead of fopen. 43246 43247 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 43248 43249 unwind: fix build on 32-bit architectures. 43250 Fix compilation warnings in unwind.c on 32-bit architectures. 43251 On some architectures getuid is actually getuid32, so change the test 43252 to use getpid instead of getuid. 43253 43254 * unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set 43255 to unsigned long. 43256 (queue_put_error): Change the 3rd argument's type to unsigned long. 43257 * tests/stack-fcall.c (f1): Use getpid instead of getuid. 43258 * tests/strace-k.test: Likewise. 43259 43260 2014-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 43261 43262 tests: robustify -w option test. 43263 * tests/count.test: Allow nanosleep to spend a bit less time than 1 second. 43264 43265 2014-06-04 Dmitry V. Levin <ldv (a] altlinux.org> 43266 43267 Fix delete_module decoding. 43268 * xlat/delete_module_flags.in: New file. 43269 * file.c (sys_delete_module): Move ... 43270 * bjm.c (sys_delete_module): ... to here. 43271 Decode 1st argument using printstr instead of printpath. 43272 * NEWS: Mention it. 43273 43274 2014-06-04 Zubin Mithra <zubin.mithra (a] gmail.com> 43275 43276 Decode paths associated with file descriptors returned by syscalls. 43277 * defs.h (RVAL_FD): New macro. 43278 (RVAL_MASK, RVAL_STR, RVAL_NONE): Update. 43279 * desc.c (sys_dup, sys_delete_module): New functions. 43280 (do_dup2, decode_open, sys_creat): Change return value to RVAL_FD. 43281 * linux/dummy.h (sys_delete_module, sys_dup): Remove. 43282 * linux/syscall.h (sys_delete_module, sys_dup): New prototypes. 43283 * syscall.c (trace_syscall_exiting): Handle RVAL_FD. 43284 43285 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 43286 43287 NEWS: Prepare for 4.9 release. 43288 43289 Warn about flags that have no effect with -c. 43290 * strace.c (init): Issue a warning if -i, -k, -r, -t, -T, or -y is used 43291 along with -c. 43292 This fixes Debian bug #443895. 43293 43294 debian: enable security hardening features. 43295 * debian/rules: Follow the advice in https://wiki.debian.org/Hardening 43296 and enable maximum hardening as for programs that handle untrusted data. 43297 Patch by Markus <waldeck (a] gmx.de>. 43298 43299 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 43300 43301 debian: update control file. 43302 * debian/control (strace64): Fix a typo in package description. 43303 Patch by Pascal De Vuyst <pascal.devuyst (a] gmail.com>. 43304 (strace, strace-udeb): Add x32 to architecture list. 43305 Patch by Guillaume Morin <guillaume (a] morinfr.org>. 43306 (strace, strace-udeb): Add or1k to architecture list. 43307 Patch by Christian Svensson <debian (a] cmd.nu>. 43308 (strace, strace-udeb): Add arm64 to architecture list, 43309 and remove defunct arm. 43310 Patch by Wookey <wookey (a] debian.org>. 43311 43312 This fixes Debian bugs: #697625, #727018, #742235, #749956. 43313 43314 2014-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 43315 43316 manpage: minor corrections. 43317 $ groff -ww -mandoc -z strace.1 43318 strace.1:65: warning: macro `IX' not defined 43319 43320 * strace.1: define IX macro as empty for groff. 43321 Change remaining '-' as minus to '\-'. 43322 Have two word spaces after a full stop as an end of sentence. 43323 Use extra space ('\,' or '\/') between roman and italic characters. 43324 Based on patch by Bjarni Ingi Gislason <bjarniig (a] rhi.hi.is>. 43325 This fixes Debian bug #725987. 43326 43327 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43328 43329 unwind: tests: add a test for -k option. 43330 * tests/stack-fcall.c: New test target. 43331 * tests/strace-k.test: New test driver. 43332 * tests/Makefile.am (check_PROGRAMS): Add stack-fcall. 43333 (TESTS): Add strace-k.test. 43334 * tests/.gitignore: Add stack-fcall. 43335 43336 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43337 43338 unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering 43339 Instead of handling stacktrace capturing and mmap cache invalidating in 43340 sys_* functions, handle them uniformly in trace_syscall_entering using 43341 new flags introduced by previous two commits. 43342 43343 The patch is simpler than its older version(v3). The value of 43344 hide_log_until_execve is just ignored. I found the value is nothing 43345 to do with this patch. unwind_cache_invalidate is mentioned only 43346 once in trace_syscall_exiting. 43347 Both are suggested by Dmitry Levin. 43348 43349 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 43350 43351 unwind: add SE and SI flags to syscall entries for all architectures. 43352 Add SE flag to execve, exit, and exit_group syscall entries. 43353 Add SI flag to brk, execve, mmap, mprotect, mremap, munmap, 43354 remap_file_pages, shmat, and shmdt syscall entries. 43355 43356 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43357 43358 unwind: introduce markers specifying the needs of special care in unwinding 43359 Some system calls require capturing the stack trace before they are 43360 processed in kernel. Typical one is execve. Some system calls require 43361 invalidating mmap cache after they are processed in kernel. 43362 43363 In current implementation these requirements are handled directly by 43364 appropriate syscall handlers. However, it is difficult to keep the 43365 source code maintainable using this approach to cover all system calls 43366 which have such requirements. 43367 43368 A more generic way to implement this is to flag all syscalls that 43369 require special processing, and handle these flags right in 43370 trace_syscall_entering instead of changing syscall handlers. 43371 43372 This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and 43373 STACKTRACE_CAPTURE_ON_ENTER. 43374 43375 The names of macros are suggested by Dmitry Levin. 43376 43377 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43378 43379 unwind: enable dwarf cache of libunwind. 43380 Here is the benchmark of the dwarf cache. 43381 43382 Target program: 43383 43384 #include <sched.h> 43385 int main(void) 43386 { 43387 unsigned int max = 0x6fff, i; 43388 for (i = 0; i < max; i++) 43389 sched_yield(); 43390 return 0; 43391 } 43392 43393 Command line: 43394 43395 ./strace -o /dev/null -k a.out 43396 43397 With the dwarf cache: 43398 43399 real 0m12.081s 43400 user 0m3.858s 43401 sys 0m8.194s 43402 43403 Without the dwarf cache: 43404 43405 real 0m22.326s 43406 user 0m5.218s 43407 sys 0m16.952s 43408 43409 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43410 43411 unwind: report expected backtracing error. 43412 When a file mmap'ed to the target process is unlink'ed, backtracing the 43413 stack would fail. Current implementation reports it as 43414 "backtracing_error". To avoid confusion, the message is changed to 43415 "expected_backtracing_error". 43416 43417 Here is the reproducer: 43418 43419 $ cat ./p-deleted.c 43420 #include <unistd.h> 43421 43422 int main(int argc, char **argv) { 43423 return unlink(argv[0]) < 0; 43424 } 43425 43426 $ strace -e unlink -k ./p-deleted 43427 unlink("./p-deleted") = 0 43428 > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17] 43429 > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575] 43430 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 43431 > backtracing_error [0x7ffff1365590] 43432 +++ exited with 0 +++ 43433 43434 p-deleted is deleted therefore backtracing_error is reported. This 43435 patch records the deleted marker when making mmap cache and refers the 43436 recorded information in the case "backtracing_error" to switch the 43437 message. 43438 43439 Here is the output of this patch: 43440 43441 $ strace -e unlink -k ./p-deleted 43442 unlink("./p-deleted") = 0 43443 > /usr/lib64/libc-2.18.so(unlink+0x7) [0xe7f17] 43444 > /home/yamato/var/strace/t_unwind/p-deleted (deleted)(+0x0) [0x575] 43445 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 43446 > expected_backtracing_error [0x7ffff1365590] 43447 +++ exited with 0 +++ 43448 43449 This solution is not perfect: if a file is unlink'ed after making the 43450 mmap cache and before unwinding, strace cannot have a chance to record 43451 the deleted marker. 43452 43453 In this version of patch, hardcoded magic number used in comparing "(delete)" 43454 string is replaced with strlen as suggested by Dmitry Levin. 43455 43456 In old version of patch, the deleted entry was thrown away from mmap 43457 cache to avoid to report "backtracing_error". In this patch I keep it, 43458 and just switch the error message. 43459 Inspired by the review comment from Dmitry Levin. 43460 43461 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43462 43463 unwind: call unwind_tcb_fin before printing detached message. 43464 captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not 43465 empty. This should happen before printing detached message, so 43466 unwind_tcb_fin is moved to the top of droptcb. 43467 43468 This is implicitly suggested by Dmitry Levin in patch review process. 43469 43470 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43471 43472 unwind: implement automatic mmap cache invalidation. 43473 A mmap cache belonging to a tcb was updated when a system call which 43474 changed the memory mapping was called. This implementation was assumed 43475 the mapping was changed only by the tcb. However, this assumption is 43476 incorrect if the target application is multi-threaded; more than two 43477 tcbs can shared the same memory mapping and a tcb can modify it without 43478 being noticed by the others. 43479 43480 This change introduces a global integer variable mmap_cache_generation, 43481 and mmap_cache_generation field to struct tcb. The variable 43482 is incremented each time a process enters a syscall that can modify its 43483 memory mapping. Each tcb records the value of this variable at the 43484 moment if building its mmap cache. Every mmap cache associated with 43485 the given tcb can be validated by comparing its mmap_cache_generation 43486 field with the variable mmap_cache_generation. 43487 43488 This implementation is inefficient. If strace attaches two processes 43489 which don't share the memory mapping, rebuilding mmap cache of a tcb 43490 triggered by another tcb's mmap system call is not necessary. 43491 43492 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43493 43494 unwind: introduce queue_t for capturing stacktrace. 43495 This is the second step for splitting capturing from printing. 43496 43497 New `queue' field is added to tcb. Captured stacktrace is stored here. 43498 The field is initialized/finalized at unwind_tcb_init/unwind_tcb_fin. 43499 43500 New API function unwind_capture_stacktrace is added. This function 43501 captures the currest stack using stracktrace_walker and records it in 43502 tcb. It's printing is delayed to the next call of 43503 unwind_print_stacktrace. 43504 43505 unwind_print_stacktrace is extended. Now it checks queue field of 43506 the given tcb at the start of function. If the function finds a 43507 captured stack trace, the latter is printed using stracktrace_walker. 43508 43509 Currently unwind_capture_stacktrace invocations are added directly to 43510 handlers of mmap, munmap, mprotect, and execve. 43511 43512 Here is the difference of output with/without patch: 43513 43514 (without patch) 43515 execve("./test-fork", ["./test-fork"], [/* 56 vars */]) = 0 43516 > /usr/lib64/ld-2.18.so(check_one_fd.part.0+0x82) [0x11f0] 43517 43518 (with patch) 43519 execve("./test-fork", ["./test-fork"], [/* 54 vars */]) = 0 43520 > /usr/lib64/libc-2.18.so(execve+0x7) [0xbcd27] 43521 > /home/yamato/var/strace/strace(exec_or_die+0x10c) [0x26ac] 43522 > /home/yamato/var/strace/strace(startup_child+0x346) [0x134f6] 43523 > /home/yamato/var/strace/strace(init+0x89f) [0x13dff] 43524 > /home/yamato/var/strace/strace(main+0xa) [0x26ca] 43525 > /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65] 43526 > /home/yamato/var/strace/strace(_start+0x29) [0x2799] 43527 43528 In older version output lines of captured elements were built when 43529 printing. In this version they are built when capturing the stack. 43530 As result, unneeded dynamic memory allocations are avoided. 43531 Suggested by Luca Clementi. 43532 43533 In older version the combination of snprintf and realloc were used. 43534 In this version they are replaced with asprintf. 43535 Suggested by Dmitry Levin. 43536 43537 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43538 43539 unwind: introduce own debug macro. 43540 * unwind.c (DPRINTF): New macro, to be utilized in debugging cache 43541 management code. 43542 43543 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43544 43545 unwind: introduce stacktrace_walker. 43546 In current implementation, the stack trace is captured and printed at 43547 the same time, in trace_syscall_exiting. This approach cannot 43548 provide user expected information when a system call changes the 43549 memory mapping. In such cases, the stack trace should be captured on 43550 entering syscall and printed on exiting. 43551 43552 As the initial step for splitting capturing from printing, this change 43553 introduces stacktrace_walker utility function. It can be used both for 43554 capturing in trace_syscall_entering and printing in 43555 trace_syscall_exiting. 43556 43557 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43558 43559 unwind: give all exported functions "unwind_" prefix. 43560 * unwind.c (init_unwind_addr_space): Rename to unwind_init. 43561 (init_libunwind_ui): Rename to unwind_tcb_init. 43562 (free_libunwind_ui): Rename to unwind_tcb_fin. 43563 (delete_mmap_cache): Rename to unwind_cache_invalidate. 43564 (print_stacktrace): Rename to unwind_print_stacktrace. 43565 * defs.h: Update prototypes. 43566 * mem.c: All callers updated. 43567 * process.c: Likewise. 43568 * strace.c: Likewise. 43569 * syscall.c: Likewise. 43570 43571 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43572 43573 unwind: delete mmap cache in free_libunwind_ui. 43574 free_libunwind_ui is expected to release all unwind related resources 43575 attached to tcp. 43576 43577 * strace.c (droptcb): Move delete_mmap_cache call ... 43578 * unwind.c (free_libunwind_ui): ... to here. 43579 43580 2014-05-30 Masatake YAMATO <yamato (a] redhat.com> 43581 43582 unwind: make alloc_mmap_cache function local. 43583 * defs.h (alloc_mmap_cache): Remove. 43584 * unwind.c (alloc_mmap_cache): Add static qualifier. 43585 43586 unwind: fix a bug in range updating of binary search. 43587 * unwind.c (print_stacktrace): Fix off-by-one error in binary search. 43588 43589 2014-05-30 Luca Clementi <luca.clementi (a] gmail.com> 43590 43591 Add -k option to print stack trace after each syscall. 43592 Print the stack trace of the traced process after each system call when 43593 -k option is specified. It is implemented using libunwind to unwind the 43594 stack and to obtain the function name pointed by the IP. 43595 43596 Based on the code that was originally taken from strace-plus 43597 of Philip J. Guo. 43598 43599 * configure.ac: Add --with-libunwind option. Check libunwind support. 43600 * Makefile.am: Add libunwind support. 43601 * defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields. 43602 [USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache, 43603 delete_mmap_cache, print_stacktrace): New prototypes. 43604 * mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support. 43605 * process.c (sys_execve): Likewise. 43606 * strace.c (usage, alloctcb, droptcb, init): Likewise. 43607 * syscall.c (trace_syscall_exiting): Likewise. 43608 * unwind.c: New file. 43609 * strace.1: Document -k option. 43610 43611 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 43612 43613 sysctl: update CTL_*, KERN_*, NET_*, and VM_* constants. 43614 * configure.ac (AC_CHECK_DECLS): Add CTL_*, KERN_*, NET_*, and 43615 VM_* constants. 43616 * system.c (CTL_PROC, CTL_CPU): Remove definitions. 43617 * xlat/sysctl_*.in: Update. 43618 43619 Check for constants used by waitid function. 43620 * configure.ac (AC_CHECK_DECLS): Add P_* constants. 43621 43622 Check for LO_FLAGS_READ_ONLY constant. 43623 * configure.ac (AC_CHECK_DECLS): Add LO_FLAGS_READ_ONLY. 43624 43625 Compress blank lines. 43626 Suppress empty lines left after automated xlat conversion. 43627 43628 xlat: cleanup the aftermath of automatic conversion. 43629 43630 Generate xlat/*.in files. 43631 Automatically convert xlat structures from *.c files to xlat/*.in files 43632 using "./generate_xlat_in.sh *.c" command. 43633 43634 Rename several xlat structures to avoid collisions. 43635 * bjm.c (which): Rename to qm_which. 43636 * ipc.c (msg_flags): Rename to ipc_msg_flags. 43637 * time.c (which): Rename to itimer_which. 43638 43639 Enhance xlat generator. 43640 * xlat/gen.sh: Define all xlat structs not declared in defs.h as static. 43641 Some symbolic constants are not macros, extend #ifdef check to cover 43642 symbolic constants checked by AC_CHECK_DECLS. 43643 Handle complex symbolic constants in SYMBOL|... form. 43644 Handle symbolic constants in 1<<SYMBOL form. 43645 Handle numeric constants. 43646 Implement #unconditional directive that turns off preprocessor checks. 43647 Implement #unterminated directive that turns off adding XLAT_END. 43648 43649 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 43650 43651 Use bootstrap script consistently. 43652 Now that ./xlat/gen.sh has to be run before autoreconf, 43653 replace all autoreconf calls with ./bootstrap call. 43654 43655 * bootstrap: Forward arguments to autoreconf. 43656 * build_static_example.sh: Replace autoreconf call with bootstrap call. 43657 * make-dist: Likewise. 43658 * qemu_multiarch_testing/README: Likewise. 43659 43660 2014-05-30 Mike Frysinger <vapier (a] gentoo.org> 43661 43662 Implement xlat generator. 43663 * bootstrap: New file. 43664 * xlat/gen.sh: Likewise. 43665 * Makefile.am: Include xlat/Makemodule.am 43666 (EXTRA_DIST): Add $(XLAT_INPUT_FILES), $(XLAT_HEADER_FILES), and 43667 xlat/gen.sh. 43668 43669 2014-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 43670 43671 tests: fix SCM_RIGHTS test for big-endian systems. 43672 * tests/scm_rights.c (main): Send zero integer to avoid issues with 43673 endianness. 43674 * tests/scm_rights-fd.test: Update grep patterns. 43675 43676 Decode file descriptors passed via SCM_RIGHTS control messages. 43677 * net.c (printcmsghdr): Print descriptors from SCM_RIGHTS control 43678 messages using printfd. 43679 * tests/scm_rights.c: New file. 43680 * tests/scm_rights-fd.test: New test. 43681 * tests/Makefile.am (check_PROGRAMS): Add scm_rights. 43682 (TESTS): Add scm_rights-fd.test. 43683 * tests/.gitignore: Add scm_rights and uio. 43684 43685 tests: add a test for -c and -w options. 43686 * tests/count.test: New test. 43687 * tests/Makefile.am (TESTS): Add it. 43688 43689 2014-05-29 Mark Hills <Mark.Hills (a] framestore.com> 43690 43691 Optionally produce stats on syscall latency. 43692 Time spent in system time is not useful where a syscall depends on some 43693 non-CPU resource, eg. typically open() or stat() to a network drive. 43694 43695 This patch adds a new flag (-w) to produce a summary of the time 43696 difference between beginning and end of the system call (ie. latency) 43697 43698 This functionality has been useful to profile slow processes that 43699 are not CPU-bound. 43700 43701 2014-05-29 Dmitry V. Levin <ldv (a] altlinux.org> 43702 43703 Constify count_syscall function. 43704 * count.c (count_syscall): Add const qualifier to timeval argument and 43705 rename it. Store the wall clock time spent while in syscall in separate 43706 timeval variable. 43707 * defs.h (count_syscall): Update prototype. 43708 * syscall.c (trace_syscall_exiting): Update count_syscall invocation. 43709 43710 Constify tv_* functions. 43711 * defs.h (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): Add 43712 const qualifier to read only arguments. 43713 * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): 43714 Likewise. 43715 43716 2014-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 43717 43718 Use printstr for sethostname, setdomainname, and gethostname decoding. 43719 The argument passed to sethostname and setdomainname syscalls, as well 43720 as the string returned by gethostname syscall, is not a pathname, so 43721 printpathn is not the right method for its decoding. 43722 43723 * process.c (sys_sethostname, sys_setdomainname): Decode 1st argument 43724 using printstr instead of printpathn. 43725 [ALPHA] (sys_gethostname): Likewise. 43726 43727 2014-05-21 James Hogan <james.hogan (a] imgtec.com> 43728 43729 Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_T. 43730 When strace is built with large file support definitions in CFLAGS (as 43731 may be provided by buildroot) the C library headers may expose a 64-bit 43732 rlim_t even though the struct rlimit fields used by the system call 43733 interface are only 32-bit. The SIZEOF_RLIM_T will then be 8 which 43734 results in bad decoding of the getrlimit and setrlimit syscalls. 43735 43736 This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with 43737 checks for current_wordsize. 43738 43739 2014-05-13 Masatake YAMATO <yamato (a] redhat.com> 43740 43741 Enhance setns syscall decoding. 43742 * process.c (sys_setns): New function. 43743 Decode the 2nd syscall argument using clone_flags. 43744 * linux/syscall.h (sys_setns): New prototype. 43745 * linux/dummy.h (sys_setns): Remove. 43746 43747 2014-05-12 Dmitry V. Levin <ldv (a] altlinux.org> 43748 43749 mips: fix syscall entries that should have TP flag set. 43750 43751 xtensa: fix unshare syscall entry. 43752 43753 alpha, hppa, mips n64: fix waitid syscall entry. 43754 43755 Add TM flag to shmat and shmdt syscall entries. 43756 43757 Alias sys_vfork to sys_fork. 43758 * process.c (sys_vfork): Remove. 43759 * linux/syscall.h (sys_vfork): Likewise. 43760 * linux/dummy.h (sys_vfork): Alias to sys_fork. 43761 * linux/alpha/syscallent.h: Fix vfork entry. 43762 * util.c (setbpt): Do not check for sys_vfork. 43763 * syscall.c (syscall_fixup_for_fork_exec): Likewise. 43764 43765 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 43766 43767 epoll_ctl: fix EPOLL_CTL_DEL argument decoding. 43768 * desc.c (sys_epoll_ctl): Do not parse the event structure for 43769 EPOLL_CTL_DEL operation. 43770 43771 Reported-by: <socketpair (a] gmail.com> 43772 43773 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 43774 43775 Update CLOCK_* constants. 43776 * time.c (clocknames): Add CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM, 43777 CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE, and CLOCK_TAI. 43778 Fixes RH#1088455. 43779 43780 2014-04-17 Dmitry V. Levin <ldv (a] altlinux.org> 43781 43782 Fix preadv/pwritev offset decoding. 43783 * util.c (printllval): Add align argument. 43784 * defs.h (printllval): Update prototype. 43785 (printllval_aligned, printllval_unaligned): New macros. 43786 * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, 43787 sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, 43788 sys_fallocate): Replace printllval call with printllval_aligned. 43789 * io.c (sys_pread, sys_pwrite): Likewise. 43790 (sys_preadv, sys_pwritev): Replace printllval call with 43791 printllval_unaligned. 43792 * linux/arm/syscallent.h: Set the number of preadv and pwritev 43793 arguments to 5. 43794 * linux/mips/syscallent-o32.h: Likewise. 43795 * linux/powerpc/syscallent.h: Likewise. 43796 * linux/sh/syscallent.h: Likewise. 43797 * linux/xtensa/syscallent.h: Likewise. 43798 43799 Reported-by: Dima Kogan <dima (a] secretsauce.net> 43800 43801 2014-04-16 Dmitry V. Levin <ldv (a] altlinux.org> 43802 43803 tests: add a test for pread/pwrite and preadv/pwritev offset decoding. 43804 * tests/uio.c: New file. 43805 * tests/uio.test: New test. 43806 * tests/Makefile.am (check_PROGRAMS): Add uio. 43807 (uio_CFLAGS): Define. 43808 (TESTS): Add uio.test. 43809 43810 2014-04-10 Dmitry V. Levin <ldv (a] altlinux.org> 43811 43812 Refactor LDT decoding. 43813 * configure.ac (AC_CHECK_TYPES): Remove struct user_desc. 43814 * ldt.c: New file. 43815 * Makefile.am (strace_SOURCES): Add ldt.c. 43816 * mem.c: Do not include <asm/ldt.h>. 43817 (print_ldt_entry): Remove. 43818 (sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): Move... 43819 * ldt.c: ... here. 43820 * process.c: Do not include <asm/ldt.h>. 43821 (sys_clone) [I386 || X86_64 || X32]: Use print_user_desc. 43822 43823 2014-04-10 Denys Vlasenko <dvlasenk (a] redhat.com> 43824 43825 Make int3 example in comments more cut-n-pastable. 43826 I found that I use it quite often. Lets make it so that 43827 after cut-n-pasting it into a file, there is no need 43828 to edit the result (e.g. no need to remove C comment 43829 chars from every line. 43830 43831 2014-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 43832 43833 mips: enable decoding of set_thread_area. 43834 * linux/dummy.h [MIPS]: Do not redirect sys_set_thread_area to printargs. 43835 * mem.c [MIPS] (sys_set_thread_area): Define. 43836 43837 x86_64, x32: enable decoding of modify_ldt, get_thread_area, and set_thread_area 43838 * linux/dummy.h [X86_64 || X32]: Do not redirect sys_modify_ldt, 43839 sys_get_thread_area, and sys_set_thread_area to printargs. 43840 43841 x32: decode clone LDT user_desc entries for x86 processes. 43842 * mem.c [X32]: Include asm/ldt.h. 43843 [X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area, 43844 sys_get_thread_area): Define. 43845 * process.c [X32]: Include asm/ldt.h. 43846 (sys_clone) [X32]: Decode LDT entry if current_personality == 1. 43847 43848 2014-04-09 Elliott Hughes <enh (a] google.com> 43849 43850 x86-64: decode clone LDT user_desc entries for x86 processes. 43851 * mem.c [X86_64]: Include asm/ldt.h. 43852 [X86_64] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area, 43853 sys_get_thread_area): Define. 43854 * process.c [X86_64]: Include asm/ldt.h. 43855 (sys_clone) [X86_64]: Decode LDT entry if current_personality == 1. 43856 43857 2014-04-09 Dmitry V. Levin <ldv (a] altlinux.org> 43858 43859 x32: fix clone(2) argument order for x86 processes. 43860 Apply the same fix that was made for x86_64. 43861 43862 * process.c [X32] (ARG_CTID, ARG_TLS): Take current 43863 personality into account. 43864 43865 2014-04-09 Elliott Hughes <enh (a] google.com> 43866 43867 x86-64: fix clone(2) argument order for x86 processes. 43868 Without this patch, strace claims that parent_tidptr == tls, which is 43869 clearly wrong. It is expected that parent_tidptr == child_tidptr. 43870 43871 * process.c [X86_64] (ARG_CTID, ARG_TLS): Take current 43872 personality into account. 43873 43874 2014-04-06 Elliott Hughes <enh (a] google.com> 43875 43876 aarch64: Fix decoding of arm struct stat64. 43877 We need to handle this situation more like x86-64. 32-bit arm and i386 43878 actually have a common struct stat64, except the arm one must not be 43879 packed. Additionally, on aarch64 the 32-bit personality is personality 0. 43880 43881 2014-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 43882 43883 ARM EABI: disable OABI support by default. 43884 OABI is rarely used in ARM EABI systems nowadays, so disable its support 43885 by default. Add --enable-arm-oabi option to enable ARM OABI support. 43886 43887 * configure.ac: New option --enable-arm-oabi. 43888 * syscall.c (get_scno) [ARM]: Check ENABLE_ARM_OABI macro defined by 43889 configure instead of undocumented STRACE_KNOWS_ONLY_EABI macro. 43890 43891 2014-03-12 Elliott Hughes <enh (a] google.com> 43892 43893 Fix stat decoding for LP64 bionic. 43894 Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with 43895 HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64. 43896 The workaround needed to be applied to all LP64 architectures, not 43897 just aarch64. This patch fixes that and adds an explanatory comment. 43898 43899 2014-03-11 Masatake YAMATO <yamato (a] redhat.com> 43900 43901 Decode protocol argument for PF_NETLINK sockets. 43902 * net.c (protocols): Rename to inet_protocols. 43903 [PF_NETLINK] (netlink_protocols): New xlat structure. 43904 (sys_socket): Rename protocols to inet_protocols. 43905 [PF_NETLINK]: Decode protocol argument using netlink_protocols. 43906 43907 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 43908 43909 2014-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 43910 43911 Cleanup socketpair decoding. 43912 The only supported domain for socketpair syscall is AF_UNIX, so 43913 no decoding related to other domains is required for socketpair. 43914 43915 * net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains, 43916 print the protocol argument as is. 43917 43918 2014-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 43919 43920 printsiginfo: add SIGSYS decoding. 43921 * configure.ac (AC_CHECK_MEMBERS): Check for siginfo_t.si_syscall. 43922 * signal.c (SYS_SECCOMP): Define if not yet defined. 43923 (sigsys_codes): new xlat structure. 43924 (printsiginfo): Decode SIGSYS. 43925 43926 Update siginfo codes. 43927 * signal.c (siginfo_codes): Add SI_DETHREAD. 43928 43929 Factor out printing of si_pid and si_uid members of siginfo_t. 43930 * signal.c (printsigsource): New function. 43931 (printsiginfo): Use it. 43932 43933 2014-03-10 Elliott Hughes <enh (a] google.com> 43934 43935 Improve SI_TIMER decoding. 43936 Decode siginfo_t more clearly for si_code SI_TIMER. 43937 The 'pid' is actually a POSIX timer id, and the 'uid' is actually the 43938 overrun. 43939 Also factor out the si_value dumping so it's the same for every si_code. 43940 43941 2014-03-03 Elliott Hughes <enh (a] google.com> 43942 43943 aarch64: fix decoding of arm syscall numbers. 43944 If an aarch64 strace is tracing a process using the arm personality, it 43945 also needs to call the shuffle_scno function for the ARM-specific 43946 syscalls. 43947 43948 * syscall.c (shuffle_scno): Define on AARCH64. 43949 (get_scno) [AARCH64]: Call shuffle_scno when the tracee is in 32-bit mode. 43950 43951 2014-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 43952 43953 Fix fcntl decoding. 43954 Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined or 43955 not defined altogether. 43956 Do not assume that sizeof(off_t) < sizeof(long long) when F_SETLK64 is 43957 undefined. 43958 43959 This change fixes build with musl libc on x86. 43960 43961 * configure.ac: Define SIZEOF_OFF_T. 43962 * desc.c (USE_PRINTFLOCK64): New macro. 43963 (struct flock64, printflock64): Do not define on X32. 43964 (printflock): Replace X32 specific workaround with SIZEOF_OFF_T check. 43965 Fix printing off_t members of struct flock. 43966 (sys_fcntl): Use USE_PRINTFLOCK64. 43967 43968 2014-03-01 Dmitry V. Levin <ldv (a] altlinux.org> 43969 43970 sys_fcntl: remove F_FREESP and F_FREESP64 support. 43971 F_FREESP and F_FREESP64 fcntl commands are not available in Linux 43972 and therefore the code implementing their decoding is useless. 43973 Besides that, F_FREESP64 decoding is too complicated to support. 43974 43975 * desc.c (fcntlcmds): Remove F_FREESP and F_FREESP64. 43976 Remove F_FREESP64 from the check whether to define struct flock64. 43977 (sys_fcntl): Remove F_FREESP and F_FREESP64 support. 43978 43979 2014-02-28 Elliott Hughes <enh (a] google.com> 43980 43981 Add multi-personality support to struct old_sigaction decoding. 43982 struct sigaction is another structure that contains members 43983 whose size differs between 32-bit and 64-bit personalities. 43984 43985 * signal.c [HAVE_SIGACTION] (old_sigaction32): New structure. 43986 [HAVE_SIGACTION] (decode_old_sigaction): Decode 32-bit struct 43987 old_sigaction on a 64-bit host. 43988 43989 2014-02-28 Elliott Hughes <enh (a] google.com> 43990 43991 Fix decoding of arm struct stat64 by aarch64 strace. 43992 aarch64's uapi header files have a struct stat but no struct stat64. 43993 To correctly decode a 32-bit process' s struct stat64 we need 43994 HAVE_STAT64, but then the build fails because there is no struct stat64. 43995 Luckily, the aarch64 struct stat is structurally equivalent to the arm 43996 struct stat64, so we can just reuse that. 43997 43998 * file.c [AARCH64] (stat64): Define to stat. 43999 44000 2014-02-28 Dmitry V. Levin <ldv (a] altlinux.org> 44001 44002 Remove obsolete ioctlsort.c. 44003 The generic version of ioctlsort.c became obsolete after commit 44004 v4.6-240-g5afdf12 that removed its last non-Linux users. 44005 44006 * ioctlsort.c: Remove. 44007 * Makefile.am (EXTRA_DIST): Remove ioctlsort.c. 44008 44009 Reported-by: Elliott Hughes <enh (a] google.com> 44010 44011 2014-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 44012 44013 Add multi-personality support to stack_t decoding. 44014 stack_t is one of many structures that contain members 44015 whose size differs between 32-bit and 64-bit personalities. 44016 44017 * signal.c (print_stack_t): Decode 32-bit stack_t on a 64-bit host. 44018 44019 Reported-by: Elliott Hughes <enh (a] google.com> 44020 44021 2014-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 44022 44023 Rewrite signal mask decoding without sigset_t. 44024 The sigset_t provided by libc is not quite convenient. 44025 In glibc, sigset_t is an array with space for 1024 bits, which is much 44026 more than required: all architectures supported by Linux have only 64 44027 signals except MIPS, which has 128. 44028 In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than 44029 necessary. 44030 44031 With this change, signal mask is decoded without use of intermediate 44032 sigset_t structure, which saves us some cpu cycles in case of glibc with 44033 its inflated sigset_t, and enables build with libcs where sigset_t is 44034 broken. 44035 44036 Old implementation used to check each signal number in the given signal 44037 mask twice using sigismember(). 44038 New implementation is based on popcount and next_set_bit() so it's 44039 noticeably faster. 44040 44041 * configure.ac: Check for __builtin_popcount. 44042 * signal.c: Ensure that NSIG >= 32. 44043 (sprintsigmask, sprintsigmask_long, printsigmask): Remove. 44044 (popcount32, sprintsigmask_n): New functions. 44045 (tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros. 44046 (print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask, 44047 sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use 44048 new signal mask decoding interface. 44049 * tests/sigaction.c (main): Add a test with almost filled signal mask. 44050 * tests/sigaction.awk: Update. 44051 44052 2014-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 44053 44054 Fix build with Bionic libc. 44055 Add generic tests for fopen64 and fputs_unlocked functions to fix build 44056 with Bionic libc that does not provide them. 44057 44058 * configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked. 44059 * strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64 44060 if !HAVE_FOPEN64. 44061 Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED. 44062 * vsprintf.c: Use fputs instead of fputs_unlocked 44063 if !HAVE_FPUTS_UNLOCKED. 44064 44065 Reported-by: Elliott Hughes <enh (a] google.com> 44066 44067 2014-02-25 James Yang <james.yang (a] freescale.com> 44068 44069 powerpc64: fix 64-bit process detection on embedded. 44070 * syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection 44071 on embedded powerpc. 44072 44073 2014-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 44074 44075 Do not compile scsi ioctl decoding if <scsi/sg.h> is not available. 44076 Add a generic test for <scsi/sg.h> availability to fix build with 44077 Bionic libc that does not provide <scsi/sg.h>. 44078 44079 * configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h. 44080 * ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H. 44081 * scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H. 44082 44083 Reported-by: Elliott Hughes <enh (a] google.com> 44084 44085 2014-02-14 Dmitry V. Levin <ldv (a] altlinux.org> 44086 44087 Revert "Add support for Altera's Nios-II softcore architecture" 44088 The patch originally submitted by Ezequiel Garca was OK, but I somehow 44089 managed to mangle it so that most of the patch was not applied. 44090 44091 According to Ezequiel Garca, an architecture port based on the generic 44092 syscall ABI is in progress. 44093 44094 This reverts commit 61e426e87ac81be4b4ff9de581635b4ea585624f. 44095 44096 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 44097 44098 tests: tighten sigaction check. 44099 * tests/sigaction.awk: Check that input conatins all expected lines. 44100 44101 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 44102 44103 Fix sigaction reporting on non-x86 architectures. 44104 If SA_RESTORER is not defined by libc headers but defined by kernel 44105 headers, use the definition provided by kernel headers for proper 44106 sigaction decoding. 44107 44108 * signal.c [!SA_RESTORER]: Define to ASM_SA_RESTORER if the latter is 44109 defined, regardless of architecure. 44110 44111 2014-02-08 Dmitry V. Levin <ldv (a] altlinux.org> 44112 44113 Check for SA_RESTORER definition in <asm/signal.h> 44114 Kernel header <asm/signal.h> cannot be included from regular code 44115 because it conflicts with libc headers, but SA_RESTORER is needed in 44116 signal.c, so SA_RESTORER value is forwarded from <asm/signal.h> to 44117 config.h using a configure check. 44118 44119 * configure.ac (ASM_SA_RESTORER): Define if SA_RESTORER is defined 44120 in <asm/signal.h>. 44121 44122 2014-02-07 Dmitry V. Levin <ldv (a] altlinux.org> 44123 44124 arm: fix compilation warning. 44125 Fix "dereferencing type-punned pointer will break strict-aliasing rules" 44126 warning introduced by commit v4.8-54-g670b21b. 44127 44128 * signal.c (sys_sigreturn) [ARM]: Avoid dereferencing type-punned pointers. 44129 44130 2014-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 44131 44132 kexec: fix typo. 44133 * kexec.c (print_kexec_segments) [SUPPORTED_PERSONALITIES == 1]: Fix typo. 44134 44135 2014-02-06 Ezequiel Garcia <ezequiel (a] vanguardiasur.com.ar> 44136 44137 Add support for Altera's Nios-II softcore architecture. 44138 This commit adds strace support for Altera's Nios-II official 44139 kernel port as found in git://git.rocketboards.org/linux-socfpga.git 44140 44141 Notice that this an out-of-tree kernel architectural port, and uses the 44142 legacy (non-generic) system call ABI. In particular, the port doesn't 44143 support PTRACE_GETREGSET, so the implementation is based on PTRACE_GETREGS. 44144 44145 Given it's mandatory for new architectures to support the generic 44146 syscall ABI and PTRACE_GETREGSET, if the nios2 architecure is ever 44147 mainlined, the strace support will have to be re-factored accordingly. 44148 44149 * linux/nios2/ioctlent.h.in: New file. 44150 * linux/nios2/syscallent.h: Likewise. 44151 * Makefile.am (EXTRA_DIST): Add linux/nios2/ioctlent.h.in and 44152 linux/nios2/syscallent.h. 44153 * configure.ac: Add NIOS2 to the list of supported architectures. 44154 * defs.h [NIOS2]: Use register reading system. 44155 * process.c (struct_user_offsets): Add NIOS2 support. 44156 * syscall.c (get_regs, get_scno, get_syscall_args, 44157 get_syscall_result, get_error): Likewise. 44158 * util.c (change_syscall): Likewise. 44159 * mem.c (sys_getpagesize): Define on NIOS2. 44160 * system.c [NIOS2] (sys_cacheflush, sys_nios2cmpxchg): New functions. 44161 44162 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 44163 44164 2014-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 44165 44166 Implement add_key, keyctl, and request_key decoding. 44167 * keyctl.c: New file. 44168 * linux/keyctl.h: Likewise. 44169 * Makefile.am (strace_SOURCES): Add keyctl.c. 44170 (EXTRA_DIST): Add linux/keyctl.h. 44171 * linux/dummy.h (sys_add_key, sys_keyctl, sys_request_key): Remove. 44172 * linux/syscall.h (sys_add_key, sys_keyctl, sys_request_key): New 44173 prototypes. 44174 44175 Implement ioprio_get and ioprio_set decoding. 44176 * ioprio.c: New file. 44177 * Makefile.am (strace_SOURCES): Add ioprio.c. 44178 * linux/dummy.h (sys_ioprio_get, sys_ioprio_set): Remove. 44179 * linux/syscall.h (sys_ioprio_get, sys_ioprio_set): New prototypes. 44180 44181 Implement finit_module decoding. 44182 * bjm.c (module_init_flags): New xlat structure. 44183 (sys_finit_module): New function. 44184 * linux/dummy.h (sys_finit_module): Remove. 44185 * linux/syscall.h (sys_finit_module): New prototype. 44186 44187 Cleanup inotify syscalls decoding. 44188 * linux/inotify.h: New file. 44189 * file.c (inotify_modes, inotify_init_flags, sys_inotify_add_watch, 44190 sys_inotify_rm_watch, sys_inotify_init1): Move... 44191 * inotify.c: ... here. 44192 (inotify_modes): Rename to inotify_flags, convert to XLAT form. 44193 (inotify_init_flags): Convert to XLAT form. 44194 * Makefile.am (strace_SOURCES): Add inotify.c. 44195 (EXTRA_DIST): Add linux/inotify.h. 44196 44197 Enhance reboot decoding. 44198 * linux/reboot.h: New file. 44199 * system.c (bootflags1, bootflags2, bootflags3, sys_reboot): Move... 44200 * reboot.c: ... here. 44201 (bootflags2, bootflags3): Update constants. 44202 * Makefile.am (strace_SOURCES): Add reboot.c. 44203 (EXTRA_DIST): Add linux/reboot.h. 44204 44205 Implement kexec_load decoding. 44206 * kexec.c: New file. 44207 * linux/kexec.h: Likewise. 44208 * Makefile.am (strace_SOURCES): Add kexec.c. 44209 (EXTRA_DIST): Add linux/kexec.h. 44210 * linux/dummy.h (sys_kexec_load): Remove. 44211 * linux/syscall.h (sys_kexec_load): New prototype. 44212 44213 Use prepared editions of recently imported linux headers. 44214 * linux/fanotify.h: Replace with edition prepared with headers_install.sh. 44215 * linux/personality.h: Likewise. 44216 44217 Implement fanotify_init and fanotify_mark decoding. 44218 * fanotify.c: New file. 44219 * linux/fanotify.h: Likewise. 44220 * Makefile.am (strace_SOURCES): Add fanotify.c. 44221 (EXTRA_DIST): Add linux/fanotify.h. 44222 * defs.h (print_dirfd): New prototype. 44223 * file.c (print_dirfd): Export. 44224 * linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove. 44225 * linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New 44226 prototypes. 44227 * pathtrace.c (pathtrace_match): Handle sys_fanotify_init and 44228 sys_fanotify_mark. 44229 44230 Use XLAT_END macro. 44231 Automatically update all xlat structures using the following sed regexp: 44232 s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/ 44233 44234 Itroduce XLAT_END macro to make xlat structures more compact. 44235 * defs.h (XLAT_END): New macro. 44236 44237 Convert personality_options to XLAT form. 44238 * linux/personality.h: New file. 44239 * Makefile.am (EXTRA_DIST): Add it. 44240 * system.c: Include <linux/personality.h>. 44241 (personality_options): Update PER_* constants, convert to XLAT form. 44242 44243 Convert futexops to XLAT form. 44244 * process.c: Define FUTEX_*_PRIVATE macros. 44245 (futexops): Convert to XLAT form. 44246 44247 Convert sigev_value to XLAT form. 44248 * time.c (sigev_value): Convert to XLAT form. 44249 (printsigevent32, printsigevent): Update use of sigev_value. 44250 44251 Use XLAT macro. 44252 Automatically convert all xlat structures to XLAT form 44253 using the following sed regexp: 44254 s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/ 44255 44256 2014-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 44257 44258 Introduce XLAT macro to ease maintenance of xlat structures. 44259 * defs.h (XLAT): New macro. 44260 44261 Suggested-by: Mike Frysinger <vapier (a] gentoo.org> 44262 44263 2014-02-04 Stefan Srensen <stefan.sorensen (a] spectralink.com> 44264 44265 Decode ptp ioctls. 44266 * defs.h (ptp_ioctl): New prototype. 44267 * ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='. 44268 * Makefile.am (strace_SOURCES): Add ptp.c. 44269 (EXTRA_DIST): Add linux/ptp_clock.h. 44270 * ptp.c: New file. 44271 * linux/ptp_clock.h: New file. 44272 44273 2014-02-03 Stefan Srensen <stefan.sorensen (a] spectralink.com> 44274 44275 Decode dynamic posix clocks. 44276 * time.c (cpuclocknames): New xlat structure. 44277 (printclockname): New function that decodes posix clock names, 44278 including dynamic fd encoded clocks. 44279 (sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep, 44280 sys_clock_adjtime, sys_timer_create, sys_timerfd, sys_timerfd_create): 44281 Use it. 44282 44283 Update ADJ_* constants. 44284 * time.c (adjtimex_modes): Add ADJ_TAI, ADJ_SETOFFSET, ADJ_MICRO, 44285 ADJ_NANO, ADJ_OFFSET_SS_READ. 44286 44287 2014-02-02 Philippe Ombredanne <pombredanne (a] nexb.com> 44288 44289 Add decoding of sockets descriptor 'paths' for network calls. 44290 * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto, 44291 sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg, 44292 sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode 44293 socket descriptor arguments using printfd. 44294 * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls 44295 that take socket descriptor arguments. 44296 * tests/net-fd.test: New test for socket descriptor arguments decoding. 44297 * tests/Makefile.am (TESTS): Add net-fd.test. 44298 (net-fd.log): New dependency on net.log. 44299 44300 2014-02-02 Dmitry V. Levin <ldv (a] altlinux.org> 44301 44302 tests: rename all tests so that their names end in .test suffix. 44303 Due to automake limitations, some features work only for tests 44304 that end in one of the suffixes listed in TEST_EXTENSIONS. 44305 44306 * tests/detach-running: Rename to detach-running.test. 44307 * tests/detach-sleeping: Rename to detach-sleeping.test. 44308 * tests/detach-stopped: Rename to detach-stopped.test. 44309 * tests/net: Rename to net.test. 44310 * tests/ptrace_setoptions: Rename to ptrace_setoptions.test. 44311 * tests/qual_syscall: Rename to qual_syscall.test. 44312 * tests/sigaction.sh: Rename to sigaction.test. 44313 * tests/stat: Rename to stat.test. 44314 * tests/strace-f: Rename to strace-f.test. 44315 * tests/Makefile.am (TESTS): Update. 44316 (LOG_COMPILER): Rename to TEST_LOG_COMPILER. 44317 44318 2014-01-31 Mike Frysinger <vapier (a] gentoo.org> 44319 44320 net: add more sockopt options. 44321 This syncs with the defines as available in linux-3.13. 44322 44323 * net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY, 44324 IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR, 44325 IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE, 44326 IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP, 44327 MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, 44328 MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL, 44329 IP_UNICAST_IF. 44330 44331 2014-01-08 Chris Dearman <chris.dearman (a] imgtec.com> 44332 44333 mips: fix sigaction reporting. 44334 MIPS userland uses the same sigaction structure with a full signal 44335 mask for old_sigaction and new_sigaction and does does not have 44336 an sa_restorer field. 44337 44338 These changes have been tested on MIPS O32 big/little endian, MIPS N64 44339 big endian and x86-64. 44340 44341 * signal.c (old_sigaction) [MIPS]: Add definition for MIPS. 44342 (decode_old_sigaction) [MIPS]: Print sa_mask according to its definition. 44343 (new_sigaction) [MIPS]: Add definition for MIPS. 44344 44345 2014-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 44346 44347 Factor out struct sigaction printing code. 44348 * signal.c [HAVE_SIGACTION] (decode_old_sigaction): New function. 44349 [HAVE_SIGACTION] (sys_sigaction): Use it. 44350 (decode_new_sigaction): New function. 44351 (sys_rt_sigaction): Use it. 44352 44353 2014-01-08 Dmitry V. Levin <ldv (a] altlinux.org> 44354 44355 tests: add a test for rt_sigaction output. 44356 Since "struct sigaction" varies between architectures, rt_sigaction 44357 decoding sometimes produces incorrect output. This test is expected 44358 to catch basic rt_sigaction decoding bugs. 44359 44360 Based on a patch proposed by Chris Dearman. 44361 44362 * tests/sigaction.c: New file. 44363 * tests/sigaction.awk: Likewise. 44364 * tests/sigaction.sh: New test. 44365 * tests/Makefile.am (check_PROGRAMS): Add sigaction. 44366 (TESTS): Add sigaction.sh. 44367 (EXTRA_DIST): Add sigaction.awk. 44368 * tests/.gitignore: Add sigaction. 44369 44370 2014-01-05 Kirill A. Shutemov <kirill.shutemov (a] linux.intel.com> 44371 44372 mem: add missed MAP_HUGETLB mmap flag. 44373 * mem.c (mmap_flags): Add MAP_HUGETLB mmap flag. 44374 44375 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 44376 44377 2013-12-31 Mike Frysinger <vapier (a] gentoo.org> 44378 44379 Delete old PTRACE_{PEEK,POKE}USR logic. 44380 The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has 44381 logic in defs.h to make sure it's set sanely. Delete this old logic as 44382 the defs.h takes care of it now. 44383 44384 * process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines. 44385 * signal.c: Likewise. 44386 * syscall.c: Delete PTRACE_PEEKUSR define. 44387 * util.c: Likewise. 44388 44389 2013-12-31 Mike Frysinger <vapier (a] gentoo.org> 44390 44391 Decode the O_PATH flag. 44392 * file.c (open_mode_flags): Add O_PATH. 44393 44394 2013-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 44395 44396 Remove unused configure checks. 44397 * configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist. 44398 (AC_CHECK_DECLS): Likewise. 44399 44400 2013-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 44401 44402 Assume that <sys/ptrace.h> provides a valid ptrace prototype. 44403 We used to explicitly list architectures where <sys/ptrace.h> from glibc 44404 is known to provide a valid prototype for ptrace, and use a homegrown 44405 replacement for all the rest. Situation seems to be better nowadays, 44406 glibc is not the only libc available, so let's use ptrace prototype from 44407 <sys/ptrace.h> by default, leaving the replacement for rare broken cases 44408 if any. 44409 44410 * defs.h: Use ptrace prototype workaround iff 44411 NEED_PTRACE_PROTOTYPE_WORKAROUND is defined. 44412 44413 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44414 44415 Stop using _LFS64_LARGEFILE. 44416 There is only one place left in the code where strace guesses whether 44417 libc provides LFS64 functions and structures. The most natural thing to 44418 do there is to check for _LARGEFILE64_SOURCE - the macro provided by 44419 glibc. Other libc implementations that provide nondegenerate LFS64 44420 interfaces are expected to define this macro as well. 44421 44422 * defs.h (_LFS64_LARGEFILE): Remove. 44423 * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE. 44424 44425 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44426 44427 Define truncate64, ftruncate64, and getdents64 decoders unconditionally. 44428 These decoders are referenced by most architectures, there were no 44429 undefined references so far because _LFS64_LARGEFILE appears to be 44430 always defined by glibc when _GNU_SOURCE is defined. 44431 44432 * file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define 44433 unconditionally. 44434 44435 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44436 44437 Define printflock64 only if it is referenced by other code. 44438 * configure.ac (AC_CHECK_TYPES): Add struct flock64. 44439 * desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros. 44440 [!HAVE_STRUCT_FLOCK64] (struct flock64): Define. 44441 (printflock64): Define only if referenced by other code. 44442 (sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff 44443 these constants are defined and differ from their non-64bit versions. 44444 44445 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44446 44447 Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific. 44448 * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and 44449 PTRACE_POKEUSER. 44450 * defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if 44451 they are not provided by <sys/ptrace.h>. 44452 44453 Reported by John Spencer. 44454 44455 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44456 44457 Remove unneeded redefinitions of IPPROTO_* macros. 44458 IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine 44459 them. 44460 44461 * net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP, 44462 IPPROTO_RAW, IPPROTO_MAX): Remove. 44463 44464 Reported by John Spencer. 44465 44466 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44467 44468 Remove unused AC_OFF_T_IS_LONG_LONG configure check. 44469 * configure.ac: Remove AC_OFF_T_IS_LONG_LONG. 44470 * m4/long_long.m4: Likewise. 44471 44472 Remove unused code. 44473 * configure.ac (AC_CHECK_TYPES): Remove struct opthdr and 44474 struct t_opthdr. 44475 * net.c (print_sock_optmgmt): Remove. 44476 44477 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44478 44479 Use struct sigcontext instead of struct sigcontext_struct. 44480 * configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct. 44481 * signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace 44482 struct sigcontext_struct with struct sigcontext. 44483 44484 Reported by John Spencer. 44485 44486 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44487 44488 Use standard names of sched_param structure members. 44489 * process.c (sys_sched_setscheduler, sys_sched_getparam, 44490 sys_sched_setparam): Use portable struct sched_param member name 44491 sched_priority instead of glibc specific __sched_priority. 44492 44493 Reported by John Spencer. 44494 44495 2013-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 44496 44497 Make SIGEV_THREAD_ID decoding less glibc specific. 44498 SIGEV_THREAD_ID decoding requires access to an internal member of 44499 struct sigevent. There seems to be no portable way to do it besides 44500 adding a configure check. 44501 44502 * configure.ac (AC_CHECK_MEMBERS): Check for 44503 struct sigevent._sigev_un._pad and struct sigevent.__pad. 44504 * time.c (printsigevent): Use an appropriate struct sigevent member 44505 to print thread id. 44506 44507 Reported by John Spencer. 44508 44509 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 44510 44511 Remove unused configure checks. 44512 * configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr, 44513 T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2. 44514 44515 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 44516 44517 Assume "long long" availability. 44518 Most of the code already uses long long types unconditionally. 44519 44520 * configure.ac: Remove the check for long long. 44521 * file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format 44522 string unconditionally. 44523 44524 2013-11-11 Dmitry V. Levin <ldv (a] altlinux.org> 44525 44526 Include <sys/poll.h> only if there is no <poll.h> 44527 * pathtrace.c: Do not include <sys/poll.h> if <poll.h> is available. 44528 * stream.c: Likewise. 44529 44530 Move io_* syscalls decoding to a separate file. 44531 * desc.c (sys_io_setup, sys_io_destroy, sys_io_submit, sys_io_cancel, 44532 sys_io_getevents, declarations from libaio.h): Move to ... 44533 * aio.c: new file. 44534 * Makefile.am (strace_SOURCES): Add aio.c. 44535 44536 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 44537 44538 Stop using external libaio.h. 44539 This change incorporates a partial copy instead 44540 of using external libaio.h. 44541 Why? 44542 Because we want to properly decode 32-bit aio calls 44543 by 64-bit strace. For that, we need more definitions than 44544 libaio.h provides. 44545 (These defs are not done yet, but will eventually be done). 44546 Keeping our local 32-bit compat defs in sync with libaio.h 44547 _without seeing libaio structs_ is hard/more bug prone. 44548 A smaller benefit is that we don't need libaio installed. 44549 44550 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 44551 44552 sys_io_submit: simplify iocb_cmd_lookup() helper. 44553 This helper returns two values (a string and an enum). 44554 The caller prints the string. It's simpler to just print 44555 the string in the caller itself. This eliminates 44556 "return by reference" and more importantly, an intermediate 44557 static string buffer for the string result. 44558 44559 Since function of the helper is different now, 44560 it is renamed to tprint_lio_opcode(). 44561 44562 2013-11-11 Denys Vlasenko <dvlasenk (a] redhat.com> 44563 44564 sys_io_submit: stop traversing iocb vector after first failure. 44565 The program may use a very large nr but supply either outright 44566 invalid iocbpp[], or one with far fewer elements than nr. 44567 We used to try reading iocbpp[i] until i == nr. 44568 With this change, we stop on the first failure. 44569 44570 2013-11-09 Denys Vlasenko <dvlasenk (a] redhat.com> 44571 44572 Fix pathtrace_match() to match recent fixes to select decoding. 44573 44574 Fix select decoding on e.g. 32-bit ppc process by 64-bit strace. 44575 Added next_set_bit() function which finds the next set bit, 44576 properly taking into account word size of the traced process. 44577 Use it in decode_select() instead of fd_isset(). 44578 Also, properly round fdsize up to word size of traced process, 44579 not to strace's word size. 44580 44581 2013-11-06 Denys Vlasenko <dvlasenk (a] redhat.com> 44582 44583 Speed up and explain fd_isset() 44584 44585 2013-11-05 Dr. David Alan Gilbert <dave (a] treblig.org> 44586 44587 Add a test for the latest select decoding fix. 44588 * test/select.c (main): Add a test for nfds larger than FD_SETSIZE. 44589 44590 2013-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 44591 44592 Fix select decoding for glibc in _FORTIFY_SOURCE mode. 44593 glibc in _FORTIFY_SOURCE mode raises SIGABRT when descriptor greater 44594 or equal to FD_SETSIZE is passed to FD_ISSET. Select family syscalls, 44595 however, can legitimately accept such descriptors. To overcome this 44596 limitation, we have to replace FD_ISSET with an equivalent that imposes 44597 no such restrictions. 44598 44599 * desc.c (fd_isset): New function. 44600 (decode_select): Use it instead of FD_ISSET. 44601 44602 2013-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 44603 44604 More select decoding fixes. 44605 * desc.c (decode_select): Actually print arg[0] as int on entering 44606 syscall. When arg[0] is negative, do not attempt to fetch and decode 44607 descriptor sets on entering syscall, kernel will reject it anyway. 44608 On exiting syscall, stop checking descriptor sets as soon as all 44609 returned descriptors are found. 44610 44611 2013-11-05 Denys Vlasenko <dvlasenk (a] redhat.com> 44612 44613 Truncate arg[0] to int in select decoding. 44614 This matches kernel's behavior. 44615 44616 test/select.c: make comment more understandable. 44617 44618 2013-11-05 Dr. David Alan Gilbert <dave (a] treblig.org> 44619 44620 Fix select decoding with bogus (huge or negative) nfds. 44621 We used to allocate and fetch bit arrays using a sanitized 44622 length, but then iterate over them with "j < arg[0]" condition, 44623 where arg[0] is not sanitized. This segfaults if arg[0] is huge 44624 or negative. This change fixes this. 44625 44626 Add test/select.c to capture the case. 44627 44628 2013-09-26 Ali Polatel <alip (a] exherbo.org> 44629 44630 Work around conflict between <sys/ptrace.h> and <linux/ptrace.h> 44631 Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args 44632 which collides with <linux/ptrace.h>. 44633 44634 * configure.ac: Check for `struct ptrace_peeksiginfo_args' in 44635 <sys/ptrace.h>. 44636 * process.c: Work around potential conflict between <sys/ptrace.h> 44637 and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args. 44638 * signal.c: Likewise. 44639 * syscall.c: Likewise. 44640 * util.c: Likewise. 44641 44642 2013-09-11 Vineet Gupta <Vineet.Gupta1 (a] synopsys.com> 44643 44644 Add support for ARC Cores from Synopsys. 44645 Take #2 on mainlining strace support for ARC (last one was 4.6 based back 44646 in March 2011), see 44647 http://sourceforge.net/p/strace/mailman/message/27210168/ 44648 44649 The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls), 44650 hence very similar to metag port. 44651 44652 test/* all seem to work well. 44653 44654 * linux/arc/ioctlent.h.in: New file. 44655 * linux/arc/syscallent.h: Likewise. 44656 * Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and 44657 linux/arc/syscallent.h. 44658 * configure.ac: Add ARC to the list of supported architectures. 44659 * defs.h: Add ARC support. 44660 * process.c (struct_user_offsets): Likewise. 44661 * signal.c (sys_sigreturn): Likewise. 44662 * syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args, 44663 get_syscall_result, get_error): Likewise. 44664 * util.c (change_syscall): Likewise. 44665 44666 Acked-by: Mike Frysinger <vapier (a] gentoo.org> 44667 44668 2013-09-11 William Manley <william.manley (a] youview.com> 44669 44670 Add support for decoding sync_file_range. 44671 * file.c (sync_file_range_flags): New xlat structure. 44672 (sys_sync_file_range, sys_sync_file_range2): New functions. 44673 * linux/syscall.h (sys_sync_file_range, sys_sync_file_range2): New 44674 prototypes. 44675 * linux/dummy.h (sys_sync_file_range, sys_sync_file_range2): Remove. 44676 * linux/mips/syscallent-o32.h: Set the number of sync_file_range 44677 arguments to 7. 44678 44679 2013-09-11 Mike Frysinger <vapier (a] gentoo.org> 44680 44681 fanotify_mark: fix number of args for 32bit arches. 44682 The fanotify_mark func takes a 64bit mask, so 32bit arches have to split 44683 it up into two fields. When the syscall was added, it was listed as only 44684 having 5 fields total (since that's correct for 64bit systems). 44685 44686 * linux/arm/syscallent.h: Set the number of fanotify_mark arguments to 6. 44687 * linux/bfin/syscallent.h: Likewise. 44688 * linux/hppa/syscallent.h: Likewise. 44689 * linux/i386/syscallent.h: Likewise. 44690 * linux/m68k/syscallent.h: Likewise. 44691 * linux/metag/syscallent.h: Likewise. 44692 * linux/microblaze/syscallent.h: Likewise. 44693 * linux/mips/syscallent-o32.h: Likewise. 44694 * linux/or1k/syscallent.h: Likewise. 44695 * linux/powerpc/syscallent.h: Likewise. 44696 * linux/s390/syscallent.h: Likewise. 44697 * linux/sh/syscallent.h: Likewise. 44698 * linux/sparc/syscallent.h: Likewise. 44699 * linux/tile/syscallent1.h: Likewise. 44700 44701 Acked-by: Chris Metcalf <cmetcalf (a] tilera.com> [for tile] 44702 44703 2013-09-11 Dmitry V. Levin <ldv (a] altlinux.org> 44704 44705 x86, x86_64: fix compilation warnings. 44706 Fix "dereferencing type-punned pointer will break strict-aliasing rules" 44707 warnings introduced by commit v4.8-52-gb51f364. 44708 44709 * signal.c (sys_sigreturn): Avoid dereferencing type-punned pointers. 44710 44711 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 44712 44713 Remove rt parameter from [s]printsigmask() 44714 In almost all cases, the parameter was 1 ("decode RT sigs too"). 44715 This change hardwires it to be 1. 44716 44717 The cases where it was 0 are, and why the change to "decode RT sigs too" 44718 is fine: 44719 44720 IA64: 64-bit arch, all 64 signals fit in one word in any case. 44721 S390[x]: sc.oldmask is a sigset_t on kernel side, 44722 (sigset_t *)&sc.oldmask[0] does contain all 64 signals. 44723 TILE: uc.uc_sigmask is a sigset_t on kernel side, 44724 memcpy(&sigm, &uc.uc_sigmask, NSIG / 8) copies all 64 signals. 44725 44726 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 44727 44728 Convert some uses of long_to_sigmask+printsigmask to sprintsigmask_long. 44729 This allows to drop long_to_sigmask function, 44730 and a whole bunch of sigset_t variables. 44731 44732 Simplify some sigmask manipulations. 44733 44734 Add compat support for sys_pselect6. 44735 44736 I386: fix signedness mismatch warning. 44737 &i386_regs.esp is a pointer to long, not unsigned long. 44738 It needs a cast. 44739 44740 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 44741 44742 Fix sigset printing via print_sigset(). 44743 Replace print_sigset() with print_sigset_addr_len(), 44744 which takes not only addr, but also len parameter. 44745 This allows us to drop "do we need to print RT signals?" parameter, 44746 and this fixes RT signals printing in many syscalls. 44747 44748 sys_epoll_pwait: print RT signals too, print sigmask size argument. 44749 44750 sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize), 44751 no change in functionality. 44752 44753 sys_sigpending: use print_sigset_addr_len(current_wordsize) 44754 instead of open-coding it. 44755 44756 sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it. 44757 sys_rt_sigpending: ditto. 44758 sys_rt_sigsuspend: ditto. 44759 sys_rt_sigtimedwait: ditto. 44760 44761 do_signalfd: print_sigset -> print_sigset_addr_len. This fixes 44762 RT signals printing (wasn't showing them before). 44763 44764 sys_ppoll: ditto. 44765 44766 copy_sigset_len() is folded into its only user, print_sigset_addr_len(), 44767 and copy_sigset() is gone. 44768 44769 While at it, checked kernel sources and noted where kernel enforces 44770 sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)), 44771 and where it allows word-sized sigset_size ([rt_]sigpending). 44772 44773 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 44774 44775 sys_rt_sigaction: fix sigset copying. 44776 In practice, we always copy as many bytes as syscall param says 44777 (8, or 16 on mips). However, malicious program can call sigaction 44778 with wrong sigset size. Such syscall will result in EINVAL, 44779 but we (strace) end up copying 128 bytes (sizeof(sigset_t)), 44780 which copyes some garbage from stack after struct sigaction. 44781 44782 Now we always copy NSIG / 8 bytes (which is 8 bytes, or 16 on mips). 44783 44784 2013-07-18 Denys Vlasenko <dvlasenk (a] redhat.com> 44785 44786 ARM: remove wrong NSIG = 32 define. 44787 ARM in fact has 64 signals (1..64), and NSIG should be 65 44788 (as usual, rememebr that NSIG_libc == NSIG_kernel+1). 44789 44790 I carefully reviewed all usages of NSIG. In syscall.c, 44791 the only usage is: 44792 for (i = 0; i <= NSIG; i++) 44793 if (strcasecmp(s, signame(i) + 3) == 0)... 44794 which is safe even if NSIG is way too big - signame(i) 44795 returns a well-formed string for any i. 44796 44797 In signal.c, memcpy(&sigset, &sc.sc_mask, NSIG / 8) is used by 44798 IA64 and TILE code, so ARM change can't affect it. And final 44799 usage is: 44800 struct new_sigaction::unsigned long sa_mask[NSIG / sizeof(long)]; 44801 It will grow on ARM (and become correct in the process). 44802 Its only use is 44803 memcpy(&sigset, &sa.sa_mask, NSIG / 8); 44804 printsigmask(&sigset, 1); 44805 which used to copy garbage in high bits, now it will copy actual data. 44806 44807 2013-07-17 Denys Vlasenko <dvlasenk (a] redhat.com> 44808 44809 ARM: fix sigreturn decoding. 44810 Decoding of test/sigreturn testcase: 44811 Was: 44812 sigreturn() (mask [QUIT TRAP ABRT BUS SEGV USR2 PIPE STKFLT STOP XCPU VTALRM PROF WINCH IO PWR RTMIN]) = 0 44813 Now: 44814 sigreturn() (mask [CHLD RT_1 RT_3 RT_31 RT_32]) = 0 44815 44816 2013-07-16 Denys Vlasenko <dvlasenk (a] redhat.com> 44817 44818 Group USE_CUSTOM_PRINTF define with other tweakables. 44819 No code changes. 44820 44821 2013-07-16 Denys Vlasenko <dvlasenk (a] redhat.com> 44822 44823 Improve sigreturn decoding on x86 to show RT signal bits too. 44824 This includes decoding of 32-bit sigreturn by 64-bit strace, 44825 which previously wasn't done. 44826 44827 Added a test for it. 44828 44829 2013-07-12 Anton Blanchard <anton (a] samba.org> 44830 44831 powerpc: enhance 32/64bit detection. 44832 We were using uname to determine if userspace was 32 or 64bit. 44833 This fails when we have a 64bit kernel and a 32bit userspace. 44834 44835 * configure.ac (powerpc*): Similar to x86, use a runtime test 44836 to determine if we are 32 or 64bit. 44837 44838 2013-07-12 Anton Blanchard <anton (a] samba.org> 44839 44840 powerpc: fix some compiler warnings. 44841 Fix a number of differing signedness warnings when building on 44842 powerpc. 44843 44844 powerpc: fix iflag build issue (static -> extern) 44845 44846 2013-07-10 Denys Vlasenko <dvlasenk (a] redhat.com> 44847 44848 PTRACE_SEIZE can set ptrace options immediately, use this feature. 44849 This eliminates some rare bugs, such as post-execve SIGTRAP 44850 generation when we attach to a process, and it manages to finish 44851 execve'ing before we set TRACEEXEC option to suppress that. 44852 44853 2013-07-08 Denys Vlasenko <dvlasenk (a] redhat.com> 44854 44855 If -o|logger is in use, exit trace loop if nprocs == 0. 44856 44857 Exit trace loop if got ECHILD, not if nprocs == 0. 44858 Comment gives a testcase which wasn't handled correctly 44859 by the old code. 44860 44861 2013-07-07 Denys Vlasenko <dvlasenk (a] redhat.com> 44862 44863 s390[x]: get rid of syscall_mode, delete code which never triggers. 44864 Before this change, the logic was as follows: 44865 syscall entry: 44866 get_scno: 44867 syscall_mode = GPR2 44868 scno = syscall_mode unless syscall_mode == -ENOSYS 44869 (if -ENOSYS, scn is retrieved by decoding current insn) 44870 fixup: 44871 gpr2 = GPR2 44872 syscall_mode = scno unless syscall_mode == -ENOSYS 44873 if (gpr2 != syscall_mode) stray_entry 44874 syscall exit: 44875 get_res: 44876 gpr2 = GRP2 44877 fixup: 44878 syscall_mode = scno unless syscall_mode == -ENOSYS 44879 if (WAITEXECVE && gpr2 in (-ENOSYS, scno)) gpr2 = 0; 44880 get_error: 44881 gpr2 is retval 44882 44883 Entry fixup's if() can never trigger: 44884 regardless whether GPR2 is -ENOSYS or not, syscall_mode is always 44885 equal to GRP2 value there. So it can be removed. 44886 44887 On sysexit path, syscall mode is never used. 44888 44889 Therefore, syscall_mode variable is deleted. grp2 is read from 44890 GPR2 register in get_scno, redundant read in entry fixup is removed. 44891 As a result, entry fixup's s390 code block vanishes completely. 44892 44893 gpr2 variable is renamed s390_gpr2 to match the convention used 44894 by other arches. 44895 44896 2013-07-04 Denys Vlasenko <dvlasenk (a] redhat.com> 44897 44898 ARM: add STRACE_KNOWS_ONLY_EABI define which can be used to omit OABI support 44899 44900 Add paranoia check before passing a long to pid2tcb(int pid) 44901 44902 2013-07-02 Denys Vlasenko <dvlasenk (a] redhat.com> 44903 44904 In debug output, show waitpid status with 6 hex digits, not 4. 44905 This shows event byte values better (without variable offset): 44906 44907 [wait(0x01057f) = 29491] WIFSTOPPED,sig=SIGTRAP,EVENT_FORK (1) 44908 [wait(0x80057f) = 29492] WIFSTOPPED,sig=SIGTRAP,EVENT_STOP (128) 44909 ^^ 44910 44911 2013-07-02 Denys Vlasenko <dvlasenk (a] redhat.com> 44912 44913 Replace suspicious popen_pid assignment with an obviously correct one. 44914 popen_pid = vfork() does work correctly, but for a subtle reason 44915 that wrong assignment of 0 happens in the child _first_, 44916 and _then_ correct value overwrites it in the parent. 44917 44918 (And in a hyphothetical system where vfork = fork, 44919 popen_pid wouldn't be shared, so it will also be ok.) 44920 44921 However, it's not necessary to be difficult. 44922 This change makes it so that assignment is done only in parent. 44923 44924 2013-07-01 Denys Vlasenko <dvlasenk (a] redhat.com> 44925 44926 Convert trace() from returning int to returning void. 44927 The cleanup sequence in error cases, and on normal code path 44928 was nearly the same, no point in duplicating it. 44929 44930 Remove ia64-specific printing of current address on signal delivery. 44931 The address is printed anyway by printleader() if -i is active. 44932 44933 Rename ia32 to ia64_ia32mode, and make it bool, not long. 44934 Grepping for just ia32 was turning up many false positives. 44935 44936 2013-06-30 Denys Vlasenko <dvlasenk (a] redhat.com> 44937 44938 Fold is_restart_error() into its sole user. 44939 44940 2013-06-29 Denys Vlasenko <dvlasenk (a] redhat.com> 44941 44942 Update qemu_multiarch_testing/README. 44943 44944 2013-06-28 Denys Vlasenko <dvlasenk (a] redhat.com> 44945 44946 sys_clone: add a comment about CLONE_PTRACE and CLONE_UNTRACED. 44947 No code changes. 44948 44949 POWERPC: get rid of "static long ppc_result" 44950 44951 POWERPC: read ppc_regs.nip if -i. 44952 44953 POWERPC: if GETREGS fails with EIO, don't try it again. 44954 44955 Get rid of powerpc_getreg(), it's a copy of upeek() 44956 44957 Change upeek() to take pid, not full tcp. 44958 This will be used by next change. 44959 44960 2013-06-26 Anton Blanchard <anton (a] samba.org> 44961 44962 powerpc: Provide a fallback for old kernels without PTRACE_GETREGS. 44963 PTRACE_GETREGS was added to the ppc kernel in 2.6.23. In order to 44964 provide backward compatibility for very old kernels, add a manual 44965 fallback. 44966 44967 * syscall.c (powerpc_getreg, powerpc_getregs_old): New functions. 44968 (get_regs): Call powerpc_getregs_old if PTRACE_GETREGS is not supported. 44969 44970 2013-06-26 Anton Blanchard <anton (a] samba.org> 44971 44972 powerpc: Use PTRACE_GETREGS to fetch all registers. 44973 * defs.h: declare ppc_regs and get_regs_error. 44974 * signal.c (sys_sigreturn): Use ppc_regs instead of upeek. 44975 * syscall.c: define ppc_regs. 44976 (printcall): Use ppc_regs instead of upeek. 44977 (get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call. 44978 (get_syscall_result): Likewise. 44979 44980 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 44981 44982 Another manpage tweak. 44983 44984 Manpage update. 44985 44986 Update build_static_example.sh. 44987 Now it also contains a tested example of i686 build on 64-bit host. 44988 44989 In -f mode, do not assume that new pid is stopped - handle exits too. 44990 44991 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 44992 44993 Set strace_child only in the right branch. 44994 "strace_child = pid" assignment was racing in NOMMU case 44995 because of vfork (no way to know which process would win). 44996 44997 After this change, strace_child is set to nonzero only 44998 in one process after [v]fork. 44999 45000 2013-06-26 Denys Vlasenko <dvlasenk (a] redhat.com> 45001 45002 Get rid of TCB_INUSE and TCB_STRACE_CHILD. 45003 We can use tcb::pid == 0 as an indicator of free tcb, 45004 and we already have strace_child variable which holds 45005 pid of our child, if any. 45006 45007 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 45008 45009 Fix debug output of wait4 result (was reusing buf[] on unknown events) 45010 45011 Show PTRACE_EVENT_STOP correctly in debug output. 45012 45013 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 45014 45015 Panic a bit less when we see an unknown pid. 45016 I stumbeld over this case when I used "exec stace ...". 45017 45018 * strace.c (trace): Do not exit if we see an unknown pid in wait4. 45019 45020 2013-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 45021 45022 detach(): Reorganize code. Logic is the same. 45023 * strace.c (detach): Use goto's instead of excessive nesting. 45024 Drop sigstop_expected and interrupt_done variables. 45025 45026 Eat pending SIGSTOP _before_ PTRACE_DETACH in detach() 45027 * strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set, 45028 di not PTRACE_DETACH - wait for SIGSTOP first. 45029 45030 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 45031 45032 detach(): warn if we see ECHILD from waitpid. 45033 * strace.c (detach): Warn if we see ECHILD from waitpid. 45034 Explain in comments that we don't normally expect !WIFSTOPPED 45035 either, and also that PTRACE_CONT failure isn't expected 45036 (the "break" there is a "I'm confused, bailing out" code style).. 45037 45038 Improve error messages in detach() 45039 * strace.c (detach): Change return type from int to void. 45040 Improve error meesages: show PID, tell exactly which operation fails. 45041 45042 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 45043 45044 Remove workarounds for ancient kernels lacking __WALL. 45045 __WALL is available and working at least since 2.4 kernels: 10 years ago. 45046 45047 * strace (detach): Remove workarounds for ancient kernels lacking __WALL. 45048 Add missing EINTR check. 45049 (trace): Remove workarounds for ancient kernels lacking __WALL. 45050 Remove redundant double error printout. 45051 45052 2013-06-20 Denys Vlasenko <dvlasenk (a] redhat.com> 45053 45054 USE_SEIZE: fix detaching from stopped processes. 45055 V3: split SEIZE/!SEIZE code paths to reduce confusion. 45056 Extensively comment every possible case. 45057 Verified that all tests/detach* tests work in both SEIZE and !SEIZE 45058 cases. 45059 45060 * strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee 45061 using PTRACE_INTERRUPT instead of sending it a SIGSTOP. 45062 In a subsequent waitpid loop, correctly wait and suppress SIGSTOP 45063 on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace 45064 stop and detach without suppressing signals. 45065 45066 2013-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 45067 45068 tests: disable /proc based checks when /proc is not mounted. 45069 * tests/detach-running: Disable /proc based checks when 45070 /proc/self/status is not available. 45071 * tests/detach-sleeping: Likewise. 45072 * tests/detach-stopped: Likewise. 45073 45074 2013-06-19 Denys Vlasenko <dvlasenk (a] redhat.com> 45075 45076 tests/detach-{running,sleeping,stopped}: check post-detach state. 45077 Check that traced process still exists and is in a right state 45078 after strace detached from it. 45079 45080 2013-06-19 Dmitry V. Levin <ldv (a] altlinux.org> 45081 45082 tests: ensure that strace can detach from running processes. 45083 * tests/detach-running: New test. 45084 * tests/Makefile.am (TESTS): Add it. 45085 45086 tests: ensure that strace does not leave sleeping processes stopped. 45087 * tests/detach-sleeping: Do not send SIGCONT to the sleeping process. 45088 45089 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 45090 45091 tests: fix parallel-tests support in detach-* tests. 45092 * tests/detach-sleeping: Use $LOG file for set_ptracer_any output. 45093 * tests/detach-stopped: Likewise. 45094 45095 tests: parametrize "sleep 1" 45096 * tests/init.sh (SLEEP_A_BIT): New variable. 45097 * tests/detach-sleeping: Use it. 45098 * tests/detach-stopped: Likewise. 45099 45100 tests: ensure that strace can detach from sleeping and stopped processes 45101 * tests/set_ptracer_any.c: New file. 45102 * tests/detach-sleeping: New test. 45103 * tests/detach-stopped: Likewise. 45104 * tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any. 45105 (TESTS): Add detach-sleeping and detach-stopped. 45106 * tests/.gitignore: Add set_ptracer_any. 45107 45108 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 45109 45110 tests: enhance timeout checks. 45111 Run each test using a wrapper that does all necessary timeout checks. 45112 45113 * tests/run.sh: New file. 45114 * tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it. 45115 * tests/init.sh (check_strace, check_timeout): Remove. 45116 * tests/detach-stopped: Update callers. 45117 * tests/net: Likewise. 45118 * tests/ptrace_setoptions: Likewise. 45119 * tests/qual_syscall: Likewise. 45120 * tests/stat: Likewise. 45121 * tests/strace-f: Likewise. 45122 45123 2013-06-18 Dmitry V. Levin <ldv (a] altlinux.org> 45124 45125 tests: enable parallel-tests support. 45126 * configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests. 45127 45128 tests: prepare for parallel-tests support. 45129 * tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS. 45130 * tests/init.sh (LOG): New variable. 45131 * tests/detach-stopped: Use it. 45132 * tests/net: Likewise. 45133 * tests/qual_syscall: Likewise. 45134 * tests/stat: Likewise. 45135 * tests/strace-f: Likewise. 45136 45137 2013-06-18 Denys Vlasenko <dvlasenk (a] redhat.com> 45138 45139 Cleanups. No logic changes. 45140 * defs.h: Define new ptrace constants unconditionally. 45141 * strace.c (detach): Fix comment. 45142 (trace): Remove now unnecessary "if USE_SEIZE". 45143 45144 2013-06-05 Dmitry V. Levin <ldv (a] altlinux.org> 45145 45146 maint: post-release administrivia. 45147 * NEWS: Add header line for next release. 45148 45149 2013-06-03 Dmitry V. Levin <ldv (a] altlinux.org> 45150 45151 ioctlent: add UAPI support. 45152 * Makefile.am (IOCTLSORT_INCLUDEDIR): Define. 45153 (ioctlsort): Use it. 45154 * linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree. 45155 Strip "uapi/" prefix from output path names. 45156 * linux/ioctlent.h.in: Regenerate from v3.9 headers. 45157 * NEWS: Mention it. 45158 45159 Prepare for 4.8 release. 45160 * NEWS: Update for 4.8 release. 45161 * debian/changelog: 4.8-1. 45162 * strace.spec: 4.8-1. 45163 45164 2013-06-02 Dmitry V. Levin <ldv (a] altlinux.org> 45165 45166 Fix "make dist" on recently added architectures. 45167 * Makefile.am (EXTRA_DIST): Add linux/aarch64/errnoent1.h, 45168 linux/aarch64/ioctlent.h.in, linux/aarch64/ioctlent1.h, 45169 linux/aarch64/signalent1.h, linux/aarch64/syscallent.h, 45170 linux/aarch64/syscallent1.h, linux/metag/ioctlent.h.in, 45171 linux/metag/syscallent.h, linux/or1k/ioctlent.h.in, 45172 linux/or1k/syscallent.h, linux/tile/errnoent1.h, linux/tile/ioctlent1.h, 45173 linux/tile/signalent1.h, linux/tile/syscallent1.h, linux/ubi-user.h, 45174 linux/xtensa/ioctlent.h.in, and linux/xtensa/syscallent.h. 45175 45176 Fix "make dist" regression introduced by commit v4.7-184-gd648f29. 45177 * Makefile.am (EXTRA_DIST): Add linux/ubi-user.h. 45178 45179 2013-05-28 Dmitry V. Levin <ldv (a] altlinux.org> 45180 45181 Do not suppress signal delivery messages with -qq. 45182 Current implementation of -qq does not allow suppressing exit status 45183 messages without suppressing signal delivery messages, which is not 45184 good. There is a traditional "-e signal=none" syntax that can be used 45185 to suppress all signal delivery messages. 45186 This partially reverts commit v4.7-222-g01997cf. 45187 45188 * strace.c (trace): Do not suppress signal delivery messages with -qq. 45189 * strace.1: Update documentation about -qq option. 45190 45191 2013-05-23 Chris Metcalf <cmetcalf (a] tilera.com> 45192 45193 tile: use siginfo_t, not struct siginfo. 45194 As of glibc 2.16, "struct siginfo" is no longer supported, 45195 and "siginfo_t" must be used instead. 45196 45197 tile: remove MAP_CACHE_xxx support in mem.c. 45198 These flags support functionality in mmap() that has not been 45199 pushed back to the community, and which may or may not eventually 45200 end up being the final community model. In the interim, having 45201 these flags unconditionally present for "#ifdef TILE" just means 45202 that the TILE build breaks if using the community versions of 45203 the kernel and glibc, so just revert the code until such time 45204 as it may end up in the community. 45205 45206 2013-05-17 Mike Frysinger <vapier (a] gentoo.org> 45207 45208 Rename COPYRIGHT to COPYING. 45209 The standard name people have adopted is "COPYING" rather than 45210 "COPYRIGHT". Use that as a lot of license scanning tools look for it. 45211 45212 * COPYRIGHT: Rename to ... 45213 * COPYING: ... this. 45214 * Makefile.am (EXTRA_DIST): Rename COPYRIGHT to COPYING. 45215 * README: Likewise. 45216 * strace.spec (%files): Likewise. 45217 45218 2013-05-17 Dmitry V. Levin <ldv (a] altlinux.org> 45219 45220 Sync strace.spec and debian/ with packages. 45221 * debian/changelog: Sync with 4.7-1. 45222 * debian/strace.docs: Likewise. 45223 * strace.spec: Sync with 4.7-3. 45224 45225 Update PTRACE_O_* constants. 45226 * process.c (ptrace_setoptions_flags): Sync with Linux 3.9. 45227 45228 Update AF_*, PF_*, MSG_*, and TCP_* constants. 45229 * net.c (domains, addrfams, protocols, socktcpoptions): Sync with 45230 Linux 3.9. 45231 45232 2013-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 45233 45234 NOMMU: do not hide startup syscalls unless in -D mode. 45235 On NOMMU systems in "strace PROG" case, we have no way to attach to 45236 the tracee before it calls execve unless in -D mode. That is, the 45237 first execve call is very likely to be missed, and setting 45238 hide_log_until_execve just results to empty log. 45239 45240 * strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve 45241 unless in -D mode. 45242 45243 2013-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 45244 45245 Make -D mode work when the Yama LSM is enabled. 45246 * strace.c [HAVE_PRCTL]: Include sys/prctl.h. 45247 (startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]: 45248 In -D mode, allow tracing the process that is going to become the 45249 tracee. 45250 45251 Update PR_* constants. 45252 * process.c (prctl_options): Add PR_SET_PTRACER. 45253 45254 2013-05-14 Denys Vlasenko <dvlasenk (a] redhat.com> 45255 45256 Hide startup syscalls. 45257 Tested with "./strace [-D] [-q] [-bexecve] env true", 45258 all cases seem to work. 45259 45260 * defs.h: Declare new variable: bool hide_log_until_execve. 45261 * strace.c: Define hide_log_until_execve. 45262 Rename skip_startup_execve to skip_one_b_execve. 45263 (startup_child): Do not set skip_one_b_execve = 1 here. 45264 (init): If "strace PROG" case (as opposed to "strace -pPID"), 45265 set skip_one_b_execve and hide_log_until_execve to 1. 45266 (trace): Don't print signal messages if hide_log_until_execve == 1. 45267 * syscall.c (trace_syscall_entering): 45268 Skip syscall printing if hide_log_until_execve == 1. 45269 Reset hide_log_until_execve if we enter execve syscall. 45270 (trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1. 45271 45272 2013-05-13 Daniel P. Berrange <berrange (a] redhat.com> 45273 45274 Allow -q to be repeated for very quiet output. 45275 Even with the -q flag specified, tracing output is still mixed 45276 with messages about signals and process exit status, which is 45277 often irrelevant. Allow the -q option to be repeated to force 45278 the suppression of signals / exit status info too. 45279 45280 * defs.h: Change 'qflag' from 'bool' to 'unsigned int'. 45281 * strace.1: Document ability to repeat '-q' option. 45282 * strace.c: Allow '-q' to be repeated to quieten process 45283 exit status and signal messages. 45284 45285 2013-05-11 Dmitry V. Levin <ldv (a] altlinux.org> 45286 45287 mips o32: fix syscall table. 45288 * linux/mips/syscallent-o32.h: Add entries for getpmsg, putpmsg, 45289 get_mempolicy, set_mempolicy and vserver. Fix names for umount, 45290 umount2, mmap, mmap2, pread64, pwrite64, sigaltstack and fstatat64 45291 syscalls. 45292 45293 2013-05-10 Dmitry V. Levin <ldv (a] altlinux.org> 45294 45295 mips n64: fix syscall table. 45296 * linux/mips/syscallent-n64.h: Add entries for get_mempolicy, 45297 set_mempolicy and timerfd syscalls. Fix entry for socket syscall. 45298 Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack 45299 and umount2 syscalls. 45300 45301 mips n32: fix syscall table. 45302 * linux/mips/syscallent-n32.h: Add entries for mbind, get_mempolicy, 45303 set_mempolicy and timerfd syscalls. Fix entry for socket syscall. 45304 Fix handlers for truncate, ftruncate and getdents64 syscalls. 45305 Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack, 45306 umount2, and getdents64 syscalls. 45307 45308 2013-05-08 Dmitry V. Levin <ldv (a] altlinux.org> 45309 45310 sync_file_range: fix number of syscall arguments. 45311 * linux/avr32/syscallent.h: Set the number of sync_file_range arguments 45312 to 6. 45313 * linux/bfin/syscallent.h: Likewise. 45314 * linux/hppa/syscallent.h: Likewise. 45315 * linux/i386/syscallent.h: Likewise. 45316 * linux/m68k/syscallent.h: Likewise. 45317 * linux/microblaze/syscallent.h: Likewise. 45318 * linux/mips/syscallent-o32.h: Likewise. 45319 * linux/or1k/syscallent.h: Likewise. 45320 * linux/s390/syscallent.h: Likewise. 45321 * linux/sh/syscallent.h: Likewise. 45322 * linux/powerpc/syscallent.h: Change sync_file_range to 45323 sync_file_range2, set the number of sync_file_range2 arguments to 6. 45324 * linux/tile/syscallent.h: Change sync_file_range to sync_file_range2, 45325 set the number of sync_file_range2 arguments to 4. 45326 * linux/tile/syscallent1.h: Change sync_file_range to sync_file_range2. 45327 update handler. 45328 * linux/xtensa/syscallent.h: Likewise. 45329 45330 Add syscall entries for new linux syscalls. 45331 * linux/dummy.h: Add printargs aliases for sys_finit_module, sys_kcmp 45332 and sys_sync_file_range2. 45333 * linux/alpha/syscallent.h: Add entries for process_vm_readv 45334 and process_vm_writev. 45335 * linux/bfin/syscallent.h: Likewise. 45336 * linux/arm/syscallent.h: Add entries for sync_file_range2, kcmp 45337 and finit_module. 45338 * linux/hppa/syscallent.h: Add entries for process_vm_readv, 45339 process_vm_writev, kcmp and finit_module. 45340 * linux/tile/syscallent.h: Likewise. 45341 * linux/tile/syscallent1.h: Likewise. 45342 * linux/ia64/syscallent.h: Add entry for finit_module. 45343 * linux/i386/syscallent.h: Add entries for kcmp and finit_module. 45344 * linux/m68k/syscallent.h: Likewise. 45345 * linux/metag/syscallent.h: Likewise. 45346 * linux/microblaze/syscallent.h: Likewise. 45347 * linux/mips/syscallent-n32.h: Likewise. 45348 * linux/mips/syscallent-n64.h: Likewise. 45349 * linux/mips/syscallent-o32.h: Likewise. 45350 * linux/or1k/syscallent.h: Likewise. 45351 * linux/powerpc/syscallent.h: Likewise. 45352 * linux/sh/syscallent.h: Likewise. 45353 * linux/sh64/syscallent.h: Likewise. 45354 * linux/x32/syscallent.h: Likewise. 45355 * linux/x86_64/syscallent.h: Likewise. 45356 * linux/xtensa/syscallent.h: Likewise. 45357 * linux/s390/syscallent.h: Add entries for s390_runtime_instr, kcmp 45358 and finit_module. 45359 * linux/s390x/syscallent.h: Likewise. 45360 * linux/sparc/syscallent.h: Add entries for kern_features, kcmp 45361 and finit_module. 45362 45363 tests/net: fix portability issues. 45364 * tests/net-accept-connect.c: Fix address length passed to bind() 45365 and connect(). 45366 * tests/net: Update regexps. 45367 45368 tests: add a test for basic network syscalls. 45369 * tests/.gitignore: Add net-accept-connect, *.o and *.log.*. 45370 * tests/Makefile.am (AM_CFLAGS): New variable. 45371 (check_PROGRAMS): Add net-accept-connect. 45372 (TESTS): Add net. 45373 * tests/net-accept-connect.c: New file. 45374 * tests/net: New file. 45375 45376 tests: do not skip tests when timeout utility is not available. 45377 * tests/init.sh (check_timeout): New function. 45378 * tests/ptrace_setoptions: Use it. 45379 * tests/qual_syscall: Likewise. 45380 * tests/stat: Likewise. 45381 * tests/strace-f: Likewise. 45382 45383 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45384 45385 Move subcall decoding configuration out of the common code. 45386 * Makefile.am (EXTRA_DIST): Add linux/subcall.h. 45387 * linux/syscall.h (SYS_socket_subcall): Remove. 45388 (SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ... 45389 * linux/subcall.h: ... new file. 45390 * linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h. 45391 * linux/i386/syscallent.h: Likewise. 45392 * linux/m68k/syscallent.h: Likewise. 45393 * linux/powerpc/syscallent.h: Likewise. 45394 * linux/s390/syscallent.h: Likewise. 45395 * linux/s390x/syscallent.h: Likewise. 45396 * linux/sh/syscallent.h: Likewise. 45397 * linux/sh64/syscallent.h: Likewise. 45398 * linux/sparc/syscallent.h: Likewise. 45399 45400 Suggested by Mike Frysinger and Chris Metcalf. 45401 45402 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45403 45404 sparc: remove some unused declarations and macros. 45405 * linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys, 45406 sys_shmsys): Remove declarations. 45407 [SPARC || SPARC64] (SYS_semsys_subcall, SYS_semsys_nsubcalls, 45408 SYS_msgsys_subcall, SYS_msgsys_nsubcalls, SYS_shmsys_subcall, 45409 SYS_shmsys_nsubcalls): Remove macros. 45410 45411 2013-05-07 Mike Frysinger <vapier (a] gentoo.org> 45412 45413 mips: fix build regression. 45414 The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled 45415 the mips headers around causing it to check the ABI defines before it 45416 included the header which set those up. Now all mips builds fail with: 45417 In file included from count.c:36:0: 45418 defs.h:48:4: error: #error Unsupported _MIPS_SIM 45419 45420 * defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check. 45421 45422 2013-05-07 James Hogan <james.hogan (a] imgtec.com> 45423 45424 metag: rename llseek syscall to _llseek. 45425 The raw llseek syscall is called _llseek from userland, so fix the 45426 naming of it for metag to allow the stat test to pass. 45427 45428 * linux/metag/syscallent.h: Rename llseek syscall to _llseek. 45429 45430 2013-05-07 James Hogan <james.hogan (a] imgtec.com> 45431 45432 metag: disable socket and ipc subcall support. 45433 The metag architecture also uses dedicated syscalls and doesn't need to 45434 multiplex ipc and socket subcalls. 45435 45436 * linux/syscall.h [METAG]: Do not define SYS_socket_subcall and 45437 SYS_ipc_subcall. 45438 45439 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45440 45441 pread, pwrite: fix number of syscall arguments. 45442 The number of pread and pwrite arguments depends on architecture and 45443 personality. For 64bit and ilp32 it equals to 4, for unaligned 45444 32bit it equals to 5, and for aligned 32bit it equals to 6. 45445 45446 * linux/aarch64/syscallent1.h: Change the number of pread and pwrite 45447 arguments to 4. 45448 * linux/alpha/syscallent.h: Likewise. 45449 * linux/mips/syscallent-n32.h: Likewise. 45450 * linux/mips/syscallent-n64.h: Likewise. 45451 * linux/s390x/syscallent.h: Likewise. 45452 * linux/sh64/syscallent.h: Likewise. 45453 * linux/tile/syscallent.h: Likewise. 45454 * linux/x32/syscallent.h: Likewise. 45455 * linux/x86_64/syscallent.h: Likewise. 45456 * linux/or1k/syscallent.h: Change the number of pread and pwrite 45457 arguments to 5. 45458 45459 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45460 45461 preadv, pwritev: fix number of syscall arguments. 45462 The number of preadv and pwritev arguments depends on architecture and 45463 personality. For 64bit and ilp32 it equals to 4, for unaligned 32bit 45464 it equals to 5, and for aligned 32bit it equals to 6. 45465 45466 * linux/aarch64/syscallent1.h: Change the number of preadv and pwritev 45467 arguments to 4. 45468 * linux/alpha/syscallent.h: Likewise. 45469 * linux/ia64/syscallent.h: Likewise. 45470 * linux/mips/syscallent-n32.h: Likewise. 45471 * linux/mips/syscallent-n64.h: Likewise. 45472 * linux/s390x/syscallent.h: Likewise. 45473 * linux/sh64/syscallent.h: Likewise. 45474 * linux/tile/syscallent.h: Likewise. 45475 * linux/x32/syscallent.h: Likewise. 45476 * linux/x86_64/syscallent.h: Likewise. 45477 * linux/powerpc/syscallent.h: Change the number of preadv and pwritev 45478 arguments to 6. 45479 * linux/sh/syscallent.h: Likewise. 45480 * linux/xtensa/syscallent.h: Likewise. 45481 45482 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45483 45484 ftruncate64, truncate64: fix number of syscall arguments. 45485 The number of ftruncate64/truncate64 arguments depends on architecture 45486 and personality. For 64bit and ilp32 it equals to 2, for unaligned 45487 32bit it equals to 3, and for aligned 32bit it equals to 4. 45488 45489 * linux/or1k/syscallent.h: Change the number of ftruncate64 and 45490 truncate64 arguments to 3. 45491 * linux/sh/syscallent.h: Likewise. 45492 * linux/sh64/syscallent.h: Change ftruncate64 and truncate64 handlers. 45493 * linux/sparc/syscallent.h: Change ftruncate64 handler, change the 45494 number of its arguments to 3. 45495 * linux/xtensa/syscallent.h: Change the number of ftruncate64 and 45496 truncate64 arguments to 4. 45497 45498 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45499 45500 fallocate: fix number of syscall arguments. 45501 The number of fallocate arguments depends on architecture and 45502 personality. For 64bit and ilp32 it equals to 4, 45503 for 32bit it equals to 6. 45504 45505 * linux/aarch64/syscallent1.h: Change the number of fallocate arguments 45506 to 4. 45507 * linux/alpha/syscallent.h: Likewise. 45508 * linux/mips/syscallent-n32.h: Likewise. 45509 * linux/mips/syscallent-n64.h: Likewise. 45510 * linux/s390x/syscallent.h: Likewise. 45511 * linux/sh64/syscallent.h: Likewise. 45512 * linux/tile/syscallent.h: Likewise. 45513 * linux/x32/syscallent.h: Likewise. 45514 * linux/x86_64/syscallent.h: Likewise. 45515 * linux/microblaze/syscallent.h: Set fallocate handler and flags. 45516 45517 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45518 45519 fadvise64, fadvise64_64: fix handlers and number of syscall arguments. 45520 The number of fadvise64 arguments depends on architecture and 45521 personality. For 64bit and ilp32 it equals to 4, for unaligned 45522 32bit it equals to 5, and for aligned 32bit it equals to 6. 45523 45524 The number of fadvise64_64 arguments is 4 for 64bit and ilp32, for 45525 unaligned 32bit and most of aligned 32bit it equals to 6, and for 45526 mips o32 it equals to 7. 45527 45528 * linux/alpha/syscallent.h: Set fadvise64 handler. 45529 * linux/s390/syscallent.h: Likewise. 45530 * linux/hppa/syscallent.h: Set fadvise64_64 handler, change the number 45531 of syscall arguments to 6. 45532 * linux/ia64/syscallent.h: Change the number of fadvise64 arguments 45533 to 4. 45534 * linux/mips/syscallent-n32.h: Likewise. 45535 * linux/tile/syscallent1.h: Change the number of fadvise64 arguments 45536 to 5. 45537 * linux/mips/syscallent-o32.h: Change the number of fadvise64_64 45538 arguments to 7. 45539 * linux/s390x/syscallent.h: Change fadvise64_64 handler. Set fadvise64 45540 handler. Change numbers of fadvise64 and fadvise64_64 arguments to 4. 45541 * linux/sh64/syscallent.h: Change fadvise64_64 handler. 45542 Change numbers of fadvise64 and fadvise64_64 arguments to 4. 45543 * linux/sparc/syscallent.h: Set fadvise64 and fadvise64_64 handlers, 45544 change numbers of their arguments to 5 and 6. 45545 * linux/x86_64/syscallent.h: Change fadvise64 handler. 45546 45547 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45548 45549 mips o32: raise the max number of syscall arguments to 7. 45550 On mips o32, fadvise64_64 takes 7 arguments. 45551 45552 * defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7. 45553 45554 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45555 45556 mips: split syscallent.h. 45557 linux/mips/syscallent.h consisted of several parts that had little in 45558 common. Split them into separate files to ease maintenance. 45559 45560 * linux/mips/syscallent-compat.h: New file. 45561 * linux/mips/syscallent-n32.h: Likewise. 45562 * linux/mips/syscallent-n64.h: Likewise. 45563 * linux/mips/syscallent-o32.h: Likewise. 45564 * linux/mips/syscallent.h: Include them. 45565 * Makefile.am (EXTRA_DIST): Add them. 45566 45567 2013-05-07 Dmitry V. Levin <ldv (a] altlinux.org> 45568 45569 readahead: fix number of syscall arguments. 45570 The number of readahead arguments depends on architecture and 45571 personality. For 64bit and ilp32 it equals to 3, for unaligned 32bit it 45572 equals to 4, and for aligned 32bit it equals to 5. 45573 45574 * linux/aarch64/syscallent1.h: Set number of readahead arguments to 3. 45575 * linux/alpha/syscallent.h: Likewise. 45576 * linux/ia64/syscallent.h: Likewise. 45577 * linux/s390x/syscallent.h: Likewise. 45578 * linux/sh64/syscallent.h: Likewise. 45579 * linux/x32/syscallent.h: Likewise. 45580 * linux/x86_64/syscallent.h: Likewise. 45581 * linux/or1k/syscallent.h: Set number of readahead arguments to 4. 45582 * linux/sh/syscallent.h: Likewise. 45583 * linux/tile/syscallent.h: Likewise. 45584 * linux/xtensa/syscallent.h: Set number of readahead arguments to 5. 45585 45586 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 45587 45588 linux/syscall.h: make subcall decoding configuration more readable. 45589 * linux/syscall.h: Inverse and sort the subcall ifdef, 45590 add a comment why subcall decoding support is not enabled 45591 on some architectures. 45592 45593 2013-05-06 Chris Zankel <chris (a] zankel.net> 45594 45595 xtensa: disable socket and ipc subcall support. 45596 The Xtensa architecture also uses dedicated syscalls and doesn't 45597 need to multiplex ipc and socket subcalls. 45598 45599 * linux/syscall.h [XTENSA]: Do not define SYS_socket_subcall and 45600 SYS_ipc_subcall. 45601 45602 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 45603 45604 Fix syscall flags. 45605 * linux/aarch64/syscallent1.h: Fix syscall flags for send. 45606 * linux/alpha/syscallent.h: Fix syscall flags for fchdir, getcwd, 45607 oldumount, sigaltstack, umount, uselib, and utimes. 45608 * linux/arm/syscallent.h: Fix syscall flags for close, creat, dup, dup2, 45609 fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, flock, 45610 fsetxattr, fsync, getdents, getdents64, ioctl, oldfstat, oldselect, 45611 open, pipe, poll, pread, pwrite, read, readahead, readdir, readv, 45612 select, socketcall, write, and writev. 45613 * linux/avr32/syscallent.h: Fix syscall flags for inotify_init and 45614 unshare. 45615 * linux/bfin/syscallent.h: Fix syscall flags for pread64 and pwrite64. 45616 * linux/hppa/syscallent.h: Fix syscall flags for fchdir, flistxattr, 45617 getcwd, pause, signal, umount2, uselib, utime, and vfork. 45618 * linux/ia64/syscallent.h: Fix syscall flags for creat, fchdir, 45619 lstat, umount, uselib, and utimes. Fix syscall handlers for 45620 fgetxattr, flistxattr, fremovexattr, and fsetxattr. 45621 * linux/m68k/syscallent.h: Fix syscall flags for close, creat, dup, 45622 dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, 45623 flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, open, pipe, 45624 poll, pread64, pwrite64, read, readahead, readdir, readv, select, 45625 socketcall, write, and writev. 45626 * linux/metag/syscallent.h: Fix syscall flags for fanotify_init, 45627 prlimit64, process_vm_readv, process_vm_writev, and quotactl. 45628 * linux/microblaze/syscallent.h: Fix syscall flags for close, creat, 45629 dup, dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, 45630 fdatasync, flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, 45631 open, perf_event_open, pipe, poll, pread64, pwrite64, read, readahead, 45632 readdir, readv, select, socketcall, write, and writev. 45633 * linux/mips/syscallent.h: Fix syscall flags for close, creat, dup, 45634 dup2, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, flock, 45635 fsetxattr, getdents, getdents64, getxattr, ioctl, lgetxattr, 45636 listxattr, llistxattr, lremovexattr, lsetxattr, oldfstat, open, pipe, 45637 pivot_root, poll, pread, pwrite, read, readahead, readv, removexattr, 45638 select, setxattr, socketcall, statfs, write, and writev. 45639 * linux/or1k/syscallent.h: Fix syscall flags for fchdir and quotactl. 45640 * linux/powerpc/syscallent.h: Fix syscall flags for fchdir. 45641 * linux/sh/syscallent.h: Fix syscall flags for getcwd. 45642 * linux/sparc/syscallent.h: Fix syscall flags for getresgid, getresuid, 45643 setresgid, setresgid32, and setresuid. 45644 * linux/xtensa/syscallent.h: Fix syscall flags for close, creat, dup, 45645 dup2, fallocate, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, 45646 flock, fsetxattr, fstatfs, fstatfs64, fsync, getdents, getdents64, 45647 ioctl, open, pipe, pivot_root, poll, pread64, pwrite64, read, 45648 readahead, readv, rt_sigreturn, select, setfsgid, setfsuid, setuid, 45649 swapoff, times, utime, write, and writev. 45650 45651 tests/stat: enhance regexps. 45652 * tests/stat: Enhance regexps that check tracing of stat/stat64 and 45653 fstatat/fstatat64 syscalls. 45654 45655 2013-05-06 Chris Metcalf <cmetcalf (a] tilera.com> 45656 45657 tests/stat: support fstatat syscall for stat() 45658 Newer Linux architectures don't support the stat/stat64 syscalls. 45659 Instead they use fstatat() with AT_FDCWD and an extra flags argument. 45660 Support seeing this output in the 'strace -efile' test. 45661 45662 As part of this change, use "grep -E -x" syntax consistently for 45663 all stat tests, since the number of \(foo\)\? expressions was becoming 45664 pretty unwieldy. 45665 45666 * tests/stat: Update stat/stat64 check regexp to handle architectures 45667 that use fstatat instead. Use "grep -E -x" syntax consistently. 45668 45669 2013-05-06 Dmitry V. Levin <ldv (a] altlinux.org> 45670 45671 ARM OABI: fix 64-bit arguments decoding. 45672 ARM OABI and ARM EABI have different function parameters passing rules, 45673 see commit v4.6-11-g7a5b08f for details. 45674 45675 * util.c (printllval): Do not align argument number in case of ARM OABI. 45676 * file.c (sys_fadvise64_64): Likewise. 45677 45678 2013-05-06 Mike Frysinger <vapier (a] gentoo.org> 45679 45680 printllval: fix 64bit unpacking on mips/o32 and xtensa. 45681 The mips/o32 ABI and xtensa arch also do 64bit aligning, so add it to the 45682 printllval list for this. 45683 45684 Normally for sys_fadvise64_64 we'd handle the same list of arches, but 45685 mips/o32 ABI is funky and doesn't shift -- it has 7 args. So just add 45686 xtensa to it. 45687 45688 * file.c (sys_fadvise64_64): Add XTENSA to the shifted list. 45689 * util.c (printllval): Add LINUX_MIPSO32 and XTENSA to the shifted list. 45690 45691 2013-05-06 Chris Metcalf <cmetcalf (a] tilera.com> 45692 45693 tile: disable socket and ipc subcall support. 45694 The tile arch just has the dedicated syscalls, so disable 45695 the logic for parsing subcalls. 45696 45697 * linux/syscall.h [TILE]: Do not define SYS_socket_subcall and 45698 SYS_ipc_subcall. 45699 45700 2013-05-06 Mike Frysinger <vapier (a] gentoo.org> 45701 45702 Blackfin: disable socketcall and ipc subcall support. 45703 The Blackfin arch does not have a socketcall or ipc subcall 45704 (it has dedicated syscalls broken out), so disable the logic for it. 45705 45706 * linux/syscall.h [BFIN]: Do not define SYS_socket_subcall and 45707 SYS_ipc_subcall. 45708 45709 2013-05-05 Mike Frysinger <vapier (a] gentoo.org> 45710 45711 s390: fix # of args truncate64/ftruncate64 takes. 45712 * linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64. 45713 45714 2013-05-05 Mike Frysinger <vapier (a] gentoo.org> 45715 45716 mtd: clamp ubi name strings. 45717 Since the length fields with the ubi volnames are signed 16bit values, 45718 make sure we clamp that number to the size of the buffer we've allocated 45719 on the stack to prevent buffer overflows. 45720 45721 * mtd.c (ubi_ioctl): Clamp length to string_quote to 0/UBI_MAX_VOLUME_NAME. 45722 Check the return of string_quote and tweak the output accordingly. 45723 45724 2013-05-04 Dmitry V. Levin <ldv (a] altlinux.org> 45725 45726 printxval: support more architectures. 45727 * configure.ac: Define SIZEOF_LONG_LONG. 45728 * util.c (printllval): Handle all architectures with sizeof(long) > 4 45729 and sizeof(long) == sizeof(long long). 45730 45731 2013-05-04 Mike Frysinger <vapier (a] gentoo.org> 45732 45733 Fix building for sparc64 targets. 45734 * util.c (printllval): Handle SPARC64 define. 45735 45736 Fix building for mips n64 targets. 45737 * util.c (printllval): Handle LINUX_MIPSN64 define. 45738 45739 2013-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 45740 45741 hppa: fix stat64 and fstat64 decoding. 45742 * file.c [HPPA]: Do not redefine stat64 to hpux_stat64. 45743 45744 arm, aarch64, ppc: fix printllval-based decoders. 45745 * util.c (printllval) [ARM || POWERPC]: Align argument number. 45746 [AARCH64]: Align argument number in 32bit mode. 45747 * file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed 45748 printllval workaround. 45749 [AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode. 45750 45751 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 45752 45753 Decode mtd/ubi ioctls. 45754 Been playing with UBI of late and it'd help if I could see what it was 45755 doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes 45756 a pointer to a 64bit value, not a strict. 45757 45758 * util.c (MAX, MIN): Move to ... 45759 * defs.h (MAX, MIN): ... here. 45760 (CLAMP): Define. 45761 (ubi_ioctl): New prototype. 45762 * ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'. 45763 * mtd.c: Include ubi user API header. 45764 (ubi_volume_types): New enum decode. 45765 (ubi_volume_props): Likewise. 45766 (ubi_ioctl): Define. 45767 * linux/ubi-user.h: Import from linux 3.8. 45768 45769 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 45770 45771 test: add mtd/ubi test helpers. 45772 I used these to develop the mtd/ubi ioctl decoders. 45773 45774 * test/.gitignore: Add mtd/ubi. 45775 * test/Makefile: Declare all tests in a PROGS var. 45776 Declare build targets .PHONY. 45777 (all): Depend on $(PROGS) instead of hardcoded list. 45778 (clean): Remove $(PROGS) instead of hardcoded list. 45779 * test/mtd.c: New file. 45780 * test/ubi.c: Likewise. 45781 45782 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 45783 45784 test: include headers for used funcs. 45785 These funcs use things like wait/write/read/strcmp but sometimes 45786 don't include the right header for them. 45787 45788 * test/Makefile: Add -Wall to CFLAGS. 45789 * test/clone.c: Include unistd.h. 45790 * test/fork.c: Include sys/wait.h. 45791 * test/sig.c: Include unistd.h. 45792 * test/sigkill_rain.c: Include sys/wait.h. 45793 * test/vfork.c: Include sys/wait.h. 45794 * test/wait_must_be_interruptible.c: Include string.h 45795 45796 2013-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 45797 45798 ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1. 45799 * linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and 45800 sys_lstat64 before redefining them to printargs. 45801 45802 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 45803 45804 2013-05-02 Mike Frysinger <vapier (a] gentoo.org> 45805 45806 tests: stat: fix clean up of sample file. 45807 * tests/stat: Also rm the sample file at the end of the test. 45808 45809 Ignore more files. 45810 * .gitignore: Add gdb related files. 45811 * tests/.gitignore: Ignore test logs. 45812 45813 2013-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 45814 45815 x32: fix decoding of i386 truncate and ftruncate syscalls. 45816 * linux/x32/syscallent1.h: Remove sys_*truncate64 redirections. 45817 45818 x32: fix printllval-based decoders of i386 syscalls. 45819 * util.c (printllval) [X32]: Handle i386 personality. 45820 45821 tests: add basic test for ftruncate, lseek and stat family syscalls. 45822 * tests/stat: New test. 45823 * tests/Makefile.am (TESTS): Add stat. 45824 45825 2013-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 45826 45827 x32: fix build regressions introduced by commit v4.7-96-g8435d67. 45828 * desc.c (printflock) [X32]: Add special handling required for 45829 this architecture with sizeof(long) < sizeof(off_t). 45830 * file.c [X32] (struct stat64): Add __attribute__((packed)). 45831 [X32] (HAVE_STAT64): Define. 45832 (printstat) [X32]: Redirect to printstat64. 45833 (printstat64) [X32]: Use "struct stat" instead of "struct stat64". 45834 [X32] (realprintstat64): Rename to printstat64_x32. 45835 (sys_stat64, sys_fstat64) [X32]: Remove second definitions of these 45836 functions. Call printstat64_x32 instead of printstat64 45837 * linux/x32/syscallent.h: Fix handlers for truncate and ftruncate. 45838 45839 Alias sys_*lstat* syscall printing functions. 45840 * file.c (sys_lstat, sys_lstat64, sys_oldlstat): Remove. 45841 * linux/dummy.h: Move !HAVE_STRUCT___OLD_KERNEL_STAT aliases forward. 45842 (sys_lstat): Alias to sys_stat. 45843 (sys_lstat64): Alias to sys_stat64. 45844 (sys_oldlstat): Alias to sys_oldstat. 45845 * linux/syscall.h (sys_lstat, sys_lstat64, sys_oldlstat): Remove. 45846 * linux/x32/syscallent1.h (sys_lstat64): Remove. 45847 45848 x86_64: decode __old_kernel_stat based syscalls. 45849 * linux/x86_64/syscallent1.h: Remove sys_old*stat redirections. 45850 45851 x32: fix decoding of __old_kernel_stat based syscalls. 45852 * file.c [X32] (struct __old_kernel_stat): Define. 45853 * linux/x32/syscallent1.h: Remove sys_old*stat redirections. 45854 45855 2013-05-01 James Hogan <james.hogan (a] imgtec.com> 45856 45857 test/threaded_execve: fix on metag. 45858 The metag ABI has stacks growing upwards so clone expects the stack 45859 argument to point at the bottom of the stack instead of the top. 45860 45861 * test/threaded_execve.c [__metag__]: Define clone2 differently 45862 to avoid a segfault at runtime. 45863 45864 2013-05-01 James Hogan <james.hogan (a] imgtec.com> 45865 45866 test/skodic: make a bit more portable. 45867 * test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses 45868 vary between architectures (as far as I can tell the use of MAP_FIXED is 45869 not relevant to the test). Also don't assume the file desriptor returned 45870 by open call is 3 when passing it to mmap. 45871 45872 2013-05-01 Mike Frysinger <vapier (a] gentoo.org> 45873 45874 printllval: handle s390x. 45875 This is a 64bit arch w/no personalities, so fix printing. 45876 It can now trace a simple call like readahead: 45877 $ cat test.c 45878 main(){readahead(-1, (unsigned long long)1 << 50, 0);} 45879 $ gcc test.c 45880 $ ./strace -ereadahead ./a.out 45881 readahead(-1, 1125899906842624, 0) = -1 EBADF (Bad file descriptor) 45882 45883 * util.c (printllval): Handle S390X define. 45884 45885 2013-05-01 Mike Frysinger <vapier (a] gentoo.org> 45886 45887 Stop using old AM_CONFIG_HEADER macro. 45888 Building with automake-1.13 throws an error: 45889 configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete. 45890 You should use the 'AC_CONFIG_HEADERS' macro instead. 45891 45892 * configure.ac (AM_CONFIG_HEADER): Rename to AC_CONFIG_HEADERS. 45893 45894 2013-04-30 Dmitry V. Levin <ldv (a] altlinux.org> 45895 45896 build: introduce git-version-gen. 45897 * .gitignore: Add .version. 45898 * Makefile.am (EXTRA_DIST, BUILT_SOURCES): Add $(srcdir)/.version. 45899 Add rules to check NEWS, generate $(srcdir)/.version and 45900 $(distdir)/.tarball-version files. 45901 Change ChangeLog and CREDITS generation rules to depend on 45902 $(srcdir)/.version instead of $(srcdir)/.git/refs/heads/*. 45903 * NEWS: Add dates to recent releases. 45904 * configure.ac (AC_INIT): Use git-version-gen. 45905 (AM_INIT_AUTOMAKE): Remove check-news. 45906 * git-version-gen: Import from gnulib. 45907 * make-dist: Check NEWS. 45908 45909 Makefile.am: sort long lists to ease maintenance. 45910 * Makefile.am (strace_SOURCES, EXTRA_DIST): Sort, place one list element 45911 per line. 45912 45913 build: fix "make dist" regression introduced by commit v4.7-105-g7270de5 45914 * Makefile.am (EXTRA_DIST): Remove linux/arm/syscallent1.h, 45915 linux/arm/signalent1.h, linux/arm/ioctlent1.h and linux/arm/errnoent1.h. 45916 45917 build: fix "make dist" regression introduced by commit v4.7-29-g17e3860. 45918 * Makefile.am (EXTRA_DIST): Add linux/ioctlent-filter.awk. 45919 45920 2013-04-30 Mike Frysinger <vapier (a] gentoo.org> 45921 45922 Blackfin: tweak sram_alloc syscall decode. 45923 * system.c (sys_sram_alloc): The 2nd argument of sram_alloc syscall 45924 is a bit field, not a specific value, so decode it as such. 45925 45926 2013-03-31 Zev Weiss <zev (a] bewilderbeest.net> 45927 45928 Print io_submit() offsets in decimal. 45929 This makes output formatting more consistent with pread()/pwrite(), 45930 which print their offset parameters in decimal. 45931 45932 * desc.c (sys_io_submit): Change offset output format from %llx to %lld. 45933 45934 2013-03-30 Andreas Schwab <schwab (a] suse.de> 45935 45936 Fix building outside source directory. 45937 The file linux/ioctlent.h is generated in the build directory, so 45938 "../ioctlent.h" won't find it. 45939 45940 * linux/aarch64/ioctlent1.h: Remove "../" from include file name. 45941 * linux/powerpc/ioctlent1.h: Likewise. 45942 * linux/tile/ioctlent1.h: Likewise. 45943 * linux/x32/ioctlent1.h: Likewise. 45944 * linux/x86_64/ioctlent1.h: Likewise. 45945 * linux/x86_64/ioctlent2.h: Likewise. 45946 45947 2013-03-30 Andreas Schwab <schwab (a] suse.de> 45948 45949 AArch64: Fix printing of long long value. 45950 * util.c (printllval): Fix printing of long long values on 45951 AArch64. 45952 45953 2013-03-27 Dmitry V. Levin <ldv (a] altlinux.org> 45954 45955 Update PR_* constants. 45956 * process.c (prctl_options): Add more PR_* constants from linux/prctl.h. 45957 45958 2013-03-25 Chris Zankel <chris (a] zankel.net> 45959 45960 Add support for the XTENSA architecture. 45961 * configure.ac: Add XTENSA to the list of supported architectures. 45962 * defs.h: Add XTENSA support. 45963 * linux/xtensa/syscallent.h: New file. 45964 * linux/xtensa/ioctlent.h.in: Likewise. 45965 * process.c (struct_user_offsets): Add XTENSA support. 45966 * signal.c (sys_sigreturn): Likewise. 45967 * syscall.c (printcall, get_scno, get_syscall_args, 45968 get_syscall_result, get_error): Likewise. 45969 * util.c (change_syscall): Likewise. 45970 45971 2013-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 45972 45973 Add example script which builds static (possibly cross-compiled) strace. 45974 45975 2013-03-21 Dmitry V. Levin <ldv (a] altlinux.org> 45976 45977 Use 64-bit versions of stat, readdir and setrlimit functions when available 45978 strace already has a mechanism to use fopen64 for output when the 64-bit 45979 version of fopen is available on 32-bit architectures. Apply this 45980 mechanism for other three functions to make strace fully adopted for 45981 64-bit types. 45982 45983 * strace.c (struct_stat, stat_file, struct_dirent, read_dir, 45984 struct_rlimit, set_rlimit): New macros. 45985 (startup_attach): Use read_dir. 45986 (startup_child): Use struct_stat and stat_file. 45987 (main): Use struct_rlimit and set_rlimit. 45988 45989 2013-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 45990 45991 Do not use struct dirent in readdir decoding. 45992 struct dirent from libc should not be used for umove'ing into because it 45993 contains fixed size d_name. 45994 45995 * file.c (printdir): Rename to print_old_dirent. 45996 [SH64]: Decode using struct kernel_dirent. 45997 [!SH64]: Decode using an open-coded struct with 32-bit d_ino and d_off. 45998 (sys_readdir): Update. 45999 46000 2013-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 46001 46002 Do not use off_t in sendfile decoding. 46003 sendfile parser used to decode off_t* parameter as a pointer to host 46004 off_t type. With this change, it is decoded as a pointer to target long 46005 type. 46006 46007 * io.c (print_off_t): New function. 46008 (sys_sendfile): Use it. 46009 * linux/aarch64/syscallent1.h: Use sys_sendfile64 for sendfile decoding. 46010 * linux/tile/syscallent.h: Likewise. 46011 * linux/x32/syscallent.h: Likewise. 46012 * linux/x86_64/syscallent.h: Likewise. 46013 * linux/hppa/syscallent.h: Use sys_sendfile64 for sendfile64 decoding. 46014 * linux/metag/syscallent.h: Correct sendfile syscall name. 46015 * linux/or1k/syscallent.h: Likewise. 46016 46017 2013-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 46018 46019 Fix build with older versions of libaio.h. 46020 * configure.ac: When libaio.h is available, check for 46021 struct iocb.u.c.flags, IO_CMD_PWRITE and IO_CMD_PWRITEV. 46022 * desc.c (print_common_flags): Check for HAVE_STRUCT_IOCB_U_C_FLAGS. 46023 (sys_io_submit): Check for HAVE_DECL_IO_CMD_PWRITE and 46024 HAVE_DECL_IO_CMD_PWRITEV. 46025 46026 Fix io_submit decoding. 46027 * desc.c (print_common_flags, sys_io_submit): Add missing ", " to 46028 SUB_COMMON output, remove extra ", " from SUB_VECTOR output. 46029 46030 2013-03-18 Maxin B. John <maxin.john (a] enea.com> 46031 46032 tests: relax check_prog to allow timeout command provided by busybox. 46033 Busybox version of timeout doesn't have --version option. 46034 Relax check_prog to handle those cases. 46035 46036 * tests/init.sh (check_prog): Use type builtin to check program 46037 availability. 46038 46039 2013-03-18 Dmitry V. Levin <ldv (a] altlinux.org> 46040 46041 Reorganize get_regs code, hopefully without functional changes. 46042 * syscall.c [I386 || ARM || OR1K || METAG] (ARCH_REGS_FOR_GETREGSET): 46043 New macro. 46044 (get_regset): Implement for AARCH64, METAG, OR1K and X32. 46045 (get_regs) [AARCH64 || METAG || OR1K || X32]: Use it. 46046 46047 arm, i386: use PTRACE_GETREGSET if available. 46048 * syscall.c [ARM || I386 || X86_64] (get_regset): New function. 46049 (get_regs) [ARM || I386 || X86_64]: Use it. 46050 46051 Include <sys/uio.h> and <elf.h> on all architectures. 46052 * syscall.c: Include <sys/uio.h> and <elf.h> on all architectures. 46053 46054 x86-64: enhance PTRACE_GETREGSET test. 46055 * syscall.c (get_regs) [X86_64]: Check whether PTRACE_GETREGSET 46056 works regardless of the kernel version. 46057 46058 x32: use PTRACE_GETREGSET unconditionally. 46059 * syscall.c (get_regs) [X32]: Assume that PTRACE_GETREGSET always works 46060 regardless of the kernel version. 46061 46062 x86-64, x32: do not include linux/ptrace.h unnecessarily. 46063 * syscall.c [X86_64 || X32]: Stop including linux/ptrace.h. 46064 46065 i386, tile, x32: do not redefine ptrace prototype. 46066 * defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h. 46067 46068 ptrace: decode note segment descriptor types. 46069 * configure.ac (AC_CHECK_HEADERS): Add elf.h. 46070 * process.c: Include elf.h. 46071 (nt_descriptor_types): New xlat structure. 46072 (sys_ptrace): Use it. 46073 46074 2013-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 46075 46076 Update MADV_* constants. 46077 * mem.c (madvise_cmds): Add more MADV_* constants from 46078 asm-generic/mman-common.h 46079 46080 Reported-by: Robin Hack <hack.robin (a] gmail.com> 46081 46082 2013-03-07 Denys Vlasenko <vda.linux (a] googlemail.com> 46083 46084 Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers() 46085 count_syscall() was calling setitimer/getitimer once in order to find 46086 smallest "tick" OS uses in time accounting, in order to use it 46087 for syscalls which apparently spent less than that time in syscall. 46088 The code assumed that this "tick" is not zero... but it is zero 46089 on linux-3.6.11. Which means that this hack doesn't work... 46090 46091 At least this change prevents this measurement from being done 46092 _repeatedly_, by initializing one_tick to -1, not 0. 46093 46094 While at it, added comments in count_syscall() explaining what we are doing. 46095 46096 Optimized call_summary_pers() a bit, by eliminating redundant tv -> float 46097 conversions, and prevented 0.0/0.0 which was resulting in "% time" 46098 being shown as "-nan" if total CPU time spent was 0.000000 46099 (try "strace -c /bin/true"). 46100 46101 The code seems to seriously underestimate CPU usage: 46102 "strace -c ls -lR /usr/share >/dev/null" shows total time spent 46103 in syscalls to be only ~10..20% of what "time ls -lR /usr/share >/dev/null" 46104 shows. 46105 46106 It might be useful to have a mode where we show wall clock time 46107 spent in syscalls, not CPU time. It might also be more accurate. 46108 46109 text data bss dec hex filename 46110 245019 676 5708 251403 3d60b strace_old 46111 244923 684 5676 251283 3d593 strace 46112 46113 2013-03-06 Denys Vlasenko <vda.linux (a] googlemail.com> 46114 46115 Open-code isprint(c) and isspace(c) 46116 We don't call setlocale, thus we always use C locale. 46117 But libc supports various other locales, and therefore 46118 its ctype interface is general and at times inefficient. 46119 For example, in glibc these macros result in function call, 46120 whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e 46121 suffices. 46122 46123 By open-coding ctype checks (we have only 4 of them) 46124 we avoid function calls, we get smaller code: 46125 46126 text data bss dec hex filename 46127 245127 680 5708 251515 3d67b strace_old 46128 245019 676 5708 251403 3d60b strace 46129 46130 and we don't link in ctype tables (beneficial for static builds). 46131 46132 2013-03-06 Denys Vlasenko <vda.linux (a] googlemail.com> 46133 46134 Makefile: add commented-out tweak to generate link map. 46135 46136 Stop using a large static buffer in getfdpath. 46137 text data bss dec hex filename 46138 245075 680 9836 255591 3e667 strace_old 46139 245143 680 5708 251531 3d68b strace 46140 46141 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 46142 46143 Fix wrongly indented closing curly brace. No code changes. 46144 46145 strace_vfprintf: if malloc fails, exit gracefully. 46146 46147 2013-03-05 Dmitry V. Levin <ldv (a] altlinux.org> 46148 46149 Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFT. 46150 PAGE_SHIFT couldn't be reliably obtained at compile time, 46151 thanks to Chris Metcalf for the hint. 46152 46153 * mem.c: Do not include <sys/user.h>. 46154 [SH64] Do not include <asm/page.h>. 46155 (get_pagesize): New function. 46156 (sys_mmap_pgoff, sys_old_mmap_pgoff): Use it. 46157 46158 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 46159 46160 Emit better message for ERESTARTNOHAND return. 46161 46162 Disable STREAMS syscalls for non-SPARC. 46163 text data bss dec hex filename 46164 3002 0 1024 4026 fba stream.o.old 46165 1729 0 1024 2753 ac1 stream.o 46166 46167 Fix printstrbufarg's address argument to be long, not int. 46168 46169 Remove variable tracing_paths and check in pathtrace_match. 46170 46171 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 46172 46173 Use dynamically-sized selected[] array for -P PATH. 46174 While at it, added a small optimization of not remembering 46175 the path twice if it happens to be the same. 46176 46177 text data bss dec hex filename 46178 245111 680 10860 256651 3ea8b strace_old 46179 245075 680 9804 255559 3e647 strace 46180 46181 2013-03-05 Denys Vlasenko <vda.linux (a] googlemail.com> 46182 46183 metag,or1k: whitesace style fix. no code changes. 46184 46185 Assorted fixes to syscallent.h. 46186 or1k was missing TM on many memory-related syscalls 46187 sys_lookup_dcookie is 3-arg on 64-bit arches, and isn't TF 46188 sys_recvmsg is 3-arg on all arches 46189 sys_nfsservctl is 3-arg on all arches 46190 sys_timerfd_create is 2-arg on all arches 46191 sys_[f]truncate64 is 4-arg or 3-arg, never 5-arg 46192 truncate64 is TF 46193 sys_[l]lseek is TD 46194 fstat[64] is TD 46195 46196 2013-03-05 James Hogan <james.hogan (a] imgtec.com> 46197 46198 Add support for Imagination Technologies Meta. 46199 Add support for Imagination Technologies Meta architecture (the 46200 architecture/ABI is usually referred to as metag in code). The Meta 46201 Linux kernel port is in the process of being upstreamed for v3.9 so it 46202 uses generic system call numbers. 46203 46204 sys_lookup_dcookie writes a filename to buffer argument, so I've set 46205 TF flag. 46206 nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h 46207 so I've left it blank. 46208 truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit 46209 args which are packed tightly on metag, so less arguments on metag. 46210 fchdir/llseek takes a file descriptor so s/TF/TD/ 46211 sync_file_range has 2 64bit args so uses 6 args, so s/4/6/ 46212 timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/ 46213 shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args. 46214 oldgetrlimit is just getrlimit for metag. 46215 add TM flag to various memory syscalls. 46216 metag doesn't directly use sys_mmap_pgoff for mmap2. 46217 prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag. 46218 fanotify_init doesn't appear to take a file descriptor so remove TD. 46219 Add kcmp syscall. 46220 46221 Cc: Christian Svensson <blue (a] cmd.nu> 46222 46223 2013-03-01 Denys Vlasenko <vda.linux (a] googlemail.com> 46224 46225 umovestr: speed up check for NUL byte in the fetched word. 46226 46227 2013-03-01 Dmitry V. Levin <ldv (a] altlinux.org> 46228 46229 Fix trace=set regression introduced by commit v4.7-111-g9cbc15b. 46230 * syscall.c (qual_syscall, qualify): Pass personality down to 46231 qualify_one. 46232 * tests/qual_syscall: New test. 46233 * tests/Makefile.am (TESTS): Add qual_syscall. 46234 46235 2013-03-01 Chris Metcalf <cmetcalf (a] tilera.com> 46236 46237 tile: handle printllval like x86_64 or powerpc64. 46238 Without this fix the tilegx build fails when it hits the new #error 46239 about SIZEOF_LONG > 4. 46240 46241 * util.c (printllval): Fix printing of long long values on TILE. 46242 46243 2013-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 46244 46245 Make -b take SYSCALL param, document it in --help and in manpage. 46246 To not waste an option letter for just one trick, 46247 extend -b to take a parameter: 46248 "on which syscalls do you want to detach?". 46249 Currently supports only execve. 46250 46251 While at it, fixed (by removing non-Linux and stale info) 46252 and extended manpage text about -f. 46253 46254 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 46255 46256 Cleanup umoven and umovestr. 46257 Cleanup sloppy error handling. 46258 46259 First, EFAULT kind of errors from process_vm_readv by itself is not 46260 something unusual, so a warning message will not be issued unless a 46261 short read is detected. 46262 46263 Second, clients of umoven and umovestr are not prepared to detect and 46264 handle short reads that can happen in these functions. The most safe 46265 way to handle them is to return an error code. 46266 46267 * util.c (umoven, umovestr): Cleanup handling of errors coming from 46268 process_vm_readv and PTRACE_PEEKDATA. 46269 46270 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 46271 46272 pathtrace: fix umovestr return code check. 46273 * pathtrace.c (upathmatch): Only NUL-terminated strings can be 46274 path-matched, so fix the umovestr return code check to filter out 46275 unsuitable strings. 46276 46277 2013-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 46278 46279 Fix compilation errors uncovered by -Werror=enum-compare. 46280 This fixes regression introduced by commit v4.7-111-g9cbc15b. 46281 46282 * syscall.c: Merge all nsyscalls* enums into single enum. 46283 Likewise merge nerrnos*, nsignals*, and nioctlents* into single enums. 46284 46285 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 46286 46287 Mass replace error_msg("%s", "literal") -> error_msg("literal") 46288 There is no need to print literal strings through "%s". 46289 Only untrusted strings such as filenames need that. 46290 46291 2013-02-26 Ben Noordhuis <info (a] bnoordhuis.nl> 46292 46293 Make umoven report success as 0, not >=0, stop returning success on partial reads 46294 umoven() uses process_vm_readv() when available but it returns the 46295 return value of that syscall, which is the number of bytes copied, 46296 while its callers expect it to simply return zero on success. 46297 46298 It was causing syscalls that take a user-space argument to print 46299 the abbreviated version, e.g.: 46300 46301 epoll_ctl(5, EPOLL_CTL_ADD, 10, {...}) 46302 46303 Instead of: 46304 46305 epoll_ctl(5, EPOLL_CTL_ADD, 10, {EPOLLIN, {u32=10, u64=10}}) 46306 46307 * util.c (umoven): Make umove[n] report success as 0, not >=0, 46308 stop returning "success" on partial reads. 46309 46310 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 46311 46312 Assorted NOMMU fixes. 46313 With -D, strdup'ing of pathname is necessary only on NOMMU. 46314 46315 Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode 46316 (try "strace [-D] -b env echo HI" to see whether we detach on correct execve). 46317 46318 Fix test_ptrace_FOO shortcuts on NOMMU to always assume success 46319 and _properly_ set all variables. 46320 46321 2013-02-26 Denys Vlasenko <vda.linux (a] googlemail.com> 46322 46323 Shorten help text - no need to show deprecated option -F. 46324 46325 2013-02-23 Denys Vlasenko <vda.linux (a] googlemail.com> 46326 46327 Merge adjacent tprint's. 46328 46329 Correct i > MAX_NSYSCALLS commparison: should be i >= MAX_NSYSCALLS. 46330 46331 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 46332 46333 Fix wrong offset display in dumpstr. 46334 BTW, the new code from prev commit is 5 times faster 46335 than old one :) 46336 46337 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 46338 46339 Fix a bug in dumpstr (no null termination). Essentially rewrote dumpstr. 46340 This is a 14 year old bug (!). 46341 46342 It wasn't biting us merely because outstr[80] was static, thus ended up 46343 in bss and whatever was after it "accidentally" provided the NUL byte. 46344 When dumpstr was changed to use on-stack buffer, the bug reared its ugly head. 46345 46346 This is a rewrite which is smaller and should be significantly faster 46347 for _long_ strings. 46348 46349 text data bss dec hex filename 46350 244627 680 10860 256167 3e8a7 strace.t9/strace 46351 244563 680 10860 256103 3e867 strace.ta/strace 46352 46353 * util.c (dumpstr): Rewrite to be faster and smaller. 46354 46355 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 46356 46357 Eliminate MAX_QUALS, make qualifier array dynamic. 46358 MAX_QUALS was 2048, even though most arches used less than 500 entries 46359 in it. MAX_QUALS had to be maintained by hand to be higher than syscall 46360 count. It also limited the highest possible fd to track. 46361 46362 This change makes qual_flagsN[] arrays start sized to the required minimum 46363 (number of syscalls) and grow dynamically if user requested 46364 -e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit 46365 can be raised with no cost for normal strace invocations. 46366 46367 qual_flags is now a define to qual_vec[current_personality]. 46368 46369 As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent 46370 names in one-personality arches to their corresponding <foo>0 arrays, 46371 removing one indirection level. 46372 46373 text data bss dec hex filename 46374 244471 700 12928 258099 3f033 strace.t7/strace 46375 244627 680 10860 256167 3e8a7 strace.t8/strace 46376 46377 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 46378 46379 Create and use struct_sysent and struct_ioctlent typedefs. 46380 This is a preparatory mass replace patch with no code changes. 46381 46382 The future change will need to typedef sysent to sysent0, 46383 which results in compile failures when "struct sysent" string 46384 gets mangled into "struct sysent0". 46385 46386 2013-02-22 Denys Vlasenko <vda.linux (a] googlemail.com> 46387 46388 Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev() 46389 We have hundreds of uses of these macros. 46390 Result is more efficient and 1.1 kbyte shorter code: 46391 46392 text data bss dec hex filename 46393 245579 700 12928 259207 3f487 strace.t5/strace 46394 244471 700 12928 258099 3f033 strace.t6/strace 46395 46396 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 46397 46398 Remove unused QUAL_FAULT code (was used by non-Linux code only). 46399 46400 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 46401 46402 Use uint8_t for qual_flags[] instead of ints. 46403 Resulting bss reduction is ~6kbytes: 46404 46405 text data bss dec hex filename 46406 245703 700 19072 265475 40d03 strace.t4/strace 46407 245687 700 12928 259315 3f4f3 strace.t5/strace 46408 46409 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 46410 46411 Eliminate many SCNO_IS_VALID checks. 46412 By adding tcp->s_ent pointer tot syscall table entry, 46413 we can replace sysent[tcp->scno] references by tcp->s_ent. 46414 More importantly, we may ensure that tcp->s_ent is always valid, 46415 regardless of tcp->scno value. This allows us to drop 46416 SCNO_IS_VALID(tcp->scno) checks before we access syscall 46417 table entry. 46418 46419 We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks 46420 with a similar technique. 46421 46422 Resulting code shrink: 46423 text data bss dec hex filename 46424 245975 700 19072 265747 40e13 strace.t3/strace 46425 245703 700 19072 265475 40d03 strace.t4/strace 46426 46427 * count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check. 46428 * defs.h: Add "int qual_flg" and "const struct sysent *s_ent" 46429 to struct tcb. Remove "int u_nargs" from it. 46430 Add UNDEFINED_SCNO constant which will mark undefined scnos 46431 in tcp->qual_flg. 46432 * pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check. 46433 Use tcp->s_ent instead of sysent[tcp->scno]. 46434 * process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs. 46435 (sys_waitid): Likewise. 46436 * strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS 46437 constant is consistent with init code. 46438 * syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs 46439 instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent. 46440 (decode_ipc_subcall): Likewise. 46441 (printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs. 46442 (printargs_lu): Likewise. 46443 (printargs_ld): Likewise. 46444 (get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check. 46445 If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values. 46446 (internal_fork): Use tcp->s_ent instead of sysent[tcp->scno]. 46447 (syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check. 46448 Use tcp->s_ent instead of sysent[tcp->scno]. 46449 (get_syscall_args): Likewise. 46450 (get_error): Drop SCNO_IS_VALID check where it is redundant. 46451 (dumpio): Drop SCNO_IS_VALID check where it is redundant. 46452 Use tcp->s_ent instead of sysent[tcp->scno]. 46453 (trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead 46454 of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno]. 46455 Drop SCNO_IS_VALID check where it is redundant. 46456 Print undefined syscall name with undefined_scno_name(tcp). 46457 (trace_syscall_exiting): Likewise. 46458 * util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno]. 46459 46460 2013-02-21 Denys Vlasenko <vda.linux (a] googlemail.com> 46461 46462 ARM: make it one-personality arch. 46463 ARM in fact _is_ one personality. 46464 46465 We had two personalities for it because it has a handful of 46466 syscalls with huge scnos (0x000f00xx). 46467 46468 Extending syscall table to have [0x000f0005] index is of course 46469 not a good idea. 46470 46471 Someone decided to handle that by having a separate personality 46472 just for these syscalls. 46473 46474 But multi-personality arch does a bit more work in other parts. 46475 46476 This patch is another alternative: "move" 0x000f00nn syscalls 46477 down to the entries just above last ordinary syscall, 46478 by manipulating scno if it falls into the 0x000f00xx range. 46479 46480 In order to not worsen genuine undefined scnos' printing, 46481 the code remaps scno back to actual value before printing 46482 "syscall_NNN" string. 46483 46484 * defs.h: Remove multi-reprsonality defines from ARM. 46485 * syscall.c (shuffle_scno): New function. 46486 (undefined_scno_name): New function. 46487 (get_scno): [ARM] Replace personality setting with scno shuffling. 46488 (trace_syscall_entering): Print unknown syscall name using 46489 undefined_scno_name(). 46490 (trace_syscall_exiting): Likewise. 46491 * linux/arm/syscallent.h: Add ARM specific syscalls at the end. 46492 * linux/arm/errnoent1.h: Deleted. 46493 * linux/arm/ioctlent1.h: Deleted. 46494 * linux/arm/signalent1.h: Deleted. 46495 * linux/arm/syscallent1.h: Deleted. 46496 46497 2013-02-20 Denys Vlasenko <vda.linux (a] googlemail.com> 46498 46499 arm: shorten syscall table for EABI - no point in storing NULL entries. 46500 Also, reformatted ARM code in get_scno(), mostly improved comments, 46501 without code changes. 46502 46503 Use the same style of includes in linux/*/* files. 46504 While at it, fix some comments which say 46505 "we use i386 syscalls/ioctls/errnos" but in reality 46506 common ones are used. 46507 46508 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 46509 46510 Fix compiler warnings. 46511 With constant current_wordsize == 4 and 32-bit longs, 46512 gcc was spooked by "1ul << (8 * current_wordsize)" = "1ul << 32". 46513 46514 Make such places conditional on SIZEOF_LONG > 4. 46515 46516 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 46517 46518 Improve comment text. No code changes. 46519 46520 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 46521 46522 Fix NOMMU + daemonized tracer SEGV. 46523 pathname[] was getting destroyed, execve of garbage pathname 46524 failing, and to top it off, the tracer's stack was also 46525 smashed and trecer segfaulted. 46526 46527 * strace.c (exec_or_die): New function. 46528 (startup_child): Don't use pathname[] contents after vfork, 46529 make a malloced copy instead. Explain "NOMMU + -D bug" 46530 and how we work around it. 46531 46532 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 46533 46534 Make it possible to to do test builds for NOMMU architectures. 46535 And while using it, I discovered that -D doesn't work too well 46536 on NOMMU. Added a comment about it. 46537 46538 2013-02-19 Denys Vlasenko <vda.linux (a] googlemail.com> 46539 46540 Clean up mmap decoding. 46541 Previous code merges too many similar, but different ways 46542 of decoding mmap. For example, sys_old_mmap is "params in memory" 46543 API... except SH[64], where it is "params in regs", 46544 i.e. what sys_mmap ("new mmap") function does on other arches! 46545 46546 It's much simpler when every mmap handler has same API regardless 46547 of arch. Where API means whether params are in regs or in memory, 46548 and whether offset is in bytes, pages, or 4k blocks. 46549 46550 Then we just insert correct function pointers into 46551 arch syscall tables. 46552 46553 It turns out there are four common mmap APIs over 46554 all architectures which exist in Linux kernel, 46555 and one outlier for S390. 46556 46557 A number of mmap decoders were plain wrong in arch tables. 46558 For example, BFIN has no old_mmap. It returns ENOSYS. 46559 I checked kernel sources for all arches nad fixed the tables. 46560 46561 There was dead code for x86_64 for old_mmap: 46562 x86_64 has no old_mmap. 46563 46564 * mem.c: Refactor mmap functions so that we have five mmap syscall 46565 handlers, each with the fixed API (not varying by arch). 46566 * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks. 46567 * linux/syscall.h: Declare new mmap syscall handler functions. 46568 * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff. 46569 * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff. 46570 * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff. 46571 * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff. 46572 * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff. 46573 * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff. 46574 * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff. 46575 * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff. 46576 * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff. 46577 * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff. 46578 * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff. 46579 * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff. 46580 * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg. 46581 * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff. 46582 * linux/sh64/syscallent.h: Likewise. 46583 * linux/sparc/syscallent1.h: mmap is TD|TM. 46584 * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff. 46585 46586 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 46587 46588 Remove unused function sys_mmap64. 46589 No wonder that it is unused. 46590 It's code looked quite questionable. 46591 46592 * mem.c (sys_mmap64): Remove this function. 46593 46594 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 46595 46596 Remove code which supports systems with long long off_t. 46597 While looking at mmap mess, did experimenting in order 46598 to figure out what gets used when. 46599 46600 Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686, 46601 x86_64 and none of they have long long off_t, 46602 which isn't suprprising: we aren't using glibc defines 46603 which enable that. 46604 46605 Moreover, we SHOULD NOT use off_t in syscall decode! 46606 Its size depends on libc, not on arch! I.e. it is essentially 46607 unpredictable and can even in theory vary on the same arch 46608 with different libc. 46609 46610 We should use longs or long longs, in a way which matches 46611 architectural ABI for the given syscall. There are usually 46612 *at most* two permutations, no need to add yet another variable 46613 (sizeof(off_t)) to the mix. 46614 46615 This change removes almost all HAVE_LONG_LONG_OFF_T conditionals, 46616 which will reveal further possible simplifications. 46617 46618 * mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. 46619 As a result, never remap sys_mmap64 to sys_mmap. 46620 (print_mmap): Compile unconditionally. 46621 (sys_old_mmap): Compile unconditionally. 46622 (sys_mmap): Compile unconditionally. 46623 * io.c (sys_sendfile): Add a FIXME comment. 46624 * file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. 46625 As a result, never remap sys_*stat64 to sys_*stat etc. 46626 (sys_truncate): Compile unconditionally. 46627 (realprintstat): Likewise. 46628 (sys_stat): Likewise. 46629 (sys_fstat): Likewise. 46630 (sys_lstat): Likewise. 46631 * desc.c (printflock): Likewise. 46632 46633 2013-02-18 Denys Vlasenko <vda.linux (a] googlemail.com> 46634 46635 Fixes in "new" mmap. 46636 * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5]. 46637 Add page shift of offset for I386. 46638 Use tcp->ext_arg[5] as offset for X32. 46639 (sys_old_mmap): [X32] Remove this function, X32 doesn't use is. 46640 46641 Preliminary simplifications in mmap functions. 46642 * mem.c: Move "define sys_mmap64 sys_mmap" from the top 46643 to the only place it affects. 46644 (print_mmap): Make offset argument unsigned, for safer implicit conversions. 46645 (sys_old_mmap): [IA64] use unsigned narrow_arg[]. 46646 Cast u_arg[5] (offset param) to unsigned long, to prevent erroneous signed 46647 expansion. 46648 46649 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46650 46651 Remove broken HAVE_LONG_LONG conditionals. 46652 We use printllval without HAVE_LONG_LONG guards in many places, 46653 but define it only if HAVE_LONG_LONG. This means that 46654 on !HAVE_LONG_LONG systems we won't build for some time now. 46655 46656 * defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro 46657 and printllval() function declaration. 46658 * util.c: Remove HAVE_LONG_LONG guard around printllval() 46659 function definition. 46660 (printllval): Add compile-time error check for using wrong 46661 if branch. Explain places where we deliberately use mismatched 46662 types for printf formats. 46663 46664 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46665 46666 Use explicit long type instead of off_t. 46667 * file.c (sys_lseek): Use long instead of off_t. 46668 46669 Merge two identical tables. 46670 * defs.h: Declare whence_codes[]. 46671 * desc.c: Delete static whence[]. 46672 (printflock[64]): Use whence_codes. 46673 * file.c: Make whence_codes[] non-static. 46674 Add SEEK_DATA and SEEK_HOLE to them. 46675 46676 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46677 46678 Remove wrong x32-specific lseek. 46679 Testing confirmed what I suspected: x32 lseek uses kernel-sized 46680 (i.e. wide) long for offset parameter. 46681 46682 * file.c: Delete sys_lseek32. 46683 * linux/syscall.h: Likewise. 46684 * linux/x32/syscallent1.h: Likewise. 46685 * test/x32_lseek.c: New file. 46686 46687 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46688 46689 Fix SEGV in lseek. 46690 I found hard way why the code was using "_whence" name. 46691 46692 * file.c: Rename whence[] to whence_codes[]. 46693 (sys_lseek): Fix printxval() to use whence_codes[]. 46694 (sys_lseek32): Likewise. 46695 46696 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46697 46698 Comment inner workings of sys_[l]lseek. 46699 The code doesn't look fully correct to me, but I need to experiment 46700 on actual x32 machine before I start "fixing" things. 46701 For now, add comments, and optimize out one tprints() call... 46702 46703 * file.c (sys_lseek): Rename '_whence' as 'whence'. 46704 Merge printing of ", " into subsequent tprintf. 46705 (sys_lseek32): Likewise. 46706 (sys_llseek): Likewise. 46707 46708 2013-02-17 Denys Vlasenko <vda.linux (a] googlemail.com> 46709 46710 Cosmetic fixes to syscall tables, no code changes. 46711 46712 2013-02-16 Denys Vlasenko <vda.linux (a] googlemail.com> 46713 46714 Make linux/mips/syscallent.h smaller. 46715 * linux/mips/syscallent.h: Remove trailing empty elements. 46716 Compactify huge stretches of NULL elements in the middle. 46717 46718 Simple optimization in get_error. 46719 * defs.h: Define SCNO_IN_RANGE(scno) macro. 46720 * syscall.c (get_error): Change return type to void. 46721 Use SCNO_IN_RANGE instead of SCNO_IS_VALID. 46722 (trace_syscall_exiting): Stop checking get_error() return value. 46723 46724 Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALID. 46725 46726 Finish prefixing regs struct names with arch_ 46727 * defs: Rename regs -> sparc_regs. 46728 * signal.c (sys_sigreturn): Use new variable name. 46729 * syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs. 46730 (getrval2): Use new variable names. 46731 (printcall): Likewise. 46732 46733 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 46734 46735 Use the same type for i386_regs on 32-bit and 64-bit x86. 46736 * defs.h: Stop including <asm/ptrace.h> for x86. 46737 Change i386_regs from "struct pt_regs" to "struct user_regs_struct". 46738 * syscall.c: Likewise. 46739 46740 Fix build error on Tile. 46741 * syscall.c (get_scno): [TILE] Remove TCB_WAITEXECVE check, 46742 it is never true on Tile, and stopped compiling when 46743 TCB_WAITEXECVE define was removed for Tile. 46744 46745 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 46746 46747 x86: zero-extend 32-bit args in syscall entry instead of sign-extension. 46748 Zero-extension is slightly more common that sign-extension: 46749 all pointers are zero-extended, and some other params are unsigned. 46750 46751 Whereas signed ones (fds, pids, etc) are often treated as 46752 _32-bit ints_ even by kernel, so just unconditionally casting 46753 such tcp->u_arg[N] to int works. 46754 46755 * syscall.c (get_syscall_args): [X86] Zero-extend 32-bit args 46756 instead of sign-extension. 46757 46758 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 46759 46760 Macroize conditional signed widening operation. 46761 * defs.h: Define widen_to_long() macro. 46762 * signal.c (sys_kill): Use it instead of open-coding it. 46763 (sys_tgkill): Use widen_to_long() on pids. 46764 * resource.c (decode_rlimit): Formatting fix. 46765 46766 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 46767 46768 A better handling of current_wordsize. 46769 On x86_64: 46770 text data bss dec hex filename 46771 435661 26628 47424 509713 7c711 strace_old 46772 435501 26612 47440 509553 7c671 strace_new_clever_wordsize 46773 46774 On x32 and arm it should be even better, current_wordsize becomes 46775 a constant there. 46776 46777 * defs.h: Declare current_wordsize as a variable if needed, 46778 else declare as a constant define. 46779 Remove declatation of personality_wordsize[]. 46780 * syscall.c: Make personality_wordsize[] static. 46781 Declare current_wordsize as a variable if needed. 46782 (set_personality): Set current_wordsize only if non-constant. 46783 46784 2013-02-15 Denys Vlasenko <vda.linux (a] googlemail.com> 46785 46786 Remove unnecessary "return 0" statements. 46787 * util.c (change_syscall): Remove dummy "return 0"s. 46788 46789 2013-02-14 Denys Vlasenko <vda.linux (a] googlemail.com> 46790 46791 x86: fix required kernel version for GETREGSET. 46792 * syscall.c (get_regs): [X86] Use GETREGSET only if kernel >= 2.6.35 46793 46794 Whitespace fix, no code changes. 46795 46796 2013-02-14 Christian Svensson <blue (a] cmd.nu> 46797 46798 Add support for the OpenRISC 1000 platform. 46799 * configure.ac: Added or1k architecture.. 46800 * defs.h: Added or1k to use register reading system. 46801 * linux/or1k/ioctlent.h.in: Use i386 ioctls. 46802 * linux/or1k/syscallent.h: New file. 46803 * process.c: Added or1k register defs to struct_user_offsets[]. 46804 * syscall.c: Added or1k_io iovec for or1k GETREGSET, 46805 regset structure for or1k. 46806 (printcall): Added handling for or1k. 46807 (get_regs): Likewise. 46808 (get_scno): Likewise. 46809 (get_syscall_args): Likewise. 46810 (get_syscall_result): Likewise. 46811 (get_error): Likewise. 46812 * util.c (change_syscall): Added dummy handling for or1k. 46813 * system.c (sys_or1k_atomic): New function (or1k specific syscall). 46814 46815 2013-02-14 Denys Vlasenko <vda.linux (a] googlemail.com> 46816 46817 [X86] Use ptrace(PTRACE_GETREGSET, NT_PRSTATUS) to get registers. 46818 Unlike PTRACE_GETREGS, this new method detects 32-bit processes 46819 reliably, without checking segment register values which 46820 are undocumented and aren't part of any sort of API. 46821 While at it, also fixed x32 detection to use __X32_SYSCALL_BIT, 46822 as it should have been from the beginning. 46823 46824 * defs.h: Declare os_release and KERNEL_VERSION. 46825 * strace.c: Make os_release non-static, remove KERNEL_VERSION define. 46826 * syscall.c: New struct i386_user_regs_struct, 46827 static union x86_regs_union and struct iovec x86_io. 46828 (printcall): Use i386_regs or x86_64_regs depending on x86_io.iov_len. 46829 (get_regs): On x86 and kernels 2.6.30+, use PTRACE_GETREGSET, 46830 on earlier kernels fall back to old method. 46831 (get_scno): [X86] Determine personality based on regset size 46832 on scno & __X32_SYSCALL_BIT. 46833 (syscall_fixup_on_sysenter): Use i386_regs or x86_64_regs depending 46834 on x86_io.iov_len. 46835 (get_syscall_args): Likewise. 46836 (get_error): Likewise. 46837 46838 2013-02-13 Denys Vlasenko <vda.linux (a] googlemail.com> 46839 46840 Rename some register statics by prefixing their names with arch. 46841 This makes it easier to grep for them. 46842 46843 * syscall.c: Rename variables: 46844 r0 -> bfin_r0,alpha_r0,sh_r0. 46845 a3 -> mips_a3. 46846 r2 -> mips_r2. 46847 (get_scno): Use new variable names. 46848 (get_syscall_result): Likewise. 46849 (get_error): Likewise. 46850 46851 2013-02-13 Denys Vlasenko <vda.linux (a] googlemail.com> 46852 46853 Factor out code to check addr, fetch and print siginfo. 46854 * defs.h: Declare new function printsiginfo_at(tcp, addr). 46855 * process.c (sys_waitid): Use printsiginfo_at(). 46856 (sys_ptrace): Likewise. 46857 * signal.c: (printsiginfo_at): Implement this new function. 46858 (sys_rt_sigsuspend): Use printsiginfo_at(). 46859 (sys_rt_sigtimedwait): Likewise. 46860 46861 Decode struct iov in PTRACE_GET/SETREGSET. 46862 * process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET. 46863 46864 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46865 46866 Unify representations of struct user fields for subarchitectures. 46867 * process.c: Unify MIPS and LINUX_MIPSN32, and SH and SH64 parts of 46868 struct_user_offsets[]. 46869 46870 Add start_code and start_data members of struct user. 46871 * process.c: Add start_code and start_data members of struct user 46872 in struct_user_offsets[], where appropriate. 46873 46874 Remove hacks for old kernels for architectures which require new kernels 46875 * util.c (change_syscall): For MICROBLAZE, replace code 46876 with dummy "return 0" and a comment explaining why that is ok 46877 for this architecture. 46878 46879 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46880 46881 Remove stray syscall result reading code on syscall entry for s390. 46882 This is a leftover from sysenter/sysexit split. 46883 I can't run-test it, but from code inspection it seems to be correct. 46884 46885 * syscall.c (get_scno): Remove stray syscall result reading for s390[x]. 46886 46887 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46888 46889 Deobfuscate definitions of struct user offsets. 46890 The maze of ifdefs/ifndefs was scaring new contributors. 46891 Format it so that every arch has its own ifdef block. 46892 46893 * process.c: Deobfuscate definitions of struct user offsets. 46894 46895 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46896 46897 Remove hacks for old kernels for architectures which require new kernels 46898 * defs.h: Do not define TCB_WAITEXECVE for AARCH64. 46899 * util.c (change_syscall): For AARCH64 and X32, replace code 46900 with dummy "return 0" and a comment explaining why that is ok 46901 for these architectures. 46902 46903 Remove old kernel hacks for architectures which require new kernels. 46904 * defs.h: Do not define TCB_WAITEXECVE for AVR32, BFIN and TILE. 46905 * util.c (change_syscall): For AVR32, BFIN and TILE, replace code 46906 with dummy "return 0" and a comment explaining why that is ok 46907 for these architectures. 46908 46909 Handle recv[m]msg for non-native 32-bit personality syscalls. 46910 * net.c (printmsghdr): If current_wordsize is 4 and long is wider than it, 46911 read 32-bit struct msghdr and expand it into a native one before using it. 46912 (printmmsghdr): Likewise for struct mmsghdr. 46913 46914 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46915 46916 Fix is_negated_errno() check for X32. 46917 X32's return value is 64-bit. We were truncating it to 32-bit long 46918 before checking for -errno. 46919 46920 * syscall.c (is_negated_errno_x32): New function. 46921 (get_error): Use is_negated_errno_x32 for X32 architecture. 46922 46923 2013-02-12 Denys Vlasenko <vda.linux (a] googlemail.com> 46924 46925 Remove unused / ambiguously used defines. 46926 We sometimes use LINUXSPARC and sometimes (more often) 46927 use "defined(SPARC) || defined(SPARC64)". Better to use 46928 one construct consistently. 46929 LINUX_MIPS64 is altogether unused. 46930 46931 * defs.h: Remove LINUXSPARC and LINUX_MIPS64 defines. 46932 Move PTRACE_xxx compat defines up, before arch-specific 46933 machinery. Use defined(SPARC) || defined(SPARC64) 46934 instead of LINUXSPARC. 46935 * file.c: Use defined(SPARC) || defined(SPARC64) instead of LINUXSPARC. 46936 * signal.c: Likewise. 46937 46938 2013-02-11 Denys Vlasenko <vda.linux (a] googlemail.com> 46939 46940 Preparatory patch for "new" x86 personality detection. 46941 * syscall.c: Move PT_FLAGS_COMPAT define to its only user, get_scno(). 46942 Rename arm_regs_union's fields to names less likely to collide with 46943 system defines. 46944 (get_regs): Use sizeof(arm_regs_union) instead of sizeof(aarch64_regs). 46945 This should be the same, but htis way it's cleaner. 46946 Remove __X32_SYSCALL_MASK and use __X32_SYSCALL_BIT instead. 46947 Explain 64-bit check in X32 build better. 46948 46949 2013-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 46950 46951 Fix sigaltstack decoder. 46952 strace used to hang when decoding sigaltstack called with invalid 46953 stack_t pointers because of mishandling umove() return code. 46954 46955 * signal.c (print_stack_t): Handle unfetchable stack_t properly. 46956 Change return type to void. 46957 (sys_sigaltstack): Update print_stack_t() usage. 46958 46959 Reported-by: kawillia (a] ucalgary.ca 46960 46961 2013-02-09 Mike Frysinger <vapier (a] gentoo.org> 46962 46963 Fix decoding of sysctl() when oldval fields are NULL. 46964 If you call glibc's syscall wrapper like so: 46965 static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE }; 46966 int buffer[2] = { 32768, 61000 }; 46967 size_t size = sizeof(buffer); 46968 sysctl(name, 3, 0, 0, buffer, size); 46969 (note that oldval/oldlenp are NULL). 46970 46971 The current strace code complains like so: 46972 _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, process_vm_readv: Bad address 46973 (nil), 0, 0x7fffe23c3960, 8}) = -1 EACCES (Permission denied) 46974 46975 Since passing NULL for the old values is valid, handle that explicitly. 46976 This also simplifies the code a bit by splitting up the handling of the 46977 new and old args so that we only handle the new args once. 46978 46979 Now the output looks like: 46980 _sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, NULL, 0, 0x7fff8c0c91b0, 8) = -1 EACCES (Permission denied) 46981 46982 * system.c (sys_sysctl): Check if info.oldval is NULL first. Move the 46983 processing of oldlen/info.newval/info.newlen out so they always get 46984 executed. Fix the format strings so we use %lu for unsigned long rather 46985 than a mix of %ld and %lu. 46986 46987 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 46988 46989 If we are on a glibc system, assume it's at least glibc 2.1. 46990 It is not likely anyone uses glibc older that that: 46991 glibc 2.1.1 was released in 1999 46992 46993 * net.c: Remove test for glibc >= 2.1. 46994 * signal.c: Remove code which is compiled only for glibc < 2.1. 46995 * util.c: Likewise. 46996 46997 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 46998 46999 S390: stop using needlessly static long pc variable. 47000 * syscall.c: Remove "static long pc" variable. 47001 (get_scno): Use an automatic long variable instead of a static. 47002 47003 Dying suddenly with abort() is rude, avoid if possible. 47004 * file.c (sys_utime): Don't call abort() if wordsize is strange. 47005 Instead, warn user about it. 47006 * desc.c (printflock): Use the same message string as in sys_utime. 47007 47008 Remove vestigial hacks around non-Linux struct sigactions. 47009 * signal.c: Stop using __sighandler_t glibc'ism. Remove SA_HANDLER macro. 47010 Explain why we can't use "sa_handler" as a field name. 47011 (sys_sigaction): Use __sa_handler instead of SA_HANDLER macro. 47012 (sys_rt_sigaction): Likewise. 47013 47014 2013-02-08 Denys Vlasenko <vda.linux (a] googlemail.com> 47015 47016 Optimize AArch64 handling of 32-bit personality. 47017 By putting aarch64_regs and arm_regs into a union, 47018 register copying is eliminated. 47019 No need to check and change personality on syscall exit. 47020 47021 * defs.h: Remove unused NUM_ARM_REGS define. Fix indentation. 47022 * syscall.c: Put aarch64_regs and arm_regs into a union. 47023 (update_personality): Shorten bitness message. 47024 (printcall): Add commented-out PC printing. 47025 (get_regs): Remove now-unnecessary 64-to-32 bits register copying. 47026 (get_syscall_result): Drop personality changing code. 47027 47028 2013-02-07 Denys Vlasenko <vda.linux (a] googlemail.com> 47029 47030 Rename some register statics by prefixing their names with arch. 47031 This makes it easier to grep for them. 47032 47033 * syscall.c: Make IA64's r8, r10 global variables static. 47034 Rename variables: 47035 r8,r10 -> ia64_r8,ia64_r10. 47036 d0 -> m68k_d0. 47037 a3 -> alpha_a3. 47038 r28 -> hppa_r28. 47039 r9 -> sh64_r9. 47040 r10 -> cris_r10. 47041 r3 -> microblaze_r3. 47042 (get_scno): Use new variable names. 47043 (syscall_fixup_on_sysenter): Likewise. 47044 (get_syscall_result): Likewise. 47045 (get_error): Likewise. 47046 47047 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 47048 47049 Rename ARM's regs structure to arm_regs. 47050 Compile-tested. 47051 47052 * defs.h: Rename regs structure to arm_regs. 47053 * syscall.c: Likewise. 47054 (printcall): Use new name instead of old one. 47055 (get_regs): Likewise. 47056 (get_scno): Likewise. 47057 (get_syscall_args): Likewise. 47058 (get_error): Likewise. 47059 * signal.c (sys_sigreturn): Likewise. 47060 47061 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 47062 47063 Stop needlessly using static variable. 47064 * syscall.c: Remove static long psr. 47065 (get_scno): Use local psr variable. 47066 (get_syscall_result): Likewise. 47067 47068 2013-02-06 Denys Vlasenko <vda.linux (a] googlemail.com> 47069 47070 Shortcut tests for fork/exec syscalls. 47071 This change should speed up strace by a tiny bit. 47072 47073 More importantly, it makes it much more clear that 47074 fork and exec fixups are not necessary for any reasonably 47075 recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees 47076 are all dead code. 47077 47078 * defs.h: Declare new need_fork_exec_workarounds flag variable. 47079 * strace.c: Define need_fork_exec_workarounds flag variable. 47080 (test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator. 47081 (test_ptrace_setoptions_for_all): Likewise. 47082 (init): Set need_fork_exec_workarounds to TRUE if needed. 47083 * syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec(). 47084 (trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if 47085 need_fork_exec_workarounds == TRUE. 47086 (trace_syscall_exiting): Likewise. 47087 47088 2013-02-05 Ben Noordhuis <info (a] bnoordhuis.nl> 47089 47090 Improve perf_event_open argument decoding. 47091 * configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h. 47092 * desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>. 47093 (perf_event_open_flags): New xlat structure. 47094 (sys_perf_event_open): New function. 47095 * linux/dummy.h (sys_perf_event_open): Remove. 47096 * linux/syscall.h (sys_perf_event_open): New prototype. 47097 47098 2013-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 47099 47100 tile: fix merge skew with new get_regs architecture. 47101 * defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error. 47102 * syscall.c (get_regs) [TILE]: Fix merge skew. 47103 (printcall) [TILE]: fix a compiler warning about pt_reg_t in 47104 a printf expression. 47105 47106 2013-02-05 Bernhard Reutner-Fischer <rep.dot.nop (a] gmail.com> 47107 47108 mount: decode MS_NOSEC. 47109 * system.c (MS_NOSEC): Define. 47110 (mount_flags): Add MS_NOSEC. 47111 47112 mmap: decode MAP_UNINITIALIZED. 47113 * mem.c (mmap_flags): Add MAP_UNINITIALIZED. 47114 47115 2013-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 47116 47117 Print 64-bit instruction pointers zero padded. 47118 * syscall.c (printcall): Print 64-bit instruction pointers zero padded. 47119 47120 x86_64: fix compilation warning introduced in previous commit. 47121 * syscall.c (printcall): Cast x86_64_regs.rip to the type being printed. 47122 47123 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 47124 47125 Simple bug fix for x86_86. 47126 * syscall.c (printcall): Use x86_64_regs.rip, not x86_64_regs.ip. 47127 47128 2013-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 47129 47130 Add tilegx support to strace. 47131 tilegx support has been in the kernel since 3.0. 47132 In addition, fix some issues with the tilepro support already 47133 present in strace, primarily the decision to use the 47134 <asm/unistd.h> numbering space for system calls. 47135 47136 * defs.h [TILE]: Include <asm/ptrace.h> and provide an extern 47137 struct pt_regs tile_regs for efficiency. Provide compat 32-bit 47138 personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE, 47139 PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY. 47140 * linux/tile/errnoent1.h: New file, includes linux/errnoent.h. 47141 * linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h. 47142 * linux/tile/signalent1.h: New file, includes linux/signalent.h. 47143 * linux/tile/syscallent.h: Update with new asm-generic syscalls. 47144 The version previously committed was the from the first tile patch 47145 to LKML, which subsequently was changed to use <asm-generic/unistd.h>. 47146 * linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h. 47147 * mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable. 47148 * process.c [TILE]: Choose clone arguments correctly and properly 47149 suppress all "struct user" related offsets in user_struct_offsets. 47150 * signal.c [TILE]: Use tile_regs not upeek. 47151 * syscall.c (update_personality) [TILE]: Print mode. 47152 (PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers. 47153 (tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state. 47154 (get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek. 47155 (get_scno) [TILE]: Set personality. 47156 (get_syscall_args) [TILE]: Use tile_regs. 47157 (get_syscall_result) [TILE]: Update tile_regs. 47158 (get_error) [TILE]: Use tile_regs. 47159 (printcall) [TILE]: Print pc. 47160 (arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]: 47161 Properly handle tile call semantics and support tilegx. 47162 47163 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 47164 47165 Small optimization for SPARC[64] get_scno. 47166 * syscall.c: Remove static unsigned long trap veriable. 47167 (get_scno): Use local trap variable. 47168 47169 Do not compile getrval2() if not needed. 47170 * syscall.c (getrval2): Do not compile it for architetures where 47171 it isn't ever used. 47172 47173 2013-02-05 Denys Vlasenko <vda.linux (a] googlemail.com> 47174 47175 Optimize out PTRACE_PEEKUSER with -i. 47176 strace -i was fetching PC with a separate PEEKUSER 47177 despite having GETREGS data: 47178 47179 ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0 47180 ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0 47181 write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82 47182 ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0 47183 47184 Now it does this: 47185 47186 ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0 47187 write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82 47188 ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0 47189 47190 Analogous improvement in sys_sigreturn() is also implemented. 47191 47192 * defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM. 47193 Declare clear_regs(), get_regs() and get_regs_error flag variable. 47194 * strace.c (trace): Call get_regs(pid) as soon as we know the tcb 47195 and that it is stopped. 47196 * syscall.c (get_regs): New function. Used to fetch registers early, 47197 just after tracee has stopped. 47198 (printcall): Move it here from util.c. Use global regs.REG data, 47199 if available on the arch, instead of re-fetching it. 47200 (get_scno): Use global regs.REG data. 47201 (get_syscall_result): Likewise. 47202 * signal.c (sys_sigreturn): Likewise. 47203 * util.c (printcall): Moved to syscall.c. 47204 47205 2012-12-15 Stanislav Brabec <sbrabec (a] suse.cz> 47206 47207 Fix sys_semtimedop decoding on s390x. 47208 The s390 and s390x pass semtimedop arguments differently from other 47209 architectures. sys_semtimedop parser was fixed for s390 by commit 47210 v4.6-177-ge0f5fd8, and s390x requires the same fix. 47211 47212 * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390x. 47213 47214 2012-12-08 Dmitry V. Levin <ldv (a] altlinux.org> 47215 47216 Fix *xattr decoding. 47217 * file.c (print_xattr_val): Do not attempt to decode a zero sized array. 47218 Fixes RH#885233. 47219 47220 2012-12-08 Stanislav Brabec <sbrabec (a] suse.cz> 47221 47222 sys_semtimedop: fix timeval argument index in wrapped call. 47223 Looking at the implementation of wrapped semtimedop() call inside glibc 47224 and kernel, I started to believe that timeval should be located in 47225 tcp->u_arg[4] and not tcp->u_arg[5]. Fortunately, tcp->u_arg[5] now 47226 works correctly as well, due to side effects of decode_ipc_subcall(). 47227 47228 declaration in header: 47229 int semtimedop(semid, *sops, nsops, *timeout); 47230 0 1 2 3 47231 47232 sys_ipc arguments in glibc on all patforms except s390*: 47233 semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout 47234 0 1 2 3 4 47235 We have to use indexes: 0 3 1 4 47236 47237 sys_ipc arguments on s390*: 47238 semid, (int) nsops, timeout, sops 47239 0 1 2 3 47240 We have to use indexes: 0 3 1 2 47241 47242 * ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in 47243 indirect_ipccall case. 47244 47245 2012-12-06 John Spencer <maillist-strace (a] barfooze.de> 47246 47247 Fix glibc version checks. 47248 * util.c: Check if __GLIBC__ is defined before using it. 47249 * signal.c: Likewise. Fix __GLIBC_MINOR__ checks. 47250 47251 2012-11-29 James Hogan <james.hogan (a] imgtec.com> 47252 47253 Add state argument to change_syscall and fix SPARC. 47254 Add a state argument to change_syscall() so that SPARC can modify that 47255 instead of read-modify-writing the whole register set. This function is 47256 always called within an arg_setup/arg_finish_change sequence which on 47257 certain architectures like SPARC will also be doing a read-modify-write. 47258 This prevents the second write (from arg_finish_change) from undoing the 47259 effects of the change_syscall call. 47260 47261 * util.c (change_syscall): Move below definition of arg_setup_state. 47262 Add state argument. 47263 [SPARC || SPARC64] Change to set state->u_regs[U_REG_G1] rather than 47264 read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS. 47265 (setbpt, clearbpt): Pass state argument to change_syscall. 47266 47267 2012-11-12 Steve McIntyre <steve.mcintyre (a] linaro.org> 47268 47269 Add support for tracing 32-bit ARM EABI binaries on AArch64. 47270 * defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the 47271 accessor macros, so it's possible to build on AArch64 without 47272 ARM system headers. Set SUPPORTED_PERSONALITIES to 2. 47273 Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE. 47274 Set DEFAULT_PERSONALITY to 1. 47275 * linux/aarch64/errnoent1.h: New file, includes generic errnoent.h. 47276 * linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h. 47277 * linux/aarch64/signalent1.h: New file, includes generic signalent.h. 47278 * linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h. 47279 * linux/aarch64/syscallent.h: New file, includes arm/syscallent.h. 47280 * syscall.c [AARCH64]: Define aarch64_regs. 47281 (update_personality) [AARCH64]: Add debug output. 47282 (get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by 47283 checking the size of the returned uio structure from PTRACE_GETREGSET 47284 and interpret the structure accordingly. 47285 (get_syscall_result): Likewise. 47286 (get_syscall_args): Merge the AArch64 and ARM sections so that on 47287 AArch64 we can fall back to supporting the ARM personality. 47288 (get_error): Likewise. 47289 47290 2012-11-12 Dmitry V. Levin <ldv (a] altlinux.org> 47291 47292 Move asm-generic ioctl definitions to linux/ioctlent.h.in. 47293 * linux/ioctlent.h.in: Add asm-generic ioctl entries from all 47294 linux/*/ioctlent.h.in files. 47295 * linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries. 47296 * linux/i386/ioctlent.h.in: Likewise. 47297 * linux/powerpc/ioctlent.h.in: Likewise. 47298 * linux/s390/ioctlent.h.in: Likewise. 47299 * linux/sparc/ioctlent.h.in: Likewise. 47300 47301 2012-10-27 Dmitry V. Levin <ldv (a] altlinux.org> 47302 47303 Filter out redundant "*32" ioctl entries. 47304 * linux/ioctlent-filter.awk: New file. 47305 * Makefile.am: Use it. 47306 * linux/ioctlent.h.in: Removed redundant "*32" entries. 47307 47308 2012-10-26 Dmitry V. Levin <ldv (a] altlinux.org> 47309 47310 Enhance quotactl decoding. 47311 * quota.c (sys_quotactl): Decode 2nd syscall argument using printpath. 47312 * pathtrace.c (pathtrace_match): Add quotactl support. 47313 * linux/*/syscallent.h: Add TF flag to quotactl entry. 47314 47315 2012-10-26 Steve McIntyre <steve.mcintyre (a] linaro.org> 47316 47317 Add AArch64 support to strace. 47318 AArch64 has been included in linux from 3.7 onwards. 47319 Add support for AArch64 in strace, tested on linux in a simulator. 47320 47321 * configure.ac: Support AArch64. 47322 * defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE. 47323 * ipc.c (indirect_ipccall): Support AArch64. 47324 * process.c (struct_user_offsets): Likewise. 47325 * syscall.c [AARCH64]: Include <asm/ptrace.h>, <sys/uio.h>, and 47326 <elf.h>. Define struct user_pt_regs regs. 47327 (get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET. 47328 (get_syscall_args, get_error): Support AArch64. 47329 * linux/aarch64/ioctlent.h.in: New file. 47330 * linux/aarch64/syscallent.h: New file, based on linux 3.7 version of 47331 asm-generic/unistd.h. 47332 47333 2012-10-26 Steve McIntyre <steve.mcintyre (a] linaro.org> 47334 47335 linux: add new errno values for EPROBE_DEFER and EOPENSTALE. 47336 New definitions match updates in Linux 3.4 and Linux 3.5 respectively. 47337 47338 * linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER. 47339 (ERRNO_518): Change to EOPENSTALE. 47340 47341 2012-10-26 Namhyung Kim <namhyung.kim (a] lge.com> 47342 47343 Add -e trace=memory option. 47344 Add a new 'memory' category for tracing memory mapping related syscalls. 47345 47346 Affected syscalls are: break, brk, get_mempolicy, madvise, mbind, 47347 migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect, 47348 mremap, msync, munlock, munlockall, munmap, remap_file_pages, and 47349 set_mempolicy. 47350 47351 * defs.h (TRACE_MEMORY): New macro. 47352 * syscall.c (lookup_class): Handle trace=memory option. 47353 * strace.1: Document it. 47354 * linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls. 47355 * linux/arm/syscallent.h: Likewise. 47356 * linux/avr32/syscallent.h: Likewise. 47357 * linux/bfin/syscallent.h: Likewise. 47358 * linux/hppa/syscallent.h: Likewise. 47359 * linux/i386/syscallent.h: Likewise. 47360 * linux/ia64/syscallent.h: Likewise. 47361 * linux/m68k/syscallent.h: Likewise. 47362 * linux/microblaze/syscallent.h: Likewise. 47363 * linux/mips/syscallent.h: Likewise. 47364 * linux/powerpc/syscallent.h: Likewise. 47365 * linux/s390/syscallent.h: Likewise. 47366 * linux/s390x/syscallent.h: Likewise. 47367 * linux/sh/syscallent.h: Likewise. 47368 * linux/sh64/syscallent.h: Likewise. 47369 * linux/sparc/syscallent.h: Likewise. 47370 * linux/tile/syscallent.h: Likewise. 47371 * linux/x32/syscallent.h: Likewise. 47372 * linux/x86_64/syscallent.h: Likewise. 47373 47374 2012-09-28 Mike Frysinger <vapier (a] gentoo.org> 47375 47376 x32: add 64bit annotation too. 47377 Since someone can invoke these entry points directly with syscall(), 47378 at least decode their name and show that they're 64bit versions rather 47379 than just showing syscall_###. 47380 47381 * linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64. 47382 47383 2012-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 47384 47385 Ignore fflush(3) return value. 47386 strace used to honor fflush(3) return value in trace_syscall_entering 47387 which resulted to tracees not being PTRACE_SYSCALL'ed which in turn 47388 caused nasty hangups like this one: 47389 47390 $ strace -o'|:' pwd 47391 |:: Broken pipe 47392 47393 There is little strace can do in case of fflush(3) returning EOF, and 47394 hangup is certainly not the best solution for the issue. 47395 47396 * syscall.c (trace_syscall_entering): Ignore fflush(3) return value. 47397 47398 2012-09-28 Dmitry V. Levin <ldv (a] altlinux.org> 47399 47400 Use perror_msg instead of perror. 47401 * signal.c (sys_sigreturn): Use perror_msg instead of perror. 47402 * strace.c (tprintf, tprints, detach, startup_attach): Likewise. 47403 * syscall.c (get_scno): Likewise. 47404 * util.c (umoven, umovestr): Likewise. 47405 47406 2012-09-27 Denys Vlasenko <vda.linux (a] googlemail.com> 47407 47408 process_vm_readv may return ESRCH if tracee was killed, don't complain. 47409 Discovered by running test/sigkill_rain under strace. 47410 47411 * util.c (umoven): Do not emit error message if process_vm_readv 47412 fails with ESRCH. 47413 (umovestr): LikeWise. 47414 47415 2012-09-13 Denys Vlasenko <vda.linux (a] googlemail.com> 47416 47417 Trivial fixes, no code changes. 47418 * strace.c: Fix compiler warning message about tgkill - we don't use it. 47419 Fix indentation of preprocessor directives. 47420 (trace): Remove outdated comment. 47421 47422 2012-08-24 Dmitry V. Levin <ldv (a] altlinux.org> 47423 47424 Always check setreuid return code. 47425 * strace.c (startup_child): Check setreuid return code. 47426 47427 2012-08-24 Mike Frysinger <vapier (a] gentoo.org> 47428 47429 x32: update {g,s}etsockopt syscall numbers. 47430 Starting with linux 3.6 (and backported to earlier kernels), these two 47431 syscalls have changed numbers (moving from native to compat entry points). 47432 Update the strace syscall list accordingly. 47433 47434 * linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move 47435 getsockopt from 55 to 542. 47436 47437 2012-08-16 Dmitry V. Levin <ldv (a] altlinux.org> 47438 47439 Decode file type returned by getdents system call. 47440 * file.c (sys_getdents): Decode d_type in unabbreviated mode. 47441 47442 2012-07-12 Dmitry V. Levin <ldv (a] altlinux.org> 47443 47444 Close pipe and wait for the pipe process termination. 47445 In case of normal strace termination, when the trace output is 47446 redirected to a file or a pipe, close it and wait for the pipe 47447 process termination. 47448 47449 * strace.c (main): Before normal exit, close shared_log when it 47450 differs from stderr, and wait for popen_pid termination. 47451 47452 2012-07-10 Denys Vlasenko <vda.linux (a] googlemail.com> 47453 47454 Enable usage of PTRACE_SEIZE. 47455 * defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL 47456 and PTRACE_EVENT_STOP1. 47457 * strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL 47458 with 0. 47459 (trace): Do not check for PTRACE_EVENT_STOP1. 47460 47461 2012-06-05 Mike Frysinger <vapier (a] gentoo.org> 47462 47463 x32: update syscall table. 47464 This syncs with the syscall table as it is in linux 3.4. 47465 47466 * linux/x32/syscallent.h (59): Fix comment typo. 47467 (78): Add missing getdents entry. 47468 (174): Delete create_module entry (not in the kernel). 47469 (181, 182, 183, 184, 185): Add missing entries. 47470 (524, 536, 539, 540): Fix spacing. 47471 47472 2012-05-18 Denys Vlasenko <vda.linux (a] googlemail.com> 47473 47474 Merge adjacent printing operations in a few places. 47475 * file.c (sys_readahead): Merge tprints() with following printllval(). 47476 (sys_ftruncate64): Likewise. 47477 (sys_fadvise64): Likewise. 47478 (sys_fadvise64_64): Likewise. 47479 (sys_fallocate): Merge tprints() with following tprintf(). 47480 47481 2012-05-16 Denys Vlasenko <vda.linux (a] googlemail.com> 47482 47483 Use %d printf format instead of %i everywhere. 47484 * loop.c (loop_ioctl): Use %d instead of %i. 47485 * mtd.c (mtd_ioctl): Likewise. 47486 47487 Fix a few goofs in sys_sysctl() 47488 * system.c (sys_sysctl): Cast pointer to long, not size_t, 47489 when we intend to use it as an address. Set oldlen to 0 prior 47490 to reading into it - we want to have deterministic result 47491 if read fails. 47492 47493 2012-05-16 Denys Vlasenko <vda.linux (a] googlemail.com> 47494 47495 Stop using non-standard %Zu and %Zd formats for size_t printing. 47496 The documented formats are %zu and %zd, but since our (normally disabled) 47497 "fast" printf code doesn't support those too, I convert them to %lu and %ld. 47498 47499 * bjm.c (sys_query_module): Convert %Zd usages to %lu. 47500 * system.c (sys_sysctl): Likewise. 47501 47502 2012-05-15 Denys Vlasenko <vda.linux (a] googlemail.com> 47503 47504 Remove outdated comment about suspending new tracees. 47505 We no longer track parent/child relationship between tracees. 47506 Therefore, we no longer suspend new tracee until parent is seen 47507 exiting form [v]fork/clone. The comment is obsolete. 47508 47509 * strace.c (trace): Remove outdated comment. 47510 47511 2012-05-15 Denys Vlasenko <vda.linux (a] googlemail.com> 47512 47513 Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches 47514 On 64bit systems with a single personality, they used to be sizeof(long), 47515 which has type "long", not "int", which complicates printf formats. 47516 47517 * defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int. 47518 This in turn makes sure current_wordsize is also an int. 47519 * count.c (call_summary): Revert the change which added cast to int. 47520 47521 2012-05-15 Dmitry V. Levin <ldv (a] altlinux.org> 47522 47523 Add configure --enable-gcc-Werror option. 47524 * configure.ac: New option --enable-gcc-Werror. 47525 47526 Make x86-64 build free of artificial warnings. 47527 * signal.c (sys_sigreturn): Do not issue "no sys_sigreturn" warning 47528 on X86_64. 47529 47530 2012-05-14 Dmitry V. Levin <ldv (a] altlinux.org> 47531 47532 Fix kernel release string parsing. 47533 * strace.c (get_os_release): Handle "X.Y-something" utsname.release 47534 strings properly. 47535 47536 Reported-by: Bryce Gibson <bryce (a] gibson-consulting.com.au> 47537 47538 2012-05-14 Denys Vlasenko <vda.linux (a] googlemail.com> 47539 47540 On clearing "breakpopint", restore syscall number too. 47541 This fixes Fedora bug 659382. 47542 Low risk: this code is not supposed to be used on any non-acient kernel. 47543 47544 * util.c (clearbpt): Restore syscall number too. 47545 47546 2012-05-05 Mike Frysinger <vapier (a] gentoo.org> 47547 47548 util: fix building when glibc has a stub process_vm_readv. 47549 If you have a newer glibc which provides process_vm_readv, but it is built 47550 against older kernel headers which lack __NR_process_vm_readv, the library 47551 will contain a stub implementation that just returns ENOSYS. Autoconf 47552 checks for this case explicitly and will declare it as unavailable. So we 47553 end up in a case where the headers provide the prototype, but autoconf has 47554 not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again: 47555 47556 util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration 47557 /usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here 47558 47559 So rename our local function to something unique, and add a define so the 47560 callers all hit the right place. 47561 47562 * util.c (strace_process_vm_readv): Rename from process_vm_readv. 47563 (process_vm_readv): Define to strace_process_vm_readv. 47564 47565 2012-05-03 Dmitry V. Levin <ldv (a] altlinux.org> 47566 47567 doc: describe documentation policy. 47568 * README-hacking: Describe documentation policy. 47569 47570 2012-05-02 Dmitry V. Levin <ldv (a] altlinux.org> 47571 47572 maint: post-release administrivia. 47573 * NEWS: Add header line for next release. 47574 47575 Prepare for 4.7 release. 47576 * configure.ac: Version 4.7. 47577 * debian/changelog: 4.7-1. 47578 * strace.spec: 4.7-1. 47579 47580 Fix build with <linux/loop.h> from 2.6.18 kernel headers. 47581 * configure.ac: Check for LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN 47582 declarations. 47583 * loop.c (loop_flags_options): Use LO_FLAGS_AUTOCLEAR and 47584 LO_FLAGS_PARTSCAN only when appropriate declarations are available. 47585 (loop_ioctl): Use LOOP_SET_CAPACITY only when it is defined. 47586 47587 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 47588 47589 * vsprintf.c: Check for USE_CUSTOM_PRINTF earlier. 47590 47591 Remove duplicate names from CREDITS. 47592 * .mailmap: Merge email addresses. 47593 * CREDITS.in: Remove a duplicate name. 47594 47595 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 47596 47597 tests: raise strace check timeout to 60 seconds. 47598 * tests/init.sh (check_timeout): New variable. 47599 * tests/ptrace_setoptions: Use it. 47600 * tests/strace-f: Likewise. 47601 47602 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 47603 47604 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 47605 47606 Update STA_* constants. 47607 * time.c (adjtimex_status): Add STA_NANO, STA_MODE, and STA_CLK. 47608 * NEWS (Improvements): Mention it. 47609 47610 NEWS: update for release. 47611 * NEWS (Improvements): Mention recent recvmsg/recvmmsg decoders 47612 enhancements. 47613 (Portability): Add a recommendation for the minimum Linux kernel 47614 version to use. 47615 47616 Make printing of utsname.domainname more portable. 47617 * configure.ac: Check for struct utsname.domainname field. 47618 * process.c (sys_uname): Print utsname.domainname when the field is 47619 available. 47620 47621 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 47622 47623 Fix recvmmsg decode: do not show more data than actually returned. 47624 This change complements recent fix for recvmsg decoding. 47625 47626 * net.c (printmmsghdr): Add msg_len parameter to pass down to do_msghdr. 47627 When this parameter is zero, pass mmsghdr.msg_len to do_msghdr instead. 47628 (decode_mmsg): Add msg_len parameter, pass it down to printmmsghdr. 47629 (sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L. 47630 (sys_recvmmsg): Call decode_mmsg with msg_len == 0. 47631 47632 2012-05-01 Dmitry V. Levin <ldv (a] altlinux.org> 47633 47634 Remove recently introduced use of ULONG_MAX. 47635 * io.c: Remove limits.h inclusion. 47636 (tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX". 47637 * net.c: Remove limits.h inclusion. 47638 (printmmsghdr, sys_sendmsg): Use "(unsigned long) -1L" instead of 47639 "ULONG_MAX". 47640 47641 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 47642 47643 Enable printing of uts.domainname in uname syscall. 47644 * process.c (sys_uname): Enable printing of uts.domainname 47645 47646 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 47647 47648 Fix printstr's len parameter width. 47649 We often pass syscall params and other long-sized values 47650 as printstr(len). Truncating them to int may be a bad thing. 47651 47652 * defs.h: Change len parameter's type from int to long in 47653 string_quote and printstr function declarations. 47654 * util.c (string_quote): Special-case only len==-1, not all len<0. 47655 (printstr): Likewise. 47656 47657 2012-04-28 Denys Vlasenko <vda.linux (a] googlemail.com> 47658 47659 Fix recvmsg decode: do not show more data than actually returned. 47660 I noticed that "hostname -d" talks over netlink and gets 20 bytes 47661 of response, but we show entire 1024 bytes of iov. 47662 This changes fixes that. 47663 47664 * defs.h: New function tprint_iov_upto. 47665 * io.c (tprint_iov_upto): Definition of this function. 47666 (tprint_iov): Call tprint_iov_upto. 47667 * net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto. 47668 (printmsghdr): Add data_size parameter, pass it down to do_msghdr. 47669 (printmmsghdr): Call do_msghdr with data_size==ULONG_MAX. 47670 (sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX. 47671 (sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval. 47672 47673 2012-04-27 Dmitry V. Levin <ldv (a] altlinux.org> 47674 47675 Package strace-log-merge. 47676 * strace.spec (%files): Add strace-log-merge. 47677 47678 2012-04-27 Mike Frysinger <vapier (a] gentoo.org> 47679 47680 NEWS: clarify & fix typo. 47681 47682 2012-04-27 Mike Frysinger <vapier (a] gentoo.org> 47683 47684 Cast current_wordsize to an int. 47685 On 64bit systems with a single personality, we see: 47686 count.c: In function 'call_summary': 47687 count.c:223:5: warning: format '%u' expects type 'unsigned int', 47688 but argument 3 has type 'long unsigned int' 47689 47690 Since on multi-personality systems this is an array of ints, cast 47691 the multiplication to an int and update the printf format. 47692 47693 * count.c (call_summary): Change %u to %d and cast first argument to int. 47694 47695 2012-04-20 Dmitry V. Levin <ldv (a] altlinux.org> 47696 47697 Update NEWS for upcoming 4.7 release. 47698 * NEWS: Update for 4.7 release. 47699 47700 Sync strace.spec and debian/ with packages. 47701 * debian/changelog: Sync with 4.5.20-2.3. 47702 * debian/control: Likewise. 47703 * strace.spec: Sync with 4.6-2. 47704 47705 2012-04-18 Mike Frysinger <vapier (a] gentoo.org> 47706 47707 Decode /dev/loop ioctls. 47708 Needed to debug some losetup failures, and it's easier when you can see 47709 what the kernel is getting vs what you think you're sending, so add some 47710 decoders for those ioctls. 47711 47712 * loop.c: New file. 47713 * Makefile.am (strace_SOURCES): Add loop.c. 47714 * defs.h (loop_ioctl): New prototype. 47715 (string_quote): Likewise. 47716 * ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'. 47717 * util.c (string_quote): Remove static keyword. 47718 47719 2012-04-18 H.J. Lu <hongjiu.lu (a] intel.com> 47720 47721 x32: add ia32 support. 47722 * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h, 47723 linux/x32/ioctlent1.h, linux/x32/signalent1.h and 47724 linux/x32/syscallent1.h. 47725 * configure.ac: Remove AC_GNU_SOURCE, obsoleted by 47726 AC_USE_SYSTEM_EXTENSIONS. 47727 * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32. 47728 (PERSONALITY1_WORDSIZE): Set to 4 for X32. 47729 * file.c (stat64): New struct for X32. 47730 (sys_lseek32): New function for X32. 47731 (stat64): Undef. 47732 (sys_fstat64): Likewise. 47733 (sys_stat64): Likewise. 47734 (realprintstat64): New function for X32. 47735 (sys_fstat64): Likewise. 47736 (sys_stat64): Likewise. 47737 * mem.c (sys_old_mmap): New function for X32. 47738 * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32. 47739 * syscall.c (update_personality): Add X32 support. 47740 (get_scno): Support currpers == 1 for X32. 47741 * linux/syscall.h (sys_lseek32): New function prototype for X32. 47742 * linux/x32/errnoent1.h: New file. 47743 * linux/x32/ioctlent1.h: Likewise. 47744 * linux/x32/signalent1.h: Likewise. 47745 * linux/x32/syscallent1.h: Likewise. 47746 47747 2012-04-17 H.J. Lu <hongjiu.lu (a] intel.com> 47748 47749 Cast clock_t type to unsigned long long. 47750 * resource.c (sys_times): Cast clock_t type to unsigned long long. 47751 * signal.c (printsiginfo): Likewise. 47752 47753 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 47754 47755 Add custom (faster) vfprintf implementation (disabled by default) 47756 * defs.h: Declare strace_vfprintf either as a alias to vfprintf 47757 or as a bona fide function. USE_CUSTOM_PRINTF define controls whether 47758 we use strace_vfprintf. By default, we don't. 47759 * strace.c (tprintf): Call strace_vfprintf instead of vfprintf. 47760 * vsprintf.c: New file, implements strace_vfprintf. 47761 47762 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 47763 47764 Stop using %h[h]u format specifiers. 47765 This is needed for simplified printf, and reduces code size a bit. 47766 47767 * block.c (block_ioctl): Cast the value to unsinged and use %u 47768 instead of using %hu. 47769 * desc.c (sys_io_cancel): Likewise. 47770 * resource.c (sys_sysinfo): Likewise. 47771 47772 2012-04-16 Denys Vlasenko <vda.linux (a] googlemail.com> 47773 47774 Trivial speed optimization. 47775 * strace.c (tprints): Use fputs_unlocked instead of fputs. 47776 47777 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 47778 47779 Fix a problem with sys_lseek on x32. 47780 * file.c (sys_lseek): Use MIPS-n32 variant also for x32 47781 47782 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 47783 47784 Add x32 support to strace. 47785 X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with 47786 32bit pointers. At system call level, x32 is also identical to x86-64, 47787 as shown by many changes like "defined(X86_64) || defined(X32)". The 47788 main differerence bewteen x32 and x86-64 is off_t in x32 is long long 47789 instead of long. 47790 47791 This patch adds x32 support to strace. Tested on Linux/x32. 47792 47793 * configure.ac: Support X32. 47794 * defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64, 47795 Set PERSONALITY2_WORDSIZE to 4 for X86_64. 47796 Add tcb::ext_arg for X32. 47797 * file.c (stat): New for X32. 47798 (sys_lseek): Use 64-bit version for X32. 47799 (printstat64): Check current_personality != 1 for X86_64. 47800 * ipc.c (indirect_ipccall): Check current_personality == 1 47801 for X86_64. 47802 * mem.c (sys_mmap64): Also use tcp->u_arg for X32. Print NULL 47803 for zero address. Call printllval for offset for X32. 47804 * pathtrace.c (pathtrace_match): Don't check sys_old_mmap for 47805 X32. 47806 * process.c (ARG_FLAGS): Defined for X32. 47807 (ARG_STACK): Likewise. 47808 (ARG_PTID): Likewise. 47809 (change_syscall): Handle X32. 47810 (struct_user_offsets): Support X32. 47811 (sys_arch_prctl): Likewise. 47812 * signal.c: Include <asm/sigcontext.h> for X32. 47813 (SA_RESTORER): Also define for X32. 47814 * syscall.c (update_personality): Support X32 for X86_64. 47815 (is_restart_error): Likewise. 47816 (syscall_fixup_on_sysenter): Likewise. 47817 (get_syscall_args): Likewise. 47818 (get_syscall_result): Likewise. 47819 (get_error): Likewise. 47820 (__X32_SYSCALL_BIT): Define if not defined. 47821 (__X32_SYSCALL_MASK): Likewise. 47822 (get_scno): Check DS register value for X32. Use 47823 __X32_SYSCALL_MASK on X32 system calls. 47824 * util.c (printllval): Use ext_arg for X32. 47825 (printcall): Support X32. 47826 (change_syscall): Likewise. 47827 (arg0_offset): Likewise. 47828 (arg1_offset): Likewise. 47829 * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h, 47830 linux/x32/ioctlent.h.in, linux/x32/signalent.h, 47831 linux/x32/syscallent.h, linux/x86_64/errnoent2.h, 47832 linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and 47833 linux/x86_64/syscallent2.h. 47834 * linux/x32/errnoent.h: New. 47835 * linux/x32/ioctlent.h.in: Likewise. 47836 * linux/x32/signalent.h: Likewise. 47837 * linux/x32/syscallent.h: Likewise. 47838 * linux/x86_64/errnoent2.h: Likewise. 47839 * linux/x86_64/ioctlent2.h: Likewise. 47840 * linux/x86_64/signalent2.h: Likewise. 47841 * linux/x86_64/syscallent2.h: Likewise. 47842 47843 2012-04-16 H.J. Lu <hongjiu.lu (a] intel.com> 47844 47845 Restore tcb::u_lrval; fix lseek on MIPS-n32. 47846 Linux kernel v3.4 adds x32 support. Both x32 and n32 use 64bit offset 47847 for lseek parameter and return value. We need u_lrval to handle it 47848 properly. Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek. 47849 This patch fixes it properly and prepares lseek for x32. 47850 47851 * defs.h (tcb): Restore tcb::u_lrval field, RVAL_Lfoo constants. 47852 Set RVAL_MASK to 7. 47853 * file.c (sys_lseek): Print 64bit offset and return RVAL_LUDECIMAL 47854 for n32. 47855 * syscall.c (get_error): Set u_lrval for MIPS-n32. 47856 (trace_syscall_exiting): Handle RVAL_Lfoo return value types. 47857 47858 2012-04-06 Mike Frysinger <vapier (a] gentoo.org> 47859 47860 Decode mtd ioctls. 47861 I got tired of figuring out mtd structures (which show up a lot 47862 in the embedded space), so add decoders for those ioctls. 47863 47864 * defs.h (mtd_ioctl): New prototype. 47865 (print_loff_t): Likewise. 47866 * io.c (print_loff_t): Delete static keyword 47867 * ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'. 47868 * Makefile.am (strace_SOURCES): Add mtd.c. 47869 (EXTRA_DIST): Add linux/mtd-abi.h. 47870 * mtd.c: New file. 47871 * linux/mtd-abi.h: New file. 47872 47873 2012-04-05 Mike Frysinger <vapier (a] gentoo.org> 47874 47875 Fix indefinite hang on no-mmu systems. 47876 The ptrace setoptions code will fork a child which goes to sleep and 47877 expects the parent to continue on to do tests. Unfortunately, this 47878 does not work on no-mmu systems as fork() is actually vfork() and any 47879 vforked children will hang the parent until it exits or execs. 47880 47881 We might be able to make this test work on no-mmu systems with a bit 47882 of work, but easier to just disable this for the release so it works 47883 now. 47884 47885 * strace.c (test_ptrace_setoptions_for_all): Return if strace_vforked. 47886 47887 2012-03-29 Denys Vlasenko <vda.linux (a] googlemail.com> 47888 47889 Makefile.am: whitespace fix. 47890 47891 2012-03-27 Anton Blanchard <anton (a] samba.org> 47892 47893 powerpc: Add syscall entries for direct socket system calls. 47894 * linux/powerpc/syscallent.h: Add direct socket system calls. 47895 47896 2012-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 47897 47898 qual_syscall: fix potential NULL dereference. 47899 Fix regression introduced by commit 47900 c1371ebc400fe9578908beca87f2bf407daf1506 47901 47902 * syscall.c (qual_syscall): Handle null sys_name. 47903 47904 Reported-by: Fr. Br. George <george (a] altlinux.org> 47905 47906 2012-03-26 Dmitry V. Levin <ldv (a] altlinux.org> 47907 47908 strace-log-merge: fix file suffix calculation. 47909 * strace-log-merge: Quote file prefix to fix file suffix calculation. 47910 47911 Reported-by: Denys Vlasenko <vda.linux (a] googlemail.com> 47912 Suggested-by: Andreas Schwab <schwab (a] linux-m68k.org> 47913 47914 2012-03-26 Denys Vlasenko <vda.linux (a] googlemail.com> 47915 47916 Remove unreachable code. 47917 * strace.c (process_opt_p_list): Remove unreachable code. 47918 47919 manpage: remove false info about -p being limited to 32 processes. 47920 47921 Tweak help text and manpage (added -In to manpage) 47922 47923 2012-03-25 Dmitry V. Levin <ldv (a] altlinux.org> 47924 47925 printstr: check for potential integer overflow. 47926 * util.c (printstr): Check for potential integer overflow during outstr 47927 buffer size calculation. 47928 47929 Robustify parsing of numbers from strings. 47930 * defs.h (string_to_uint): New prototype. 47931 * util.c (string_to_uint): New function. 47932 * strace.c (error_opt_arg): New function. 47933 (process_opt_p_list): Use string_to_uint instead of atoi. 47934 Terminate in case of invalid process id. 47935 (init): Use string_to_uint instead of atoi. 47936 Use error_opt_arg in case of invalid option argument. 47937 * syscall.c (qual_syscall, qual_signal, qual_desc): Use string_to_uint 47938 instead of atoi. 47939 47940 strace-log-merge: enhance usage error diagnostics. 47941 * strace-log-merge: Add --help option. Check number of arguments. 47942 Issue an error message when no strace output was merged. 47943 47944 configure.ac: sort lists and use m4_normalize to ease maintenance. 47945 * configure.ac (AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_CHECK_MEMBERS, 47946 AC_CHECK_DECLS): Sort lists, use m4_normalize. 47947 47948 2012-03-23 Denys Vlasenko <vda.linux (a] googlemail.com> 47949 47950 Simple optimizations. 47951 Why open-coding isdigit is a good idea? 47952 47953 Before: call __ctype_b_loc 47954 movzbl (%ebx),%edx 47955 mov (%eax),%eax 47956 testb $0x8,0x1(%eax,%edx,2) 47957 je lbl 47958 47959 After: movzbl (%eax),%edx 47960 sub $0x30,%edx 47961 cmp $0x9,%dl 47962 ja lbl 47963 47964 text data bss dec hex filename 47965 236869 704 18944 256517 3ea05 strace.before 47966 236719 700 18944 256363 3e96b strace 47967 47968 * defs.h: Alias sigemptyset to __sigemptyset on glibc. 47969 * syscall.c (qual_syscall): Open-code isdigit. 47970 (qual_desc): Likewise. 47971 (qual_signal): Open-code isdigit. Remove string copying 47972 which was done for no apparent reason. 47973 47974 2012-03-23 Denys Vlasenko <vda.linux (a] googlemail.com> 47975 47976 Reorder declarations in defs.h. No code changes. 47977 * defs.h: Reorder declarations (such as: keep all printing functions together). 47978 47979 2012-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 47980 47981 Simplify current tcp switching and current column handling. 47982 Instead of using "static FILE *outf and static unsigned int curcol" 47983 to cache current outfile and its position, we can simply 47984 remember current tcb and use its ->outf and ->curcol. 47985 This allows to drop numerous "tcp->curcol = curcol" ops in trace(). 47986 47987 Turns out we can't drop "static FILE *outf", but now its role is 47988 a bit clearer: it newer changes after init, stays == stderr or 47989 opened to shared log (which may be the same thing if neither -o 47990 nor -ff was specified). Let's rename it then. 47991 47992 text data bss dec hex filename 47993 236953 704 18944 256601 3ea59 strace.before.prev.commit 47994 236905 704 18944 256553 3ea29 strace.before 47995 236869 704 18944 256517 3ea05 strace 47996 47997 * strace.c: Replace curcol static variable by struct tcb *current_tcp. 47998 Rename static FILE *outf to shared_log (since it no longer caches tcp->outf). 47999 (ptrace_restart): Use current_tcp->curcol instead of curcol. 48000 (tprintf): Check current_tcp != NULL instead of outf != NULL. 48001 Use current_tcp->outf instead of outf, current_tcp->curcol instead of curcol. 48002 (tprints): Likewise. 48003 (line_ended): Likewise. 48004 (printleader): Switch current tcb by "current_tcp = tcp" istead of 48005 assignments to outf and curcol. 48006 (droptcb): Set current_tcp to NULL if we dropped it. 48007 (startup_child): Rename outf to shared_log. 48008 (init): Likewise. 48009 (cleanup): Likewise. 48010 (trace): Simplify current tcp switching and current column handling. 48011 48012 2012-03-22 Denys Vlasenko <vda.linux (a] googlemail.com> 48013 48014 Make threaded execve handling code more reabable and somewhat simpler. 48015 * strace.c (droptcb): Remove outfname check in "outfname && followfork >= 2" - 48016 with recent changes, followfork >= 2 check guarantees that outfile 48017 was specified, and _is already opened_. 48018 (trace): Move tcb existence check before threaded execve handling. 48019 This allows to remove tcp != NULL checks in threaded execve handling. 48020 Rewrite threaded execve handling code to be less indented, 48021 keeping the same logic. 48022 48023 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 48024 48025 simple cleanups in defs.h. No logic changes. 48026 * defs.h: Move offsetof macro definition into "libc stuff" section. 48027 Renumber TCB_foo constants (smaller constants -> sometimes smaller code). 48028 Remove uoff macro. 48029 * process.c: Move uoff macro here (sole user). 48030 48031 Show "+++ exited..." with -C. 48032 * strace.c (trace): Show "+++ exited..." with -C too. 48033 Save tcp->curcol after PTRACE_LISTEN failure too, just in case. 48034 48035 Slight tweak to qemu_multiarch_testing scripts. 48036 48037 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 48038 48039 Replace reprinting decision logic. 48040 After this change, we no longer need to decide when we need 48041 to set TCB_REPRINT, and when we don't: it's never needed :) 48042 48043 Well, almost. That pesky pid-changing execve needs special treatment. 48044 If not it, it'd be possible to nuke TCB_REPRINT... 48045 48046 While at it, fix a case of mishandled -C. 48047 48048 * strace.c (printleader): Do not set TCB_REPRINT. 48049 (trace): Set TCB_REPRINT only for execve with changing pid. 48050 Fix mishandling of -C. 48051 * syscall.c (trace_syscall_entering): Do not clear TCB_REPRINT. 48052 (trace_syscall_exiting): Replace reprinting decision logic. 48053 Remove call to printargs(): it is known to just return 0 here. 48054 48055 2012-03-21 Denys Vlasenko <vda.linux (a] googlemail.com> 48056 48057 Report some ptrace failures; nuke tcp->ptrace_errno. 48058 Report some (not all) ptrace errors, namely, 48059 errors on ptrace restart operations. 48060 48061 Before: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...> 48062 After: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process> 48063 48064 This tells user that strace failed to let sendto syscall 48065 to be entered - process was dead at that point of time. 48066 It is (marginally) better than to always say "<unfinished ...>" 48067 48068 While at it, patch removes tcp->ptrace_errno. 48069 I added it many months ago, and it looks that after all 48070 it is not needed for ptrace error detection: I failed to execute 48071 a single existing code path which is accessible 48072 through that variable only. 48073 48074 * defs.h: Remove struct tcp::ptrace_errno field. 48075 * strace.c (ptrace_restart): Emit message to log on error. 48076 (printleader): Remove "if (printing_tcp->ptrace_errno)..." code. 48077 (trace): Remove !tcp->ptrace_errno check, it's always true. 48078 48079 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 48080 48081 Eliminate redundant checks of res variable. 48082 * syscall.c (trace_syscall_entering): Eliminate redundant checks of res variable. 48083 (trace_syscall_exiting): Likewise. 48084 48085 Rename POWERPC-specific static variable result to ppc_result. 48086 * syscall.c: Rename POWERPC-specific static variable result to ppc_result. 48087 48088 Remove redundant checks in syscall entry/exit, rename badly named function 48089 * syscall.c (syscall_enter): Rename to get_syscall_args. 48090 Document its return values. 48091 (trace_syscall_entering): Don't check get_syscall_args() return 48092 value for 0, it never returns that. 48093 (syscall_fixup_on_sysexit): Make it return void. 48094 (trace_syscall_exiting): Fix up syscall_fixup_on_sysexit() 48095 call site accordingly. 48096 48097 Trivial tweaks. No logic changes. 48098 * process.c (sys_ptrace): Remove unneeded line wrapping. 48099 * syscall.c (trace_syscall_entering): Use tprints() instead of tprintf(). 48100 48101 Make ptrace_restart() static. No code changes. 48102 * defs.h: Remove ptrace_restart() declaration. 48103 * strace.c (ptrace_restart): Move its definition here. 48104 * util.c (ptrace_restart): Remove its definition. 48105 48106 2012-03-20 Dmitry V. Levin <ldv (a] altlinux.org> 48107 48108 Do not include limits.h unnecessarily. 48109 * ioctl.c: Remove limits.h inclusion left after the reverted change. 48110 48111 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 48112 48113 Partially revert last change. 48114 Thank you Dmitry for spotting it. 48115 48116 * ioctl.c (compare): Partially revert last change - the new 48117 comparison logic was buggy. 48118 48119 2012-03-20 Denys Vlasenko <vda.linux (a] googlemail.com> 48120 48121 Simplify search in ioctl table. 48122 text data bss dec hex filename 48123 236973 704 18944 256621 3ea6d strace.before 48124 236929 704 18944 256577 3ea41 strace 48125 48126 * ioctl.c (compare): Simplify generation of compare result. 48127 (ioctl_lookup): Pass key directly, not as part of dummy struct. 48128 (ioctl_next_match): More readable code. No logic changes. 48129 48130 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 48131 48132 Update qemu build script: now tries to upload result back to host. 48133 48134 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 48135 48136 Shrink space needed by undefined syscalls in syscall tables. 48137 Undefined syscall looked like this before this change: 48138 { 5, 0, printargs, "SYS_53" }, 48139 That is, "SYS_53" string had to be allocated and stored in strace binary. 48140 Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL 48141 for valid syscalls, we can replace printargs with NULL in such lines 48142 and make them "invalid", thus not requiring syscall name string. 48143 48144 Savings on i386: 48145 text data bss dec hex filename 48146 237389 704 18944 257037 3ec0d strace.before 48147 236973 704 18944 256621 3ea6d strace 48148 Savings on mips: 48149 336551 153692 38320 528563 810b3 strace.before 48150 275543 153688 38320 467551 7225f strace 48151 48152 Tested to still decode undefined syscalls correctly (syscall no. 222 on i386). 48153 48154 * linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with 48155 'NULL, NULL'. 48156 48157 2012-03-19 Denys Vlasenko <vda.linux (a] googlemail.com> 48158 48159 Optimize code if we have only one personality. 48160 On i386: 48161 text data bss dec hex filename 48162 238025 672 18980 257677 3ee8d strace.before 48163 237389 704 18944 257037 3ec0d strace 48164 48165 * defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined. 48166 Introduce new define, current_wordsize as 48167 (personality_wordsize[current_personality]). 48168 Make set_personality() no-op, current_personality constant zero, 48169 current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality. 48170 * count.c (call_summary): Use current_wordsize instead of 48171 personality_wordsize[current_personality]. 48172 * desc.c (printflock): Likewise. 48173 * file.c (sys_utime): Likewise. 48174 * io.c (tprint_iov): Likewise. 48175 * process.c (printargv): Likewise. 48176 * resource.c (decode_rlimit): Likewise. 48177 * signal.c (sys_kill): Likewise. 48178 (sys_rt_sigaction): Likewise. 48179 * time.c (sprinttv): Likewise. 48180 (sprint_timespec): Likewise. 48181 (printitv_bitness): Likewise. 48182 (tprint_timex): Likewise. 48183 (printsigevent): Likewise. 48184 * util.c (dumpiov): Likewise. 48185 (umoven): Likewise. 48186 (umovestr): Likewise. 48187 * syscall.c: Initialize sysent to sysent0 etc. 48188 Make current_personality, personality_wordsize[], set_personality() 48189 conditional on SUPPORTED_PERSONALITIES > 1. 48190 48191 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 48192 48193 Fix mips64 build failure: sys_pwrite64 doesn't exist. 48194 sys_pwrite seems to do the same thing as sys_pwrite64 48195 which we deleted when we removed non-Linux code. 48196 48197 * linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/ 48198 48199 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 48200 48201 qemu_multiarch_testing/: a directory with scripts for build testing. 48202 48203 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 48204 48205 Make internal_fork and internal_exec static. 48206 text data bss dec hex filename 48207 237917 672 18980 257569 3ee21 strace 48208 237845 672 18980 257497 3edd9 strace_new 48209 48210 * defs.h: Remove declarations of internal_fork and internal_exec. 48211 * process.c: Remove definitions of internal_fork and internal_exec. 48212 * syscall.c: Move them here. 48213 (internal_syscall): Return void instead of int. We were always 48214 returning zero, and callers weren't checking it anyway. 48215 48216 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 48217 48218 Remove code which is not used on Linux. 48219 Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686, 48220 mipsel,mips,x86_64 48221 48222 * syscall.c: Remove code which handles RVAL_Lfoo constants. 48223 * defs.h: Remove struct tcb::u_lrval member - it is never set. 48224 Remove RVAL_Lfoo constants which signify return of "long" result - 48225 they are never used. 48226 48227 2012-03-18 Denys Vlasenko <vda.linux (a] googlemail.com> 48228 48229 Remove unused version of sys_lseek. 48230 It is buggy: it returns RVAL_LUDECIMAL, which means the return value 48231 is in tcp->u_lrval. But tcp->u_lrval is never set 48232 (on Linux - it used to be set on other OSes). 48233 48234 * file.c (sys_lseek): Remove a version of this function which is 48235 supposed to be used if off_t is long long. It appears to be buggy 48236 and unused. 48237 48238 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 48239 48240 Revert "Remove underscores from a few syscall names which have them" 48241 This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae. 48242 48243 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 48244 48245 Simplify sys_lseek64 conditional compilation. 48246 It looks like sys_lseek64() is never used. 48247 For one, it is buggy (always shows 0 return value), and no one complains. 48248 48249 From code inspection: sys_lseek64 name is not used anywhere. 48250 It is defined to sys_lseek if HAVE_LONG_LONG_OFF_T is true. 48251 Thus, if !HAVE_LONG_LONG_OFF_T, it is never used. 48252 Therefore "if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T" 48253 conditional it sits in can be simplified to 48254 "if HAVE_LONG_LONG_OFF_T". 48255 Therefore, we can move it a bit up and merge with 48256 "if !HAVE_LONG_LONG_OFF_T, use this sys_lseek()" code block, 48257 by addind an "else" clause to it. 48258 To simplify it more, drop define and just rename sys_lseek64 -> 48259 sys_lseek. 48260 48261 Since the function is buggy, I think it is unused and we can 48262 just drop it. (I checked: at least I386 never uses it). 48263 48264 * file.c (sys_lseek64): Rename to sys_lseek; don't compile it 48265 if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case 48266 it is never used. 48267 48268 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 48269 48270 Remove underscores from a few syscall names which have them. 48271 Affected names are "_newselect", "_llseek", "_sysctl". 48272 I see no apparent reason why they have leading underscores. 48273 Moreover, some arches have underscored names and some have 48274 non-underscored ones. This is not consistent. 48275 48276 I verified that every architectire I touched did not have 48277 a similarly named syscall without underscore, thus this change 48278 does not introduce new ambiquities. 48279 48280 I left "_exit" untouched for now, but the same points stand for it too: 48281 some architectures use "exit" and no one complains. So why many 48282 arches are using "_exit"? 48283 48284 * linux/*/syscallent.h: Remove underscores from displayed 48285 syscall names for _newselect, _llseek, _sysctl. 48286 48287 2012-03-17 Denys Vlasenko <vda.linux (a] googlemail.com> 48288 48289 Remove unused struct tcb::baddr field. 48290 * defs.h: Remove unused struct tcb::baddr field. 48291 48292 Remove unused PTRACE_WRITE{TEXT,DATA} constants (they are from SunOS) 48293 * util.c: Remove unused PTRACE_WRITE{TEXT,DATA} constants. 48294 48295 Reindent case labels. No code changes. 48296 * net.c (printsockopt): Reindent case labels. 48297 * signal.c (sys_signal): Likewise. 48298 48299 Remove unused constants. No code changes. 48300 * syscall.c: Remove unused ENOIOCTLCMD constant. Fix indentation. 48301 * util.c: Remove unused CLONE_STOPPED constant. 48302 48303 Move change_syscall() to its only user and make it static. 48304 * defs.h: Remove declaration of change_syscall(). 48305 * process.c (change_syscall): Remove definition of this function. 48306 * util.c (change_syscall): Add definition of change_syscall(). 48307 48308 MAP_ANON is the same as MAP_ANONYMOUS, no need to have the former. 48309 * mem.c: Do not allocate string for MAP_ANON if it is the same as 48310 MAP_ANONYMOUS. 48311 48312 Indentation and whitespace fixes. No code changes. 48313 48314 test/threaded_execve: make it also test a case when leader is not in syscall 48315 48316 2012-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 48317 48318 Implement prlimit64 decoding, rewrite [gs]etrlimit decoding. 48319 * configure.ac: Remove AC_RLIM_T_IS_LONG_LONG call. 48320 Define SIZEOF_RLIM_T. 48321 * m4/long_long.m4 (AC_RLIM_T_IS_LONG_LONG): Remove. 48322 * linux/dummy.h (sys_prlimit64): Remove. 48323 * linux/syscall.h (sys_prlimit64): New prototype. 48324 * resource.c (resources): Reindent, add RLIMIT_RTTIME. 48325 (sprintrlim, print_rlimit32, sys_getrlimit, sys_setrlimit): Remove. 48326 [HAVE_LONG_LONG_RLIM_T]: Remove dead code. 48327 [_LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T]: Likewise. 48328 (sprint_rlim64, print_rlimit64, decode_rlimit64, sprint_rlim32, 48329 print_rlimit32, decode_rlimit, sys_getrlimit, sys_setrlimit, 48330 sys_prlimit64): New functions. 48331 48332 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 48333 48334 Remove another "interrupt to quit" message. 48335 * strace.c (startup_attach): Remove another "interrupt to quit" message. 48336 48337 Fix "strace -oFILE -ff -p<nonexistant_pid>" behavior. 48338 * strace.c (newoutf): Set tcp->outf in non-ff mode too. 48339 (alloctcb): This define is removed. 48340 (alloc_tcb): Renamed to alloctcb. Does not set tcp->outf anymore. 48341 Lost 'command_options_parsed' flag parameter. 48342 (startup_attach): Do not say "interrupt to quit" in attach message - 48343 ^C does not work in all cases, we mislead users. 48344 Call newoutf(tcp) after successful attach. 48345 (startup_child): Call newoutf(tcp) after successful attach. 48346 (trace): Call newoutf(tcp) when we picked up already attached child. 48347 48348 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 48349 48350 Make alloc_tcb and droptcb static. No code changes. 48351 The change is trivial. Diff is large because it is confused 48352 by function definitions being moved around. 48353 48354 * defs.h: Remove declarations of alloc_tcb and droptcb. 48355 * strace.c: Make alloc_tcb and droptcb static. 48356 Shuffle functions around to make compiler happy. 48357 48358 2012-03-16 Denys Vlasenko <vda.linux (a] googlemail.com> 48359 48360 Tidy up includes and copyright notices, fix indentation. 48361 The files not mentioned in changelog below had only 48362 copyright notices fixes and indentation fixes. 48363 48364 * defs.h: Include <stdint.h> and <inttypes.h>. 48365 * file.c: Do not include <inttypes.h>. 48366 Move struct kernel_dirent declaration below top include block. 48367 * block.c: Do not include <stdint.h> and <inttypes.h>. 48368 * quota.c: Likewise. 48369 * desc.c: Likewise. 48370 * signal.c: Likewise. 48371 48372 2012-03-16 Dmitry V. Levin <ldv (a] altlinux.org> 48373 48374 scsi.c: add copyright header. 48375 * scsi.c: This file was added back in 2007 without a copyright header. 48376 Add it now. 48377 48378 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 48379 48380 Enhance capget and capset syscalls decoding. 48381 * system.c (cap_version): New xlat structure. 48382 (print_cap_header, print_cap_data): New functions. 48383 (sys_capget, sys_capset): Use them. 48384 48385 Remove unused code. 48386 * syscall.c (subcall_style, decode_subcall): Remove. 48387 [SYS_socket_subcall] (decode_socket_subcall): New function, based on 48388 decode_subcall in deref_style. 48389 [SYS_ipc_subcall] (decode_ipc_subcall): New function, based on 48390 decode_subcall in shift_style. 48391 (trace_syscall_entering): Use decode_socket_subcall and 48392 decode_ipc_subcall instead of decode_subcall. 48393 48394 Fix IPC decoding on alpha and arm. 48395 * ipc.c (indirect_ipccall): Return 0 on ALPHA and ARM EABI. 48396 (sys_shmat): Use indirect_ipccall for proper return value decoding. 48397 48398 arm: fix compilation warnings. 48399 * configure.ac: Define SIZEOF_LONG. 48400 * signal.c (sys_rt_sigaction) [SUPPORTED_PERSONALITIES > 1]: Help 48401 compiler to optimize out unreachable code that is not expected to work 48402 on platforms where sizeof(long) <= 4. 48403 48404 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 48405 48406 tests: robustify again buggy shells. 48407 * tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax 48408 instead of "${parameter-word}". 48409 48410 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 48411 48412 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 48413 48414 improve ifdef check with decode_subcall. 48415 Use the same ifdef logic around the call sites of decode_subcall() 48416 to protect the definition of the func itself. This fixes warnings 48417 for targets like hppa which don't use this func. 48418 48419 * syscall.c (decode_subcall): Wrap in SYS_socket_subcall and 48420 SYS_ipc_subcall define checks. 48421 48422 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 48423 48424 alpha: fix decode of osf_sigprocmask. 48425 The alpha sigprocmask syscall is special in that it comes from OSF rather 48426 than the style that everyone else uses. 48427 48428 Tested with this simple code: 48429 $ cat test.c 48430 #include <signal.h> 48431 main() { 48432 sigset_t set, oldset; 48433 sigemptyset(&set); 48434 sigaddset(&set, SIGINT); 48435 sigaddset(&set, SIGHUP); 48436 sigprocmask(SIG_SETMASK, &set, &oldset); 48437 sigprocmask(SIG_UNBLOCK, &oldset, &set); 48438 sleep(3); 48439 } 48440 $ gcc test.c && ./strace ./a.out 48441 ... 48442 osf_sigprocmask(SIG_SETMASK, [HUP INT]) = 0 (old mask []) 48443 osf_sigprocmask(SIG_UNBLOCK, []) = 0x3 (old mask [HUP INT]) 48444 osf_sigprocmask(SIG_BLOCK, [CHLD]) = 0x3 (old mask [HUP INT]) 48445 ... 48446 48447 * linux/alpha/syscallent.h: Call sys_sigprocmask for osf_sigprocmask, 48448 and change number of arguments to two. 48449 * signal.c (sys_sigprocmask): Fix decoding of alpha osf sigprocmask. 48450 48451 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48452 48453 Fix array size calculation in previous commit. 48454 * pathtrace.c (getfdpath): Fix array size calculation. 48455 48456 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48457 48458 pathtrace_select() is never called with NULL, remove dead code. 48459 pathtrace_select() is only called for -P FILE options, 48460 and FILE is never a NULL pointer. 48461 48462 text data bss dec hex filename 48463 239453 672 19012 259137 3f441 strace.before 48464 239329 672 19012 259013 3f3c5 strace 48465 48466 * pathtrace.c (pathtrace_select): Remove "if (path == NULL)...". 48467 (pathtrace_select): Remove code which only executes if path == NULL. 48468 The code was also buggy, it can free non-malloced pointer. 48469 (getfdpath): Simplify snprintf to sprintf. 48470 (pathmatch): Use strcmp() == 0 idiom for string equality test. 48471 (pathtrace_match): Likewise. 48472 48473 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48474 48475 manpage: remove bugs which are fixed. 48476 "A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x. 48477 "A traced process which tries to block SIGTRAP will be sent a SIGSTOP 48478 in an attempt to force continuation of tracing." - not needed 48479 and no longer done. 48480 "On Linux, exciting as it would be, tracing the init process is forbidden" 48481 - not true anymore. 48482 "When a traced process receives a SIGTRAP signal not 48483 associated with tracing, strace will not report that signal correctly." 48484 - not true anymore. 48485 48486 Simplify SIGCHLD handler setting. 48487 * strace.c (init): Set SIGCHLD to SIG_DFL earlier. 48488 (startup_child): Do not bother restoring SIGCHLD handler. 48489 48490 When reporting signals, use short signal names (SIGfoo) instead of strerror 48491 * defs.h: Remove strsignal declaration. 48492 * signal.c: Better check for SI_FROMUSER define. 48493 * strace.c (strerror): Remove this function. 48494 (trace): Use short signal names (SIGfoo) instead of strerror. 48495 48496 Remove TODO file: it's eleven years old and completely outdated. 48497 48498 Clean up defs.h order. No code changes. 48499 * defs.h: Group together related declarations. No code changes. 48500 48501 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48502 48503 Fix lame kernel version checking code. 48504 The code "os_release[0] >= '3'" is not good for any 48505 finer-grained checks such as "kernel >= 3.2.1". 48506 Let's proactively fix it. 48507 48508 * strace.c: Change os_release from string to integer. 48509 (get_os_release): Parse uname.release to KERNEL_VERSION 48510 representation. 48511 (init): Convert kernel version check to KERNEL_VERSION. 48512 48513 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48514 48515 Experimental support for "detach on execve" feature. 48516 * strace.c: Define new detach_on_execve, skip_startup_execve bool variables. 48517 (init): Set detach_on_execve on -b, set skip_startup_execve if 48518 "strace PROG" form is used. 48519 (trace): Detach from process if -b and we see PTRACE_EVENT_EXEC event. 48520 48521 Simple fixes. 48522 * strace.c (usage): Document -d; document that -F is deprecated. 48523 (droptcb): Print "<detached ...>" correctly for non-ff mode too. 48524 (detach): Suppress a warning. 48525 48526 Remove an outdated comment. 48527 * defs.h: Remove an outdated comment. 48528 48529 Remove extra include directives. No code changes. 48530 * defs.h: Include <signal.h> unconditionally. 48531 Other files were doing it unconditionally, so no harm done. 48532 * bjm.c: Remove system includes which are already included by defs.h. 48533 * pathtrace.c: Likewise. 48534 * process.c: Likewise. 48535 * signal.c: Likewise. 48536 * strace.c: Likewise. 48537 * stream.c: Likewise. 48538 * syscall.c: Likewise. 48539 * system.c: Likewise. 48540 * util.c: Likewise. 48541 48542 2012-03-15 Denys Vlasenko <vda.linux (a] googlemail.com> 48543 48544 Tidy up order of includes; make bool variables explicit. 48545 Bool variables are more compact in data and (on x86) on code too: 48546 48547 text data bss dec hex filename 48548 237950 676 19044 257670 3ee86 strace.before 48549 237838 676 19012 257526 3edf6 strace 48550 48551 * defs.h: Group library includes at the top of the file. 48552 Rename dtime to Tflag, debug to debug_flag. 48553 Change debug_flag,Tflag,qflag,not_failing_only,show_fd_path,tracing_paths 48554 variable declarations from int to bool. 48555 * strace.c: Change corresponding definitions. Do the same for static 48556 variables iflag,rflag,print_pid_pfx. 48557 Rename dtime to Tflag, debug to debug_flag. 48558 * syscall.c: Rename dtime to Tflag, debug to debug_flag. 48559 48560 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 48561 48562 Fix compiler warnings about breaking strict-aliasing rules. 48563 * system.c (sys_capget, sys_capset): Use proxy unions to cast long* 48564 pointers to cap_user_header_t and cap_user_data_t pointers without 48565 breaking strict-aliasing rules. 48566 48567 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 48568 48569 2012-03-15 Mike Frysinger <vapier (a] gentoo.org> 48570 48571 ppc64: drop unused pid variable. 48572 * syscall.c (get_scno) [POWERPC64]: Delete unused pid variable. 48573 48574 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 48575 48576 ia64: fix compilation warnings. 48577 * linux/ia64/syscallent.h: Remove improper defines and undefs. 48578 48579 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 48580 48581 2012-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 48582 48583 Ensure that SWAP_FLAG_* constants are defined. 48584 * file.c: Define those of SWAP_FLAG_* constants which are not yet 48585 provided by <sys/swap.h>. 48586 48587 Reported-by: Mike Frysinger <vapier (a] gentoo.org> 48588 48589 2012-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 48590 48591 Enhance *listxattr syscalls decoding. 48592 * file.c (print_xattr_list): New function. 48593 (sys_listxattr, sys_flistxattr): Use it. 48594 48595 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 48596 48597 Fix *at syscalls flags decoding. 48598 Several *at decoders were defining own incomplete *atflags xlat 48599 structures. That was error prone, and fchownat decoder actually 48600 failed to recognize AT_EMPTY_PATH. Merging these incomplete 48601 structures into the single at_flags xlat structure will fix 48602 flags handling in all these decoders altogether. 48603 48604 * file.c: Define all AT_* constants used by *at decoders. 48605 (at_flags): New xlat structure, with records for all AT_* constants. 48606 (fstatatflags, linkat_flags, unlinkatflags): Remove. 48607 (sys_newfstatat, sys_linkat, sys_unlinkat, sys_fchownat, 48608 sys_utimensat): Use at_flags. 48609 48610 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 48611 48612 Fix linkat flags decoding. 48613 * file.c (linkat_flags): New xlat structure. 48614 (sys_linkat): Decode flags using linkat_flags. 48615 48616 Implement sys_rt_tgsigqueueinfo syscall decoder. 48617 * linux/dummy.h (sys_rt_tgsigqueueinfo): Remove. 48618 * linux/syscall.h (sys_rt_tgsigqueueinfo): New prototype. 48619 * signal.c (print_sigqueueinfo): New function, based on 48620 sys_rt_sigqueueinfo. 48621 (sys_rt_sigqueueinfo): Use print_sigqueueinfo. 48622 (sys_rt_tgsigqueueinfo): New function. 48623 48624 Implement syslog syscall decoder. 48625 * linux/dummy.h (sys_syslog): Remove. 48626 * linux/syscall.h (sys_syslog): New prototype. 48627 * system.c (syslog_action_type): New xlat structure. 48628 (sys_syslog): New function. 48629 48630 2012-03-13 Denys Vlasenko <vda.linux (a] googlemail.com> 48631 48632 Less ugly debug display of ptrace events. 48633 * strace.c (trace): Less ugly debug display of ptrace events. 48634 48635 Make manpage mention that -p "`pidof PROG`" works. 48636 48637 2012-03-13 Denys Vlasenko <vda.linux (a] googlemail.com> 48638 48639 Fix logging for "strace -o FILE -ff test/threaded_execve" test case. 48640 Our logic which was deciding whether to print "<unfinished ...>" 48641 thingy wasn't working properly for -ff case. 48642 48643 * defs.h: Group log generation-related declarations together. 48644 Add a large comment which explains how it works. 48645 Add declaration of line_ended() function. 48646 * strace.c (line_ended): New function which sets up internal data 48647 to indicate that previous line was finished. 48648 (printleader): Change logic to fix log generation in -ff mode. 48649 (newoutf): Make check for -ff mode consistent with other places. 48650 (droptcb): Print "<detached ...>" if last line for this tcp wasn't finished. 48651 (cleanup): Remove code to print "<unfinished ...>", printleader() 48652 or detach() will do it instead. 48653 (trace): Remove code to print "<unfinished ...>". 48654 Add code which finishes threaded execve's incomplete line 48655 with " <pid changed to PID ...>" message. Replace printing_tcp = NULL 48656 followed by fflush() by line_ended() call. 48657 * process.c (sys_exit): Call line_ended() to indicate that we finished priting. 48658 * syscall.c (trace_syscall_exiting): Set printing_tcp to current tcp. 48659 Call line_ended() to indicate that we finished priting. 48660 Remove call to fflush(), it is done by line_ended() now. 48661 48662 2012-03-13 Dmitry V. Levin <ldv (a] altlinux.org> 48663 48664 net.c: recognize MSG_WAITFORONE. 48665 * net.c (msg_flags): Add MSG_WAITFORONE. 48666 48667 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 48668 48669 Treat -ff without -o FILE as single -f. 48670 * strace.c (init): Treat -ff without -o FILE as single -f. 48671 48672 Style fix. No code changes. 48673 * strace.c (process_opt_p_list): Style fix. 48674 48675 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 48676 48677 Reduce stack usage by ~0.5k. 48678 main() uses ~0.5k of stack for local variables and such. When we enter 48679 main tracing loop, most of these variables are no longer used. 48680 But they still take up stack for the entire life of strace. 48681 We can avoid this wastage if we move init code into a separate function. 48682 (Need to be careful and not allow automatic inlining). 48683 48684 * strace.c (init): New function. Most of pre-existing code of 48685 main is now living here. 48686 (main): Call init() to do initialization. 48687 48688 2012-03-12 Denys Vlasenko <vda.linux (a] googlemail.com> 48689 48690 Preparatory cosmetic changes for the next commit. 48691 * strace.c (tprintf): Move function up in the source file. No code changes. 48692 (tprints): Likewise. 48693 (printleader): Likewise. 48694 (tabto): Likewise. 48695 48696 2012-03-11 Dmitry V. Levin <ldv (a] altlinux.org> 48697 48698 Implement sendmmsg syscall decoder. 48699 * linux/dummy.h (sys_sendmmsg): Remove. 48700 * linux/syscall.h (sys_sendmmsg): New prototype. 48701 * net.c (printmmsghdr): Add index argument specifying the element in 48702 mmsghdr array to print. 48703 (decode_mmsg): New function, prints the whole mmsghdr array, its length 48704 and message flags. 48705 (sys_sendmmsg): New function. 48706 (sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding. 48707 48708 Implement sched_rr_get_interval syscall decoder. 48709 * linux/dummy.h (sys_sched_rr_get_interval): Remove. 48710 * linux/syscall.h (sys_sched_rr_get_interval): New prototype. 48711 * process.c (sys_sched_rr_get_interval): New function. 48712 48713 Implement migrate_pages syscall decoder. 48714 * linux/dummy.h (sys_migrate_pages): Remove. 48715 * linux/syscall.h (sys_migrate_pages): New prototype. 48716 * mem.c (sys_migrate_pages): New function. 48717 48718 Implement get_robust_list syscall decoder. 48719 * linux/dummy.h (sys_get_robust_list): Remove. 48720 * linux/syscall.h (sys_get_robust_list): New prototype. 48721 * process.c (sys_get_robust_list): New function. 48722 48723 Define sys_set_robust_list as an alias to sys_munmap. 48724 * linux/dummy.h (sys_set_robust_list): Redefine to sys_munmap. 48725 48726 Implement clock_adjtime syscall decoder. 48727 * linux/dummy.h (sys_clock_adjtime): Remove. 48728 * linux/syscall.h (sys_clock_adjtime): New prototype. 48729 * time.c (do_adjtimex): New function, based on sys_adjtimex. 48730 (sys_adjtimex): Use it. 48731 (sys_clock_adjtime): New function. 48732 48733 Define sys_setns as an alias to sys_inotify_rm_watch. 48734 * linux/dummy.h (sys_setns): Redefine to sys_inotify_rm_watch. 48735 48736 Sort definitions of dummy parsers. No code changes. 48737 * linux/dummy.h: Sort definitions of parsers implemented as aliases. 48738 48739 Correct inotify_rm_watch decoder. 48740 * file.c (sys_inotify_rm_watch): Print second argument as int. 48741 48742 Alias sys_fsync to sys_close. 48743 * file.c (sys_fsync): Remove. 48744 * linux/syscall.h (sys_fsync): Likewise. 48745 * linux/dummy.h (sys_fsync): Alias to sys_close. 48746 * linux/m68k/syscallent.h: Add TD flag to fsync entry. 48747 * linux/microblaze/syscallent.h: Likewise. 48748 * linux/mips/syscallent.h: Likewise. 48749 48750 2012-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 48751 48752 Update ioctl entries. 48753 * linux/ioctlent.h.in: Regenerate from v3.3 headers. 48754 * linux/i386/ioctlent.h.in: Likewise. 48755 48756 strace-log-merge: cleanup. 48757 * strace-log-merge: Redirect usage to stderr, make the check 48758 for numeric suffix simpler. 48759 48760 Add syscall entries for new linux syscalls. 48761 * linux/i386/syscallent.h: Update process_vm_writev handler. 48762 * linux/powerpc/syscallent.h: Likewise. 48763 * linux/x86_64/syscallent.h: Likewise. 48764 * linux/alpha/syscallent.h: Add entries for accept4 and sendmmsg. 48765 * linux/arm/syscallent.h: Add entries for process_vm_readv and 48766 process_vm_writev. 48767 * linux/m68k/syscallent.h: Likewise. 48768 * linux/mips/syscallent.h: Likewise. 48769 * linux/s390/syscallent.h: Likewise. 48770 * linux/s390x/syscallent.h: Likewise. 48771 * linux/sh/syscallent.h: Likewise. 48772 * linux/sh64/syscallent.h: Likewise. 48773 * linux/sparc/syscallent.h: Likewise. 48774 * linux/ia64/syscallent.h: Add entries for process_vm_readv, 48775 process_vm_writev and accept4. 48776 * linux/microblaze/syscallent.h: Add entries for sendmmsg, 48777 process_vm_readv and process_vm_writev. 48778 48779 Implement process_vm_writev decoder. 48780 * process.c (sys_process_vm_writev): New function. 48781 * linux/syscall.h (sys_process_vm_writev): New prototype. 48782 48783 Output iovec length in vmsplice and process_vm_readv decoders. 48784 * io.c (sys_vmsplice): Output iovec length. 48785 * process.c (sys_process_vm_readv): Likewise. 48786 48787 2012-03-09 Dmitry V. Levin <ldv (a] altlinux.org> 48788 48789 swapon: decode swap flags. 48790 * file.c: Include <sys/swap.h>. 48791 (swap_flags): New xlat structure. 48792 (sys_swapon): New function. 48793 * linux/dummy.h (sys_swapon): Remove. 48794 * linux/syscall.h (sys_swapon): New declaration. 48795 48796 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48797 48798 Trivial simplification. 48799 * strace.c (detach): Use waitpid instead of wait4. 48800 48801 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48802 48803 Don't consider PROG to be our child in "strace -D PROG" case. 48804 TCB_STRACE_CHILD is used for the case when "strace PROG" is ^C-ed 48805 or something like that. strace should not just exit - it should 48806 do something with its child (such as signal it too). 48807 48808 In -D case, PROG is not really a child of _strace_, it is a child 48809 of strace's parent. It's ok to handle it exactly as an attached process. 48810 48811 While we are at it, remove nonsensical special-casing of TCB_STRACE_CHILD 48812 in printing of "<unfinished ...>" message. 48813 48814 * strace.c (startup_attach): Don't set TCB_STRACE_CHILD if -D. 48815 (trace): Print "<unfinished ...>" on error regardless of TCB_STRACE_CHILD. 48816 48817 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48818 48819 Fix the case where we try to detach unattached processes. 48820 Before this change: 48821 $ strace -D -p1 48822 strace: -D and -p are mutually exclusive options 48823 Process 1 detached <==== WRONG! (and we try to SIGSTOP it!!!) 48824 48825 * defs.h: Change the meaning of TCB_ATTACHED: now it means "this tracee 48826 is attached to us". Add TCB_STRACE_CHILD: "this tracee is our child". 48827 * strace.c (kill_save_errno): Move up. No code changes. 48828 (process_opt_p_list): Don't set TCB_ATTACHED on new tcb. 48829 (startup_attach): Change how we work with TCB_ATTACHED. 48830 Set TCB_STRACE_CHILD on -D. 48831 (startup_child): Use kill_save_errno instead of kill. 48832 Set TCB_ATTACHED and TCB_STRACE_CHILD on attached strace child. 48833 If we are in -D case, don't set TCB_ATTACHED (we aren't attached yet). 48834 (detach): do not do PTRACE_DETACH if TCB_ATTACHED is not set. 48835 (cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED. 48836 (trace): Likewise. 48837 48838 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48839 48840 Call PTRACE_CONT with addr=0. 48841 * strace.c (trace): Call PTRACE_CONT with addr=0. 48842 48843 install strace-log-merge by "make install" 48844 48845 strace_log_merge: new file. Helper to merge timestamped strace -ff logs. 48846 48847 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48848 48849 Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case. 48850 In this case we were printing PIDs to LOG.* files 48851 even though it is not necessary. 48852 48853 The fix is in the addition of "&& followfork < 2" condition. 48854 48855 * strace.c: Remove pflag_seen variable, add print_pid_pfx one. 48856 (process_opt_p_list): Do not pflag_seen++. 48857 (main): Use "nprocs != 0" condition instead of "pflag_seen != 0". 48858 Set print_pid_pfx before entering main tracing loop. 48859 (printleader): Use print_pid_pfx to decide whether to print pid prefix. 48860 48861 2012-03-09 Denys Vlasenko <vda.linux (a] googlemail.com> 48862 48863 Allow -p PID to take comma or whitespace-separated list of PIDs. 48864 * defs.h: Clarify meaning of TCB_ATTACHED. No code changes. 48865 * strace.c (process_opt_p_list): New function. 48866 (main): Call process_opt_p_list to process -p PIDs argument. 48867 48868 2012-03-08 Denys Vlasenko <vda.linux (a] googlemail.com> 48869 48870 Pass addr=0 instead of 1 into restarting ptrace calls. 48871 While we are at it, fold do_ptrace into its lone caller. 48872 We no longer set tcp->ptrace_errno = ESRCH on ESRC error in upeek. 48873 Other code paths where ptrace fails wern't doing it, and the code which 48874 checks tcp->ptrace_errno even assumes it is never set to ESRCH. 48875 (It was me who added this code sometime ago, so it was my fault 48876 that it was a bit messy) 48877 48878 I ran sigkill_rain test and verified that unfinished syscalls are 48879 still handled correctly. 48880 48881 * util.c (ptrace_restart): Do not pass addr=1 to ptrace(), pass 0 instead. 48882 I have no idea why we were passing 1. Ptrace documentation says 48883 that addr parameter is ignored. 48884 (do_ptrace): Remove this function. 48885 (upeek): Use ptrace() instead of do_ptrace(). 48886 * defs.h: Remove do_ptrace() declaration. 48887 48888 2012-03-08 Denys Vlasenko <vda.linux (a] googlemail.com> 48889 48890 Trivial tweaks to error messages. 48891 * strace.c (test_ptrace_setoptions_followfork): Use kill_save_errno 48892 instead of kill. 48893 (trace): Use perror_msg instead of perror. 48894 * count.c (set_sortby): Use error_msg_and_die instead of fprintf. 48895 * syscall.c (qualify): Likewise. 48896 * util.c (ptrace_restart): Expand error message. 48897 (umoven): Likewise. 48898 (umovestr): Likewise. 48899 (upeek): Use perror_msg instead of sprintf + perror. 48900 48901 2012-02-28 Denys Vlasenko <vda.linux (a] googlemail.com> 48902 48903 Remove stray sys_swapon() declaration. 48904 * linux/syscall.h: Remove stray sys_swapon() declaration. 48905 * linux/mips/syscallent.h: Include dummy.h with correct relative path. 48906 * linux/dummy.h: Tweak one place where spaces are used instead of tabs. 48907 * linux/dummy_check.sh: New script. It helps in finding stray syscall 48908 handler declarations. 48909 48910 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 48911 48912 Correct syscall entries for t[g]kill. 48913 * linux/hppa/syscallent.h: Make tgkill use sys_tgkill, not printargs. 48914 * linux/sh/syscallent.h: Change tkill type TD -> TS. 48915 * linux/sh64/syscallent.h: Likewise. 48916 * linux/mips/syscallent.h: Change tkill type 0 -> TS. 48917 * linux/x86_64/syscallent.h: Likewise. 48918 * linux/avr32/syscallent.h: Likewise. 48919 48920 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 48921 48922 Assorted trivial optimizations. 48923 text data bss dec hex filename 48924 236448 672 19044 256164 3e8a4 strace.before 48925 236360 672 19044 256076 3e84c strace 48926 48927 * file.c (sprintmode): Use smaller static buffer, eliminate strlen call. 48928 (sprinttime): Use smaller static buffer. 48929 (printstat_sparc64): Coalesce two printing calls into one. 48930 (printstat_powerpc32): Likewise. 48931 (printcompat_statfs6): Likewise. 48932 (sys_utime): Do not fetch personality_wordsize[current_personality] 48933 repeatedly - cache it in local variable instead. 48934 * process.c (printargv): Likewise. 48935 * resource.c (sprintrlim): Return const char*, not char*. This allows 48936 to eliminate sprintf(buf, "RLIM_INFINITY"). Use smaller static buffer. 48937 (sprintrlim64): Likewise. 48938 * strace.c (strerror): Use smaller static buffer. 48939 (strsignal): Likewise. 48940 48941 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 48942 48943 Alias a few more syscall printing functions. 48944 text data bss dec hex filename 48945 237384 672 19044 257100 3ec4c strace.before 48946 236448 672 19044 256164 3e8a4 strace 48947 48948 * defs.h: Declare new functions printargs_lu(), printargs_ld() 48949 which simply print syscall all args as unsigned or signed longs. 48950 * desc.c (sys_epoll_create): Call printargs_ld() instead of open-coding it. 48951 * linux/syscall.h: Remove declarations of the following functions: 48952 sys_alarm, sys_getresgid, sys_getsid, sys_nice, sys_setgid, sys_setpgid, 48953 sys_setpgrp, sys_setregid, sys_setresgid. 48954 * process.c (sys_setgid): Delete this function: now aliased to sys_setuid(). 48955 (sys_getresgid): Delete this function: now aliased to sys_getresuid(). 48956 (sys_setregid): Delete this function: now aliased to sys_setreuid(). 48957 (sys_setresgid): Delete this function: now aliased to sys_setresuid(). 48958 (sys_setpgrp): Delete this function: now aliased to printargs_lu(). 48959 (sys_getsid): Likewise. 48960 (sys_setpgid): Likewise. 48961 (sys_alarm): Likewise. 48962 (sys_getpgrp): Delete this function: was unused - was already shadowed 48963 by a define in linux/dummy.h. 48964 (sys_setsid): Likewise. 48965 (sys_getpgid): Likewise. 48966 * resource.c (sys_nice): Delete this function: now aliased to printargs_ld(). 48967 * linux/dummy.h: Define new aliases (see above for the list). 48968 * syscall.c (printargs_lu): New function. 48969 (printargs_ld): New function. 48970 48971 2012-02-27 Denys Vlasenko <vda.linux (a] googlemail.com> 48972 48973 Style fixes, no code changes. 48974 * desc.c (sys_io_getevents): Indentation fix. 48975 * file.c (sys_xstat): Remove space after function name. 48976 (decode_mknod): Indentation fix. 48977 * net.c (printsockopt): Indentation fix. 48978 * process.c (unalignctl_string): Indentation fix. 48979 (sys_sched_getscheduler): Remove space after ! operator. 48980 48981 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 48982 48983 Compress blank lines. 48984 Suppress repeated empty lines left after automated code removal. 48985 This change was made by filtering every source code file through 48986 "cat -s". 48987 48988 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 48989 48990 Remove parts of automake machinery which are not needed on Linux. 48991 This change is a verbatim part of Dmitry's changes to remove support 48992 for non-Linux architectures. 48993 48994 * Makefile.am: Don't install PORTING file. Install README-linux-ptrace file. 48995 Set OS variable to linux unconditionally. 48996 * configure.ac: Remove code to set opsys variable, and its usage. 48997 Remove checks for headers which are never present on Linux. 48998 * m4/stat.m4: Remove 'ifdef LINUX' check. 48999 * m4/statfs.m4: Likewise. 49000 49001 2012-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 49002 49003 Remove and update documentation. 49004 This change is a verbatim part of Dmitry's changes to remove support 49005 for non-Linux architectures. 49006 49007 * PORTING: Deleted. 49008 * INSTALL: Modified. 49009 * README: Modified. 49010 * strace.1: Modified: bugs should be reported to mailing list, not Debian. 49011 * strace.spec: do not install PORTING file. 49012 49013 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 49014 49015 Remove a few more code parts which are unused on Linux. 49016 This change is abapted from Dmitry's changes to remove support for 49017 non-Linux architectures. 49018 49019 * Makefile.am: Remove if LINUX/endif pairs. 49020 * defs.h: Remove stream_ioctl() declaration. 49021 * ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block. 49022 * resource.c: Use 'defined(FOO)' instead of 'defined FOO' form. 49023 * util.c: Likewise. 49024 * signal.c: Remove conditional includes which are never used on Linux. 49025 * stream.c: Likewise. 49026 * file.c: Remove excessive empty lines. 49027 49028 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 49029 49030 Build fixes after non-Linux code removal. 49031 * configure.ac: Remove calls to proc-based ptrace checks. 49032 * proc.c: Remove, it's empty now. 49033 * Makefile.am: Remove reference to proc.c. 49034 * net.c: Remove trailing newlines. 49035 * quota.c: Likewise 49036 * resource.c: Likewise 49037 * strace.c: Likewise 49038 * stream.c: Likewise 49039 * time.c: Likewise 49040 49041 Fix defined(FOO) style. 49042 * file.c: Consistently use defined(FOO) instead of defined (FOO). 49043 * mem.c: Likewise. 49044 * net.c: Likewise. 49045 * signal.c: Likewise. 49046 * sock.c: Likewise. 49047 * linux/mips/syscallent.h: Likewise. 49048 49049 Reindent preprocessor directives in util.c; fix style. 49050 * util.c: Fix indentation of preprocessor directives broken by 49051 automatic removal of non-Linux code. Fix style to use consistent 49052 defined(FOO) instead of defined (FOO). 49053 49054 Reindent preprocessor directives in syscall.c; fix style. 49055 * syscall.c: Fix indentation of preprocessor directives broken by 49056 automatic removal of non-Linux code. Fix style to use consistent 49057 defined(FOO) instead of defined (FOO). 49058 49059 Reindent defs.h preprocessor directives. 49060 * defs.h: Fix indentation of preprocessor directives broken by 49061 automatic removal of non-Linux code. 49062 49063 Cleanup after non-Linux code removal. 49064 Conditions such as defined(LINUX) are always true now, 49065 defined(FREEBSD) etc are always false. 49066 When if directive has them as subexpressions, it can be simplified. 49067 Another trivial changes here are fixes for directive indentation. 49068 49069 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 49070 49071 Manual removal of non-Linux source, documentation, etc. 49072 Remove non-Linux source directories: freebsd/, svr4/, sunos4/, svr4/. 49073 Remove README-freebsd, README-sunos4, README-svr4, m4/procfs.m4. 49074 49075 linux/sparc/{errnoent1,ioctlent1,signalent1}.h used to point to svr4/ files - 49076 replace their contents with copies of used (and now deleted) files. 49077 Make linux/sparc64/{errnoent1,ioctlent1,signalent1}.h include these files 49078 instead of svr4/* ones. 49079 49080 Makefile.am: remove references to deleted files. 49081 configure.ac: Remove a few tests which make no sense on Linux. 49082 Man page: remove non-Linux quirks information. 49083 49084 2012-02-25 Denys Vlasenko <vda.linux (a] googlemail.com> 49085 49086 Automated removal of non-Linux code. 49087 This change is generated by running every source through the following command: 49088 49089 unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD 49090 -USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS 49091 -UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c 49092 49093 2012-02-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49094 49095 When accessing data blocks, truncate addr to wordsize. 49096 * util.c (umoven): Truncate addr to wordsize before use. 49097 49098 2012-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 49099 49100 strace.1: fix a typo. 49101 * strace.1: Fix a typo in example description. 49102 This fixes Debian bug #653309. 49103 49104 Fix sockaddr_un.sun_path name in decoded output. 49105 * net.c (printsock): Show sockaddr_un.sun_path as "sun_path". 49106 This fixes Debian bug #554946. 49107 49108 Avoid potential core file clobbering on exit. 49109 * strace.c (main): Set RLIMIT_CORE to zero before terminating itself 49110 with a deadly signal. 49111 This fixes Debian bug #656398. 49112 49113 2012-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 49114 49115 Eliminate native_scno and known_scno. 49116 * defs.h (known_scno): Remove. 49117 (sysent): Remove native_scno field. 49118 * process.c [IA64]: Replace known_scno(tcp) with tcp->scno. 49119 (internal_fork) [USE_PROCFS || !LINUX]: Likewise. 49120 * syscall.c: Do not define NR_SYSCALL_BASE. 49121 (known_scno): Remove. 49122 (syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp) 49123 with tcp->scno. 49124 (trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise. 49125 (syscall_fixup_on_sysexit) [SUNOS4]: Likewise. 49126 49127 Remove initialization of native_scno field. 49128 * linux/i386/syscallent.h: Remove native_scno initialization for clone, 49129 fork and vfork. 49130 * linux/ia64/syscallent.h (sys_fork, sys_vfork): Remove redirections 49131 to printargs. 49132 * linux/syscall.h [IA64]: Do not define SYS_fork and SYS_vfork. 49133 * util.c (printcall) [IA64]: Likewise. 49134 (setbpt): Use sys_func to check for clone, fork and vfork syscalls. 49135 49136 Do not use SYS_ipc and SYS_socketcall. 49137 * linux/dummy.h (sys_ipc, sys_socketcall): Remove redirections to 49138 printargs. 49139 * linux/ia64/syscallent.h: Likewise. 49140 * linux/i386/syscallent.h: Remove native_scno initialization for "ipc" 49141 and "socketcall". 49142 * linux/syscall.h (sys_ipc, sys_socketcall): New prototypes. 49143 (SYS_ipc, SYS_socketcall): Remove no longer used constants. 49144 [IA64]: Remove undefining of ipc and socket SYS_* constants. 49145 [SPARC || SPARC64]: Remove unused ipc SYS_* constants. 49146 * ipc.c (sys_ipc): New function. 49147 * sock.c (sys_socketcall): Likewise. 49148 * syscall.c (trace_syscall_entering): Use sys_func to check for ipc and 49149 socket subcalls. 49150 49151 2012-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 49152 49153 Remove initialization of native_scno field for most of syscalls. 49154 The native_scno field is not so much used in the code than before. 49155 In many cases sys_func is checked instead, and for most of syscall 49156 entries there is no need to initialize native_scno. 49157 49158 * linux/i386/syscallent.h: Remove native_scno initialization for 49159 _exit, read, write, waitpid, execve, wait4, sysfs, readv, writev, 49160 pread64, pwrite64, exit_group, waitid, send, recv, sendto and 49161 recvfrom syscall entries. 49162 * linux/syscall.h: Do not define no longer used SYS_waitid and 49163 SYS_sub_* constants. 49164 [IA64]: Do not define SYS_waitpid and SYS32_* constants. 49165 * defs.h: Do not define no longer used __NR_exit_group constant. 49166 * strace.c [USE_PROCFS] (proc_open): Use sys_func to check for execve. 49167 49168 2012-02-14 Mike Frysinger <vapier (a] gentoo.org> 49169 49170 util: check for process_vm_readv in C library. 49171 glibc-2.15 provides process_vm_readv, so trying to provide it ourselves 49172 with that version fails. 49173 49174 * configure.ac (AC_CHECK_FUNCS): Add process_vm_readv. 49175 * util.c: Handle HAVE_PROCESS_VM_READV. 49176 49177 2012-02-09 Denys Vlasenko <vda.linux (a] googlemail.com> 49178 49179 README-linux-ptrace: correct the description of suppressed signals. 49180 49181 2012-02-06 Dmitry V. Levin <ldv (a] altlinux.org> 49182 49183 strace -P: fix handling of invalid syscalls. 49184 * pathtrace.c (pathtrace_match): Check the given syscall number using 49185 SCNO_IN_RANGE. 49186 49187 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49188 49189 Skip the syscall entry if the sys_func field is NULL. 49190 Avoid NULL dereference when there are holes in sysent tables. 49191 It can happen with syscall (number, ...) and number is in those holes. 49192 There are no targets with holey systent tables so far, but at least 49193 one such a target, x32, is already on the horizon. 49194 49195 * defs.h (SCNO_IN_RANGE): Also check the sys_func field. 49196 49197 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49198 49199 Define RLIM64_INFINITY only if not defined. 49200 * resource.c (RLIM64_INFINITY): Define only if it isn't defined. 49201 49202 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49203 49204 Cast to long for %l in printf. 49205 Cast a value to long for %l in printf to avoid compiler warning 49206 on systems where it may be long long. 49207 49208 * count.c (call_summary_pers): Cast to long. 49209 * ipc.c (sys_mq_open, printmqattr): Likewise. 49210 * quota.c (decode_cmd_data): Likewise. 49211 * resource.c (sys_sysinfo): Likewise. 49212 * time.c (tprint_timex): Likewise. 49213 49214 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49215 49216 Check HAVE_LONG_LONG_OFF_T when printing offset. 49217 When HAVE_LONG_LONG_OFF_T is defined, we need to use %llu to print 49218 offset. 49219 49220 * io.c (sys_sendfile): Check HAVE_LONG_LONG_OFF_T when printing 49221 offset. 49222 49223 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49224 49225 Define old stat functions only if needed. 49226 When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't 49227 used and strace won't link since they use realprintstat which isn't 49228 defined when HAVE_LONG_LONG_OFF_T is defined. 49229 49230 * file.c (convertoldstat, sys_oldstat, sys_oldfstat, sys_oldlstat): 49231 Define only if HAVE_LONG_LONG_OFF_T isn't defined. 49232 49233 2012-02-06 H.J. Lu <hongjiu.lu (a] intel.com> 49234 49235 Print NULL for zero address in sys_mmap64. 49236 * mem.c (sys_mmap64): Print NULL for zero address so that it is 49237 consistent with sys_mmap. 49238 49239 2012-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 49240 49241 Remove unused sys_pread64 and sys_pwrite64 parsers on Linux. 49242 * io.c [HAVE_LONG_LONG_OFF_T]: Remove sys_pread64 and sys_pwrite64 49243 aliases. 49244 (sys_pread64, sys_pwrite64): Define these functions only on 49245 [SVR4 && _LFS64_LARGEFILE] platform. 49246 * linux/mips/syscallent.h: Use sys_pread and sys_pwrite to handle 49247 appropriate syscalls. 49248 * linux/syscall.h (sys_pread64, sys_pwrite64): Remove. 49249 * syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only on 49250 [SVR4 && _LFS64_LARGEFILE] platform. 49251 49252 2012-02-03 Denys Vlasenko <vda.linux (a] googlemail.com> 49253 49254 Trivial changes to help text. No code changes. 49255 * strace.c (usage): Tweak help text: remove unpaired closing brackets, 49256 make -V and -h sit on separate lines (hard to see them otherwise). 49257 49258 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 49259 49260 Simple optimizations. 49261 text data bss dec hex filename 49262 239474 672 20484 260630 3fa16 strace.before 49263 239234 668 19044 258946 3f382 strace 49264 49265 * file.c (sprint_open_modes): Reduce static buffer size. 49266 Simplify separator printing. 49267 * signal.c (sprintsigmask): Reduce static buffer size. 49268 Simplify separator printing and printing of almost full masks. 49269 Use stpcpy instead of sprintf and strcpy+strlen. 49270 * strace.c (startup_child): Don't strchr() for ':' twice in a row. 49271 * util.c (sprintflags): Exit loop early if possible. 49272 49273 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 49274 49275 Trivial optimization. 49276 * strace.c (cleanup): Read 'interrupted' volatile variable only once. 49277 49278 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 49279 49280 Make interactive-ness directly controllable via command line option. 49281 Defaults are often ok, but when they are not, people get confused. 49282 "Why can't I kill strace?" and "Why strace dies on ^C when I want 49283 to _tracee_ to die instead?" are typical complaints. 49284 49285 * strace.c: Replace 'interactive' variable with 'opt_intr' variable. 49286 Define INTR_foo constants for its possible values. 49287 Define 'interactive' as a macro. 49288 (usage): Document -I n option. 49289 (main): Parse -I n option, modify signal handling to accomidate new 49290 -I 1 and -I 4 modes. 49291 49292 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 49293 49294 Suppress compiler warning. 49295 * strace.c (trace): Frame potentially unused label with ifdef/endif. 49296 49297 On Ctrl-C induced detach, send SIGINT to child tracee, not SIGTERM. 49298 * strace.c (interrupt): Remember signal number. 49299 (cleanup): If we exiting due to signal, send that signal to child tracee. 49300 49301 2012-01-29 Denys Vlasenko <vda.linux (a] googlemail.com> 49302 49303 Add experimental code to use PTRACE_SEIZE, disabled by default. 49304 All new code is predicated on "ifdef USE_SEIZE". If it is not defined, 49305 behavior is not changed. 49306 49307 If USE_SEIZE is enabled and run-time check shows that PTRACE_SEIZE works, then: 49308 - All attaching is done with PTRACE_SEIZE + PTRACE_INTERRUPT. 49309 This means that we no longer generate (and possibly race with) SIGSTOP. 49310 - PTRACE_EVENT_STOP will be generated if tracee is group-stopped. 49311 When we detect it, we issue PTRACE_LISTEN instead of PTRACE_SYSCALL. 49312 This leaves tracee stopped. This fixes the inability to SIGSTOP or ^Z 49313 a straced process. 49314 49315 * defs.h: Add commented-out "define USE_SEIZE 1" and define PTRACE_SEIZE 49316 and related constants. 49317 * strace.c: New variable post_attach_sigstop shows whether we age going 49318 to expect SIGSTOP on attach (IOW: are we going to use PTRACE_SEIZE). 49319 (ptrace_attach_or_seize): New function. Uses PTRACE_ATTACH or 49320 PTRACE_SEIZE + PTRACE_INTERRUPT to attach to given pid. 49321 (startup_attach): Use ptrace_attach_or_seize() instead of ptrace(PTRACE_ATTACH). 49322 (startup_child): Conditionally use alternative attach method using PTRACE_SEIZE. 49323 (test_ptrace_setoptions_followfork): More robust parameters to PTRACE_TRACEME. 49324 (test_ptrace_seize): New function to test whether PTRACE_SEIZE works. 49325 (main): Call test_ptrace_seize() while initializing. 49326 (trace): If PTRACE_EVENT_STOP is seen, restart using PTRACE_LISTEN in order 49327 to not let tracee run. 49328 * process.c: Decode PTRACE_SEIZE, PTRACE_INTERRUPT, PTRACE_LISTEN. 49329 * util.c (ptrace_restart): Add "LISTEN" to a possible error message. 49330 49331 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 49332 49333 process_vm_readv gets EINVAL if process is gone (SIGKILLed). Don't complain. 49334 * util.c (umoven): Don't complain on EINVAL from process_vm_readv. 49335 (umovestr): Likewise. 49336 49337 Revert last change. Add a comment to prevent further misunderstanding. 49338 * time.c (sys_nanosleep): Display remaining time only on interrupt. 49339 49340 Fix nanosleep decoding: second argument was not shown after success. 49341 * time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check. 49342 * syscall.c (is_restart_error): Remove redundant check. 49343 49344 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 49345 49346 Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks. 49347 Currently, we use PTRACE_PEEKDATA to read things like filenames and 49348 data passed by I/O syscalls. 49349 PTRACE_PEEKDATA gets one word per syscall. This is VERY expensive. 49350 For example, in order to print fstat syscall, we need to perform 49351 more than twenty trips into kernel to fetch one struct stat! 49352 49353 Kernel 3.2 got a new syscall, process_vm_readv(), which can be used to 49354 copy data blocks out of process' address space. 49355 49356 This change uses it in umoven() and umovestr() functions if possible, 49357 with fallback to old method if process_vm_readv() fails. 49358 If it returns ENOSYS, we don't try to use it anymore, eliminating 49359 overhead of trying it on older kernels. 49360 49361 Result of "time strace -oLOG ls -l /usr/lib >/dev/null": 49362 before patch: 0.372s 49363 After patch: 0.262s 49364 49365 * util.c (process_vm_readv): Wrapper to call process_vm_readv syscall. 49366 (umoven): Use process_vm_readv for block reads of tracee memory. 49367 (umovestr): Likewise. 49368 * linux/syscall.h: Declare new function sys_process_vm_readv. 49369 * process.c (sys_process_vm_readv): Decoder for new syscall. 49370 * linux/i386/syscallent.h: Add process_vm_readv, process_vm_writev syscalls. 49371 * linux/x86_64/syscallent.h: Likewise. 49372 * linux/powerpc/syscallent.h: Likewise. 49373 49374 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 49375 49376 Fix a case of broken output if last seen syscall was exit. 49377 * defs.h: Rename tcp_last to printing_tcp. Explain what it means. 49378 Remove printtrailer() function. 49379 * process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL". 49380 * strace.c: Add new variable printing_tcp. 49381 (cleanup): Convert printtrailer() call to "printing_tcp = NULL". 49382 (trace): Likewise. 49383 (trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit. 49384 (printleader): Set printing_tcp. 49385 (printtrailer): Remove this function. 49386 * syscall.c: Remove tcp_last variable. 49387 (trace_syscall_entering): Don't set printing_tcp, printleader call now does it. 49388 (trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL". 49389 49390 2012-01-28 Denys Vlasenko <vda.linux (a] googlemail.com> 49391 49392 Fix handling of test/threaded_execve.c testcase. 49393 Since 3.0, Linux has a way to identify which thread execve'ed. 49394 This patch makes use of it in order to properly dispose 49395 of disappeared ("superseded") thread leader, 49396 and replace it with execve'ed thread. 49397 49398 Before this patch, strace was "leaking" thread which exec'ed. 49399 It was thinking that it still runs. It would look like this: 49400 49401 18460 pause( <unfinished ...> <=== thread leader 49402 18466 execve("/proc/self/exe", ["exe", "exe"], [/* 47 vars */] <unfinished ...> 49403 18465 +++ exited with 0 +++ <=== exits from other threads 49404 18460 <... pause resumed> ) = 0 49405 49406 The last line is wrong: it's not pause resumed, it's execve resumed. 49407 If thread leader would do exit instead of pause, it is much worse: 49408 strace panics because it thinks it sees return from exit syscall! 49409 49410 And strace isn't aware 18466 (exec'ed thread) is gone. 49411 It still thinks it's executes execve syscall. 49412 49413 * strace.c: New variable "static char *os_release". 49414 (get_os_release): New static function. 49415 (main): Call get_os_release to retrieve Linux version. 49416 (trace): If we see PTRACE_EVENT_EXEC, retrieve old pid, and if it 49417 differs from new one, free one of tcbs and print correct messages. 49418 49419 2012-01-27 Denys Vlasenko <vda.linux (a] googlemail.com> 49420 49421 Fix readlink result display - was printing bogus "..." semi-randomly. 49422 * file.c (decode_readlink): Use printstr() instead of printpathn(). 49423 49424 Add new test program: test/threaded_execve.c. 49425 49426 Make pid2tcb static. 49427 * defs.h: Remove pid2tcb declaration. 49428 * strace.c (pid2tcb): Make this function static. 49429 49430 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49431 49432 Per Dmitry's request, remove paranoid check in verror_msg() 49433 * strace.c (verror_msg): Remove redundant check for msg != NULL. 49434 49435 More robust error check for vasprintf. 49436 * strace.c (verror_msg): More robust error check for vasprintf. 49437 49438 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49439 49440 Slightly more compact handling of argv[] 49441 text data bss dec hex filename 49442 238274 672 20484 259430 3f566 strace.before 49443 238226 672 20484 259382 3f536 strace 49444 49445 * strace.c (main): Slightly more compact handling of argv[] 49446 49447 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49448 49449 Trivial optimization. 49450 * strace.c: Set default interactive = 1 statically instead 49451 of doing it in main(). 49452 49453 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49454 49455 Allocate -o OUTFILE buffer only if needed. 49456 text data bss dec hex filename 49457 238258 668 28676 267602 41552 strace.before 49458 238274 668 20484 259426 3f562 strace 49459 49460 * strace.c (main): Allocate -o OUTFILE buffer only if needed: 49461 unused buffer in bss is not entirely free. 49462 49463 2012-01-24 Denys Vlasenko <vda.linux (a] googlemail.com> 49464 49465 Use single fprintf in verror_msg() 49466 This change partially reverts commit 44d0532. 49467 49468 In code before commit 44d0532, single fprintf was used on purpose: 49469 we want to send entire message as one write() call. Since stderr 49470 is unbuffered, separate fprintf's to it always result in separate 49471 writes, they are not coalesced. If we aren't the only program 49472 which writes to this particular stderr, this may result 49473 in interleaved messages. 49474 49475 Since this function is not performance critical, I guess 49476 it's ok to make it less efficient. 49477 49478 * strace.c (verror_msg): Attempt to print the message in single 49479 write operation. Use separate fprintfs as a fallback if malloc fails. 49480 49481 2012-01-21 Denys Vlasenko <vda.linux (a] googlemail.com> 49482 49483 Improve code readability (logic is unchanged) 49484 * util.c (umoven): Move assignment out of function call. Make assignment 49485 to a flag variable later, closer to the place where it will be used. 49486 (umovestr): Likewise. 49487 (uload): Likewise. 49488 49489 2012-01-20 Denys Vlasenko <vda.linux (a] googlemail.com> 49490 49491 Change umovestr API: return > 0 instead of 0 if NUL was seen. 49492 * pathtrace.c (upathmatch): Adjust umovestr return value check for new API. 49493 * util.c (printpathn): Use umovestr() > 0 return value for more efficient 49494 (and robust - we don't depend on "no overwrote past NUL" behavior anymore) 49495 handling of terminating NUL. 49496 (printstr): Remove useless NUL placement before umovestr() call. 49497 Allocate 1 byte more to outstr[] array - for NUL. 49498 (umovestr): Change to return 1 if NUL was seen. 49499 49500 umovestr result may have no NUL, use "%.*s" instead of "%s" to print it. 49501 * system.c (sys_mount): Be careful when printing umovestr result, 49502 it may have no terminating NUL. 49503 (sys_sysmips): Likewise. 49504 49505 2012-01-20 Denys Vlasenko <vda.linux (a] googlemail.com> 49506 49507 Eliminate code duplication in time printing, reduce a few static buffers 49508 text data bss dec hex filename 49509 238454 664 28772 267890 41672 strace.before 49510 238106 664 28676 267446 414b6 strace 49511 49512 * defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines. 49513 Add 'int special' parameter to sprinttv(). 49514 * time.c (sprinttv): Add 'int special' parameter, and use it 49515 similarly to 'int special' parameter of printtv_bitness(). 49516 (printtv_bitness): Use sprinttv() instead of duplicating its code. 49517 (print_timespec): Use sprint_timespec() instead of duplicating 49518 its code. 49519 * desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128 49520 when checking remaining buffer size. 49521 * net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128 49522 for static buffer size. 49523 * stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128 49524 when checking remaining buffer size. 49525 49526 2012-01-19 Denys Vlasenko <dvlasenk (a] redhat.com> 49527 49528 Reduce bss usage and speed up string printing. 49529 text data bss dec hex filename 49530 237913 660 49284 287857 46471 strace.before 49531 237973 660 28772 267405 4148d strace 49532 49533 This reduces L1 D-cache pressure a bit: instead of dirtying 49534 20k of bss, we will reuse already dirty stack area. 49535 49536 * util.c (printpathn): Use on-stack buffers instead of static ones. 49537 Saves 5*MAXPATHLEN in bss. 49538 (printstr): Use tprints() instead of tprintf("%s") when printing 49539 formatted string. May be a bit faster, depending on libc. 49540 49541 2012-01-18 Andreas Schwab <schwab (a] linux-m68k.org> 49542 49543 Add support for compat_statfs64. 49544 * file.c (struct compat_statfs64, printcompat_statfs64): Define. 49545 (sys_statfs64, sys_fstatfs64): Use it. 49546 49547 Add support for statfs64.f_flags. 49548 * file.c (printstatfs64): Print f_flags if available. 49549 49550 Fix missing parens. 49551 * signal.c (sys_sigreturn): Add missing parens. 49552 49553 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 49554 49555 Get rid of TCB_SIGTRAPPED. 49556 On attempts to block or set SIGTRAP handler, 49557 for example, using sigaction syscall, we generate 49558 an additional SIGSTOP. 49559 49560 This change gets rid of this SIGSTOP sending/ignoring. 49561 It appears to work just fine. 49562 49563 It also works if I force strace to not use PTRACE_O_TRACESYSGOOD, 49564 which means strace stops will be marked with SIGTRAP, 49565 not (SIGTRAP | 0x80) - I wondered maybe that's when 49566 this hack is needed. 49567 49568 So, why we even have TCB_SIGTRAPPED? No one knows. It predates 49569 version control: this code was present in the initial commit, 49570 in 1999. No adequate comments, either. 49571 49572 Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction 49573 and sys_sigprocmask syscalls - the ones which are most usually 49574 used to implement signal blocking, it is only set in obsolete 49575 sys_signal, sys_sigaction, sys_sigsetmask, and in some dead 49576 non-Linux code. 49577 49578 I think whatever bug it was fixing is gone long ago - 49579 at least as long as sys_rt_sigaction is used by glibc. 49580 Again, since glibc (and uclibc) uses sys_rt_sigaction 49581 and sys_sigprocmask, modified code paths are not used 49582 by most programs anyway. 49583 49584 * defs.h: Remove definition of TCB_SIGTRAPPED. 49585 * signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP. 49586 (sys_sigsetmask): Likewise. 49587 (sys_sigaction): Likewise. 49588 (sys_signal): Likewise. 49589 * strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set. 49590 49591 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 49592 49593 When we write log, flush output buffers in a few more cases. 49594 I observed a case when signal delivery message was buffered 49595 by stdio until it was flushed along with the next syscall 49596 entry message. 49597 49598 * strace.c (trace): Flush output buffers in a few more cases. 49599 49600 2012-01-18 Denys Vlasenko <dvlasenk (a] redhat.com> 49601 49602 Fix old sigaction display. 49603 * signal.c (sys_sigaction): Fix display of sigaction with 49604 SIG_DFL/SIG_IGN handlers. 49605 49606 Change x86_64_regs struct type from pt_regs to user_regs_struct. 49607 * syscall.c: Change x86_64_regs struct type from 49608 pt_regs to user_regs_struct, and explain the change in comment. 49609 49610 2012-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 49611 49612 Fix struct pt_regs declaration on i386 and x86-64. 49613 * defs.h [I386] (i386_regs): Replace definition with declaration. 49614 [X86_64] (x86_64_regs): Remove. 49615 * syscall.c [X86_64] (x86_64_regs): Make static. 49616 49617 2012-01-12 Denys Vlasenko <dvlasenk (a] redhat.com> 49618 49619 Make ERESTARTxyz messages more descriptive. 49620 There is widespread confusion about exact meaning 49621 of ERESTARTxyz codes. Before this change, we were showing 49622 all four of them the same: as "(To be restarted)". 49623 49624 This change prints better explanations for these codes, 49625 and contains verbose comments which explain *why* we display 49626 codes that way - or else someone confused 49627 is bound to come later and mangle them again. 49628 New messages are: 49629 49630 ERESTARTSYS (To be restarted if SA_RESTART is set) 49631 ERESTARTNOINTR (To be restarted) 49632 ERESTARTNOHAND (Interrupted by signal) 49633 ERESTART_RESTARTBLOCK (Interrupted by signal) 49634 49635 * syscall.c (trace_syscall_exiting): Make ERESTARTxyz messages 49636 more descriptive. 49637 49638 2012-01-10 Denys Vlasenko <dvlasenk (a] redhat.com> 49639 49640 Fix sigreturn arg count from 1 to 0 on all architectures. 49641 * linux/alpha/syscallent.h: Change [rt_]sigreturn's arg count to 0. 49642 * linux/arm/syscallent.h: Likewise. 49643 * linux/avr32/syscallent.h: Likewise. 49644 * linux/bfin/syscallent.h: Likewise. 49645 * linux/m68k/syscallent.h: Likewise. 49646 * linux/microblaze/syscallent.h: Likewise. 49647 * linux/mips/syscallent.h: Likewise. 49648 * linux/powerpc/syscallent.h: Likewise. 49649 * linux/sh/syscallent.h: Likewise. 49650 * linux/sh64/syscallent.h: Likewise. 49651 * linux/sparc/syscallent.h: Likewise. 49652 * linux/tile/syscallent.h: Likewise. 49653 49654 2012-01-10 Denys Vlasenko <dvlasenk (a] redhat.com> 49655 49656 Display mask on enter to sigreturn, not on exit. 49657 sys_sigreturn() performs ugly manipulations in order to show 49658 signal mask which is restored by this syscall: on syscall entry, 49659 fetches it from the stack, saves it in tcp->u_arg[] 49660 (where it used to overflow this array - fixed sometime ago), 49661 then retrieves the mask and displays it on syscall exit. 49662 49663 Apparently, the motivation is to make it slightly more obvious 49664 to user that signal mask is restored only when this syscall returns. 49665 IMO, this hardly justifies the necessary hacks. It is much easier 49666 to display the mask at the point when we fetch it - on syscall entry. 49667 49668 While at it, I made it so that we do display returned value/errno. 49669 I see no point in hiding it and showing uninformative "= ?" instead. 49670 49671 Example of pause() being interrupted by ALRM which has installed handler 49672 which re-arms ALRM: 49673 49674 Before the patch: 49675 49676 rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted) 49677 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) --- 49678 alarm(1) = 0 49679 sigreturn() = ? (mask now [INT]) 49680 49681 After: 49682 49683 rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted) 49684 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) --- 49685 alarm(1) = 0 49686 sigreturn() (mask [INT]) = -1 EINTR (Interrupted system call) 49687 49688 * defs.h: Declare struct pt_regs i386_regs and struct pt_regs x86_64_regs. 49689 * syscall.c: Remove "static" keywork from these structures' definitions. 49690 * signal.c (sys_sigreturn): Display mask on enter, not on exit. 49691 49692 2012-01-04 Denys Vlasenko <dvlasenk (a] redhat.com> 49693 49694 Do not detach from tracee which experienced ptrace error. 49695 Before this patch, if a thread got nuked by exit in another thread 49696 and we happened to poke it at the same time, we print "????(" thingy 49697 and detach the thread. Since we removed "detach before death" logic, 49698 this no longer matches the behavior of other threads. 49699 Before patch: 49700 [pid 1780] exit_group(1) = ? 49701 [pid 1778] ????( <unfinished ...> 49702 Process 1778 detached 49703 [pid 5860] +++ exited with 1 +++ 49704 After: 49705 [pid 17765] exit_group(1) = ? 49706 [pid 21680] ????( <unfinished ...> 49707 [pid 17791] +++ exited with 1 +++ 49708 [pid 21680] +++ exited with 1 +++ 49709 49710 * strace (trace): Do not detach from tracee which experienced ptrace error. 49711 49712 2012-01-04 Denys Vlasenko <dvlasenk (a] redhat.com> 49713 49714 Remove sig parameter from detach() 49715 * strace.c (detach): Drop sig parameter - it is zero in all calls. 49716 (cleanup): Don't pass sig = 0 to detach() call. 49717 (detach): Ditto. 49718 49719 2011-12-26 Dmitry V. Levin <ldv (a] altlinux.org> 49720 49721 Enhance decoding for personalities with small wordsize. 49722 * util.c (umoven, umovestr) [SUPPORTED_PERSONALITIES > 1]: If current 49723 personality's wordsize is less than sizeof(long), use only significant 49724 bits of the given address. 49725 49726 2011-12-23 Dmitry V. Levin <ldv (a] altlinux.org> 49727 49728 Enhance personality switching. 49729 On syscall entry, save current personality in the tcb structure 49730 along with scno. 49731 On syscall exit, restore current personality from the tcb structure. 49732 * defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers 49733 field. 49734 * strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize 49735 tcp->currpers. 49736 * syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New 49737 function. 49738 (get_scno, trace_syscall_exiting): Use it. 49739 49740 Reported-by: Michael A Fetterman <mafetter (a] nvidia.com> 49741 49742 2011-12-01 Dmitry V. Levin <ldv (a] altlinux.org> 49743 49744 * net.c (socktcpoptions): Add more TCP_* constants from linux/tcp.h. 49745 Reported-by: Rick Jones <rick.jones2 (a] hp.com> 49746 49747 2011-12-01 Heiko Carstens <heiko.carstens (a] de.ibm.com> 49748 49749 Fix sys_ipc/sys_semtimedop decoding on s390. 49750 The s390 kernel sys_ipc system call only takes five arguments instead of 49751 six arguments which the common code sys_ipc implementation takes. 49752 One of the arguments of the sys_semtimedop subcall is therefore passed in 49753 a different register than in the common code implementation. 49754 This leads to broken decoding of the timespec argument: 49755 49756 semtimedop(0, 0x3ffffb43832, 1, {...}) = -1 EAGAIN 49757 49758 Fixed it looks like this: 49759 49760 semtimedop(0, 0x3ffffc2c842, 1, {0, 10000000}) = -1 EINTR 49761 49762 * linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390. 49763 49764 2011-11-29 Dmitry V. Levin <ldv (a] altlinux.org> 49765 49766 strace.c (trace): Fix compilation warning. 49767 49768 2011-11-28 Dmitry V. Levin <ldv (a] altlinux.org> 49769 49770 linux/syscall.h: Remove redundant function declarations. 49771 Remove 51 function declarations aliased to other declarations in 49772 linux/dummy.h file. 49773 49774 linux/syscall.h: Sort function declarations. 49775 49776 linux/syscall.h: Place one function declaration per line. 49777 49778 Remove redundant parsers. 49779 * desc.c (sys_dup): Remove. 49780 * file.c (sys_pivotroot, sys_rmdir, sys_fchdir, sys_chroot, sys_fchroot, 49781 sys_unlink, sys_symlink, sys_rename): Remove. 49782 * linux/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_pivotroot, 49783 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 49784 * linux/dummy.h: Add aliases for sys_chroot, sys_dup, sys_pivotroot, 49785 sys_rename, sys_rmdir, sys_symlink, sys_unlink. 49786 * pathtrace.c (pathtrace_match): Update. 49787 * sunos4/dummy.h: Add aliases for sys_chroot, sys_dup, sys_fchdir, 49788 sys_fchroot, sys_rename, sys_rmdir, sys_symlink, sys_unlink. 49789 * svr4/dummy.h: Likewise. 49790 * sunos4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot, 49791 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 49792 * svr4/syscall.h (sys_chroot, sys_dup, sys_fchdir, sys_fchroot, 49793 sys_rename, sys_rmdir, sys_symlink, sys_unlink): Remove. 49794 49795 Reflect the fact that nfsservctl syscall was removed from linux kernels. 49796 linux/dummy.h: Move nfsservctl to "unimplemented" section. 49797 49798 2011-11-27 Dmitry V. Levin <ldv (a] altlinux.org> 49799 49800 x86_64: add getcpu syscall entry. 49801 * linux/x86_64/syscallent.h: Add syscall entry for getcpu. 49802 49803 2011-11-26 Dmitry V. Levin <ldv (a] altlinux.org> 49804 49805 Add syscall entries for new linux syscalls. 49806 * linux/dummy.h: Add printargs parsers for new syscalls. 49807 * linux/arm/syscallent.h: Add entries for sys_clock_adjtime, 49808 sys_name_to_handle_at, sys_open_by_handle_at, sys_sendmmsg, sys_setns 49809 and sys_syncfs. 49810 * linux/i386/syscallent.h: Likewise. 49811 * linux/ia64/syscallent.h: Likewise. 49812 * linux/mips/syscallent.h: Likewise. 49813 * linux/powerpc/syscallent.h: Likewise. 49814 * linux/sh/syscallent.h: Likewise. 49815 * linux/sh64/syscallent.h: Likewise. 49816 * linux/sparc/syscallent.h: Likewise. 49817 * linux/x86_64/syscallent.h: Likewise. 49818 * linux/alpha/syscallent.h: Add entries for sys_clock_adjtime, 49819 sys_name_to_handle_at, sys_open_by_handle_at, sys_setns and sys_syncfs. 49820 * linux/m68k/syscallent.h: Likewise. 49821 * linux/microblaze/syscallent.h: Likewise. 49822 * linux/s390/syscallent.h: Likewise. 49823 * linux/s390x/syscallent.h: Likewise. 49824 * linux/avr32/syscallent.h: Add entry for sys_setns. 49825 * linux/bfin/syscallent.h: Add entries for sys_sendmmsg and sys_setns. 49826 * linux/hppa/syscallent.h: Add entries for sys_clock_adjtime, 49827 fanotify_init, fanotify_mark, sys_name_to_handle_at, 49828 sys_open_by_handle_at, sys_sendmmsg, sys_setns and sys_syncfs. 49829 49830 Fix prctl syscall entries. 49831 * linux/mips/syscallent.h: Fix prctl handler. 49832 * linux/tile/syscallent.h: Likewise. 49833 49834 arm: fix io_* syscall entries. 49835 * linux/arm/syscallent.h: Fix handlers for io_setup, io_destroy, 49836 io_getevents, io_submit and io_cancel. 49837 49838 Fix mincore syscall entries. 49839 * linux/arm/syscallent.h: Fix mincore handler. 49840 * linux/avr32/syscallent.h: Likewise. 49841 * linux/mips/syscallent.h: Likewise. 49842 * linux/sh/syscallent.h: Likewise. 49843 * linux/sh64/syscallent.h: Likewise. 49844 49845 2011-11-25 Dmitry V. Levin <ldv (a] altlinux.org> 49846 49847 Fix sendmsg syscall entries. 49848 * linux/arm/syscallent.h: Fix number of sendmsg arguments. 49849 * linux/avr32/syscallent.h: Likewise. 49850 * linux/bfin/syscallent.h: Likewise. 49851 * linux/hppa/syscallent.h: Likewise. 49852 * linux/i386/syscallent.h: Likewise. 49853 * linux/m68k/syscallent.h: Likewise. 49854 * linux/microblaze/syscallent.h: Likewise. 49855 * linux/powerpc/syscallent.h: Likewise. 49856 * linux/s390/syscallent.h: Likewise. 49857 * linux/s390x/syscallent.h: Likewise. 49858 * linux/sh/syscallent.h: Likewise. 49859 * linux/sh64/syscallent.h: Likewise. 49860 * linux/sparc/syscallent.h: Likewise. 49861 * linux/tile/syscallent.h: Likewise. 49862 * linux/x86_64/syscallent.h: Likewise. 49863 49864 Fix epoll_wait syscall entries. 49865 * linux/arm/syscallent.h: Fix epoll_wait flags and handler. 49866 * linux/m68k/syscallent.h: Fix epoll_wait flags. 49867 * linux/microblaze/syscallent.h: Fix number of epoll_wait arguments. 49868 * linux/sh/syscallent.h: Likewise. 49869 * linux/sh64/syscallent.h: Likewise. 49870 * linux/x86_64/syscallent.h: Likewise. 49871 49872 Fix epoll_ctl syscall entries. 49873 * linux/arm/syscallent.h: Fix epoll_ctl flags and handler. 49874 * linux/m68k/syscallent.h: Fix epoll_ctl flags. 49875 * linux/x86_64/syscallent.h: Fix number of epoll_ctl arguments. 49876 49877 arm: fix epoll_create syscall entry. 49878 * linux/arm/syscallent.h: Fix epoll_create handler. 49879 49880 Fix mlockall syscall entries. 49881 * linux/arm/syscallent.h: Fix number of mlockall arguments. 49882 * linux/avr32/syscallent.h: Likewise. 49883 * linux/bfin/syscallent.h: Likewise. 49884 * linux/i386/syscallent.h: Likewise. 49885 * linux/m68k/syscallent.h: Likewise. 49886 * linux/microblaze/syscallent.h: Likewise. 49887 * linux/s390/syscallent.h: Likewise. 49888 * linux/s390x/syscallent.h: Likewise. 49889 * linux/sh/syscallent.h: Likewise. 49890 * linux/sh64/syscallent.h: Likewise. 49891 * linux/sparc/syscallent.h: Likewise. 49892 * linux/tile/syscallent.h: Likewise. 49893 * linux/x86_64/syscallent.h: Likewise. 49894 49895 Fix epoll_pwait syscall entries. 49896 * linux/alpha/syscallent.h: Fix number of epoll_pwait arguments. 49897 * linux/arm/syscallent.h: Likewise. 49898 * linux/avr32/syscallent.h: Likewise. 49899 * linux/bfin/syscallent.h: Likewise. 49900 * linux/i386/syscallent.h: Likewise. 49901 * linux/ia64/syscallent.h: Likewise. 49902 * linux/m68k/syscallent.h: Likewise. 49903 * linux/microblaze/syscallent.h: Likewise. 49904 * linux/mips/syscallent.h: Likewise. 49905 * linux/powerpc/syscallent.h: Likewise. 49906 * linux/s390/syscallent.h: Likewise. 49907 * linux/s390x/syscallent.h: Likewise. 49908 * linux/sh/syscallent.h: Likewise. 49909 * linux/sh64/syscallent.h: Likewise. 49910 * linux/sparc/syscallent.h: Likewise. 49911 * linux/tile/syscallent.h: Likewise. 49912 * linux/x86_64/syscallent.h: Likewise. 49913 49914 Fix reboot syscall entries. 49915 * linux/alpha/syscallent.h: Fix number of reboot arguments. 49916 * linux/arm/syscallent.h: Likewise. 49917 * linux/avr32/syscallent.h: Likewise. 49918 * linux/bfin/syscallent.h: Likewise. 49919 * linux/hppa/syscallent.h: Likewise. 49920 * linux/i386/syscallent.h: Likewise. 49921 * linux/ia64/syscallent.h: Likewise. 49922 * linux/m68k/syscallent.h: Likewise. 49923 * linux/microblaze/syscallent.h: Likewise. 49924 * linux/mips/syscallent.h: Likewise. 49925 * linux/powerpc/syscallent.h: Likewise. 49926 * linux/s390/syscallent.h: Likewise. 49927 * linux/s390x/syscallent.h: Likewise. 49928 * linux/sh/syscallent.h: Likewise. 49929 * linux/sh64/syscallent.h: Likewise. 49930 * linux/sparc/syscallent.h: Likewise. 49931 * linux/tile/syscallent.h: Likewise. 49932 * linux/x86_64/syscallent.h: Likewise. 49933 49934 Fix swapon syscall entries. 49935 * linux/arm/syscallent.h: Fix number of swapon arguments. 49936 * linux/avr32/syscallent.h: Likewise. 49937 * linux/bfin/syscallent.h: Likewise. 49938 * linux/i386/syscallent.h: Likewise. 49939 * linux/m68k/syscallent.h: Likewise. 49940 * linux/microblaze/syscallent.h: Likewise. 49941 * linux/mips/syscallent.h: Likewise. 49942 * linux/powerpc/syscallent.h: Likewise. 49943 * linux/s390/syscallent.h: Likewise. 49944 * linux/s390x/syscallent.h: Likewise. 49945 * linux/sh/syscallent.h: Likewise. 49946 * linux/sh64/syscallent.h: Likewise. 49947 * linux/sparc/syscallent.h: Likewise. 49948 * linux/tile/syscallent.h: Likewise. 49949 * linux/x86_64/syscallent.h: Likewise. 49950 * linux/alpha/syscallent.h: Fix number of swapon arguments, add TF flag. 49951 * linux/hppa/syscallent.h: Likewise. 49952 * linux/ia64/syscallent.h: Likewise. 49953 49954 Fix sgetmask and ssetmask syscall entries. 49955 * linux/hppa/syscallent.h: Fix sgetmask and ssetmask entries. 49956 * linux/powerpc/syscallent.h: Likewise. 49957 * linux/sparc/syscallent.h: Likewise. 49958 * linux/tile/syscallent.h: Likewise. 49959 49960 Rename siggetmask to sgetmask and sigsetmask to ssetmask. 49961 * linux/arm/syscallent.h: Rename siggetmask to sgetmask and 49962 sigsetmask to ssetmask. 49963 * linux/bfin/syscallent.h: Likewise. 49964 * linux/i386/syscallent.h: Likewise. 49965 * linux/m68k/syscallent.h: Likewise. 49966 * linux/microblaze/syscallent.h: Likewise. 49967 * linux/mips/syscallent.h: Likewise. 49968 * linux/sh/syscallent.h: Likewise. 49969 * linux/sh64/syscallent.h: Likewise. 49970 * linux/ia64/syscallent.h: Rename sys_sgetmask to sys_siggetmask, 49971 sys_ssetmask to sys_sigsetmask. 49972 49973 Add TRACE_IPC flag to sys_ipc syscall entries. 49974 * linux/arm/syscallent.h: Add TI flag to sys_ipc entry. 49975 * linux/avr32/syscallent.h: Likewise. 49976 * linux/bfin/syscallent.h: Likewise. 49977 * linux/i386/syscallent.h: Likewise. 49978 * linux/m68k/syscallent.h: Likewise. 49979 * linux/microblaze/syscallent.h: Likewise. 49980 * linux/mips/syscallent.h: Likewise. 49981 * linux/powerpc/syscallent.h: Likewise. 49982 * linux/s390/syscallent.h: Likewise. 49983 * linux/s390x/syscallent.h: Likewise. 49984 * linux/sh/syscallent.h: Likewise. 49985 * linux/sh64/syscallent.h: Likewise. 49986 * linux/sparc/syscallent.h: Likewise. 49987 49988 2011-11-05 Dmitry V. Levin <ldv (a] altlinux.org> 49989 49990 gitlog-to-changelog: update from gnulib. 49991 * gitlog-to-changelog: Update from gnulib. 49992 * Makefile.am: Add --append-dot to gitlog-to-changelog invocation. 49993 49994 2011-10-22 Denys Vlasenko <dvlasenk (a] redhat.com> 49995 49996 Decode TIOCSCTTY's third parameter. 49997 * term.c (term_ioctl): Decode TIOCSCTTY's third parameter. 49998 49999 2011-10-14 Dmitry V. Levin <ldv (a] altlinux.org> 50000 50001 Remove useless and obsolete "#if DONE" sections. No code changes. 50002 * linux/dummy.h: Remove "#if DONE" section. 50003 * linux/sparc/dummy2.h: Likewise. 50004 * linux/sparc64/dummy2.h: Likewise. 50005 * sunos4/dummy.h: Likewise. 50006 * svr4/dummy.h: Likewise. 50007 50008 Add names for dummy parsers. No code changes. 50009 * linux/dummy.h: Add aliases to printargs() for those of dummy parsers 50010 that had no own names before. 50011 * linux/*/syscallent.h: Use these new names instead of printargs. 50012 50013 Sort definitions of dummy parsers. No code changes. 50014 * linux/dummy.h: Sort definitions of parsers implemented as aliases 50015 to printargs(). 50016 50017 2011-10-14 Mike Frysinger <vapier (a] gentoo.org> 50018 50019 sys_epoll_create1: decode flag arguments correctly. 50020 * desc.c (epollflags): Define. 50021 (sys_epoll_create1): Use epollflags to printflags. Change "O" to "EPOLL". 50022 50023 Reported-by: <socketpair (a] gmail.com> 50024 50025 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 50026 50027 Implement decoding of splice, tee and vmsplice(2) syscalls. 50028 * io.c (print_loff_t): New function. 50029 (sys_sendfile64): Use it. 50030 (splice_flags): New xlat structure. 50031 (sys_tee, sys_splice, sys_vmsplice): New functions. 50032 * linux/syscall.h (sys_tee, sys_splice, sys_vmsplice): Declare them. 50033 * linux/*/syscallent.h: Use them. 50034 50035 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 50036 50037 Fix epoll_wait and epoll_pwait decoding. 50038 * desc.c (epoll_wait_common): Print "maxevents" and "timeout" arguments 50039 as integers. 50040 50041 Reported-by: <socketpair (a] gmail.com> 50042 50043 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 50044 50045 Decode EPOLLRDHUP. 50046 * desc.c (epollevents): Add EPOLLRDHUP. 50047 50048 Reported-by: <socketpair (a] gmail.com> 50049 50050 2011-10-11 Dmitry V. Levin <ldv (a] altlinux.org> 50051 50052 Remove unreachable code in umoven() and umovestr(). 50053 * util.c (umoven, umovestr): Remove unreachable code. 50054 50055 Reported-by: Weichuan Yan <wchyan (a] marvell.com> 50056 50057 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 50058 50059 Do post-attach initialization earlier; fix "we ignore SIGSTOP on NOMMU" bug 50060 We set ptrace options when we see post-attach SIGSTOP. 50061 This is wrong: it's better to set them right away on the very first 50062 stop (whichever it will be). It also will make adding SEIZE support easier, 50063 since SEIZE has no post-attach SIGSTOP. 50064 50065 We do it by adding a new bit, TCB_IGNORE_ONE_SIGSTOP, and treating 50066 TCB_STARTUP and TCB_IGNORE_ONE_SIGSTOP as two slightly different things. 50067 50068 * defs.h: Add a new flag bit, TCB_IGNORE_ONE_SIGSTOP. 50069 * process.c (internal_fork): Set TCB_IGNORE_ONE_SIGSTOP on a newly added child. 50070 * strace.c (startup_attach): Set TCB_IGNORE_ONE_SIGSTOP after attach. 50071 Fix a case when "strace -p PID" found PID dead but sone other of its threads 50072 still alive. 50073 (startup_child): Set TCB_IGNORE_ONE_SIGSTOP after attach, _if needed_. 50074 This fixes a bogus case where we can ignore a _real_ SIGSTOP on NOMMU. 50075 (detach): Perform anti-SIGSTOP dance only if TCB_IGNORE_ONE_SIGSTOP is set, 50076 not if TCB_STARTUP is set. 50077 (trace): Set TCB_IGNORE_ONE_SIGSTOP after attach. 50078 Clear TCB_STARTUP and initialize tracee on the very first tracee stop. 50079 Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen. 50080 50081 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 50082 50083 Get rid of TCB_ATTACH_DONE. 50084 * defs.h: Remove TCB_ATTACH_DONE constant. 50085 * strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE 50086 to distinquish attached from not-yet-attached threads. 50087 50088 2011-09-05 Denys Vlasenko <dvlasenk (a] redhat.com> 50089 50090 Set TCB_STARTUP only _after_ we attached. 50091 This fixes logic in detach() which thinks that TCB_STARTUP 50092 means that we are already attached, but did not see SIGSTOP yet. 50093 This also allows to get rid of TCB_ATTACH_DONE flag. 50094 50095 * process.c (internal_fork): Set TCB_STARTUP after attach. 50096 * strace.c (startup_attach): Likewise. 50097 (startup_child): Likewise. 50098 (alloc_tcb): Do not set TCB_STARTUP on tcb allocation - we are 50099 not attached yet. 50100 (trace): Set TCB_STARTUP when we detech an auto-attached child. 50101 50102 2011-09-02 Denys Vlasenko <dvlasenk (a] redhat.com> 50103 50104 Simple optimizations in trace() 50105 * strace.c (trace): Calculate WSTOPSIG(status) once, 50106 unify code paths to ptrace(PTRACE_SYSCALL). 50107 50108 Trivial fixes on error paths. 50109 * strace.c (startup_attach): Emit message on fork() failure. 50110 (startup_child): Remove non-informative comment. 50111 * util.c (ptrace_restart): use perror_msg() on error instead of fprintf(). 50112 50113 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 50114 50115 Fix compile failure introduced by last commit. 50116 * desc.c (decode_select): Fix double definition of nfds. 50117 50118 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 50119 50120 Roll back "die on malloc failure" behaviour a bit. 50121 After recent change, select(2^31-1, NULL, NULL, NULL) 50122 would make strace exit. This change caps fdsize so that 50123 it is always in [0, 1025*1024], IOW: we will try to allocate at most 50124 1 megabyte, which in practice will almost always work, 50125 unlike malloc(2Gig). 50126 50127 * desc.c (decode_select): Cap fdsize to 1024*1024. 50128 * pathtrace.c (pathtrace_match): Cap fdsize to 1024*1024. 50129 * file.c (sys_getdents): Cap len to 1024*1024. 50130 (sys_getdents64): Cap len to 1024*1024. 50131 * util.c (dumpiov): Refuse to process iov with more than 1024*1024 50132 elements. Don't die on malloc failure. 50133 (dumpstr): Don't die on malloc failure. 50134 50135 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 50136 50137 Add stpcpy to autoconf machinery. 50138 * configure.ac: Add stpcpy to AC_CHECK_FUNCS. 50139 * defs.h: Frame stpcpy with "if !defined HAVE_STPCPY". 50140 * util.c: Likewise. 50141 50142 Simplify sprinttv() 50143 * time.c (sprinttv): Trivial simplifications. 50144 50145 * desc.c (decode_select): Set tcp->auxstr as late as possible. 50146 50147 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 50148 50149 Reformat setuid-ing code in startup_child() 50150 New code does the same as old one, but is more readable (I hope). 50151 50152 * strace.c (startup_child): Reformat setuid-ing code. 50153 50154 2011-09-01 Denys Vlasenko <dvlasenk (a] redhat.com> 50155 50156 Minor tweaks in startup_child(). Logic isn't changed (but code is) 50157 * strace.c (startup_attach): Tweak comment. 50158 (startup_child): Move common code out of ifdef. 50159 Indent nested ifdefs. Tweak comments. Remove two 50160 unnecessary calls to getpid(). 50161 50162 Use tprints with literal strings, it may be faster than tprintf. 50163 * bjm.c: Replace tprintf("str") with tprints("str"). 50164 * block.c: Likewise. 50165 * desc.c: Likewise. 50166 * file.c: Likewise. 50167 * io.c: Likewise. 50168 * ipc.c: Likewise. 50169 * mem.c: Likewise. 50170 * net.c: Likewise. 50171 * proc.c: Likewise. 50172 * process.c: Likewise. 50173 * quota.c: Likewise. 50174 * resource.c: Likewise. 50175 * scsi.c: Likewise. 50176 * signal.c: Likewise. 50177 * sock.c: Likewise. 50178 * strace.c: Likewise. 50179 * stream.c: Likewise. 50180 * syscall.c: Likewise. 50181 * system.c: Likewise. 50182 * term.c: Likewise. 50183 * time.c: Likewise. 50184 * util.c: Likewise. 50185 50186 Fix "format not a string literal" warning caused by tprintf(str) 50187 * defs.h: Declare tprints(). 50188 * strace.c: Define tprints(). 50189 (tabto): Use tprints(str), since tprintf(str) was throwing a warning. 50190 * desc.c: Use tprints(str) instead of tprintf("%s", str). 50191 * file.c: Likewise. 50192 * io.c: Likewise. 50193 * net.c: Likewise. 50194 * process.c: Likewise. 50195 * signal.c: Likewise. 50196 * syscall.c: Likewise. 50197 * util.c: Likewise. 50198 50199 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 50200 50201 Add README-linux-ptrace file. 50202 I tried to push this doc to Michael Kerrisk <mtk.manpages (a] gmail.com>, 50203 but got no reply. To avoid losing the document, let it live 50204 in strace tree for now. 50205 50206 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 50207 50208 Make out-of-memory handling more uniform. 50209 This fixes one real bug in dumpstr(). 50210 50211 * defs.h: Declare die_out_of_memory(). 50212 * strace.c (die_out_of_memory): New function. 50213 (strace_popen): If allocation fails, call die_out_of_memory(). 50214 (main): Likewise. 50215 (expand_tcbtab): Likewise. 50216 (rebuild_pollv): Likewise. 50217 * count.c (count_syscall): Likewise. 50218 (call_summary_pers): Likewise. 50219 * desc.c (decode_select): Likewise. 50220 * file.c (sys_getdents): Likewise. 50221 (sys_getdents64): Likewise. 50222 (sys_getdirentries): Likewise. 50223 * pathtrace.c (pathtrace_match): Likewise. 50224 * syscall.c (qualify): Likewise. 50225 * util.c (printstr): Likewise. 50226 (dumpiov): Likewise. 50227 (dumpstr): Likewise. 50228 (fixvfork): Likewise. 50229 * mem.c (sys_mincore): Don't check free() parameter for NULL. 50230 50231 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 50232 50233 Optimization: eliminate all remaining usages of strcat() 50234 After this change, we don't use strcat() anywhere. 50235 50236 * defs.h: Change sprinttv() return type to char *. 50237 * time.c (sprinttv): Return pointer past last stored char. 50238 * desc.c (decode_select): Change printing logic in order to eliminate 50239 usage of strcat() - use stpcpy(), *outptr++ = ch, sprintf() instead. 50240 Also reduce usage of strlen(). 50241 * stream.c (decode_poll): Likewise. 50242 50243 2011-08-31 Denys Vlasenko <dvlasenk (a] redhat.com> 50244 50245 Optimize string_quote() for speed. 50246 * util.c (string_quote): Speed up check for terminating NUL. 50247 Replace strintf() with open-coded binary to hex/oct conversions - 50248 we potentially do them for every single byte, need to be fast. 50249 50250 Optimization: eliminate some usages of strcat() 50251 * defs.h: Declare stpcpy(). 50252 * util.c: Define stpcpy(). 50253 * file.c: Remove static str_append(). 50254 (sprint_open_modes): Use stpcpy() instead of str_append(). 50255 (sprintflags): Use stpcpy() instead of strcat(). 50256 (printpathn): Eliminate usage of strcat(). 50257 (printstr): Eliminate usage of strcat(). 50258 50259 2011-08-30 Denys Vlasenko <dvlasenk (a] redhat.com> 50260 50261 Small optimization on AVR32. 50262 * syscall.c (syscall_enter): Optimize tcp->u_arg[i] setting 50263 from regs.FOO for AVR32. 50264 50265 2011-08-30 Denys Vlasenko <dvlasenk (a] redhat.com> 50266 50267 On X86_64 and I386, use PTRACE_GETREGS to fetch all registers. 50268 Before this change, registers were read with PTRACE_PEEKUSER 50269 ptrace operation, one per register. This is slower than 50270 fetching them all in one ptrace operation. 50271 50272 * defs.h: include asm/ptrace.h on X86_64 and I386. 50273 * syscall.c: New static variables i386_regs and x86_64_regs. 50274 Remove static eax/rax variables. 50275 (get_scno): Fetch all registers with single PTRACE_GETREGS operation. 50276 (get_syscall_result): Likewise. 50277 (syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs. 50278 (syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results. 50279 (get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results. 50280 50281 2011-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 50282 50283 Do not include <limits.h> 50284 * strace.c: Do not include <limits.h> explicitly, it is already included 50285 implicitly by <sys/param.h>. 50286 50287 2011-08-30 Dmitry V. Levin <ldv (a] altlinux.org> 50288 50289 Include <sys/param.h> to get PATH_MAX definition. 50290 * pathtrace.c: Include <sys/param.h> instead of <limits.h> to get 50291 PATH_MAX definition. 50292 50293 Reported-by: Steve Bennett <steveb (a] workware.net.au> 50294 50295 2011-08-26 Denys Vlasenko <dvlasenk (a] redhat.com> 50296 50297 Indent a large set of nested ifdefs/endifs. No code changes. 50298 * defs.h: Indent a large set of nested ifdefs/endifs 50299 50300 Rename syscall_fixup to syscall_fixup_on_sysenter. 50301 * defs.h: Tweak comment. 50302 * syscall.c: Rename syscall_fixup to syscall_fixup_on_sysenter. 50303 (trace_syscall_entering): Use new finction name. 50304 50305 Make syscall result reading more consistent among different arches. 50306 * syscall.c: Eliminate static flags variable for POWERPC. 50307 (syscall_fixup): Don't fetch syscall results. Affected arches: 50308 POWERPC, BFIN, HPPA. 50309 (syscall_fixup_on_sysexit): Move syscall results fetching code 50310 for this function to get_syscall_result. Affected arches: 50311 S390X, POWERPC, BFIN, M68K, HPPA, CRIS, MICROBLAZE. 50312 (get_syscall_result): Add syscall results fetching. 50313 50314 2011-08-25 Denys Vlasenko <dvlasenk (a] redhat.com> 50315 50316 Simplify syscall_fixup[_on_sysexit] 50317 * syscall.c (syscall_fixup): Remove checks for entering(tcp). 50318 Remove code which executes if exiting(tcp). 50319 (syscall_fixup_on_sysexit): Remove code which executes 50320 if entering(tcp). Remove checks for exiting(tcp). 50321 50322 Split syscall_fixup into enter/exit pair of functions. 50323 * syscall.c: Create syscall_fixup_on_sysexit() which is a copy of 50324 syscall_fixup(). 50325 (trace_syscall_exiting): Call syscall_fixup_on_sysexit() instead of 50326 syscall_fixup(). 50327 50328 Remove stray commas in struct initializers. No code changes. 50329 * process.c: Remove stray commas in struct initializers. 50330 50331 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50332 50333 Optimize tabto() 50334 tabto is used in many lines of strace output. 50335 On glibc, tprintf("%*s", col - curcol, "") is noticeably slow 50336 compared to tprintf(" "). Use the latter. 50337 Observed ~15% reduction of time spent in userspace. 50338 50339 * defs.h: Drop extern declaration of acolumn. Make tabto() 50340 take no parameters. 50341 * process.c (sys_exit): Call tabto() with no parameters. 50342 * syscall.c (trace_syscall_exiting): Call tabto() with no parameters. 50343 * strace.c: Make acolumn static, add static char *acolumn_spaces. 50344 (main): Allocate acolumn_spaces as a string of spaces. 50345 (printleader): Call tabto() with no parameters. 50346 (tabto): Use simpler method to print lots of spaces. 50347 50348 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50349 50350 * syscall.c (sys_indir): Use %ld for printing long, not %u. 50351 50352 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50353 50354 Opotimize "scno >= 0 && scno < nsyscalls" check. 50355 gcc can't figure out on its own that this check can be done with 50356 single compare, and does two compares. We can help it by casting 50357 scno to unsigned long: ((unsigned long)(scno) < nsyscalls) 50358 50359 * defs.h: New macro SCNO_IN_RANGE(long_var). 50360 * count.c (count_syscall): Use SCNO_IN_RANGE() instead of open-coded check. 50361 * syscall.c (getrval2): Use SCNO_IN_RANGE() instead of open-coded check. 50362 This fixes a bug: missing check for scno < 0 and scno > nsyscalls 50363 instead of scno >= nsyscalls. 50364 (get_scno): Use SCNO_IN_RANGE() instead of open-coded check. 50365 This fixes a bug: scno > nsyscalls instead of scno >= nsyscalls. 50366 (known_scno): Use SCNO_IN_RANGE() instead of open-coded check. 50367 (internal_syscall): Likewise. 50368 (syscall_enter): Likewise. 50369 (trace_syscall_entering): Likewise. 50370 (get_error): Likewise. 50371 (trace_syscall_exiting): Likewise. 50372 50373 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50374 50375 Remove scno_good logic in syscall exit. 50376 * syscall.c (trace_syscall_exiting): Remove scno_good logic, 50377 it can't trigger in syscall exit. 50378 50379 Remove redundant assignments. 50380 * syscall.c (get_error): Remove redundant "u_error = 0" and redundant 50381 and unclear comments. 50382 50383 Group int-sized fields together in struct tcb. 50384 * defs.h: Group int-sized fields together in struct tcb. 50385 50386 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50387 50388 Reorder functions in syscall.c. No code changes. 50389 Old order (basically "in no particular order"): 50390 dumpio 50391 decode_subcall 50392 internal_syscall 50393 get_scno 50394 get_syscall_result 50395 known_scno 50396 syscall_fixup 50397 is_negated_errno 50398 get_error 50399 syscall_enter 50400 trace_syscall_entering 50401 trace_syscall_exiting 50402 trace_syscall 50403 printargs 50404 getrval2 50405 sys_indir 50406 is_restart_error 50407 50408 New order: 50409 various utility functions: 50410 decode_subcall 50411 printargs 50412 getrval2 50413 sys_indir 50414 is_restart_error 50415 syscall enter handling functions: 50416 get_scno 50417 known_scno 50418 syscall_fixup (also used in syscall exit code) 50419 internal_syscall (also used in syscall exit code) 50420 syscall_enter 50421 trace_syscall_entering 50422 syscall exit handling functions: 50423 get_syscall_result 50424 is_negated_errno 50425 get_error 50426 dumpio 50427 trace_syscall_exiting 50428 main syscall enter/exit function: 50429 trace_syscall 50430 50431 * syscall.c: Reorder functions so that related ones are closer 50432 in the source. 50433 50434 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50435 50436 Rename some functions, delete unused one. No code changes. 50437 * defs.h: Rename get_scno_on_sysenter() to get_scno(); 50438 delete force_result() declaration. 50439 * strace.c (proc_open): Rename get_scno_on_sysenter() to get_scno(). 50440 * syscall.c: Rename get_scno_on_sysenter() to get_scno(). 50441 Rename get_scno_on_sysexit() to get_syscall_result(). 50442 Delete unused force_result(). 50443 50444 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50445 50446 Unify per-architecture post-execve SIGTRAP check. 50447 Move post-execve SIGTRAP check from get_scno_on_sysenter 50448 (multitude of places on many architectures) to a single location 50449 in trace_syscall_entering. This loosens the logic for some arches, 50450 since many of them had additional checks such as scno == 0. 50451 However, on non-ancient Linux kernels we should never have post-execve 50452 SIGTRAP in the first place, by virtue of using PTRACE_O_TRACEEXEC. 50453 50454 * syscall.c (get_scno_on_sysenter): Remove tcp->flags & TCB_WAITEXECVE checks. 50455 (trace_syscall_entering): Do tcp->flags & TCB_WAITEXECVE check here. 50456 (get_scno_on_sysexit): Tweak comment. 50457 (syscall_fixup): Likewise. 50458 (trace_syscall_exiting): Likewise. 50459 50460 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50461 50462 Speed up x86 by avoiding EAX read on syscall entry. 50463 on x86, EAX read on syscall entry is not necessary if we know 50464 that post-execve SIGTRAP is disabled by PTRACE_O_TRACEEXEC ptrace option. 50465 This patch (a) moves EAX retrieval from syscall_fixup 50466 to get_scno_on_sysexit, and (b) perform EAX retrieval in syscall_fixup 50467 only if we are in syscall entry and PTRACE_O_TRACEEXEC option is not on. 50468 50469 * syscall.c (get_scno_on_sysexit): On I386 and X86_64, read eax/rax 50470 which contain syscall return value. 50471 (syscall_fixup): On I386 and X86_64, read eax/rax only on syscall enter 50472 and only if PTRACE_O_TRACEEXEC is not in effect. 50473 50474 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50475 50476 Do not read syscall no in get_scno_on_sysexit. 50477 * syscall.c (get_scno_on_sysexit): Remove scno retrieval code, since 50478 we don't save it anyway. This is the first real logic change 50479 which should make strace faster: for example, on x64 ORIG_EAX 50480 is no longer read in each syscall exit. 50481 50482 Simplify get_scno_on_sysenter/sysexit. 50483 * syscall.c (get_scno_on_sysenter): Remove "if (exiting(tcp))" code, 50484 make "if (entering(tcp))" code unconditional. 50485 (get_scno_on_sysexit): Remove "if (entering(tcp))" code, 50486 make "if (exiting(tcp))" code unconditional. 50487 50488 2011-08-24 Denys Vlasenko <dvlasenk (a] redhat.com> 50489 50490 get_scno is an unholy mess, make it less horrible. 50491 Currently, get_scno does *much* more than "get syscall no". 50492 It checks for post-execve SIGTRAP. It checks for changes 50493 in personality. It retrieves params on entry and registers on exit. 50494 Worse still, it is different in different architectures: for example, 50495 for AVR32 regs are fetched in get_scno(), while for e.g. I386 50496 it is done in syscall_enter(). 50497 50498 Another problem is that get_scno() is called on both syscall entry and 50499 syscall exit, which is stupid: we don't need to know scno on syscall 50500 exit, it is already known from last syscall entry and stored in 50501 tcp->scno! In essence, get_scno() does two completely different things 50502 on syscall entry and on exit, they are just mixed into one bottle, like 50503 shampoo and conditioner. 50504 50505 The following patches will try to improve this situation. 50506 50507 This change duplicates get_scno into identical get_scno_on_sysenter, 50508 get_scno_on_sysexit functions. Call them in syscall enter and syscall 50509 exit, correspondingly. 50510 50511 * defs.h: Rename get_scno to get_scno_on_sysenter; declare it only 50512 if USE_PROCFS. 50513 * strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno. 50514 * syscall.c (get_scno): Split into two (so far identical) functions 50515 get_scno_on_sysenter and get_scno_on_sysexit. 50516 (trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno. 50517 (trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno. 50518 50519 2011-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 50520 50521 Reduce code redundancy in syscall_enter() 50522 * syscall.c [LINUX] (syscall_enter): Move tcp->u_nargs initialization 50523 from arch-specific ifdefs to common code. Always cache tcp->u_nargs in 50524 a local variable and use it in for() loops. 50525 [IA64, AVR32] Rewrite tcp->u_arg[] initialization using a loop. 50526 50527 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50528 50529 Define MAX_ARGS to 6 for all Linux arches. 50530 * defs.h: Define MAX_ARGS to 6 for all Linux arches. 50531 * linux/ia64/syscallent.h: Change all 8-argument printargs 50532 to MA (MAX_ARGS). 50533 linux/mips/syscallent.h: Change all two 7-argument printargs 50534 to MA (MAX_ARGS). 50535 50536 Fix argument printing in sys_mmap64. 50537 * mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i] 50538 instead of argument values copied from memory. 50539 50540 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50541 50542 Cache tcp->u_nargs in a local variable for for() loops. 50543 Loops of the form "for (i = 0; i < tcp->u_nargs; i++) ..." 50544 need to fetch tcp->u_nargs from memory on every iteration 50545 if "..." part has a function call (gcc doesn't know that 50546 tcp->u_nargs won't change). This can be sped up 50547 by putting tcp->u_nargs in a local variable, which might 50548 go into a CPU register. 50549 50550 * syscall.c (decode_subcall): Cache tcp->u_nargs in a local variable 50551 as for() loop limit value. 50552 (syscall_enter): Likewise. 50553 50554 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50555 50556 Drop checks for sysent[i].nargs == -1. 50557 * defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned. 50558 * syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned. 50559 (decode_subcall): Drop checks for sysent[i].nargs == -1. 50560 (syscall_enter): Likewise. 50561 50562 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50563 50564 Stop using nargs == -1 in syscallent tables. 50565 Usage -1 as argument count in syscallent tables 50566 necessitates the check for it, a-la: 50567 if (sysent[tcp->scno].nargs != -1) 50568 tcp->u_nargs = sysent[tcp->scno].nargs; 50569 else 50570 tcp->u_nargs = MAX_ARGS; 50571 which is stupid: we waste cycles checking something which 50572 is constant and known at compile time. 50573 50574 * defs.h: Make struct sysent::nargs unsigned. 50575 * freebsd/i386/syscallent.h: Replace nargs of -1 with MA. 50576 * linux/s390/syscallent.h: Likewise. 50577 * linux/s390x/syscallent.h: Likewise. 50578 * svr4/syscallent.h: Likewise. 50579 * freebsd/syscalls.pl: Likewise in generator script. 50580 * syscallent.sh: Likewise in generator script. 50581 * syscall.c: Add define MA MAX_ARGS / undef MA around includes 50582 of syscallent[N].h. 50583 50584 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50585 50586 Move trace_syscall_exiting below trace_syscall_entering. No code changes. 50587 Syscall enter happens before syscall exit. Having functions 50588 in opposite order in the source is confusing. 50589 50590 * syscall.c: Move trace_syscall_exiting below trace_syscall_entering. 50591 50592 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50593 50594 Fix -z display. 50595 Before this patch, the following: 50596 open("qwerty", O_RDONLY) = -1 ENOENT 50597 write(2, "wc: qwerty: No such file or dire"..., 38) = 38 50598 was shown totally wrongly with -z: 50599 open("qwerty", O_RDONLY) = 38 50600 (yes, that's right, write syscall is lost!) 50601 Now it is shown "less wrongly" as: 50602 open("qwerty", O_RDONLY <unfinished ...> 50603 write(2, "wc: qwerty: No such file or dire"..., 38) = 38 50604 50605 * syscall.c (trace_syscall_exiting): Use common TCB_INSYSCALL clearing 50606 via "goto ret". This fixes totally broken display of -z, but even now 50607 it is not working as intended. Add a comment about that. 50608 (trace_syscall_entering): Use common TCB_INSYSCALL setting 50609 via "goto ret". 50610 50611 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50612 50613 Straighten up confused comments/messages about post-execve SIGTRAP handling 50614 * defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail. 50615 * strace.c (choose_pfd): Use entering/exiting macros instead of direct check 50616 for TCB_INSYSCALL. 50617 * syscall.c (get_scno): Use entering/exiting macros instead of direct check 50618 for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP. 50619 (syscall_fixup): Use entering/exiting instead of direct check 50620 for TCB_INSYSCALL. Add a comment what "not a syscall entry" message 50621 usually means. Change wrong "stray syscall exit" messages into 50622 "not a syscall entry" ones. 50623 50624 count_syscall() always returns 0, optimize it. 50625 * defs.h (count_syscall): Change return type from int to void. 50626 * count.c (count_syscall): Change return type from int to void. 50627 * syscall.c (trace_syscall_exiting): Change code around call 50628 to count_syscall accordingly. 50629 50630 Optimize out dummy PC printing on signal delivery. 50631 * strace.c (trace): Optimize out dummy PC printing on signal delivery. 50632 While at it, tweak comments. 50633 50634 Conditionally optimize out unused code. 50635 * syscall.c (internal_syscall): Call internal_exec only if 50636 SUNOS4 || (LINUX && TCB_WAITEXECVE). 50637 * process.c (internal_exec): Define this function only if 50638 SUNOS4 || (LINUX && TCB_WAITEXECVE). 50639 (printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1. 50640 * signal.c (sys_kill): Likewise. 50641 * syscall.c (is_negated_errno): Likewise. 50642 (trace_syscall_exiting): Fold a tprintf into tprintfs which follow it. 50643 50644 Cosmetic improvement in ifdefs. No code changes. 50645 * strace.c (proc_open): Change ifdefs so that braces are properly paired. 50646 50647 Exclude tcp->pfd from non-procfs systems. 50648 * defs.h: Make struct tcb::pfd fields conditional on USE_PROCFS. 50649 * strace.c (alloc_tcb): Use tcp->pfd only if USE_PROCFS. 50650 (droptcb): Likewise. 50651 50652 Small optimizations related to memory allocation. 50653 * strace (expand_tcbtab): Shorten "out of memory" message. 50654 (rebuild_pollv): Remove unnecessary NULL check before free(). 50655 * util.c (dumpstr): Add a comment about likely bug. 50656 50657 Improve code readability by avoiding assignments inside if() 50658 * desc.c (decode_select): Move assignment out of if() condition. 50659 * file.c (sprinttime): Likewise. 50660 (sys_getdirentries): Likewise. 50661 * io.c (sys_ioctl): Likewise. 50662 * strace.c (test_ptrace_setoptions_followfork): Likewise. 50663 (main): Likewise. 50664 (proc_open): Likewise. 50665 (detach): Likewise. 50666 (proc_poll): Likewise. 50667 (trace): Likewise. 50668 * syscall.c (qualify): Likewise. 50669 (sys_indir): Likewise. 50670 * test/procpollable.c (main): Likewise. 50671 * test/sfd.c (main): Likewise. 50672 * time.c (printtv_bitness): Likewise. 50673 (sprinttv): Likewise. 50674 (print_timespec): Likewise. 50675 (void sprint_timespec): Likewise. 50676 (printitv_bitness): Likewise. 50677 * util.c (dumpstr): Likewise. 50678 (umovestr): Likewise. 50679 (fixvfork): Likewise. 50680 50681 Convert ioctl_next_match() to new-style C function definition. 50682 * ioctl.c (ioctl_next_match): Convert to new-style C function definition. 50683 50684 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50685 50686 Small optimization in signal and ioctl tables. 50687 Trivial shuffling of data tables puts them all in one file, 50688 allowing gcc to see their sizes and eliminate variables 50689 which store these sizes. 50690 50691 Surprisingly, in C mode gcc does not optimize out static const int 50692 variables. Help it by using enums instead. 50693 50694 * defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2}, 50695 signalent{0,1,2}, nsignals{0,1,2}. 50696 * ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}. 50697 * signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}. 50698 * syscall.c: Move above definitions to this file. Make them static const 50699 or enums if suitable. 50700 50701 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50702 50703 Don't return int from set_personality(), no one checks it. 50704 * defs.h (set_personality): Change return type to void. 50705 * syscall.c (set_personality): Change return type to void. 50706 50707 Remove unused declaration. 50708 * defs.h: Remove unused declaration of handle_new_child(). 50709 50710 Use natural-sized integer field for tcb::flags. 50711 * defs: Change struct tcb::flags type from short to int. 50712 This results in smaller code at least on x86. 50713 50714 Make needlessly static data local. 50715 * syscall.c (get_scno): For POWERPC64 and X86-64, variable currpers 50716 is declared static. But its old data is never used. Convert it 50717 to ordinary local variable. 50718 50719 Optimize get_scno function. 50720 * syscall.c (get_scno): Make gpr_offset[] array static const. 50721 50722 Optimize iocb_cmd_lookup. 50723 * desc.c (iocb_cmd_lookup): Make command table constant. 50724 Reduce size of static char buffer. 50725 50726 Correct sys_sendfile[64] type and nargs. 50727 * freebsd/i386/syscallent.h: Correct sys_sendfile nargs 7->8 50728 * linux/mips/syscallent.h: Correct sys_sendfile64 nargs 5->4 50729 * linux/sh/syscallent.h: Correct sys_sendfile64 nargs 5->4 50730 * linux/sh64/syscallent.h: Correct sys_sendfile64 nargs 5->4 50731 * linux/m68k/syscallent.h: Correct sys_sendfile64 type TF->TD|TN 50732 * linux/microblaze/syscallent.h: Correct sys_sendfile64 type TF->TD|TN 50733 * linux/tile/syscallent.h: Correct sys_sendfile and sys_sendfile64 type TD->TD|TN 50734 50735 Make addflags return void. 50736 * defs.h (addflags): Change return type from int to void. 50737 * util.c (addflags): Change return type from int to void. 50738 50739 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50740 50741 Set saner MAX_ARGS (6 or 8) for X86_64 and I386. 50742 I noticed that tcp->u_args[MAX_ARGS] array is way larger than 50743 I'd expect: for all arches except HPPA it has 32 (!) elements. 50744 50745 I looked at the code and so far I spotted only one abuser of 50746 this fact: sys_sigreturn. On several arches, it saves sigset_t 50747 into tcp->u_args[1...N] on entry and prints it on exit, a-la 50748 50749 memcpy(&tcp->u_arg[1], &sc.oldmask[0], sizeof(sigset_t)) 50750 50751 The problem here is that in glibc sigset_t is insanely large: 50752 128 bytes, and using sizeof(sigset_t) in memcpy will overrun 50753 &tcp->u_args[1] even with MAX_ARGS == 32: 50754 On 32 bits, sizeof(tcp->u_args) == 32*4 == 128 bytes! 50755 We may already have a bug there! 50756 50757 This commit changes the code to save NSIG / 8 bytes only. 50758 NSIG can't ever be > 256, and in practice is <= 129, 50759 thus NSIG / 8 is <= 16 bytes == 4 32-bit words, 50760 and even MAX_ARGS == 5 should be enough for saving signal masks. 50761 50762 * defs.h: Reduce MAX_ARGS for X86_64 and I386 from 32 to 8 50763 for FreeBSD and to 6 for everyone else. Add comment about current 50764 state of needed MAX_ARGS. 50765 * signal.c: Add comment about size of sigset_t. 50766 (sprintsigmask): Reduce static string buffer from 8k to 2k. 50767 (sys_sigreturn): Fix sigset saving to save only NSIG / 8 bytes, 50768 not sizeof(sigset_t) bytes. 50769 * linux/mips/syscallent.h: Reduce nargs of printargs-type syscall to 7. 50770 * linux/arm/syscallent.h: Reduce nargs of printargs-type syscall to 6. 50771 * linux/i386/syscallent.h: Likewise. 50772 * linux/m68k/syscallent.h: Likewise. 50773 * linux/powerpc/syscallent.h: Likewise. 50774 * linux/s390/syscallent.h: Likewise. 50775 * linux/s390x/syscallent.h: Likewise. 50776 * linux/sh/syscallent.h: Likewise. 50777 * linux/sh64/syscallent.h: Likewise. 50778 * linux/sparc/syscallent.h: Likewise. 50779 50780 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50781 50782 Optimize sys_old_mmap. 50783 * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64, 50784 copy narrow parameters from userspace by single umove, not by six 50785 separate ones; then assign them to long u_arg[i]. For SH[64], 50786 avoid copying of tcp->u_arg. 50787 (sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled 50788 differently for no apparent reason. 50789 * test/mmap_offset_decode.c: New test program, illustrates FIXME. 50790 50791 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50792 50793 Untangle ifdef forest in sys_mmap64. No code changes. 50794 After careful analysis, it looks like !LINUX and ALPHA 50795 pass all seven parameters in registers; and in all other cases 50796 parameters are on stack (pointed to by tcp->u_arg[0]). 50797 In light of this, reorganize ifdefs, making them simpler, 50798 without changing any logic. 50799 After this, it's apparent we use tcp->u_arg[4,5,6] and possibly 50800 [7] without checking that it's valid to do so. 50801 So far, just add a comment about this. 50802 50803 * mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way. 50804 Add comments about apparent bugs. 50805 50806 2011-08-23 Denys Vlasenko <dvlasenk (a] redhat.com> 50807 50808 Style and comment fixes, no code changes. 50809 * mem.c: Indent includes to show nesting better. 50810 (addtileflags): Fix style of this function definition; 50811 correct wrong endif comment, add another endif comment. 50812 50813 Use simpler rounding up to next multiple of 2. 50814 * util.c (printllval): simpler rounding up to next multiple of 2. 50815 50816 Cosmetic fixes, no code changes. 50817 * defs.h: Add/reformat comments. 50818 * signal.c: Remove wrong comment. Add warning directive 50819 when we detect that NSIG is undefined. Add comment about 50820 NSIG on ARM. Fix typo in comment. 50821 (signame): Reformat code a bit without changes to logic. 50822 Shorten static buffer. 50823 (sys_rt_sigprocmask): Remove stray empty line. 50824 * syscall.c: Add warning directive when we detect that 50825 NSIG is undefined. Add comment about NSIG on ARM. 50826 50827 2011-08-23 Dmitry V. Levin <ldv (a] altlinux.org> 50828 50829 Fix PTRACE_SETOPTIONS tests. 50830 * strace.c [LINUX] (kill_save_errno): New function. 50831 (test_ptrace_setoptions_followfork): Change return type to void. 50832 Fix and harden error handling. Use kill_save_errno() to avoid errno 50833 clobbering. Treat EIO from ptrace() the same way as EINVAL. 50834 (test_ptrace_setoptions_for_all): Use kill_save_errno() to avoid errno 50835 clobbering. Treat EIO from ptrace() the same way as EINVAL. 50836 (main): Update use of test_ptrace_setoptions_followfork(). 50837 50838 Fix compilation on linux 2.4.x. 50839 * configure.ac: Check for BLKGETSIZE64. 50840 * block.c (block_ioctl): Check for HAVE_BLKGETSIZE64. 50841 50842 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 50843 50844 Remove tcp->parent and TCB_CLONE_THREAD. 50845 tcp->parent is used for only two things: 50846 (1) to send signal on detach via tgkill (need to know tgid). 50847 Solution: use tkill, it needs only tid. 50848 (2) to optimize out ptrace options setting for new tracees. 50849 Not a big deal if we drop this optimization: "set options" op is fast, 50850 doing it just one extra time once per each tracee is hardly measurable. 50851 50852 TCB_CLONE_THREAD is a misnomer. It used only to flag sibling we attached to 50853 in startup_attach. This is used to prevent infinite recursive rescanning 50854 of /proc/PID/task. 50855 Despite the name, there is no guarantee it is set only on non-leader: 50856 if one would run "strace -f -p THREAD_ID" and THREAD_ID is *not* 50857 a thread leader, strace will happily attach to it and all siblings 50858 and will think that THREAD_ID is the leader! Which is a bug, but 50859 since we no longer detach when we think tracee is going to die, 50860 this bug no longer matters, because we do not use the knowledge 50861 about thread group leaders for anything. (We used it to delay 50862 leader's exit). 50863 50864 IOW: after this patch strace has no need to know about threads, parents 50865 and children, and so on. Therefore it does not track that information. 50866 It treats all tracees as independent entities. Overall, 50867 this simplifies code a lot. 50868 50869 * defs.h: Add TCB_ATTACH_DONE flag, remove TCB_CLONE_THREAD flag 50870 and struct tcb::parent field. 50871 * process.c (internal_fork): Don't set tcpchild->parent. 50872 * strace.c (startup_attach): Use TCB_ATTACH_DONE flag instead of 50873 TCB_CLONE_THREAD to avoid attach attempts on already-attached threads. 50874 Unlike TCB_CLONE_THREAD, TCB_ATTACH_DONE bit is used only temporarily, 50875 and only in this function. We clear it on every tcb before we return. 50876 (detach): Use tkill instead of tgkill. 50877 (trace): Set ptrace options on new tracees unconditionally, 50878 not only when tcp->parent == NULL. 50879 50880 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 50881 50882 Remove TCB_SUSPENDED constant and related code. 50883 Since we no longer suspend waitpid'ing tracees, we have only one case when 50884 we suspend tracee: when we pick up a new tracee created by clone/fork/vfork. 50885 50886 Background: on some other OSes, attach to child is done this way: 50887 get fork's result (pid), loop ptrace(PTRACE_ATTACH) until you hook up 50888 new process/thread. This is ugly and not safe, but what matters for us 50889 is that it doesn't require suspending. Suspending is required 50890 on Linux only, because on Linux attach to child is done differently. 50891 50892 On Linux, we use two methods of catching new tracee: 50893 adding CLONE_THREAD bit to syscall (if needed, we change 50894 [v]fork into clone before that), or using ptrace options. 50895 In both cases, it may be so that new tracee appears before one which 50896 created it returns from syscall. In this case, current code 50897 suspends new tracee until its creator returns. Only then 50898 strace can determine who is its parent (it needs child's pid for this, 50899 which is visible in parent's [v]fork/clone result). 50900 This is inherently racy. For example, what if SIGKILL kills 50901 creator after it succeeded creating child, but before it returns? 50902 Looks like we will have child suspended forever. 50903 50904 But after previous commit, we DO NOT NEED parent<->child link for anything. 50905 Therefore we do not need suspending too. Bingo! 50906 50907 This patch removes suspending code. Now new tracees will be continued 50908 right away. Next patch will remove tcp->parent member. 50909 50910 * defs.h: Remove TCB_SUSPENDED constant 50911 * process.c (handle_new_child): Delete this function. 50912 (internal_fork): Do not call handle_new_child on syscall exit. 50913 * strace.c (handle_ptrace_event): Delete this function. 50914 (trace): Do not suspend new child; remove all handling 50915 of now impossible TCB_SUSPENDED condition. 50916 50917 2011-08-17 Denys Vlasenko <dvlasenk (a] redhat.com> 50918 50919 Do not detach when we think tracee is going to die. 50920 Current code plays some ungodly tricks, trying to not detach 50921 thread group leader until all threads exit. 50922 50923 Also, it detaches from a tracee when signal delivery is detected 50924 which will cause tracee to exit. 50925 This operation is racy (not to mention the determination 50926 whether signal is set to SIG_DFL is a horrible hack): 50927 after we determined that this signal is indeed fatal 50928 but before we detach and let process die, 50929 *other thread* may set a handler to this signal, and 50930 we will leak the process, falsely displaying it as killed! 50931 50932 I need to look in the past to figure out why we even do it. 50933 First guess is that it's a workaround for old kernel bugs: 50934 kernel used to deliver exit notifications to the tracer, 50935 not to real parent. These workarounds are ancient 50936 (internal_exit is from 1995). 50937 50938 The patch deletes the hacks. We no longer need tcp->nclone_threads, 50939 TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather 50940 ugly functions. 50941 50942 I also added a new message: "+++ exited with EXITCODE +++" 50943 which shows exact moment strace got exit notification. 50944 It is analogous to existing "+++ killed by SIG +++" message. 50945 50946 * defs.h: Delete struct tcb::nclone_threads field, 50947 TCB_EXITING and TCB_GROUP_EXITING constants, 50948 declarations of sigishandled() and internal_exit(). 50949 * process.c (internal_exit): Delete this function. 50950 (handle_new_child): Don't ++tcp->nclone_threads. 50951 * signal.c (parse_sigset_t): Delete this function. 50952 (sigishandled): Delete this function. 50953 * strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++. 50954 (droptcb): Don't delay dropping if tcp->nclone_threads > 0, 50955 don't drop parent if its nclone_threads reached 0: 50956 just drop (only) this tcb unconditionally. 50957 (detach): don't drop parent. 50958 (handle_group_exit): Delete this function. 50959 (handle_ptrace_event): Instead of handle_group_exit, just drop tcb; 50960 do not panic if we see WIFEXITED from an attached pid; 50961 print "+++ exited with EXITCODE +++" for every WIFEXITED pid. 50962 * syscall.c (internal_syscall): Do not treat sys_exit specially - 50963 don't call internal_exit on it. 50964 50965 2011-08-16 Sergei Trofimovich <slyfox (a] gentoo.org> 50966 50967 Declare printrusage32() on Alpha. 50968 * defs.h [ALPHA] (printrusage32): New declaration. 50969 50970 2011-08-15 Denys Vlasenko <dvlasenk (a] redhat.com> 50971 50972 Slight optimization and cleanup in trace() 50973 * strace.c (trace): Do not recalculate "cflag ? &ru : NULL" 50974 again and again. Do not clear errno unnecessarily. 50975 Consistently check wait errors as pid < 0, not pid == -1. 50976 Indent ifdefs for better readability. 50977 Remove comments after endif if ifdef/endif block is really tiny. 50978 50979 Fix compilation on 2.4.20 kernel based system. 50980 * block.c (block_ioctl): add ifdef/endif around BLKGETSIZE64 usage 50981 * strace.c (trace): add ifdef/endif around WIFCONTINUED usage 50982 50983 2011-07-19 Dmitry V. Levin <ldv (a] altlinux.org> 50984 50985 Check for additional PTRACE_* constants. 50986 * configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD, 50987 PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC, 50988 PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT. 50989 * defs.h [LINUX]: Define these PTRACE_* constants when they are not 50990 provided by <sys/ptrace.h>. 50991 50992 Reported-by: Douglas Mencken <dougmencken (a] gmail.com> 50993 Reported-by: Steve Bennett <steveb (a] workware.net.au> 50994 50995 2011-07-19 Denys Vlasenko <dvlasenk (a] redhat.com> 50996 50997 Remove superfluous backslash-continuation in configure.ac. 50998 * configure.ac: remove superfluous backslash continuation 50999 in AC_CHECK_DECLS 51000 51001 2011-06-24 Denys Vlasenko <dvlasenk (a] redhat.com> 51002 51003 Make IOCTL_WSTOP more readable. 51004 * defs.h: Make IOCTL_WSTOP more readable 51005 51006 Trivial cleanups. 51007 * strace.c (trace): Change ifdef LINUX to make a bit more sense, 51008 remove wrong comment at its endif. Slightly optimize 51009 "+++ killed by SIG +++" message for systems without WCOREDUMP macro. 51010 51011 Remove redundant include <stdarg.h> 51012 * strace.c: Remove redundant include <stdarg.h> 51013 51014 Clean up two old comments. 51015 * strace.c (startup_attach): Remove misplaced comment. 51016 (trace) Remove incomplete part of a comment. 51017 51018 Make a few variables static. 51019 * defs.h: Remove tcbtab declaration. 51020 * strace.c: Make run_uid, run_gid, outf, tcbtab, progname 51021 global variables static 51022 51023 Add debug output in initial attachment code. 51024 * strace.c (startup_attach): If -d, report pid and success/failure 51025 of every attach attempt. 51026 51027 Better debug logging of allocations and waitpit results. 51028 * strace.c (alloc_tcb): Print number of allocated tcb's if -d. 51029 (droptcb): Likewise. 51030 (handle_ptrace_event): Remove PTRACE_EVENT_EXEC debug message. 51031 (trace): Improve logging of waitpid: show WIFxxx, exitcode/signal, 51032 ptrace event name, WCOREDUMP - all on one line. 51033 51034 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51035 51036 Optimize arrays of register indexes in syscall_enter. 51037 * syscall.c (syscall_enter) [BFIN]: Make register no array "static const". 51038 [SH]: Make register no array "const", pre-multiply it by 4. 51039 [SH64]: Make register no array "const". 51040 [X86_64]: Make register no array "const", pre-multiply it by 8. 51041 51042 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51043 51044 Deindent syscall_enter by removing unnecessary braces. No code changes. 51045 syscall_enter has many long (>80 columns) lines. 51046 It is aggravated by the fact that it has a lot of {} blocks 51047 which are not necessary (the code is the same without them). 51048 This patch removes {}s and deindents affected lines. 51049 While at it, it indents ifdefs so that nesting is easier to track, 51050 and adds a few spaces in the expressions, such as 51051 "tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...". 51052 There is no actual changes to the code here. 51053 51054 * syscall.c (syscall_enter): Remove unnecessary {} blocks. 51055 51056 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51057 51058 Remove dead "ifndef CLONE_PTRACE" branch. 51059 process.c defines CLONE_PTRACE for Linux, so it can't be undefined. 51060 Therefore ifndef CLONE_PTRACE code is dead (since at least 2004). 51061 This patch removes it. 51062 51063 * process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not 51064 the code inside) and entire ifndef CLONE_PTRACE/endif block. 51065 51066 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51067 51068 Add a comment about setbpt. No code changes. 51069 * defs.h: Add a comment about setbpt(). 51070 51071 Untangle a particularly badly obfuscated bit of code. No logic changes. 51072 * util.c (setbpt): Calculate new arg0 in more readable way. 51073 51074 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51075 51076 Remove TCB_FOLLOWFORK. 51077 TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow 51078 all [v]forks/clones or don't follow any, therefore global variable 51079 followfork is an already existing indicator of what we want to do. 51080 This patch drops all setting/clearing of TCB_FOLLOWFORK bit, 51081 and replaces checks for this bit by checks of followfork value. 51082 In internal_fork, check is moved to in front of if(), since 51083 the check is needed on both "entering" and "exiting" branch. 51084 51085 * defs.h: Remove TCB_FOLLOWFORK define. 51086 * process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK, 51087 test followfork instead of tcp->flags & TCB_FOLLOWFORK. 51088 (handle_new_child): Likewise. 51089 * strace.c (startup_attach): Likewise. 51090 51091 2011-06-23 Dmitry V. Levin <ldv (a] altlinux.org> 51092 51093 * system.c (sys_capget, sys_capset): Fix pointer arithmetics. 51094 51095 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51096 51097 Make initial tcb allocation more readable. No logic changes. 51098 * strace.c (main): Make initial tcb allocation more readable. 51099 51100 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51101 51102 Do not allocate tiny cap_user_header/data structures, place them on stack. 51103 This allows us to avoid having code to malloc them, and code to check 51104 for malloc failure. Resulting code decrease: 51105 text data bss dec hex filename 51106 10175 0 16 10191 27cf system.o.old 51107 9797 0 0 9797 2645 system.o 51108 51109 * system.c (sys_capget): Put cap_user_header_t and cap_user_data_t 51110 on stack, rather than allocating them in heap. These structures 51111 are very small (a few integer fields), stack is a better place 51112 for them. 51113 (sys_capset): Likewise. 51114 51115 2011-06-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51116 51117 Use [p]error_msg[_and_die] where appropriate. No logic changes. 51118 Resulting size changes: 51119 text data bss dec hex filename 51120 17445 16 8572 26033 65b1 strace.o.old 51121 16850 16 8572 25438 635e strace.o 51122 51123 * strace.c: Replace fprintf[+cleanup]+exit with [p]error_msg_and_die, 51124 fprintf("progname: ...") with [p]error_msg where appropriate. 51125 51126 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51127 51128 Whitespace cleanups. No code changes. 51129 * count.c: Place opening curly brace after if (), 51130 not on the next line. Almost all strace code alredy 51131 uses this style. 51132 * desc.c: Likewise. 51133 * file.c: Likewise. 51134 * net.c: Likewise. 51135 * pathtrace.c: Likewise. 51136 * process.c: Likewise. 51137 * quota.c: Likewise. 51138 * signal.c: Likewise. 51139 * strace.c: Likewise. 51140 * syscall.c: Likewise. 51141 * time.c: Likewise. 51142 51143 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51144 51145 Make strace_fopen abort on error. 51146 Error from strace_fopen in main results in call to exit(1). 51147 Error from strace_fopen in newoutf is propagated to newoutf 51148 callers: startup_attach (where it results in exit(1)) 51149 and alloc_tcb (where error is ignored). In second case, 51150 the behavior doesn't seem to be right: it means with -ff 51151 on open error for new LOGFILE.PID the output will continue 51152 to go into *the same file as the previous process* - which 51153 would be confusing. Moreover, on droptcb outf may be closed 51154 and the output of other, still running process outputting 51155 to the same outf will be lost. I don't think this is sane. 51156 IOW: in all cases, error in strace_fopen should be fatal. 51157 51158 * strace.c (strace_fopen): Abort on error instead of returning NULL. 51159 (newoutf): Change return type to void. 51160 (startup_attach): Remove error check on newoutf return value. 51161 (main): Remove error check on strace_fopen return value. 51162 51163 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51164 51165 Make set_cloexec_flag abort on error. 51166 set_cloexec_flag() may fail only if we pass it a bad fd, 51167 such as -1 or non-opened one. If we do, we have a bug 51168 in the caller. It makes no sense to try to continue 51169 running when we detect such a blatant bug in our own code. 51170 51171 * strace (set_cloexec_flag): Abort instead of returning error 51172 indicator. Change function to return void. 51173 (strace_fopen): Remove error check on set_cloexec_flag return value. 51174 (proc_open): Likewise. 51175 (proc_poll_open): Likewise. 51176 51177 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51178 51179 Make strace_popen abort on error. 51180 It makes no sense to postpone abort on strace_popen error 51181 unti it returns. Moreover, out-of-memory error was exiting 51182 without any message. 51183 While at it, use 0 as "none" for popen_pid, as optimization. 51184 51185 * strace: Initialize popen_pid to 0 - this puts it in bss. 51186 (trace): Reset popen_pid to 0 instead of -1. 51187 (strace_popen): Never return NULL as error indicator, 51188 abort with good error message instead. 51189 (main): Remove NULL check of strace_popen result. 51190 51191 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51192 51193 Delete fork_tcb() 51194 Get rid of fork_tcb() function. It used to do what the comment 51195 above it says, but now it doesn't do much: 51196 it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls 51197 expand_tcbtab(). The second operation is not necessary, since 51198 alloc_tcp() will do it itself when needed. 51199 This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK 51200 where it was formerly called. It also makes nprocs, tcbtabsize and 51201 expand_tcbtab() static. (While at it, I nuked redundant 51202 extern char **environ declaration: strace.c had *two* of them...) 51203 51204 * defs.h: Remove declarations of nprocs, tcbtabsize and 51205 expand_tcbtab. 51206 * process.c (fork_tcb): Remove this function. 51207 (internal_fork): Open-code fork_tcb. 51208 (handle_new_child): Likewise. 51209 * strace.c: Remove redundant "extern char **environ". Declare 51210 nprocs and tcbtabsize static. 51211 (expand_tcbtab): Make it static. 51212 51213 2011-06-22 Denys Vlasenko <dvlasenk (a] redhat.com> 51214 51215 Simplify expand_tcbtab and alloc_tcb. 51216 Get rid of a few intermediate variables, simplifies a few expressions, 51217 and uses error_msg_and_die instead of more verbose 51218 fprintf+cleanup+exit sequence. 51219 In alloc_tcp, I use memset to clear entire new tcp. 51220 This not only saves a few bytes of code, but lowers the chances 51221 of future bugs where some data "leaks out" into new tcb's 51222 from old ones because we forgot to re-initialize it. 51223 51224 * strace.c (expand_tcbtab): Simplify this function. No logic changes. 51225 (alloc_tcb): Likewise. 51226 51227 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 51228 51229 Trivial fixes. 51230 * process.c (internal_fork): Remove conditionals which make no difference 51231 (we return 0 on both branches of these ifs). 51232 * util.c: Fix indentation of an ifdef. 51233 51234 2011-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 51235 51236 Fix build when libaio-devel is not available. 51237 * desc.c: Do not compile code that uses struct iocb unless 51238 HAVE_LIBAIO_H is set. 51239 51240 Reported-by: Denys Vlasenko <dvlasenk (a] redhat.com> 51241 51242 2011-06-21 Dmitry V. Levin <ldv (a] altlinux.org> 51243 51244 tests: finish ptrace_setoptions_* merge. 51245 * tests/Makefile.am (TESTS): Merge ptrace_setoptions_*. 51246 * tests/ptrace_setoptions: Check for Linux kernel > 2.6. 51247 51248 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 51249 51250 Remove write-only nchildren member from struct tcb. 51251 * defs.h: Remove nchildren member from struct tcb. 51252 * process.c (handle_new_child): Remove inc/decrements of tcp->nchildren. 51253 (internal_fork): Likewise. 51254 * strace.c (startup_attach): Likewise. 51255 (droptcb): Likewise. 51256 (alloc_tcb): Remove initialization of tcp->nchildren. 51257 51258 Fix tests/ptrace_setoptions_* to match last fix in ptrace options code. 51259 51260 Remove write-only nzombies member from struct tcb. 51261 * defs.h: Remove nzombies member from struct tcb. 51262 * strace.c (droptcb): Remove "tcp->parent->nzombies++". 51263 (alloc_tcb): Remove "tcp->nzombies = 0". 51264 51265 2011-06-21 Denys Vlasenko <dvlasenk (a] redhat.com> 51266 51267 Fix regression introduced by "Properly handle real SIGTRAPs" change. 51268 Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54 51269 introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set. 51270 The check (tcp->parent == NULL) in old code was meant to check 51271 "if we are not a child created by auto-attach" - in this case, 51272 options need to be set on the child; otherwise they are inherited 51273 and do not need to be set. 51274 I misunderstood the check and if tcp->parent is not NULL, I was 51275 setting only ptrace_setoptions_for_all bits. 51276 This change fixes the problem. Since the fixed logic makes it 51277 unnecessary to keep two sets of options in separate variables, 51278 I merge them back into one variable, ptrace_setoptions. 51279 51280 * defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all 51281 into one variable, ptrace_setoptions. 51282 * strace.c: Likewise. 51283 (test_ptrace_setoptions_followfork): Use ptrace_setoptions variable. 51284 (test_ptrace_setoptions_for_all): Likewise. 51285 (main): Likewise. 51286 * process.c (internal_fork): Likewise. 51287 (internal_exec): Likewise. 51288 * strace.c (trace): Fix the bug where different options were set 51289 depending on "tcp->parent == NULL" condition. Add a comment 51290 which makes it more clear why this condition is checked. 51291 51292 2011-06-18 Denys Vlasenko <dvlasenk (a] redhat.com> 51293 51294 Do not suspend waitpid. 51295 strace used to suspend waitpid until there is a child 51296 for waitpid'ing process to collect status from. 51297 Apparently, it was done because in some very old kernels 51298 (circa 2002 or even earlier) there were ptrace bugs which 51299 were making waitpid in real parent to not see children. 51300 This kernel bug is fixed long ago. This change removes the workaround. 51301 test/wait_must_be_interruptible.c is a test program which 51302 illustrates why without this change strace changes 51303 programs's behavior. 51304 51305 * defs.h: Delete waitpid and nclone_waiting members from from struct tcb. 51306 Remove declaration of internal_wait(). 51307 * process.c (internal_wait): Remove this function. 51308 * strace.c (alloc_tcb): Do not set tcp->nclone_waiting. 51309 (resume): Remove this function. 51310 (resume_from_tcp): Remove this function. 51311 (detach): Do not call resume_from_tcp(). 51312 (handle_group_exit): Do not call resume_from_tcp(). 51313 * syscall.c (internal_syscall): Do not call internal_wait(). 51314 51315 2011-06-13 Andi Kleen <ak (a] linux.intel.com> 51316 51317 Enhance io_submit() decoding. 51318 strace didn't decode important fields in the iocb passed to io_submit. 51319 This patch changes the code to dump them all. Also it prefixes the fields 51320 with names to make it easier to read. 51321 51322 * desc.c (iocb_cmd_lookup, print_common_flags): New functions. 51323 (sys_io_submit): New iocb decoder. 51324 51325 2011-06-13 Dmitry V. Levin <ldv (a] altlinux.org> 51326 51327 Add argument to tprint_iov() specifying whether to decode each iovec. 51328 * defs.h (tprint_iov): Add decode_iov argument. 51329 * io.c (tprint_iov): Implement new decode_iov argument. 51330 (sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update 51331 tprint_iov calls. 51332 * net.c (do_msghdr): Likewise. 51333 51334 Introduce ARRAY_SIZE() macro. 51335 * defs.h (ARRAY_SIZE): New macro. 51336 * ioctl.c: Use it. 51337 * pathtrace.c (pathmatch, storepath): Likewise. 51338 * process.c (printpriv): Likewise. 51339 * signal.c: Likewise. 51340 * syscall.c: Likewise. 51341 51342 2011-06-13 Andi Kleen <ak (a] linux.intel.com> 51343 51344 Fix decoding of timer id returned by timer_create. 51345 * time.c (sys_timer_create): The kernel returns a integer, not a 51346 pointer for the timer id in the memory pointed to by timer_id. 51347 51348 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 51349 51350 Add test for PTRACE_O_TRACESYSGOOD. 51351 * tests/ptrace_setoptions_for_all: New file. 51352 * tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all. 51353 51354 tests: update test for linux kernel version. 51355 * tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6. 51356 51357 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 51358 51359 Update ptrace_setoptions test. 51360 The test have to be adjusted after commit v4.6-5-g3454e4b. 51361 51362 * ptrace_setoptions: Update grep pattern, rename to 51363 ptrace_setoptions_followfork. 51364 * tests/Makefile.am (TESTS): Rename ptrace_setoptions to 51365 ptrace_setoptions_followfork. 51366 51367 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 51368 51369 * strace.c (verror_msg): Rewrite without use of heap memory allocation. 51370 51371 2011-06-09 Dmitry V. Levin <ldv (a] altlinux.org> 51372 51373 Fix MIPS syscall entries. 51374 * linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337, 51375 and 4338 syscall numbers. 51376 51377 Reported-by: Denys Vlasenko <dvlasenk (a] redhat.com> 51378 51379 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 51380 51381 Don't display bogus parameter for sigreturn syscall. 51382 * linux/*/syscallent.h: For those arches which use sys_sigreturn, 51383 not printargs, to show [rt_]sigreturn syscall, change number of arguments 51384 from 1 to 0: sys_sigreturn function doesn't use syscall parameters. 51385 (I guess kernel doesn't actually _have_ any parameters for this syscall, 51386 at least on these architectures). Do the same change for I386 and x86-64 51387 even though they use printargs: I looked at kernel code and syscall 51388 definitely doesn't have any parameters on these arches. 51389 (I hesitate to change 1 to 0 params for arches I don't know - 51390 it is remotely possible some of them do have a parameter for this syscall). 51391 51392 Optimize sigreturn handling. 51393 * signal.c (sys_sigreturn): move stack pointer variables, 51394 and for SPARC and MIPS, stack pointer and sigmask reading code 51395 into "if (entering) ..." block, because it is only needed 51396 in this branch; load tcp->u_arg[1] into sigmask for display 51397 _after_ we know for sure u_arg[1] does contain valid sigmask 51398 (IOW: perform operation only when we know we will need the result) 51399 51400 Do not call umoven to fetch parameters if we have zero params. 51401 * syscall.c [I386] (syscall_enter): Do not call umoven 51402 to fetch zero bytes. This is just an optimization. 51403 51404 "Modernize" four old-style function parameter declarations. 51405 * signal.c (signame, long_to_sigset, printsigmask, printsignal): 51406 Convert old-style C function definitions to a "modern" form. 51407 This does not change any actual code. 51408 51409 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 51410 51411 Fix sigreturn decoding on MIPS. 51412 The "return 0" line was accidentally deleted circa 2007, 51413 which made sigreturn on MIPS always display "= 0" return 51414 instead of more informative " = ? (mask now [MASK])". 51415 51416 * strace.c (sys_sigreturn): Add wrongly deleted "return 0" line 51417 51418 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 51419 51420 Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed 51421 We already do it in the normal case, but in rare code path where 51422 tracee is gone (SIGKILLed?) sometimes we were printing this: 51423 "SYSCALL(ARGS <unavailable>)= ? <unavailable>" - note jammed together ")=". 51424 test/sigkill_rain.c can be used to verify the fix. 51425 51426 * strace.c (printleader): add a space after ")" in " <unavailable>)" 51427 51428 2011-06-08 Denys Vlasenko <dvlasenk (a] redhat.com> 51429 51430 Add fflush after printf in test/sigkill_rain.c. 51431 51432 Update test/* directory, it seem to be a bit bit-rotted. 51433 Added README; modified sigkill_rain.c to be more understandable, 51434 made clone.c compile; added wait_must_be_interruptible.c test; 51435 updated Makefile and .gitignore. 51436 51437 2011-06-07 Denys Vlasenko <dvlasenk (a] redhat.com> 51438 51439 Whitespace cleanups. no code changes. 51440 * bjm.c: Fix tabulation (such as extra spaces before tabs), 51441 convert punctuation where it deviates from prevalent form 51442 elsewhere in strace code, convert sizeof and offsetof where 51443 it deviates from from prevalent form, remove space between 51444 function/macro/array names and (parameters) or [index], 51445 add space between "if" and (condition), correct non-standard 51446 or wrong indentaion. 51447 * defs.h: Likewise 51448 * desc.c: Likewise 51449 * file.c: Likewise 51450 * ipc.c: Likewise 51451 * linux/arm/syscallent.h: Likewise 51452 * linux/avr32/syscallent.h: Likewise 51453 * linux/hppa/syscallent.h: Likewise 51454 * linux/i386/syscallent.h: Likewise 51455 * linux/ioctlsort.c: Likewise 51456 * linux/m68k/syscallent.h: Likewise 51457 * linux/microblaze/syscallent.h: Likewise 51458 * linux/powerpc/syscallent.h: Likewise 51459 * linux/s390/syscallent.h: Likewise 51460 * linux/s390x/syscallent.h: Likewise 51461 * linux/sh/syscallent.h: Likewise 51462 * linux/sh64/syscallent.h: Likewise 51463 * linux/tile/syscallent.h: Likewise 51464 * linux/x86_64/syscallent.h: Likewise 51465 * mem.c: Likewise 51466 * net.c: Likewise 51467 * pathtrace.c: Likewise 51468 * process.c: Likewise 51469 * signal.c: Likewise 51470 * sock.c: Likewise 51471 * strace.c: Likewise 51472 * stream.c: Likewise 51473 * sunos4/syscall.h: Likewise 51474 * sunos4/syscallent.h: Likewise 51475 * svr4/syscall.h: Likewise 51476 * svr4/syscallent.h: Likewise 51477 * syscall.c: Likewise 51478 * system.c: Likewise 51479 * test/childthread.c: Likewise 51480 * test/leaderkill.c: Likewise 51481 * test/skodic.c: Likewise 51482 * time.c: Likewise 51483 * util.c: Likewise 51484 51485 2011-05-30 Dmitry V. Levin <ldv (a] altlinux.org> 51486 51487 ARM EABI: fix 64-bit syscall's arguments decoding. 51488 ARM OABI and ARM EABI have different function parameters passing rules. 51489 With EABI, 64-bit function parameters passed in registers are aligned to 51490 an even-numbered register instead of using the next available pair, see 51491 http://lkml.org/lkml/2006/1/12/175 51492 This rule also applies to syscall's arguments. 51493 51494 * linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64, 51495 readahead, preadv, pwritev): Fix number of arguments. 51496 * util.c (printllval): Align 64bit argument to 64bit boundary on 51497 __ARM_EABI__. 51498 51499 Reported-by: Damir Shayhutdinov <damir (a] altlinux.org> 51500 51501 2011-05-30 Damir Shayhutdinov <damir (a] altlinux.ru> 51502 51503 Linux: implement decoding of preadv and pwritev syscalls. 51504 * io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions. 51505 * linux/syscall.h (sys_preadv, sys_pwritev): Declare them. 51506 * linux/*/syscallent.h: Use them. 51507 51508 2011-05-30 Denys Vlasenko <dvlasenk (a] redhat.com> 51509 51510 "Modernize" all old-style function parameter declarations. 51511 * bjm.c: Convert all remaining old-style C function definitions 51512 to a "modern" form. This does not change any actual code. 51513 * io.c: Likewise 51514 * ioctl.c: Likewise 51515 * net.c: Likewise 51516 * proc.c: Likewise 51517 * process.c: Likewise 51518 * signal.c: Likewise 51519 * sock.c: Likewise 51520 * strace.c: Likewise 51521 * stream.c: Likewise 51522 * syscall.c: Likewise 51523 * system.c: Likewise 51524 * time.c: Likewise 51525 * util.c: Likewise 51526 51527 2011-05-27 Denys Vlasenko <dvlasenk (a] redhat.com> 51528 51529 Cleanups on top of "handle SIGTRAP properly" change, based on Dmitry's comments. 51530 * defs.h ([p]error_msg[_and_die]): Declare new functions. 51531 * strace.c (SYSCALLTRAP): Rename to syscall_trap_sig. 51532 ([p]error_msg[_and_die]): Define new functions. 51533 (strace_tracer_pid): New variable, it controls which pid will 51534 do cleanup on exit via [p]error_msg_and_die. 51535 (main): Set strace_tracer_pid to our initial pid. 51536 (startup_attach): Change strace_tracer_pid if we are in -D mode. 51537 (test_ptrace_setoptions_for_all): Minor changes to logic, 51538 such as better diagnostic messages. 51539 51540 2011-05-25 Denys Vlasenko <dvlasenk (a] redhat.com> 51541 51542 Identifier "errno" may be a macro, it's unsafe to use it. 51543 * strace.c (strerror): Rename parameter errno to err_no 51544 51545 2011-05-24 Denys Vlasenko <dvlasenk (a] redhat.com> 51546 51547 Don't perform TCB_WAITEXECVE wait if not needed. 51548 * defs.h (ptrace_setoptions_for_all): Expose this variable. 51549 * strace.c (ptrace_setoptions_for_all): Remove "static". 51550 * process.c (internal_exec): Don't set TCB_WAITEXECVE bit 51551 if we know that post-execve SIGTRAP is not going to happen. 51552 51553 2011-05-23 Denys Vlasenko <dvlasenk (a] redhat.com> 51554 51555 Properly handle real SIGTRAPs. 51556 * defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork. 51557 * process.c (internal_fork): Ditto. 51558 * strace.c (ptrace_setoptions_for_all): New variable. 51559 (SYSCALLTRAP): New variable. 51560 (error_msg_and_die): New function. 51561 (test_ptrace_setoptions_for_all): New function. 51562 (main): Call test_ptrace_setoptions_for_all() at init. 51563 (handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it). 51564 (trace): Check events and set ptrace options without -f too. 51565 Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP. 51566 51567 2011-04-24 Mike Frysinger <vapier (a] gentoo.org> 51568 51569 Blackfin: update syscall list. 51570 51571 * linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at, 51572 clock_adjtime, and syncfs syscalls. 51573 51574 2011-04-24 Mike Frysinger <vapier (a] gentoo.org> 51575 51576 linux: add new EHWPOISON errno. 51577 51578 * linux/errnoent.h: Change ERRNO_133 to EHWPOISON. 51579 51580 2011-04-08 Grant Edwards <grant.b.edwards (a] gmail.com> 51581 51582 Add ability to print file descriptor paths and filter by those paths. 51583 * pathtrace.c: New file, implements matching syscall arguments to 51584 user-specified file paths. 51585 * Makefile.am (strace_SOURCES): Add pathtrace.c. 51586 * defs.h (TCB_FILTERED, filtered): New defines. 51587 (getfdpath, pathtrace_select, pathtrace_match, show_fd_path, 51588 tracing_paths): New declarations. 51589 * strace.c (show_fd_path, tracing_paths): New global variables. 51590 (usage, main): Implement handling of -y and -P options. 51591 * strace.1: Add descriptions of -y and -P options. 51592 * syscall.c (trace_syscall_entering): Add path matching logic to the 51593 print/noprint decision and set the TCB_FILTERED bit appropriately. 51594 (trace_syscall_exiting): Use filtered() macro that checks the 51595 TCB_FILTERED bit to determine print/noprint status. 51596 * util.c (printfd): Use getfdpath(). 51597 51598 2011-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 51599 51600 Fix BLKTRACESTOP definition. 51601 * block.c: Fix typo in the check for BLKTRACESTOP. 51602 Reported by Gabor Z. Papp. 51603 51604 2011-03-15 Dmitry V. Levin <ldv (a] altlinux.org> 51605 51606 Ensure that PTRACE_GETSIGINFO et al are always defined on Linux. 51607 * configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants. 51608 * defs.h [LINUX]: Define those PTRACE_* constants that are not provided 51609 by <sys/ptrace.h>. 51610 51611 * CREDITS.in: Fix typo. 51612 51613 2011-03-14 Dmitry V. Levin <ldv (a] altlinux.org> 51614 51615 Update PTRACE_* constants. 51616 * process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET. 51617 51618 Prepare for 4.6 release. 51619 * NEWS: Update for 4.6 release. 51620 * configure.ac: Version 4.6. 51621 * debian/changelog: 4.6-1. 51622 * strace.spec: 4.6-1. 51623 51624 2011-03-14 Mike Frysinger <vapier (a] gentoo.org> 51625 51626 linux/ioctlent: unify them all. 51627 This unifies all the ioctlent.h's in the linux subdir while still 51628 allowing each arch to maintain its own minor list. 51629 51630 The basic method is: 51631 - each arch has linux/<arch>/ioctlent.h.in which defines only the 51632 arch-specific ioctls; 51633 - linux/ioctlent.h.in which defines only the common ioctls; 51634 - at build time, these two headers are combined and sorted to produce 51635 the linux/ioctlent.h file. 51636 51637 This also requires a little tweaking of the include files since the 51638 common ioctlent.h is a built file. 51639 51640 * linux/ioctlent.h: Split into linux/ioctlent.h.in and 51641 linux/i386/ioctlent.h.in, remove asm entries from the former, remove 51642 non-asm entries from the latter. 51643 * linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove 51644 non-asm entries. 51645 * linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove 51646 non-asm entries. 51647 * linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove 51648 non-asm entries. 51649 * linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove 51650 non-asm entries. 51651 * linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove 51652 non-asm entries. 51653 * linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in, 51654 remove non-asm entries. 51655 * linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove 51656 non-asm entries. 51657 * linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove 51658 non-asm entries. 51659 * linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove 51660 non-asm entries. 51661 * linux/arm/ioctlent.h.in: New file. 51662 * linux/avr32/ioctlent.h.in: Likewise. 51663 * linux/i386/ioctlent.h.in: Likewise. 51664 * linux/m68k/ioctlent.h.in: Likewise. 51665 * linux/microblaze/ioctlent.h.in: Likewise. 51666 * linux/tile/ioctlent.h.in: Likewise. 51667 * linux/x86_64/ioctlent.h.in: Likewise. 51668 * linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of 51669 ioctlent.h. 51670 * linux/sh64/ioctlent.h.in: Likewise. 51671 * linux/sparc64/ioctlent.h.in: Likewise. 51672 * linux/arm/ioctlent1.h: Update ioctlent.h include. 51673 * linux/powerpc/ioctlent1.h: Likewise. 51674 * linux/sparc/ioctlent1.h: Likewise. 51675 * linux/sparc64/ioctlent1.h: Likewise. 51676 * linux/x86_64/ioctlent1.h: Likewise. 51677 * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS). 51678 (EXTRA_DIST): Update. 51679 [MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in. 51680 [LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules. 51681 * .gitignore: Add linux/ioctlent.h. 51682 51683 2011-03-10 Dmitry V. Levin <ldv (a] altlinux.org> 51684 51685 Show more details about signals received by traced processess. 51686 * strace.c [!USE_PROCFS] (trace): Differentiate output format depending 51687 on PTRACE_GETSIGINFO success or failure. In the former case, use 51688 printsiginfo() to show more details about received signal. 51689 51690 Get rid of PT_GETSIGINFO. 51691 * strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is 51692 available. Replace PT_GETSIGINFO with PTRACE_GETSIGINFO. Use 51693 PTRACE_GETSIGINFO for all signals. 51694 51695 Enhance decoding of kernel-generated signals. 51696 * signal.c (printsiginfo) [LINUX]: Do not print uninteresting 51697 zero-initialized fields. 51698 51699 Fix decoding of user-generated signals. 51700 * signal.c [LINUX] (SI_FROMUSER): Define. 51701 [LINUX || SVR4] (printsiginfo) [SI_FROMUSER]: Enhance decoding. 51702 51703 Recognize SI_KERNEL and SI_ASYNCNL. 51704 * signal.c [LINUX] (SI_KERNEL, SI_ASYNCNL): Define. 51705 [LINUX || SVR4] (siginfo_codes): Add entries for SI_KERNEL and 51706 SI_ASYNCNL, reorder entries. 51707 51708 2011-03-05 Sebastian Pipping <sebastian (a] pipping.org> 51709 51710 Take all git branches into account for generation of CREDITS file. 51711 * Makefile.am: Make CREDITS target depend on all git branches. 51712 51713 2011-03-04 Dmitry V. Levin <ldv (a] altlinux.org> 51714 51715 Fix decoding of file descriptors. 51716 * defs.h (printfd): New function prototype. 51717 * util.c (printfd): New function. 51718 * file.c (print_dirfd): Update prototype to use printfd(). 51719 (sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat, 51720 sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat, 51721 sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd(). 51722 (sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64, 51723 sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64, 51724 sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync, 51725 sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr, 51726 sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64, 51727 sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch, 51728 sys_fallocate): Use printfd() for decoding of file descriptors. 51729 * desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2, 51730 decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for 51731 decoding of file descriptors. 51732 * io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread, 51733 sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64, 51734 sys_ioctl): Likewise. 51735 * mem.c (print_mmap, sys_mmap64): Likewise. 51736 * signal.c (do_signalfd): Likewise. 51737 * stream.c (decode_poll): Likewise. 51738 * time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise. 51739 Based on patch from Grant Edwards <grant.b.edwards (a] gmail.com>. 51740 51741 2011-03-03 Sebastian Pipping <sebastian (a] pipping.org> 51742 51743 Print shutdown(2) modes as SHUT_* constants. 51744 * net.c (shutdown_modes): New xlat structure. 51745 (sys_shutdown): Use shutdown_modes to decode 2nd syscall argument. 51746 51747 Fix decoding of inotify_init1() flags. 51748 * file.c (inotify_init_flags): New xlat structure. 51749 (sys_inotify_init1): Use it instead of open_mode_flags. 51750 51751 2011-03-03 Dmitry V. Levin <ldv (a] altlinux.org> 51752 51753 Fix struct xlat initialization bugs. 51754 * file.c (inotify_modes): Terminate with NULL entry. 51755 * net.c (sock_type_flags): Make this array static. 51756 (socketlayers): Add a comment that this array should remain not 51757 NULL-terminated. 51758 51759 tests: avoid SIGPIPE. 51760 * tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null". 51761 The former may result to strace being killed by SIGPIPE, which in 51762 certain configuratons may lead to generation of a core file. 51763 Suggested by Mike Frysinger. 51764 51765 2011-03-01 Mike Frysinger <vapier (a] gentoo.org> 51766 51767 tests: do not make missing /usr/bin/time a failure. 51768 * tests/init.sh (framework_skip_): New function. 51769 (check_prog): Use it instead of framework_failure_. 51770 51771 2011-02-27 Dmitry V. Levin <ldv (a] altlinux.org> 51772 51773 Generate an xz tar archive of the distribution. 51774 * configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with dist-xz. 51775 * Makefile.am: Update srpm target. 51776 * make-dist: Update for dist-xz. 51777 * strace.spec: Update Source tag. 51778 * debian/watch: Update regexp. 51779 * .gitignore: Add strace-*.tar.xz. 51780 51781 Use "make check" in debian/rules and strace.spec. 51782 * debian/control: Update Build-Depends. 51783 * debian/rules: Run "make check". 51784 * strace.spec: Update BuildRequires. Run "make check" in %check section. 51785 51786 Implement two basic "strace -f" tests. 51787 * Makefile.am (SUBDIRS): Add tests. 51788 * configure.ac (AC_CONFIG_FILES): Add tests/Makefile. 51789 * tests/.gitignore: New file. 51790 * tests/Makefile.am: Likewise. 51791 * tests/init.sh: Likewise. 51792 * tests/ptrace_setoptions: Likewise. 51793 * tests/strace-f: Likewise. 51794 51795 2011-02-26 Dmitry V. Levin <ldv (a] altlinux.org> 51796 51797 ppc, s390, sparc: regenerate ioctlent.h files. 51798 * linux/powerpc/ioctlent.h: Regenerated using Fedora 15 kernel headers. 51799 * linux/s390/ioctlent.h: Likewise. 51800 * linux/sparc/ioctlent.h: Likewise. 51801 51802 Remove redundant ioctlent.h files. 51803 * linux/s390x/ioctlent.h: Replace old contents with include of 51804 s390/ioctlent.h file. 51805 * linux/sparc64/ioctlent.h: Replace old contents with include of 51806 sparc/ioctlent.h file. 51807 51808 2011-02-25 Dmitry V. Levin <ldv (a] altlinux.org> 51809 51810 ioctlsort: sync with ioctl_lookup() 51811 * linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with 51812 ioctl_lookup() which looks at these bits only. 51813 51814 Remove obsolete .cvsignore files. 51815 * test/.cvsignore: Rename to test/.gitignore. 51816 * */.cvsignore, */*/.cvsignore: Removed. 51817 51818 Ignore generated intermediate header files. 51819 * .gitignore: Add ioctls.h and ioctldefs.h. 51820 51821 2011-02-24 Dmitry V. Levin <ldv (a] altlinux.org> 51822 51823 Generate much of the CREDITS file from git log. 51824 * CREDITS.in: New file, derived from CREDITS, without names of 51825 those who are listed as git log 'Author:'s. 51826 * CREDITS: Remove file. 51827 * Makefile.am [MAINTAINER_MODE] (CREDITS): New rule. 51828 * .gitignore: Add CREDITS. 51829 * .mailmap: New file, required to map git author names and email 51830 addresses to canonical/preferred form. 51831 51832 2011-02-23 Dmitry V. Levin <ldv (a] altlinux.org> 51833 51834 sparc: fix compilation warning. 51835 * file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size 51836 to unsigned long. 51837 51838 Update the list of files that must be distributed. 51839 * Makefile.am (EXTRA_DIST): Add debian/source/format, debian/watch, 51840 linux/ia64/signalent.h, linux/powerpc/ioctlent1.h, 51841 linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h, 51842 linux/powerpc/signalent1.h. 51843 51844 Fix compilation warning reported by gcc -Wunused-but-set-variable. 51845 * process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable. 51846 51847 2011-02-22 Mike Frysinger <vapier (a] gentoo.org> 51848 51849 ioctlsort: zero pad ioctl codes to 4 places. 51850 Zero padding the ioctl number will allow simple sorting via shell scripts. 51851 51852 * linux/ioctlsort.c (main): Output ioctl codes zero padded. 51853 * linux/ioctlent.h: Regenerated. 51854 51855 2011-02-22 Mike Frysinger <vapier (a] gentoo.org> 51856 51857 Update mount flags to latest linux. 51858 * system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION, 51859 MS_STRICTATIME, MS_BORN): Define. 51860 (mount_flags): Add MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION, 51861 MS_STRICTATIME, MS_BORN. 51862 51863 2011-02-22 Dmitry V. Levin <ldv (a] altlinux.org> 51864 51865 Sync debian/changelog and strace.spec with packages. 51866 * debian/changelog: Sync with 4.5.20-2. 51867 * strace.spec: Likewise. 51868 51869 2011-02-20 Dmitry V. Levin <ldv (a] altlinux.org> 51870 51871 Add TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries. 51872 * linux/*/syscallent.h: Add TD flag to fanotify_init. Add TD|TF flags 51873 to fanotify_mark. 51874 51875 Fix flags of fallocate sysentries. 51876 * linux/*/syscallent.h: Fix sys_fallocate flags. 51877 51878 Add TRACE_DESC flag to epoll_create* sysentries. 51879 * linux/*/syscallent.h: Add TD flag to sys_epoll_create and 51880 sys_epoll_create1. 51881 51882 Add TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries 51883 * linux/*/syscallent.h: Add TD flag to sys_fgetxattr, sys_flistxattr, 51884 and fremovexattr. 51885 51886 Add TRACE_FILE flag to swapoff sysentries. 51887 * linux/*/syscallent.h: Add TF flag to sys_swapoff. 51888 51889 Add TRACE_DESC flag to fadvise64* sysentries. 51890 * linux/*/syscallent.h: Add TD flag to sys_fadvise64 and 51891 sys_fadvise64_64. 51892 51893 Add TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries. 51894 * linux/*/syscallent.h: Add TD flag to sys_mmap and sys_old_mmap. 51895 51896 Do not initialize native_scno on platforms with only one personality. 51897 * linux/bfin/syscallent.h: Remove redundant native_scno initialization. 51898 * linux/m68k/syscallent.h: Likewise. 51899 * linux/microblaze/syscallent.h: Likewise. 51900 51901 Add LOOP_* ioctls defined in linux/loop.h. 51902 * linux/ioctlent.sh: Add LOOP_* ioctls (0x4C..) defined in linux/loop.h 51903 header file. 51904 * linux/ioctlent.h: Regenerated. 51905 Reported by Mike Frysinger. 51906 51907 2011-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 51908 51909 Fix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions() 51910 * strace.c (handle_ptrace_event): Fix PTRACE_GETEVENTMSG usage. 51911 (test_ptrace_setoptions): Test that PTRACE_GETEVENTMSG works properly. 51912 51913 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 51914 51915 linux/sparc: move to common syscall.h. 51916 Rather than constantly deal with the sparc/syscall.h going stale, merge 51917 the few sparc-specific pieces into the linux/syscall.h header. 51918 51919 * linux/syscall.h: Add sparc-specific pieces from sparc/syscall.h. 51920 * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h and 51921 linux/sparc64/syscall.h. 51922 * linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted. 51923 51924 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 51925 51926 sparc: add new funcs to syscall.h. 51927 Sync missing defs from the common syscall.h here. 51928 51929 * linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and 51930 sys_pwrite64 prototypes. 51931 51932 2011-02-19 Mike Frysinger <vapier (a] gentoo.org> 51933 51934 sparc: punt unused syscall.h.2. 51935 I can't find any mention of this header actually being used. 51936 Seems to be a really old copy of the common syscall.h. 51937 51938 * Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h.2. 51939 * linux/sparc/syscall.h.2: Deleted. 51940 51941 2011-02-19 Dmitry V. Levin <ldv (a] altlinux.org> 51942 51943 Fix raw exit_group(2) decoding. 51944 * syscall.c (trace_syscall_entering): Check for sys_exit instead of 51945 SYS_exit to handle exit_group(2) as well as _exit(2). 51946 51947 2011-02-18 Dmitry V. Levin <ldv (a] altlinux.org> 51948 51949 Optimize known_scno() 51950 * syscall.c (known_scno): Do not check for native_scno field on 51951 platforms that support only one personality. 51952 51953 * process.c (internal_exit) [IA64]: Remove redundant check. 51954 51955 2011-02-09 Dmitry V. Levin <ldv (a] altlinux.org> 51956 51957 Fix biarch support in IO dumping. 51958 * syscall.c (dumpio): Switch on tcp->sys_func instead of tcp->scno 51959 for more reliable results. 51960 51961 Simplify tprintf() declaration. 51962 * defs.h (tprintf): Simplify declaration. 51963 51964 2011-02-05 Dmitry V. Levin <ldv (a] altlinux.org> 51965 51966 * defs.h (SYSCALL_NEVER_FAILS): Fix typo. 51967 51968 2011-01-19 Dmitry V. Levin <ldv (a] altlinux.org> 51969 51970 Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values. 51971 * defs.h (SYSCALL_NEVER_FAILS): New syscall flag. 51972 * linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id 51973 and setfs[ug]id. 51974 * linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id, 51975 gete[ug]id and setfs[ug]id syscalls. 51976 * process.c [LINUX] (sys_getuid, sys_setfsuid): New functions. 51977 * syscall.c (NF): New shorthand macro for use in syscallent.h files. 51978 (get_error): Check SYSCALL_NEVER_FAILS flag. 51979 Reported by <socketpair (a] gmail.com>. 51980 51981 * linux/*/syscallent.h: Fix typo in sys_newfstatat syscall flags. 51982 51983 2011-01-18 Mike Frysinger <vapier (a] gentoo.org> 51984 51985 Blackfin: update ioctl list. 51986 * linux/bfin/ioctlent.h: Sync with latest kernel sources. 51987 51988 2011-01-17 Dmitry V. Levin <ldv (a] altlinux.org> 51989 51990 Fix stat64 decoding on mips. 51991 * linux/mips/syscallent.h: Use sys_stat64() to decode stat64 syscall. 51992 This fixes Debian bug #599028. 51993 51994 Update linux/*/syscallent.h files to match Linux kernel v2.6.37. 51995 * linux/alpha/syscallent.h: Add hooks for fanotify_init, fanotify_mark, 51996 and prlimit64. 51997 * linux/i386/syscallent.h: Likewise. 51998 * linux/ia64/syscallent.h: Likewise. 51999 * linux/m68k/syscallent.h: Likewise. 52000 * linux/microblaze/syscallent.h: Likewise. 52001 * linux/mips/syscallent.h: Likewise. 52002 * linux/powerpc/syscallent.h: Likewise. 52003 * linux/s390/syscallent.h: Likewise. 52004 * linux/s390x/syscallent.h: Likewise. 52005 * linux/sh/syscallent.h: Likewise. 52006 * linux/sh64/syscallent.h: Likewise. 52007 * linux/sparc/syscallent.h: Likewise. 52008 * linux/x86_64/syscallent.h: Likewise. 52009 * linux/arm/syscallent.h: Add hooks for accept4, fanotify_init, 52010 fanotify_mark, and prlimit64. 52011 * linux/hppa/syscallent.h: Add hook for prlimit64. 52012 52013 2011-01-16 Dmitry V. Levin <ldv (a] altlinux.org> 52014 52015 block.c: cleanup. 52016 * block.c: Include <inttypes.h>. 52017 (print_blkpg_req): Always decode struct blkpg_ioctl_arg. 52018 Robustify decoding of strings. 52019 (block_ioctl): Do not decode return values passed by pointers on exit 52020 from failed syscalls. 52021 Use format macros from inttypes.h to print values of type uint64_t. 52022 52023 2011-01-15 Dmitry V. Levin <ldv (a] altlinux.org> 52024 52025 Add block ioctl support. 52026 * block.c: New file. 52027 * Makefile.am (strace_SOURCES): Add it. 52028 * defs.h [LINUX] (block_ioctl): New function. 52029 * ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK* 52030 ioctls. 52031 Patch by Jeff Mahoney <jeffm (a] suse.com> 52032 52033 2011-01-14 Holger Hans Peter Freyther <zecke (a] selfish.org> 52034 52035 Parse SOL_SCTP socket options. 52036 * configure.ac (AC_CHECK_HEADERS): Add netinet/sctp.h. 52037 * net.c [HAVE_NETINET_SCTP_H]: Include <netinet/sctp.h>. 52038 [SOL_SCTP] (socksctpoptions): New xlat structure. 52039 (sys_getsockopt, printsockopt): Parse SOL_SCTP options. 52040 52041 * net.c (socketlayers): Add more SOL_* constants from linux/socket.h. 52042 52043 2011-01-14 Dmitry V. Levin <ldv (a] altlinux.org> 52044 52045 strace.1: fix misleading italics. 52046 * strace.1: Use bold instead of italics for "-e trace=" keywords. 52047 This fixes Debian bug #589323. 52048 52049 Update linux/ioctlent.h. 52050 * linux/ioctlent.h: Regenerate using linux v2.6.37 headers. 52051 52052 Add HDIO_* ioctls defined in linux/hdreg.h. 52053 * linux/ioctlent.sh: Add HDIO_* ioctls (0x03..) defined in 52054 linux/hdreg.h header file. 52055 This fixes Debian bug #450953. 52056 52057 2011-01-13 Dmitry V. Levin <ldv (a] altlinux.org> 52058 52059 Test PTRACE_O_TRACECLONE and PTRACE_O_TRACEVFORK along with PTRACE_O_TRACEFORK 52060 * strace.c (test_ptrace_setoptions): Add PTRACE_O_TRACECLONE and 52061 PTRACE_O_TRACEVFORK to PTRACE_SETOPTIONS call, to test exactly 52062 the same set of options that is going to be used later in trace(). 52063 52064 2011-01-10 Dmitry V. Levin <ldv (a] altlinux.org> 52065 52066 * net.c (protocols): Add more IPPROTO_* constants defined in netinet/in.h 52067 52068 2011-01-10 Holger Hans Peter Freyther <holger (a] freyther.de> 52069 52070 * net.c (protocols): Add IPPROTO_GRE, IPPROTO_SCTP and IPPROTO_UDPLITE. 52071 52072 2011-01-10 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 52073 52074 sh: Add entry for not-multiplexed accept4. 52075 * linux/sh/syscallent.h: Add specific entry for not-multiplexed accept4 52076 available in kernel mainline since v2.6.37-rc6, see 52077 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21b6e4c7106b2d68a6710506d8706608272fd78b 52078 52079 2010-12-14 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 52080 52081 sh: Add entries for not-multiplexed socket calls. 52082 * linux/sh/syscallent.h: Add specific entries for not-multiplexed 52083 socket calls (available in kernel mainline since v2.6.37-rc1) 52084 52085 sh: Fix compilation warning in do_pipe due to missing prototype. 52086 * defs.h [SH]: Make getrval2 prototype visible to do_pipe 52087 and fix the following compiler warning: 52088 .../net.c: In function 'do_pipe': 52089 .../net.c:1632: warning: implicit declaration of function 'getrval2' 52090 .../net.c:1632: warning: format '%lu' expects type 'long unsigned int', 52091 but argument 3 has type 'int' 52092 52093 2010-12-14 Dmitry V. Levin <ldv (a] altlinux.org> 52094 52095 Fix build on uClibc. 52096 * defs.h [LINUX]: Define PTRACE_GETEVENTMSG macro. 52097 Patch by Douglas Mencken <dougmencken (a] gmail.com>. 52098 52099 2010-12-07 Dmitry V. Levin <ldv (a] altlinux.org> 52100 52101 Fix strace -f -o '|command' hangup. 52102 * strace.c (main): Call test_ptrace_setoptions() before parsing 52103 -o option, otherwise a forked command will cause a hangup inside 52104 test_ptrace_setoptions(). 52105 52106 2010-12-03 Dmitry V. Levin <ldv (a] altlinux.org> 52107 52108 Output diagnostics to stderr. 52109 * syscall.c (get_scno): Output information about changes in 52110 personality mode to stderr. Reported by Pdraig Brady. 52111 52112 Recognize more clone flags. 52113 * process.c (CLONE_*): Define more flags from linux v2.6.25. 52114 (clone_flags): Add entries for them. 52115 Proposed by <zhangyanfei (a] cn.fujitsu.com>. 52116 52117 Decode struct ucred for getsockopt SO_PEERCRED. 52118 * net.c (sys_getsockopt): Decode SO_PEERCRED. 52119 Proposed by Arkadiusz Mikiewicz <arekm (a] maven.pl>. 52120 52121 2010-12-03 Carmelo AMOROSO <carmelo.amoroso (a] st.com> 52122 52123 sh: Add support for tracing sys_cacheflush system call. 52124 * linux/sh/syscallent.h: Update sys_cacheflush entry. 52125 * linux/syscall.h [SH] (sys_cacheflush): New function declaration. 52126 * system.c [SH] (cacheflush_flags): New xlat structure. 52127 [SH] (sys_cacheflush): New function. 52128 52129 Reviewed-by: Angelo Castello <angelo.castello (a] st.com> 52130 52131 2010-11-30 Dmitry V. Levin <ldv (a] altlinux.org> 52132 52133 Cleanup test_ptrace_setoptions() 52134 * strace.c (test_ptrace_setoptions): Cleanup. 52135 (main): Fix test_ptrace_setoptions() error diagnostics message. 52136 Print ptrace_setoptions value in debug mode. 52137 52138 2010-11-30 Wang Chao <wang.chao (a] cn.fujitsu.com> 52139 52140 Handle followfork using ptrace_setoptions if available. 52141 If PTRACE_O_TRACECLONE et al options are supported by kernel, 52142 use them to do followfork rather than the original setbpt 52143 method that changes registers ourselves. 52144 52145 * defs.h [LINUX] (handle_new_child): New function prototype. 52146 * process.c [LINUX] (handle_new_child): New function based on the 52147 code from internal_fork(), with a trivial change: do reparent only 52148 for sys_clone. 52149 [LINUX] (internal_fork): Use handle_new_child(). Do nothing if 52150 ptrace_setoptions is in effect. 52151 * strace.c [LINUX] (handle_ptrace_event): New function. 52152 [LINUX] (trace): If ptrace_setoptions is in effect, then 52153 call the new function to handle PTRACE_EVENT_* status, and 52154 set PTRACE_SETOPTIONS when we see the initial stop of tracee. 52155 52156 2010-11-30 Wang Chao <wang.chao (a] cn.fujitsu.com> 52157 52158 Test how PTRACE_SETOPTIONS support works. 52159 Currently test fork related options only. Fork a child that uses 52160 PTRACE_TRACEME at startup and then does a fork so strace can test 52161 how the PTRACE_SETOPTIONS support works before it handles any real 52162 tracee. Since PTRACE_O_TRACECLONE/*FORK were introduced to kernel 52163 at the same time, this test seems to be enough for these 3 options. 52164 52165 * defs.h [LINUX]: Define PTRACE_O_TRACECLONE et al macros here. 52166 (ptrace_setoptions): New variable declaration. 52167 * strace.c [LINUX] (test_ptrace_setoptions): New function, tests 52168 whether kernel supports PTRACE_O_CLONE/*FORK, the result is stored 52169 in the new variable ptrace_setoptions for later use. 52170 (main): Call test_ptrace_setoptions() if followfork option is set. 52171 52172 2010-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 52173 52174 Enable support for less verbose build rules. 52175 * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules. 52176 52177 2010-09-17 Wang Chao <wang.chao (a] cn.fujitsu.com> 52178 52179 Do not trace children cloned with CLONE_UNTRACED flag. 52180 If clone is called with flag CLONE_UNTRACED, to be consistent with 52181 option PTRACE_O_TRACECLONE, we should not set CLONE_PTRACE flag on 52182 its arguments. 52183 52184 * process.c [LINUX] (internal_fork): Check the syscall and arguments. 52185 52186 2010-09-17 Dmitry V. Levin <ldv (a] altlinux.org> 52187 52188 Update the list of CLOCK_* constants to match Linux kernel v2.6.32+ 52189 * time.c (struct xlat clocknames[]): Add more RT clock IDs. 52190 Reported by Tommi Rantala. 52191 52192 2010-09-16 Dmitry V. Levin <ldv (a] altlinux.org> 52193 52194 Update linux/hppa/syscallent.h to match Linux kernel v2.6.35. 52195 * linux/hppa/syscallent.h: Add hooks for recvmmsg and accept4. 52196 52197 2010-09-15 Dmitry V. Levin <ldv (a] altlinux.org> 52198 52199 Pass less information to qualify_one and qual_* 52200 * syscall.c (qualify_one, qual_syscall, qual_signal, qual_fault, 52201 qual_desc): Take just a bitflag argument instead of pointer to the whole 52202 qual_options structure. 52203 (struct qual_options): Update prototype of "qualify" field. 52204 (qualify): Update use of qualify_one and qual_options->qualify. 52205 52206 2010-09-15 Wang Chao <wang.chao (a] cn.fujitsu.com> 52207 52208 Fix -e option with only one value in qualifier statement. 52209 Fix regression introduced by commit v4.5.20-19-g30145dd: 52210 if -e option is used with only one value in qualifier statement, 52211 e.g. 'strace -e trace=open ls', syscall information would not be 52212 printed properly. 52213 52214 * syscall.c (qualify): Remove faulty optimization. 52215 52216 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 52217 52218 Fix off_t/rlim_t size checks when cross-compiling. 52219 The current off_t/rlim_t size checks (wrt size of long long) use AC_RUN 52220 which obviously doesn't work when cross-compiling. While we don't hit 52221 any configure errors, the fall back code is pretty dumb (which is to say 52222 there isn't any). Considering the code in question though, we can use 52223 some fun compiler tricks with sizeof and array lengths to turn it into 52224 a pure build test and avoid the RUN issue completely. 52225 52226 * m4/long_long.m4 (AC_OFF_T_IS_LONG_LONG, AC_RLIM_T_IS_LONG_LONG): 52227 Convert from AC_RUN_IFELSE to AC_COMPILE_IFELSE. 52228 52229 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 52230 52231 Fix long long little endian detection when cross-compiling. 52232 The long long endian detection code does an AC_TRY_RUN() and since that 52233 doesn't work when cross-compiling, it sets a fallback value. However, 52234 rather than do any sort of default endian detection, the code simply 52235 sets it to "no". This probably breaks most little endian systems out 52236 there when cross-compiling for them. It certainly breaks Blackfin 52237 systems. So use the common endian detection code provided by autoconf 52238 and key off of that when cross-compiling. 52239 52240 * configure.ac: Call AC_C_BIGENDIAN. 52241 * m4/long_long.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Set cross-compiling 52242 logic based on ac_cv_c_bigendian. 52243 52244 2010-09-15 Mike Frysinger <vapier (a] gentoo.org> 52245 52246 Blackfin: decode new syscalls. 52247 * linux/bfin/syscallent.h: Add fanotify/prlimit/cacheflush syscalls. 52248 * linux/syscall.h: Add sys_cacheflush() decl. 52249 * system.c: Decode Blackfin's cacheflush syscall. 52250 52251 * linux/ioctlent.sh: Search a few non-exported paths. 52252 52253 2010-09-15 Roland McGrath <roland (a] redhat.com> 52254 52255 Clean up pid2tcb usage. 52256 * strace.c (pid2tcb): Always match pid. Fail for argument <= 0. 52257 [USE_PROCFS] (first_used_tcb): New function. 52258 [USE_PROCFS] (trace): Use that instead of pid2tcb(0). 52259 52260 2010-09-09 Dmitry V. Levin <ldv (a] altlinux.org> 52261 52262 Turn on more compiler warnings. 52263 * configure.ac: Enable gcc -Wwrite-strings. 52264 52265 Import warnings.m4 from gnulib. 52266 * m4/warnings.m4: Replace with warnings.m4 from gnulib. 52267 * configure.ac: Use gl_WARN_ADD from new warnings.m4. 52268 * Makefile.am (AM_CFLAGS): Update for new warnings.m4. 52269 52270 Split acinclude.m4. 52271 * Makefile.am (ACLOCAL_AMFLAGS): Add "-I m4". 52272 * acinclude.m4: Remove. 52273 * m4/includedir.m4: New file, with definition of AC_INCLUDEDIR from 52274 acinclude.m4. 52275 * m4/long_long.m4: New file, with definitions of AC_OFF_T_IS_LONG_LONG, 52276 AC_RLIM_T_IS_LONG_LONG and AC_LITTLE_ENDIAN_LONG_LONG from acinclude.m4. 52277 * m4/procfs.m4: New file, with definitions of AC_MP_PROCFS, 52278 AC_POLLABLE_PROCFS and AC_STRUCT_PR_SYSCALL from acinclude.m4. 52279 * m4/stat.m4: New file, with definition of AC_STAT64 from acinclude.m4. 52280 * m4/statfs.m4: New file, with definition of AC_STATFS64 from 52281 acinclude.m4. 52282 * m4/warnings.m4: New file, with definition of AC_WARNFLAGS from 52283 acinclude.m4. 52284 52285 * process.c (sys_waitid): Remove unused variable. 52286 52287 2010-09-07 Dmitry V. Levin <ldv (a] altlinux.org> 52288 52289 Fix const-correctness issues uncovered by gcc -Wwrite-strings. 52290 * defs.h (struct xlat): Add const qualifier to the field of 52291 type "char *". 52292 (set_sortby, qualify, printnum, printnum_int): Add const qualifier to 52293 arguments of type "char *". 52294 * count.c (set_sortby): Add const qualifier to the argument and 52295 automatic variable of type "char *". 52296 * desc.c (decode_select): Add const qualifier to automatic variables of 52297 type "char *". 52298 * ioctlsort.c (struct ioctlent): Add const qualifier to fields of 52299 type "char *". 52300 (main): Add const qualifier to argv. 52301 * process.c (printargv): Add const qualifier to the argument and 52302 automatic variable of type "char *". 52303 (printargc) Add const qualifier to argument of type "char *". 52304 * signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to 52305 arguments of type "char *". 52306 * strace.c (progname): Add const qualifier. 52307 (detach): Add const qualifier to automatic variable of type "char *". 52308 * stream.c (struct strbuf): Add const qualifier to the field of 52309 type "char *". 52310 * syscall.c (struct qual_options): Add const qualifier to fields of 52311 type "char *". 52312 (qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier 52313 to arguments of type "char *". 52314 (qual_signal): Add const qualifier to the argument of type "char *", 52315 avoid modification of constant argument. 52316 (qualify): Likewise. 52317 * util.c (printflags): Add const qualifier to automatic variable of 52318 type "char *". 52319 (printnum, printnum_int): Add const qualifier to arguments of 52320 type "char *". 52321 52322 2010-09-04 Wang Chao <wang.chao (a] cn.fujitsu.com> 52323 52324 Fix printing clone flags. 52325 When we trace clone() syscall with only exit signal as clone 52326 flags, strace would print an unnecessary OR operator. 52327 52328 * process.c (sys_clone): Fix this. 52329 52330 2010-08-28 Wang Chao <wang.chao (a] cn.fujitsu.com> 52331 52332 Drop nclone_detached and related flags. 52333 Remove nclone_detached since CLONE_DETACHED flag was no-op for a very 52334 long time in kernel. 52335 52336 * defs.h (struct tcb): Remove nclone_detached field. 52337 Remove TCB_CLONE_DETACHED flag. 52338 * process.c: Remove CLONE_DETACHED flag. 52339 (clone_flags): Remove CLONE_DETACHED entry. 52340 (internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED 52341 flag and nclone_detached. 52342 * strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit): 52343 Likewise. 52344 52345 2010-08-09 Neil Campbell <lists (a] thebatcave.org.uk> 52346 52347 Correct get/set_robust_list syscall numbers for powerpc. 52348 * linux/powerpc/syscallent.h: Swap positions of get_ and set_robust_list. 52349 52350 2010-08-09 Wang Chao <wang.chao (a] cn.fujitsu.com> 52351 52352 Handle CLONE_PARENT flag. 52353 * process.c (internal_fork): The parent of new cloned process is the 52354 same of the calling process when CLONE_PARENT is set. 52355 52356 Fix error when judging if process has children. 52357 * process.c (internal_wait): Processes counted in tcp->nclone_threads 52358 are tcp's threads, rather than tcp's children. 52359 52360 2010-08-09 Wang Chao <wang.chao (a] cn.fujitsu.com> 52361 52362 Forbid using mutually exclusive options -D and -p together. 52363 If we use -D and -p option together to trace a multi-thread program, in 52364 addition to the main thread, other threads could not be traced even if we 52365 present -f option. Moreover, when executing 'strace -D -p <non-exist pid>', 52366 strace could not terminate normally. 52367 52368 * strace.c (main): Check it. 52369 52370 2010-08-05 David Daney <ddaney (a] caviumnetworks.com> 52371 52372 Update Linux MIPS syscalls to match 2.6.35-rc6+ 52373 * linux/mips/syscallent.h: Add and update 405 hooks. 52374 52375 2010-08-05 Edgar E. Iglesias <edgar.iglesias (a] gmail.com> 52376 52377 Add support for the MicroBlaze architecture. 52378 * configure.ac: Recognize MicroBlaze. 52379 * linux/microblaze/syscallent.h: New file. 52380 * Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h 52381 * process.c (change_syscall, struct_user_offsets): Add MicroBlaze 52382 support. 52383 * signal.c (sys_sigreturn): Likewise. 52384 * syscall.c (internal_syscall, get_scno, syscall_fixup, get_error, 52385 syscall_enter): Likewise. 52386 52387 2010-08-05 Frederik Schler <fs (a] debian.org> 52388 52389 linux/sparc: add missing syscall declarations. 52390 * linux/sparc/syscall.h: Sync with linux/syscall.h 52391 52392 2010-07-17 Andreas Schwab <schwab (a] linux-m68k.org> 52393 52394 Handle biarch get/setrlimit. 52395 * resource.c (print_rlimit32) [POWERPC64 || X86_64]: Define. 52396 (sys_getrlimit, sys_setrlimit) [POWERPC64 || X86_64]: Use it. 52397 52398 2010-07-13 Andreas Schwab <schwab (a] linux-m68k.org> 52399 52400 Add biarch support for powerpc64. 52401 * acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of 52402 long. 52403 * configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if 52404 $host_cpu = powerpc64. 52405 * defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE) 52406 (PERSONALITY1_WORDSIZE) [POWERPC64]: Define. 52407 * file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]: 52408 Define. 52409 (printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in 52410 32-bit personality. 52411 (sys_newfstatat) [POWERPC64]: Handle personalities. 52412 * signal.c (sys_sigreturn) [POWERPC64]: Likewise. 52413 * util.c (printllval) [POWERPC64]: Likewise. 52414 (printcall) [POWERPC64]: Use wider format for IP prefix. 52415 * syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode. 52416 * linux/powerpc/errnoent1.h: New file. 52417 * linux/powerpc/ioctlent1.h: New file. 52418 * linux/powerpc/signalent1.h: New file. 52419 * linux/powerpc/syscallent1.h: New file. 52420 52421 2010-07-09 Andreas Schwab <schwab (a] redhat.com> 52422 52423 Balance braces. 52424 * strace.c (proc_open): Avoid unbalanced braces. 52425 (trace): Likewise. 52426 52427 2010-07-06 Andreas Schwab <schwab (a] linux-m68k.org> 52428 52429 Remove extern declaration at file scope. 52430 * defs.h (force_result): Declare. 52431 * process.c (internal_wait): Don't declare force_result. 52432 52433 2010-06-24 Andreas Schwab <schwab (a] redhat.com> 52434 52435 Document -C/-D. 52436 * strace.c (usage): Document -C. 52437 * strace.1: Document -D. 52438 52439 2010-06-13 Roland McGrath <roland (a] redhat.com> 52440 52441 Fix sourceforge download URL. 52442 52443 2010-06-05 Andreas Schwab <schwab (a] linux-m68k.org> 52444 52445 M68K: Fix fetching syscall arguments. 52446 * syscall.c (syscall_enter) [M68K]: Properly handle more than five 52447 syscall arguments. 52448 52449 2010-05-28 Andreas Schwab <schwab (a] linux-m68k.org> 52450 52451 Decode TLS syscalls on m68k. 52452 * linux/m68k/syscallent.h: Add entries for get_thread_area, 52453 set_thread_area, atomic_comxchg_32, atomic_barrier. 52454 * linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]: 52455 Don't redefine. 52456 * mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New. 52457 52458 Fix warning when compiling for m68k. 52459 * syscall.c (d0): Define as long. 52460 52461 2010-04-13 Dmitry V. Levin <ldv (a] altlinux.org> 52462 52463 Prepare for 4.5.20 release. 52464 * NEWS: Update for 4.5.20 release. 52465 * configure.ac: Version 4.5.20. 52466 * debian/changelog: 4.5.20-1. 52467 * strace.spec: 4.5.20-1. 52468 52469 2010-04-13 Frederik Schler <fs (a] debian.org> 52470 52471 Update debian/* files for the upcoming release. 52472 * debian/control: update standards-version to 3.8.4. 52473 * debian/rules: allow parallel building. 52474 * debian/rules: comment out verbose build, only needed for debugging. 52475 * debian/rules: clean up clean: target, dh_clean does most of the work 52476 already. 52477 * debian/rules: use *-stamp instead of stamp-*, so dh_clean can tidy 52478 up for us. 52479 52480 2010-04-13 Heiko Carstens <heiko.carstens (a] de.ibm.com> 52481 52482 Fix s390 system call table list. 52483 * linux/s390/syscallent.h: Add the missing entries for preadv and 52484 pwritev to the system call table list. 52485 * linux/s390x/syscallent.h: Likewise. 52486 52487 2010-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 52488 52489 Update linux/ioctlent.h. 52490 * linux/ioctlent.sh: Search in asm-generic directory as well. 52491 * linux/ioctlent.h: Regenerated. 52492 52493 Update linux/*/syscallent.h files to match Linux kernel v2.6.33. 52494 * linux/alpha/syscallent.h: Add 47 hooks. 52495 * linux/arm/syscallent.h: Update hooks for pselect6, ppoll, 52496 epoll_pwait. Add 11 hooks. 52497 * linux/bfin/syscallent.h: Update hooks for prctl, fallocate, 52498 signalfd4, eventfd2, epoll_create1, dup3, pipe2, perf_event_open. 52499 Hook up recvmmsg. 52500 * linux/hppa/syscallent.h: Update hooks for signalfd4, eventfd2, 52501 epoll_create1, dup3, pipe2, perf_event_open. 52502 * linux/i386/syscallent.h: Fix syscall name for the kexec_load hook. 52503 Add 5 hooks. 52504 * linux/ia64/syscallent.h: Fix syscall name for the kexec_load hook. 52505 Add 4 hooks. 52506 * linux/m68k/syscallent.h: Add 50 hooks. 52507 * linux/powerpc/syscallent.h: Fix hook for timerfd_create. Fix 52508 6 syscall names to match the kernel. Use sys_semop to parse semop. 52509 Add 14 hooks. 52510 * linux/s390/syscallent.h: Fix syscall name for the kexec_load hook. 52511 Add 14 hooks. 52512 * linux/s390x/syscallent.h: Likewise. 52513 * linux/sh/syscallent.h: Add 13 hooks. 52514 * linux/sh64/syscallent.h: Add 15 hooks. 52515 * linux/sparc/syscallent.h: Add 22 hooks. 52516 * linux/x86_64/syscallent.h: Add 5 hooks. 52517 52518 Enhance recvmmsg parser. 52519 * net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the 52520 syscall. Decode timespec structure both on entrance and on exit. 52521 52522 2010-04-07 Andreas Schwab <schwab (a] linux-m68k.org> 52523 52524 Decode recvmmsg syscall. 52525 * net.c (do_msghr): New function to print struct msghdr. 52526 (printmsghdr): Use it. 52527 (printmmsghdr, sys_recvmmsg): New. 52528 * linux/syscall.h: Declare sys_recvmmsg. 52529 (SYS_sub_recvmmsg): Define. 52530 (SYS_socket_nsubcalls): Bump. 52531 * linux/sparc/syscall.h: Likewise. 52532 * linux/arm/syscallent.h: Add sys_recvmmsg. 52533 * linux/bfin/syscallent.h: Likewise. 52534 * linux/i386/syscallent.h: Likewise. 52535 * linux/m68k/syscallent.h: Likewise. 52536 * linux/powerpc/syscallent.h: Likewise. 52537 * linux/s390/syscallent.h: Likewise. 52538 * linux/s390x/syscallent.h: Likewise. 52539 * linux/sh/syscallent.h: Likewise. 52540 * linux/sh64/syscallent.h: Likewise. 52541 * linux/sparc/syscallent.h: Likewise. 52542 * linux/ia64/syscallent.h: Adjust. 52543 52544 2010-04-07 Dmitry V. Levin <ldv (a] altlinux.org> 52545 52546 * strace.1: Fix quoting of hyphens and formatting of strace options. 52547 52548 Split trace_syscall() for better readability. 52549 * syscall.c (trace_syscall): Split into trace_syscall_exiting() and 52550 trace_syscall_entering(). 52551 52552 Implement -C option to combine regular and -c output. 52553 * defs.h (cflag_t): New enum. 52554 * strace.1: Document -C option. 52555 * strace.c (cflag): Update type. 52556 (main): Handle -C option. 52557 (trace): Update use of cflag. 52558 * count.c (count_syscall): Move clearing of TCB_INSYSCALL to ... 52559 * syscall.c (trace_syscall): ... here. Update use of cflag. 52560 Based on patch by Adrien Kunysz. 52561 52562 Fix "make dist" regression introduced by commit v4.5.19-12-g5078770. 52563 * Makefile.am (EXTRA_DIST): Rename linux/syscallent.h to linux/i386/syscallent.h 52564 52565 * desc.c (sys_epoll_pwait): Fix output formatting bug. 52566 52567 * desc.c (decode_select): Fix potential stack buffer overflow. 52568 52569 2010-03-31 Dmitry V. Levin <ldv (a] altlinux.org> 52570 52571 Fix msgsnd indirect ipccall decoding. 52572 This regression was introduced by commit v4.5.18-136-g783f5bc. 52573 * ipc.c (tprint_msgsnd): Add and use "flags" argument. 52574 (sys_msgsnd): Pass "flags" argument to tprint_msgsnd(). 52575 Patch by Anton Blanchard. 52576 52577 2010-03-23 Mark Wielaard <mjw (a] redhat.com> 52578 52579 Hook up inotify_init1 open mode flags printer. 52580 * file.c [LINUX] (sys_inotify_init1): New function. 52581 * linux/syscall.h: Declare new sys_inotify_init1 handler. 52582 * linux/bfin/syscallent.h: Hook up new handler. 52583 * linux/hppa/syscallent.h: Likewise. 52584 * linux/i386/syscallent.h: Likewise. 52585 * linux/x86_64/syscallent.h: Likewise. 52586 52587 2010-03-09 Andreas Schwab <schwab (a] redhat.com> 52588 52589 Avoid spurious error when checking for linux/netlink.h. 52590 * configure.ac: Include <asm/types.h> when checking for 52591 linux/netlink.h. 52592 52593 2010-02-23 Andreas Schwab <schwab (a] linux-m68k.org> 52594 52595 Fix reporting signal mask by sigreturn on powerpc. 52596 * signal.c (sys_sigreturn) [POWERPC]: Skip dummy stack frame when 52597 locating signal context. 52598 52599 2010-02-09 David Daney <ddaney (a] caviumnetworks.com> 52600 52601 Fix MIPS N32/N64 compile error. 52602 * syscall.c [LINUX_MIPSN32 || LINUX_MIPSN64] (syscall_enter): Pass 52603 tcp->pid to ptrace(). 52604 52605 2010-02-05 Chris Metcalf <cmetcalf (a] tilera.com> 52606 52607 Add support for the TILE architecture. 52608 * configure.ac: Add TILE to the list of supported architectures. 52609 * defs.h: Define TCB_WAITEXECVE for TILE. 52610 * linux/tile/syscallent.h: New file. 52611 * Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h 52612 * process.c (change_syscall, struct_user_offsets): Add TILE support. 52613 * syscall.c (get_scno, get_error, syscall_enter): Likewise. 52614 * mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions 52615 support. 52616 * signal.c (sigact_flags): Add SA_NOPTRACE. 52617 (sys_sigreturn): Add TILE support. 52618 52619 2010-02-04 Dmitry V. Levin <ldv (a] altlinux.org> 52620 52621 Remove dead code. 52622 * defs.h (tv_tv): Remove. 52623 * net.c (sys_xsetsockaddr): Remove commented out dead code. 52624 * process.c (setarg, sys_execv, sys_execve, struct_user_offsets): 52625 Likewise. 52626 * signal.c (sys_sigsuspend): Likewise. 52627 * strace.c (reaper, trace): Likewise. 52628 * stream.c (internal_stream_ioctl): Likewise. 52629 * syscall.c (trace_syscall): Likewise. 52630 * term.c (term_ioctl): Likewise. 52631 * util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt): 52632 Likewise. 52633 52634 Merge Linux internal_clone() into internal_fork() 52635 * defs.h (internal_clone): Remove. 52636 * process.c (internal_clone): Merge into internal_fork(). 52637 (internal_fork) [!LINUX]: Remove dead code. 52638 * syscall.c (internal_syscall): Replace internal_clone() with 52639 internal_fork(). 52640 52641 * Makefile.am (INCLUDES): Remove redundant search directories. 52642 52643 2010-02-04 Frederik Schler <fs (a] debian.org> 52644 52645 Update debian/* files. 52646 * debian/control: add sparc64 to the architectures list. 52647 This closes Debian bug #560062 52648 * Backport commit f0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 to fix FTBFS. 52649 This closes Debian bug #560516 52650 * debian/control: Update standards-version to 3.8.3. 52651 * debian/control: Lower package priority to optional, matching 52652 the archive override. 52653 * debian/control: add ${misc:Depends} to Depends: lines where 52654 appropriate. 52655 * debian/watch: new file, allows automatic tracking of new 52656 upstream versions. 52657 * debian/source/format: new file, adapt to debian source format "quilt" 52658 * debian/rules: indentation cleanups; use dh_testroot and dh_prep 52659 in clean target. 52660 52661 2010-01-25 Andreas Schwab <schwab (a] redhat.com> 52662 52663 Fix spurious failure of AC_STAT64 test. 52664 * acinclude.m4 (AC_STAT64): Include <sys/types.h> first. 52665 52666 2010-01-12 Andreas Schwab <schwab (a] redhat.com> 52667 52668 Don't kill the process when detaching. 52669 * strace.c (detach): Call clearbpt when TCB_BPTSET is set. 52670 52671 2009-12-25 Dmitry V. Levin <ldv (a] altlinux.org> 52672 52673 Decode fifth argument of mremap syscall. 52674 * mem.c (sys_mremap): Decode fifth argument. 52675 * linux/*/syscallent.h: Update the number of mremap syscall arguments. 52676 52677 2009-12-24 Chris Metcalf <cmetcalf (a] tilera.com> 52678 52679 * mem.c (sys_mbind): Display first argument in hex. 52680 52681 * mem.c (mremap_flags): Add MREMAP_FIXED. 52682 52683 2009-11-16 Mike Frysinger <vapier (a] gentoo.org> 52684 52685 Move i386-specific files out of common linux dir. 52686 * linux/syscallent.h: Moved to ... 52687 * linux/i386/syscallent.h: ... here. 52688 * linux/ia64/syscallent.h: Update i386 syscallent.h include. 52689 * linux/sparc/gen.pl: Likewise. 52690 * linux/x86_64/syscallent1.h: Likewise. 52691 52692 2009-11-16 Andreas Schwab <schwab (a] redhat.com> 52693 52694 Remove support for pre-C89. 52695 * defs.h: Remove references to __STDC__ and P macros. 52696 * strace.c: Likewise. 52697 52698 2009-11-13 Dmitry V. Levin <ldv (a] altlinux.org> 52699 52700 Decode more SOL_PACKET socket options. 52701 * net.c (sockpacketoptions): Add more PACKET_* entries. 52702 (sys_getsockopt): Decode PACKET_STATISTICS. 52703 (printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING. 52704 Patch by Gabor Gombas. 52705 52706 2009-11-11 Andreas Schwab <schwab (a] redhat.com> 52707 52708 Ignore errors if a thread is killed. 52709 * util.c (clearbpt): Ignore ESRCH error. 52710 52711 2009-11-06 Bernhard Reutner-Fischer <rep.dot.nop (a] gmail.com> 52712 52713 Fix handling of Linux systems without struct statfs64. 52714 * acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64. 52715 * configure.ac: Call AC_STATFS64. 52716 * file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only 52717 if struct statfs64 is available. 52718 52719 2009-11-06 Dmitry V. Levin <ldv (a] altlinux.org> 52720 52721 Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int) 52722 * net.c (sys_getsockopt): Optimize output a bit. 52723 Decode integer argument using printnum_int(), patch by Gabor Gombas. 52724 52725 Check umove() return code. 52726 * bjm.c (sys_query_module): Print input parameters when entering 52727 syscall. Fix handling of syscall error. Handle unlikely umove() 52728 failures. 52729 * ipc.c (tprint_msgrcv): New function. Move part of msgrcv parser code 52730 here, add check umove() return code. 52731 (sys_msgsnd): Print msqid parameter as int instead of long. 52732 (sys_msgrcv): Likewise. Use tprint_msgrcv(). 52733 * process.c (print_affinitylist): Check umove() return code. 52734 * sock.c (sock_ioctl): Handle unlikely umove() failure in the 52735 SIOCGIFCONF parser. 52736 52737 Fix check for linux/netlink.h on Linux 2.6.32-rc5+ 52738 * configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include 52739 sys/socket.h instead of linux/socket.h beforehand. 52740 52741 2009-11-04 Andreas Schwab <schwab (a] redhat.com> 52742 52743 Decode fallocate on PowerPC. 52744 * linux/powerpc/syscallent.h: Decode fallocate. 52745 52746 Factor out printing of 64bit syscall argument. 52747 * defs.h (ALIGN64): Remove. 52748 (printllval): Declare. 52749 * util.c (printllval): Define. 52750 * file.c (sys_readahead): Use printllval. 52751 (sys_lseek64): Likewise. 52752 (sys_truncate64): Likewise. 52753 (sys_ftruncate64): Likewise. 52754 (sys_fadvise64): Likewise. 52755 (sys_fadvise64_64): Likewise. 52756 (sys_fallocate): Likewise. 52757 * io.c (sys_pread): Likewise. 52758 (sys_pwrite): Likewise. 52759 (sys_pread64): Likewise. 52760 (sys_pwrite64): Likewise. 52761 * mem.c (sys_mmap64): Likewise. 52762 52763 2009-11-03 Andreas Schwab <schwab (a] redhat.com> 52764 52765 Correct decoding of readahead and fadvice64(_64) on PowerPC. 52766 * file.c (sys_readahead): Align 64bit argument. Handle PowerPC64 52767 like other 64bit architectures. 52768 (sys_fadvise64): Likewise. 52769 (sys_fadvise64_64): Handle PowerPC like ARM. 52770 * linux/powerpc/syscallent.h (sys_readahead): Account for 64bit 52771 argument alignment on PowerPC32. 52772 52773 2009-10-27 Andreas Schwab <schwab (a] redhat.com> 52774 52775 Maintain separate print column for each process. 52776 * defs.h (struct tcp): Add curcol. 52777 * strace.c: (alloc_tcb): Initialize it. 52778 (trace): Use curcol from current process and save it before 52779 continuing. 52780 (tprintf): Don't modify curcol on output error. 52781 52782 2009-10-21 Roland McGrath <roland (a] redhat.com> 52783 52784 * strace.spec: 4.5.19-1 release. 52785 52786 2009-10-21 Dmitry V. Levin <ldv (a] altlinux.org> 52787 52788 * file.c (printstat64): Cleanup trailing whitespace. 52789 52790 2009-10-16 Andreas Schwab <schwab (a] redhat.com> 52791 52792 Fix decoding of newfstatat syscall on x86-64. 52793 * file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit 52794 process redirect to printstat. 52795 Fixes RH#529316 "Field values shown for "newfstatat" system 52796 call are incorrect" 52797 52798 2009-10-12 Dmitry V. Levin <ldv (a] altlinux.org> 52799 52800 * configure.ac (AC_CHECK_HEADERS): Remove asm/reg.h. 52801 52802 2009-10-12 Mike Frysinger <vapier (a] gentoo.org> 52803 52804 sparc/linux: Rewrite to use asm/ptrace.h. 52805 The current sparc/linux code uses asm/reg.h, but recent Linux kernels 52806 dropped that header completely. So switch over to the ptrace headers 52807 as those should stick around indefinitely as part of the ABI. 52808 52809 * defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define. 52810 * process.c: Drop asm/regs.h include. 52811 [SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs. 52812 * signal.c: Drop asm/regs.h include. 52813 (m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS]. 52814 [SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs. 52815 * syscall.c: Drop asm/regs.h include. 52816 [SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result, 52817 syscall_enter): Change struct regs to struct pt_regs. 52818 * util.c: Drop asm/regs.h include. 52819 (_hack_syscall5, _ptrace): Delete. 52820 [SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change 52821 struct regs to struct pt_regs. 52822 52823 2009-10-11 Roland McGrath <roland (a] redhat.com> 52824 52825 * make-dist: Clean up. 52826 52827 * configure.ac: Use AC_CONFIG_AUX_DIR([.]). 52828 52829 2009-10-09 Dmitry V. Levin <ldv (a] altlinux.org> 52830 52831 * make-dist: New script for preparing release tarballs. 52832 52833 * git-set-file-times: Import from rsync. 52834 52835 * Makefile.am [MAINTAINER_MODE]: Define and export TAR_OPTIONS. 52836 52837 2009-10-08 Dmitry V. Levin <ldv (a] altlinux.org> 52838 52839 Enhance msgsnd() parser. 52840 * ipc.c (tprint_msgsnd): New function. Move msgsnd parser code here, 52841 add check for umove() return code. 52842 (sys_msgsnd): Use tprint_msgsnd(). 52843 52844 * NEWS: Update for 4.5.19 release. 52845 52846 Enhance semop()/semtimedop() sembuf parser. 52847 * ipc.c (tprint_sembuf): New function. Move sembuf parser code here, 52848 add abbrev() support. 52849 (sys_semop, sys_semtimedop): Use tprint_sembuf(). 52850 52851 2009-10-08 Jakub Bogusz <qboosh (a] pld-linux.org> 52852 52853 Add pretty printing of sembuf argument to semop() and semtimedop() 52854 * ipc.c (semop_flags): New xlat structure. 52855 (sys_semop, sys_semtimedop): Add pretty printing of sembuf argument. 52856 52857 2009-10-08 Mike Frysinger <vapier (a] gentoo.org> 52858 52859 Add support for Linux/no-mmu with vfork. 52860 * configure.ac (AC_CHECK_FUNCS): Add fork. 52861 * strace.c (strace_vforked): Define. 52862 (startup_child): Do not raise SIGSTOP if vforked. 52863 (trace): Skip first exec when starting up after vforked. 52864 * syscall.c [BFIN] (get_scno): Drop waitexec checks. 52865 52866 Avoid malloc(0) in getdents parsers. 52867 On end of directory, getdents returns 0. This return value is used to 52868 then try and do malloc(0), but on some systems this will always return 52869 NULL. Since the code won't read the pointer in question if len is 0, 52870 then don't bother calling malloc(0) and set the pointer to NULL ourself. 52871 * file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call. 52872 52873 2009-10-07 Mike Frysinger <vapier (a] gentoo.org> 52874 52875 Add sys_nanosleep() prototype for sparc. 52876 * linux/sparc/syscall.h (sys_nanosleep): New prototype. 52877 Reported by Frederik Schler. 52878 52879 Silence compiler warnings about implicit cast from pointer to integer. 52880 * util.c (do_ptrace): Cast ptrace() 4th arg to long. 52881 (ptrace_restart): Drop void* cast on ptrace() 4th arg. 52882 52883 Ignore .gdb files from FLAT toolchains. 52884 * .gitignore: Add /*.gdb. 52885 52886 * configure.ac (AC_CHECK_FUNCS): Sort and expand. 52887 52888 Blackfin: Update ioctl/syscall lists. 52889 * linux/bfin/ioctlent.h: Sync list with latest kernel sources. 52890 * linux/bfin/syscallent.h: Likewise. 52891 52892 ioctlsort: Check ppc hosts too. 52893 * linux/ioctlsort.c: Check for __powerpc__. 52894 52895 2009-10-07 Andreas Schwab <schwab (a] redhat.com> 52896 52897 Fix build on ia64. 52898 * linux/ia64/syscallent.h: Update for addition of accept4 syscall 52899 in ../syscallent.h. 52900 52901 2009-10-07 Roland McGrath <roland (a] redhat.com> 52902 52903 * strace.spec (%doc): Add ChangeLog-CVS. 52904 52905 * Makefile.am (srpm): New phony target. 52906 52907 * Makefile.am (EXTRA_DIST): Add ChangeLog. 52908 ($(srcdir)/ChangeLog): New target, replaces gen-changelog phony target. 52909 Put it inside [MAINTAINER_MODE]. 52910 52911 2009-10-06 Dmitry V. Levin <ldv (a] altlinux.org> 52912 52913 * NEWS: Update for 4.5.19 release. 52914 52915 2009-10-05 Frederik Schler <fs (a] debian.org> 52916 52917 Prepare debian/* files for release. 52918 * debian/rules: Do not ship ChangeLog anymore. 52919 * debian/control: Update to Debian standards version 3.8.1, and remove 52920 Roland from the Maintainers list. This closes Debian bug #521458. 52921 * debian/changelog: Document changes and prepare for release. 52922 52923 2009-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 52924 52925 * defs.h [HPPA]: Lower MAX_ARGS from 32 to 6. 52926 52927 * ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer. 52928 Based on patch from Carlos O'Donell. 52929 52930 2009-10-05 Carlos O'Donell <carlos (a] systemhalted.org> 52931 52932 * linux/hppa/syscallent.h: Update syscalls. 52933 Based on work by Kyle McMartin and Helge Deller. 52934 52935 Fix SA_HANDLER function pointer comparisons for hppa. 52936 * signal.c (sys_sigaction): Cast SA_HANDLER function pointers to long. 52937 (sys_rt_sigaction): Likewise. 52938 52939 2009-10-05 Edgar E. Iglesias <edgar.iglesias (a] gmail.com> 52940 52941 CRIS: Correct first argument to upeek() 52942 This complements commit ea0e6e80260d2b1b7ad40282012b0e47869bcddf. 52943 * syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass 52944 tcp pointer instead of pid to upeek(). 52945 * util.c [CRISV10 || CRISV32] (printcall): Likewise. 52946 52947 2009-10-05 Dmitry V. Levin <ldv (a] altlinux.org> 52948 52949 * signal.c (do_signalfd): Fix typo in output format. 52950 52951 2009-09-21 Dmitry V. Levin <ldv (a] altlinux.org> 52952 52953 * Makefile.am (gen_changelog_start_date): Fix date. 52954 52955 2009-09-19 Dmitry V. Levin <ldv (a] altlinux.org> 52956 52957 Prepare for 4.5.19 release. 52958 * NEWS: Update for 4.5.19 release. 52959 * configure.ac: Version 4.5.19. 52960 * debian/changelog: 4.5.19-1. 52961 * strace.spec: 4.5.19-1. 52962 52963 Update debian/* to 4.5.18-1. 52964 * debian/changelog: Update to 4.5.18-1. 52965 * debian/compat: Set compatibility level to 7. 52966 * debian/control (Build-Depends): Update debhelper requirement. 52967 (strace, strace64): Add Section and Priority tags. 52968 52969 2009-09-19 Kirill A. Shutemov <kirill (a] shutemov.name> 52970 52971 Fix fadvise64 decoding on ARM. 52972 * file.c (sys_fadvise64_64) [ARM]: Fix argument ordering. 52973 52974 2009-09-18 Dmitry V. Levin <ldv (a] altlinux.org> 52975 52976 Fix follow fork/vfork on Linux ARM OABI. 52977 __NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI. 52978 * process (change_syscall) [LINUX && ARM]: Mask off the high order bits 52979 when changing syscall. 52980 52981 Reviewed-by: Kirill A. Shutemov <kirill (a] shutemov.name> 52982 52983 2009-09-18 Mike Frysinger <vapier (a] gentoo.org> 52984 52985 Mark shell scripts as executable. 52986 52987 Ignore ioctlsort helper program. 52988 * .gitignore: Add ioctlsort. 52989 52990 linux/errno: Add ERFKILL. 52991 * linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132 52992 definition introduced in Linux 2.6.31. 52993 52994 2009-09-01 Paolo Bonzini <pbonzini (a] redhat.com> 52995 52996 Add accept4 socketcall. 52997 This second patch in the series adds support for accept4 as a socketcall 52998 sub-call. Besides the need to renumber all system calls, this poses 52999 no problem. 53000 Tested on i686. 53001 53002 * linux/arm/syscallent.h: Add accept4 socketcall. 53003 * linux/m68k/syscallent.h: Likewise. 53004 * linux/powerpc/syscallent.h: Likewise. 53005 * linux/s390/syscallent.h: Likewise. 53006 * linux/s390x/syscallent.h: Likewise. 53007 * linux/sh/syscallent.h: Likewise. 53008 * linux/sh64/syscallent.h: Likewise. 53009 * linux/sparc/syscallent.h: Likewise. 53010 * linux/syscallent.h: Likewise. 53011 53012 * linux/sparc/syscall.h (SYS_sub_accept4): Declare. 53013 (SYS_socket_nsubcalls): Update. 53014 * linux/syscall.h: Likewise. 53015 53016 2009-09-01 Paolo Bonzini <pbonzini (a] redhat.com> 53017 53018 Replace x86-64 paccept with accept4. 53019 This patch changes the paccept syscall to accept4 for x86-64, since 53020 the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826. 53021 At the same time, it adds support for pretty printing its arguments. 53022 53023 * linux/x86_64/syscallent.h: Replace paccept with accept4, 53024 hook in sys_accept4. 53025 * net.c (sys_accept): Leave a small stub calling the new... 53026 (do_accept): ... function, which also adds a flags_arg argument. 53027 (sys_accept4): New. 53028 53029 2009-08-28 Andreas Schwab <schwab (a] redhat.com> 53030 53031 Zero-extend 32-bit addresses when printing argv array. 53032 (printargv): Zero-extend 32-bit addresses. 53033 Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit 53034 process". 53035 53036 2009-08-12 Andreas Schwab <schwab (a] redhat.com> 53037 53038 Add more futex decoding. 53039 * process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI) 53040 (FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define. 53041 (futexops): Add entries for them. 53042 (sys_futex): Decode FUTEX_CMP_REQUEUE_PI and 53043 FUTEX_WAIT_REQUEUE_PI. 53044 53045 2009-07-08 Dmitry V. Levin <ldv (a] altlinux.org> 53046 53047 Generate ChangeLog from git log. 53048 * .gitignore: Add ChangeLog 53049 * ChangeLog: Rename to ChangeLog-CVS. 53050 * Makefile.am (gen-changelog): New rule. 53051 (dist-hook): Depend on it. 53052 (EXTRA_DIST): Add ChangeLog-CVS. 53053 * README-hacking: Describe changes. 53054 * gitlog-to-changelog: Import from gnulib. 53055 53056 53057 See ChangeLog-CVS for older changes. 53058