From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7161CA00E6 for ; Fri, 9 Aug 2019 18:29:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 693AF2082; Fri, 9 Aug 2019 18:29:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 83C47271; Fri, 9 Aug 2019 18:29:45 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x79GKVZN032470; Fri, 9 Aug 2019 09:29:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=SM7tXmIbfucYvgDm99L7ELFLChj1Ls1jAPLjwAPvYV8=; b=VuOhVp+X97rnqO5vROWahtxwVHCgThGeWcoghOOopARf+dVVh8OktigV/bOM4OzrkLja DWBYQQUaKUt1ijuDuAHlOL19E7Dv/LgIL2JkKf4dGFy7Npc1ICb4h5/TRZM1c7K/qEQS dUBuX37EqFtJdPHDsTQIXPxysyjXvyLkCJ0yvUm//oJeg6jFqgNWiRnEJpful6ZYf42V RH3VIIaqrxN+S/vP01Ahh1xwm4lDXq8RqVL2RQtSjtTmEknWjjCJ31XQeE0ZLRWAUouz XFEYbdIWio9GTRlhv1yDEtUzqoelCZ8T/Sffjfr4v9u8XEfKfQpG5RvMF/20B8kQM7tt 0g== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2u8cqjewff-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2019 09:29:42 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 9 Aug 2019 09:29:41 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 9 Aug 2019 09:29:41 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 5C8133F7040; Fri, 9 Aug 2019 09:29:39 -0700 (PDT) From: To: , Konstantin Ananyev CC: , Jerin Jacob , Date: Fri, 9 Aug 2019 21:59:19 +0530 Message-ID: <20190809162919.5967-1-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-09_04:2019-08-09,2019-08-09 signatures=0 Subject: [dpdk-dev] [PATCH] bpf: fix to allow ptr stack program type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob 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 --- 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