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 X-Spam-Level: X-Spam-Status: No, score=-13.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 269DEC48BDF for ; Thu, 24 Jun 2021 05:51:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01470613E7 for ; Thu, 24 Jun 2021 05:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230252AbhFXFxm (ORCPT ); Thu, 24 Jun 2021 01:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbhFXFxl (ORCPT ); Thu, 24 Jun 2021 01:53:41 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46A1C061756 for ; Wed, 23 Jun 2021 22:51:11 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id j11-20020a05600c1c0bb02901e23d4c0977so4774898wms.0 for ; Wed, 23 Jun 2021 22:51:11 -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=qIntmPPQbCP87xjj7bh0r4cc7gAnVPHyQczxOblAUok=; b=Pw+CHyKfzVoGPxKzPdzts7rgNexSCkFJOGvcpU3nkO7NJ0oopux5inTcl0hgNAKLib vcaT0spKtYWK243o7ojM6gQn26yFIL7afapjchrpJmPL9oAZTdW/RZcV41CNJ8XHp8Hq 1yJZlL/POWTmn6AxwMTPuhlioTRH79XeCgRQfWFxrAHkN3pMEchxZXt2FFi3TJwK/+u6 /iGCjm4H+f11Ezv3iZlmtwqm6SuyQvyFHIxdCr9LevJSImpl3Pu9GHyuBAhQNXzDiF8K r6yu9zeik4aIwQBAjLlIw3YYS6A2XMcBNI6GwPngGhxxiWuyb29Jcytk/czm02HsyeCg 1J8Q== 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=qIntmPPQbCP87xjj7bh0r4cc7gAnVPHyQczxOblAUok=; b=oAq7n0HdXU8lvwg8zp5ZA2s81wL6xxEpT3W1twBjhzd23t44nPPuKKsVhxemF2KQOs qSvjKqAU0+IXO0GDotzW+60ty6N593iN2bzJDfLgvW0ZKrYmdyfbi4a5u03gts5LP9G6 Xcj8JCa5tvnSzjpubbQvNRAAJY4mXUP+3x4kqTb28qILXsrqhRViuxRkoGxsD4SITK72 hpD42awFTvFQl3XyqQrK+Egpf8GQgUf/e1p82ANis4PszGm+W7tcqw/etiWJEFPuuKnn vPLfQO3v+bR36bQp3xYmZP2FyVUbS89fvQQCz8QmWbTm4wl3x5JJSMalvZpLUTiLF+UK /XlQ== X-Gm-Message-State: AOAM531ivJGy+pTLnAYHA/2Eepmug2rrwjyTdPXW2x0VUkVUz1/HM4yx 8TKMLbrQFv2/xlcCfLpL0i12Iy1M+tuVsj+U6L1HcQ== X-Google-Smtp-Source: ABdhPJxrH2cGMeaZzrDFNYUrt8zZ/feBYir8lI7PV4TIGt8vCQ2mBsMkEF7rGg+GGku6t2TUL+cDh7IgQM3Zrh2vVOg= X-Received: by 2002:a05:600c:1d0a:: with SMTP id l10mr2199670wms.124.1624513870371; Wed, 23 Jun 2021 22:51:10 -0700 (PDT) MIME-Version: 1.0 References: <20210617194326.2107129-1-cjense@google.com> <20210617155828.4e9c7f45@gandalf.local.home> <20210623210621.3b35e0d4@rorschach.local.home> In-Reply-To: <20210623210621.3b35e0d4@rorschach.local.home> From: Ian Rogers Date: Wed, 23 Jun 2021 22:50:58 -0700 Message-ID: Subject: Re: [PATCH 1/2] libtraceevent: Add eof checks. To: Steven Rostedt Cc: Claire Jensen , eranian@google.com, tz.stoyanov@gmail.com, linux-trace-devel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On Wed, Jun 23, 2021 at 6:06 PM Steven Rostedt wrote: > > On Thu, 17 Jun 2021 15:58:28 -0400 > Steven Rostedt wrote: > > > On Thu, 17 Jun 2021 19:43:25 +0000 > > Claire Jensen wrote: > > > > Hi Claire, > > > > Thanks for sending the patches, I'll try to get some time to look at them > > (note, that I have a lot of other duties that I need to finish before I can > > get to this). > > > > > Added checking for __read_char and peek_char to make sure value is not at end > > > of file. > > > > > > This issue was found while fuzz testing. One of the test cases created an infinite loop because __read_token had reached end of file. Checking was added to all cases where this may occur. > > > > You don't need to fix this now, but for future reference, we follow the > > Linux guidelines on submitting patches which includes having line breaks at > > 74 (although I use 76) bytes, for the change log. > > > > This makes the change logs easier to read. > > > > I made the mistake of adding this patch and pushing it to a new release > without running my test suite against it. It ended up breaking the parsing. > > When running with --debug -N, I get: Hi Steve, sorry for the breakage, could you give a full reproduction command? Thanks! Ian > [ftrace:branch] unexpected type 1 > [sched:sched_switch] unknown op '' > [irq:irq_handler_exit] unexpected type 1 > [timer:timer_start] unknown op '' > [kvm:vcpu_match_mmio] unexpected type 1 > [kvm:kvm_wait_lapic_expire] unknown op '' > [kvm:kvm_vcpu_wakeup] unexpected type 1 > [kvm:kvm_userspace_exit] unknown op '' > [kvm:kvm_pv_tlb_flush] unexpected type 1 > [kvm:kvm_ple_window_update] unknown op '' > [kvm:kvm_pio] unknown op '' > [kvm:kvm_pic_set_irq] unknown op '' > [kvm:kvm_nested_vmrun] unexpected type 1 > [kvm:kvm_nested_vmexit_inject] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_nested_vmexit] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_nested_vmenter_failed] bad op token > [kvm:kvm_msr] unexpected type 1 > [kvm:kvm_msi_set_irq] unknown op '' > unknown op '' > [kvm:kvm_ioapic_set_irq] unknown op '' > Error: expected type 5 but read 0 > unknown op '' > [kvm:kvm_ioapic_delayed_eoi_inj] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_exit] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_emulate_insn] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_cpuid] unexpected type 1 > unknown op '' > [kvm:kvm_apic_ipi] unknown op '' > Error: expected type 5 but read 0 > unknown op '' > [kvm:kvm_apic_accept_irq] unknown op '' > Error: expected type 5 but read 0 > [kvm:kvm_age_page] unexpected type 1 > > with the patch, and no errors without it. > > I have to revert this patch and push a new version out. > > -- Steve