patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type
@ 2019-08-09 16:29 jerinj
  2019-08-12  8:49 ` Ananyev, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: jerinj @ 2019-08-09 16:29 UTC (permalink / raw)
  To: dev, Konstantin Ananyev; +Cc: thomas, Jerin Jacob, stable

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-13  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 16:29 [dpdk-stable] [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type jerinj
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

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).