linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] minor kfence patches
@ 2021-05-14  9:21 Sven Schnelle
  2021-05-14  9:21 ` [PATCH 1/2] kfence: add function to mask address bits Sven Schnelle
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sven Schnelle @ 2021-05-14  9:21 UTC (permalink / raw)
  To: Marco Elver; +Cc: linux-kernel

i'm currently looking into adding support for KFENCE to the s390
architecture. So far everything is straightforward, and i get the
kfence testsuite to pass, which is good! :)

One minor thing i encountered is that for a translation exception,
s390 only reports the page address, but not the complete address. I
worked around that by adding a function to kfence which allows to mask
out certain bits during unit testing. I wonder whether that should be a
weak function that can be implemented by architectures if required, some
kconfig option, or some other way?

The other thing is that s390 (and some other architectures) has different
address spaces for kernel and user space, so the decision whether an
address belongs to user or kernel space cannot be made by just looking
at the address. I added a small if (user_mode(regs)) check to
kfence_handle_page_fault(). But this could of also be done in the
architecture specific code.

What do you think?

Thanks,
Sven



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-14 11:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14  9:21 [RFC] minor kfence patches Sven Schnelle
2021-05-14  9:21 ` [PATCH 1/2] kfence: add function to mask address bits Sven Schnelle
2021-05-14 10:54   ` Marco Elver
2021-05-14 11:03     ` Sven Schnelle
2021-05-14 11:23       ` Marco Elver
2021-05-14  9:21 ` [PATCH 2/2] kfence: only handle kernel mode faults Sven Schnelle
2021-05-14 10:52   ` Marco Elver
2021-05-14 10:55     ` Sven Schnelle
2021-05-14 10:59       ` Marco Elver
2021-05-14 10:56 ` [RFC] minor kfence patches Marco Elver

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).