syscall instrumentation: handle copy_from_user return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 9 Sep 2014 12:32:29 +0000 (08:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Sep 2014 16:10:00 +0000 (12:10 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/syscalls/headers/x86-64-syscalls-3.10.0-rc7_pointers_override.h

index 7a8812c6fcf686f194942791bd7c5136be8e3db7..5e402a5a80b06aa23ea00730d39833d1d769df4a 100644 (file)
@@ -29,9 +29,10 @@ SC_LTTNG_TRACEPOINT_EVENT_CODE(connect,
                                if (addrlen < sizeof(struct sockaddr_in6))
                                        goto skip_code;
                                (void) get_user(tp_locvar->dport, &((struct sockaddr_in6 *) uservaddr)->sin6_port);
-                               (void) copy_from_user(tp_locvar->v6addr,
+                               if (copy_from_user(tp_locvar->v6addr,
                                                &((struct sockaddr_in6 *) uservaddr)->sin6_addr.in6_u.u6_addr8,
-                                               sizeof(tp_locvar->v6addr));
+                                               sizeof(tp_locvar->v6addr)))
+                                       memset(tp_locvar->v6addr, 0, sizeof(tp_locvar->v6addr));
                                tp_locvar->v6addr_len = 8;
                                break;
                        }
@@ -94,9 +95,10 @@ SC_LTTNG_TRACEPOINT_EVENT_CODE(accept,
                                if (tp_locvar->uaddr_len < sizeof(struct sockaddr_in6))
                                        goto skip_code;
                                (void) get_user(tp_locvar->sport, &((struct sockaddr_in6 *) upeer_sockaddr)->sin6_port);
-                               (void) copy_from_user(tp_locvar->v6addr,
+                               if (copy_from_user(tp_locvar->v6addr,
                                                &((struct sockaddr_in6 *) upeer_sockaddr)->sin6_addr.in6_u.u6_addr8,
-                                               sizeof(tp_locvar->v6addr));
+                                               sizeof(tp_locvar->v6addr)))
+                                       memset(tp_locvar->v6addr, 0, sizeof(tp_locvar->v6addr));
                                tp_locvar->v6addr_len = 8;
                                break;
                        }
This page took 0.025884 seconds and 4 git commands to generate.