wrapper: remove lttng_access_ok() wrapper
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:34:46 +0000 (12:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Apr 2020 16:34:46 +0000 (12:34 -0400)
lib/ringbuffer/backend.h
lib/ringbuffer/ring_buffer_iterator.c
lttng-filter-interpreter.c
probes/lttng-probe-user.c
wrapper/uaccess.h [deleted file]

index da4e92b9d89633039e5d609d964f32ce0e13dc03..189b25bebb35a722eabe264be97b5b0579b03e51 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/list.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
-#include <wrapper/uaccess.h>
+#include <linux/uaccess.h>
 
 /* Internal helpers */
 #include <wrapper/ringbuffer/backend_internal.h>
@@ -289,7 +289,7 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config
 
        set_fs(KERNEL_DS);
        pagefault_disable();
-       if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
+       if (unlikely(!access_ok(src, len)))
                goto fill_buffer;
 
        if (likely(pagecpy == len)) {
@@ -359,7 +359,7 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf
 
        set_fs(KERNEL_DS);
        pagefault_disable();
-       if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
+       if (unlikely(!access_ok(src, len)))
                goto fill_buffer;
 
        if (likely(pagecpy == len)) {
@@ -449,7 +449,7 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest,
        unsigned long ret;
        mm_segment_t old_fs;
 
-       if (!lttng_access_ok(VERIFY_READ, src, len))
+       if (!access_ok(src, len))
                return 1;
        old_fs = get_fs();
        set_fs(KERNEL_DS);
index 00faa729aa2507a661ccc29e804fdcce823a66d2..382a477de2ce82ff4505fa49478432867166a0fa 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <wrapper/ringbuffer/iterator.h>
 #include <wrapper/file.h>
-#include <wrapper/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/jiffies.h>
 #include <linux/delay.h>
 #include <linux/module.h>
@@ -606,7 +606,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp,
        ssize_t len;
 
        might_sleep();
-       if (!lttng_access_ok(VERIFY_WRITE, user_buf, count))
+       if (!access_ok(user_buf, count))
                return -EFAULT;
 
        /* Finish copy of previous record */
index c7ce7d331bd2dc4eb8639751d7b38377ed451fca..811a262296190ef60e52481fa333c823f9a76886 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
-#include <wrapper/uaccess.h>
+#include <linux/uaccess.h>
 #include <wrapper/frame.h>
 #include <wrapper/types.h>
 #include <linux/swab.h>
@@ -30,8 +30,7 @@ char get_char(struct estack_entry *reg, size_t offset)
                char c;
 
                /* Handle invalid access as end of string. */
-               if (unlikely(!lttng_access_ok(VERIFY_READ,
-                               reg->u.s.user_str + offset,
+               if (unlikely(!access_ok(reg->u.s.user_str + offset,
                                sizeof(c))))
                        return '\0';
                /* Handle fault (nonzero return value) as end of string. */
index b777c40dfeb0ff23b95f7fb50a7769b366a0b4c6..411899d16497fa483e65cf70108665adc0cb9c56 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <linux/uaccess.h>
 #include <linux/module.h>
-#include <wrapper/uaccess.h>
 #include <probes/lttng-probe-user.h>
 
 /*
@@ -31,8 +30,7 @@ long lttng_strlen_user_inatomic(const char *addr)
                char v;
                unsigned long ret;
 
-               if (unlikely(!lttng_access_ok(VERIFY_READ,
-                               (__force const char __user *) addr,
+               if (unlikely(!access_ok((__force const char __user *) addr,
                                sizeof(v))))
                        break;
                ret = __copy_from_user_inatomic(&v,
diff --git a/wrapper/uaccess.h b/wrapper/uaccess.h
deleted file mode 100644 (file)
index 7abe5e5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/uaccess.h
- *
- * wrapper around linux/uaccess.h.
- *
- * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_UACCESS_H
-#define _LTTNG_WRAPPER_UACCESS_H
-
-#include <linux/uaccess.h>
-#include <lttng-kernel-version.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) || \
-       LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0))
-
-#define VERIFY_READ    0
-#define VERIFY_WRITE   1
-#define lttng_access_ok(type, addr, size) access_ok(addr, size)
-
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */
-
-#define lttng_access_ok(type, addr, size) access_ok(type, addr, size)
-
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */
-
-#endif /* _LTTNG_WRAPPER_UACCESS_H */
This page took 0.029112 seconds and 4 git commands to generate.