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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 BD763C433E9 for ; Tue, 2 Mar 2021 15:09:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74FDD64F1E for ; Tue, 2 Mar 2021 15:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384552AbhCBPFN (ORCPT ); Tue, 2 Mar 2021 10:05:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:51802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444811AbhCBMlX (ORCPT ); Tue, 2 Mar 2021 07:41:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6B4164F0D; Tue, 2 Mar 2021 12:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614688565; bh=aIU8ufo2x+haijSAUpLIr8X8Yfx2CeP0Z0v54Zc1His=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OvlAIbDDGqpyHt1/I0gE+IzgvV8cMbvrtpyqL+omBoz9+g7MUwc47tJWF6NsdxDdJ wL5uDQQWVZzEf1UXDmoxU0aLwdE6WVq/VsgsQ+WpdXSKmjmT9U2xWXwyiHz/IHrsJC bzfUPGVdeGcS4wNfhZO9dBWrWrANeUKV0fv1KoUZmjnw1sqSo37DwCTkbk1A0mqFA4 6bTVA+PXOHdWbn7MYrcqvlsqsFHGsNPSKMvKXRBCoE0NOZgQ5tx1m4dERmpYcgMKXO z3YAXo8zDixfLGFJr8S+9oPTKUQ4C/CIIIcJYOSsO/xE9KJJyKgUTS97lefeUz2YmO /Y76PIpxBdmrA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id AD82B40CD9; Tue, 2 Mar 2021 09:36:02 -0300 (-03) Date: Tue, 2 Mar 2021 09:36:02 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-kernel , Stephane Eranian Subject: Re: [PATCH] perf trace: Ensure read cmdlines are null terminated. Message-ID: References: <20210226221431.1985458-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Mar 01, 2021 at 04:50:50PM +0900, Namhyung Kim escreveu: > Hi Ian, > > On Sat, Feb 27, 2021 at 7:14 AM Ian Rogers wrote: > > > > Issue detected by address sanitizer. > > > > Fixes: cd4ceb63438e (perf util: Save pid-cmdline mapping into tracing header) > > Signed-off-by: Ian Rogers > > Acked-by: Namhyung Kim Thanks, applied. - Arnaldo > Thanks, > Namhyung > > > --- > > tools/perf/util/trace-event-read.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c > > index f507dff713c9..8a01af783310 100644 > > --- a/tools/perf/util/trace-event-read.c > > +++ b/tools/perf/util/trace-event-read.c > > @@ -361,6 +361,7 @@ static int read_saved_cmdline(struct tep_handle *pevent) > > pr_debug("error reading saved cmdlines\n"); > > goto out; > > } > > + buf[ret] = '\0'; > > > > parse_saved_cmdline(pevent, buf, size); > > ret = 0; > > -- > > 2.30.1.766.gb4fecdf3b7-goog > > -- - Arnaldo