From patchwork Wed Nov 22 21:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13465465 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452A51A5 for ; Wed, 22 Nov 2023 13:31:26 -0800 (PST) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AMIrJVg006857 for ; Wed, 22 Nov 2023 13:31:26 -0800 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3uhqadh283-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 22 Nov 2023 13:31:25 -0800 Received: from twshared4634.37.frc1.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:21d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 22 Nov 2023 13:31:23 -0800 Received: by devbig019.vll3.facebook.com (Postfix, from userid 137359) id F117A3BF4602F; Wed, 22 Nov 2023 13:31:12 -0800 (PST) From: Andrii Nakryiko To: , , , CC: , Subject: [PATCH bpf-next 0/3] Verify global subprogs lazily Date: Wed, 22 Nov 2023 13:31:09 -0800 Message-ID: <20231122213112.3596548-1-andrii@kernel.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: WtydsIyZIdChTNWblYxfWQccEni1_9nW X-Proofpoint-GUID: WtydsIyZIdChTNWblYxfWQccEni1_9nW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-22_16,2023-11-22_01,2023-05-22_02 X-Patchwork-Delegate: bpf@iogearbox.net See patch #2 for justification. In few words, current eager verification of global func prevents BPF CO-RE approaches to be applied to global functions. Patch #1 is just a nicety to emit global subprog names in verifier logs. Patch #3 adds selftests validating new lazy semantics. Andrii Nakryiko (3): bpf: emit global subprog name in verifier logs bpf: validate global subprogs lazily selftests/bpf: add lazy global subprog validation tests include/linux/bpf.h | 2 + kernel/bpf/verifier.c | 88 ++++++++++++++---- .../selftests/bpf/prog_tests/verifier.c | 2 + .../selftests/bpf/progs/test_global_func12.c | 4 +- .../bpf/progs/verifier_global_subprogs.c | 92 +++++++++++++++++++ .../bpf/progs/verifier_subprog_precision.c | 4 +- 6 files changed, 168 insertions(+), 24 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/verifier_global_subprogs.c