Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3542586ybd; Fri, 28 Jun 2019 10:24:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2t1rOPh5ZmdEYCtpZ0SHFB0SPe1JELSNEOJkRN4lxbwN6HqeVdlg0hVlUwG1IO1q7MZ5b X-Received: by 2002:a17:90a:c481:: with SMTP id j1mr14441094pjt.96.1561742679703; Fri, 28 Jun 2019 10:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561742679; cv=none; d=google.com; s=arc-20160816; b=gzeaar3qKSxnHwIq0nAaOAr5h9Rkzj7Xvi+thSO2QTnmwQediMPfTpGH320EYAn12+ 2DepYVej56jxlg9p4hfHX76LzaRpY9LavYgIVguHVCfJCstlVT2TCKOycjdzt5Gaqno7 8FNHIoyyliXqcOXNEEmRMRg/eQ9ZruyhmIW4socAsqX258SsJ2xTCwa9MQ+PVsjzqi6o de1yPSnC3QwcN8ppFk5NAHX+YeCT4wSTvl7o65o6nLJB8FQCL/P8X9ziBipVAeQ+paI8 xymecMJp0bWmw61JdmyuSJFDkt8GKTetq4bqoF0PROBEt3qJHKckUXVrgZ27tqqWhejr 0Biw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-disposition :mime-version:subject:cc:to:from:date; bh=/48Xps/Nn0N8jSAGvAX9vjYFljTMABmfxpV/4KBFutA=; b=Ovl4gJxHffScZXk4TWSqIlthm7uyYQ0sO4oHHCHfNoOc2WvQolcAc1Gtv1KZVjWFJb VqkIhNeS/p0tQBUEhQJTVwz+N7Rez3tC3unG1duENSyQaLgHNK5j04MQbYW5dX69BCCT V+05Xd6eP/3Et4f1k+77ySbJVAvPEB1zBUjgZ8+WlXcChG0gDti46RuHf5IbbmVNzvrv 7HE2gjJ0T1ohAxSFI2VnqNgeIdkv7wqpG6XemYHY/hXSLRt+HHOYZPKAPh0PIY3jHGs3 vf3qHhqgG9tZAVh49OfaIC/p8sC7vrdendVbMNL37zeY0JWXjtZq2SUeUPqvV7O76+A6 eWpA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si2486268pgp.478.2019.06.28.10.24.22; Fri, 28 Jun 2019 10:24:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbfF1RW7 (ORCPT + 99 others); Fri, 28 Jun 2019 13:22:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9320 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726443AbfF1RW7 (ORCPT ); Fri, 28 Jun 2019 13:22:59 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5SHHHf3124252 for ; Fri, 28 Jun 2019 13:22:56 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tdnvsu7ah-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Jun 2019 13:22:55 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Jun 2019 18:22:52 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 28 Jun 2019 18:22:49 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5SHMmP718743318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jun 2019 17:22:48 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 95E794C04A; Fri, 28 Jun 2019 17:22:48 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55EB84C040; Fri, 28 Jun 2019 17:22:48 +0000 (GMT) Received: from localhost (unknown [9.152.212.21]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 28 Jun 2019 17:22:48 +0000 (GMT) Date: Fri, 28 Jun 2019 19:22:47 +0200 From: Vasily Gorbik To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Andrey Ryabinin Subject: [PATCH] kallsyms: exclude kasan local symbols on s390 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Patchwork-Bot: notify X-TM-AS-GCONF: 00 x-cbid: 19062817-0012-0000-0000-0000032D7595 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062817-0013-0000-0000-00002166B910 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-28_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906280198 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc asan instrumentation emits the following sequence to store frame pc when the kernel is built with CONFIG_RELOCATABLE: debug/vsprintf.s: .section .data.rel.ro.local,"aw" .align 8 .LC3: .quad .LASANPC4826@GOTOFF .text .align 8 .type number, @function number: .LASANPC4826: and in case reloc is issued for LASANPC label it also gets into .symtab with the same address as actual function symbol: $ nm -n vmlinux | grep 0000000001397150 0000000001397150 t .LASANPC4826 0000000001397150 t number In the end kernel backtraces are almost unreadable: [ 143.748476] Call Trace: [ 143.748484] ([<000000002da3e62c>] .LASANPC2671+0x114/0x190) [ 143.748492] [<000000002eca1a58>] .LASANPC2612+0x110/0x160 [ 143.748502] [<000000002de9d830>] print_address_description+0x80/0x3b0 [ 143.748511] [<000000002de9dd64>] __kasan_report+0x15c/0x1c8 [ 143.748521] [<000000002ecb56d4>] strrchr+0x34/0x60 [ 143.748534] [<000003ff800a9a40>] kasan_strings+0xb0/0x148 [test_kasan] [ 143.748547] [<000003ff800a9bba>] kmalloc_tests_init+0xe2/0x528 [test_kasan] [ 143.748555] [<000000002da2117c>] .LASANPC4069+0x354/0x748 [ 143.748563] [<000000002dbfbb16>] do_init_module+0x136/0x3b0 [ 143.748571] [<000000002dbff3f4>] .LASANPC3191+0x2164/0x25d0 [ 143.748580] [<000000002dbffc4c>] .LASANPC3196+0x184/0x1b8 [ 143.748587] [<000000002ecdf2ec>] system_call+0xd8/0x2d8 Since LASANPC labels are not even unique and get into .symtab only due to relocs filter them out in kallsyms. Signed-off-by: Vasily Gorbik --- scripts/kallsyms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index e17837f1d3f2..ae6504d07fd6 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -150,6 +150,9 @@ static int read_symbol(FILE *in, struct sym_entry *s) /* exclude debugging symbols */ else if (stype == 'N' || stype == 'n') return -1; + /* exclude s390 kasan local symbols */ + else if (!strncmp(sym, ".LASANPC", 8)) + return -1; /* include the type field in the symbol name, so that it gets * compressed together */ -- 2.21.0