[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/4] xen: arm: enable stack protector feature
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Sat, 30 Nov 2024 01:10:16 +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=/GsamCxU4DN+NHcKP8lPzqtJEu/j5Oky0k16OeYjFl0=; b=lp99NVvkken8eGyMkGD+JrsaN1ZI2NfxRM6h5GFUEFjJA8T5yhh00gZzK2dYRRVUGCYtrmD1G/SOIqocgboZ8ZGdLJwmGBng2PdMxTm4bDGJrEnCwPG4c+nOj4QplbXA1vFs1M/9iLXNQafT+7QlqwZ1UiDHbVkA0+X6ipEVknARbtGiU48yGEknP7muSu2rNXCOB9zu/8++JhN9FxtcLF/OSbg58Vx31cB/kXSMPESgqzOf03B1/4Zqv0L+bWHOzip6oVa267kj9wVGJLs4xPGc2GqmpDr6v/XZbbWqjlfrs2Wm+VIEGCUYXOj6IhrhLzA7gYTK/wLcNP5DHBRN/Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dJGgNN3u03vI/zEaAexMLmSK2Zk65WXniXdHACi6cyM8r+F0r2FXdIpV3O5XL7T9DGmqoklF4im4QHVe9TDJz2NqD/6OmtPsDgb2/5JYQP0qgw8zqGsVqH+nM9Q0jkajP7k+07dAhzlJcsAWmWuKHTmh+g+B4DriZ01lZnYzb10vsrCKXOPGMMuTN0N1V71Nf9IzXWbRrL/iefXkQ2Gz46ivOmjqzrsdc8SfdQe1fgEkswMBH4PV4pbmWLV8xU6Gbm5DmfMu4WIUxqeI8KVXyIfUF4Mg+KXKtOFGjVADbWqR9WM7lpAi++XEq3X7mIYe/fEyYbiyhWjfzXhOEVz1Ug==
- 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: Sat, 30 Nov 2024 01:10:37 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbQsSdZeSazgkTckCfCx9gDu8jUA==
- Thread-topic: [PATCH v2 3/4] 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>
---
In v2:
- Reordered Kconfig entry
---
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 23bbc91aad..a24c88c327 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -16,6 +16,7 @@ config ARM
select HAS_ALTERNATIVE if HAS_VMAP
select HAS_DEVICE_TREE
select HAS_PASSTHROUGH
+ select HAS_STACK_PROTECTOR
select HAS_UBSAN
select IOMMU_FORCE_PT_SHARE
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 2e27af4560..f855e97e25 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.1
|