Re: [PATCH RFC v1 19/26] kmsan: call KMSAN hooks where needed

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

 



On Tue, 2019-10-29 at 15:09 +0100, Alexander Potapenko wrote:
> On Fri, Oct 18, 2019 at 5:02 PM Qian Cai <cai@xxxxxx> wrote:
> > 
> > On Fri, 2019-10-18 at 11:42 +0200, glider@xxxxxxxxxx wrote:
> > > Insert KMSAN hooks that check for potential memory errors and/or make
> > > necessary bookkeeping changes:
> > >  - allocate/split/deallocate metadata pages in
> > >    alloc_pages()/split_page()/free_page();
> > 
> > This also seems unnecessary where there are options like page_poison and
> > debug_pagealloc should be able detect uninitialized memory access in the page
> > allocator as well. Even KASAN has some of the functionality.
> 
> I still believe there's some misunderstanding between us because I
> didn't CC you on KMSAN runtime or the documentation.
> I'll do this and will be happy to answer questions if you still have them.
> Without these hooks, KMSAN will be virtually unusable, because it
> won't know about heap allocations.
> 
> When a buffer is allocated on heap, KMSAN updates the metadata for
> that region of memory, writing 0xFF (meaning uninitialized) to every
> shadow byte and a stack ID to every 4 region bytes.
> Note that shadow and origin bytes are stored separately and are
> generally incompatible with what debug pagealloc/page poison do.

That makes more sense to me now. I was a bit worry about some of those options
could stub one's toe with KMSAN, but I had shared with you the MM debug config
in another email before, so you could try it out, so I don't need to spam you
later once this hit the linux-next.




[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