diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-11 10:44:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-11 10:44:28 +0300 |
commit | 112345a4046838d97a2bd030a98297ff7e2c9f2d (patch) | |
tree | 271b0c1610366667328d6f9d4f1bfb839188904b /kernel/bpf/core.c | |
parent | 522c35e08b53f157ad3e51848caa861b258001e4 (diff) | |
parent | a39b6ac3781d46ba18193c9dbb2110f31e9bffe9 (diff) | |
download | linux-112345a4046838d97a2bd030a98297ff7e2c9f2d.tar.xz |
Merge 6.7-rc5 into usb-next
We need the USB fixes in here as well to build off of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r-- | kernel/bpf/core.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index cd3afe57ece3..fe254ae035fe 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -371,14 +371,18 @@ static int bpf_adj_delta_to_imm(struct bpf_insn *insn, u32 pos, s32 end_old, static int bpf_adj_delta_to_off(struct bpf_insn *insn, u32 pos, s32 end_old, s32 end_new, s32 curr, const bool probe_pass) { - const s32 off_min = S16_MIN, off_max = S16_MAX; + s64 off_min, off_max, off; s32 delta = end_new - end_old; - s32 off; - if (insn->code == (BPF_JMP32 | BPF_JA)) + if (insn->code == (BPF_JMP32 | BPF_JA)) { off = insn->imm; - else + off_min = S32_MIN; + off_max = S32_MAX; + } else { off = insn->off; + off_min = S16_MIN; + off_max = S16_MAX; + } if (curr < pos && curr + off + 1 >= end_old) off += delta; |