From patchwork Wed Jun 2 03:27:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12292737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE4F5C47092 for ; Wed, 2 Jun 2021 03:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0174613CC for ; Wed, 2 Jun 2021 03:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbhFBD3r (ORCPT ); Tue, 1 Jun 2021 23:29:47 -0400 Received: from mail.loongson.cn ([114.242.206.163]:45696 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230511AbhFBD3q (ORCPT ); Tue, 1 Jun 2021 23:29:46 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxH0O6+rZgh7MIAA--.9496S2; Wed, 02 Jun 2021 11:27:54 +0800 (CST) From: Tiezhu Yang To: Greg Kroah-Hartman , Sasha Levin Cc: stable@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 4.19 0/9] bpf: fix verifier selftests on inefficient unaligned access architectures Date: Wed, 2 Jun 2021 11:27:44 +0800 Message-Id: <1622604473-781-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-CM-TRANSID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derInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org With the following patch series, all verifier selftests pass on the archs which select HAVE_EFFICIENT_UNALIGNED_ACCESS. [v2,4.19,00/19] bpf: fix verifier selftests, add CVE-2021-29155, CVE-2021-33200 fixes https://patchwork.kernel.org/project/netdevbpf/cover/20210528103810.22025-1-ovidiu.panait@windriver.com/ But on inefficient unaligned access architectures, there still exist many failures, so some patches about F_NEEDS_EFFICIENT_UNALIGNED_ACCESS are also needed, backport to 4.19 with a minor context difference. This patch series is based on the series (all now queued up by greg k-h): "bpf: fix verifier selftests, add CVE-2021-29155, CVE-2021-33200 fixes". Björn Töpel (2): selftests/bpf: add "any alignment" annotation for some tests selftests/bpf: Avoid running unprivileged tests with alignment requirements Daniel Borkmann (2): bpf: fix test suite to enable all unpriv program types bpf: test make sure to run unpriv test cases in test_verifier David S. Miller (4): bpf: Add BPF_F_ANY_ALIGNMENT. bpf: Adjust F_NEEDS_EFFICIENT_UNALIGNED_ACCESS handling in test_verifier.c bpf: Make more use of 'any' alignment in test_verifier.c bpf: Apply F_NEEDS_EFFICIENT_UNALIGNED_ACCESS to more ACCEPT test cases. Joe Stringer (1): selftests/bpf: Generalize dummy program types include/uapi/linux/bpf.h | 14 ++ kernel/bpf/syscall.c | 7 +- kernel/bpf/verifier.c | 3 + tools/include/uapi/linux/bpf.h | 14 ++ tools/lib/bpf/bpf.c | 8 +- tools/lib/bpf/bpf.h | 2 +- tools/testing/selftests/bpf/test_align.c | 4 +- tools/testing/selftests/bpf/test_verifier.c | 224 ++++++++++++++++++++-------- 8 files changed, 206 insertions(+), 70 deletions(-)