Re: [RFC 0/2] kasan: introduce mem track feature

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 18 Jan 2024 14:28:00, andreyknvl@xxxxxxxxx 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?




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux