Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4000543pxv; Mon, 5 Jul 2021 10:57:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmBvHAtbUzi5vfYAHyyYKnzolFXNoRacfoxdwUr3ygbOTIIBtC0L61aBV7lQvn3P3C9Imc X-Received: by 2002:a50:ed90:: with SMTP id h16mr17505523edr.348.1625507851367; Mon, 05 Jul 2021 10:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625507851; cv=none; d=google.com; s=arc-20160816; b=A9wWqAJC+CHGULMr0vlDharq7jRXg8GyOyVcGNuvhcrnqWmlYNia/U3chfV2HeypiF /2qL1vEY3h3PiSOOL3Hd40IN4ElYt5OhRVq3QJvFMFoOAqqCXIti99YtT9yz6F4bHqjI fMEPex0pIZ676TEeksKZXSybMNZmBKIW4gPy+yXkOFifa8n4qgs8AIVnwW4vwn/ypRCP Ra3+giYM1OExORxAcPtv3D/Qa5bbu9t3FRVaRGbl7DfdyREkCnn5jRAXcCRIFtPPaIME NikzBolCg7AbBxV98bcVePWwz5N0wiisqJOSV8lxOi48tjciHg5kKxzRnOwbMse5/gkR bSzw== 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=HwhyBCKSARwosXfRSQui9CtYeEoDh6sf6F+vrgSoYkk=; b=KDTbDzx6XTCglVWbLK1vCwAH3EP1TCuzcXMC7t9hORJG1nAnC0ioXDg92iQAJoVVFh ZdbmyC52ubC6OUNZyaPYLMn2cK3aBfW/ACfsNsk29WlIXhdtE8gnDicW46qD8lDr3NMo ENcihwKXXxSlnsH7TOv4VLw+I7DI0lhZGOgaK1gPGW0ZoY5Dg9cHRT/Aq2czKhdNaJuI 6Jw9Fp3yc8C8ctY0bR5tCcpKCbvKBdOdrbi9EsrsQe5AkebPgs8I3f6o3y6/ZZMbI4je E48Z9LoKslsD0rKH5yybNNl4tTa6N0Vux3ECylukyzTSUTcNQEllQM+aCCB5nnM0W9ZA FTSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCoJqSK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si11427522ejm.214.2021.07.05.10.57.05; Mon, 05 Jul 2021 10:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCoJqSK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229733AbhGER6p (ORCPT + 99 others); Mon, 5 Jul 2021 13:58:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:42794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbhGER6o (ORCPT ); Mon, 5 Jul 2021 13:58:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F37E61960; Mon, 5 Jul 2021 17:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625507767; bh=bv2embn+MbMbkbhPOy30PDymp7h/saItL/lDCYweFOI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pCoJqSK9GDWmjlan3Ns9JeJKF14oy/dCQTRZ309CxXtjnJezbneUXqpOeaDGi5TKB EdgzNTRX7CRnwiYPs4c8fThr9mb2mitZzUMAkUKYvfJ8/nlgfiyaNDf41yW3wes6Si Fi/rMhTiwduaK/EKfBAirLMDWA2ExxoeO4mX9HaX8wR+dC41lZq56FcCG1DpD2HLDC tNq+LqFFVCvz2zzSO1vLrVuHWoGXjY0qOSMWw9CVEFWkJCUrAP3werzIt01g+mwdFv qTHlWmf6RLOLyg2Mhkx5N+rTN30Nu6Y9gu9jYnkA2jbhUh5Qxh+SkU2aWVBNVjVgcK LBNQvfIHr50zA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id CB5DD40B1A; Mon, 5 Jul 2021 14:56:03 -0300 (-03) Date: Mon, 5 Jul 2021 14:56:03 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Riccardo Mancini , Ian Rogers , Jiri Slaby , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Remi Bernon , Fabian Hemmer , linux-perf-users , linux-kernel Subject: Re: [PATCH] perf top: fix overflow in elf_sec__is_text Message-ID: References: <20210621222108.196219-1-rickyman7@gmail.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 Tue, Jun 22, 2021 at 12:46:38PM -0700, Namhyung Kim escreveu: > Hi Riccardo, > > On Mon, Jun 21, 2021 at 3:22 PM Riccardo Mancini wrote: > > > > ASan reports a heap-buffer-overflow in elf_sec__is_text when using perf-top. > > The bug is caused by the fact that secstrs is built from runtime_ss, while > > shdr is built from syms_ss if shdr.sh_type != SHT_NOBITS. Therefore, they > > point to two different ELF files. > > > > This patch renames secstrs to secstrs_run and adds secstrs_sym, so that > > the correct secstrs is chosen depending on shdr.sh_type. Thanks, applied. - Arnaldo