From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D602C433EF for ; Thu, 7 Jul 2022 15:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbiGGPqC (ORCPT ); Thu, 7 Jul 2022 11:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235202AbiGGPqB (ORCPT ); Thu, 7 Jul 2022 11:46:01 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72F803055D for ; Thu, 7 Jul 2022 08:46:00 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id dn9so27851388ejc.7 for ; Thu, 07 Jul 2022 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AGEBbie67q5TXwVzOJXE7BN9/2n5IbFsl2IvZ4cbCcE=; b=goedwjqoQ2sWlaUqLeZOrUhs9AKIg6BJq+VcnIzpR1u4OlsdoPmMpxHBA9CcgJ9MX5 PmHiYlknW7+KelZITx2/4lh2ZDUAnpw7fAJJFeKYeVsmH38K89R19JRmSOj3YDv1jFKp 2RBHLdGI3tfrNTKyxXrZ69PzqvIWdKuuPnWa2yOX9l0lY5wnEDnn5ti/DZhRtfHy8b+v IZPIqjGYppqtz85aS79S3+ghWXUfwPpXo4NCiGmJHR64TZcFomqUaKB/IwFHi/ePliVE nsiK1IgzHoz99SPUGNpom4RH+INBgM5xZl19Na5tWdpHaL31LladA73UBA8Y6E/cY2So Mp+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AGEBbie67q5TXwVzOJXE7BN9/2n5IbFsl2IvZ4cbCcE=; b=cXWMPaT2720SPHHORZFAmvEpDwPx67hl9bsBbeEa84KhrNlOME4Rn77y+VqoP/pHwr Mc42tWJcjHLeh/zKd9LuufzsfEzchl8lmlIfVMSW+1PFWRTS9qihfGpw6CMEZ+DbtV2q BCHQ6Nipq0YFFYZADDIx9j7Y3eTEgYVhBNPiQK1Cq+HYxeSeOzChwKkFR6028W2o4OLv g9HSzItq10CDtk8JzE3nJ4pKglZ0Gs5RGZFOqDsvTLOxTm5aAMD//igyeSPkvLdajorY qBlmx96lRZrlD5JiHAC1qpRM3BC7Pec72C/doIb9G6U7IjQ/P8T+4eREM0RfR3LtZtKd n9mw== X-Gm-Message-State: AJIora+mF9eawQM777rreyiXSn6Jo59/fZWpzCo1esigEzqzJfShpA3i YmdLsH1UmeB3SLPQ1k5lSbKGxFip2655NyaRw1Q= X-Google-Smtp-Source: AGRyM1ulov115nvGKkxiMqWRfqRf9lMLJAh+4WYm5LVfsH1/Jtb5ZM5HC+/wR6bk6c3DyxMzSfz2E2Z0x67JEWIJWPc= X-Received: by 2002:a17:906:5189:b0:722:dc81:222a with SMTP id y9-20020a170906518900b00722dc81222amr45443816ejk.502.1657208759039; Thu, 07 Jul 2022 08:45:59 -0700 (PDT) MIME-Version: 1.0 References: <20220706155848.4939-1-laoar.shao@gmail.com> <20220706155848.4939-3-laoar.shao@gmail.com> In-Reply-To: From: Alexei Starovoitov Date: Thu, 7 Jul 2022 08:45:47 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2 2/2] bpf: Warn on non-preallocated case for missed trace types To: Yafang Shao Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Quentin Monnet , Roman Gushchin , Hao Luo , bpf , linux-mm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Jul 7, 2022 at 3:30 AM Yafang Shao wrote: > > On Thu, Jul 7, 2022 at 12:50 AM Alexei Starovoitov > wrote: > > > > On Wed, Jul 6, 2022 at 8:59 AM Yafang Shao wrote: > > > > > > BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE and BPF_PROG_TYPE_TRACING are > > > trace type as well, which may also cause unexpected memory allocation if > > > we set BPF_F_NO_PREALLOC. > > > Let's also warn on both of them. > > > > > > Signed-off-by: Yafang Shao > > > --- > > > kernel/bpf/verifier.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > > > index df3ec6b05f05..f9c0f4889a3a 100644 > > > --- a/kernel/bpf/verifier.c > > > +++ b/kernel/bpf/verifier.c > > > @@ -12570,6 +12570,8 @@ static bool is_tracing_prog_type(enum bpf_prog_type type) > > > case BPF_PROG_TYPE_TRACEPOINT: > > > case BPF_PROG_TYPE_PERF_EVENT: > > > case BPF_PROG_TYPE_RAW_TRACEPOINT: > > > + case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE: > > > + case BPF_PROG_TYPE_TRACING: > > > > BPF_TRACE_ITER should probably be excluded. > > Right, I have verified that BPF_TRACE_ITER can be excluded. > Will change it. Probably more than that. See that your change broke BPF CI and selftests are failing. Which means it breaks existing bpf programs.