linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: fix hash_name() and branch predictor issues
@ 2025-12-08 12:34 Russell King (Oracle)
  2025-12-08 12:34 ` [PATCH 1/3] ARM: allow __do_kernel_fault() to report execution of memory faults Russell King (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Russell King (Oracle) @ 2025-12-08 12:34 UTC (permalink / raw)
  To: Xie Yuanbin; +Cc: linux-arm-kernel, torvalds, viro, will

This series, which I'm intending to be part of my upcoming pull request
for this merge window (note - will be sent before Thursday, otherwise
it won't be until maybe the middle of January) fixes the recently
reported hash_name() issue, and also the long standing branch predictor
hardening smp_processor_id() warning which occurs due to interrupts
being enabled.

Fixing this isn't trivial because there are many paths through
do_page_fault() which are non-obvious.

For example, we detect page faults by the kernel attempting to execute
memory that it shouldn't and print such a warning. If we introduce an
early address check, we avoid that detection, making it become a
plain kernel oops without the informative error message.

The first patch adds an additional check in __do_kernel_fault() to
detect this condition. This patch is a non-obvious dependency for the
next patch.

The second patch handles faults above the top of userspace entirely
separately, meaning we have a simpler and more obvious fault path,
which avoids any possibility of taking any MM mutexes, which is the
cause of the hash_name() problem.

The third patch moves harden_branch_predictor() out of
__do_user_fault() and to appropriate places in the parent functions.
The reason this has been avoided thus far is because do_page_fault()
can be a hot path (since it's used for page aging as well) but with
kernel address faults being handled by an entirely separate path,
this avoids adding to that overhead.

I would like to get some attributations for this - specifically
tested-by.

Thanks.

 arch/arm/mm/alignment.c |  6 +++-
 arch/arm/mm/fault.c     | 74 +++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 67 insertions(+), 13 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


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

end of thread, other threads:[~2025-12-11  4:07 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 12:34 [PATCH 0/3] ARM: fix hash_name() and branch predictor issues Russell King (Oracle)
2025-12-08 12:34 ` [PATCH 1/3] ARM: allow __do_kernel_fault() to report execution of memory faults Russell King (Oracle)
2025-12-09  4:02   ` Xie Yuanbin
2025-12-09  8:43     ` Russell King (Oracle)
2025-12-08 12:34 ` [PATCH 2/3] ARM: fix hash_name() fault Russell King (Oracle)
2025-12-08 12:35 ` [PATCH 3/3] ARM: fix branch predictor hardening Russell King (Oracle)
2025-12-08 15:08 ` [PATCH 0/3] ARM: fix hash_name() and branch predictor issues Xie Yuanbin
2025-12-08 15:59   ` Russell King (Oracle)
2025-12-08 16:47     ` Russell King (Oracle)
2025-12-09  2:52       ` Xie Yuanbin
2025-12-09  8:56       ` Xie Yuanbin
2025-12-09  8:59         ` Russell King (Oracle)
2025-12-09  9:09           ` Xie Yuanbin
2025-12-10  9:08         ` Xie Yuanbin
2025-12-10 15:11           ` Russell King (Oracle)
2025-12-11  4:07             ` Xie Yuanbin
2025-12-09  2:15     ` Xie Yuanbin

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