Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1100554ybc; Tue, 19 Nov 2019 14:35:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzt32ISdS9nZ1FjkbxFcQ9aEmvJc6lhqtH5CfZQGog/tzLqNDC+UcQXn4orrxwAwkpODOdI X-Received: by 2002:a17:906:7708:: with SMTP id q8mr101860ejm.33.1574202920697; Tue, 19 Nov 2019 14:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574202920; cv=none; d=google.com; s=arc-20160816; b=QlG6K1eMewCq3Kugf6p1Nynily0qockX22r4pfLzQPrjWg8mD7TFhljV2WxIaQUuoG mpJJEGdjgCe4eGzsH04+YBt+xfmAyZr3thxvbM2fGybuHiBfRrIkb04rtYYM68B2KVb+ h5B66CRcHD5UOmFBO2cRoXMI9vwNzOoLlAvnOItdQcAGAQ87mf/R79gSqFFayQgZSF/u vgmHe8LbPNAk7+VncR1/SWjSHhlCwsdmt6245ksgspqa//4If6hK/WKS5O6f1sWVY5ZF FgMqTbMDf0shIdVVSG1DshkY8MsHh6UJQALnAK1kqn0PXbplJX8DCcuDCGgVEQ6kmj69 R1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=wUxu2E7yq8HSrGs2Snujibznuu5fJg9NwhoB4yurP9Q=; b=ehuKueY7HwQXWzJQKLGqMt/UiVZTsT1hkZ1cLjawe4df4BsZNmHc7Nf1VUuYzbyw2w kRDR4tgRpEnJANesvRIiJYAKqLkQUecBTrRxSfC3ILji9DAH4IsMbJySdbeoI9lEhWGD 3rmp5CyE6joVAU0d8kHit9z6whq7haF84DGpcvS7PBm9HthttQ8L18OqTOrLKzap9G/r Z2VZFwz1vqd9arRxdlAPq9pQkJwd28LLdI891P3SPjH05DZq+p1Dh5899EjksBQcCBSv cHlv+qdCen9T4BDLvv16na40dJVZvI/iQbbccOBDEPdEcfm48Q+6+eAZq0CaPrqywsdL 4pBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hicbRw4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id me16si14786498ejb.158.2019.11.19.14.34.57; Tue, 19 Nov 2019 14:35:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hicbRw4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727194AbfKSWdR (ORCPT + 99 others); Tue, 19 Nov 2019 17:33:17 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:46354 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbfKSWdQ (ORCPT ); Tue, 19 Nov 2019 17:33:16 -0500 Received: by mail-qk1-f193.google.com with SMTP id h15so19435478qka.13 for ; Tue, 19 Nov 2019 14:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wUxu2E7yq8HSrGs2Snujibznuu5fJg9NwhoB4yurP9Q=; b=hicbRw4ECbje8ifkawEBY07FlCN/R/GSwaaNqRGapBb55gyvgYQVB9OQZ4SSqJO7WY KI7Ovv1jE3DIaSMUg8u8ERgbQy9Ia+DTZFznqWNnnxFYinUfmVb/rn6Rli1cqN/YpktO v9K0CwxaoH99zTDVGsKPkfX1A/uUNVJ2PfizWAdm1jZvddalzAtV0eBDTK9NPue7k5q5 sFtoDIRI2fjcCVoi9bBpaa29LiRSvR8AGeMq5x6rU2QrID1uUhLW+nr+HHS/oCWB/EfA /c7P++NJXeeCD0IlKOMwhqU7gughRpjf+36ivMzT5JWgFjS+Jefimad7C4Gw24wv8KaS mfPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wUxu2E7yq8HSrGs2Snujibznuu5fJg9NwhoB4yurP9Q=; b=RTt2ZdtebJjJFJSQnLi4Itx3dI3d4U3s9itZDNTZ9IRnkjAg/gFqkucCgSg1idDvEb KzPK+PvLPC/X6ae3yHsi9a2CXipVpzZlx+BXX1sZv70wNLi70tVl2WYaxAHnRZtNtNHR z8AB90S4a0uDJ292GFfSkZbb/JmJh9kzmJmGhteMKsyMac7lukUhpWSXjh29Sp/6zdYq XsKW8EzPPwjePMVRLh256GsRAOLjmDZOVnu9rs1r7cO5+OfsyjU0FQGzx8gBx66PwXGY iLG1rXxrsBWwBxulpEXDE4SBLfGe2/rYHI7K8hJLVRUpG1//RkJnogM163zHM+foyC/y cK/w== X-Gm-Message-State: APjAAAV352QLICoQowOSWGKu2ZcX/gtYmiHJoxNzjXu09TOVsnTsA4K9 MBDVis6zNflXYDCTeTbTvbs= X-Received: by 2002:a37:a211:: with SMTP id l17mr30134923qke.139.1574202795667; Tue, 19 Nov 2019 14:33:15 -0800 (PST) Received: from quaco.ghostprotocols.net ([190.15.121.82]) by smtp.gmail.com with ESMTPSA id a6sm12906431qth.74.2019.11.19.14.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 14:33:14 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 02DB140D3E; Tue, 19 Nov 2019 19:33:11 -0300 (-03) Date: Tue, 19 Nov 2019 19:33:11 -0300 To: Jiri Olsa Cc: Alexey Budankov , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v3] perf session: fix decompression of PERF_RECORD_COMPRESSED records Message-ID: <20191119223311.GD24290@kernel.org> References: <20191119200510.GA7364@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191119200510.GA7364@krava> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Nov 19, 2019 at 09:05:10PM +0100, Jiri Olsa escreveu: > On Mon, Nov 18, 2019 at 05:21:03PM +0300, Alexey Budankov wrote: > > > > Avoid termination of trace loading in case the last record in > > the decompressed buffer partly resides in the following > > mmaped PERF_RECORD_COMPRESSED record. In this case NULL value > > returned by fetch_mmaped_event() means to proceed to the next > > mmaped record then decompress it and load compressed events. > > > > The issue can be reproduced like this: > > > > $ perf record -z -- some_long_running_workload > > $ perf report --stdio -vv > > decomp (B): 44519 to 163000 > > decomp (B): 48119 to 174800 > > decomp (B): 65527 to 131072 > > fetch_mmaped_event: head=0x1ffe0 event->header_size=0x28, mmap_size=0x20000: fuzzed perf.data? > > Error: > > failed to process sample > > ... > > > > Testing: > > > > 71: Zstd perf.data compression/decompression : Ok > > > > $ tools/perf/perf report -vv --stdio > > decomp (B): 59593 to 262160 > > decomp (B): 4438 to 16512 > > decomp (B): 285 to 880 > > Looking at the vmlinux_path (8 entries long) > > Using vmlinux for symbols > > decomp (B): 57474 to 261248 > > prefetch_event: head=0x3fc78 event->header_size=0x28, mmap_size=0x3fc80: fuzzed or compressed perf.data? > > decomp (B): 25 to 32 > > decomp (B): 52 to 120 > > ... > > > > Fixes: 57fc032ad643 ("perf session: Avoid infinite loop when seeing invalid header.size") > > Link: https://marc.info/?l=linux-kernel&m=156580812427554&w=2 > > Co-developed-by: Jiri Olsa > > Signed-off-by: Alexey Budankov > > Acked-by: Jiri Olsa Thanks, applied. - Arnaldo > thanks, > jirka -- - Arnaldo