[PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

Andy Lutomirski luto at kernel.org
Tue Aug 20 08:20:47 AEST 2019


> On Aug 18, 2019, at 8:58 PM, Daniel Axtens <dja at axtens.net> wrote:
>

>>> Each page of shadow memory represent 8 pages of real memory. Could we use
>>> page_ref to count how many pieces of a shadow page are used so that we can
>>> free it when the ref count decreases to 0.
>
> I'm not sure how much of a difference it will make, but I'll have a look.
>

There are a grand total of eight possible pages that could require a
given shadow page. I would suggest that, instead of reference
counting, you just check all eight pages.

Or, better yet, look at the actual vm_area_struct and are where prev
and next point. That should tell you exactly which range can be freed.


More information about the Linuxppc-dev mailing list