From patchwork Fri Jun 8 08:42:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ananyev, Konstantin" X-Patchwork-Id: 40806 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 081D51B03F; Fri, 8 Jun 2018 10:42:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0EEB61B029 for ; Fri, 8 Jun 2018 10:42:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 01:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="47424165" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by orsmga007.jf.intel.com with ESMTP; 08 Jun 2018 01:42:47 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: Konstantin Ananyev Date: Fri, 8 Jun 2018 09:42:32 +0100 Message-Id: <1528447355-29411-1-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.0.7 To: dev@dpdk.org Subject: [dpdk-dev] [PATCH 0/3] bpf: extend validation of input BPF programs 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" As first step extend struct rte_bpf_xsym with new fields to provide extra information for allowed external varaibles and helper functions. That allows to extend bpf validation with new checks for: - use/return uninitialized registers and/or stack data - possible memory access boundaries violation - invalid arguments for the function Konstantin Ananyev (3): bpf: add extra information for external symbol definitions bpf: add extra validation for input BPF program test/bpf: add new test-case for external function call app/test-pmd/bpf_cmd.c | 27 +- lib/librte_bpf/bpf_def.h | 5 + lib/librte_bpf/bpf_exec.c | 2 +- lib/librte_bpf/bpf_impl.h | 14 + lib/librte_bpf/bpf_jit_x86.c | 17 +- lib/librte_bpf/bpf_load.c | 49 +- lib/librte_bpf/bpf_load_elf.c | 4 +- lib/librte_bpf/bpf_validate.c | 1136 +++++++++++++++++++++++++++++++++++++++-- lib/librte_bpf/rte_bpf.h | 21 +- test/test/test_bpf.c | 169 +++++- 10 files changed, 1382 insertions(+), 62 deletions(-)