linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: lizhe.67@bytedance.com
To: andreyknvl@gmail.com
Cc: akpm@linux-foundation.org, dvyukov@google.com, elver@google.com,
	glider@google.com, kasan-dev@googlegroups.com,
	linux-mm@kvack.org, lizefan.x@bytedance.com,
	lizhe.67@bytedance.com, ryabinin.a.a@gmail.com,
	vincenzo.frascino@arm.com
Subject: Re: [RFC 0/2] kasan: introduce mem track feature
Date: Mon, 22 Jan 2024 11:03:43 +0800	[thread overview]
Message-ID: <20240122030343.17548-1-lizhe.67@bytedance.com> (raw)
In-Reply-To: <CA+fCnZdVVhx-sNU36A1pa3dJkE_RyYjdJU-PZQf57E42GWO46A@mail.gmail.com>

On Thu, 18 Jan 2024 14:28:00, andreyknvl@gmail.com wrote:
>
>> Yes I am trying to add custom poison/unpoison functions which can monitor
>> memory in a fine-grained manner, and not affect the original functionality
>> of kasan. For example, for a 100-byte variable, I may only want to monitor
>> certain two bytes (byte 3 and 4) in it. According to my understanding,
>> kasan_poison/unpoison() can not detect the middle bytes individually. So I
>> don't think function kasan_poison/unpoison() can do what I want.
>
>I'm not sure this type of tracking belongs within KASAN.
>
>If there are only a few locations you want to monitor, perhaps a
>separate tools based on watchpoints would make more sense?

Thank you for your review!

Yes hardware breakpoint is a method to monitor a few locations. However,
this depends on the hardware implementation and there will be a problem of
limited number of hardware watchpoints, and software solution does not have
these problems.

>
>Another alternative is to base this functionality on KMSAN: it already
>allows for bit-level precision. Plus, it would allow to only report
>when the marked memory is actually being used, not when it's just
>being copied. Perhaps Alexander can comment on whether this makes
>sense.
>
>If we decide to add this to KASAN or KMSAN, we need to least also add
>some in-tree users to demonstrate the functionality. And it would be
>great to find some bugs with it, but perhaps syzbot will be able to
>take care of that.
>
>Thank you!

In my opinion, currently this feature will only appear in our daily debugging
process. Maybe this feature can be used in perf later. Or do you have any
suggestions for in-tree users?


  reply	other threads:[~2024-01-22  3:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 12:41 [RFC 0/2] kasan: introduce mem track feature lizhe.67
2024-01-18 12:41 ` [RFC 1/2] kasan: introduce mem track feature base on kasan lizhe.67
2024-01-18 12:41 ` [RFC 2/2] kasan: add mem track interface and its test cases lizhe.67
2024-01-18 13:28 ` [RFC 0/2] kasan: introduce mem track feature Marco Elver
2024-01-18 14:30   ` lizhe.67
2024-01-19 16:06     ` Andrey Konovalov
2024-01-22  3:03       ` lizhe.67 [this message]
2024-01-22  4:49 ` Dmitry Vyukov
2024-01-22  6:26   ` lizhe.67
2024-01-22  7:03     ` Dmitry Vyukov
2024-01-23  6:27       ` lizhe.67

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=20240122030343.17548-1-lizhe.67@bytedance.com \
    --to=lizhe.67@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=vincenzo.frascino@arm.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).