Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp999786ybt; Fri, 19 Jun 2020 21:08:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOkSdvHfrAz7yUkgTsvZiNHPa4duQ3AOtaTROJpoeXomVPaX/yB+XrUG1DxYg4uNXiY8nN X-Received: by 2002:a17:906:9402:: with SMTP id q2mr6456269ejx.216.1592626087556; Fri, 19 Jun 2020 21:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592626087; cv=none; d=google.com; s=arc-20160816; b=Yzv93l1bTrPndRuc2+lCfEnfOcb6QEqtjQMiFEeCWC44SUEpZ4PgUx04FfheA4WmbI PY+v23OiTBvv4fB/sGGkydSHSH6Y/ZWTeadjQuSHeSYZuag5tNMBanIyYnCpzHJ26Tmi iFSrYuODyjwKvuRTN5JXhPdtFMZKCm3025QPHtZxI9AScpTCDG/OMOKDpxbZXAq5JTnE aXsl3NLHDfxnhWFnbAUV94ZQDQeFJ+1KClKNuYhpEeakYU8rOHxooxbfnkfcrUyrw/Dw aJzEbHkRbDVGu6J50cJuKvlSZB/ihuEwGkHa4gzffarKxKDdS0fqf9dL3PPO3lB6ATaQ RWgg== 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=BdgmJed8WwODAiyLM+K3tBOCuNnfH66CgCKZWXyh3Rk=; b=T18zTR2yEV5LLUCx4JL/9ycmu4QGLUAEBTIv13UL7xeTppv1dyBPonpYSTsZyPiOoY Kkn8sy4yMWPZ6AvvUzjxu8V9BmNhmYQOMMlFWwsxPi4noCGR2KVZEaP+fetktWqy0Rc7 elJtAxoBdmL6zGsQMVm4fvoQQ/TFXxrsOdeO153urI7p3zjhWpUG3CUB7d5MaT//SF71 w+hmrtMxQtXFJbk5BDBJZK1wSEke4xFAVHOESk6YKHyiRwPSxXoxodiaqDFSs48F01Ne ffvBJF1ommAEp3zLf/lD9WDApC0e3oLK2fQ/MWua0uy8STmuYaTIQkDLN+6/wibaDuDR 9yFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PHnLZiZ4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si4869628ejb.241.2020.06.19.21.07.45; Fri, 19 Jun 2020 21:08:07 -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=PHnLZiZ4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404970AbgFSQph (ORCPT + 99 others); Fri, 19 Jun 2020 12:45:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:60856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388324AbgFSOmD (ORCPT ); Fri, 19 Jun 2020 10:42:03 -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 4489121527; Fri, 19 Jun 2020 14:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577723; bh=LM/du8b8FjrYi1EUgb3XJShtRGgCq7C3Ef2V21ibtII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PHnLZiZ4MS23H2UZmZ0mOBSI7NxogEazxpceEBPOri1A/1+UDfbdzwLPBvMpciM7i xNEBwxd7NYHecEZ3WNQ6lE6BIczrlYV42fvk7qmsXQM3OZJk0ySDdfzvYLhRhPjnFL uE1/Ovn8Tui6YmvRnhJ2Ntez6Gm1uUC1yjbwo4Bo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Thierry , "Peter Zijlstra (Intel)" , Miroslav Benes , Josh Poimboeuf , Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 056/128] objtool: Ignore empty alternatives Date: Fri, 19 Jun 2020 16:32:30 +0200 Message-Id: <20200619141623.160513124@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@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 From: Julien Thierry [ Upstream commit 7170cf47d16f1ba29eca07fd818870b7af0a93a5 ] The .alternatives section can contain entries with no original instructions. Objtool will currently crash when handling such an entry. Just skip that entry, but still give a warning to discourage useless entries. Signed-off-by: Julien Thierry Acked-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- tools/objtool/check.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index b0b8ba9b800c..c7399d7f4bc7 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -778,6 +778,12 @@ static int add_special_section_alts(struct objtool_file *file) } if (special_alt->group) { + if (!special_alt->orig_len) { + WARN_FUNC("empty alternative entry", + orig_insn->sec, orig_insn->offset); + continue; + } + ret = handle_group_alt(file, special_alt, orig_insn, &new_insn); if (ret) -- 2.25.1