1 /*- 2 * Copyright (c) 1994-1995 Søren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer 10 * in this position and unchanged. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #include <sys/cdefs.h> 30 __FBSDID("$FreeBSD$"); 31 32 #include "opt_compat.h" 33 34 #include <sys/param.h> 35 #include <sys/kernel.h> 36 #include <sys/sdt.h> 37 #include <sys/systm.h> 38 #include <sys/proc.h> 39 40 #include <amd64/linux32/linux.h> 41 #include <amd64/linux32/linux32_proto.h> 42 #include <compat/linux/linux_dtrace.h> 43 #include <compat/linux/linux_util.h> 44 45 /* DTrace init */ 46 LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); 47 48 DUMMY(stime); 49 DUMMY(olduname); 50 DUMMY(syslog); 51 DUMMY(uname); 52 DUMMY(vhangup); 53 DUMMY(swapoff); 54 DUMMY(adjtimex); 55 DUMMY(create_module); 56 DUMMY(init_module); 57 DUMMY(delete_module); 58 DUMMY(get_kernel_syms); 59 DUMMY(quotactl); 60 DUMMY(bdflush); 61 DUMMY(sysfs); 62 DUMMY(query_module); 63 DUMMY(nfsservctl); 64 DUMMY(sendfile); 65 DUMMY(setfsuid); 66 DUMMY(setfsgid); 67 DUMMY(pivot_root); 68 DUMMY(mincore); 69 DUMMY(ptrace); 70 DUMMY(lookup_dcookie); 71 DUMMY(remap_file_pages); 72 DUMMY(mbind); 73 DUMMY(get_mempolicy); 74 DUMMY(set_mempolicy); 75 DUMMY(mq_open); 76 DUMMY(mq_unlink); 77 DUMMY(mq_timedsend); 78 DUMMY(mq_timedreceive); 79 DUMMY(mq_notify); 80 DUMMY(mq_getsetattr); 81 DUMMY(kexec_load); 82 /* linux 2.6.11: */ 83 DUMMY(add_key); 84 DUMMY(request_key); 85 DUMMY(keyctl); 86 /* linux 2.6.13: */ 87 DUMMY(ioprio_set); 88 DUMMY(ioprio_get); 89 DUMMY(inotify_init); 90 DUMMY(inotify_add_watch); 91 DUMMY(inotify_rm_watch); 92 /* linux 2.6.16: */ 93 DUMMY(migrate_pages); 94 DUMMY(unshare); 95 /* linux 2.6.17: */ 96 DUMMY(splice); 97 DUMMY(sync_file_range); 98 DUMMY(tee); 99 DUMMY(vmsplice); 100 /* linux 2.6.18: */ 101 DUMMY(move_pages); 102 /* linux 2.6.19: */ 103 DUMMY(getcpu); 104 /* linux 2.6.22: */ 105 DUMMY(signalfd); 106 DUMMY(timerfd_create); 107 /* linux 2.6.25: */ 108 DUMMY(timerfd_settime); 109 DUMMY(timerfd_gettime); 110 /* linux 2.6.27: */ 111 DUMMY(signalfd4); 112 DUMMY(inotify_init1); 113 /* linux 2.6.30: */ 114 DUMMY(preadv); 115 DUMMY(pwritev); 116 /* linux 2.6.31: */ 117 DUMMY(rt_tgsigqueueinfo); 118 DUMMY(perf_event_open); 119 /* linux 2.6.33: */ 120 DUMMY(fanotify_init); 121 DUMMY(fanotify_mark); 122 /* linux 2.6.39: */ 123 DUMMY(name_to_handle_at); 124 DUMMY(open_by_handle_at); 125 DUMMY(clock_adjtime); 126 /* linux 3.0: */ 127 DUMMY(setns); 128 /* linux 3.2: */ 129 DUMMY(process_vm_readv); 130 DUMMY(process_vm_writev); 131 /* linux 3.5: */ 132 DUMMY(kcmp); 133 /* linux 3.8: */ 134 DUMMY(finit_module); 135 DUMMY(sched_setattr); 136 DUMMY(sched_getattr); 137 /* linux 3.14: */ 138 DUMMY(renameat2); 139 /* linux 3.15: */ 140 DUMMY(seccomp); 141 DUMMY(getrandom); 142 DUMMY(memfd_create); 143 /* linux 3.18: */ 144 DUMMY(bpf); 145 /* linux 3.19: */ 146 DUMMY(execveat); 147 /* linux 4.2: */ 148 DUMMY(userfaultfd); 149 /* linux 4.3: */ 150 DUMMY(membarrier); 151 /* linux 4.4: */ 152 DUMMY(mlock2); 153 /* linux 4.5: */ 154 DUMMY(copy_file_range); 155 /* linux 4.6: */ 156 DUMMY(preadv2); 157 DUMMY(pwritev2); 158 /* linux 4.8: */ 159 DUMMY(pkey_mprotect); 160 DUMMY(pkey_alloc); 161 DUMMY(pkey_free); 162 163 #define DUMMY_XATTR(s) \ 164 int \ 165 linux_ ## s ## xattr( \ 166 struct thread *td, struct linux_ ## s ## xattr_args *arg) \ 167 { \ 168 \ 169 return (ENOATTR); \ 170 } 171 DUMMY_XATTR(set); 172 DUMMY_XATTR(lset); 173 DUMMY_XATTR(fset); 174 DUMMY_XATTR(get); 175 DUMMY_XATTR(lget); 176 DUMMY_XATTR(fget); 177 DUMMY_XATTR(list); 178 DUMMY_XATTR(llist); 179 DUMMY_XATTR(flist); 180 DUMMY_XATTR(remove); 181 DUMMY_XATTR(lremove); 182 DUMMY_XATTR(fremove); 183