[PATCH v2 3/3] kasan: update documentation for generic kasan

14 views
Skip to first unread message

Walter Wu

unread,
May 10, 2020, 10:32:38 PM5/10/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu
Generic KASAN will support to record first and last call_rcu() call
stack and print them in KASAN report. so we update documentation.

Signed-off-by: Walter Wu <walter...@mediatek.com>
Cc: Andrey Ryabinin <arya...@virtuozzo.com>
Cc: Dmitry Vyukov <dvy...@google.com>
Cc: Alexander Potapenko <gli...@google.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
Documentation/dev-tools/kasan.rst | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
index c652d740735d..d4efcfde9fff 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -193,6 +193,12 @@ function calls GCC directly inserts the code to check the shadow memory.
This option significantly enlarges kernel but it gives x1.1-x2 performance
boost over outline instrumented kernel.

+Currently generic KASAN can print call_rcu() call stack in KASAN report, it
+can't increase the cost of memory consumption, but it has one limitations.
+It can't get both call_rcu() call stack and free stack, so that it can't
+print free stack for allocation objects in KASAN report. This feature is
+only suitable for generic KASAN.
+
Software tag-based KASAN
~~~~~~~~~~~~~~~~~~~~~~~~

--
2.18.0

Dmitry Vyukov

unread,
May 11, 2020, 6:52:31 AM5/11/20
to Walter Wu, Andrey Ryabinin, Alexander Potapenko, Jonathan Corbet, kasan-dev, Linux-MM, LKML, Linux ARM, wsd_upstream, linux-m...@lists.infradead.org
On Mon, May 11, 2020 at 4:32 AM Walter Wu <walter...@mediatek.com> wrote:
>
> Generic KASAN will support to record first and last call_rcu() call
> stack and print them in KASAN report. so we update documentation.
>
> Signed-off-by: Walter Wu <walter...@mediatek.com>
> Cc: Andrey Ryabinin <arya...@virtuozzo.com>
> Cc: Dmitry Vyukov <dvy...@google.com>
> Cc: Alexander Potapenko <gli...@google.com>
> Cc: Jonathan Corbet <cor...@lwn.net>
> ---
> Documentation/dev-tools/kasan.rst | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
> index c652d740735d..d4efcfde9fff 100644
> --- a/Documentation/dev-tools/kasan.rst
> +++ b/Documentation/dev-tools/kasan.rst
> @@ -193,6 +193,12 @@ function calls GCC directly inserts the code to check the shadow memory.
> This option significantly enlarges kernel but it gives x1.1-x2 performance
> boost over outline instrumented kernel.
>
> +Currently

Currently is excessive here. Everything in the doc is about the
current state of the things.

> generic KASAN can print call_rcu()

s/can print/prints/

> call stack in KASAN report, it

KASAN is implied for "report" in this doc.
s/KASAN//


> +can't increase the cost of memory consumption,

It does not increase only as compared to the current state of things.
But strictly saying, if we now take the call_rcu stacks away, we can
reduce memory consumption.
This statement is confusing because stacks consume memory.

> but it has one limitations.
> +It can't get both call_rcu() call stack and free stack, so that it can't
> +print free stack for allocation objects in KASAN report.

1. This sentence produces the impression that KASAN does not print
free stack for freed objects. KASAN does still print free stack for
freed objects.
2. This sentence is mostly relevant as diff on top of the current
situation and thus more suitable for the commit description. We never
promise to print free stack for allocated objects. And free stack for
allocated objects is not an immediately essential thing either. So for
a reader of this doc, this is not a limitation.

> This feature is
> +only suitable for generic KASAN.

We already mentioned "generic" in the first sentence. So this is excessive.

This paragraph can be reduced to:

"Generic KASAN prints up to 2 call_rcu() call stacks in reports, the
first and the last one."

The rest belongs to change description and is only interesting as a
historic reference. Generally documentation does not accumulate
everything that happened since the creation of the world :)


> Software tag-based KASAN
> ~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> 2.18.0
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20200511023231.15437-1-walter-zh.wu%40mediatek.com.

