Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3792853ybi; Mon, 29 Jul 2019 12:43:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0ueL0FozXvZaUCv5J/umB5KgKlcWxNt+Guh4BXNdW5nZP9JpX9x7poAIrnz1T3n5wYuX/ X-Received: by 2002:a17:902:934a:: with SMTP id g10mr113729598plp.18.1564429423340; Mon, 29 Jul 2019 12:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429423; cv=none; d=google.com; s=arc-20160816; b=xAed4xYnztCblmHbxDu6fJT7GZ68R4l6hOJpdAeTcMEENi+6miTdyckxV/NawsC16I xeuqMDdYoX9fHM82uwzyPsRiTmAajcZY6nODEgfc01g85sK0u0PMPZF4HF0CyfWaosMN KC22v4wiSjsgHn4VvFQQ+HHSzSXZlRIgiK4GcyRYGFIDjyHCFb+DfRM/j2Cp/481PlvY LJV+kCTBKW6UhcPhZ8+vYhNhuBLUujqc1WovfcN20vJ1cwJOc+Xn61r9HN3x1ab5FLnH j7+EcuwHJ1G2FbV9OEdTWWGuBOYv5aV8H0dDXl8m7vvYLk/SPFNiOaptbVbboUi6PE+7 GCDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3+oewKIZOU11gzhvhgX/4Phcpkg9PXVgbxYSRaaBBig=; b=IG0i0QkXYQq99eAZGTDnNXReP4wzxvtYg8xNKk8jQRRY3/5uHjZaC5v1/txjFdj77P eozwTUu2KVoltECuw/aYCz8Ylzr91nI1Fe4QmSlfqTg+f68tkNW4XcGuIuBTpWFBPFRk T0GsZzHGA6cpsEU9hQjceH8cAVh55XMxu1RfrI6G49Ri2mAK+rjULM+oqeSfkuRqv+96 +XTnPNfTtkbYPNTppSHIB5zxsEELv+PtaOTXxWbTq+r5GVwN9bI9uSNM1ZjvJs4MUyis 53dy9k0XX5RDkh9KkqleAtLAdCCwEOQ+Hqn6t8V529yob3kSlcVVmP7rKgpy8zH4HpFn VGhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SDYcaVcf; 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 131si21737549pgf.597.2019.07.29.12.43.28; Mon, 29 Jul 2019 12:43:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SDYcaVcf; 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 S2389330AbfG2TmV (ORCPT + 99 others); Mon, 29 Jul 2019 15:42:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389290AbfG2TmQ (ORCPT ); Mon, 29 Jul 2019 15:42:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7700220C01; Mon, 29 Jul 2019 19:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429336; bh=Mt3rxP5j/KBt/R08xubLFerAOhYk7oa71VRYwJkBrrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SDYcaVcflHmtbD+tu5eEbYZ7RdeY2IHUqaYsrpOSN4XPeGsP1bRdYGTvHnXnjJE3y lmZQ5ZRQAOmExpsW/Ym3I1SGFm72UPrh+/F85Vty48+Frq0Cn9h2bn92ZGNDAS2I+P sbf/ZqEbUFE9cf9yPz6vybRfLjGHiARnJ6xKHWLI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Gorbik , Masahiro Yamada , Sasha Levin Subject: [PATCH 4.19 064/113] kallsyms: exclude kasan local symbols on s390 Date: Mon, 29 Jul 2019 21:22:31 +0200 Message-Id: <20190729190710.822245021@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 33177f01ca3fe550146bb9001bec2fd806b2f40c ] 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 Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kallsyms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 0c9c54b57515..31ed7f3f0e15 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -152,6 +152,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.20.1