Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3726382pxk; Tue, 29 Sep 2020 04:55:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzVASG4xpYla3uNKKHEvQMjMr4wrjjuOycrtn/MfQ9gb2gC5+RpobpFAdui14bqy7WxCj9 X-Received: by 2002:a17:906:16c8:: with SMTP id t8mr3538207ejd.272.1601380517923; Tue, 29 Sep 2020 04:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601380517; cv=none; d=google.com; s=arc-20160816; b=sqXf34m8HB6pELIlmMwNJZr2aJys0V2CdisqRjGM0cPOWPYmBxHvVxBjpMdLOsqOiJ dmtCPuXhHQwe3mhFUSY0iXdU2m7HQ4zqbl+hA2ZXuPdoeXaUPbKg4ZgePzuGXYNVNkkv UTvDuK2lKY4PCk5ELhDx4R8TgTZHOCdLt75SEkkN80m0DJLOOgtIiPPw86InXeQVJqEf uI+FoFnAaCEcMqUIib8pJWhsa1efirJFuiD7hp1qwwYlV20gDcY0q7lHv60QyQ0YDRD+ Ex/cbyxp2QAog9WrsYuvfZHziFEELy6BQXZ/q4bAu8k65IOnMWwPTflh5cUpmGpeyjh3 Hlxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yBLDFDO0lIZKg894xFE2eSwxpxQSpkZwaj0Lu2nBOiY=; b=l2zYyfwON71KyHXy47mMUX6GvItOcEjthgW6QklBmTHasto3fZjccFfNhysZiUDfMk 62aPzoh5ZxxC4vKRnV9ZRu4M/nITsMQaQWcaB3+aZ5FNmt80zOk+n7Yps7k+b0XSZ1vw 2Aq8XruFq8NyxoJWHqAG85rtkkZhhHVu7NgZYCnAQZ4QOBXUnQmA/dqq3vFu+J1LCVfh 5CjDZMHptpVy4LfrixhbGSlHN2dgjP5Kf9CMs5rnkxWn7tRjytFX1WJeSu2ZiDAT5OWw +rSgnsdEVx1zcIs9pxokiTemF2SAI6WAQjuc5AaKEkSEfo+JzUTWMbxH1cQWEF0BN609 /scw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=stdF3KnU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si590210edj.548.2020.09.29.04.54.55; Tue, 29 Sep 2020 04:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=stdF3KnU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731461AbgI2Lx7 (ORCPT + 99 others); Tue, 29 Sep 2020 07:53:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:47380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730986AbgI2Lqh (ORCPT ); Tue, 29 Sep 2020 07:46:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 B860620848; Tue, 29 Sep 2020 11:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379989; bh=puesQLL1vTui9u2CuuuBOVYfBiDNpon7FKU4BmliOZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=stdF3KnU2vxiLNspN7g6keZ7R8ZGXrpINrUy0sVKwOu8z+6l1/qGCdwWF7y5WPV3a JlqRC0hLYerTO81xAFwZaUMr2XBINDQkLpUUPNr9xyPT0aUbOzaD2hRJb1Y3YzUi2p ZM7Gbc/dRwV7ND5OBYH67N3LoyX0ZEmySmGAjic4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Josh Poimboeuf , Borislav Petkov , Sasha Levin Subject: [PATCH 5.8 18/99] objtool: Fix noreturn detection for ignored functions Date: Tue, 29 Sep 2020 13:01:01 +0200 Message-Id: <20200929105930.615718036@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105929.719230296@linuxfoundation.org> References: <20200929105929.719230296@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf [ Upstream commit db6c6a0df840e3f52c84cc302cc1a08ba11a4416 ] When a function is annotated with STACK_FRAME_NON_STANDARD, objtool doesn't validate its code paths. It also skips sibling call detection within the function. But sibling call detection is actually needed for the case where the ignored function doesn't have any return instructions. Otherwise objtool naively marks the function as implicit static noreturn, which affects the reachability of its callers, resulting in "unreachable instruction" warnings. Fix it by just enabling sibling call detection for ignored functions. The 'insn->ignore' check in add_jump_destinations() is no longer needed after e6da9567959e ("objtool: Don't use ignore flag for fake jumps"). Fixes the following warning: arch/x86/kvm/vmx/vmx.o: warning: objtool: vmx_handle_exit_irqoff()+0x142: unreachable instruction which triggers on an allmodconfig with CONFIG_GCOV_KERNEL unset. Reported-by: Linus Torvalds Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Acked-by: Linus Torvalds Link: https://lkml.kernel.org/r/5b1e2536cdbaa5246b60d7791b76130a74082c62.1599751464.git.jpoimboe@redhat.com Signed-off-by: Sasha Levin --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5e0d70a89fb87..773e6c7ee5f93 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -619,7 +619,7 @@ static int add_jump_destinations(struct objtool_file *file) if (!is_static_jump(insn)) continue; - if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET) + if (insn->offset == FAKE_JUMP_OFFSET) continue; rela = find_rela_by_dest_range(file->elf, insn->sec, -- 2.25.1