diff mbox

Documentation: kprobes: Document jprobes stack copying limitations

Message ID 1471033484-2709-1-git-send-email-dave.long@linaro.org
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

David Long Aug. 12, 2016, 8:24 p.m. UTC
From: "David A. Long" <dave.long@linaro.org>

Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
duplication for jprobes problematic. Document this.

Signed-off-by: David A. Long <dave.long@linaro.org>
---
 Documentation/kprobes.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Masami Hiramatsu (Google) Aug. 12, 2016, 11:46 p.m. UTC | #1
On Fri, 12 Aug 2016 16:24:44 -0400
David Long <dave.long@linaro.org> wrote:

> From: "David A. Long" <dave.long@linaro.org>
> 
> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
> duplication for jprobes problematic. Document this.
> 
> Signed-off-by: David A. Long <dave.long@linaro.org>

Looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> ---
>  Documentation/kprobes.txt | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
> index 1f9b3e2..1f6d45a 100644
> --- a/Documentation/kprobes.txt
> +++ b/Documentation/kprobes.txt
> @@ -103,6 +103,16 @@ Note that the probed function's args may be passed on the stack
>  or in registers.  The jprobe will work in either case, so long as the
>  handler's prototype matches that of the probed function.
>  
> +Note that in some architectures (e.g.: arm64 and sparc64) the stack
> +copy is not done, as the actual location of stacked parameters may be
> +outside of a reasonable MAX_STACK_SIZE value and because that location
> +cannot be determined by the jprobes code. In this case the jprobes
> +user must be careful to make certain the calling signature of the
> +function does not cause parameters to be passed on the stack (e.g.:
> +more than eight function arguments, an argument of more than sixteen
> +bytes, or more than 64 bytes of argument data, depending on
> +architecture).
> +
>  1.3 Return Probes
>  
>  1.3.1 How Does a Return Probe Work?
> -- 
> 2.5.0
>
Jonathan Corbet Aug. 15, 2016, 2:25 p.m. UTC | #2
On Fri, 12 Aug 2016 16:24:44 -0400
David Long <dave.long@linaro.org> wrote:

> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
> duplication for jprobes problematic. Document this.

Applied to the docs tree, thanks.

jon
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Long Aug. 15, 2016, 2:49 p.m. UTC | #3
On 08/15/2016 10:25 AM, Jonathan Corbet wrote:
> On Fri, 12 Aug 2016 16:24:44 -0400
> David Long <dave.long@linaro.org> wrote:
>
>> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
>> duplication for jprobes problematic. Document this.
>
> Applied to the docs tree, thanks.
>
> jon
>

Was kind of hoping to see an ack (or critique) from a sparc maintainer.

Thanks,
-dl

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Corbet Aug. 15, 2016, 3:32 p.m. UTC | #4
On Mon, 15 Aug 2016 10:49:36 -0400
David Long <dave.long@linaro.org> wrote:

> On 08/15/2016 10:25 AM, Jonathan Corbet wrote:
> > On Fri, 12 Aug 2016 16:24:44 -0400
> > David Long <dave.long@linaro.org> wrote:
> >  
> >> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
> >> duplication for jprobes problematic. Document this.  
> >
> > Applied to the docs tree, thanks.
> >
> > jon
> >  
> 
> Was kind of hoping to see an ack (or critique) from a sparc maintainer.

So are you saying you don't want the patch applied at this point?

jon
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Long Aug. 15, 2016, 3:41 p.m. UTC | #5
On 08/15/2016 11:32 AM, Jonathan Corbet wrote:
> On Mon, 15 Aug 2016 10:49:36 -0400
> David Long <dave.long@linaro.org> wrote:
>
>> On 08/15/2016 10:25 AM, Jonathan Corbet wrote:
>>> On Fri, 12 Aug 2016 16:24:44 -0400
>>> David Long <dave.long@linaro.org> wrote:
>>>
>>>> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
>>>> duplication for jprobes problematic. Document this.
>>>
>>> Applied to the docs tree, thanks.
>>>
>>> jon
>>>
>>
>> Was kind of hoping to see an ack (or critique) from a sparc maintainer.
>
> So are you saying you don't want the patch applied at this point?
>
> jon
>


I think we can apply it.  It's not looking like we're going to get 
comments from a sparc/kprobes maintainer.  The need for this change was 
first addressed on the sparc email alias exactly one week ago, which is 
maybe long enough to wait.

Sorry for the trouble,
-dl

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Catalin Marinas Aug. 15, 2016, 3:41 p.m. UTC | #6
On Mon, Aug 15, 2016 at 09:32:43AM -0600, Jonathan Corbet wrote:
> On Mon, 15 Aug 2016 10:49:36 -0400
> David Long <dave.long@linaro.org> wrote:
> 
> > On 08/15/2016 10:25 AM, Jonathan Corbet wrote:
> > > On Fri, 12 Aug 2016 16:24:44 -0400
> > > David Long <dave.long@linaro.org> wrote:
> > >  
> > >> Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack
> > >> duplication for jprobes problematic. Document this.  
> > >
> > > Applied to the docs tree, thanks.
> > >
> > > jon
> > 
> > Was kind of hoping to see an ack (or critique) from a sparc maintainer.
> 
> So are you saying you don't want the patch applied at this point?

To avoid any doubt, for arm64:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

(and I want the patch applied)
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 1f9b3e2..1f6d45a 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -103,6 +103,16 @@  Note that the probed function's args may be passed on the stack
 or in registers.  The jprobe will work in either case, so long as the
 handler's prototype matches that of the probed function.
 
+Note that in some architectures (e.g.: arm64 and sparc64) the stack
+copy is not done, as the actual location of stacked parameters may be
+outside of a reasonable MAX_STACK_SIZE value and because that location
+cannot be determined by the jprobes code. In this case the jprobes
+user must be careful to make certain the calling signature of the
+function does not cause parameters to be passed on the stack (e.g.:
+more than eight function arguments, an argument of more than sixteen
+bytes, or more than 64 bytes of argument data, depending on
+architecture).
+
 1.3 Return Probes
 
 1.3.1 How Does a Return Probe Work?