[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNM_bp03RvWYr+PaOxx0DS3LryChweG90QXci3iBgzW4wQ@mail.gmail.com>
Date: Mon, 24 Jan 2022 12:45:16 +0100
From: Marco Elver <elver@...gle.com>
To: "liupeng (DM)" <liupeng256@...wei.com>
Cc: glider@...gle.com, dvyukov@...gle.com, corbet@....net,
sumit.semwal@...aro.org, christian.koenig@....com,
akpm@...ux-foundation.org, kasan-dev@...glegroups.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linaro-mm-sig@...ts.linaro.org, linux-mm@...ck.org
Subject: Re: [PATCH RFC 1/3] kfence: Add a module parameter to adjust kfence objects
[ FYI, your reply was not plain text, so LKML may have rejected it. I
advise that you switch your email client for LKML emails to plain
text. ]
On Mon, 24 Jan 2022 at 12:24, liupeng (DM) <liupeng256@...wei.com> wrote:
[...]
> > I think the only reasonable way forward is if you add immediate patching
> > support to the kernel as the "Note" suggests.
>
> May you give us more details about "immediate patching"?
[...]
> Thank you for your patient suggestions, it's actually helpful and inspired.
> We have integrated your latest work "skipping already covered allocations",
> and will do more experiments about KFENCE. Finally, we really hope you can
> give us more introductions about "immediate patching".
"Immediate patching" would, similar to "static branches" or
"alternatives" be based on code hot patching.
https://www.kernel.org/doc/html/latest/staging/static-keys.html
"Patching immediates" would essentially patch the immediate operands
of certain (limited) instructions. I think designing this properly to
work across various architectures (like static_keys/jump_label) is
very complex. So it may not be a viable near-term option.
What Dmitry suggests using a constant virtual address carveout is more
realistic. But this means having to discuss with arch maintainers
which virtual address ranges can be reserved. The nice thing about
just relying on memblock and nothing else is that it is very portable
and simple. You can have a look at how KASAN deals with organizing its
shadow memory if you are interested.
Thanks,
-- Marco
Powered by blists - more mailing lists