Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11217407ybi; Thu, 25 Jul 2019 12:05:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqylhBrlMEEqELvbo6R0kISr/brlgGP+v/1trhv93AgMMNn9BaeI8xR2NeKR4GQrUqHfcaOZ X-Received: by 2002:a17:902:8a94:: with SMTP id p20mr92045895plo.312.1564081534100; Thu, 25 Jul 2019 12:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564081534; cv=none; d=google.com; s=arc-20160816; b=nGkVQ3QHW3Sy+oONeuYFHlGcFy7ZaRtUjlakLxGJTuAjkukybY/12gKccMD2DsJXmY gkmC4zWPXzlWj/hHfcMYcVDiSnKJNa/I3K4lW6m2sDWAZa/feDeloYTrYVHW7OO67xMD uhPc+6FF9mRXgNkttejVm1D7t/48pbp5jJbE3Bw/S99Mp5GDv5iLyUfKdlA0yt5aP48E DFIx42uGwFS5ftLl5u7/DfLcrPtLb4JRcZcS8GFHU2y9SMKJ6BIwAWGlGJ3AgYUuMKh0 ofM9wA3VdxM4K6wJxLgnB7zrwFB5C4lMvm8EYpM06bwjUZOfXIrAG9ne0QMh4/U+XFGR sXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature; bh=LKu/Qknu3DhcpvZAjH/Cg2C3TRqk9B3bltB+fAqL9wk=; b=e7UFokjMrdhhjGrjHgXnxJgz+5rCbkmeNIagqXxeealTs1huEu79rsAkq8kgaQGMjh SuaYnhVZ7Gcb2dJEVwzr0nHlu4S/cX1y8DvbZiQdlcmGPtVD7GQQrYNRw61NYXUuYXcL Rqhr7Q83XPXVJzaMq6KKxZ3kgo+kisQ8RurPRMa81TQB75kKsGOoCoKEF0RzM/737vXv RgT6H23Vr08KVmXgWtWUWkwV3dBiEdV5PyGtbKtR0ZuA1iRMqu9wBfeLVAj8h/kUfMXA zozKlHRvgktViIlGlcM6W9WB3OzDr4iJ+MCKX1JHwgaTio/V+hrYPU2WqcKTf1N9CyQ5 Z6MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=e6TYk6nU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si18413016pgs.106.2019.07.25.12.05.19; Thu, 25 Jul 2019 12:05:34 -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; dkim=pass header.i=@maine.edu header.s=google header.b=e6TYk6nU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726417AbfGYTEh (ORCPT + 99 others); Thu, 25 Jul 2019 15:04:37 -0400 Received: from mail-qt1-f177.google.com ([209.85.160.177]:41269 "EHLO mail-qt1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbfGYTEg (ORCPT ); Thu, 25 Jul 2019 15:04:36 -0400 Received: by mail-qt1-f177.google.com with SMTP id d17so50076259qtj.8 for ; Thu, 25 Jul 2019 12:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=LKu/Qknu3DhcpvZAjH/Cg2C3TRqk9B3bltB+fAqL9wk=; b=e6TYk6nUklMcBLDNOXeCNg7kg6Zy+WiNNfq1X+GbMgJgt9ZpbkE0mLxrahOgvG9ikR Roar7pYOfSEJlGeu5C1RbUvc4byj6OfsdmaHAnOYqCfRplqNSXECeo/sbd+kJtIosD7y ZWZGm+7U1oOHN6ijjTX+z31n97JPV1uzg2KGc= 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:in-reply-to:message-id :references:user-agent:mime-version; bh=LKu/Qknu3DhcpvZAjH/Cg2C3TRqk9B3bltB+fAqL9wk=; b=cYM1reeFY71qcxhOd+rqkQ6SqMGQiS6g7Z99bkAASH2y3RMaxFTTyG9nQZsS14/UHV 35miyUskkVolCyxDeH4HZ+zu6dG9JFU4vg3BPXFQ6pLBmcp0gCPYDckxYzSbGNQj5ma3 KYo3ixSVDc8yB/flej+mP6FJtGYyxmwpjgFWna9r392jqk2V0CYHvSf9PyURuIp44RNT EltTSKnPXqXeKIR2rbUghraOcNeAIUnDDwAe5BpcRhFa6eX7v5PBwHMkeD7BU216cera 76ikd3sppD79Yrqsu+M31MpqLrzhb1sl35ENH3u1tFzvIdf4XEjrlYJhbU/0D3NTVaAn ZTEQ== X-Gm-Message-State: APjAAAUXZ0bk+IGBCKd6+eI4xyKEe4cOubY9JcyHun+hz/UY8UvJ841W M/cvDc3DWbbpS7WqfRweb+CbhT2xAyU= X-Received: by 2002:ac8:1106:: with SMTP id c6mr10335368qtj.332.1564081475362; Thu, 25 Jul 2019 12:04:35 -0700 (PDT) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id a6sm22909833qth.76.2019.07.25.12.04.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 12:04:34 -0700 (PDT) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Thu, 25 Jul 2019 15:04:32 -0400 (EDT) X-X-Sender: vince@macbook-air To: linux-kernel@vger.kernel.org cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim Subject: Re: [patch] perf report segfault with 0-sized strings In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org probably all perf_header_strings are affected by this. The fuzzer just tripped up cmdline now, which needs this fix. Signed-off-by: Vince Weaver diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index c24db7f4909c..631aa1911f3a 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1427,6 +1430,8 @@ static void print_cmdline(struct feat_fd *ff, FILE *fp) fprintf(fp, "# cmdline : "); + if (ff->ph->env.cmdline_argv==NULL) return; + for (i = 0; i < nr; i++) { char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); if (!argv_i) {