From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yonghong Song Subject: [PATCH net-next 0/3 v2] bpf: improve verifier ARG_CONST_SIZE_OR_ZERO semantics Date: Sun, 12 Nov 2017 08:03:58 -0800 Message-ID: <20171112160401.278318-1-yhs@fb.com> Mime-Version: 1.0 Content-Type: text/plain Cc: To: , , Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40148 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbdKLQED (ORCPT ); Sun, 12 Nov 2017 11:04:03 -0500 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vACG3Mwk008417 for ; Sun, 12 Nov 2017 08:04:02 -0800 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2e61cuj2g5-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 12 Nov 2017 08:04:02 -0800 Sender: netdev-owner@vger.kernel.org List-ID: This patch set intends to change verifier ARG_CONST_SIZE_OR_ZERO semantics so that simpler bpf programs can be written with verifier acceptance. Patch #1 comment provided the detailed examples and the patch itself implements the new semantics. Patch #2 changes bpf_probe_read helper arg2 type from ARG_CONST_SIZE to ARG_CONST_SIZE_OR_ZERO. Patch #3 fixed a few test cases and added some for better coverage. Changelog: v1 -> v2: Fix typo in commit message pointed by Sergei Shtylyov Yonghong Song (3): bpf: improve verifier ARG_CONST_SIZE_OR_ZERO semantics bpf: change helper bpf_probe_read arg2 type to ARG_CONST_SIZE_OR_ZERO bpf: fix and add test cases for ARG_CONST_SIZE_OR_ZERO semantics change kernel/bpf/verifier.c | 40 +++++---- kernel/trace/bpf_trace.c | 8 +- tools/testing/selftests/bpf/test_verifier.c | 131 ++++++++++++++++++++++++---- 3 files changed, 142 insertions(+), 37 deletions(-) -- 2.9.5