Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp58265pxu; Tue, 6 Oct 2020 18:45:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/ZK0lD1rSVrlh62EsvPtDns6Ps5zggYi9Zu1Q6Ag+z5scH9ctOq0xv5LrrfNtjSVkZ9pf X-Received: by 2002:a50:dec9:: with SMTP id d9mr1041717edl.145.1602035108637; Tue, 06 Oct 2020 18:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602035108; cv=none; d=google.com; s=arc-20160816; b=T+ptp8vY4meyUhrAEUeSfvgTG12epeZoLB4Yu9dpIsQxkRnpM4cZ+W0VbrU/bSs7Sm ZutiTlJybmFN0L3uL9KB2wik2H87jheKEZqvMDXwacx66ZUABYy+gFOhBNwXlPt6hEF2 VduKM+BvlD3d62+Nv64kv0FAMW4nhhzG6R6c4HgeQMWWnCPn9IW9UX+zvFxekmDKlXyg q5URy6JbgP/ddFXRcicx95qOhcxddZ3d2Ks4jYQISpJyKJlA6sbMjRM8Ej0IkQ18hqrF XQTw1pdUom4IzwZOBTBelD4kx8AOBEHg8pkC/CvGJLSJAj2yaOenangu32LAMwgiEGc4 OTdQ== 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=eRgpBFDQ71r3jZmAEWAU5ispHXswfcNPKvXGtL8hegk=; b=UZaqEFF+AfPoM9VMp/OtW52NhzzJQMWMiDAiYgPTDHxAqmdkRok9VTpSpP1XwruEdw abV6jl9yhGdy7KSkeZJzLlh7kUoxVZnN82LlNtOIf0sxpjJv3Bw/mS06FP9m18c0dWnw wt1kat6ohR03/UyyD6TZer/BiYDSIb9u1xErMAo+9ODp28cAR/M4bTXcH5uoJ/vvV0q9 Y8t4RNsrewcTZkms84My0N5bK3DoAG5piP1bq8U9ehrpkcYgPfy/bkQvYe62LPWNweI9 7GAtUAF7sHr1jpCgNGy71BBfyO9qJr5kXxEgZWjnkIniYUFtFJTUKrPpXtCsU5BeRjZI 7V3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MrdR1Mx+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si332531edt.210.2020.10.06.18.44.46; Tue, 06 Oct 2020 18:45:08 -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=@google.com header.s=20161025 header.b=MrdR1Mx+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgJGAvG (ORCPT + 99 others); Tue, 6 Oct 2020 20:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbgJGAvF (ORCPT ); Tue, 6 Oct 2020 20:51:05 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 639C5C061755 for ; Tue, 6 Oct 2020 17:51:05 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id md26so474874ejb.10 for ; Tue, 06 Oct 2020 17:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eRgpBFDQ71r3jZmAEWAU5ispHXswfcNPKvXGtL8hegk=; b=MrdR1Mx+X+SeJ23S2PnH5HipsAt0mLLjg8Qsk3HtHtaMT6qKs80nxn/ZtQD1O4E4k9 yzMsQ1eaaxP+we98Wk+3I6R7MK5Iwgd/AiZ/8Y22njGHOlNX6NnC0rRBTTGQsoKLykX1 rL81TNWoUTP2mYuNE7Z7vLtG8YEDodvSY1heIAHezmt8ug6ELrA9l9JGlPWrbQiKD/w1 Ot3G7Z6uVl2UFVh5isZSYS78Wx/Rx0MnNZeIcnJZW6HFni9vDb2lh/UPm5I2N1gZSpQH hnU6+jis26zSubOANjvPkfAWHDskkMjbaX4wyWQb6JfwTolFKMuI/h9yWP2dkim5B/3N +Qbg== 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=eRgpBFDQ71r3jZmAEWAU5ispHXswfcNPKvXGtL8hegk=; b=KdZ+Chph62VTNcrrfoid3NKdiR/nD8rHdonvURWGyH3DWY61bQORsWastA9kChFvZj LAhTTtLGhY8/yIU3kWeFSctvFsZLnchAYj4JK+fkU9RrxJZXzz2xWNgXnnRyJkip13Iq 5Vwn7nARWmRWfbtsLMBmNrMKvrA0mRXNG/vA857+I8IKZ3UB6Wcc0UvHBKG2Zt44r5/7 ftNsI3SABdemk36o4imh9MzVNG8csYYUzaS4Ca8HrDuUaF/FhaEVNQjukElXofkZlwPr A0523n6Rjn6Udf/4dyUNDn+NCJ6LQBHOtS2rPOScZECCdJq5l/e5Y3SzfnlpfgZcQ4o9 Kmuw== X-Gm-Message-State: AOAM531YYVQhYaJ6fXIIMQ0B3+2O4szqOIW+1DWJ2Po7fxVMUXidlz16 U+XhKQWWYDHehkL0h+2U6O+b6rtoGnzqlqaCj61xpA== X-Received: by 2002:a17:906:7d52:: with SMTP id l18mr735056ejp.220.1602031863860; Tue, 06 Oct 2020 17:51:03 -0700 (PDT) MIME-Version: 1.0 References: <20201006231706.2744579-1-haoluo@google.com> In-Reply-To: From: Hao Luo Date: Tue, 6 Oct 2020 17:50:52 -0700 Message-ID: Subject: Re: [PATCH] bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64 To: Andrii Nakryiko 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: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. > > .result = REJECT, > > }, > > { > > -- > > 2.28.0.806.g8561365e88-goog > >