Walter Wu

unread,
May 11, 2020, 8:28:41 AM5/11/20
to Dmitry Vyukov, Andrey Ryabinin, Alexander Potapenko, Jonathan Corbet, kasan-dev
Thank your for your review. I will fix it in next patch.

Walter Wu

unread,
May 18, 2020, 2:31:22 AM5/18/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu
Generic KASAN will support to record the last two call_rcu() call
stacks and print them in KASAN report. so we update documentation.

Signed-off-by: Walter Wu <walter...@mediatek.com>
Cc: Andrey Ryabinin <arya...@virtuozzo.com>
Cc: Dmitry Vyukov <dvy...@google.com>
Cc: Alexander Potapenko <gli...@google.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
Documentation/dev-tools/kasan.rst | 3 +++
1 file changed, 3 insertions(+)

diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
index c652d740735d..fede42e6536b 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -193,6 +193,9 @@ function calls GCC directly inserts the code to check the shadow memory.
This option significantly enlarges kernel but it gives x1.1-x2 performance
boost over outline instrumented kernel.

+Generic KASAN prints up to 2 call_rcu() call stacks in reports, the last one
+and the second to last.
+

Walter Wu

unread,
May 18, 2020, 10:26:36 PM5/18/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu
Generic KASAN will support to record the last two call_rcu() call
stacks and print them in KASAN report. So need to update documentation.

Walter Wu

unread,
May 20, 2020, 8:39:56 AM5/20/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu
Generic KASAN will support to record the last two call_rcu() call stacks
and print them in KASAN report. So that need to update documentation.

Walter Wu

unread,
May 21, 2020, 10:02:16 PM5/21/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu

Dmitry Vyukov

unread,
May 25, 2020, 5:57:05 AM5/25/20
to Walter Wu, Andrey Ryabinin, Alexander Potapenko, Jonathan Corbet, kasan-dev, Linux-MM, LKML, Linux ARM, wsd_upstream, linux-m...@lists.infradead.org
On Fri, May 22, 2020 at 4:02 AM Walter Wu <walter...@mediatek.com> wrote:
>
> Generic KASAN will support to record the last two call_rcu() call stacks
> and print them in KASAN report. So that need to update documentation.

Reviewed-and-tested-by: Dmitry Vyukov <dvy...@google.com>

> Signed-off-by: Walter Wu <walter...@mediatek.com>
> Cc: Andrey Ryabinin <arya...@virtuozzo.com>
> Cc: Dmitry Vyukov <dvy...@google.com>
> Cc: Alexander Potapenko <gli...@google.com>
> Cc: Jonathan Corbet <cor...@lwn.net>
> ---
> Documentation/dev-tools/kasan.rst | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
> index c652d740735d..fede42e6536b 100644
> --- a/Documentation/dev-tools/kasan.rst
> +++ b/Documentation/dev-tools/kasan.rst
> @@ -193,6 +193,9 @@ function calls GCC directly inserts the code to check the shadow memory.
> This option significantly enlarges kernel but it gives x1.1-x2 performance
> boost over outline instrumented kernel.
>
> +Generic KASAN prints up to 2 call_rcu() call stacks in reports, the last one
> +and the second to last.
> +
> Software tag-based KASAN
> ~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> 2.18.0
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20200522020212.23460-1-walter-zh.wu%40mediatek.com.

Walter Wu

unread,
Jun 1, 2020, 1:11:20 AM6/1/20
to Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Jonathan Corbet, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org, linux-ar...@lists.infradead.org, wsd_upstream, linux-m...@lists.infradead.org, Walter Wu
Generic KASAN will support to record the last two call_rcu() call stacks
and print them in KASAN report. So that need to update documentation.

Signed-off-by: Walter Wu <walter...@mediatek.com>
Reviewed-and-tested-by: Dmitry Vyukov <dvy...@google.com>
Reviewed-by: Andrey Konovalov <andre...@google.com>
Cc: Andrey Ryabinin <arya...@virtuozzo.com>
Reply all
Reply to author
Forward
0 new messages