Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9907391ybi; Wed, 10 Jul 2019 19:41:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEZ/Med1c8nRTqaQL+oZcR/4nnwMPfE4syYSGt0yaPJVXoVW61jZ41Ke3/1CVpStKFziEA X-Received: by 2002:a65:4489:: with SMTP id l9mr1741291pgq.207.1562812892272; Wed, 10 Jul 2019 19:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562812892; cv=none; d=google.com; s=arc-20160816; b=GWG0giE3oFGUOAXEI4M9qyfVWh15tJjZ7+WzX3QIOTCYXwIszhHIPMkZoonEXnO2u/ 5icMObenNzC3+irpi8pGXS3dNRdWNCpsLIw+jjRbsKuRP7S8cDYcOzmtEaTvKPxCJax/ qxu2r8IufEsycVCGOIdTicOo2+9FcCUDQssOKI1AehdOTJAYbVEUtw/FEiKahQOerWUi +steCgGSqH+Rw6dHbDn1D8p+ULGTba1vNvVas1Aum+1TM4LR4gEX5qWlRYse5RtU2RwO W4/+e6p+CV/QG/sO2q9JXKLoQig87Fvy+eMCaZncTw8/h3IEpjSko1ayd7Ap5EWkkFlH XKKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=TqAx4sSarpbcLG9lpfqX3EP0Ke2VrZx9yWDoSR6Sd68=; b=sBpAOTw1z+aq4gurjoCnUOwonQsuPJKYn/qDXLNB0C9Cs8NKX2KuCwqPurhbKhducq bsBmRrrGsdqTJO73VROAPD7cCyg5h533i+NtrlN1uiFDU4tsI8ULgOWajJTniP401y1m +1MfEjMWGenTsNr9Fd6wdSGQg90N8aPITdc8iu78idVUGRmrf1YAVWFyalh2ogUFT7Zc 13c7GG7F1YuCDYg/81KoGEvAtJdR/23314z5O6v9WXuQNFfe7QEZ8lRMuocfmdiFFpPP sQv/SvOilvFy88TmpLN0fWY1FDyefWQGnfQDnpKq5sYXiioJ/bW7KDpZjhH1ll3lkTdR Z4Nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si3941002pgi.587.2019.07.10.19.41.16; Wed, 10 Jul 2019 19:41:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbfGKCkY (ORCPT + 99 others); Wed, 10 Jul 2019 22:40:24 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:35373 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbfGKCkX (ORCPT ); Wed, 10 Jul 2019 22:40:23 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09366905|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.0744421-0.00954207-0.916016;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03267;MF=han_mao@c-sky.com;NM=1;PH=DS;RN=7;RT=7;SR=0;TI=SMTPD_---.Evp2QQa_1562812820; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.Evp2QQa_1562812820) by smtp.aliyun-inc.com(10.147.40.7); Thu, 11 Jul 2019 10:40:20 +0800 From: Mao Han To: linux-kernel@vger.kernel.org Cc: linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, Mao Han , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: [PATCH 1/1] riscv: Fix perf record without libelf support Date: Thu, 11 Jul 2019 10:38:40 +0800 Message-Id: <96b979a523210628de8a8a3d6e48492f6f1ff02d.1562812381.git.han_mao@c-sky.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fix following perf record error by linking vdso.so with build id. perf.data perf.data.old [ perf record: Woken up 1 times to write data ] free(): double free detected in tcache 2 Aborted perf record use filename__read_build_id(util/symbol-minimal.c) to get build id when libelf is not supported. When vdso.so is linked without build id, the section size of PT_NOTE will be zero, buf size will realloc to zero and cause memory corruption. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou --- arch/riscv/kernel/vdso/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile index f1d6ffe..49a5852 100644 --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -37,7 +37,7 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE # these symbols in the kernel code rather than hand-coded addresses. SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ - -Wl,--hash-style=both + -Wl,--build-id -Wl,--hash-style=both $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE $(call if_changed,vdsold) -- 2.7.4