linux-stable/include
Andrii Nakryiko 67420501e8 bpf: generalize reg_set_min_max() to handle non-const register comparisons
Generalize bounds adjustment logic of reg_set_min_max() to handle not
just register vs constant case, but in general any register vs any
register cases. For most of the operations it's trivial extension based
on range vs range comparison logic, we just need to properly pick
min/max of a range to compare against min/max of the other range.

For BPF_JSET we keep the original capabilities, just make sure JSET is
integrated in the common framework. This is manifested in the
internal-only BPF_JSET + BPF_X "opcode" to allow for simpler and more
uniform rev_opcode() handling. See the code for details. This allows to
reuse the same code exactly both for TRUE and FALSE branches without
explicitly handling both conditions with custom code.

Note also that now we don't need a special handling of BPF_JEQ/BPF_JNE
case none of the registers are constants. This is now just a normal
generic case handled by reg_set_min_max().

To make tnum handling cleaner, tnum_with_subreg() helper is added, as
that's a common operator when dealing with 32-bit subregister bounds.
This keeps the overall logic much less noisy when it comes to tnums.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Link: https://lore.kernel.org/r/20231112010609.848406-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-11-15 12:03:41 -08:00
..
acpi
asm-generic Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
clocksource
crypto
drm drm next and fixes for 6.7-rc1 2023-11-07 17:10:02 -08:00
dt-bindings linux-watchdog 6.7-rc1 tag 2023-11-09 13:54:25 -08:00
keys
kunit
kvm
linux bpf: generalize reg_set_min_max() to handle non-const register comparisons 2023-11-15 12:03:41 -08:00
math-emu
media
memory
misc
net net/sched: act_ct: Always fill offloading tuple iifidx 2023-11-08 17:47:08 -08:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20231102 2023-11-02 15:13:50 -10:00
soc IOMMU Updates for Linux v6.7 2023-11-09 13:37:28 -08:00
sound
target
trace Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
uapi bpf: Add crosstask check to __bpf_get_stack 2023-11-10 11:06:10 -08:00
ufs
vdso
video
xen