[PATCH] kasan: Add documentation for CONFIG_KASAN_EXTRA_INFO

20 views
Skip to first unread message

Juntong Deng

unread,
Feb 15, 2024, 1:44:44 PMFeb 15
to ryabin...@gmail.com, gli...@google.com, andre...@gmail.com, dvy...@google.com, vincenzo...@arm.com, cor...@lwn.net, kasa...@googlegroups.com, linu...@vger.kernel.org, linux-...@vger.kernel.org
This patch adds CONFIG_KASAN_EXTRA_INFO introduction information to
KASAN documentation.

Signed-off-by: Juntong Deng <junton...@outlook.com>
---
Documentation/dev-tools/kasan.rst | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
index a5a6dbe9029f..3dc48b08cf71 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -277,6 +277,27 @@ traces point to places in code that interacted with the object but that are not
directly present in the bad access stack trace. Currently, this includes
call_rcu() and workqueue queuing.

+CONFIG_KASAN_EXTRA_INFO
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Enabling CONFIG_KASAN_EXTRA_INFO allows KASAN to record and report more
+information, the extra information currently supported is the CPU number and
+timestamp at allocation and free. More information can help find the cause of
+the bug and correlate the error with other system events, at the cost of using
+extra memory to record more information (more cost details in the help text of
+CONFIG_KASAN_EXTRA_INFO).
+
+Here is the report with CONFIG_KASAN_EXTRA_INFO enabled (only the
+different parts are shown)::
+
+ ==================================================================
+ ...
+ Allocated by task 134 on cpu 5 at 229.133855s:
+ ...
+ Freed by task 136 on cpu 3 at 230.199335s:
+ ...
+ ==================================================================
+
Implementation details
----------------------

--
2.39.2

Randy Dunlap

unread,
Feb 15, 2024, 2:02:59 PMFeb 15
to Juntong Deng, ryabin...@gmail.com, gli...@google.com, andre...@gmail.com, dvy...@google.com, vincenzo...@arm.com, cor...@lwn.net, kasa...@googlegroups.com, linu...@vger.kernel.org, linux-...@vger.kernel.org
Hi--

On 2/15/24 10:43, Juntong Deng wrote:
> This patch adds CONFIG_KASAN_EXTRA_INFO introduction information to
> KASAN documentation.
>
> Signed-off-by: Juntong Deng <junton...@outlook.com>
> ---
> Documentation/dev-tools/kasan.rst | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
> index a5a6dbe9029f..3dc48b08cf71 100644
> --- a/Documentation/dev-tools/kasan.rst
> +++ b/Documentation/dev-tools/kasan.rst
> @@ -277,6 +277,27 @@ traces point to places in code that interacted with the object but that are not
> directly present in the bad access stack trace. Currently, this includes
> call_rcu() and workqueue queuing.
>
> +CONFIG_KASAN_EXTRA_INFO
> +~~~~~~~~~~~~~~~~~~~~~~~
> +

Fix punctuation (run-on sentence):

> +Enabling CONFIG_KASAN_EXTRA_INFO allows KASAN to record and report more
> +information, the extra information currently supported is the CPU number and

information. The

> +timestamp at allocation and free. More information can help find the cause of
> +the bug and correlate the error with other system events, at the cost of using
> +extra memory to record more information (more cost details in the help text of
> +CONFIG_KASAN_EXTRA_INFO).
> +
> +Here is the report with CONFIG_KASAN_EXTRA_INFO enabled (only the
> +different parts are shown)::
> +
> + ==================================================================
> + ...
> + Allocated by task 134 on cpu 5 at 229.133855s:
> + ...
> + Freed by task 136 on cpu 3 at 230.199335s:
> + ...
> + ==================================================================
> +
> Implementation details
> ----------------------
>

thanks.
--
#Randy

Juntong Deng

unread,
Feb 15, 2024, 2:17:59 PMFeb 15
to ryabin...@gmail.com, gli...@google.com, andre...@gmail.com, dvy...@google.com, vincenzo...@arm.com, cor...@lwn.net, kasa...@googlegroups.com, linu...@vger.kernel.org, linux-...@vger.kernel.org
This patch adds CONFIG_KASAN_EXTRA_INFO introduction information to
KASAN documentation.

Signed-off-by: Juntong Deng <junton...@outlook.com>
---
V1 -> V2: Fix run-on sentence.

Documentation/dev-tools/kasan.rst | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
index a5a6dbe9029f..d7de44f5339d 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -277,6 +277,27 @@ traces point to places in code that interacted with the object but that are not
directly present in the bad access stack trace. Currently, this includes
call_rcu() and workqueue queuing.

+CONFIG_KASAN_EXTRA_INFO
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Enabling CONFIG_KASAN_EXTRA_INFO allows KASAN to record and report more
+information. The extra information currently supported is the CPU number and
+timestamp at allocation and free. More information can help find the cause of
+the bug and correlate the error with other system events, at the cost of using
+extra memory to record more information (more cost details in the help text of
+CONFIG_KASAN_EXTRA_INFO).
+
+Here is the report with CONFIG_KASAN_EXTRA_INFO enabled (only the
+different parts are shown)::
+
+ ==================================================================
+ ...
+ Allocated by task 134 on cpu 5 at 229.133855s:
+ ...
+ Freed by task 136 on cpu 3 at 230.199335s:
+ ...
+ ==================================================================
+
Implementation details
----------------------

--
2.39.2

Andrey Konovalov

unread,
Feb 15, 2024, 6:38:07 PMFeb 15
to Juntong Deng, ryabin...@gmail.com, gli...@google.com, dvy...@google.com, vincenzo...@arm.com, cor...@lwn.net, kasa...@googlegroups.com, linu...@vger.kernel.org, linux-...@vger.kernel.org
Reviewed-by: Andrey Konovalov <andre...@gmail.com>

Jonathan Corbet

unread,
Feb 19, 2024, 4:42:04 PMFeb 19
to Juntong Deng, ryabin...@gmail.com, gli...@google.com, andre...@gmail.com, dvy...@google.com, vincenzo...@arm.com, kasa...@googlegroups.com, linu...@vger.kernel.org, linux-...@vger.kernel.org
Juntong Deng <junton...@outlook.com> writes:

> This patch adds CONFIG_KASAN_EXTRA_INFO introduction information to
> KASAN documentation.
>
> Signed-off-by: Juntong Deng <junton...@outlook.com>
> ---
> V1 -> V2: Fix run-on sentence.
>
> Documentation/dev-tools/kasan.rst | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)

Applied, thanks.

jon
Reply all
Reply to author
Forward
0 new messages