]> granicus.if.org Git - strace/commitdiff
ucopy: skip redundant tracee address truncation check
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 29 Jul 2017 23:27:52 +0000 (23:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 29 Jul 2017 23:27:52 +0000 (23:27 +0000)
* ucopy.c (vm_read_mem): Skip raddr != truncated_raddr check
if these variables have the same data size.

ucopy.c

diff --git a/ucopy.c b/ucopy.c
index c2ec2c50c7e9f8d71f247339773fb8a009703609..52cbfebd8f7283b69bcc508177e06cc1e4aa704c 100644 (file)
--- a/ucopy.c
+++ b/ucopy.c
@@ -67,10 +67,12 @@ vm_read_mem(const pid_t pid, void *const laddr,
 {
        const unsigned long truncated_raddr = raddr;
 
+#if SIZEOF_LONG < SIZEOF_KERNEL_LONG_T
        if (raddr != (kernel_ulong_t) truncated_raddr) {
                errno = EIO;
                return -1;
        }
+#endif
 
        const struct iovec local = {
                .iov_base = laddr,