Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2906518rwb; Sat, 24 Sep 2022 18:22:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6esWvvE/ZRnaHgjspe6Tsy13ebFzC6Sl7d50Lqw0I7fQJaKPLFdgx6j4+K8pj5Q76NaSz7 X-Received: by 2002:a63:ff50:0:b0:439:ae51:503c with SMTP id s16-20020a63ff50000000b00439ae51503cmr14225468pgk.158.1664068978550; Sat, 24 Sep 2022 18:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664068978; cv=none; d=google.com; s=arc-20160816; b=DMp3PbXyVGjJIKrEtfg9MFVcVHcm6Y+TiAtzSwt0C4R9Z66SvLDbNUhHKtGuPis8M9 m7UAEVaB4RzBt5Qrt3PIKcTY1tx3DoAZ3Vylnhjgr+Vp5nz8qp9Q7ZnZgbRytMHAkBZd AYxFsESznt4Hp4c366e8lFlPvpHf5+u2edo9LFo8Y4evZORS+mtaE/4V19Tvdlh2Eimv i7ELjehFRmBupGzVbvtkwqdfGQSQKfDrBCUeS9A8o2cvNHPrk/ARX2E4XrrRtFtZrxSO J49yJJUiJMoC6qGp11nvKIY5pKXhBvZ2sGu9CzDDJ+Saok478eeNkVbOVAhxwW0tPD1Z lXHg== 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=cJzXVCVoc18ABdRcUIsWy2aVUz4QJ6reHu2nO0fOZDw=; b=A0M2IffUt2WFb137Zvg4Foctd7LBJTluyJkDbsWwCRgJSbFjBQ7yDYGPEaBkuwv+K+ 9NwKA4weK3sW6HUD2omoQVLI7uE+6IeYyeiiuHI260x6pT5nyuThP7ybpV+NcAk4QvvY 8ugFwnM0aYouObRi5L0MfL5RBlNuzS+qFIc36GK5Yl3QP2jFcm1o5B5aOBux0ojqHDFB 2dAtWOfsTrbC/EjP1RLey94vv0ZJAYe0y45OSQ3NC3xjZmVQz2u9TWgdIdtQjxuINW0U vgeVMGY22TWFZ1xSt8/l84fwzZ4L6sLMJ6/YFR1yHeUZvpNv10QOtCyFXVeG5S2u8tNy J4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VsbU1C9p; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a17090a881100b002007ef7a2a0si7129690pjn.71.2022.09.24.18.22.43; Sat, 24 Sep 2022 18:22:58 -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=@linaro.org header.s=google header.b=VsbU1C9p; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbiIYBMq (ORCPT + 99 others); Sat, 24 Sep 2022 21:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiIYBMo (ORCPT ); Sat, 24 Sep 2022 21:12:44 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4125E36843 for ; Sat, 24 Sep 2022 18:12:43 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id v4so3545623pgi.10 for ; Sat, 24 Sep 2022 18:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=cJzXVCVoc18ABdRcUIsWy2aVUz4QJ6reHu2nO0fOZDw=; b=VsbU1C9pj6PrOh7Tpac41c4wwewHJBSRM+9UaR/sO1w9OZnFfCpEg/NcPxW8/rqcRP iJPZhhOw3inT2PMKTaJTrmS2xGVeE/MG7AIjiRkdgJ1GZdM6y2vuV565zipUw0y0KZeP SV2T5GF372quFshJgZ1uLqpppaA/y52hq2C7svKhpvLLAPHBlLW/lsE/jgwbcVO3m4yY MecAri6bE00rb8iLtuZP/qk6gUeMZJHKO3UXP3VT+Rlrlw2mGy5xMbmbXtkutHjVxRR0 tTqCtwXvnIbdYF16cJRKrqCcF54sPjqTx1FYYsrDws0n8RZfoJtBH4EdiPvyMGrc+kcb jwfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=cJzXVCVoc18ABdRcUIsWy2aVUz4QJ6reHu2nO0fOZDw=; b=id7lqoZuzBFSEOGAp2xv94/Ki4DCyWGkts9GTuS/XJs4t7GJxleSjwKeakQtqGD2sn vndVmtvQGRf2f9/VBQpHSY2oHYy/tF++YP4ebZQpheZehigpxG2XQbD5Er5FQZZfbSm4 rxZnuh/RzYBN/te/3IcZFUW+kkiqEzo89mhX37eYrVeuOVfIqk8YhtwTRPyn5CKC+vHM clSpkqNznWmHysPKffyHdQvt9V6LUeopsouxrdZC4Lae93CC0A1bgZS0vWblGrHrJUHY owPNvy/dPYwyRWPPtHSfc8nBDDbyvlvz/jWkKYGWFVE8kmz/OJNsMFWX7v0og+4JcB// sLsg== X-Gm-Message-State: ACrzQf31qW3quJZA41nMV44a03A4O3LhfpeM7Fow6KqU+ZAHfQgXARMJ bbiDkRvjRvD93+SDHwCft9AU7w== X-Received: by 2002:a05:6a00:4106:b0:548:9e0e:f13b with SMTP id bu6-20020a056a00410600b005489e0ef13bmr16645834pfb.0.1664068362624; Sat, 24 Sep 2022 18:12:42 -0700 (PDT) Received: from leoy-huanghe ([39.144.40.86]) by smtp.gmail.com with ESMTPSA id c36-20020a631c24000000b0043ae1797e2bsm7818324pgc.63.2022.09.24.18.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Sep 2022 18:12:42 -0700 (PDT) Date: Sun, 25 Sep 2022 09:12:37 +0800 From: Leo Yan To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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. Leo