Received: by 10.213.65.68 with SMTP id h4csp452298imn; Tue, 13 Mar 2018 09:29:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELt9ZuvvzT3hBL0PYiraQpbxKYsmjCScnbRKx+q6ccTAOUbexE8KoysvP9B4ohJNBC2uhB1Y X-Received: by 10.99.66.65 with SMTP id p62mr961539pga.378.1520958596964; Tue, 13 Mar 2018 09:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958596; cv=none; d=google.com; s=arc-20160816; b=TwgD9NOpT7t6UzbdUW/Lvyzs8QBp5a+rKjlrFUlTKetrPR0R4hzoL0Ltf+9Z0jPQYd lRIRkVlGrulbWOwQ5+z8bR7qsE+XqscyqXYcl41PutZh81pcD5CFx1ktbhxrptZIX2W5 hE9Gjz0dGLPSpXGpt1omDVMed9KPGsrxeGkvpdexaAFVG0/pTD6l1mbYqkYarYe/dLV1 NW0mz6zMVAHUw42SZceDNlgTsnn6IKnnf25I3ofplJYPPZT2LRMX8EXMcjGTajVF+8pd 9RAOgdnOyuKr2rbopSVGwTYgEwqwhrLyP1HNbGb9Eg0vfK6StMDjJpq9yIUjXs7rKael Mdvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=R/db7WB+yL4bHFmGzvpFqZ/zGUxl8EDeb2QJHgX8IYw=; b=ct2KLsyrpDQhsb3dp8egI/1+xwEgoUKrQZp8ycdo0E9vp20YDV8ht5b5KLqmb6I9VR AJIOSxQejQNEc73Wt+UlMuJXzLNH/Wepgl1K12nL3Sfzq9OV0CTae991kImWlu5EXV8W QNdkvyhPbzfnDekYm/uwQfNFh7Saco8Ybt7okDs/cgcLnoaywtu9i4kR5c8MN2pZYMvf yCuUMG82fLIAaLYH+JBhFLsBWD+rT3VTcC6m7P5HVEEQm+d9UsOODZp4SHp6L1Pi2F9D PJIUKPi4FjExpnkPLGRUSbY/DAI3Gcwb685J5tF/b4KIs57zfu/bIlt+wVF4JKM/IxXp qBgA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6-v6si337271plr.174.2018.03.13.09.29.42; Tue, 13 Mar 2018 09:29:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753095AbeCMPdg (ORCPT + 99 others); Tue, 13 Mar 2018 11:33:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60706 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933573AbeCMPdb (ORCPT ); Tue, 13 Mar 2018 11:33:31 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8EA8BDE7; Tue, 13 Mar 2018 15:33:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Josh Poimboeuf , Thomas Gleixner , Peter Zijlstra Subject: [PATCH 4.15 101/146] objtool: Fix another switch table detection issue Date: Tue, 13 Mar 2018 16:24:28 +0100 Message-Id: <20180313152328.313274950@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Poimboeuf commit 1402fd8ed7e5bda1b3e7613b70780b0db392d1e6 upstream. Continue the switch table detection whack-a-mole. Add a check to distinguish KASAN data reads from switch data reads. The switch jump tables in .rodata have relocations associated with them. This fixes the following warning: crypto/asymmetric_keys/x509_cert_parser.o: warning: objtool: x509_note_pkey_algo()+0xa4: sibling call from callable instruction with modified stack frame Reported-by: Arnd Bergmann Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Tested-by: Arnd Bergmann Cc: Peter Zijlstra Link: https://lkml.kernel.org/r/d7c8853022ad47d158cb81e953a40469fc08a95e.1519784382.git.jpoimboe@redhat.com Signed-off-by: Greg Kroah-Hartman --- tools/objtool/check.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -924,7 +924,11 @@ static struct rela *find_switch_table(st if (find_symbol_containing(file->rodata, text_rela->addend)) continue; - return find_rela_by_dest(file->rodata, text_rela->addend); + rodata_rela = find_rela_by_dest(file->rodata, text_rela->addend); + if (!rodata_rela) + continue; + + return rodata_rela; } return NULL;