compat.h 34 KB

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