ptrace: restore the previous single step reporting behavior
diff mbox series

Message ID 877do3gaq9.fsf@m5Zedd9JOGzJrf0
State New, archived
Headers show
Series
  • ptrace: restore the previous single step reporting behavior
Related show

Commit Message

Yuxuan Shui Jan. 23, 2021, 11:21 a.m. UTC
Commit 64eb35f701f04b30706e21d1b02636b5d31a37d2 changed when single step
is reported.

Specifically, the report_single_step is changed so that single steps are
only reported when both SYSCALL_EMU and _TIF_SINGLESTEP are set, while
previously they are reported when _TIF_SINGLESTEP is set without
_TIF_SYSCALL_EMU being set.

This behavior change breaks rr [1]

This commit restores the old behavior.

[1]: https://github.com/rr-debugger/rr/issues/2793

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
---
 kernel/entry/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gabriel Krisman Bertazi Jan. 27, 2021, 11:55 p.m. UTC | #1
Yuxuan Shui <yshuiv7@gmail.com> writes:

> Commit 64eb35f701f04b30706e21d1b02636b5d31a37d2 changed when single step
> is reported.
>
> Specifically, the report_single_step is changed so that single steps are
> only reported when both SYSCALL_EMU and _TIF_SINGLESTEP are set, while
> previously they are reported when _TIF_SINGLESTEP is set without
> _TIF_SYSCALL_EMU being set.
>
> This behavior change breaks rr [1]
>
> This commit restores the old behavior.
>
> [1]: https://github.com/rr-debugger/rr/issues/2793
>
> Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>

Looks correct to me.

To gather the right attention, you should directly CC the correct maintainers.

Fixes: 64eb35f701f0 ("ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag")
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Yuxuan Shui Jan. 28, 2021, 12:16 a.m. UTC | #2
Hi,

On Wed, Jan 27, 2021 at 11:55 PM Gabriel Krisman Bertazi
<krisman@collabora.com> wrote:
>
> Yuxuan Shui <yshuiv7@gmail.com> writes:
>
> > Commit 64eb35f701f04b30706e21d1b02636b5d31a37d2 changed when single step
> > is reported.
> >
> > Specifically, the report_single_step is changed so that single steps are
> > only reported when both SYSCALL_EMU and _TIF_SINGLESTEP are set, while
> > previously they are reported when _TIF_SINGLESTEP is set without
> > _TIF_SYSCALL_EMU being set.
> >
> > This behavior change breaks rr [1]
> >
> > This commit restores the old behavior.
> >
> > [1]: https://github.com/rr-debugger/rr/issues/2793
> >
> > Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
>
> Looks correct to me.
>
> To gather the right attention, you should directly CC the correct maintainers.

Thanks, will do.

>
> Fixes: 64eb35f701f0 ("ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag")
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
>
> --
> Gabriel Krisman Bertazi
Thomas Gleixner Jan. 28, 2021, 12:40 p.m. UTC | #3
On Wed, Jan 27 2021 at 20:55, Gabriel Krisman Bertazi wrote:
> Yuxuan Shui <yshuiv7@gmail.com> writes:
>
> To gather the right attention, you should directly CC the correct
> maintainers.

You could have cc'ed them on your reply ....

> Fixes: 64eb35f701f0 ("ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag")
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>

Patch
diff mbox series

diff --git a/kernel/entry/common.c b/kernel/entry/common.c
index 90533f34ea99c..ad3b17fcde782 100644
--- a/kernel/entry/common.c
+++ b/kernel/entry/common.c
@@ -220,7 +220,7 @@  static inline bool rep:ort_single_step(unsigned long work)
  */
 static inline bool report_single_step(unsigned long work)
 {
-	if (!(work & SYSCALL_WORK_SYSCALL_EMU))
+	if (!!(work & SYSCALL_WORK_SYSCALL_EMU))
 		return false;
 
 	return !!(current_thread_info()->flags & _TIF_SINGLESTEP);