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

On Thu, Jan 18, 2024 at 3:30 PM <lizhe.67@bytedance.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?

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!


  reply	other threads:[~2024-01-19 16:06 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 [this message]
2024-01-22  3:03       ` lizhe.67
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=CA+fCnZdVVhx-sNU36A1pa3dJkE_RyYjdJU-PZQf57E42GWO46A@mail.gmail.com \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --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=lizhe.67@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).