Update strace to 4.23.

Noteworthy changes in release 4.23 (2018-06-14)
===============================================

* Changes in behaviour
  * On x32 personality, 64-bit syscalls (such as readv) are now shown with "#64"
    suffix instead of "64:" prefix.  Unlike the old names, these new names
    can be used in syscall qualification expressions.
  * Changed error number output format: error numbers are consistently
    printed as "-1 ECONST (Error description)"
    for known errors and as "-1 (errno 123)" for unknown errors,
    regardless of -e raw qualification settings.  One can specify
    -X raw for displaying raw error numbers unconditionally.
  * Unfetchable addresses inside arrays are now printed as comments.
  * Obsolete IA-32 mode syscall names are no longer printed on ia64.

* Improvements
  * Implemented libdw backend for -k option, configured at build time
    using --with-libdw option.
    Whether -k option is compiled is now configured at build time
    using --enable-stacktrace option.
  * Added -X option for configuring xlat output formatting (addresses
    Debian bug #692915).
  * Added support for personality designation ("64", "32", or "x32") to syscall
    qualifications in -e trace expressions.
  * Implemented injection of syscalls with no side effects as an alternative
    to injection of an invalid syscall (-e inject=SET:syscall= expression).
  * Improved support for reproducible builds (addresses Debian bug #896016).
  * Implemented decoding of BPF_PROG_QUERY and BPF_RAW_TRACEPOINT_OPEN bpf
    syscall commands.
  * Implemented decoding of INOTIFY_IOC_SETNEXTWD and PERF_EVENT_IOC_* ioctl
    commands.
  * Implemented decoding of PR_GET_SPECULATION_CTRL and PR_SET_SPECULATION_CTRL
    prctl syscall options.
  * Enhanced decoding of bpf, getsockopt, setsockopt, and socket syscalls.
  * Enhanced decoding of NETLINK_KOBJECT_UEVENT and NETLINK_ROUTE protocols.
  * Enhanced decoding of *_DIAG_MEMINFO netlink attributes.
  * Enhanced decoding of BTRFS_*, FS_IOC_*, SIOCGIFHWADDR, and SIOCSIFHWADDR
    ioctl commands.
  * Enhanced decoding of AF_BLUETOOTH socket addresses.
  * Implemented decoding of io_pgetevent syscall.
  * Wired up rseq syscall.
  * Updated lists of ADJ_*, BPF_*, BPF_F_*, BPF_PROG_TYPE_*, ETH_P_*, FPE_*,
    IFF_*, IPPROTO_*, MAP_*, MS_*, MSG_*, NETLINK_*, PACKET_*, PROT_*, SCTP_*,
    SECCOMP_FILTER_FLAG_*, SEGV_*, SEM_*, SHM_*, SW_*, V4L2_CID_*,
    V4L2_CTRL_CLASS_*, and V4L2_PIX_FMT_* constants.
  * Updated lists of ioctl commands from Linux 4.17.

* Bug fixes
  * Fixed decoding of msgtyp argument of msgrcv syscall.
  * Fixed fallback definitions for F_*, MCL_*, MSG_ZEROCOPY, SI_*,
    and SOL_SOCKET constants.
  * Fixed -e trace=%pure expression on mips.

Bug: N/A
Test: strace -f date
Change-Id: I9eff306cca99b239815284a366315fb04686667a
diff --git a/socketutils.c b/socketutils.c
index 38b864c..a646b5b 100644
--- a/socketutils.c
+++ b/socketutils.c
@@ -252,6 +252,13 @@
 static bool
 unix_send_query(struct tcb *tcp, const int fd, const unsigned long inode)
 {
+	/*
+	 * The kernel bug was fixed in mainline by commit v4.5-rc6~35^2~11
+	 * and backported to stable/linux-4.4.y by commit v4.4.4~297.
+	 */
+	const uint16_t dump_flag =
+		os_release < KERNEL_VERSION(4, 4, 4) ? NLM_F_DUMP : 0;
+
 	struct {
 		const struct nlmsghdr nlh;
 		const struct unix_diag_req udr;
@@ -259,13 +266,14 @@
 		.nlh = {
 			.nlmsg_len = sizeof(req),
 			.nlmsg_type = SOCK_DIAG_BY_FAMILY,
-			.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST
+			.nlmsg_flags = NLM_F_REQUEST | dump_flag
 		},
 		.udr = {
 			.sdiag_family = AF_UNIX,
 			.udiag_ino = inode,
 			.udiag_states = -1,
-			.udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER
+			.udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER,
+			.udiag_cookie = { ~0U, ~0U }
 		}
 	};
 	return send_query(tcp, fd, &req, sizeof(req));
@@ -363,8 +371,7 @@
 		},
 		.ndr = {
 			.sdiag_family = AF_NETLINK,
-			.sdiag_protocol = NDIAG_PROTO_ALL,
-			.ndiag_show = NDIAG_SHOW_MEMINFO
+			.sdiag_protocol = NDIAG_PROTO_ALL
 		}
 	};
 	return send_query(tcp, fd, &req, sizeof(req));