Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3789854ybi; Mon, 29 Jul 2019 12:40:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh9c7AcpgGwCONuUVP+G/06+hOXJGhdqM7YZWw4LoCxDgZ0AHjGjyJcPx5hZTPkhn8onoE X-Received: by 2002:a17:902:aa09:: with SMTP id be9mr26820444plb.52.1564429200244; Mon, 29 Jul 2019 12:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429200; cv=none; d=google.com; s=arc-20160816; b=nFEYVIYDI+SnLMYBS1FNMcXB8oH1jzTmStzxqaE0/LdMw94Yhr35P/U+GyTFomJZ2u cONptEUK0uelFlXIeG1/L1cu/hrhqZVkkjyIlvx+xcQKKm0lZyh31JSmokFozgplEBbj 9SnZJ79pmsvsvHdXYraO93sYZzDJ3CSrLSpnKb2wRnLIzLoAyF0lponb9db2/x5syBr2 NKgigYD02hWVSQXBOpmBABU0cpEl2CKhGlcDl74FmJkZS7WSsKkrmqGelhEzSX+lJmlQ tn1I7DgrjzcTHZFIgcWkvybm/EkKGDhEETAR2QD4R2RE+/tUM3HadLa0Gz7sF2WlFMPp MEag== 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=M41X/QWb4zQYTD5YSST1dWsZDeSm/U90LGuAJBu/38g=; b=bSexY+BmD63liVkfI3grvZddb8Cyd489CnX7KUbFd8DxCmLOlCpwcdnRKTpx/26IOf uA3uHDT93QPYQCpRHLzDRqZgLXTOHW+cjmWn96ys3vb0Ljo0jVfGLoyy78yd9fkrwE8X gKSyo48cVd2EfChGg9SnWAmQPG8rJTytA5FPX3vGclQD0vKIHpMLLSRWoF5Y7ZOAc/9+ YX5IEzXK0hBnI4fwvC96N4w4tjx4Wf55L7kiwYwsoB20kGqUW0bjlQyhSd1tzdPHAE9k 3wjaFjsQ1YK9FtOwVdei9OZOXoHd7h+9FCpWMxIjtLgwFhoUwGylWWlE9VL3332x6d07 ZGHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FkV/uCmR"; 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 m143si28445357pfd.224.2019.07.29.12.39.45; Mon, 29 Jul 2019 12:40:00 -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="FkV/uCmR"; 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 S2388667AbfG2ThO (ORCPT + 99 others); Mon, 29 Jul 2019 15:37:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:51570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfG2ThD (ORCPT ); Mon, 29 Jul 2019 15:37:03 -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 3D38320C01; Mon, 29 Jul 2019 19:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429022; bh=PU7Dd+5IV7sWwb4ymWOHQ82+VRVcPHi0ngUL0BtacQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FkV/uCmRiMDO0Ps6xAM0YX0IvrRUYbT8C8WzuHKF2a787KGM98MFFgq95MKZ9zR5q 4bBLiFHsNViw1rcqw8rOhae9fdxPZuzyAckstah5A2nebL9FWYlCboznP61kpWW/LI sjKdTvAbs2CQYiP20KEBkA/9aqJ94FWeZKzzkid8= 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.14 259/293] kallsyms: exclude kasan local symbols on s390 Date: Mon, 29 Jul 2019 21:22:30 +0200 Message-Id: <20190729190844.262976455@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 1dd24c5b9b47..b471022c8162 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -160,6 +160,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