Received: by 10.213.65.68 with SMTP id h4csp428683imn; Tue, 13 Mar 2018 08:46:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELt/Qx1Wqe/cjuL344uEkcuATW8PXB6gb92rQYwz6Qci2z6pQG+EtVUQnci8Jb6H0tN/IA4M X-Received: by 10.98.234.22 with SMTP id t22mr1078272pfh.56.1520955974038; Tue, 13 Mar 2018 08:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520955974; cv=none; d=google.com; s=arc-20160816; b=fWX0/j+1wQAEwvhAEGs1ri7kWEqkWY2QdqFkYPRK4KSNITOlr5KRFtuw0TmwuaP1q6 jGKJh/5YDkrwCCN14A9mC/OQQrpUOgo2nZsrc+vJaSEUFCFEjdJhLX9WpUb7aVMenNZY ICCvIaMfncC62uF6Zf8rv0+mzTfDHj16w8RJYgGFFHxi1X5tx6n2J2c2V1kP7KhuP1Q/ aaHRbDO+kdtOiM/WQFBmf6Aym5u+kENNa9n3VB2IKNhWnt4PI84RqjQNBQ+rU0p4TAQB Zt0Ss28iMo9AeFNy5fi+e3NZYT2Ftzxflic9nGN4G7ACD5O8KiTPGSEHiwMJLceM2wFZ Qwhw== 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=fa2ujxQgZjjzJQIDpp5JvocgQqxCOyiJLRrEVpiGB0w=; b=0TFb/ZzpJ3kCqNwqD0TUXqPT7PQj4s0DCqIq8cgCo64n8aldoYfKOW9/bH0kxo6Dos d33EMU8Z9FQnE45S4NGByBOYKYwQWIg21YqGtf8Ypmm1zlFqqRLkcXXKt8U676rIjhY4 40t5L/dRSz9PJkHOr0hX+Ds2F/rc1RYqNVnq011sSoJ7B3wEeamRy/YhaK9m7QSDKysT 4f6rtHdF+/RhFAx62zwdRw5GyMF29cq8dDpkWnF94EO+3VaN7Rs81MrLQPH1SkT2yKqD YH6XEg1MeBiMNrtk48pU8Ue0P/OB+D1ISuT7+q0w5dzqmqGK0aOGCFFUsnam1m+FS6vd HCKA== 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 q4-v6si277855plr.365.2018.03.13.08.45.59; Tue, 13 Mar 2018 08:46:14 -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 S935043AbeCMPnI (ORCPT + 99 others); Tue, 13 Mar 2018 11:43:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37084 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934720AbeCMPlm (ORCPT ); Tue, 13 Mar 2018 11:41:42 -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 D3B781274; Tue, 13 Mar 2018 15:41:35 +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.14 138/140] objtool: Fix another switch table detection issue Date: Tue, 13 Mar 2018 16:25:41 +0100 Message-Id: <20180313152507.445017149@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-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;