linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code
@ 2021-02-02  0:21 Keno Fischer
  2021-02-02 20:31 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Keno Fischer @ 2021-02-02  0:21 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: will

This was found by inspection - I don't work with aarch32 very
much, but I believe there is a missing return in this code,
since the second force_sig_fault here would override the
first, thus making the whole compat code here pointless.

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
---

This was left over in my working tree from when I was working
through various aarch64 ptrace weirdness last year and I don't
think I ever got around to submitting it, but I just looked
through my work from back then and came across this again -
my apologies if I'm wrong about this - it's been a while,
so I'm not really read into this code anymore.

 arch/arm64/kernel/ptrace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index e7b01904f180..9309c41dbafe 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -195,6 +195,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		arm64_force_sig_ptrace_errno_trap(si_errno,
 						  (void __user *)bkpt->trigger,
 						  desc);
+		return;
 	}
 #endif
 	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code
  2021-02-02  0:21 [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code Keno Fischer
@ 2021-02-02 20:31 ` Will Deacon
  2021-02-02 21:01   ` Keno Fischer
  0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2021-02-02 20:31 UTC (permalink / raw)
  To: Keno Fischer; +Cc: linux-arm-kernel

Hi Keno,

On Mon, Feb 01, 2021 at 07:21:09PM -0500, Keno Fischer wrote:
> This was found by inspection - I don't work with aarch32 very
> much, but I believe there is a missing return in this code,
> since the second force_sig_fault here would override the
> first, thus making the whole compat code here pointless.
> 
> Signed-off-by: Keno Fischer <keno@juliacomputing.com>
> ---
> 
> This was left over in my working tree from when I was working
> through various aarch64 ptrace weirdness last year and I don't
> think I ever got around to submitting it, but I just looked
> through my work from back then and came across this again -
> my apologies if I'm wrong about this - it's been a while,
> so I'm not really read into this code anymore.
> 
>  arch/arm64/kernel/ptrace.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
> index e7b01904f180..9309c41dbafe 100644
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
> @@ -195,6 +195,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
>  		arm64_force_sig_ptrace_errno_trap(si_errno,
>  						  (void __user *)bkpt->trigger,
>  						  desc);
> +		return;
>  	}
>  #endif
>  	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,

Thanks, I'll apply this for 5.12. However, I was trying to rework the commit
message to describe the impact of the issue and I'm not sure I agree with
your assessment that the second signal overrides the first. My (admittedly
brief) reading of __send_signal() is that the subsequent signal is
effectively ignored. Am I missing something?

Cheers,

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code
  2021-02-02 20:31 ` Will Deacon
@ 2021-02-02 21:01   ` Keno Fischer
  0 siblings, 0 replies; 3+ messages in thread
From: Keno Fischer @ 2021-02-02 21:01 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-arm-kernel

Hi Will,

> Thanks, I'll apply this for 5.12. However, I was trying to rework the commit
> message to describe the impact of the issue and I'm not sure I agree with
> your assessment that the second signal overrides the first. My (admittedly
> brief) reading of __send_signal() is that the subsequent signal is
> effectively ignored. Am I missing something?

Ah, I suppose you're probably right. I hadn't looked at this code in quite
a while, so I must have mis-remembered what the impact was.

Keno

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-02 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02  0:21 [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code Keno Fischer
2021-02-02 20:31 ` Will Deacon
2021-02-02 21:01   ` Keno Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).