Fix build for Tizen 4.0 98/149898/1 accepted/tizen/4.0/unified/20170913.154114 submit/tizen_4.0/20170913.123755
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 12 Sep 2017 16:00:25 +0000 (19:00 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 13 Sep 2017 12:27:07 +0000 (15:27 +0300)
Change-Id: Ie2b8140d19658038862b085e66299b9ae12a1338
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
15 files changed:
arch/arm/uprobe/swap_uprobe.h
kprobe/swap_kprobes_deps.h
ks_features/file_ops.c
loader/loader_module.c
master/swap_debugfs.c
master/swap_debugfs.h
nsp/nsp.c
parser/msg_parser.c
preload/preload_control.c
preload/preload_module.c
preload/preload_process.c
uprobe/swap_uprobes.c
us_manager/img/img_proc.c
us_manager/probes/probe_info_new.c
us_manager/usm_hook.c

index 86941d0..19c84f1 100644 (file)
@@ -24,6 +24,7 @@
 #define _SWAP_ASM_ARM_UPROBE_H
 
 
+#include <linux/printk.h>
 #include <linux/uaccess.h>
 #include "../probes/compat_arm64.h"
 
index f9b7e1c..e40d39e 100644 (file)
@@ -33,6 +33,7 @@
 #define _SWAP_KPROBES_DEPS_H
 
 #include <linux/version.h>     /* LINUX_VERSION_CODE, KERNEL_VERSION() */
+#include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
 #include <linux/mempolicy.h>
index db05683..7954528 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <kprobe/swap_kprobes.h>
+#include <kprobe/swap_kprobes_deps.h>
 #include <writer/event_filter.h>
 #include "ks_map.h"
 #include "ksf_msg.h"
index 5d00cdb..e262c99 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/dcache.h>
 #include <linux/namei.h>
index 2f999d0..661305b 100644 (file)
 #include <linux/module.h>
 #include <linux/debugfs.h>
 #include <linux/uaccess.h>
+#include <linux/version.h>
 #include "swap_initializer.h"
 #include "swap_debugfs.h"
 
 
 static int change_permission(struct dentry *dentry)
 {
+       const int system_fw = 202;
+
        /* set UNIX permissions */
-       dentry->d_inode->i_uid.val = 202; /* system_fw */
-       dentry->d_inode->i_gid.val = 202; /* system_fw */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+       dentry->d_inode->i_uid = KUIDT_INIT(system_fw);
+       dentry->d_inode->i_gid = KGIDT_INIT(system_fw);
+#else
+       dentry->d_inode->i_uid = system_fw;
+       dentry->d_inode->i_gid = system_fw;
+#endif
 
        return 0;
 }
index 39c1e50..2717db9 100644 (file)
@@ -39,6 +39,7 @@ struct dfs_setget_64 {
 };
 
 struct dentry;
+struct file_operations;
 
 struct dentry *swap_debugfs_create_setget_u64(const char *name, umode_t mode,
                                              struct dentry *parent,
index e03cd2c..39d8d29 100644 (file)
--- a/nsp/nsp.c
+++ b/nsp/nsp.c
@@ -20,6 +20,7 @@
  */
 
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <writer/swap_msg.h>
 #include <kprobe/swap_ktd.h>
index 98b9d30..d35952d 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 
+#include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <us_manager/probes/probes.h>
index 43b92d0..7d6567e 100644 (file)
@@ -1,8 +1,10 @@
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/limits.h>
 #include <linux/list.h>
 #include <linux/fs.h>
+#include <linux/mm.h>
 
 #include <us_manager/sspt/sspt_ip.h>
 #include <us_manager/us_common_file.h>
index f3e29f6..fd63bdf 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/slab.h>
 #include <linux/namei.h>
 #include <linux/mutex.h>
+#include <linux/sched.h>
 #include <kprobe/swap_kprobes_deps.h>
 #include <writer/kernel_operations.h>
 #include <writer/swap_msg.h>
index d4dd3a7..1b777b1 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/err.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/namei.h>
index fe6429e..d25b2d7 100644 (file)
@@ -32,6 +32,7 @@
 
 
 #include <linux/hash.h>
+#include <linux/sched.h>
 #include <linux/mempolicy.h>
 #include <linux/module.h>
 
index 1d4db97..40f6470 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 
+#include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
index 701b61a..303f332 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <us_manager/sspt/sspt_ip.h>
 #include <us_manager/pf/pf_group.h>
index 830c114..c41fd94 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/rwsem.h>
 #include <linux/errno.h>
 #include <linux/module.h>
+#include <kprobe/swap_kprobes_deps.h> // for swap_hlist_for_each_entry
 #include "usm_hook.h"
 
 
@@ -58,9 +59,10 @@ EXPORT_SYMBOL_GPL(usm_hook_unreg);
 void usm_hook_mmap(struct sspt_proc *proc, struct vm_area_struct *vma)
 {
        struct usm_hook *hook;
+       DECLARE_NODE_PTR_FOR_HLIST(node);
 
        down_read(&hook_sem);
-       hlist_for_each_entry(hook, &hook_head, node) {
+       swap_hlist_for_each_entry(hook, node, &hook_head, node) {
                if (hook->mmap)
                        hook->mmap(proc, vma);
        }