Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5973737ybf; Thu, 5 Mar 2020 10:32:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vs4FFjZLmBzQCs54tJJVKDaERwcLx8/WLHLl2M1RPxJ4EWdZsosZtnSAGlEKiVYcKzoHckG X-Received: by 2002:aca:5303:: with SMTP id h3mr308565oib.74.1583433162282; Thu, 05 Mar 2020 10:32:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583433162; cv=none; d=google.com; s=arc-20160816; b=u22IrfOnSw3ddn7jlFbCgvbYXOGfSbFPEZXHQwvIiKJzxZve/JvwXANPal+DrN6VUM Dqz0qCnp9WyDQaHvAwR4eC8qVElgHZUmcziYXga//8DdDgJciArcS5A8LVKLwX3LkjXw 5Mn3Osc6xm/hmIqiSzkS9vKwKckYg5sLmxQNXXOeqe75hvplTSBqK82ymmRDGu/63TJ5 XzrSXAGDfbD3WX//fgIEm0Yv02rXQOf1wB8bGGfUyR/+CC7aPC9mH7Q6N8fl/BvhPsf/ MRd5lAwFPvxmLzTYnvSj3PEnp7IbjxcK90Ii8+crpvGEJW3++G5LMovEcbfOcMaxMTeg mkSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=q+q9IU8Wx0V4j8L92DOhFLTeCQAb66oJF6rmO0kuWTI=; b=g6iaDjW6Il+q18PEJ821Uy/Drkg0BElPuouQxN/su1tV57cTj/V547md14+1YmK6us 7nxcFMkhKqn2+deBdFx3Z5E2d03eIzkq9I96fEwBME0+cC2qs4pQ/ADUvl1Ecs+ipFkB 4uycTDafe2QBRx9xWlVnL5RrLL4UmpEU1075lr1t0GEe1o1dwu7WWXLQi5JUtFLsZTwa lFBzqtYb5HwFshb9Q7vVbPnBhWOyHcnJm4koO7pNza3CzkebZgwJHbFHg4azmTa5VUeH CihdXUi4kQziR5ZT5mwyKU3N7KQ7VZelWirvmxpLYdTVIsSGgXFV3GxctA629zZ0jGQn akqA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t192si4039732oih.98.2020.03.05.10.32.29; Thu, 05 Mar 2020 10:32:42 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbgCEScI (ORCPT + 99 others); Thu, 5 Mar 2020 13:32:08 -0500 Received: from mga01.intel.com ([192.55.52.88]:29598 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbgCEScH (ORCPT ); Thu, 5 Mar 2020 13:32:07 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2020 10:32:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,518,1574150400"; d="scan'208";a="352410826" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga001.fm.intel.com with ESMTP; 05 Mar 2020 10:32:07 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id EA28D301BC6; Thu, 5 Mar 2020 10:32:06 -0800 (PST) Date: Thu, 5 Mar 2020 10:32:06 -0800 From: Andi Kleen To: Arnaldo Carvalho de Melo Cc: zhe.he@windriver.com, jolsa@kernel.org, meyerk@hpe.com, linux-kernel@vger.kernel.org, acme@kernel.org Subject: Re: [PATCH] perf: Fix crash due to null pointer dereference when iterating cpu map Message-ID: <20200305183206.GA1454533@tassilo.jf.intel.com> References: <1583405239-352868-1-git-send-email-zhe.he@windriver.com> <20200305152755.GA6958@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305152755.GA6958@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 05, 2020 at 12:27:55PM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Mar 05, 2020 at 06:47:19PM +0800, zhe.he@windriver.com escreveu: > > From: He Zhe > > > > NULL pointer may be passed to perf_cpu_map__cpu and then cause the > > following crash. > > > > perf ftrace -G start_kernel ls > > failed to set tracing filters > > [ 208.710716] perf[341]: segfault at 4 ip 00000000567c7c98 > > sp 00000000ff937ae0 error 4 in perf[56630000+1b2000] > > [ 208.724778] Code: fc ff ff e8 aa 9b 01 00 8d b4 26 00 00 00 00 8d > > 76 00 55 89 e5 83 ec 18 65 8b 0d 14 00 00 00 89 > > 4d f4 31 c9 8b 45 08 8b9 > > Segmentation fault > > I'm not being able to repro this here, what is the tree you are using? I believe that's the same bug that Jann Horn reported recently for perf trace. I thought the patch for that went in. -Andi