Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2524457rwn; Fri, 9 Sep 2022 15:29:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5nv/p0OJmBi697knDq7l11iC1B2zjCfmVUW8WJKqWZ+CzJEHZHy1ewInFoB6P1ugZO0uw6 X-Received: by 2002:aa7:8115:0:b0:537:bd1e:1519 with SMTP id b21-20020aa78115000000b00537bd1e1519mr16118700pfi.14.1662762561126; Fri, 09 Sep 2022 15:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662762561; cv=none; d=google.com; s=arc-20160816; b=wDBUIK0CVP307k3MM5Zyd8R+2IqpeGWPhUouAJ3YFDMI1qspNEJiaovXCR4Eo37LAg pzVuhrDvhMiyftd2fJZsBLt0eh+yrQVqN1nTVaNZIQLkyp2MN0MPKzaDbJ5m1qoqmZDH bxjuI5pEH6sGcCYAmLnbNWHHm2ThG5QqV7xZTy7/D3FZebQFZKAsV2PSXb+F3QWuoMIl qBtyLInJaPIby/ctzeueRAVBmfttaCf98tMqVWmVBgUj0zYl7H1NcOqSwMSm4GBQnZrH KYe/nmcyfaOZvn1qaYM5O+l2oYNk5dk6Bt1dFjlmbtFejcQvhb6nMOpyulLysV6fA5UF FSEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=RQ/RHVVHpmpB1V0DuvGfzSeOFbDRdXln7rq3LTWarTA=; b=E9ilENTZp7lvYGHFCcMpt1iKS7WkllR1jg02ZBSx46F9LbB4hjyLQUudsM5ein5Vwt ynxbvHi+4/xQofK7yyf0ycszQ2GfLhkEGZ38aco0HTxxnc0CzNa1+42dBFe1w6EqJXWy C6gtYnRTBTFL5BqzBCE34pdktojnGJur+8xmEP5CiihwUVWdUI2EsVko9OCnY3b0Dhi8 bnj3OwVEYjPTix8lCPSd+RIXA8lY0aZGBAYKvlrjkdI08xJpbEi3sypXGfbI4fVzKJEI 47yrJ1f0xR/GavCSnCkhNWvYkQBBIX35nbUFxVSyrRqmaYDEfJHQ/MSYgl/URbfd3QxG tI8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Y9COy7bD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902c40900b001714352fc5asi1900760plk.404.2022.09.09.15.29.09; Fri, 09 Sep 2022 15:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Y9COy7bD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231602AbiIIVn0 (ORCPT + 99 others); Fri, 9 Sep 2022 17:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiIIVnX (ORCPT ); Fri, 9 Sep 2022 17:43:23 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05C8F13E4EF for ; Fri, 9 Sep 2022 14:43:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 184-20020a2507c1000000b00696056767cfso2644338ybh.22 for ; Fri, 09 Sep 2022 14:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=RQ/RHVVHpmpB1V0DuvGfzSeOFbDRdXln7rq3LTWarTA=; b=Y9COy7bDApy6jOXUDs8cE/zwtaXpJVQs2yW5bcVJUB9dEen41pIRSOfHXVEy3XpSMr In1BWDC4ycuBveJyi34VQdSRPykN8pakuW1CdhDdvg2KmEW/9K55JFtORM9Zzbuwc8UM YbQ/ghAlbbAAFF1kOkK5N9S89JsdjbS60gmnh6oNl/ut1jCSz21+k+9fiZIREwDWFrSK NXFJWd8OAt+sTzRI9S7CN1P8dYDaGrnXc4gqLtbT7mSzgg1U5JSXaL8E+FfXULJZ/rJM J2SMtm04BpMuLnTwrpW8SL7iid6zwqKbu6bKDIsl6pj5Y5HgtWT8O+Ee6YOi6s3hURjQ eKlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=RQ/RHVVHpmpB1V0DuvGfzSeOFbDRdXln7rq3LTWarTA=; b=T3CMXmxJGr2rv16GmuKehwZWJGlsa/XopbAtdOxBSEvSaaImPKxYg/U+yy7FshWwzM I4ImJh+OTqxUSuTUsJGYVoxThsytZ+LbE+YyYiAmmUQVMlA9nObavtbPqwLFddpdS6WX fkvkLf27Urk7OM24O9QP00pAmyTYrVj/IHNKqkqmQcnRPNXbxVqHK0tBhlInO4tlw3g2 KzdbiQJ0kAyvuq0emn/Wzi8ueiMD9eaoJNq+qfcDAio9FxmUwoPnpPWied/qwGa2G6bM Ce6UN90HjQX6moQliuUJf4tb/H6+2ZCSRfzn6iZm7gre7zLQ+uq2szk3GjkgGreE0tlE rbIA== X-Gm-Message-State: ACgBeo0u1OyPJPzhQzgkyi2Tlrl3yTkwAQSn8m/s90K50YModQjpjkOa oo6z6Divzi0wl3bxVKbVwKvbEdg= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a25:bed1:0:b0:695:8192:8d1d with SMTP id k17-20020a25bed1000000b0069581928d1dmr13187190ybm.533.1662759800271; Fri, 09 Sep 2022 14:43:20 -0700 (PDT) Date: Fri, 9 Sep 2022 14:43:18 -0700 In-Reply-To: <20220909211540.GA11304@bytedance> Mime-Version: 1.0 References: <000000000000e506e905e836d9e7@google.com> <20220909211540.GA11304@bytedance> Message-ID: Subject: Re: [syzbot] WARNING in bpf_verifier_vlog From: sdf@google.com To: Peilin Ye Cc: Benjamin Tissoires , Andrii Nakryiko , Alexei Starovoitov , bpf , Daniel Borkmann , davem@davemloft.net, haoluo@google.com, hawk@kernel.org, John Fastabend , jolsa@kernel.org, KP Singh , kuba@kernel.org, lkml , llvm@lists.linux.dev, martin.lau@linux.dev, nathan@kernel.org, Nick Desaulniers , Networking , Song Liu , syzkaller-bugs@googlegroups.com, Tom Rix , Yonghong Song , Peilin Ye Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/09, Peilin Ye wrote: > Hi all, > On Fri, Sep 09, 2022 at 12:54:06PM -0700, sdf@google.com wrote: > > On 09/09, Benjamin Tissoires wrote: > > Yeah, good point. I've run the repro. I think the issue is that > > syzkaller is able to pass btf with a super long random name which > > then hits BPF_VERIFIER_TMP_LOG_SIZE while printing the verifier > > log line. Seems like a non-issue to me, but maybe we need to > > add some extra validation.. > In btf_func_proto_check_meta(): > if (t->name_off) { > btf_verifier_log_type(env, t, "Invalid name"); > return -EINVAL; > } > In the verifier log, maybe we should just say that > BTF_KIND_FUNC_PROTO "must > not have a name" [1], instead of printing out the user-provided > (potentially very long) name and say it's "Invalid" ? > Similarly, for name-too-long errors, should we truncate the name to > KSYM_NAME_LEN bytes (see __btf_name_valid()) in the log ? Both suggestions sound good to me. Care to cook and send a patch with a fix? > [1] commit 2667a2626f4d ("bpf: btf: Add BTF_KIND_FUNC and > BTF_KIND_FUNC_PROTO") > Thanks, > Peilin Ye