ptrace.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1992 Ross Biro
  7. * Copyright (C) Linus Torvalds
  8. * Copyright (C) 1994, 95, 96, 97, 98, 2000 Ralf Baechle
  9. * Copyright (C) 1996 David S. Miller
  10. * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  11. * Copyright (C) 1999 MIPS Technologies, Inc.
  12. * Copyright (C) 2000 Ulf Carlsson
  13. *
  14. * At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
  15. * binaries.
  16. */
  17. #include <linux/compiler.h>
  18. #include <linux/context_tracking.h>
  19. #include <linux/elf.h>
  20. #include <linux/kernel.h>
  21. #include <linux/sched.h>
  22. #include <linux/mm.h>
  23. #include <linux/errno.h>
  24. #include <linux/ptrace.h>
  25. #include <linux/regset.h>
  26. #include <linux/smp.h>
  27. #include <linux/user.h>
  28. #include <linux/security.h>
  29. #include <linux/tracehook.h>
  30. #include <linux/audit.h>
  31. #include <linux/seccomp.h>
  32. #include <linux/ftrace.h>
  33. #include <asm/byteorder.h>
  34. #include <asm/cpu.h>
  35. #include <asm/dsp.h>
  36. #include <asm/fpu.h>
  37. #include <asm/mipsregs.h>
  38. #include <asm/mipsmtregs.h>
  39. #include <asm/pgtable.h>
  40. #include <asm/page.h>
  41. #include <asm/syscall.h>
  42. #include <asm/uaccess.h>
  43. #include <asm/bootinfo.h>
  44. #include <asm/reg.h>
  45. #define CREATE_TRACE_POINTS
  46. #include <trace/events/syscalls.h>
  47. /*
  48. * Called by kernel/ptrace.c when detaching..
  49. *
  50. * Make sure single step bits etc are not set.
  51. */
  52. void ptrace_disable(struct task_struct *child)
  53. {
  54. /* Don't load the watchpoint registers for the ex-child. */
  55. clear_tsk_thread_flag(child, TIF_LOAD_WATCH);
  56. }
  57. /*
  58. * Read a general register set. We always use the 64-bit format, even
  59. * for 32-bit kernels and for 32-bit processes on a 64-bit kernel.
  60. * Registers are sign extended to fill the available space.
  61. */
  62. int ptrace_getregs(struct task_struct *child, __s64 __user *data)
  63. {
  64. struct pt_regs *regs;
  65. int i;
  66. if (!access_ok(VERIFY_WRITE, data, 38 * 8))
  67. return -EIO;
  68. regs = task_pt_regs(child);
  69. for (i = 0; i < 32; i++)
  70. __put_user((long)regs->regs[i], data + i);
  71. __put_user((long)regs->lo, data + EF_LO - EF_R0);
  72. __put_user((long)regs->hi, data + EF_HI - EF_R0);
  73. __put_user((long)regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
  74. __put_user((long)regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
  75. __put_user((long)regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
  76. __put_user((long)regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
  77. return 0;
  78. }
  79. /*
  80. * Write a general register set. As for PTRACE_GETREGS, we always use
  81. * the 64-bit format. On a 32-bit kernel only the lower order half
  82. * (according to endianness) will be used.
  83. */
  84. int ptrace_setregs(struct task_struct *child, __s64 __user *data)
  85. {
  86. struct pt_regs *regs;
  87. int i;
  88. if (!access_ok(VERIFY_READ, data, 38 * 8))
  89. return -EIO;
  90. regs = task_pt_regs(child);
  91. for (i = 0; i < 32; i++)
  92. __get_user(regs->regs[i], data + i);
  93. __get_user(regs->lo, data + EF_LO - EF_R0);
  94. __get_user(regs->hi, data + EF_HI - EF_R0);
  95. __get_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
  96. /* badvaddr, status, and cause may not be written. */
  97. return 0;
  98. }
  99. int ptrace_getfpregs(struct task_struct *child, __u32 __user *data)
  100. {
  101. int i;
  102. if (!access_ok(VERIFY_WRITE, data, 33 * 8))
  103. return -EIO;
  104. if (tsk_used_math(child)) {
  105. union fpureg *fregs = get_fpu_regs(child);
  106. for (i = 0; i < 32; i++)
  107. __put_user(get_fpr64(&fregs[i], 0),
  108. i + (__u64 __user *)data);
  109. } else {
  110. for (i = 0; i < 32; i++)
  111. __put_user((__u64) -1, i + (__u64 __user *) data);
  112. }
  113. __put_user(child->thread.fpu.fcr31, data + 64);
  114. __put_user(current_cpu_data.fpu_id, data + 65);
  115. return 0;
  116. }
  117. int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
  118. {
  119. union fpureg *fregs;
  120. u64 fpr_val;
  121. int i;
  122. if (!access_ok(VERIFY_READ, data, 33 * 8))
  123. return -EIO;
  124. fregs = get_fpu_regs(child);
  125. for (i = 0; i < 32; i++) {
  126. __get_user(fpr_val, i + (__u64 __user *)data);
  127. set_fpr64(&fregs[i], 0, fpr_val);
  128. }
  129. __get_user(child->thread.fpu.fcr31, data + 64);
  130. /* FIR may not be written. */
  131. return 0;
  132. }
  133. int ptrace_get_watch_regs(struct task_struct *child,
  134. struct pt_watch_regs __user *addr)
  135. {
  136. enum pt_watch_style style;
  137. int i;
  138. if (!cpu_has_watch || boot_cpu_data.watch_reg_use_cnt == 0)
  139. return -EIO;
  140. if (!access_ok(VERIFY_WRITE, addr, sizeof(struct pt_watch_regs)))
  141. return -EIO;
  142. #ifdef CONFIG_32BIT
  143. style = pt_watch_style_mips32;
  144. #define WATCH_STYLE mips32
  145. #else
  146. style = pt_watch_style_mips64;
  147. #define WATCH_STYLE mips64
  148. #endif
  149. __put_user(style, &addr->style);
  150. __put_user(boot_cpu_data.watch_reg_use_cnt,
  151. &addr->WATCH_STYLE.num_valid);
  152. for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) {
  153. __put_user(child->thread.watch.mips3264.watchlo[i],
  154. &addr->WATCH_STYLE.watchlo[i]);
  155. __put_user(child->thread.watch.mips3264.watchhi[i] & 0xfff,
  156. &addr->WATCH_STYLE.watchhi[i]);
  157. __put_user(boot_cpu_data.watch_reg_masks[i],
  158. &addr->WATCH_STYLE.watch_masks[i]);
  159. }
  160. for (; i < 8; i++) {
  161. __put_user(0, &addr->WATCH_STYLE.watchlo[i]);
  162. __put_user(0, &addr->WATCH_STYLE.watchhi[i]);
  163. __put_user(0, &addr->WATCH_STYLE.watch_masks[i]);
  164. }
  165. return 0;
  166. }
  167. int ptrace_set_watch_regs(struct task_struct *child,
  168. struct pt_watch_regs __user *addr)
  169. {
  170. int i;
  171. int watch_active = 0;
  172. unsigned long lt[NUM_WATCH_REGS];
  173. u16 ht[NUM_WATCH_REGS];
  174. if (!cpu_has_watch || boot_cpu_data.watch_reg_use_cnt == 0)
  175. return -EIO;
  176. if (!access_ok(VERIFY_READ, addr, sizeof(struct pt_watch_regs)))
  177. return -EIO;
  178. /* Check the values. */
  179. for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) {
  180. __get_user(lt[i], &addr->WATCH_STYLE.watchlo[i]);
  181. #ifdef CONFIG_32BIT
  182. if (lt[i] & __UA_LIMIT)
  183. return -EINVAL;
  184. #else
  185. if (test_tsk_thread_flag(child, TIF_32BIT_ADDR)) {
  186. if (lt[i] & 0xffffffff80000000UL)
  187. return -EINVAL;
  188. } else {
  189. if (lt[i] & __UA_LIMIT)
  190. return -EINVAL;
  191. }
  192. #endif
  193. __get_user(ht[i], &addr->WATCH_STYLE.watchhi[i]);
  194. if (ht[i] & ~0xff8)
  195. return -EINVAL;
  196. }
  197. /* Install them. */
  198. for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) {
  199. if (lt[i] & 7)
  200. watch_active = 1;
  201. child->thread.watch.mips3264.watchlo[i] = lt[i];
  202. /* Set the G bit. */
  203. child->thread.watch.mips3264.watchhi[i] = ht[i];
  204. }
  205. if (watch_active)
  206. set_tsk_thread_flag(child, TIF_LOAD_WATCH);
  207. else
  208. clear_tsk_thread_flag(child, TIF_LOAD_WATCH);
  209. return 0;
  210. }
  211. /* regset get/set implementations */
  212. static int gpr_get(struct task_struct *target,
  213. const struct user_regset *regset,
  214. unsigned int pos, unsigned int count,
  215. void *kbuf, void __user *ubuf)
  216. {
  217. struct pt_regs *regs = task_pt_regs(target);
  218. return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
  219. regs, 0, sizeof(*regs));
  220. }
  221. static int gpr_set(struct task_struct *target,
  222. const struct user_regset *regset,
  223. unsigned int pos, unsigned int count,
  224. const void *kbuf, const void __user *ubuf)
  225. {
  226. struct pt_regs newregs;
  227. int ret;
  228. ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
  229. &newregs,
  230. 0, sizeof(newregs));
  231. if (ret)
  232. return ret;
  233. *task_pt_regs(target) = newregs;
  234. return 0;
  235. }
  236. static int fpr_get(struct task_struct *target,
  237. const struct user_regset *regset,
  238. unsigned int pos, unsigned int count,
  239. void *kbuf, void __user *ubuf)
  240. {
  241. unsigned i;
  242. int err;
  243. u64 fpr_val;
  244. /* XXX fcr31 */
  245. if (sizeof(target->thread.fpu.fpr[i]) == sizeof(elf_fpreg_t))
  246. return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
  247. &target->thread.fpu,
  248. 0, sizeof(elf_fpregset_t));
  249. for (i = 0; i < NUM_FPU_REGS; i++) {
  250. fpr_val = get_fpr64(&target->thread.fpu.fpr[i], 0);
  251. err = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
  252. &fpr_val, i * sizeof(elf_fpreg_t),
  253. (i + 1) * sizeof(elf_fpreg_t));
  254. if (err)
  255. return err;
  256. }
  257. return 0;
  258. }
  259. static int fpr_set(struct task_struct *target,
  260. const struct user_regset *regset,
  261. unsigned int pos, unsigned int count,
  262. const void *kbuf, const void __user *ubuf)
  263. {
  264. unsigned i;
  265. int err;
  266. u64 fpr_val;
  267. /* XXX fcr31 */
  268. if (sizeof(target->thread.fpu.fpr[i]) == sizeof(elf_fpreg_t))
  269. return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
  270. &target->thread.fpu,
  271. 0, sizeof(elf_fpregset_t));
  272. for (i = 0; i < NUM_FPU_REGS; i++) {
  273. err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
  274. &fpr_val, i * sizeof(elf_fpreg_t),
  275. (i + 1) * sizeof(elf_fpreg_t));
  276. if (err)
  277. return err;
  278. set_fpr64(&target->thread.fpu.fpr[i], 0, fpr_val);
  279. }
  280. return 0;
  281. }
  282. enum mips_regset {
  283. REGSET_GPR,
  284. REGSET_FPR,
  285. };
  286. static const struct user_regset mips_regsets[] = {
  287. [REGSET_GPR] = {
  288. .core_note_type = NT_PRSTATUS,
  289. .n = ELF_NGREG,
  290. .size = sizeof(unsigned int),
  291. .align = sizeof(unsigned int),
  292. .get = gpr_get,
  293. .set = gpr_set,
  294. },
  295. [REGSET_FPR] = {
  296. .core_note_type = NT_PRFPREG,
  297. .n = ELF_NFPREG,
  298. .size = sizeof(elf_fpreg_t),
  299. .align = sizeof(elf_fpreg_t),
  300. .get = fpr_get,
  301. .set = fpr_set,
  302. },
  303. };
  304. static const struct user_regset_view user_mips_view = {
  305. .name = "mips",
  306. .e_machine = ELF_ARCH,
  307. .ei_osabi = ELF_OSABI,
  308. .regsets = mips_regsets,
  309. .n = ARRAY_SIZE(mips_regsets),
  310. };
  311. static const struct user_regset mips64_regsets[] = {
  312. [REGSET_GPR] = {
  313. .core_note_type = NT_PRSTATUS,
  314. .n = ELF_NGREG,
  315. .size = sizeof(unsigned long),
  316. .align = sizeof(unsigned long),
  317. .get = gpr_get,
  318. .set = gpr_set,
  319. },
  320. [REGSET_FPR] = {
  321. .core_note_type = NT_PRFPREG,
  322. .n = ELF_NFPREG,
  323. .size = sizeof(elf_fpreg_t),
  324. .align = sizeof(elf_fpreg_t),
  325. .get = fpr_get,
  326. .set = fpr_set,
  327. },
  328. };
  329. static const struct user_regset_view user_mips64_view = {
  330. .name = "mips",
  331. .e_machine = ELF_ARCH,
  332. .ei_osabi = ELF_OSABI,
  333. .regsets = mips64_regsets,
  334. .n = ARRAY_SIZE(mips_regsets),
  335. };
  336. const struct user_regset_view *task_user_regset_view(struct task_struct *task)
  337. {
  338. #ifdef CONFIG_32BIT
  339. return &user_mips_view;
  340. #endif
  341. #ifdef CONFIG_MIPS32_O32
  342. if (test_thread_flag(TIF_32BIT_REGS))
  343. return &user_mips_view;
  344. #endif
  345. return &user_mips64_view;
  346. }
  347. long arch_ptrace(struct task_struct *child, long request,
  348. unsigned long addr, unsigned long data)
  349. {
  350. int ret;
  351. void __user *addrp = (void __user *) addr;
  352. void __user *datavp = (void __user *) data;
  353. unsigned long __user *datalp = (void __user *) data;
  354. switch (request) {
  355. /* when I and D space are separate, these will need to be fixed. */
  356. case PTRACE_PEEKTEXT: /* read word at location addr. */
  357. case PTRACE_PEEKDATA:
  358. ret = generic_ptrace_peekdata(child, addr, data);
  359. break;
  360. /* Read the word at location addr in the USER area. */
  361. case PTRACE_PEEKUSR: {
  362. struct pt_regs *regs;
  363. union fpureg *fregs;
  364. unsigned long tmp = 0;
  365. regs = task_pt_regs(child);
  366. ret = 0; /* Default return value. */
  367. switch (addr) {
  368. case 0 ... 31:
  369. tmp = regs->regs[addr];
  370. break;
  371. case FPR_BASE ... FPR_BASE + 31:
  372. if (!tsk_used_math(child)) {
  373. /* FP not yet used */
  374. tmp = -1;
  375. break;
  376. }
  377. fregs = get_fpu_regs(child);
  378. #ifdef CONFIG_32BIT
  379. if (test_thread_flag(TIF_32BIT_FPREGS)) {
  380. /*
  381. * The odd registers are actually the high
  382. * order bits of the values stored in the even
  383. * registers - unless we're using r2k_switch.S.
  384. */
  385. tmp = get_fpr32(&fregs[(addr & ~1) - FPR_BASE],
  386. addr & 1);
  387. break;
  388. }
  389. #endif
  390. tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
  391. break;
  392. case PC:
  393. tmp = regs->cp0_epc;
  394. break;
  395. case CAUSE:
  396. tmp = regs->cp0_cause;
  397. break;
  398. case BADVADDR:
  399. tmp = regs->cp0_badvaddr;
  400. break;
  401. case MMHI:
  402. tmp = regs->hi;
  403. break;
  404. case MMLO:
  405. tmp = regs->lo;
  406. break;
  407. #ifdef CONFIG_CPU_HAS_SMARTMIPS
  408. case ACX:
  409. tmp = regs->acx;
  410. break;
  411. #endif
  412. case FPC_CSR:
  413. tmp = child->thread.fpu.fcr31;
  414. break;
  415. case FPC_EIR:
  416. /* implementation / version register */
  417. tmp = current_cpu_data.fpu_id;
  418. break;
  419. case DSP_BASE ... DSP_BASE + 5: {
  420. dspreg_t *dregs;
  421. if (!cpu_has_dsp) {
  422. tmp = 0;
  423. ret = -EIO;
  424. goto out;
  425. }
  426. dregs = __get_dsp_regs(child);
  427. tmp = (unsigned long) (dregs[addr - DSP_BASE]);
  428. break;
  429. }
  430. case DSP_CONTROL:
  431. if (!cpu_has_dsp) {
  432. tmp = 0;
  433. ret = -EIO;
  434. goto out;
  435. }
  436. tmp = child->thread.dsp.dspcontrol;
  437. break;
  438. default:
  439. tmp = 0;
  440. ret = -EIO;
  441. goto out;
  442. }
  443. ret = put_user(tmp, datalp);
  444. break;
  445. }
  446. /* when I and D space are separate, this will have to be fixed. */
  447. case PTRACE_POKETEXT: /* write the word at location addr. */
  448. case PTRACE_POKEDATA:
  449. ret = generic_ptrace_pokedata(child, addr, data);
  450. break;
  451. case PTRACE_POKEUSR: {
  452. struct pt_regs *regs;
  453. ret = 0;
  454. regs = task_pt_regs(child);
  455. switch (addr) {
  456. case 0 ... 31:
  457. regs->regs[addr] = data;
  458. break;
  459. case FPR_BASE ... FPR_BASE + 31: {
  460. union fpureg *fregs = get_fpu_regs(child);
  461. if (!tsk_used_math(child)) {
  462. /* FP not yet used */
  463. memset(&child->thread.fpu, ~0,
  464. sizeof(child->thread.fpu));
  465. child->thread.fpu.fcr31 = 0;
  466. }
  467. #ifdef CONFIG_32BIT
  468. if (test_thread_flag(TIF_32BIT_FPREGS)) {
  469. /*
  470. * The odd registers are actually the high
  471. * order bits of the values stored in the even
  472. * registers - unless we're using r2k_switch.S.
  473. */
  474. set_fpr32(&fregs[(addr & ~1) - FPR_BASE],
  475. addr & 1, data);
  476. break;
  477. }
  478. #endif
  479. set_fpr64(&fregs[addr - FPR_BASE], 0, data);
  480. break;
  481. }
  482. case PC:
  483. regs->cp0_epc = data;
  484. break;
  485. case MMHI:
  486. regs->hi = data;
  487. break;
  488. case MMLO:
  489. regs->lo = data;
  490. break;
  491. #ifdef CONFIG_CPU_HAS_SMARTMIPS
  492. case ACX:
  493. regs->acx = data;
  494. break;
  495. #endif
  496. case FPC_CSR:
  497. child->thread.fpu.fcr31 = data;
  498. break;
  499. case DSP_BASE ... DSP_BASE + 5: {
  500. dspreg_t *dregs;
  501. if (!cpu_has_dsp) {
  502. ret = -EIO;
  503. break;
  504. }
  505. dregs = __get_dsp_regs(child);
  506. dregs[addr - DSP_BASE] = data;
  507. break;
  508. }
  509. case DSP_CONTROL:
  510. if (!cpu_has_dsp) {
  511. ret = -EIO;
  512. break;
  513. }
  514. child->thread.dsp.dspcontrol = data;
  515. break;
  516. default:
  517. /* The rest are not allowed. */
  518. ret = -EIO;
  519. break;
  520. }
  521. break;
  522. }
  523. case PTRACE_GETREGS:
  524. ret = ptrace_getregs(child, datavp);
  525. break;
  526. case PTRACE_SETREGS:
  527. ret = ptrace_setregs(child, datavp);
  528. break;
  529. case PTRACE_GETFPREGS:
  530. ret = ptrace_getfpregs(child, datavp);
  531. break;
  532. case PTRACE_SETFPREGS:
  533. ret = ptrace_setfpregs(child, datavp);
  534. break;
  535. case PTRACE_GET_THREAD_AREA:
  536. ret = put_user(task_thread_info(child)->tp_value, datalp);
  537. break;
  538. case PTRACE_GET_WATCH_REGS:
  539. ret = ptrace_get_watch_regs(child, addrp);
  540. break;
  541. case PTRACE_SET_WATCH_REGS:
  542. ret = ptrace_set_watch_regs(child, addrp);
  543. break;
  544. default:
  545. ret = ptrace_request(child, request, addr, data);
  546. break;
  547. }
  548. out:
  549. return ret;
  550. }
  551. /*
  552. * Notification of system call entry/exit
  553. * - triggered by current->work.syscall_trace
  554. */
  555. asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
  556. {
  557. long ret = 0;
  558. user_exit();
  559. if (secure_computing(syscall) == -1)
  560. return -1;
  561. if (test_thread_flag(TIF_SYSCALL_TRACE) &&
  562. tracehook_report_syscall_entry(regs))
  563. ret = -1;
  564. if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
  565. trace_sys_enter(regs, regs->regs[2]);
  566. audit_syscall_entry(syscall_get_arch(),
  567. syscall,
  568. regs->regs[4], regs->regs[5],
  569. regs->regs[6], regs->regs[7]);
  570. return syscall;
  571. }
  572. /*
  573. * Notification of system call entry/exit
  574. * - triggered by current->work.syscall_trace
  575. */
  576. asmlinkage void syscall_trace_leave(struct pt_regs *regs)
  577. {
  578. /*
  579. * We may come here right after calling schedule_user()
  580. * or do_notify_resume(), in which case we can be in RCU
  581. * user mode.
  582. */
  583. user_exit();
  584. audit_syscall_exit(regs);
  585. if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
  586. trace_sys_exit(regs, regs->regs[2]);
  587. if (test_thread_flag(TIF_SYSCALL_TRACE))
  588. tracehook_report_syscall_exit(regs, 0);
  589. user_enter();
  590. }