patch 'bpf: fix MOV instruction evaluation' has been queued to stable release 22.11.6
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 15 17:25:45 CEST 2024
Hi,
FYI, your patch has been queued to stable release 22.11.6
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/17/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d7a549306d92869a80230f51b51d1e7e36fccfad
Thanks.
Luca Boccassi
---
>From d7a549306d92869a80230f51b51d1e7e36fccfad Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev at huawei.com>
Date: Thu, 27 Jun 2024 19:04:40 +0100
Subject: [PATCH] bpf: fix MOV instruction evaluation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 3eef64655bfe3602f4e3235e2533932205f24569 ]
Verifier might left some register-state values uninitialized while
evaluating MOV instructions.
Add explicit initialization.
Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
Signed-off-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
lib/bpf/bpf_validate.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 61cbb42216..1bf91fa05b 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -636,14 +636,14 @@ eval_alu(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
{
uint64_t msk;
uint32_t op;
- size_t opsz;
+ size_t opsz, sz;
const char *err;
struct bpf_eval_state *st;
struct bpf_reg_val *rd, rs;
- opsz = (BPF_CLASS(ins->code) == BPF_ALU) ?
+ sz = (BPF_CLASS(ins->code) == BPF_ALU) ?
sizeof(uint32_t) : sizeof(uint64_t);
- opsz = opsz * CHAR_BIT;
+ opsz = sz * CHAR_BIT;
msk = RTE_LEN2MASK(opsz, uint64_t);
st = bvf->evst;
@@ -652,8 +652,10 @@ eval_alu(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
if (BPF_SRC(ins->code) == BPF_X) {
rs = st->rv[ins->src_reg];
eval_apply_mask(&rs, msk);
- } else
+ } else {
+ rs = (struct bpf_reg_val){.v = {.size = sz,},};
eval_fill_imm(&rs, msk, ins->imm);
+ }
eval_apply_mask(rd, msk);
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-07-15 16:19:35.145803899 +0100
+++ 0007-bpf-fix-MOV-instruction-evaluation.patch 2024-07-15 16:19:34.444203816 +0100
@@ -1 +1 @@
-From 3eef64655bfe3602f4e3235e2533932205f24569 Mon Sep 17 00:00:00 2001
+From d7a549306d92869a80230f51b51d1e7e36fccfad Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 3eef64655bfe3602f4e3235e2533932205f24569 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 79be5e917d..11344fff4d 100644
+index 61cbb42216..1bf91fa05b 100644
More information about the stable
mailing list