Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp42779pxu; Tue, 6 Oct 2020 18:09:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkiomWpxuZJFOddi3XAWsv+H0UhD3BhEv9wdZKzcvkOoLF3ZBBdMqNrvmucVnT6WJ3IcvG X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr792582ejb.516.1602032999000; Tue, 06 Oct 2020 18:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602032998; cv=none; d=google.com; s=arc-20160816; b=MfWEyqvEKiW7gvU4SRBVq+WsftDHepkHeVxrnN2QkuBGXjDk8q1L8M2H3vNoozHBds 44iie2r9I2fdSeOIAjdn6sd0LWSzz6Um3Y6rGJQZK0RVx5ljF5FKi2ptXa5auH3Z8tc5 bLAWbP9fLXZ4MtClj+f5P3aT+6gDGdy/JQbcP7prbdPVpfprFUJAfs4AlLgdTwGFIucs xclyNCFInjmuK4cHy3liFXY+I81gDN3xL0r7ojqQGlHJAJUlcs5i63B1jWJHakDK8pTx xeym1GMOSt7vHM6VqY50bg0BjiaYAd4nVu1/3eSUAXdI9kh1orUL6M3hn7XL9liGRe+O WITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V3zqpSMPS8gtKxeX3TbkFq5u4mIeEj4U3nOHYlCoGeo=; b=J3luEIJiqjje4NJ8blrUzpAz9JYyUrOdqq9ZOF5a7xCiJNWdnhI/3vb2UCmNCfLwOL hMrQ5W/1LnkgidjHVabk6L5YyvduEjVJNjRqwufhoAvRmvRrVGakg3Fz4s6uj0sB6nfE 8fFd/A5e7y5XKZkpxzKNRg6acmhEiyt/WSg1LNY+XP1ZM+uN7hnnE2qduf1nCgdXRghg kPKz2GIV41r8lQnNSKmWpigeDNW1GuBjdyULLw26xMK1VK7tKeC7SMpGR6qnseEKtccb 6PbX18fC8pod/9DXsDGYyhoXAFkzO/w6wdwSMNNHV6Hx2gRFmSKTr8dIgmrzx3JKRtN/ MchA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vGg+OypG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si340722ejb.476.2020.10.06.18.09.36; Tue, 06 Oct 2020 18:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vGg+OypG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbgJGA4c (ORCPT + 99 others); Tue, 6 Oct 2020 20:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbgJGA4c (ORCPT ); Tue, 6 Oct 2020 20:56:32 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFCAFC061755; Tue, 6 Oct 2020 17:56:31 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id 67so555911ybt.6; Tue, 06 Oct 2020 17:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V3zqpSMPS8gtKxeX3TbkFq5u4mIeEj4U3nOHYlCoGeo=; b=vGg+OypGRkCqFLX2djYv0TqEfRRV5vwCvcmreBa0IP6X4OCUNlzLbPZGt7kqBJRhP8 NA0aeHDYnnC7+NYpdXdTK3xpLrhK5I5yBLyIeomDUM2Ku2FObiInUTYvEb6Aw67l28rR PQXcksLDGdbMvWZ3zInbLnE2ifSjyzT2cHtioqywwrmToBz4fbzN51OnJdQItyjOfOIz thbUgt/T2M0KpZhQyEpsOtZQ4LQN8TzfIeBkbXyodKw85XAzOH8wqAm0hq/a8/+i9lyC rJ1wXjh0K4LJVR95wmDfzhvSJNo2uDymq23u6Ykvx39FFUFn7+47tI5pHv1UrE0vtunK NIoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V3zqpSMPS8gtKxeX3TbkFq5u4mIeEj4U3nOHYlCoGeo=; b=G+IqccQwAxl1EzgxDl9tEFLEraLr2EyhT49KDf6Qwopvp1U+TIWko2JGAhwik74K2U 7rL+bbavHYd3ex+uV41qPSB/I4plZNO+isZi9kH9gwEnHKnwfJ1HupDIjU50rNOxpyh/ Xae1TiYujUQ8XSxldth7RFs94jRGtmlOLGvmyHsOH4+K64Bnp8fk6y1k6H1dCkzJsfmp ctfty4eP5ymndxXQHiiJEc72R0XBtn43BmQR0k4FzSj1IPIOwecCH86LbkxWU4kmp3Jb x0l1edFrMWlJwuzDYqXBsaALKU4q6T3CABJGJUSxnhnzNLcjJPDQzgacoyb7CtZP6wVC z2BA== X-Gm-Message-State: AOAM533BtKg68zJxNiFhessJaCsc4CSS2IfTo/xyjPJ2pAqKvW8Dk7K2 p1FGvUK5W+xeyY/mu+7SCgQahYpjgL9jxdnNGcM= X-Received: by 2002:a25:730a:: with SMTP id o10mr1235486ybc.403.1602032190986; Tue, 06 Oct 2020 17:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20201006231706.2744579-1-haoluo@google.com> In-Reply-To: From: Andrii Nakryiko Date: Tue, 6 Oct 2020 17:56:20 -0700 Message-ID: Subject: Re: [PATCH] bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64 To: Hao Luo Cc: Networking , bpf , open list , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 6, 2020 at 5:51 PM Hao Luo wrote: > > On Tue, Oct 6, 2020 at 5:43 PM Andrii Nakryiko > wrote: > > > > On Tue, Oct 6, 2020 at 4:45 PM Hao Luo wrote: > > > > > > Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched > > > the order of check_subprogs() and resolve_pseudo_ldimm() in > > > the verifier. Now an empty prog and the prog of a single > > > invalid ldimm expect to see the error "last insn is not an > > > exit or jmp" instead, because the check for subprogs comes > > > first. Fix the expection of the error message. > > > > > > Tested: > > > # ./test_verifier > > > Summary: 1130 PASSED, 538 SKIPPED, 0 FAILED > > > and the full set of bpf selftests. > > > > > > Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id") > > > Signed-off-by: Hao Luo > > > --- > [...] > > > diff --git a/tools/testing/selftests/bpf/verifier/ld_imm64.c b/tools/testing/selftests/bpf/verifier/ld_imm64.c > > > index 3856dba733e9..f300ba62edd0 100644 > > > --- a/tools/testing/selftests/bpf/verifier/ld_imm64.c > > > +++ b/tools/testing/selftests/bpf/verifier/ld_imm64.c > > > @@ -55,7 +55,7 @@ > > > .insns = { > > > BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0), > > > }, > > > - .errstr = "invalid bpf_ld_imm64 insn", > > > + .errstr = "last insn is not an exit or jmp", > > > > but this completely defeats the purpose of the test; better add > > BPF_EXIT_INSN() after ldimm64 instruction to actually get to > > validation of ldimm64 > > > > Actually there is already a test (test4) that covers this case. So it > makes sense to remove it, I think. I will resend with this change. ah, this test validates that half of ldimm64 at the very end won't cause any troubles to verifier... Yeah, I guess now it's pointless because it can never be the very last instruction. > > > > .result = REJECT, > > > }, > > > { > > > -- > > > 2.28.0.806.g8561365e88-goog > > >