Files
linux/include/linux
Gabriel Krisman Bertazi 6342adcaa6 entry: Ensure trap after single-step on system call return
Commit 2991552447 ("entry: Drop usage of TIF flags in the generic syscall
code") introduced a bug on architectures using the generic syscall entry
code, in which processes stopped by PTRACE_SYSCALL do not trap on syscall
return after receiving a TIF_SINGLESTEP.

The reason is that the meaning of TIF_SINGLESTEP flag is overloaded to
cause the trap after a system call is executed, but since the above commit,
the syscall call handler only checks for the SYSCALL_WORK flags on the exit
work.

Split the meaning of TIF_SINGLESTEP such that it only means single-step
mode, and create a new type of SYSCALL_WORK to request a trap immediately
after a syscall in single-step mode.  In the current implementation, the
SYSCALL_WORK flag shadows the TIF_SINGLESTEP flag for simplicity.

Update x86 to flip this bit when a tracer enables single stepping.

Fixes: 2991552447 ("entry: Drop usage of TIF flags in the generic syscall code")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Kyle Huey <me@kylehuey.com>
Link: https://lore.kernel.org/r/87h7mtc9pr.fsf_-_@collabora.com
2021-02-06 00:21:42 +01:00
..
2020-12-09 19:26:02 -06:00
2020-06-25 22:25:13 -07:00
2020-06-16 14:19:57 +02:00
2020-05-24 20:48:11 +02:00
2020-07-21 08:24:52 -05:00
2020-12-02 09:46:55 -07:00
2020-07-08 10:48:35 -07:00
2020-11-06 08:08:37 -08:00
2020-09-21 15:00:40 -07:00
2020-12-02 09:46:55 -07:00
2020-08-19 14:14:29 +02:00
2020-12-19 11:18:38 -08:00
2020-10-16 17:21:51 +02:00
2020-12-14 16:24:19 +01:00
2020-12-11 14:02:14 -08:00
2020-05-04 11:19:58 -07:00
2020-12-02 22:00:22 -08:00
2020-08-12 20:42:08 +02:00
2020-12-10 12:42:59 -06:00
2020-11-16 16:31:41 +01:00
2020-11-16 15:20:01 +01:00
2020-07-24 17:12:41 -07:00
2020-11-16 08:14:30 -07:00
2020-08-04 21:02:38 -04:00
2020-12-02 22:10:35 -08:00
2020-11-23 14:16:55 +00:00
2020-12-08 14:14:48 +00:00
2020-09-16 08:54:53 -05:00
2020-05-18 10:30:21 +01:00
2020-11-24 16:47:48 +01:00
2020-12-15 16:19:31 +01:00
2020-06-02 15:15:46 +01:00
2020-12-15 16:19:31 +01:00
2020-09-04 09:25:20 -07:00
2021-01-22 15:09:42 +01:00
2020-05-08 18:18:11 +01:00
2020-05-08 00:12:42 +02:00
2020-05-28 10:31:09 +02:00
2020-09-23 18:02:49 -07:00
2020-12-07 10:29:57 +01:00
2020-09-04 12:46:07 +01:00
2020-12-04 12:23:25 +01:00
2020-08-27 16:06:47 -04:00
2020-05-09 13:57:12 +02:00
2020-07-01 10:49:02 +02:00
2020-09-24 19:49:36 -07:00
2020-07-23 17:34:18 +10:00
2020-05-15 13:51:28 -07:00
2020-12-15 15:11:08 -06:00
2020-08-31 12:52:33 -07:00
2020-12-16 13:08:18 -08:00
2020-10-18 09:27:10 -07:00
2020-05-09 13:57:12 +02:00
2020-12-03 11:20:52 +01:00
2020-08-18 17:06:15 +02:00
2020-12-15 12:13:39 -08:00
2020-12-07 17:12:49 -07:00
2020-11-06 10:05:18 -08:00
2020-12-10 16:17:15 +01:00
2020-12-15 12:13:37 -08:00
2020-11-24 16:47:49 +01:00
2020-12-10 10:45:36 +01:00
2020-09-26 22:55:05 -04:00
2020-10-30 21:57:04 +01:00
2020-11-16 15:20:01 +01:00
2020-12-04 16:54:35 +01:00
2020-11-09 18:39:36 +01:00
2020-07-04 09:35:36 -05:00
2020-09-10 14:03:31 -07:00
2020-07-07 11:58:59 -05:00
2020-08-19 14:13:20 +02:00
2020-08-01 11:28:17 +02:00
2020-12-15 12:13:41 -08:00
2020-10-05 13:21:49 +02:00