Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4538749ybi; Sat, 6 Jul 2019 07:17:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzg91wCAGYTDdLnyWCDAgLFBZnzrUREwdnehh6v8eyy4KAfw6DbO+nRNU/VyYhwk9pGyw2Y X-Received: by 2002:a17:90b:8d2:: with SMTP id ds18mr12190990pjb.132.1562422661245; Sat, 06 Jul 2019 07:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562422661; cv=none; d=google.com; s=arc-20160816; b=dyINoQDs7ZLkzDwCnMXvfsTwH4qGFLndqVWGFSqIGmbgf2FoTM46Bs2nKeAdeS5FIy ysThGFF28WwFU4kgcrJabHKRVpeHyZDPEu+FOX3Pkxk6+TrHAjzEEqR9wRY7Hbs0/vRy lYTLhTSp9qveJdmvvGuWe+KNEXnPR6wYld1ognyvQrUD+/3Np0UgUG46ZEVb0Y69yQqd qHvLCkLfhNFb8W9gg6QZ3Dwb6OazFVBD5ptc14r7lWw2EV2UftV//WyJFbSybBEKzAV0 X66zuhEUUi42+FtDqoOgh6GjGIX+1UW1K2KPolly5Gk7oot8E2FzUAwnMGNi2V8GAbQ+ BRbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=HCApOdyo4KU3IsXI4r6TLPZS6MXQpPNXGi/bCJqdG+Q=; b=c8xoWjt7bTqVkBcpPGekPZBmFFhGMNZfU2SMtr0euKHsmFxLpa5c2hLKrBuoogllqI /LrdjHsD3kSTwx+xFbWt4LbbYUcRLfTwT0s2jmKyP+V479PJNB7Rinf9ylHJCwK5IA1q MUksvE73LAfLMNTsH//XDM+ETpxD0WEBwC3mpJXJP12n0113D8Dcfkc2lRp9vXqaYFOp UfAPgFufXQq/14aj0S4rMtTbm5YoIFbAo8ERsV/+nZ945zSeFbt6okfr+AGr0Uj9edI5 YUBwvArWIJhq/GAMk1gzy0rXkNqz82xPY5qU6+wn7n82HIyW+SBM6GK1N2L7Hh2llLmr 5EMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="I9gn1/j1"; 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 r11si10953099pjq.108.2019.07.06.07.17.24; Sat, 06 Jul 2019 07:17:41 -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=@nifty.com header.s=dec2015msa header.b="I9gn1/j1"; 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 S1726732AbfGFOQ1 (ORCPT + 99 others); Sat, 6 Jul 2019 10:16:27 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:52738 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbfGFOQ0 (ORCPT ); Sat, 6 Jul 2019 10:16:26 -0400 Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) (authenticated) by conssluserg-04.nifty.com with ESMTP id x66EGKOG024269; Sat, 6 Jul 2019 23:16:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com x66EGKOG024269 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562422581; bh=HCApOdyo4KU3IsXI4r6TLPZS6MXQpPNXGi/bCJqdG+Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=I9gn1/j1PhpH+caW3xR8cOVdQc72bRCCKoCeHSs6XQEX/ZZAcLCzq+WGKm/MRCZrU Ox32CG2wh9OQ2OMfPeuIKl5T6qqurjDOpgWsx746DJy4lcTJBpCvAsxDX99jAeT50Z Anvg064r7SF3Wur9eEpyxDZfpFouTsvamMYD4JwjdIZEsnHUQ/XBsxrN/BJMWaoAxv yXFF+LdmLdfrLER7K7tjDwev1QlyBcO8mz8mNxXY4pQymGOWUsmX4oxqf3FpzqMIWy oDdUbcxaeY1yzbaDXWJxWa2fgmeFjLhy4M5zv7RrHSIsOmvUBlt/5KioN0Z3EGhH8i /PeUXC0Pp9M5Q== X-Nifty-SrcIP: [209.85.217.41] Received: by mail-vs1-f41.google.com with SMTP id m23so5489902vso.1; Sat, 06 Jul 2019 07:16:21 -0700 (PDT) X-Gm-Message-State: APjAAAUKqXVcNEPT0V2XG2z4uRtvb+nbCBPPn373VgI3EJFNJmKDu2cO EDc8w7y1CVqpT3JZgXAJEgav1FOxBZDa1gSL7Fo= X-Received: by 2002:a67:f495:: with SMTP id o21mr5321098vsn.54.1562422579886; Sat, 06 Jul 2019 07:16:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Sat, 6 Jul 2019 23:15:43 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kallsyms: exclude kasan local symbols on s390 To: Vasily Gorbik Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , Andrey Ryabinin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 29, 2019 at 2:22 AM Vasily Gorbik wrote: > > 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 Applied to linux-kbuild. Thanks. > --- > 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 > -- Best Regards Masahiro Yamada