#define _SWAP_ASM_ARM_UPROBE_H
+#include <linux/printk.h>
#include <linux/uaccess.h>
#include "../probes/compat_arm64.h"
#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>
#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"
+#include <linux/sched.h>
#include <linux/module.h>
#include <linux/dcache.h>
#include <linux/namei.h>
#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;
}
};
struct dentry;
+struct file_operations;
struct dentry *swap_debugfs_create_setget_u64(const char *name, umode_t mode,
struct dentry *parent,
*/
+#include <linux/err.h>
#include <linux/module.h>
#include <writer/swap_msg.h>
#include <kprobe/swap_ktd.h>
*/
+#include <linux/err.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <us_manager/probes/probes.h>
#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>
#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>
+#include <linux/err.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/namei.h>
#include <linux/hash.h>
+#include <linux/sched.h>
#include <linux/mempolicy.h>
#include <linux/module.h>
*/
+#include <linux/err.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/mutex.h>
*/
+#include <linux/err.h>
#include <linux/module.h>
#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/pf/pf_group.h>
#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"
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);
}