Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4671602ybi; Sat, 6 Jul 2019 10:21:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpyV8Dl3zADnxQSOjSPd9And7Fj36hN4GUEgeBeqLqhVPbn2mAVIt9MXJvZYOcyqf+Q2GM X-Received: by 2002:a17:902:294a:: with SMTP id g68mr12758200plb.169.1562433699071; Sat, 06 Jul 2019 10:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562433699; cv=none; d=google.com; s=arc-20160816; b=0QOw4oBywg9fDPPjYRGv4l3WS7ZMwH4xRQprSflS/nRy2FBz9AXCtOStTThtLUXRgx WQhXS8xB3yqMt8A5VYfYD05nozj1ykqSNmhuwDW28Aovs6oScN96QBDs095ZWGVGoC11 ++jud5hVOc9L/Pgnq2pU31eRnNcnHHkCcigLILdNZkDlAdsWf0Llb39Hl2spZZn38+9K iIOYj+I+2xSo0BL8LqZpDwwQvGKTNiT3oGuEwvBPYPjL5QhR5tdefEYIyGwZxR1jT+ey GKwWC0JVO8XjoiVGl+y2X4cnedcdMMBA3v35QrJT1PVKvd8V0Fijwb39691s/PectnQS 5U0w== 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:from:date; bh=rjUhViZClL3TlPu+qeDLBhXO6i/RkL94QwObMuz/YXk=; b=fjAkgMHqED7PGwba5snsCq7wNqa/0VJjDq6nq0aJdrUdaCLErdyFahJadssFJLqUY/ 4FRtYFCWvj7lWiPVJirAU91rV+ud0J7LLNk2m066R2TX6GN06hz+QrSVOnrm13tHrhQ1 s1cR3ViK+W5SP/JhGixqHrwuMKRU1dBy9kZOBrJRBdvfcLGcpP5FMLptnpuUViiof6nT wkD61b/X2T8vE1Aye4faOi65M5lmoifyGcC0h/aFXSZLBBiT2HCcQtX6aA76cWkW4Q5G uapi3GyIczRrhZJUMfjMhS8WN85cfgnuhhEyJLQo49Pc1q4gsAfkWb8U4QKf5D2Dz6y8 VMGQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si12792119pfh.284.2019.07.06.10.21.24; Sat, 06 Jul 2019 10:21:39 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbfGFRU3 (ORCPT + 99 others); Sat, 6 Jul 2019 13:20:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38250 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbfGFRU3 (ORCPT ); Sat, 6 Jul 2019 13:20:29 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F539356F6; Sat, 6 Jul 2019 17:20:29 +0000 (UTC) Received: from sandy.ghostprotocols.net (ovpn-112-18.phx2.redhat.com [10.3.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D76C3844; Sat, 6 Jul 2019 17:20:28 +0000 (UTC) Received: by sandy.ghostprotocols.net (Postfix, from userid 1000) id 3AD10115; Sat, 6 Jul 2019 14:17:36 -0300 (BRT) Date: Sat, 6 Jul 2019 14:17:36 -0300 From: Arnaldo Carvalho de Melo To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, davidca@fb.com, jolsa@kernel.org, namhyung@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] perf: assign proper ff->ph in perf_event__synthesize_features() Message-ID: <20190706171736.GD2093@redhat.com> References: <20190620010453.4118689-1-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620010453.4118689-1-songliubraving@fb.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 06 Jul 2019 17:20:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jun 19, 2019 at 06:04:53PM -0700, Song Liu escreveu: > bpf/btf write_* functions need ff->ph->env. > > With this missing, pipe-mode (perf record -o -) would crash like: > > Program terminated with signal SIGSEGV, Segmentation fault. > > This patch assign proper ph value to ff. Thanks, applied. - Arnaldo > Cc: stable@vger.kernel.org #v5.1+ > Fixes: 606f972b1361 ("perf bpf: Save bpf_prog_info information as headers to perf.data") > Reported-by: David Carrillo Cisneros > Signed-off-by: Song Liu > --- > tools/perf/util/header.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c > index 06ddb6618ef3..5f1aa0284e1b 100644 > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -3684,6 +3684,7 @@ int perf_event__synthesize_features(struct perf_tool *tool, > return -ENOMEM; > > ff.size = sz - sz_hdr; > + ff.ph = &session->header; > > for_each_set_bit(feat, header->adds_features, HEADER_FEAT_BITS) { > if (!feat_ops[feat].synthesize) { > -- > 2.17.1