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