From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7A7A455AD for ; Mon, 15 Jul 2024 17:27:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2F2840A75; Mon, 15 Jul 2024 17:27:28 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 85565402B0 for ; Mon, 15 Jul 2024 17:27:27 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so26465905e9.1 for ; Mon, 15 Jul 2024 08:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721057247; x=1721662047; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PNr8tFPKke50BHlgLb7tqzBySD1dZ28HsF6P7dNKRcM=; b=GRP3acQQ1A4yZ4z1FuapLfcSJ0kzCTKqeYUqh3z7/6NAX/wc1AsrwNtZ4dT+9pHQon 1BuOSPPiGU/eeRmFLjrc1+iDyiKiyeYGHyJLMI2ymRgOa5muOrpXFGraDDfjwZlXnN0/ Oi7HLVULfupNPoAmCHXFwnEblXoImdLYUl6eFEr/QSKp88yWrc9NtFrNlPc/d/JELOcc LnWbnsZ/JN38jmpND4SqWW6hUp5T2VY3FAG3V03g0idWvTljTkIjAaePStBb437pOynT FAjW42xtva2wgLkGjgC9ap7GMHUvqB1Ic3z0TabBo99cd+UHG0bVMCfn50AF5sib9+o/ tJgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057247; x=1721662047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PNr8tFPKke50BHlgLb7tqzBySD1dZ28HsF6P7dNKRcM=; b=A4j11nDsATjsdjZivRTs2Txbxk9d8rGK5ujrW3yDP2O6FelxlRgmB7RM48A/6VByGJ u+Ycgqk+gjrMAHdhHRvNNVL207yaaZww7BA6I4sDDL9kr+d3iH86JANobg7rfAXHbGlD aHJf28vU1sitss4xRc8p/9MW6/x74LJixqkaXy4e5WRLg2FoszC9b4XqQB5Ehw5Nwp3v XbW0Ttve9Ds4EDaxsKMK58QnTIKPomPvFw8IEye3Z0TEG1lECBijk8/MlYWfRh1qJRg6 GTL3karjuIe0UxZEhv00OBbBJmbMrE6l2A7xWobkO3hllav91B906NcJIcWV+pAXr/yf DNXA== X-Forwarded-Encrypted: i=1; AJvYcCWtIsJak+7r+eaBpfDBWvMpE4E5+Reo3HOf7AKUFoivQkVCVWkEyhMVLVLTKBmLboz7UlXnfnigs9lyYeik05g= X-Gm-Message-State: AOJu0YzKcUw0sa9C+iK4RvgkVaE4+xm+LxqOZy1P/Mktaf6nkGaPBcDQ reiLaS1mZ63PcZ21YAY+E4AO4I+OHoIMV0vaVd8MsguXr9VlZi0S3LlZBTYr X-Google-Smtp-Source: AGHT+IGLDc97G/j/gsj5xg8H2KgQvTuI0vjAgvuBCo+Jrqs76uD4qCBSdJDq/lpuklWaw3D2wcYV4w== X-Received: by 2002:a05:600c:6b0b:b0:426:698b:791f with SMTP id 5b1f17b1804b1-4279d9f3513mr76184495e9.3.1721057246988; Mon, 15 Jul 2024 08:27:26 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427a5ef56f7sm91676965e9.47.2024.07.15.08.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 08:27:26 -0700 (PDT) From: luca.boccassi@gmail.com To: Konstantin Ananyev Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Subject: patch 'bpf: fix MOV instruction evaluation' has been queued to stable release 22.11.6 Date: Mon, 15 Jul 2024 16:25:45 +0100 Message-Id: <20240715152704.2229503-7-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240715152704.2229503-1-luca.boccassi@gmail.com> References: <20240624235907.885628-81-luca.boccassi@gmail.com> <20240715152704.2229503-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Acked-by: Morten Brørup --- 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@dpdk.org @@ -23 +24 @@ -index 79be5e917d..11344fff4d 100644 +index 61cbb42216..1bf91fa05b 100644