Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1191554ybi; Fri, 2 Aug 2019 10:51:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq8C0cRYxN3znM2fiGR+eCT73fNEGpW2LGV2TTs0TkgL+sLmH58I8hRR76CRFQMlLH1pz3 X-Received: by 2002:a65:63c4:: with SMTP id n4mr123912483pgv.44.1564768290551; Fri, 02 Aug 2019 10:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564768290; cv=none; d=google.com; s=arc-20160816; b=vh18AArdaJPqMYrCOasefzoGVIDfQ4yRDo+4KgSUOopBsyS5CmM6JfQwatpWAj3wrx NoJjLEK8DI+BLc3QPiNUnCkw+ot4GYc8x/X+v7o3pUOF4Mfc/MRwDjN/68LuicN36fK5 g3ughhdL1ZTQek+SkCCMG7n0EThVsdPrqd6k2oL2WoEj1zG1LnFoLElQnw+8wTfayyM6 VNnnuh68SfJwD28dOFx87bChIiYHbvENkSUaRZpGHFiDuKsHXkRLZEk4A8kUd0gDROmc Xi8M+bjW7yAe6oO7Ncl+FXTF6BJNWhzCnY7Z4g+F3cOtN4Acd9iOuCpKzoh5a5WpTG0I KZHw== 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=ctPUYW8xUu1v5uIllC5B/Ss5NdHIHNfIj2sNT5gPmr0=; b=AYuIJ3LRX6VgQ/OtFv5clehivdnFsilPPhE+DPqoOXnomq1jahw2Yx8jeOcoyOA5sx mTSnpxjzsM3qiFjM9gAMRALZbkvOZXL/+kqwQu7F4mN0TEIa17gc6tJhNeFh5w9clG62 c4ASAReXyVgK7RdlJiyDfCSlfposknPLFP4/RUIDxfJ+9dViy0Ea4vgEXFygjSr2i0tw fRUchU00gvRGwtCm0MFxOXjm6fkBwKXn3V2WwXFZf16x1z5xO+5TJtTVIUFnlNkraovq wmseEciS+ug4xM/f7VXEtsYz7njTbFx6henN9JYzSQroFNlKxpXNSBYrJkbU/WNe4xZb s3Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tejIZFyA; 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 w21si40109536pff.263.2019.08.02.10.51.16; Fri, 02 Aug 2019 10:51:30 -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=tejIZFyA; 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 S2405915AbfHBJvo (ORCPT + 99 others); Fri, 2 Aug 2019 05:51:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:56970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405897AbfHBJvk (ORCPT ); Fri, 2 Aug 2019 05:51:40 -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 DECCC2064A; Fri, 2 Aug 2019 09:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739500; bh=l/sJq6+Pylog6bAJK4LtJ4uRslCufPgEYAPgL41//NY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tejIZFyAC2MIcf13bIvOfwGDbkZ7VHt0nFY5vDunV1OiOnAPFKUie0cncdUiLlaLc bGuWs4ueWgcr3Z9Pw0mC+4ac+07LzWHcrKM09RPxkqLEWYQsTfHPFPN9qSZROXT5G3 FsAywI4wS8MWM4kuICQYZdTUkMfCQ6qmp8+Qs1LA= 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.9 189/223] kallsyms: exclude kasan local symbols on s390 Date: Fri, 2 Aug 2019 11:36:54 +0200 Message-Id: <20190802092249.687452392@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@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 1f22a186c18c..2c8b8c662da5 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -161,6 +161,9 @@ static int read_symbol(FILE *in, struct sym_entry *s) /* exclude debugging symbols */ else if (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