[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] xen: arm: enable stack protector feature


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 22 Nov 2024 21:07:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hKhc6MOCXjks3p+mF1Hok1MhyOqzBUachJYh4VSNAfA=; b=pzOchMNl+fLT32dCQV7r01lAII9BvuvkhjInQ/RNH5X/xrJRs3aB4lXVCWE/n4OaWoFdbIwu5pKWfjAPCRg4LRhNxdH1+DcoTmh3pxINE8k4RYcTSZa2vqXoUxUNkWnPbtUXBBXSpDGTTPcAJRxdkWWUgu1nctjMAnr8geautjgOtGmdhTK29moic0FmmTxkh9N/49yos88deeSdMRFGpiP2AMFWmLyA5bmSUrHYz7QJwML9Q4I4B72B5ZDiFxs+PKbTWhc7wkwzzjHbC9Zrqgmz36aqSa4ziq6msKF5CiCFHIxBjxA87gv8cUwMCl0x3CnCL2DGapZ4g5aV/mS3xQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ByzlH/mC/RxZMcA3Jn7WlK2C4XWE8REKDsqGHfRgSnr/0Po/17BWtfFqpY2BvucsxaDYL5jkUTE75MNQgeOb6wr4jiDSdk9hXPaQ5BX/CPOq95euYk3xIOOe/vS88vYFOFuXbesritFa1eEC2EX7B4Lozfm26dcaOvC60+VsHVJQW3mjY43VrdHjytMWXJSmJ4QBt5DW5OvNXcSXO9/FokxljoTmkaPe+I0lmHxHvoJre6gp6zz5oKsaH/a8J3r8UYyTWFVMkAXWPN4PcfIT6T8MoRWXxpxCbsdItu6q0vizdHW0La0Z1y5Ltiw8oeVjOURHbnYJTC8IExeDCtav/A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 22 Nov 2024 21:07:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbPSKKppr5gbUiFkmSWcjt2gLITQ==
  • Thread-topic: [PATCH 2/3] xen: arm: enable stack protector feature

Enable previously added CONFIG_STACK_PROTECTOR feature for ARM
platform. Here we can call boot_stack_chk_guard_setup() in start_xen()
function, because it never returns, so stack protector code will not
be triggered because of changed canary.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
 xen/arch/arm/Kconfig | 1 +
 xen/arch/arm/setup.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 15b2e4a227..8fbb31bc07 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -17,6 +17,7 @@ config ARM
        select HAS_PASSTHROUGH
        select HAS_UBSAN
        select IOMMU_FORCE_PT_SHARE
+       select HAS_STACK_PROTECTOR
 
 config ARCH_DEFCONFIG
        string
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 71ebaa77ca..2bd3caf90b 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -13,6 +13,7 @@
 #include <xen/domain_page.h>
 #include <xen/grant_table.h>
 #include <xen/types.h>
+#include <xen/stack_protector.h>
 #include <xen/string.h>
 #include <xen/serial.h>
 #include <xen/sched.h>
@@ -341,6 +342,8 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
      */
     system_state = SYS_STATE_boot;
 
+    boot_stack_chk_guard_setup();
+
     if ( acpi_disabled )
     {
         printk("Booting using Device Tree\n");
-- 
2.47.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.