From: Dmitry V. Levin Date: Tue, 20 Dec 2016 02:04:09 +0000 (+0000) Subject: Do not use widen_to_ulong in kexec.c and process_vm.c X-Git-Tag: v4.16~319 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=552888b1acae3bf19dd850f6d5c8940d1e48a77e;p=strace Do not use widen_to_ulong in kexec.c and process_vm.c Automatic argument truncation makes use of this function redundant. * kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong. * process_vm.c (SYS_FUNC(process_vm_readv), SYS_FUNC(process_vm_writev)): Likewise. --- diff --git a/kexec.c b/kexec.c index d7054993..0d3ae560 100644 --- a/kexec.c +++ b/kexec.c @@ -81,16 +81,16 @@ print_kexec_segments(struct tcb *tcp, const unsigned long addr, SYS_FUNC(kexec_load) { /* entry, nr_segments */ - printaddr(widen_to_ulong(tcp->u_arg[0])); - tprintf(", %lu, ", widen_to_ulong(tcp->u_arg[1])); + printaddr(tcp->u_arg[0]); + tprintf(", %lu, ", tcp->u_arg[1]); /* segments */ - print_kexec_segments(tcp, widen_to_ulong(tcp->u_arg[2]), - widen_to_ulong(tcp->u_arg[1])); + print_kexec_segments(tcp, tcp->u_arg[2], + tcp->u_arg[1]); tprints(", "); /* flags */ - unsigned long n = widen_to_ulong(tcp->u_arg[3]); + unsigned long n = tcp->u_arg[3]; printxval_long(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???"); n &= ~(unsigned long) KEXEC_ARCH_MASK; if (n) { diff --git a/process_vm.c b/process_vm.c index b0bade72..bc9f3aee 100644 --- a/process_vm.c +++ b/process_vm.c @@ -34,9 +34,9 @@ SYS_FUNC(process_vm_readv) /* arg 1: pid */ tprintf("%d, ", (int) tcp->u_arg[0]); } else { - unsigned long local_iovcnt = widen_to_ulong(tcp->u_arg[2]); - unsigned long remote_iovcnt = widen_to_ulong(tcp->u_arg[4]); - unsigned long flags = widen_to_ulong(tcp->u_arg[5]); + unsigned long local_iovcnt = tcp->u_arg[2]; + unsigned long remote_iovcnt = tcp->u_arg[4]; + unsigned long flags = tcp->u_arg[5]; /* arg 2: local iov */ tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1], @@ -56,9 +56,9 @@ SYS_FUNC(process_vm_readv) SYS_FUNC(process_vm_writev) { - unsigned long local_iovcnt = widen_to_ulong(tcp->u_arg[2]); - unsigned long remote_iovcnt = widen_to_ulong(tcp->u_arg[4]); - unsigned long flags = widen_to_ulong(tcp->u_arg[5]); + unsigned long local_iovcnt = tcp->u_arg[2]; + unsigned long remote_iovcnt = tcp->u_arg[4]; + unsigned long flags = tcp->u_arg[5]; /* arg 1: pid */ tprintf("%d, ", (int) tcp->u_arg[0]);