Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp774223ybt; Fri, 19 Jun 2020 13:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiFTHfyJSWlngfzoJjPiOqWMpFpZ7MnGvweAKFPblAzQ9bJDTRg6xya1pzez7D6r7PJEmR X-Received: by 2002:aa7:c15a:: with SMTP id r26mr4943963edp.21.1592598347666; Fri, 19 Jun 2020 13:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592598347; cv=none; d=google.com; s=arc-20160816; b=cP/ZKwRiVWS+yPI/meSJlEyNL8TMkOEwH5oB2n3fQoTulpN0ZAznRf0f+NDXDwqvBP qGOKgIht5LZ2ctEX0CCLGpTiVVxZur0eQWxC9C75VqSVvy2au0lIzCaTwyg9fkdBpSSf 55IYaIwo0GUMS2f8oElpdkqMXXaOQkPus9UU3B+M4d7q74kPBWjbK3+GI4T0P2DHilc0 GWqr8rx2q2qQ3zaRasRUPQc30i5K0zY0XTQzNkHyFEt/BiGUaQz3Ff0ZNPGBn0F5AEg7 2LTBmF1tvepdwuJecjEYx4qu2sKDRsi4MARQXUjVKokcwt+o+W2vyErsFhhKklUQepWh EPeA== 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=ZpWsmr9voec5kzO/s0+HNJLMgx7RH3xAyz/9djqDfRY=; b=x/+GlqsbE28GoOJ0HURC4LEjX5MKq8Qq0VrzrG5lM72op/KYCYE9eZ7eQnEoxDHWY3 SjrdMzuEnm4xxDzQvU9ZGFu04fDpmD2plUAk/zZacgUpbcEwZfgM83BxJmb1xm3Mo7nQ bjQY1T3G6c1J3OxBq1xCptrER+vKTBj/FYzvuNBwXX5SVYkS793PyRO2tSasJXASkY/f yaWtMmOrLPRxwOTTGLVwUxKmRenmmGvgx8waSb59+NEmQb/Pl9zXwxlk6TzR02XAVbQL eaoH1ZFzKkDUUrTn4v13mPB87ihVcibqMca7C/8jKjvPYNDVibOas1BIn7lvb94rrc03 tpJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wmjujtVm; 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 by19si4451666ejb.216.2020.06.19.13.25.24; Fri, 19 Jun 2020 13:25:47 -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=wmjujtVm; 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 S2390259AbgFSO5d (ORCPT + 99 others); Fri, 19 Jun 2020 10:57:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390193AbgFSO5M (ORCPT ); Fri, 19 Jun 2020 10:57:12 -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 49612217D8; Fri, 19 Jun 2020 14:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578632; bh=/YEJX4/4794rBMCNqysDhVlcMXdUFlMmWWEnYdEx+MU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wmjujtVmMnqNCfhQQSO1HwgOTcn38XYeDd9pmpUEn3xFIG7NJ9WYB8XMqiCnxXA/m R8SPerNCxD4OjUOoNofvDOZm3jBGdkuHYXQ7oZ5O30TvihxFYNxX3VDJh0cebf3MKl +xhrZaTUdri8in7XVr4AK+ZQv7dIo40uoU9/P//M= 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.19 097/267] objtool: Ignore empty alternatives Date: Fri, 19 Jun 2020 16:31:22 +0200 Message-Id: <20200619141653.514213479@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@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 4d509734b695..fd3071d83dea 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -801,6 +801,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