mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] nospec: Add documentation for array_index_nospec
@ 2023-06-16 13:37 Jordy Zomer
  2023-06-16 13:37 ` [PATCH 1/1] " Jordy Zomer
  0 siblings, 1 reply; 5+ messages in thread
From: Jordy Zomer @ 2023-06-16 13:37 UTC (permalink / raw)
  To: linux-kernel, linux-doc
  Cc: corbet, jordyzomer, dave.hansen, daniel, tglx, rdunlap,
	pawan.kumar.gupta

array_index_nospec() should only be used if the upper boundary is a built
time constant. Otherwise the boundary could be speculated on as well.
While it might be more difficult to control two loads, it doesn't rule
out the problem. Adding this to the documentation so people won't mis-use
it instead of barrier_nospec().

Jordy Zomer (1):
  nospec: Add documentation for array_index_nospec

 Documentation/staging/speculation.rst | 5 +++++
 include/linux/nospec.h                | 5 +++++
 2 files changed, 10 insertions(+)

-- 
2.41.0.162.gfafddb0af9-goog


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

end of thread, other threads:[~2023-06-16 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 13:37 [PATCH 0/1] nospec: Add documentation for array_index_nospec Jordy Zomer
2023-06-16 13:37 ` [PATCH 1/1] " Jordy Zomer
2023-06-16 16:18   ` Dave Hansen
2023-06-16 18:05   ` Matthew Wilcox
2023-06-16 18:46     ` Jordy Zomer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®