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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Thu, 13 Feb 2025 22:00:27 +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=rp3sx+Qz/TUPSWt/2rwv/aBkJj8l3/Pj+YsA/GRt+To=; b=Sd14zdgRZj8oEB81mgdQmee7uL24y0zg3GfU5R0Yjj7FU9du7uI0o/TPRIL9EeJD1NdVD9Prfs27Ccj3lF3La7YqzQlSYRAg02pJHNeBUbIaDzuNuXSnIzM2G++v9Bqk65u8EsjyJRDoXwv4MfeBFA+fwp7+gPN0u+D20rKekvBNHU91IJd2J81rqRL7jroRGUL2zYWIhHU1D5xnVE/gZvg/QP6WJC/x6VhQF04TlDgFuz6kw0Q9kSjWV1Pvujd5r5PE8q19NzI577CpfFmhq3BypSLkCYnxTVYEtpJrCuWsTCk2+DokEIIczazpiQYRZxJ/3qBppXHL+cmBTZhwMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OaGQPsvEjHD6WXdgaM5H8PxD+TdKA/720kPYD7vy1cEfa7hNRuzMLQYBtAzu7b3V1R26Ielklk1lWYl9Fh6v2Ik891eMjIjCwDw7NH0xvW5vRDfuJKS/iJ5kOO/9uHzWbSsYU0F4BcXR8l8uVOvW49eM0qFjdNplvkHsJuX9lz7RV6xIK5ydo+94Ap3pVFaX/QrP9ichLhr7yO9UtvC0/sDh9cVt3CXJcSpFVuWG7J7BRrIqoIHdPa8E5tIccwWdg7iHN8Q+POINKoyxH0lUVrl3WIE+iW5u3MMC4smpsuzl9jOuuQYDbNyZCSW3qna23y4XBDOgNkrsl8NHP5JVGA==
  • 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: Thu, 13 Feb 2025 22:00:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbfmKwZ00k4YYKH0WPipI2HVN66Q==
  • Thread-topic: [PATCH v5 3/4] xen: arm: enable stack protector feature

Enable previously added CONFIG_STACK_PROTECTOR feature for ARM
platform. Initialize stack protector very early, at the very beginning
of start_xen() function.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

---

Changes in v5:

 - Call boot_stack_chk_guard_setup() from start_xen()
   instead of early ASM
---
 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 a26d3e1182..8f1a3c7d74 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -16,6 +16,7 @@ config ARM
        select GENERIC_UART_INIT
        select HAS_ALTERNATIVE if HAS_VMAP
        select HAS_DEVICE_TREE
+       select HAS_STACK_PROTECTOR
        select HAS_UBSAN
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index c1f2d1b89d..0dca691207 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -30,6 +30,7 @@
 #include <xen/virtual_region.h>
 #include <xen/version.h>
 #include <xen/vmap.h>
+#include <xen/stack-protector.h>
 #include <xen/trace.h>
 #include <xen/libfdt/libfdt-xen.h>
 #include <xen/acpi.h>
@@ -305,6 +306,8 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
     struct domain *d;
     int rc, i;
 
+    boot_stack_chk_guard_setup();
+
     dcache_line_bytes = read_dcache_line_bytes();
 
     percpu_init_areas();
-- 
2.47.1



 


Rackspace

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