From mboxrd@z Thu Jan 1 00:00:00 1970 From: Song Liu Subject: [PATCH v4 bpf-next 0/2] bpf: add cg_skb_is_valid_access Date: Thu, 18 Oct 2018 09:06:47 -0700 Message-ID: <20181018160649.1611530-1-songliubraving@fb.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , , Song Liu To: Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:32836 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726774AbeJSAIz (ORCPT ); Thu, 18 Oct 2018 20:08:55 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9IG5s5W004816 for ; Thu, 18 Oct 2018 09:07:14 -0700 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2n6v8vg9ap-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 18 Oct 2018 09:07:14 -0700 Sender: netdev-owner@vger.kernel.org List-ID: Changes v3 -> v4: 1. Fixed crash issue reported by Alexei. Changes v2 -> v3: 1. Added helper function bpf_compute_and_save_data_pointers() and bpf_restore_data_pointers(). Changes v1 -> v2: 1. Updated the list of read-only fields, and read-write fields. 2. Added dummy sk to bpf_prog_test_run_skb(). This set enables BPF program of type BPF_PROG_TYPE_CGROUP_SKB to access some __skb_buff data directly. Song Liu (2): bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB bpf: add tests for direct packet access from CGROUP_SKB include/linux/filter.h | 24 +++ kernel/bpf/cgroup.c | 6 + net/bpf/test_run.c | 7 + net/core/filter.c | 36 ++++- tools/testing/selftests/bpf/test_verifier.c | 170 ++++++++++++++++++++ 5 files changed, 242 insertions(+), 1 deletion(-)