Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp362989rdb; Mon, 18 Sep 2023 18:51:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvP4VoMv1FLQhxOYHObndhMgCM8dWQ432+I01QUeKSNn6eztFxJSuR6Q9kZTwtqPnjexyi X-Received: by 2002:a05:6a00:2d1a:b0:690:38b6:b2db with SMTP id fa26-20020a056a002d1a00b0069038b6b2dbmr12495419pfb.6.1695088295388; Mon, 18 Sep 2023 18:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695088295; cv=none; d=google.com; s=arc-20160816; b=oHdaij9btZIoavZF9w6lje3T76a/OK45tf+L8bbjoOlbIQeqHpCNpn13y7xtUzd8x7 XTwUxmexQYqH4NewbLcdGaaTQ6Ejh1hpYF1ziiv/wDprrkJWQJQzAxzbfv+y4PiOPxOT MmQonZhUIoxNxMoS+OOUxmSZUCA5wBL9RNhzlHVOuFntSmV5h/xniux8OOlbE8YhGAEq RKr2/PGRhRGRGt9htOCbg1XvbeoXsQR3QMdx/JyB6X8Kpvr73tiEab9n+LhkhtOytwuz vABNbJozNylF+mNGGwtTXPbo4+3Bbh1KonPLdsWdM+j9YAzD8NGhyYSEzv3HP3kNESRC nDzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=BJ1woQbsU8JgvmOwT/oRdvCsbPhSedSrieHov1xe/QY=; fh=38O5UD8+XixcB2jM/XUsOv3NnMZZTIqqbznw43+apgk=; b=nTvdnE+8lx/TrM/7WQc3V3JI6mXTK03lhvzPYVLAcK6N59cdhpO0I5Pqe1a9si2gmP WaoXKbfTOAlpck19EZBHrbawziq8mqVSB4tGD+gbwl4H2a6FwSf+ufYDiKwSAlekIRqi ioaIK5o14n1eVr79ToTxdSQVYZjuuYh8LJcKzlD/oHFXo0oRbsA3aVi7ITBjuWOmC6pH JAqJJKAS5aoQA41VngZJMbNfx6rd6k63X1a9zeMLExeEtJ9IinOl1r1SrD69ztDeKvDF lN6RUX74YE4AGN61YrR5X/YBVWp+8TShFNexlyn3rai5SDm0cVp0L/D8bl0roOk9M0eQ uIZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id cd17-20020a056a00421100b006907e44c739si2777598pfb.86.2023.09.18.18.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AA99980740F5; Mon, 18 Sep 2023 18:50:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbjISBuU (ORCPT + 99 others); Mon, 18 Sep 2023 21:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjISBuT (ORCPT ); Mon, 18 Sep 2023 21:50:19 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90BEE94; Mon, 18 Sep 2023 18:50:13 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RqPfp3ClfzVk0r; Tue, 19 Sep 2023 09:47:14 +0800 (CST) Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 19 Sep 2023 09:50:09 +0800 Subject: Re: [PATCH] perf jevents: Fix segfault in perf_pmu__find_events_table To: Namhyung Kim CC: , , , , , , , , , References: <20230918030304.24832-1-yangjihong1@huawei.com> From: Yang Jihong Message-ID: <10d67fbc-49b2-25ff-6d02-e13d6a22bced@huawei.com> Date: Tue, 19 Sep 2023 09:50:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 18:50:26 -0700 (PDT) Hello, On 2023/9/19 7:55, Namhyung Kim wrote: > Hello, > > On Sun, Sep 17, 2023 at 8:05 PM Yang Jihong wrote: >> >> Before caching the JSON events table, perf_pmu__find_events_table() need >> to check whether table is empty. >> >> For example, AuthenticAMD-15-6B-1 is used. The matching events table cannot >> be found. As a result, a null pointer is accessed when caching JSON events >> table, causing segfault. >> >> Before: >> # perf record -vv true >> DEBUGINFOD_URLS= >> Using CPUID AuthenticAMD-15-6B-1 >> Segmentation fault (core dumped) >> >> After: >> # perf record -vv true >> DEBUGINFOD_URLS= >> Using CPUID AuthenticAMD-15-6B-1 >> >> [ perf record: Woken up 1 times to write data ] >> [ perf record: Captured and wrote 0.005 MB perf.data ] >> >> Fixes: 7c52f10c0d4d ("perf pmu: Cache JSON events table") >> Signed-off-by: Yang Jihong > > Thanks for the fix but please see > > https://lore.kernel.org/all/20230913125157.2790375-1-tmricht@linux.ibm.com/ > Uh.. no notice that there is already a fix, please ignore it. Thanks, Yang