ARM: use swap_access_process_vm() for user memory access 55/155955/1 accepted/tizen/4.0/unified/20171017.213334 accepted/tizen/4.0/unified/20171018.231711 submit/tizen_4.0/20171017.092546 submit/tizen_4.0/20171018.024233 submit/tizen_4.0/20171018.060355 tizen_4.0.IoT.p2_release tizen_4.0.m2_release
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 16 Oct 2017 14:09:04 +0000 (17:09 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 16 Oct 2017 14:12:01 +0000 (17:12 +0300)
Change-Id: I93b31067a58d538de30d9e37d4e3406b2b74ac17
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
kprobe/swap_kprobes_deps.c
kprobe/swap_kprobes_deps.h

index 2e2694a4e2ad4eac2d4d70a9136fdb5ad3e88667..9a54bb893eb4c79ec906fd65810447f6a212d1d0 100644 (file)
@@ -453,7 +453,7 @@ int init_module_dependencies(void)
 }
 
 
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
 
 static int do_access_process_vm(struct task_struct *tsk, struct mm_struct *mm,
                                unsigned long addr, void *buf, int len,
@@ -537,7 +537,7 @@ int swap_access_process_vm(struct task_struct *tsk, unsigned long addr,
 }
 EXPORT_SYMBOL_GPL(swap_access_process_vm);
 
-#else /* CONFIG_ARM64 */
+#else /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 38) /* FIXME: must be < 32 */
 #define GUP_FLAGS_WRITE                  0x1
@@ -1364,6 +1364,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
 
        /* FIXME: danger: write memory in atomic context */
        atomic = in_atomic();
+       WARN_ON(atomic);
 
        /* ignore errors, just check how much was successfully transferred */
        while (len) {
@@ -1421,7 +1422,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
 }
 EXPORT_SYMBOL_GPL(access_process_vm_atomic);
 
-#endif /* CONFIG_ARM64 */
+#endif /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 /**
  * @brief Page present.
index e40d39ec92c99b266e332bca52b14b6f6f8875ff..8d4f345c29ff4f851cb8add0179d8b416f0a6c33 100644 (file)
@@ -135,7 +135,7 @@ do { \
 int init_module_dependencies(void);
 
 
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
 
 int swap_access_process_vm(struct task_struct *tsk, unsigned long addr,
                           void *buf, int len, int write);
@@ -145,7 +145,7 @@ int swap_access_process_vm(struct task_struct *tsk, unsigned long addr,
 # define write_proc_vm_atomic(tsk, addr, buf, len) \
        swap_access_process_vm(tsk, addr, buf, len, 1)
 
-#else /* CONFIG_ARM64 */
+#else /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
                             void *buf, int len, int write);
@@ -155,7 +155,7 @@ int access_process_vm_atomic(struct task_struct *tsk, unsigned long addr,
 # define write_proc_vm_atomic(tsk, addr, buf, len) \
        access_process_vm_atomic(tsk, addr, buf, len, 1)
 
-#endif /* CONFIG_ARM64 */
+#endif /* defined(CONFIG_ARM) || defined(CONFIG_ARM64) */
 
 int page_present(struct mm_struct *mm, unsigned long addr);