compat.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_COMPAT_H
  3. #define _LINUX_COMPAT_H
  4. /*
  5. * These are the type definitions for the architecture specific
  6. * syscall compatibility layer.
  7. */
  8. #include <linux/types.h>
  9. #include <linux/time.h>
  10. #include <linux/stat.h>
  11. #include <linux/param.h> /* for HZ */
  12. #include <linux/sem.h>
  13. #include <linux/socket.h>
  14. #include <linux/if.h>
  15. #include <linux/fs.h>
  16. #include <linux/aio_abi.h> /* for aio_context_t */
  17. #include <linux/uaccess.h>
  18. #include <linux/unistd.h>
  19. #include <asm/compat.h>
  20. #ifdef CONFIG_COMPAT
  21. #include <asm/siginfo.h>
  22. #include <asm/signal.h>
  23. #endif
  24. #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  25. /*
  26. * It may be useful for an architecture to override the definitions of the
  27. * COMPAT_SYSCALL_DEFINE0 and COMPAT_SYSCALL_DEFINEx() macros, in particular
  28. * to use a different calling convention for syscalls. To allow for that,
  29. + the prototypes for the compat_sys_*() functions below will *not* be included
  30. * if CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  31. */
  32. #include <asm/syscall_wrapper.h>
  33. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  34. #ifndef COMPAT_USE_64BIT_TIME
  35. #define COMPAT_USE_64BIT_TIME 0
  36. #endif
  37. #ifndef __SC_DELOUSE
  38. #define __SC_DELOUSE(t,v) ((__force t)(unsigned long)(v))
  39. #endif
  40. #ifndef COMPAT_SYSCALL_DEFINE0
  41. #define COMPAT_SYSCALL_DEFINE0(name) \
  42. asmlinkage long compat_sys_##name(void); \
  43. ALLOW_ERROR_INJECTION(compat_sys_##name, ERRNO); \
  44. asmlinkage long compat_sys_##name(void)
  45. #endif /* COMPAT_SYSCALL_DEFINE0 */
  46. #define COMPAT_SYSCALL_DEFINE1(name, ...) \
  47. COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
  48. #define COMPAT_SYSCALL_DEFINE2(name, ...) \
  49. COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
  50. #define COMPAT_SYSCALL_DEFINE3(name, ...) \
  51. COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
  52. #define COMPAT_SYSCALL_DEFINE4(name, ...) \
  53. COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
  54. #define COMPAT_SYSCALL_DEFINE5(name, ...) \
  55. COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
  56. #define COMPAT_SYSCALL_DEFINE6(name, ...) \
  57. COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
  58. /*
  59. * The asmlinkage stub is aliased to a function named __se_compat_sys_*() which
  60. * sign-extends 32-bit ints to longs whenever needed. The actual work is
  61. * done within __do_compat_sys_*().
  62. */
  63. #ifndef COMPAT_SYSCALL_DEFINEx
  64. #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
  65. __diag_push(); \
  66. __diag_ignore(GCC, 8, "-Wattribute-alias", \
  67. "Type aliasing is used to sanitize syscall arguments");\
  68. asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
  69. asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
  70. __attribute__((alias(__stringify(__se_compat_sys##name)))); \
  71. ALLOW_ERROR_INJECTION(compat_sys##name, ERRNO); \
  72. static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
  73. asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
  74. asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
  75. { \
  76. long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
  77. __MAP(x,__SC_TEST,__VA_ARGS__); \
  78. return ret; \
  79. } \
  80. __diag_pop(); \
  81. static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
  82. #endif /* COMPAT_SYSCALL_DEFINEx */
  83. #ifdef CONFIG_COMPAT
  84. #ifndef compat_user_stack_pointer
  85. #define compat_user_stack_pointer() current_user_stack_pointer()
  86. #endif
  87. #ifndef compat_sigaltstack /* we'll need that for MIPS */
  88. typedef struct compat_sigaltstack {
  89. compat_uptr_t ss_sp;
  90. int ss_flags;
  91. compat_size_t ss_size;
  92. } compat_stack_t;
  93. #endif
  94. #define compat_jiffies_to_clock_t(x) \
  95. (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
  96. typedef __compat_uid32_t compat_uid_t;
  97. typedef __compat_gid32_t compat_gid_t;
  98. typedef compat_ulong_t compat_aio_context_t;
  99. struct compat_sel_arg_struct;
  100. struct rusage;
  101. struct compat_utimbuf {
  102. old_time32_t actime;
  103. old_time32_t modtime;
  104. };
  105. struct compat_itimerval {
  106. struct old_timeval32 it_interval;
  107. struct old_timeval32 it_value;
  108. };
  109. struct itimerval;
  110. int get_compat_itimerval(struct itimerval *, const struct compat_itimerval __user *);
  111. int put_compat_itimerval(struct compat_itimerval __user *, const struct itimerval *);
  112. struct compat_tms {
  113. compat_clock_t tms_utime;
  114. compat_clock_t tms_stime;
  115. compat_clock_t tms_cutime;
  116. compat_clock_t tms_cstime;
  117. };
  118. struct compat_timex {
  119. compat_uint_t modes;
  120. compat_long_t offset;
  121. compat_long_t freq;
  122. compat_long_t maxerror;
  123. compat_long_t esterror;
  124. compat_int_t status;
  125. compat_long_t constant;
  126. compat_long_t precision;
  127. compat_long_t tolerance;
  128. struct old_timeval32 time;
  129. compat_long_t tick;
  130. compat_long_t ppsfreq;
  131. compat_long_t jitter;
  132. compat_int_t shift;
  133. compat_long_t stabil;
  134. compat_long_t jitcnt;
  135. compat_long_t calcnt;
  136. compat_long_t errcnt;
  137. compat_long_t stbcnt;
  138. compat_int_t tai;
  139. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  140. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  141. compat_int_t:32; compat_int_t:32; compat_int_t:32;
  142. };
  143. struct timex;
  144. int compat_get_timex(struct timex *, const struct compat_timex __user *);
  145. int compat_put_timex(struct compat_timex __user *, const struct timex *);
  146. #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
  147. typedef struct {
  148. compat_sigset_word sig[_COMPAT_NSIG_WORDS];
  149. } compat_sigset_t;
  150. struct compat_sigaction {
  151. #ifndef __ARCH_HAS_IRIX_SIGACTION
  152. compat_uptr_t sa_handler;
  153. compat_ulong_t sa_flags;
  154. #else
  155. compat_uint_t sa_flags;
  156. compat_uptr_t sa_handler;
  157. #endif
  158. #ifdef __ARCH_HAS_SA_RESTORER
  159. compat_uptr_t sa_restorer;
  160. #endif
  161. compat_sigset_t sa_mask __packed;
  162. };
  163. typedef union compat_sigval {
  164. compat_int_t sival_int;
  165. compat_uptr_t sival_ptr;
  166. } compat_sigval_t;
  167. typedef struct compat_siginfo {
  168. int si_signo;
  169. #ifndef __ARCH_HAS_SWAPPED_SIGINFO
  170. int si_errno;
  171. int si_code;
  172. #else
  173. int si_code;
  174. int si_errno;
  175. #endif
  176. union {
  177. int _pad[128/sizeof(int) - 3];
  178. /* kill() */
  179. struct {
  180. compat_pid_t _pid; /* sender's pid */
  181. __compat_uid32_t _uid; /* sender's uid */
  182. } _kill;
  183. /* POSIX.1b timers */
  184. struct {
  185. compat_timer_t _tid; /* timer id */
  186. int _overrun; /* overrun count */
  187. compat_sigval_t _sigval; /* same as below */
  188. } _timer;
  189. /* POSIX.1b signals */
  190. struct {
  191. compat_pid_t _pid; /* sender's pid */
  192. __compat_uid32_t _uid; /* sender's uid */
  193. compat_sigval_t _sigval;
  194. } _rt;
  195. /* SIGCHLD */
  196. struct {
  197. compat_pid_t _pid; /* which child */
  198. __compat_uid32_t _uid; /* sender's uid */
  199. int _status; /* exit code */
  200. compat_clock_t _utime;
  201. compat_clock_t _stime;
  202. } _sigchld;
  203. #ifdef CONFIG_X86_X32_ABI
  204. /* SIGCHLD (x32 version) */
  205. struct {
  206. compat_pid_t _pid; /* which child */
  207. __compat_uid32_t _uid; /* sender's uid */
  208. int _status; /* exit code */
  209. compat_s64 _utime;
  210. compat_s64 _stime;
  211. } _sigchld_x32;
  212. #endif
  213. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
  214. struct {
  215. compat_uptr_t _addr; /* faulting insn/memory ref. */
  216. #ifdef __ARCH_SI_TRAPNO
  217. int _trapno; /* TRAP # which caused the signal */
  218. #endif
  219. #define __COMPAT_ADDR_BND_PKEY_PAD (__alignof__(compat_uptr_t) < sizeof(short) ? \
  220. sizeof(short) : __alignof__(compat_uptr_t))
  221. union {
  222. /*
  223. * used when si_code=BUS_MCEERR_AR or
  224. * used when si_code=BUS_MCEERR_AO
  225. */
  226. short int _addr_lsb; /* Valid LSB of the reported address. */
  227. /* used when si_code=SEGV_BNDERR */
  228. struct {
  229. char _dummy_bnd[__COMPAT_ADDR_BND_PKEY_PAD];
  230. compat_uptr_t _lower;
  231. compat_uptr_t _upper;
  232. } _addr_bnd;
  233. /* used when si_code=SEGV_PKUERR */
  234. struct {
  235. char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD];
  236. u32 _pkey;
  237. } _addr_pkey;
  238. };
  239. } _sigfault;
  240. /* SIGPOLL */
  241. struct {
  242. compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  243. int _fd;
  244. } _sigpoll;
  245. struct {
  246. compat_uptr_t _call_addr; /* calling user insn */
  247. int _syscall; /* triggering system call number */
  248. unsigned int _arch; /* AUDIT_ARCH_* of syscall */
  249. } _sigsys;
  250. } _sifields;
  251. } compat_siginfo_t;
  252. /*
  253. * These functions operate on 32- or 64-bit specs depending on
  254. * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments.
  255. */
  256. extern int compat_get_timespec(struct timespec *, const void __user *);
  257. extern int compat_put_timespec(const struct timespec *, void __user *);
  258. extern int compat_get_timeval(struct timeval *, const void __user *);
  259. extern int compat_put_timeval(const struct timeval *, void __user *);
  260. struct compat_iovec {
  261. compat_uptr_t iov_base;
  262. compat_size_t iov_len;
  263. };
  264. struct compat_rlimit {
  265. compat_ulong_t rlim_cur;
  266. compat_ulong_t rlim_max;
  267. };
  268. struct compat_rusage {
  269. struct old_timeval32 ru_utime;
  270. struct old_timeval32 ru_stime;
  271. compat_long_t ru_maxrss;
  272. compat_long_t ru_ixrss;
  273. compat_long_t ru_idrss;
  274. compat_long_t ru_isrss;
  275. compat_long_t ru_minflt;
  276. compat_long_t ru_majflt;
  277. compat_long_t ru_nswap;
  278. compat_long_t ru_inblock;
  279. compat_long_t ru_oublock;
  280. compat_long_t ru_msgsnd;
  281. compat_long_t ru_msgrcv;
  282. compat_long_t ru_nsignals;
  283. compat_long_t ru_nvcsw;
  284. compat_long_t ru_nivcsw;
  285. };
  286. extern int put_compat_rusage(const struct rusage *,
  287. struct compat_rusage __user *);
  288. struct compat_siginfo;
  289. struct __compat_aio_sigset;
  290. struct compat_dirent {
  291. u32 d_ino;
  292. compat_off_t d_off;
  293. u16 d_reclen;
  294. char d_name[256];
  295. };
  296. struct compat_ustat {
  297. compat_daddr_t f_tfree;
  298. compat_ino_t f_tinode;
  299. char f_fname[6];
  300. char f_fpack[6];
  301. };
  302. #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
  303. typedef struct compat_sigevent {
  304. compat_sigval_t sigev_value;
  305. compat_int_t sigev_signo;
  306. compat_int_t sigev_notify;
  307. union {
  308. compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
  309. compat_int_t _tid;
  310. struct {
  311. compat_uptr_t _function;
  312. compat_uptr_t _attribute;
  313. } _sigev_thread;
  314. } _sigev_un;
  315. } compat_sigevent_t;
  316. struct compat_ifmap {
  317. compat_ulong_t mem_start;
  318. compat_ulong_t mem_end;
  319. unsigned short base_addr;
  320. unsigned char irq;
  321. unsigned char dma;
  322. unsigned char port;
  323. };
  324. struct compat_if_settings {
  325. unsigned int type; /* Type of physical device or protocol */
  326. unsigned int size; /* Size of the data allocated by the caller */
  327. compat_uptr_t ifs_ifsu; /* union of pointers */
  328. };
  329. struct compat_ifreq {
  330. union {
  331. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
  332. } ifr_ifrn;
  333. union {
  334. struct sockaddr ifru_addr;
  335. struct sockaddr ifru_dstaddr;
  336. struct sockaddr ifru_broadaddr;
  337. struct sockaddr ifru_netmask;
  338. struct sockaddr ifru_hwaddr;
  339. short ifru_flags;
  340. compat_int_t ifru_ivalue;
  341. compat_int_t ifru_mtu;
  342. struct compat_ifmap ifru_map;
  343. char ifru_slave[IFNAMSIZ]; /* Just fits the size */
  344. char ifru_newname[IFNAMSIZ];
  345. compat_caddr_t ifru_data;
  346. struct compat_if_settings ifru_settings;
  347. } ifr_ifru;
  348. };
  349. struct compat_ifconf {
  350. compat_int_t ifc_len; /* size of buffer */
  351. compat_caddr_t ifcbuf;
  352. };
  353. struct compat_robust_list {
  354. compat_uptr_t next;
  355. };
  356. struct compat_robust_list_head {
  357. struct compat_robust_list list;
  358. compat_long_t futex_offset;
  359. compat_uptr_t list_op_pending;
  360. };
  361. #ifdef CONFIG_COMPAT_OLD_SIGACTION
  362. struct compat_old_sigaction {
  363. compat_uptr_t sa_handler;
  364. compat_old_sigset_t sa_mask;
  365. compat_ulong_t sa_flags;
  366. compat_uptr_t sa_restorer;
  367. };
  368. #endif
  369. struct compat_keyctl_kdf_params {
  370. compat_uptr_t hashname;
  371. compat_uptr_t otherinfo;
  372. __u32 otherinfolen;
  373. __u32 __spare[8];
  374. };
  375. struct compat_statfs;
  376. struct compat_statfs64;
  377. struct compat_old_linux_dirent;
  378. struct compat_linux_dirent;
  379. struct linux_dirent64;
  380. struct compat_msghdr;
  381. struct compat_mmsghdr;
  382. struct compat_sysinfo;
  383. struct compat_sysctl_args;
  384. struct compat_kexec_segment;
  385. struct compat_mq_attr;
  386. struct compat_msgbuf;
  387. extern void compat_exit_robust_list(struct task_struct *curr);
  388. #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
  389. #define BITS_TO_COMPAT_LONGS(bits) DIV_ROUND_UP(bits, BITS_PER_COMPAT_LONG)
  390. long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
  391. unsigned long bitmap_size);
  392. long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
  393. unsigned long bitmap_size);
  394. int copy_siginfo_from_user32(siginfo_t *to, const struct compat_siginfo __user *from);
  395. int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from);
  396. int get_compat_sigevent(struct sigevent *event,
  397. const struct compat_sigevent __user *u_event);
  398. static inline int old_timeval32_compare(struct old_timeval32 *lhs,
  399. struct old_timeval32 *rhs)
  400. {
  401. if (lhs->tv_sec < rhs->tv_sec)
  402. return -1;
  403. if (lhs->tv_sec > rhs->tv_sec)
  404. return 1;
  405. return lhs->tv_usec - rhs->tv_usec;
  406. }
  407. static inline int old_timespec32_compare(struct old_timespec32 *lhs,
  408. struct old_timespec32 *rhs)
  409. {
  410. if (lhs->tv_sec < rhs->tv_sec)
  411. return -1;
  412. if (lhs->tv_sec > rhs->tv_sec)
  413. return 1;
  414. return lhs->tv_nsec - rhs->tv_nsec;
  415. }
  416. extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat);
  417. /*
  418. * Defined inline such that size can be compile time constant, which avoids
  419. * CONFIG_HARDENED_USERCOPY complaining about copies from task_struct
  420. */
  421. static inline int
  422. put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
  423. unsigned int size)
  424. {
  425. /* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */
  426. #ifdef __BIG_ENDIAN
  427. compat_sigset_t v;
  428. switch (_NSIG_WORDS) {
  429. case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
  430. case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
  431. case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
  432. case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
  433. }
  434. return copy_to_user(compat, &v, size) ? -EFAULT : 0;
  435. #else
  436. return copy_to_user(compat, set, size) ? -EFAULT : 0;
  437. #endif
  438. }
  439. extern int compat_ptrace_request(struct task_struct *child,
  440. compat_long_t request,
  441. compat_ulong_t addr, compat_ulong_t data);
  442. extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
  443. compat_ulong_t addr, compat_ulong_t data);
  444. struct epoll_event; /* fortunately, this one is fixed-layout */
  445. extern ssize_t compat_rw_copy_check_uvector(int type,
  446. const struct compat_iovec __user *uvector,
  447. unsigned long nr_segs,
  448. unsigned long fast_segs, struct iovec *fast_pointer,
  449. struct iovec **ret_pointer);
  450. extern void __user *compat_alloc_user_space(unsigned long len);
  451. int compat_restore_altstack(const compat_stack_t __user *uss);
  452. int __compat_save_altstack(compat_stack_t __user *, unsigned long);
  453. #define compat_save_altstack_ex(uss, sp) do { \
  454. compat_stack_t __user *__uss = uss; \
  455. struct task_struct *t = current; \
  456. put_user_ex(ptr_to_compat((void __user *)t->sas_ss_sp), &__uss->ss_sp); \
  457. put_user_ex(t->sas_ss_flags, &__uss->ss_flags); \
  458. put_user_ex(t->sas_ss_size, &__uss->ss_size); \
  459. if (t->sas_ss_flags & SS_AUTODISARM) \
  460. sas_ss_reset(t); \
  461. } while (0);
  462. /*
  463. * These syscall function prototypes are kept in the same order as
  464. * include/uapi/asm-generic/unistd.h. Deprecated or obsolete system calls
  465. * go below.
  466. *
  467. * Please note that these prototypes here are only provided for information
  468. * purposes, for static analysis, and for linking from the syscall table.
  469. * These functions should not be called elsewhere from kernel code.
  470. *
  471. * As the syscall calling convention may be different from the default
  472. * for architectures overriding the syscall calling convention, do not
  473. * include the prototypes if CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  474. */
  475. #ifndef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  476. asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p);
  477. asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr,
  478. u32 __user *iocb);
  479. asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id,
  480. compat_long_t min_nr,
  481. compat_long_t nr,
  482. struct io_event __user *events,
  483. struct old_timespec32 __user *timeout);
  484. asmlinkage long compat_sys_io_pgetevents(compat_aio_context_t ctx_id,
  485. compat_long_t min_nr,
  486. compat_long_t nr,
  487. struct io_event __user *events,
  488. struct old_timespec32 __user *timeout,
  489. const struct __compat_aio_sigset __user *usig);
  490. /* fs/cookies.c */
  491. asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
  492. /* fs/eventpoll.c */
  493. asmlinkage long compat_sys_epoll_pwait(int epfd,
  494. struct epoll_event __user *events,
  495. int maxevents, int timeout,
  496. const compat_sigset_t __user *sigmask,
  497. compat_size_t sigsetsize);
  498. /* fs/fcntl.c */
  499. asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
  500. compat_ulong_t arg);
  501. asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
  502. compat_ulong_t arg);
  503. /* fs/ioctl.c */
  504. asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
  505. compat_ulong_t arg);
  506. /* fs/namespace.c */
  507. asmlinkage long compat_sys_mount(const char __user *dev_name,
  508. const char __user *dir_name,
  509. const char __user *type, compat_ulong_t flags,
  510. const void __user *data);
  511. /* fs/open.c */
  512. asmlinkage long compat_sys_statfs(const char __user *pathname,
  513. struct compat_statfs __user *buf);
  514. asmlinkage long compat_sys_statfs64(const char __user *pathname,
  515. compat_size_t sz,
  516. struct compat_statfs64 __user *buf);
  517. asmlinkage long compat_sys_fstatfs(unsigned int fd,
  518. struct compat_statfs __user *buf);
  519. asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
  520. struct compat_statfs64 __user *buf);
  521. asmlinkage long compat_sys_truncate(const char __user *, compat_off_t);
  522. asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t);
  523. /* No generic prototype for truncate64, ftruncate64, fallocate */
  524. asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
  525. int flags, umode_t mode);
  526. /* fs/readdir.c */
  527. asmlinkage long compat_sys_getdents(unsigned int fd,
  528. struct compat_linux_dirent __user *dirent,
  529. unsigned int count);
  530. /* fs/read_write.c */
  531. asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int);
  532. asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
  533. const struct compat_iovec __user *vec, compat_ulong_t vlen);
  534. asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
  535. const struct compat_iovec __user *vec, compat_ulong_t vlen);
  536. /* No generic prototype for pread64 and pwrite64 */
  537. asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
  538. const struct compat_iovec __user *vec,
  539. compat_ulong_t vlen, u32 pos_low, u32 pos_high);
  540. asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
  541. const struct compat_iovec __user *vec,
  542. compat_ulong_t vlen, u32 pos_low, u32 pos_high);
  543. #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64
  544. asmlinkage long compat_sys_preadv64(unsigned long fd,
  545. const struct compat_iovec __user *vec,
  546. unsigned long vlen, loff_t pos);
  547. #endif
  548. #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64
  549. asmlinkage long compat_sys_pwritev64(unsigned long fd,
  550. const struct compat_iovec __user *vec,
  551. unsigned long vlen, loff_t pos);
  552. #endif
  553. /* fs/sendfile.c */
  554. asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
  555. compat_off_t __user *offset, compat_size_t count);
  556. asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
  557. compat_loff_t __user *offset, compat_size_t count);
  558. /* fs/select.c */
  559. asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
  560. compat_ulong_t __user *outp,
  561. compat_ulong_t __user *exp,
  562. struct old_timespec32 __user *tsp,
  563. void __user *sig);
  564. asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
  565. unsigned int nfds,
  566. struct old_timespec32 __user *tsp,
  567. const compat_sigset_t __user *sigmask,
  568. compat_size_t sigsetsize);
  569. /* fs/signalfd.c */
  570. asmlinkage long compat_sys_signalfd4(int ufd,
  571. const compat_sigset_t __user *sigmask,
  572. compat_size_t sigsetsize, int flags);
  573. /* fs/splice.c */
  574. asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
  575. unsigned int nr_segs, unsigned int flags);
  576. /* fs/stat.c */
  577. asmlinkage long compat_sys_newfstatat(unsigned int dfd,
  578. const char __user *filename,
  579. struct compat_stat __user *statbuf,
  580. int flag);
  581. asmlinkage long compat_sys_newfstat(unsigned int fd,
  582. struct compat_stat __user *statbuf);
  583. /* fs/sync.c: No generic prototype for sync_file_range and sync_file_range2 */
  584. /* fs/timerfd.c */
  585. asmlinkage long compat_sys_timerfd_gettime(int ufd,
  586. struct old_itimerspec32 __user *otmr);
  587. asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
  588. const struct old_itimerspec32 __user *utmr,
  589. struct old_itimerspec32 __user *otmr);
  590. /* fs/utimes.c */
  591. asmlinkage long compat_sys_utimensat(unsigned int dfd,
  592. const char __user *filename,
  593. struct old_timespec32 __user *t,
  594. int flags);
  595. /* kernel/exit.c */
  596. asmlinkage long compat_sys_waitid(int, compat_pid_t,
  597. struct compat_siginfo __user *, int,
  598. struct compat_rusage __user *);
  599. /* kernel/futex.c */
  600. asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
  601. struct old_timespec32 __user *utime, u32 __user *uaddr2,
  602. u32 val3);
  603. asmlinkage long
  604. compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
  605. compat_size_t len);
  606. asmlinkage long
  607. compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
  608. compat_size_t __user *len_ptr);
  609. /* kernel/hrtimer.c */
  610. asmlinkage long compat_sys_nanosleep(struct old_timespec32 __user *rqtp,
  611. struct old_timespec32 __user *rmtp);
  612. /* kernel/itimer.c */
  613. asmlinkage long compat_sys_getitimer(int which,
  614. struct compat_itimerval __user *it);
  615. asmlinkage long compat_sys_setitimer(int which,
  616. struct compat_itimerval __user *in,
  617. struct compat_itimerval __user *out);
  618. /* kernel/kexec.c */
  619. asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
  620. compat_ulong_t nr_segments,
  621. struct compat_kexec_segment __user *,
  622. compat_ulong_t flags);
  623. /* kernel/posix-timers.c */
  624. asmlinkage long compat_sys_timer_create(clockid_t which_clock,
  625. struct compat_sigevent __user *timer_event_spec,
  626. timer_t __user *created_timer_id);
  627. asmlinkage long compat_sys_timer_gettime(timer_t timer_id,
  628. struct old_itimerspec32 __user *setting);
  629. asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags,
  630. struct old_itimerspec32 __user *new,
  631. struct old_itimerspec32 __user *old);
  632. asmlinkage long compat_sys_clock_settime(clockid_t which_clock,
  633. struct old_timespec32 __user *tp);
  634. asmlinkage long compat_sys_clock_gettime(clockid_t which_clock,
  635. struct old_timespec32 __user *tp);
  636. asmlinkage long compat_sys_clock_getres(clockid_t which_clock,
  637. struct old_timespec32 __user *tp);
  638. asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
  639. struct old_timespec32 __user *rqtp,
  640. struct old_timespec32 __user *rmtp);
  641. /* kernel/ptrace.c */
  642. asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
  643. compat_long_t addr, compat_long_t data);
  644. /* kernel/sched/core.c */
  645. asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
  646. unsigned int len,
  647. compat_ulong_t __user *user_mask_ptr);
  648. asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
  649. unsigned int len,
  650. compat_ulong_t __user *user_mask_ptr);
  651. asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
  652. struct old_timespec32 __user *interval);
  653. /* kernel/signal.c */
  654. asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
  655. compat_stack_t __user *uoss_ptr);
  656. asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
  657. compat_size_t sigsetsize);
  658. #ifndef CONFIG_ODD_RT_SIGACTION
  659. asmlinkage long compat_sys_rt_sigaction(int,
  660. const struct compat_sigaction __user *,
  661. struct compat_sigaction __user *,
  662. compat_size_t);
  663. #endif
  664. asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set,
  665. compat_sigset_t __user *oset,
  666. compat_size_t sigsetsize);
  667. asmlinkage long compat_sys_rt_sigpending(compat_sigset_t __user *uset,
  668. compat_size_t sigsetsize);
  669. asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese,
  670. struct compat_siginfo __user *uinfo,
  671. struct old_timespec32 __user *uts, compat_size_t sigsetsize);
  672. asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig,
  673. struct compat_siginfo __user *uinfo);
  674. /* No generic prototype for rt_sigreturn */
  675. /* kernel/sys.c */
  676. asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
  677. asmlinkage long compat_sys_getrlimit(unsigned int resource,
  678. struct compat_rlimit __user *rlim);
  679. asmlinkage long compat_sys_setrlimit(unsigned int resource,
  680. struct compat_rlimit __user *rlim);
  681. asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
  682. /* kernel/time.c */
  683. asmlinkage long compat_sys_gettimeofday(struct old_timeval32 __user *tv,
  684. struct timezone __user *tz);
  685. asmlinkage long compat_sys_settimeofday(struct old_timeval32 __user *tv,
  686. struct timezone __user *tz);
  687. asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
  688. /* kernel/timer.c */
  689. asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
  690. /* ipc/mqueue.c */
  691. asmlinkage long compat_sys_mq_open(const char __user *u_name,
  692. int oflag, compat_mode_t mode,
  693. struct compat_mq_attr __user *u_attr);
  694. asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
  695. const char __user *u_msg_ptr,
  696. compat_size_t msg_len, unsigned int msg_prio,
  697. const struct old_timespec32 __user *u_abs_timeout);
  698. asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
  699. char __user *u_msg_ptr,
  700. compat_size_t msg_len, unsigned int __user *u_msg_prio,
  701. const struct old_timespec32 __user *u_abs_timeout);
  702. asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
  703. const struct compat_sigevent __user *u_notification);
  704. asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
  705. const struct compat_mq_attr __user *u_mqstat,
  706. struct compat_mq_attr __user *u_omqstat);
  707. /* ipc/msg.c */
  708. asmlinkage long compat_sys_msgctl(int first, int second, void __user *uptr);
  709. asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp,
  710. compat_ssize_t msgsz, compat_long_t msgtyp, int msgflg);
  711. asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp,
  712. compat_ssize_t msgsz, int msgflg);
  713. /* ipc/sem.c */
  714. asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
  715. asmlinkage long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
  716. unsigned nsems, const struct old_timespec32 __user *timeout);
  717. /* ipc/shm.c */
  718. asmlinkage long compat_sys_shmctl(int first, int second, void __user *uptr);
  719. asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
  720. /* net/socket.c */
  721. asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, compat_size_t len,
  722. unsigned flags, struct sockaddr __user *addr,
  723. int __user *addrlen);
  724. asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
  725. char __user *optval, unsigned int optlen);
  726. asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
  727. char __user *optval, int __user *optlen);
  728. asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
  729. unsigned flags);
  730. asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
  731. unsigned int flags);
  732. /* mm/filemap.c: No generic prototype for readahead */
  733. /* security/keys/keyctl.c */
  734. asmlinkage long compat_sys_keyctl(u32 option,
  735. u32 arg2, u32 arg3, u32 arg4, u32 arg5);
  736. /* arch/example/kernel/sys_example.c */
  737. asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
  738. const compat_uptr_t __user *envp);
  739. /* mm/fadvise.c: No generic prototype for fadvise64_64 */
  740. /* mm/, CONFIG_MMU only */
  741. asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
  742. compat_ulong_t mode,
  743. compat_ulong_t __user *nmask,
  744. compat_ulong_t maxnode, compat_ulong_t flags);
  745. asmlinkage long compat_sys_get_mempolicy(int __user *policy,
  746. compat_ulong_t __user *nmask,
  747. compat_ulong_t maxnode,
  748. compat_ulong_t addr,
  749. compat_ulong_t flags);
  750. asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
  751. compat_ulong_t maxnode);
  752. asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
  753. compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
  754. const compat_ulong_t __user *new_nodes);
  755. asmlinkage long compat_sys_move_pages(pid_t pid, compat_ulong_t nr_pages,
  756. __u32 __user *pages,
  757. const int __user *nodes,
  758. int __user *status,
  759. int flags);
  760. asmlinkage long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid,
  761. compat_pid_t pid, int sig,
  762. struct compat_siginfo __user *uinfo);
  763. asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  764. unsigned vlen, unsigned int flags,
  765. struct old_timespec32 __user *timeout);
  766. asmlinkage long compat_sys_wait4(compat_pid_t pid,
  767. compat_uint_t __user *stat_addr, int options,
  768. struct compat_rusage __user *ru);
  769. asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
  770. int, const char __user *);
  771. asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
  772. struct file_handle __user *handle,
  773. int flags);
  774. asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock,
  775. struct compat_timex __user *tp);
  776. asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  777. unsigned vlen, unsigned int flags);
  778. asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
  779. const struct compat_iovec __user *lvec,
  780. compat_ulong_t liovcnt, const struct compat_iovec __user *rvec,
  781. compat_ulong_t riovcnt, compat_ulong_t flags);
  782. asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
  783. const struct compat_iovec __user *lvec,
  784. compat_ulong_t liovcnt, const struct compat_iovec __user *rvec,
  785. compat_ulong_t riovcnt, compat_ulong_t flags);
  786. asmlinkage long compat_sys_execveat(int dfd, const char __user *filename,
  787. const compat_uptr_t __user *argv,
  788. const compat_uptr_t __user *envp, int flags);
  789. asmlinkage ssize_t compat_sys_preadv2(compat_ulong_t fd,
  790. const struct compat_iovec __user *vec,
  791. compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags);
  792. asmlinkage ssize_t compat_sys_pwritev2(compat_ulong_t fd,
  793. const struct compat_iovec __user *vec,
  794. compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags);
  795. #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64V2
  796. asmlinkage long compat_sys_readv64v2(unsigned long fd,
  797. const struct compat_iovec __user *vec,
  798. unsigned long vlen, loff_t pos, rwf_t flags);
  799. #endif
  800. #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64V2
  801. asmlinkage long compat_sys_pwritev64v2(unsigned long fd,
  802. const struct compat_iovec __user *vec,
  803. unsigned long vlen, loff_t pos, rwf_t flags);
  804. #endif
  805. /*
  806. * Deprecated system calls which are still defined in
  807. * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
  808. */
  809. /* __ARCH_WANT_SYSCALL_NO_AT */
  810. asmlinkage long compat_sys_open(const char __user *filename, int flags,
  811. umode_t mode);
  812. asmlinkage long compat_sys_utimes(const char __user *filename,
  813. struct old_timeval32 __user *t);
  814. /* __ARCH_WANT_SYSCALL_NO_FLAGS */
  815. asmlinkage long compat_sys_signalfd(int ufd,
  816. const compat_sigset_t __user *sigmask,
  817. compat_size_t sigsetsize);
  818. /* __ARCH_WANT_SYSCALL_OFF_T */
  819. asmlinkage long compat_sys_newstat(const char __user *filename,
  820. struct compat_stat __user *statbuf);
  821. asmlinkage long compat_sys_newlstat(const char __user *filename,
  822. struct compat_stat __user *statbuf);
  823. /* __ARCH_WANT_SYSCALL_DEPRECATED */
  824. asmlinkage long compat_sys_time(old_time32_t __user *tloc);
  825. asmlinkage long compat_sys_utime(const char __user *filename,
  826. struct compat_utimbuf __user *t);
  827. asmlinkage long compat_sys_futimesat(unsigned int dfd,
  828. const char __user *filename,
  829. struct old_timeval32 __user *t);
  830. asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
  831. compat_ulong_t __user *outp, compat_ulong_t __user *exp,
  832. struct old_timeval32 __user *tvp);
  833. asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
  834. asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len,
  835. unsigned flags);
  836. asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
  837. /* obsolete: fs/readdir.c */
  838. asmlinkage long compat_sys_old_readdir(unsigned int fd,
  839. struct compat_old_linux_dirent __user *,
  840. unsigned int count);
  841. /* obsolete: fs/select.c */
  842. asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
  843. /* obsolete: ipc */
  844. asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
  845. /* obsolete: kernel/signal.c */
  846. #ifdef __ARCH_WANT_SYS_SIGPENDING
  847. asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set);
  848. #endif
  849. #ifdef __ARCH_WANT_SYS_SIGPROCMASK
  850. asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *nset,
  851. compat_old_sigset_t __user *oset);
  852. #endif
  853. #ifdef CONFIG_COMPAT_OLD_SIGACTION
  854. asmlinkage long compat_sys_sigaction(int sig,
  855. const struct compat_old_sigaction __user *act,
  856. struct compat_old_sigaction __user *oact);
  857. #endif
  858. /* obsolete: kernel/time/time.c */
  859. asmlinkage long compat_sys_stime(old_time32_t __user *tptr);
  860. /* obsolete: net/socket.c */
  861. asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
  862. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  863. /*
  864. * For most but not all architectures, "am I in a compat syscall?" and
  865. * "am I a compat task?" are the same question. For architectures on which
  866. * they aren't the same question, arch code can override in_compat_syscall.
  867. */
  868. #ifndef in_compat_syscall
  869. static inline bool in_compat_syscall(void) { return is_compat_task(); }
  870. #endif
  871. /**
  872. * ns_to_old_timeval32 - Compat version of ns_to_timeval
  873. * @nsec: the nanoseconds value to be converted
  874. *
  875. * Returns the old_timeval32 representation of the nsec parameter.
  876. */
  877. static inline struct old_timeval32 ns_to_old_timeval32(s64 nsec)
  878. {
  879. struct timeval tv;
  880. struct old_timeval32 ctv;
  881. tv = ns_to_timeval(nsec);
  882. ctv.tv_sec = tv.tv_sec;
  883. ctv.tv_usec = tv.tv_usec;
  884. return ctv;
  885. }
  886. /*
  887. * Kernel code should not call compat syscalls (i.e., compat_sys_xyzyyz())
  888. * directly. Instead, use one of the functions which work equivalently, such
  889. * as the kcompat_sys_xyzyyz() functions prototyped below.
  890. */
  891. int kcompat_sys_statfs64(const char __user * pathname, compat_size_t sz,
  892. struct compat_statfs64 __user * buf);
  893. int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
  894. struct compat_statfs64 __user * buf);
  895. #else /* !CONFIG_COMPAT */
  896. #define is_compat_task() (0)
  897. #ifndef in_compat_syscall
  898. static inline bool in_compat_syscall(void) { return false; }
  899. #endif
  900. #endif /* CONFIG_COMPAT */
  901. #endif /* _LINUX_COMPAT_H */