Skip to content

Commit d87c930

Browse files
eddyz87Alexei Starovoitov
authored andcommitted
Revert "selftests/bpf: Update reg_bound range refinement logic"
This reverts commit da653de. Removed logic is now covered by range_refine_in_halves() which handles both 32-bit and 64-bit refinements. Suggested-by: Paul Chaignon <paul.chaignon@gmail.com> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260306-bpf-32-bit-range-overflow-v3-3-f7f67e060a6b@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent f81fdfd commit d87c930

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

tools/testing/selftests/bpf/prog_tests/reg_bounds.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,6 @@ static struct range range_refine(enum num_t x_t, struct range x, enum num_t y_t,
519519
return range_intersection(x_t, x, x_swap);
520520
}
521521

522-
if (!t_is_32(x_t) && !t_is_32(y_t) && x_t != y_t) {
523-
if (x_t == S64 && x.a > x.b) {
524-
if (x.b < y.a && x.a <= y.b)
525-
return range(x_t, x.a, y.b);
526-
if (x.a > y.b && x.b >= y.a)
527-
return range(x_t, y.a, x.b);
528-
} else if (x_t == U64 && y.a > y.b) {
529-
if (y.b < x.a && y.a <= x.b)
530-
return range(x_t, y.a, x.b);
531-
if (y.a > x.b && y.b >= x.a)
532-
return range(x_t, x.a, y.b);
533-
}
534-
}
535-
536522
/* otherwise, plain range cast and intersection works */
537523
return range_intersection(x_t, x, y_cast);
538524
}

0 commit comments

Comments
 (0)