hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/kernel/bpf/core.c
....@@ -32,6 +32,7 @@
3232 #include <linux/perf_event.h>
3333 #include <linux/extable.h>
3434 #include <linux/log2.h>
35
+#include <linux/nospec.h>
3536
3637 #include <asm/barrier.h>
3738 #include <asm/unaligned.h>
....@@ -827,7 +828,7 @@
827828 {
828829 /* Only used as heuristic here to derive limit. */
829830 bpf_jit_limit_max = bpf_jit_alloc_exec_limit();
830
- bpf_jit_limit = min_t(u64, round_up(bpf_jit_limit_max >> 2,
831
+ bpf_jit_limit = min_t(u64, round_up(bpf_jit_limit_max >> 1,
831832 PAGE_SIZE), LONG_MAX);
832833 return 0;
833834 }
....@@ -1646,9 +1647,7 @@
16461647 * reuse preexisting logic from Spectre v1 mitigation that
16471648 * happens to produce the required code on x86 for v4 as well.
16481649 */
1649
-#ifdef CONFIG_X86
16501650 barrier_nospec();
1651
-#endif
16521651 CONT;
16531652 #define LDST(SIZEOP, SIZE) \
16541653 STX_MEM_##SIZEOP: \