kasan: Add documentation for CONFIG_KASAN_EXTRA_INFO
authorJuntong Deng <juntong.deng@outlook.com>
Thu, 15 Feb 2024 19:17:23 +0000 (19:17 +0000)
committerJonathan Corbet <corbet@lwn.net>
Wed, 21 Feb 2024 20:44:21 +0000 (13:44 -0700)
This patch adds CONFIG_KASAN_EXTRA_INFO introduction information to
KASAN documentation.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/AM6PR03MB5848C52B871DA67455F0B2F2994D2@AM6PR03MB5848.eurprd03.prod.outlook.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/dev-tools/kasan.rst

index 858c77fe7dc46c35c2ed74b77467c9d114be3221..d56f298a9d7cae155790a49ed446e6d9e0ad0902 100644 (file)
@@ -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
 ----------------------