From 45afc0f8505999b9fdce8b50f590691641944eec Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Thu, 25 Aug 2016 15:53:52 +0300 Subject: [PATCH] Add CONFIG_SWAP_HOOK_SYSCALL support Change-Id: I77cbb7cf011e61d9a8e53a18aa254872f9f54549 Signed-off-by: Vitaliy Cherepanov --- ks_features/Kbuild | 1 + ks_features/features_data.c | 30 ++-- ks_features/ks_feature_hook.c | 157 +++++++++++++++++++++ ks_features/ks_feature_kprobe.c | 164 +++++++++++++++++++++ ks_features/ks_features.c | 205 ++------------------------- ks_features/ks_features_data.c | 111 +++++++++++++++ ks_features/ks_features_data.h | 86 +++++++++++ ks_features/syscall_list.h | 306 ++++++++++++++++++++-------------------- 8 files changed, 701 insertions(+), 359 deletions(-) create mode 100644 ks_features/ks_feature_hook.c create mode 100644 ks_features/ks_feature_kprobe.c create mode 100644 ks_features/ks_features_data.c create mode 100644 ks_features/ks_features_data.h diff --git a/ks_features/Kbuild b/ks_features/Kbuild index 207627d..94a041a 100644 --- a/ks_features/Kbuild +++ b/ks_features/Kbuild @@ -4,6 +4,7 @@ KBUILD_EXTRA_SYMBOLS = $(src)/../kprobe/Module.symvers \ obj-m := swap_ks_features.o swap_ks_features-y := ks_features.o \ + ks_features_data.o \ ks_map.o \ file_ops.o \ ksf_msg.o diff --git a/ks_features/features_data.c b/ks_features/features_data.c index 3a96c80..5b847e4 100644 --- a/ks_features/features_data.c +++ b/ks_features/features_data.c @@ -56,7 +56,7 @@ struct feature { * @def X * X-macros for syscall list. */ -#define X(name, args) id_##name +#define X(name, args) id_sys_##name, /** * @enum syscall_id * Syscall list @@ -71,7 +71,9 @@ static enum syscall_id id_none[] = {}; static enum syscall_id id_file[] = { id_sys_acct, id_sys_mount, - id_sys_umount, +/* TODO: + * id_sys_umount, + */ id_sys_truncate, /* TODO: * id_sys_stat, @@ -102,8 +104,10 @@ static enum syscall_id id_file[] = { id_sys_open, id_sys_access, id_sys_chown, - id_sys_chown16, - id_sys_utime, +/* TODO: + * id_sys_chown16, + * id_sys_utime, + */ id_sys_utimes, id_sys_pread64, id_sys_pwrite64, @@ -151,7 +155,9 @@ static enum syscall_id id_ipc[] = { id_sys_shmget, id_sys_shmdt, id_sys_shmctl, - id_sys_ipc +/* TODO: + * id_sys_ipc + */ }; static enum syscall_id id_net[] = { @@ -176,7 +182,9 @@ static enum syscall_id id_net[] = { id_sys_recvmmsg, id_sys_socket, id_sys_socketpair, - id_sys_socketcall, +/* TODO: + * id_sys_socketcall, + */ id_sys_listen }; @@ -229,7 +237,9 @@ static enum syscall_id id_desc[] = { id_sys_fgetxattr, id_sys_flistxattr, id_sys_fremovexattr, - id_sys_fadvise64_64, +/* TODO: + * id_sys_fadvise64_64, + */ id_sys_pipe2, id_sys_dup3, id_sys_sendfile, @@ -276,8 +286,10 @@ static enum syscall_id id_desc[] = { id_sys_fanotify_init, id_sys_fanotify_mark, id_sys_syncfs, - id_sys_mmap_pgoff, - id_sys_old_mmap, +/* TODO: + * id_sys_mmap_pgoff, + * id_sys_old_mmap, + */ id_sys_name_to_handle_at, id_sys_setns }; diff --git a/ks_features/ks_feature_hook.c b/ks_features/ks_feature_hook.c new file mode 100644 index 0000000..60e7ea2 --- /dev/null +++ b/ks_features/ks_feature_hook.c @@ -0,0 +1,157 @@ +/** + * @author Vyacheslav Cherkashin: SWAP ks_features implement + * + * @section LICENSE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * @section COPYRIGHT + * + * Copyright (C) Samsung Electronics, 2016 + * + * @section DESCRIPTION + * + * SWAP kernel features + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ksf_msg.h" +#include "ks_features.h" +#include "syscall_list.h" +#include "features_data.c" +#include "writer/kernel_operations.h" +#include "ks_features_data.h" + + +static void syscall_entry_hendler(struct hook_syscall *self, + struct pt_regs *regs) +{ + if (check_event(current)) { + struct ks_probe *ksp = container_of(self, struct ks_probe, hook); + const char *fmt = ksp->args; + const unsigned long func_addr = ksp->sys_addr; + enum probe_t type = ksp->type; + + ksf_msg_entry(regs, func_addr, type, fmt); + } +} + +static void syscall_exit_hendler(struct hook_syscall *self, + struct pt_regs *regs) +{ + if (check_event(current)) { + struct ks_probe *ksp = container_of(self, struct ks_probe, hook); + const unsigned long func_addr = ksp->sys_addr; + const unsigned long ret_addr = get_regs_ret_func(regs); + enum probe_t type = ksp->type; + + ksf_msg_exit(regs, func_addr, ret_addr, type, 'x'); + } +} + +static int register_syscall(size_t id) +{ + int ret = 0; + + if (id >= syscall_cnt) + return -EINVAL; + + ksp[id].hook.entry = syscall_entry_hendler; + ksp[id].hook.exit = syscall_exit_hendler; +#ifdef CONFIG_COMPAT + /* FIXME: add hook_syscall_reg() */ + ret = hook_syscall_reg_compat(&ksp[id].hook, ksp[id].id); +#else + ret = hook_syscall_reg(&ksp[id].hook, ksp[id].id); +#endif + + if (ret) { + pr_err("ERROR: cannot register hook '%s' id=%zd sysid=%u\n", + get_sys_name(id), id, ksp[id].id); + } + + return ret; +} + +static int unregister_syscall(size_t id) +{ + if (id >= syscall_cnt) + return -EINVAL; + +#ifdef CONFIG_COMPAT + /* FIXME: add hook_syscall_unreg() */ + hook_syscall_unreg_compat(&ksp[id].hook); +#else + hook_syscall_unreg(&ksp[id].hook); +#endif + + return 0; +} + +static int unregister_multiple_syscalls(size_t *id_p, size_t cnt) +{ + size_t i; + int ret = 0; + + for (i = 0; i < cnt; i++) { + ret = unregister_syscall(id_p[i]); + if (ret) + return ret; + } + + return 0; +} + +static int init_syscalls(void) +{ + size_t i, sys_id; + unsigned long addr; + const char *name; + const char *sys_call_table_name; + unsigned long *syscall_table; + +#ifdef CONFIG_COMPAT + sys_call_table_name = "compat_sys_call_table"; +#else + sys_call_table_name = "sys_call_table"; +#endif + + syscall_table = (unsigned long *)swap_ksyms(sys_call_table_name); + if (syscall_table == NULL) { + pr_warn("WARN: '%s' not found\n", sys_call_table_name); + return 0; + } + + for (i = 0; i < syscall_cnt; ++i) { + name = get_sys_name(i); + sys_id = ksp[i].id; + addr = syscall_table[sys_id]; + if (addr == 0) + pr_warn("WARN: %s() not found\n", name); + + ksp[i].sys_addr = addr; + } + + return 0; +} diff --git a/ks_features/ks_feature_kprobe.c b/ks_features/ks_feature_kprobe.c new file mode 100644 index 0000000..5a47056 --- /dev/null +++ b/ks_features/ks_feature_kprobe.c @@ -0,0 +1,164 @@ +/** + * @author Vyacheslav Cherkashin: SWAP ks_features implement + * + * @section LICENSE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * @section COPYRIGHT + * + * Copyright (C) Samsung Electronics, 2016 + * + * @section DESCRIPTION + * + * SWAP kernel features + */ + + +#include +#include +#include +#include +#include +#include +#include +#include "ksf_msg.h" +#include "ks_features.h" +#include "features_data.c" +#include "ks_features_data.h" + + +/* ========================= HANDLERS ========================= */ +static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs) +{ + struct kretprobe *rp = ri->rp; + + if (rp && check_event(current)) { + struct ks_probe *ksp = container_of(rp, struct ks_probe, rp); + const char *fmt = ksp->args; + const unsigned long addr = ksp->rp.kp.addr; + enum probe_t type = ksp->type; + + ksf_msg_entry(regs, addr, type, fmt); + } + + return 0; +} + +static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs) +{ + struct kretprobe *rp = ri->rp; + + if (rp && check_event(current)) { + struct ks_probe *ksp = container_of(rp, struct ks_probe, rp); + const unsigned long func_addr = rp->kp.addr; + const unsigned long ret_addr = (unsigned long)ri->ret_addr; + enum probe_t type = ksp->type; + + ksf_msg_exit(regs, func_addr, ret_addr, type, 'x'); + } + + return 0; +} + +/* ========================= HANDLERS ========================= */ + + + + + +static int register_syscall(size_t id) +{ + int ret; + + if (ksp[id].rp.kp.addr == 0) + return 0; + + ksp[id].rp.entry_handler = entry_handler; + ksp[id].rp.handler = ret_handler; + + ret = swap_register_kretprobe(&ksp[id].rp); + + return ret; +} + +static int unregister_syscall(size_t id) +{ + if (ksp[id].rp.kp.addr == 0) + return 0; + + swap_unregister_kretprobe(&ksp[id].rp); + + return 0; +} + +static int unregister_multiple_syscalls(size_t *id_p, size_t cnt) +{ + struct kretprobe **rpp; + const size_t end = ((size_t) 0) - 1; + size_t i = 0, id; + int ret = 0; + + if (cnt == 1) + return unregister_syscall(id_p[0]); + + rpp = kmalloc(sizeof(*rpp) * cnt, GFP_KERNEL); + --cnt; + if (rpp == NULL) { + for (; cnt != end; --cnt) { + ret = unregister_syscall(id_p[cnt]); + if (ret) + return ret; + } + return ret; + } + + for (; cnt != end; --cnt) { + id = id_p[cnt]; + if (ksp[id].rp.kp.addr) { + rpp[i] = &ksp[id].rp; + ++i; + } + } + + swap_unregister_kretprobes(rpp, i); + kfree(rpp); + + return 0; +} + +static int init_syscalls(void) +{ + size_t i; + unsigned long addr, ni_syscall; + const char *name; + + ni_syscall = swap_ksyms("sys_ni_syscall"); + + for (i = 0; i < syscall_cnt; ++i) { + name = get_sys_name(i); + addr = swap_ksyms(name); + if (addr == 0) { + pr_err("ERROR: %s() not found\n", name); + } else if (ni_syscall == addr) { + pr_err("WARN: %s is not install\n", name); + addr = 0; + } + + ksp[i].rp.kp.addr = addr; + } + + return 0; +} diff --git a/ks_features/ks_features.c b/ks_features/ks_features.c index 503612f..b6d9f97 100644 --- a/ks_features/ks_features.c +++ b/ks_features/ks_features.c @@ -37,118 +37,13 @@ #include #include "ksf_msg.h" #include "ks_features.h" -#include "syscall_list.h" -#include "features_data.c" #include "file_ops.h" - -/** - * @struct ks_probe - * @brief Kernel-space probe. Struct used as a container of syscall probes. - * @var ks_probe::rp - * Pointer to kretprobe. - * @var ks_probe::counter - * Installed probes counter. - * @var ks_probe::args - * Pointer to args format string. - * @var ks_probe::type - * Probe sub type. - */ -struct ks_probe { - struct kretprobe rp; - int counter; - char *args; - int type; -}; - -#define CREATE_RP(name) \ -{ \ - .entry_handler = NULL, \ - .handler = NULL \ -} - -#define X(name, args) #name -static const char *const syscall_name[] = { - SYSCALL_LIST -}; -#undef X - -/** - * @enum - * Syscall name count defenition - */ -enum { - syscall_name_cnt = sizeof(syscall_name) / sizeof(char *) -}; - - -#define X(name, args__) \ -{ \ - .rp = CREATE_RP(name), \ - .counter = 0, \ - .args = #args__, \ - .type = PT_KS_NONE \ -} - -static struct ks_probe ksp[] = { - SYSCALL_LIST -}; -#undef X - -static const char *get_sys_name(size_t id) -{ - return syscall_name[id]; -} - -static int get_counter(size_t id) -{ - return ksp[id].counter; -} - -static void inc_counter(size_t id) -{ - ++ksp[id].counter; -} - -static void dec_counter(size_t id) -{ - --ksp[id].counter; -} - -/* ========================= HANDLERS ========================= */ -static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs) -{ - struct kretprobe *rp = ri->rp; - - if (rp && check_event(current)) { - struct ks_probe *ksp = container_of(rp, struct ks_probe, rp); - const char *fmt = ksp->args; - const unsigned long addr = ksp->rp.kp.addr; - enum probe_t type = ksp->type; - - ksf_msg_entry(regs, addr, type, fmt); - } - - return 0; -} - -static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs) -{ - struct kretprobe *rp = ri->rp; - - if (rp && check_event(current)) { - struct ks_probe *ksp = container_of(rp, struct ks_probe, rp); - const unsigned long func_addr = rp->kp.addr; - const unsigned long ret_addr = (unsigned long)ri->ret_addr; - enum probe_t type = ksp->type; - - ksf_msg_exit(regs, func_addr, ret_addr, type, 'x'); - } - - return 0; -} -/* ========================= HANDLERS ========================= */ - +#ifdef CONFIG_SWAP_HOOK_SYSCALL +# include "ks_feature_hook.c" +#else /* CONFIG_SWAP_HOOK_SYSCALL */ +# include "ks_feature_kprobe.c" +#endif /* CONFIG_SWAP_HOOK_SYSCALL */ @@ -254,71 +149,6 @@ unlock: - -static int register_syscall(size_t id) -{ - int ret; - printk(KERN_INFO "register_syscall: %s\n", get_sys_name(id)); - - if (ksp[id].rp.kp.addr == 0) - return 0; - - ksp[id].rp.entry_handler = entry_handler; - ksp[id].rp.handler = ret_handler; - - ret = swap_register_kretprobe(&ksp[id].rp); - - return ret; -} - - -static int unregister_syscall(size_t id) -{ - printk(KERN_INFO "unregister_syscall: %s\n", get_sys_name(id)); - - if (ksp[id].rp.kp.addr == 0) - return 0; - - swap_unregister_kretprobe(&ksp[id].rp); - - return 0; -} - -static int unregister_multiple_syscalls(size_t *id_p, size_t cnt) -{ - struct kretprobe **rpp; - const size_t end = ((size_t) 0) - 1; - size_t i = 0, id; - int ret = 0; - - if (cnt == 1) - return unregister_syscall(id_p[0]); - - rpp = kmalloc(sizeof(*rpp) * cnt, GFP_KERNEL); - --cnt; - if (rpp == NULL) { - for (; cnt != end; --cnt) { - ret = unregister_syscall(id_p[cnt]); - if (ret) - return ret; - } - return ret; - } - - for (; cnt != end; --cnt) { - id = id_p[cnt]; - if (ksp[id].rp.kp.addr) { - rpp[i] = &ksp[id].rp; - ++i; - } - } - - swap_unregister_kretprobes(rpp, i); - kfree(rpp); - - return 0; -} - static void set_pst(struct feature *f, size_t id) { ksp[id].type |= f->type; @@ -505,33 +335,14 @@ EXPORT_SYMBOL_GPL(unset_feature); static int init_syscall_features(void) { - size_t i; - unsigned long addr, ni_syscall; - const char *name; - - ni_syscall = swap_ksyms("sys_ni_syscall"); - - for (i = 0; i < syscall_name_cnt; ++i) { - name = get_sys_name(i); - addr = swap_ksyms(name); - if (addr == 0) { - printk(KERN_INFO "INFO: %s() not found\n", name); - } else if (ni_syscall == addr) { - printk(KERN_INFO "INFO: %s is not install\n", name); - addr = 0; - } - - ksp[i].rp.kp.addr = addr; - } - - return 0; + return init_syscalls(); } static void uninit_syscall_features(void) { size_t id; - for (id = 0; id < syscall_name_cnt; ++id) { + for (id = 0; id < syscall_cnt; ++id) { if (get_counter(id) > 0) unregister_syscall(id); } @@ -600,7 +411,7 @@ void print_all_syscall(void) int i; printk(KERN_INFO "SYSCALL:\n"); - for (i = 0; i < syscall_name_cnt; ++i) + for (i = 0; i < syscall_cnt; ++i) printk(KERN_INFO " [%2d] %s\n", get_counter(i), get_sys_name(i)); } diff --git a/ks_features/ks_features_data.c b/ks_features/ks_features_data.c new file mode 100644 index 0000000..78ef3a0 --- /dev/null +++ b/ks_features/ks_features_data.c @@ -0,0 +1,111 @@ +/** + * @author Vitaliy Cherepanov: SWAP ks_features_data implement + * + * @section LICENSE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * @section COPYRIGHT + * + * Copyright (C) Samsung Electronics, 2016 + * + * @section DESCRIPTION + * + * SWAP kernel features + */ + +#include "syscall_list.h" +#include "ks_features_data.h" +#include "ksf_msg.h" + + +/** + * @struct ks_probe + * @brief Kernel-space probe. Struct used as a container of syscall probes. + * @var ks_probe::rp + * Pointer to kretprobe. + * @var ks_probe::counter + * Installed probes counter. + * @var ks_probe::args + * Pointer to args format string. + * @var ks_probe::type + * Probe sub type. + */ + +#define CREATE_RP(name) \ +{ \ + .entry_handler = NULL, \ + .handler = NULL \ +} + +#define CREATE_HOOK_SYSCALL(name) \ +{ \ + .entry = NULL, \ + .exit = NULL \ +} + +#define SYSCALL_NAME_STR(name) #name + +#ifdef CONFIG_SWAP_HOOK_SYSCALL + +#include /* FIXME: for only arm64 compat mode */ + +#define X(name__, args__) \ +{ \ + .hook = CREATE_HOOK_SYSCALL(name__), \ + .sys_addr = 0xdeadbeef, \ + .counter = 0, \ + .args = #args__, \ + .type = PT_KS_NONE, \ + .name = SYSCALL_NAME_STR(sys_ ## name__), \ + .id = __NR_ ## name__, \ +}, +#else /* !CONFIG_SWAP_HOOK_SYSCALL */ +#define X(name__, args__) \ +{ \ + .rp = CREATE_RP(name__), \ + .counter = 0, \ + .args = #args__, \ + .type = PT_KS_NONE, \ + .name = SYSCALL_NAME_STR(sys_ ## name__), \ +}, +#endif /* CONFIG_SWAP_HOOK_SYSCALL */ + +struct ks_probe ksp[syscall_cnt] = { + SYSCALL_LIST +}; + +#undef X + +const char *get_sys_name(size_t id) +{ + return ksp[id].name; +} + +int get_counter(size_t id) +{ + return ksp[id].counter; +} + +void inc_counter(size_t id) +{ + ++ksp[id].counter; +} + +void dec_counter(size_t id) +{ + --ksp[id].counter; +} + diff --git a/ks_features/ks_features_data.h b/ks_features/ks_features_data.h new file mode 100644 index 0000000..e68a1b1 --- /dev/null +++ b/ks_features/ks_features_data.h @@ -0,0 +1,86 @@ +/** + * ks_features/ks_features_data.h + * @author Vitaliy Cherepanov: SWAP ks_features implement + * + * @section LICENSE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * @section COPYRIGHT + * + * Copyright (C) Samsung Electronics, 2016 + * + * @section DESCRIPTION + * + * SWAP kernel features + */ + +/** + * @struct ks_probe + * @brief Kernel-space probe. Struct used as a container of syscall probes. + * @var ks_probe::rp + * Pointer to kretprobe. + * @var ks_probe::counter + * Installed probes counter. + * @var ks_probe::args + * Pointer to args format string. + * @var ks_probe::type + * Probe sub type. + */ +#ifndef __KS_FEATURE_DATA_H__ +#define __KS_FEATURE_DATA_H__ + +#include "syscall_list.h" + +#ifdef CONFIG_SWAP_HOOK_SYSCALL +# include +#else +# include "kprobe/swap_kprobes.h" +#endif + +struct ks_probe { +#ifdef CONFIG_SWAP_HOOK_SYSCALL + struct hook_syscall hook; + u64 sys_addr; +#else /* CONFIG_SWAP_HOOK_SYSCALL */ + struct kretprobe rp; +#endif /* CONFIG_SWAP_HOOK_SYSCALL */ + + int counter; + char *args; + int type; + + const char *name; + unsigned int id; +}; + +/** + * @enum + * Syscall name count defenition + */ +#define X(name__, args__) + 1 +enum { + syscall_cnt = 0 SYSCALL_LIST +}; +#undef X + +extern struct ks_probe ksp[syscall_cnt]; + +const char *get_sys_name(size_t id); +int get_counter(size_t id); +void inc_counter(size_t id); +void dec_counter(size_t id); + +#endif /* __KS_FEATURE_DATA_H__ */ diff --git a/ks_features/syscall_list.h b/ks_features/syscall_list.h index ee04553..380e53f 100644 --- a/ks_features/syscall_list.h +++ b/ks_features/syscall_list.h @@ -32,158 +32,158 @@ #define _SYSCALL_LIST_H #define SYSCALL_LIST \ - X(sys_accept4, dpdd), \ - X(sys_accept, dpd), \ - X(sys_access, sd), \ - X(sys_acct, s), \ - X(sys_bind, dpd), \ - X(sys_chdir, s), \ - X(sys_chmod, sd), \ - X(sys_chown16, sdd), \ - X(sys_chown, sdd), \ - X(sys_chroot, s), \ - X(sys_clone, ddddd), \ - X(sys_connect, dpd), \ - X(sys_creat, sd), \ - X(sys_dup3, ddd), \ - X(sys_epoll_create1, d), \ - X(sys_epoll_ctl, dddp), \ - X(sys_epoll_pwait, dpddpx), \ - X(sys_epoll_wait, dpdd), \ - X(sys_eventfd2, dd), \ - X(sys_eventfd, d), \ - X(sys_execve, spp), \ - X(sys_exit, d), \ - X(sys_exit_group, d), \ - X(sys_faccessat, dsd), \ - X(sys_fadvise64_64, dxxd), \ - X(sys_fallocate, ddxx), \ - X(sys_fanotify_init, dd), \ - X(sys_fanotify_mark, ddxds), \ - X(sys_fchmodat, dsd), \ - X(sys_fchownat, dsddd), \ - X(sys_fgetxattr, dspx), \ - X(sys_flistxattr, dpx), \ - X(sys_fork, /* empty */), \ - X(sys_fremovexattr, ds), \ - X(sys_fstat64, xp), \ - X(sys_ftruncate64, dx), \ - X(sys_futimesat, dsp), \ - X(sys_getcwd, px), \ - X(sys_getpeername, dpd), \ - X(sys_getsockname, dpd), \ - X(sys_getsockopt, dddpd), \ - X(sys_getxattr, sspx), \ - X(sys_inotify_add_watch, dsd), \ - X(sys_inotify_init, /* empty */), \ - X(sys_inotify_init1, d), \ - X(sys_inotify_rm_watch, dd), \ - X(sys_ipc, ddxxpx), \ - X(sys_kill, dd), \ - X(sys_linkat, dsdsd), \ - X(sys_link, ss), \ - X(sys_listen, dd), \ - X(sys_listxattr, spx), \ - X(sys_lstat64, sp), \ -/* TODO: X(sys_lstat, sp), */ \ - X(sys_mkdirat, dsd), \ - X(sys_mkdir, sd), \ - X(sys_mknodat, dsdd), \ - X(sys_mknod, sdd), \ - X(sys_mmap_pgoff, xxxxxx), \ - X(sys_mount, pppxp), \ - X(sys_msgctl, ddp), \ - X(sys_msgget, dd), \ - X(sys_msgrcv, dpxxd), \ - X(sys_msgsnd, dpxd), \ - X(sys_name_to_handle_at, dspdd), \ -/* TODO: X(sys_newfstatat, dspd), */ \ - X(sys_old_mmap, p), \ - X(sys_openat, dsdd), \ - X(sys_open_by_handle_at, dpd), \ - X(sys_open, sdd), \ - X(sys_pause, /* empty */), \ - X(sys_pipe2, dd), \ - X(sys_ppoll, pdpp), \ - X(sys_pread64, dpxx), \ - X(sys_preadv, xpxxx), \ - X(sys_pselect6, dxxxpp), \ - X(sys_pwrite64, dsxx), \ - X(sys_pwritev, xpxxx), \ - X(sys_readlinkat, dspd), \ - X(sys_readlink, spd), \ - X(sys_recv, dpxd), \ - X(sys_recvfrom, dpxdpd), \ - X(sys_recvmmsg, dpddp), \ - X(sys_recvmsg, dpd), \ - X(sys_removexattr, ss), \ - X(sys_renameat, dsds), \ - X(sys_rename, ss), \ - X(sys_rmdir, s), \ - X(sys_rt_sigaction, dpp), \ - X(sys_rt_sigprocmask, dppx), \ - X(sys_rt_sigsuspend, px), \ - X(sys_rt_sigtimedwait, pppx), \ - X(sys_rt_tgsigqueueinfo, dddp), \ - X(sys_semctl, dddx), \ - X(sys_semget, ddd), \ - X(sys_semop, dpd), \ - X(sys_semtimedop, dpdp), \ - X(sys_send, dpxd), \ - X(sys_sendfile64, ddlxx), \ - X(sys_sendfile, ddxx), \ - X(sys_sendmmsg, dpdd), \ - X(sys_sendmsg, dpd), \ - X(sys_sendto, dpxdpd), \ - X(sys_setns, dd), \ - X(sys_setsockopt, dddpd), \ - X(sys_setxattr, sspxd), \ - X(sys_shmat, dpd), \ - X(sys_shmctl, ddp), \ - X(sys_shmdt, p), \ - X(sys_shmget, dxd), \ - X(sys_shutdown, dd), \ - X(sys_sigaction, dpp), \ -/* TODO: X(sys_sigaltstack, pp), */ \ -/* TODO: X(sys_signal, dp), */ \ - X(sys_signalfd4, dpxd), \ - X(sys_signalfd, dpx), \ - X(sys_sigpending, p), \ - X(sys_sigprocmask, dpp), \ -/* TODO: X(sys_sigsuspend, ddp), */ \ -/* TODO: X(sys_sigsuspend, p), */ \ - X(sys_socketcall, dx), \ - X(sys_socket, ddd), \ - X(sys_socketpair, dddd), \ - X(sys_splice, dxdxxd), \ - X(sys_stat64, sp), \ - X(sys_statfs64, sxp), \ - X(sys_statfs, sp), \ -/* TODO: X(sys_stat, sp), */ \ - X(sys_swapoff, s), \ - X(sys_swapon, sd), \ - X(sys_symlinkat, sds), \ - X(sys_symlink, ss), \ - X(sys_syncfs, d), \ - X(sys_tee, ddxd), \ - X(sys_tgkill, ddd), \ - X(sys_timerfd_create, dd), \ - X(sys_timerfd_gettime, dp), \ - X(sys_timerfd_settime, ddpp), \ - X(sys_truncate64, sx), \ - X(sys_truncate, sx), \ - X(sys_umount, pd), \ - X(sys_unlinkat, dsd), \ - X(sys_unlink, s), \ - X(sys_unshare, x), \ - X(sys_uselib, s), \ - X(sys_utimensat, dspd), \ - X(sys_utime, pp), \ - X(sys_utimes, pp), \ - X(sys_vfork, /* empty */), \ - X(sys_vmsplice, dpxd), \ - X(sys_wait4, dddp), \ - X(sys_waitid, ddpdp) -/* TODO: X(sys_waitpid, ddd) */ + X(accept4, dpdd) \ + X(accept, dpd) \ + X(access, sd) \ + X(acct, s) \ + X(bind, dpd) \ + X(chdir, s) \ + X(chmod, sd) \ +/* TODO: X(chown16, sdd) */ \ + X(chown, sdd) \ + X(chroot, s) \ + X(clone, ddddd) \ + X(connect, dpd) \ + X(creat, sd) \ + X(dup3, ddd) \ + X(epoll_create1, d) \ + X(epoll_ctl, dddp) \ + X(epoll_pwait, dpddpx) \ + X(epoll_wait, dpdd) \ + X(eventfd2, dd) \ + X(eventfd, d) \ + X(execve, spp) \ + X(exit, d) \ + X(exit_group, d) \ + X(faccessat, dsd) \ +/* TODO: X(fadvise64_64, dxxd) */ \ + X(fallocate, ddxx) \ + X(fanotify_init, dd) \ + X(fanotify_mark, ddxds) \ + X(fchmodat, dsd) \ + X(fchownat, dsddd) \ + X(fgetxattr, dspx) \ + X(flistxattr, dpx) \ + X(fork, /* empty */) \ + X(fremovexattr, ds) \ + X(fstat64, xp) \ + X(ftruncate64, dx) \ + X(futimesat, dsp) \ + X(getcwd, px) \ + X(getpeername, dpd) \ + X(getsockname, dpd) \ + X(getsockopt, dddpd) \ + X(getxattr, sspx) \ + X(inotify_add_watch, dsd) \ + X(inotify_init, /* empty */) \ + X(inotify_init1, d) \ + X(inotify_rm_watch, dd) \ +/* TODO: X(ipc, ddxxpx) */\ + X(kill, dd) \ + X(linkat, dsdsd) \ + X(link, ss) \ + X(listen, dd) \ + X(listxattr, spx) \ + X(lstat64, sp) \ +/* TODO: X(lstat, sp) */ \ + X(mkdirat, dsd) \ + X(mkdir, sd) \ + X(mknodat, dsdd) \ + X(mknod, sdd) \ +/* TODO: X(mmap_pgoff, xxxxxx) */ \ + X(mount, pppxp) \ + X(msgctl, ddp) \ + X(msgget, dd) \ + X(msgrcv, dpxxd) \ + X(msgsnd, dpxd) \ + X(name_to_handle_at, dspdd) \ +/* TODO: X(newfstatat, dspd) */ \ +/* TODO: X(old_mmap, p) */ \ + X(openat, dsdd) \ + X(open_by_handle_at, dpd) \ + X(open, sdd) \ + X(pause, /* empty */) \ + X(pipe2, dd) \ + X(ppoll, pdpp) \ + X(pread64, dpxx) \ + X(preadv, xpxxx) \ + X(pselect6, dxxxpp) \ + X(pwrite64, dsxx) \ + X(pwritev, xpxxx) \ + X(readlinkat, dspd) \ + X(readlink, spd) \ + X(recv, dpxd) \ + X(recvfrom, dpxdpd) \ + X(recvmmsg, dpddp) \ + X(recvmsg, dpd) \ + X(removexattr, ss) \ + X(renameat, dsds) \ + X(rename, ss) \ + X(rmdir, s) \ + X(rt_sigaction, dpp) \ + X(rt_sigprocmask, dppx) \ + X(rt_sigsuspend, px) \ + X(rt_sigtimedwait, pppx) \ + X(rt_tgsigqueueinfo, dddp) \ + X(semctl, dddx) \ + X(semget, ddd) \ + X(semop, dpd) \ + X(semtimedop, dpdp) \ + X(send, dpxd) \ + X(sendfile64, ddlxx) \ + X(sendfile, ddxx) \ + X(sendmmsg, dpdd) \ + X(sendmsg, dpd) \ + X(sendto, dpxdpd) \ + X(setns, dd) \ + X(setsockopt, dddpd) \ + X(setxattr, sspxd) \ + X(shmat, dpd) \ + X(shmctl, ddp) \ + X(shmdt, p) \ + X(shmget, dxd) \ + X(shutdown, dd) \ + X(sigaction, dpp) \ +/* TODO: X(sigaltstack, pp) */ \ +/* TODO: X(signal, dp) */ \ + X(signalfd4, dpxd) \ + X(signalfd, dpx) \ + X(sigpending, p) \ + X(sigprocmask, dpp) \ +/* TODO: X(sigsuspend, ddp) */ \ +/* TODO: X(sigsuspend, p) */ \ +/* TODO: X(socketcall, dx) */\ + X(socket, ddd) \ + X(socketpair, dddd) \ + X(splice, dxdxxd) \ + X(stat64, sp) \ + X(statfs64, sxp) \ + X(statfs, sp) \ +/* TODO: X(stat, sp) */ \ + X(swapoff, s) \ + X(swapon, sd) \ + X(symlinkat, sds) \ + X(symlink, ss) \ + X(syncfs, d) \ + X(tee, ddxd) \ + X(tgkill, ddd) \ + X(timerfd_create, dd) \ + X(timerfd_gettime, dp) \ + X(timerfd_settime, ddpp) \ + X(truncate64, sx) \ + X(truncate, sx) \ +/* TODO: X(umount, pd) */\ + X(unlinkat, dsd) \ + X(unlink, s) \ + X(unshare, x) \ + X(uselib, s) \ + X(utimensat, dspd) \ +/* TODO: X(utime, pp) */\ + X(utimes, pp) \ + X(vfork, /* empty */) \ + X(vmsplice, dpxd) \ + X(wait4, dddp) \ + X(waitid, ddpdp) +/* TODO: X(waitpid, ddd) */ #endif /* _SYSCALL_LIST_H */ -- 2.7.4