Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp945163rwb; Mon, 26 Sep 2022 07:48:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Gq6qwZo+FxxpAICCCdMeYWqwW2VQYPwJYfVoBfOxb9Gi9JsVAFh9U/39oS5e2eg0P+0iO X-Received: by 2002:a05:6402:548a:b0:454:762b:158b with SMTP id fg10-20020a056402548a00b00454762b158bmr22492064edb.362.1664203705578; Mon, 26 Sep 2022 07:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664203705; cv=none; d=google.com; s=arc-20160816; b=Dn5TTID67UiTXbVOd4wRrdEfu+bRHf/qhec3S8LC+BkD9z2FPAK4mYHhwMi4W0/amz R1D5IoUdl4O9Q/tg/ncaW0m4QSfhl8+ciPga29VkiSCaFJedJt0eMP1gzpgvN57SECRN E3ErFuCrG82qLvMEapAsUuOPn7VaEmVr4vHNHpkJHhJj6/kl4P66IYjmwfj4DxQhwMuT 7VAdIzlpoq/i+ONSOE0mIhcM/GHGOG5C5eq1z7+djvuyyAlzoL0JyA4Wz4AF6l9JUCx5 v7hXDCCWmTeAvdrRvdjo4i1tpiMT560WGDuNtDc5c14aPQGRxa89Pl8RWDLlC7vjK5JC s/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z2AhZhEpfmSXlnrEmFf0TVv/CxKiD4D83XJ5+cTHPaU=; b=uUW/qCSVuc6hMkI/L2Nl4JsIFkDZBRiawaKUkoZXK8HAgDOkumVWekd4fDeAbrW9ek Tkv9SnGHsiBYvbPLCeCm/bdgRH0hj8zEWt6jqblECDvdT8GxfO9JVfEYblqtD2ReLp1G WO0aQFZqWPVsj5kLoScfmXNuq9jLLSct8scpba83ZukwH9m0n/1e56Y3UUsT+Xij38Ef keDWKUiCBPotjuWcWHt+Brg8EM8zE9ukxskMR1orN8szioPgmvFG/eRH+E3yD6DuWwbN lFjiOkeJESDrZPlNiNEdBd4gfkjaCBzVtGSYLGvPaEwpf4C2WV3HFf+V0KZoGGCJ6uPX /7NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DXTuqS1N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa13-20020a170907868d00b007707c682264si99277ejc.298.2022.09.26.07.48.00; Mon, 26 Sep 2022 07:48:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DXTuqS1N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235223AbiIZOl7 (ORCPT + 99 others); Mon, 26 Sep 2022 10:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234931AbiIZOlP (ORCPT ); Mon, 26 Sep 2022 10:41:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F17C5F8E; Mon, 26 Sep 2022 06:03:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B70360D28; Mon, 26 Sep 2022 13:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4537FC433C1; Mon, 26 Sep 2022 13:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664197401; bh=edJaC8g1NJfxM/VM8JJRmUgz2AQBoTwZ3IVbR7mOLq0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DXTuqS1NXrFWtXtkxtylwVBsmXUV1U+2ku5hyqo+1zO5qQYJLrt5pVYDLZXh2C/ZL S/amDgP55wKJ22aTnyjiCEGPfnCfEnExHSA/4e7qHxj3PCTV45CHBul2J0lqL2Urfw ZAu6rfg7NbgaX0vQ5V2fT2hTVhw7Prwzyn6s0Yly6au2Adxa9G3d/pgzjmeDZ8t56n GzsE6m1jE9DhVFYcbDv++KXyo39Wcx4aVlycEmzNVTMWxk3GQw5g8UjAY5lECAqLb8 dARMFHo0fyNGNgHSlKb8kkINoTxEZpzE6Za3fzTNy+Dk5ZzcPb5ElgoHHrhLgadX5y QzJxhGsN0q7Tg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id DBEA3403B0; Mon, 26 Sep 2022 14:03:18 +0100 (IST) Date: Mon, 26 Sep 2022 14:03:18 +0100 From: Arnaldo Carvalho de Melo To: Leo Yan Cc: Namhyung Kim , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-perf-users , linux-kernel Subject: Re: [PATCH] perf record: Fix segmentation fault in record__read_lost_samples() Message-ID: References: <20220924113346.1110909-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, Sep 25, 2022 at 09:12:37AM +0800, Leo Yan escreveu: > Hi Namhyung, > > On Sat, Sep 24, 2022 at 09:52:09AM -0700, Namhyung Kim wrote: > > [...] > > > > In the unprivileged mode perf fails to open PMU event, the function > > > record__open() returns error and "session->evlist" is NULL; this leads > > > to segmentation fault when iterates "session->evlist" in the function > > > record__read_lost_samples(). > > > > > > This patch checks "session->evlist" in record__read_lost_samples(), if > > > "session->evlist" is NULL then the function directly bails out to avoid > > > segmentation fault. > > > > > > Fixes: a49aa8a54e86 ("perf record: Read and inject LOST_SAMPLES events") > > > Signed-off-by: Leo Yan > > > > Thanks for the fix and sorry for the inconvenience. > > Actually I sent the same fix a few weeks ago. > > > > https://lore.kernel.org/r/20220909235024.278281-1-namhyung@kernel.org > > Thanks a lot for the info and fix. The patch in above link looks good > to me! Please ignore this one. Took that as an Acked-by: Leo, thanks! - Arnaldo