From: <jerinj@marvell.com>
To: <dev@dpdk.org>, Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: <thomas@monjalon.net>, Jerin Jacob <jerinj@marvell.com>,
<stable@dpdk.org>
Subject: [dpdk-stable] [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type
Date: Fri, 9 Aug 2019 21:59:19 +0530 [thread overview]
Message-ID: <20190809162919.5967-1-jerinj@marvell.com> (raw)
From: Jerin Jacob <jerinj@marvell.com>
bpf_validate does not allow to execute
RTE_BPF_ARG_PTR_STACK for no reason.
Fix it by enhancing the prog_arg.type check.
Fixes: 6e12ec4c4d6d ("bpf: add more checks")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
lib/librte_bpf/bpf_validate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 0cf41fa27..c75777b6d 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_bpf/bpf_validate.c
@@ -2216,6 +2216,7 @@ bpf_validate(struct rte_bpf *bpf)
/* check input argument type, don't allow mbuf ptr on 32-bit */
if (bpf->prm.prog_arg.type != RTE_BPF_ARG_RAW &&
+ bpf->prm.prog_arg.type != RTE_BPF_ARG_PTR_STACK &&
bpf->prm.prog_arg.type != RTE_BPF_ARG_PTR &&
(sizeof(uint64_t) != sizeof(uintptr_t) ||
bpf->prm.prog_arg.type != RTE_BPF_ARG_PTR_MBUF)) {
--
2.22.0
next reply other threads:[~2019-08-09 16:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 16:29 jerinj [this message]
2019-08-12 8:49 ` Ananyev, Konstantin
2019-08-12 10:34 ` Jerin Jacob Kollanukkaran
2019-08-12 11:37 ` Ananyev, Konstantin
2019-08-13 3:31 ` Jerin Jacob Kollanukkaran
2019-08-13 6:50 ` Ananyev, Konstantin
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=20190809162919.5967-1-jerinj@marvell.com \
--to=jerinj@marvell.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/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).