summaryrefslogtreecommitdiff
path: root/0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2020-03-30 14:44:36 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2020-03-30 14:44:36 -0700
commit5683fc973632ffea612b51d3eb2c3e72a3f2ee72 (patch)
treed32ce4179f7c8a3e8ba7b1b05f6f733ecf5c4d5a /0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch
parentUpdated to 5.5.13 (diff)
downloadlinux-ck-5683fc973632ffea612b51d3eb2c3e72a3f2ee72.tar.xz
Rebuild with bpf hotfix
Add sata as builtin
Diffstat (limited to '0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch')
-rw-r--r--0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch b/0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch
new file mode 100644
index 0000000..4e866fa
--- /dev/null
+++ b/0012-Revert-bpf-Provide-better-register-bounds-after-jmp32-instructions.patch
@@ -0,0 +1,57 @@
+From 9ff88052dbb54cdb7b05d91561b3540056c96e83 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 30 Mar 2020 22:37:11 +0200
+Subject: Revert "bpf: Provide better register bounds after jmp32 instructions"
+
+This reverts commit 581738a681b6faae5725c2555439189ca81c0f1f.
+---
+ kernel/bpf/verifier.c | 19 -------------------
+ 1 file changed, 19 deletions(-)
+
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
+index 7d530ce8719d..79f38a281390 100644
+--- a/kernel/bpf/verifier.c
++++ b/kernel/bpf/verifier.c
+@@ -1034,17 +1034,6 @@ static void __reg_bound_offset(struct bpf_reg_state *reg)
+ reg->umax_value));
+ }
+
+-static void __reg_bound_offset32(struct bpf_reg_state *reg)
+-{
+- u64 mask = 0xffffFFFF;
+- struct tnum range = tnum_range(reg->umin_value & mask,
+- reg->umax_value & mask);
+- struct tnum lo32 = tnum_cast(reg->var_off, 4);
+- struct tnum hi32 = tnum_lshift(tnum_rshift(reg->var_off, 32), 32);
+-
+- reg->var_off = tnum_or(hi32, tnum_intersect(lo32, range));
+-}
+-
+ /* Reset the min/max bounds of a register */
+ static void __mark_reg_unbounded(struct bpf_reg_state *reg)
+ {
+@@ -5677,10 +5666,6 @@ static void reg_set_min_max(struct bpf_reg_state *true_reg,
+ /* We might have learned some bits from the bounds. */
+ __reg_bound_offset(false_reg);
+ __reg_bound_offset(true_reg);
+- if (is_jmp32) {
+- __reg_bound_offset32(false_reg);
+- __reg_bound_offset32(true_reg);
+- }
+ /* Intersecting with the old var_off might have improved our bounds
+ * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc),
+ * then new var_off is (0; 0x7f...fc) which improves our umax.
+@@ -5790,10 +5775,6 @@ static void reg_set_min_max_inv(struct bpf_reg_state *true_reg,
+ /* We might have learned some bits from the bounds. */
+ __reg_bound_offset(false_reg);
+ __reg_bound_offset(true_reg);
+- if (is_jmp32) {
+- __reg_bound_offset32(false_reg);
+- __reg_bound_offset32(true_reg);
+- }
+ /* Intersecting with the old var_off might have improved our bounds
+ * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc),
+ * then new var_off is (0; 0x7f...fc) which improves our umax.
+--
+cgit v1.2.3-1-gf6bb5
+