From patchwork Fri Oct 29 20:36:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1548282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=G3D+D7FP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HgvRk4RDnz9sSf for ; Sat, 30 Oct 2021 07:39:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mgYef-0001k6-KR; Fri, 29 Oct 2021 20:39:13 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mgYed-0001js-Pd for kernel-team@lists.ubuntu.com; Fri, 29 Oct 2021 20:39:11 +0000 Received: from localhost.localdomain (1.general.cascardo.us.vpn [10.172.70.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 743233F174 for ; Fri, 29 Oct 2021 20:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1635539951; bh=TAfZmSw7RWb4fRq9PA5j251x09nIUX1EhVVuGqmjrqM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=G3D+D7FP59yeuEZND/tw84pAQ7KA8NXrm1upBYqWjHyS9EOVtogkE9OuHVzdNO7Iq yP9BjQOmEcoyULMbXoW+c+Z+DkVzsSqciYsrE6IlKMQJnTHWdeAyxnZRmLiz0uE3kO 38XCykEhJ/32w+WicXjU3TCHHOMOqcqhT1HbnuguBpBX6RSicCaFca6mRUPynm2t8+ 9BgfZJPcatKs7qoJ9o/jFpZ7GbMmwMa/hhS6wIzfLDpuxLBH0eRwwbfY8674ZyTlKj jOLP+05RzzaE+iG0jAe4PTl77M298u4QQ2lP3PwbTquGzytLfkQHy20eGZSi25EiqH H/4gkhJMZvRcw== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Bionic 0/4] BPF tests on i386 Date: Fri, 29 Oct 2021 17:36:20 -0300 Message-Id: <20211029203624.1367572-1-cascardo@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1788578 BugLink: https://bugs.launchpad.net/bugs/1934414 These two bugs are related to BPF tests on i386. The first one requires a change on how some narrow/unaligned context access is allowed. It could lead to BPF programs causing processor exceptions on some architectures, though it shouldn't. The second one only changes the tests. I verified at least i386 and amd64, and they are all fine there. The second bug required a lot of backport, because we didn't want to required kernel BPF verifier changes that could introduce regressions, or worse, potential vulnerabilities because of incomplete backports. Those would be: commit cc8b0b92a1699bc32f7fec71daa2bfc90de43a4d "bpf: introduce function calls (function boundaries)", which would open a big can of worms we don't want to do. commit 5e581dad4fec0e6d062740dc35b8dc248b39d224 "bpf: make unknown opcode handling more robust". Though it might add more robustness, it changes the table in the interpreter, so I decided not to backport it now, and fixup the error messages in test_verifier, instead. Cascardo. Alexei Starovoitov (1): selftests/bpf: make test_verifier run most programs Daniel Borkmann (3): bpf: add couple of test cases for div/mod by zero bpf: add further test cases around div/mod and others bpf: fix context access in tracing progs on 32 bit archs include/linux/filter.h | 30 +- kernel/bpf/verifier.c | 3 +- kernel/trace/bpf_trace.c | 10 +- lib/test_bpf.c | 8 +- tools/testing/selftests/bpf/test_verifier.c | 358 +++++++++++++++++++- 5 files changed, 397 insertions(+), 12 deletions(-) Acked-by: Tim Gardner Acked-by: Kleber Sacilotto de Souza