Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp12367pxb; Tue, 12 Jan 2021 18:27:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9mtXnvtzf7OZrtHnyDS/N0daF7DDUDpss1erdCuN5sltk2DbRzEnhSJFF1Ghyw515Fbbz X-Received: by 2002:a17:906:3094:: with SMTP id 20mr1203046ejv.218.1610504830090; Tue, 12 Jan 2021 18:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610504830; cv=none; d=google.com; s=arc-20160816; b=ibJEjOUHnKlYKny5GjqfU9ysAiJ9Bl5MGE0oPyzlNsvkMtHZ9Ik1Nb10/UmtggOzYZ 3kMZXoZ5N43rP8a8QD3Gqg8EeZ3wDTGbzjKIedilDMPXRA5/3qUk+iqH6aawH8HDjaIA 79zVRHWNK+c+PufJHRy4cuNyI7RD9n18CZL2tKNU0fDlO6s3TKGagfsFe9PGkn95UAiJ 8BxhY5qA7hh6QEdpJmDZ6yyKc7wMu2FWvZnGj25N6+A0H67QXOSYkrTcte+DLJxbHhT1 VDWEyKsFRXrjL6uxLMW7lwnWvW2aqo7l/V1ZStvnY7yexg56IxrIpJnevW79LQWQJaJu jmGQ== 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=TNPja6jXIGq6+WeUuKATWjnFXyMnNMz8ngrg6c9AKD0=; b=Km/k3RpCnEYJlfOwkCbQGL/KWSOByul1NVEn0Fiqa/ghL2MlyfZEFjJYM5wauYPIS/ m5kK7PUDN19YUOAwAr1shh1Nc1GQ/c6jqVJzk98svh9zqvG2TqTne8kcy2dfmMMWo3Rv WazUu/3aWuTe7iLW/nvnUhWAzxVIWhnlcuZXynwQXVfIbtjUUDHgFwbfrPw44miJ85D2 DL4i6ANMRyJk8mxNuUWurJQFVbODI71ayNR383bTUfhnlCVUjrWMWM+DYpXs4WpWRpvZ c8EXJ2xYnfn4JbskSLt09LvpeWIj6iPpB3Ws8AOPO3yaE5bdvq9l24DZXEmCifmYVUlu xYsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uu1jt8YO; 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 ay17si290330ejb.580.2021.01.12.18.26.46; Tue, 12 Jan 2021 18:27:10 -0800 (PST) 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=uu1jt8YO; 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 S1731591AbhALTRQ (ORCPT + 99 others); Tue, 12 Jan 2021 14:17:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbhALTRQ (ORCPT ); Tue, 12 Jan 2021 14:17:16 -0500 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E20C061575; Tue, 12 Jan 2021 11:16:36 -0800 (PST) Received: by mail-yb1-xb2d.google.com with SMTP id r63so3185868ybf.5; Tue, 12 Jan 2021 11:16:36 -0800 (PST) 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=TNPja6jXIGq6+WeUuKATWjnFXyMnNMz8ngrg6c9AKD0=; b=uu1jt8YOQDPTwOiEnroeayfpLf1D92LEYOVacbYjPt7p1jd1Bvcazv++l6w76EcvQl 8Ri5Nrg1mP+zTo3mOK1ffdacadGEQc1nX5JwphjAYug/LqWFJLoUugg6g1sxqakQL/7O bnLWHRE7q2JsHX21JKEr7axULwLP33NkO4hGyhKV+cn8k+OsZfydt9jNdAxTlgpgbbLY ul8Kp6VqDzBBeazvgy++vwNbMq91IWBHQMh42KM8BQofGjU5icKldisJjcgvnwhpd4bK PcJ2a21kBGwuq/xtaQSW+lNBX1ZlAua8LTMks2aXJwJaN4wwO9k/9GbBevIsuCad/hKT fEtQ== 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=TNPja6jXIGq6+WeUuKATWjnFXyMnNMz8ngrg6c9AKD0=; b=hO9ty3cVPQ2zhtyy2cBn7pVoPlGTse8w3MBixyvpdfCwiQNmtDRoWE4Rz5qR91UEg4 D2ZdTYP3kt+VU/MsAFlsEVUpsDQmFlMFNBN5b7l7IBBOI61gCLv30EuNWLS3IpzD40Sa Y+wm1zOwUr1KHGxDBGjcbaHOhtYbYOxMR3SVS7IT6OdnelPqzek6yQtiU0WEl3c/OD0F Xmo3UC7nFa/KANbWRSjrDfbT/oZSFXTZ3q0DedEJ5x+UM5U3qqELinw9pq2t9Fjrxtoc XoE5gZ4SrQSwaAmq2RyphM04OFjijIRyewpDuHR2eC18fRdvUfGkrd1HQ9Hr5RvJ63Pf J1OQ== X-Gm-Message-State: AOAM531dOoEz7VE+b0NE5Ojvfn3JJNZNrnM55PMtxcP4uQgVHLSDGLDl 7yT2XSKpyIFnL2OBp5A4ThYlTe4DT67ZMQQiIEQ= X-Received: by 2002:a25:9882:: with SMTP id l2mr1232712ybo.425.1610478995598; Tue, 12 Jan 2021 11:16:35 -0800 (PST) MIME-Version: 1.0 References: <20210112123913.2016804-1-jackmanb@google.com> In-Reply-To: <20210112123913.2016804-1-jackmanb@google.com> From: Andrii Nakryiko Date: Tue, 12 Jan 2021 11:16:24 -0800 Message-ID: Subject: Re: [PATCH bpf-next] bpf: Fix a verifier message for alloc size helper arg To: Brendan Jackman Cc: bpf , Alexei Starovoitov , Daniel Borkmann , KP Singh , Florent Revest , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 4:39 AM Brendan Jackman wrote: > > The error message here is misleading, the argument will be rejected > unless it is a known constant. > > Signed-off-by: Brendan Jackman > --- LGTM. Acked-by: Andrii Nakryiko > kernel/bpf/verifier.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index 17270b8404f1..5534e667bdb1 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c > @@ -4319,7 +4319,7 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, > err = mark_chain_precision(env, regno); > } else if (arg_type_is_alloc_size(arg_type)) { > if (!tnum_is_const(reg->var_off)) { > - verbose(env, "R%d unbounded size, use 'var &= const' or 'if (var < const)'\n", > + verbose(env, "R%d is not a known constant'\n", > regno); > return -EACCES; > } > > base-commit: e22d7f05e445165e58feddb4e40cc9c0f94453bc > -- > 2.30.0.284.gd98b1dd5eaa7-goog >