linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Walter Wu <walter-zh.wu@mediatek.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Walter Wu <walter-zh.wu@mediatek.com>,
	wsd_upstream <wsd_upstream@mediatek.com>,
	linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
	linux-mm@kvack.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] kasan: add KASAN_RCU_STACK_RECORD documentation
Date: Wed, 6 May 2020 13:26:55 +0800	[thread overview]
Message-ID: <20200506052655.14639-1-walter-zh.wu@mediatek.com> (raw)

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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

                 reply	other threads:[~2020-05-06  5:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200506052655.14639-1-walter-zh.wu@mediatek.com \
    --to=walter-zh.wu@mediatek.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=corbet@lwn.net \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).