lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] kasan: add KASAN_RCU_STACK_RECORD documentation
Date
This adds the documentation for the KASAN_RCU_STACK_RECORD config option.

Signed-off-by: Walter Wu <walter-zh.wu@mediatek.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
---
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 c652d740735d..368ff0dad0d7 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -281,3 +281,24 @@ unmapped. This will require changes in arch-specific code.

This allows ``VMAP_STACK`` support on x86, and can simplify support of
architectures that do not have a fixed module region.
+
+CONFIG_KASAN_RCU_STACK_RECORD
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+With CONFIG_KASAN_RCU_STACK_RECORD, when call_rcu() is called, it will
+store the call_rcu() call stack into slub alloc meta-data. The goal
+is to print call_rcu() information in KASAN report. It is helpful for
+use-after-free or double free memory issue.
+
+Record first and last call_rcu() call stack and print two call_rcu()
+call stack in KASAN report.
+
+This option doesn't increase the cost of memory consumption, we add two
+call_rcu() call stack into struct kasan_alloc_meta and size is 8 bytes.
+Remove the free track from struct kasan_alloc_meta and size is 8 bytes.
+So we don't enlarge the slub meta-data size.
+
+This option is only suitable for generic KASAN. Because the free track
+is stored in freed object. so free track is valid information only when
+it exists in the quarantine. If the slub object is in-use state, then
+KASAN report doesn't print call_rcu() free track information.
--
2.18.0
\
 
 \ /
  Last update: 2020-05-06 07:27    [W:0.026 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site