summaryrefslogtreecommitdiff
path: root/include/linux/log2.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-01-29 17:02:22 -0800
committerBen Hutchings <ben@decadent.org.uk>2018-03-19 18:59:12 +0000
commit0510dfd3cc0f01fbea0857736afc2e06c8c59014 (patch)
treef34e7e6966b0ded0f50d9ed8e83b1a87fe8bac1a /include/linux/log2.h
parentdaa41d548d5b088304957529529307105017f8f2 (diff)
array_index_nospec: Sanitize speculative array de-references
commit f3804203306e098dae9ca51540fcd5eb700d7f40 upstream. array_index_nospec() is proposed as a generic mechanism to mitigate against Spectre-variant-1 attacks, i.e. an attack that bypasses boundary checks via speculative execution. The array_index_nospec() implementation is expected to be safe for current generation CPUs across multiple architectures (ARM, x86). Based on an original implementation by Linus Torvalds, tweaked to remove speculative flows by Alexei Starovoitov, and tweaked again by Linus to introduce an x86 assembly implementation for the mask generation. Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org> Co-developed-by: Alexei Starovoitov <ast@kernel.org> Suggested-by: Cyril Novikov <cnovikov@lynx.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arch@vger.kernel.org Cc: kernel-hardening@lists.openwall.com Cc: Peter Zijlstra <peterz@infradead.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Russell King <linux@armlinux.org.uk> Cc: gregkh@linuxfoundation.org Cc: torvalds@linux-foundation.org Cc: alan@linux.intel.com Link: https://lkml.kernel.org/r/151727414229.33451.18411580953862676575.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux/log2.h')
0 files changed, 0 insertions, 0 deletions