DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [RFC 3/5] bpf: fix validation of eal_divmod
Date: Tue,  6 Nov 2018 13:48:59 -0800	[thread overview]
Message-ID: <20181106214901.1392-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20181106214901.1392-1-stephen@networkplumber.org>

Coverity spotted self assignment in BPF eval_divmod.
This looks like a bug where the incoming source register
should have been used instead.

Coverity issue: 302850
Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_bpf/bpf_validate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 83983efc4e5c..b768f72c4c02 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_bpf/bpf_validate.c
@@ -512,7 +512,7 @@ eval_divmod(uint32_t op, struct bpf_reg_val *rd, struct bpf_reg_val *rs,
 		if (op == BPF_MOD)
 			rd->u.max = RTE_MIN(rd->u.max, rs->u.max - 1);
 		else
-			rd->u.max = rd->u.max;
+			rd->u.max = rs->u.max;
 		rd->u.min = 0;
 	}
 
-- 
2.17.1

  parent reply	other threads:[~2018-11-06 21:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 21:48 [dpdk-dev] [RFC 0/5] more Coverity related bug fixes Stephen Hemminger
2018-11-06 21:48 ` [dpdk-dev] [RFC 1/5] bus/pci: fix allocation of pci device path Stephen Hemminger
2018-11-18 15:03   ` Thomas Monjalon
2018-11-22 23:52   ` Ferruh Yigit
2018-11-23  0:29   ` [dpdk-dev] [PATCH] bus/pci: fix allocation of PCI " Ferruh Yigit
2018-11-23 10:45     ` Thomas Monjalon
2018-11-23 10:55       ` Andrew Rybchenko
2018-11-23 11:01     ` Maxime Coquelin
2018-11-25 10:53       ` Thomas Monjalon
2018-11-06 21:48 ` [dpdk-dev] [RFC 2/5] bus/pci: fix TOCTOU issue Stephen Hemminger
2018-11-18 15:04   ` Thomas Monjalon
2018-11-06 21:48 ` Stephen Hemminger [this message]
2018-11-07 12:54   ` [dpdk-dev] [RFC 3/5] bpf: fix validation of eal_divmod Ananyev, Konstantin
2018-11-07 19:51     ` Stephen Hemminger
2018-11-07 20:07       ` Ananyev, Konstantin
2018-11-07 23:04       ` Ananyev, Konstantin
2018-11-06 21:49 ` [dpdk-dev] [RFC 4/5] eal/memory: avoid double munmap in error path Stephen Hemminger
2018-11-06 23:10   ` Thomas Monjalon
2018-11-06 21:49 ` [dpdk-dev] [RFC 5/5] pipeline: remove dead code Stephen Hemminger
2018-11-18 15:07   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106214901.1392-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).