From patchwork Tue May 12 03:39:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 11542025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E65F81 for ; Tue, 12 May 2020 03:41:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEAFD2068D for ; Tue, 12 May 2020 03:41:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c1M1X3dP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEAFD2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jYLm6-000417-4D; Tue, 12 May 2020 03:40:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jYLm4-000410-S8 for xen-devel@lists.xenproject.org; Tue, 12 May 2020 03:40:08 +0000 X-Inumbo-ID: 45cf3aba-9402-11ea-b07b-bc764e2007e4 Received: from mail-qv1-xf42.google.com (unknown [2607:f8b0:4864:20::f42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 45cf3aba-9402-11ea-b07b-bc764e2007e4; Tue, 12 May 2020 03:40:07 +0000 (UTC) Received: by mail-qv1-xf42.google.com with SMTP id r3so5788571qvm.1 for ; Mon, 11 May 2020 20:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fUSe4sPjrvSj8MkkBiwu4oYkVAy7jThrwleho5JbiVw=; b=c1M1X3dPW7QnQPjbFpKT7WhAdgxtg4rq9TM7hm5+PSgae+tVgAk0JBMT0ZwBeSwujK uZfh4bYl2V9rpND3rgVchQd6asXnmTwXhhbOxY8XbY93n443iKWwfzsZuihjsdwA21mZ s0xTpK8fDNciZg078A4XzJTMyhk+SpbAogyy/sr6+UFhHR5/GAQ6gXDsDDxUC8eorjaq QPW5lIF7S6arOwtLmGa0T/l4vQJAhS6SoelNd/BBPhKg2qV4P1rP2gKaUyALEejJp0gZ QnInLjfLJjP9Y6LcywP4p/bc9FCcHOxPF4HnQ63li6GccJS1FMtt6k8WDtO8BsEt7wDa vtOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fUSe4sPjrvSj8MkkBiwu4oYkVAy7jThrwleho5JbiVw=; b=Iy6yKbE4zJDwdR9NwlSjTJzWRhzXF+6Nj11GfGsgWEyS2ouzTv/nqWGUP4QkEScg4N xTyIsMVwWUwWwEAdsb2wS5NaxmwmAPPmJBKAedQeDNlDWDrxvgYxEYAadfk7jDlg69ws d/2Si5u2sKm42g0eG/vciqRiPf4UhXoDfxNpUlenEH7mxqq6fQzqyFu/SEAZvCH4To4J jbHIl9BUE3hzV79lW+zvLQldh7anHbJvesRZwyfv/erKg+TGVdmPveNq+wWNR/7T4Rw9 E1V4Lx8UPNigDcl9B2IcsIUnFdHjfa5RYqPi/rI1QBKA3tNNLmtcDKXcSwu8bIs+YgAi kihA== X-Gm-Message-State: AGi0PubRqJmInhCW1Fpbd3Z6S7WEKKbdUs2Ab6+hrX8GHAToEmMfnmmo EDtdStNgAvzzXEmENyPIFyrFE6Np X-Google-Smtp-Source: APiQypLRzxmHa0L58r2SmRhhbfGpiE9hN1MiCxm5pUopE/A9Pmr4BwSf/4tYae5vzJKjB77AHsPb2w== X-Received: by 2002:ad4:548b:: with SMTP id q11mr18798391qvy.129.1589254806451; Mon, 11 May 2020 20:40:06 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:54fc:f6ff:ea10:3d73]) by smtp.gmail.com with ESMTPSA id w35sm1107092qtk.51.2020.05.11.20.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 20:40:05 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Subject: [PATCH 2/2] x86/boot: Drop .note.gnu.properties in build32.lds Date: Mon, 11 May 2020 23:39:48 -0400 Message-Id: <20200512033948.3507-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200512033948.3507-1-jandryuk@gmail.com> References: <20200512033948.3507-1-jandryuk@gmail.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Jason Andryuk , Andrew Cooper , Stefan Bader , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" reloc.S and cmdline.S as arrays of executable bytes for inclusion in head.S generated from compiled object files. Object files generated by an -fcf-protection toolchain include a .note.gnu.property section. The way reloc.S and cmdline.S are generated, the bytes of .note.gnu.property become the start of the .S files. When head.S calls reloc or cmdline_parse_early, those note bytes are executed instead of the intended .text section. This results in an early crash in reloc. Discard the .note.gnu.property section when linking to avoid the extra bytes. Stefan Bader also noticed that build32.mk requires -fcf-protection=none or else the hypervisor will not boot. https://bugs.launchpad.net/ubuntu/+source/gcc-9/+bug/1863260 CC: Stefan Bader Signed-off-by: Jason Andryuk --- xen/arch/x86/boot/build32.lds | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/x86/boot/build32.lds b/xen/arch/x86/boot/build32.lds index da35aee910..0f69765579 100644 --- a/xen/arch/x86/boot/build32.lds +++ b/xen/arch/x86/boot/build32.lds @@ -48,5 +48,10 @@ SECTIONS * Please check build32.mk for more details. */ /* *(.got.plt) */ + /* + * The note will end up before the .text section and be called + * incorrectly as instructions. + */ + *(.note.gnu.property) } }