diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2016-07-15 16:08:19 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-07-18 22:12:45 +0000 |
commit | b759d276d53cbac1f60895c7e674b63f841f6d5d (patch) | |
tree | 8742380f5fdc57bc02d32ee68dfce70e310f1271 /net.c | |
parent | 7f8ece11c8779a55b63399e21ec53a7a2ff743fc (diff) | |
download | strace-b759d276d53cbac1f60895c7e674b63f841f6d5d.tar.gz |
Unabuse struct tcb.auxstr
As we've got a proper mechanism that parsers can use for storing private
data between entering and exiting stages, all cases of struct tcb.auxstr
abuse should go.
* btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong
instead of abusing tcp->auxstr.
* file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
* msghdr.c (SYS_FUNC(recvmsg)): Likewise.
* net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise.
* v4l2.c (print_v4l2_queryctrl): Likewise.
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -206,8 +206,7 @@ decode_sockname(struct tcb *tcp) printfd(tcp, tcp->u_arg[0]); tprints(", "); if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) { - /* abuse of auxstr to retain state */ - tcp->auxstr = (void *) (long) ulen; + set_tcb_priv_ulong(tcp, ulen); return 0; } else { printaddr(tcp->u_arg[1]); @@ -217,8 +216,7 @@ decode_sockname(struct tcb *tcp) } } - ulen = (long) tcp->auxstr; - tcp->auxstr = NULL; + ulen = get_tcb_priv_ulong(tcp); if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) { printaddr(tcp->u_arg[1]); @@ -308,8 +306,7 @@ SYS_FUNC(recvfrom) printfd(tcp, tcp->u_arg[0]); tprints(", "); if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) { - /* abuse of auxstr to retain state */ - tcp->auxstr = (void *) (long) ulen; + set_tcb_priv_ulong(tcp, ulen); } } else { /* buf */ @@ -325,8 +322,7 @@ SYS_FUNC(recvfrom) printflags(msg_flags, tcp->u_arg[3], "MSG_???"); tprints(", "); - ulen = (long) tcp->auxstr; - tcp->auxstr = NULL; + ulen = get_tcb_priv_ulong(tcp); if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) { /* from address */ |