Fix: ensure userspace accesses are done with _inatomic
[lttng-modules.git] / probes / lttng-events.h
index cc65656d522844c45ab58bb5bc50635d7e405a9c..6e4f3d9452fee81d4bdd893fe99173bfbf9875b2 100644 (file)
@@ -2,14 +2,27 @@
  * lttng-events.h
  *
  * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
- * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2009-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * Dual LGPL v2.1/GPL v2 license.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-
+#include <linux/uaccess.h>
 #include <linux/debugfs.h>
 #include "lttng.h"
 #include "lttng-types.h"
+#include "lttng-probe-user.h"
 #include "../wrapper/vmalloc.h"        /* for wrapper_vmalloc_sync_all() */
 #include "../wrapper/ringbuffer/frontend_types.h"
 #include "../lttng-events.h"
@@ -347,7 +360,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
 #undef __string_from_user
 #define __string_from_user(_item, _src)                                               \
        __event_len += __dynamic_len[__dynamic_len_idx++] =                    \
-               max_t(size_t, strlen_user(_src), 1);
+               max_t(size_t, lttng_strlen_user_inatomic(_src), 1);
 
 #undef TP_PROTO
 #define TP_PROTO(args...) args
This page took 0.026015 seconds and 4 git commands to generate.