From patchwork Sat Nov 30 01:10:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 13889037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BCD85D735EE for ; Sat, 30 Nov 2024 01:10:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.846087.1261368 (Exim 4.92) (envelope-from ) id 1tHC0E-0004ma-Qe; Sat, 30 Nov 2024 01:10:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 846087.1261368; Sat, 30 Nov 2024 01:10:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tHC0E-0004mR-MT; Sat, 30 Nov 2024 01:10:30 +0000 Received: by outflank-mailman (input) for mailman id 846087; Sat, 30 Nov 2024 01:10:29 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tHC0D-00044C-G4 for xen-devel@lists.xenproject.org; Sat, 30 Nov 2024 01:10:29 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2062d.outbound.protection.outlook.com [2a01:111:f403:2613::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e2799066-aeb7-11ef-a0cf-8be0dac302b0; Sat, 30 Nov 2024 02:10:27 +0100 (CET) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by AM9PR03MB7694.eurprd03.prod.outlook.com (2603:10a6:20b:41e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Sat, 30 Nov 2024 01:10:16 +0000 Received: from GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e]) by GV1PR03MB10456.eurprd03.prod.outlook.com ([fe80::a41e:5aa8:e298:757e%7]) with mapi id 15.20.8182.018; Sat, 30 Nov 2024 01:10:16 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e2799066-aeb7-11ef-a0cf-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjYxMzo6NjJkIiwiaGVsbyI6IkVVUjA1LVZJMS1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImUyNzk5MDY2LWFlYjctMTFlZi1hMGNmLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyOTI5MDI3LjQ4MTM3Niwic2VuZGVyIjoidm9sb2R5bXlyX2JhYmNodWtAZXBhbS5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== 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== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/GsamCxU4DN+NHcKP8lPzqtJEu/j5Oky0k16OeYjFl0=; b=ESjXKrQw569T3+U6ohQnUqwuP94i1DzmsjeDPVIfej6Tw0mkRzsJgVxyFMH9N9xClCzmatafnhbM4ZLMosnwUv1kDOjFdTjHHT4nijevx5MU0kW3uz6cpBt6bVz8KDs8OCuxbp4SK4IYJJ5oaebwJo03QdkZZ/a/83RNkHL7+3Z23ySNxRU5czgU2+Jl4ZV/aRlkQ2Z1sEADr4VBWk1Wg0rhW4C6DpRACek2dWP0h0KNt2engewxtyvkQBMTt1vCcrAdt8MLihifG17fIK1XE57QDLUfMaIQtiOlA7DARqEcrHCW3JKlk4HiwvKYylg1b7JoDs8NBBY2FaucDmuH6w== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v2 3/4] xen: arm: enable stack protector feature Thread-Topic: [PATCH v2 3/4] xen: arm: enable stack protector feature Thread-Index: AQHbQsSdZeSazgkTckCfCx9gDu8jUA== Date: Sat, 30 Nov 2024 01:10:16 +0000 Message-ID: <20241130010954.36057-4-volodymyr_babchuk@epam.com> References: <20241130010954.36057-1-volodymyr_babchuk@epam.com> In-Reply-To: <20241130010954.36057-1-volodymyr_babchuk@epam.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.47.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV1PR03MB10456:EE_|AM9PR03MB7694:EE_ x-ms-office365-filtering-correlation-id: a3c86f64-0920-46bf-b577-08dd10dbc065 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?bRipTcm2C1tHjSJy+OQ79DxPH5?= =?iso-8859-1?q?BBdwz4nolXBL/9hMF/CDqAYvcarMCkXqyMxzE/Ctk1otpwQGiHDjWA1lkY3b?= =?iso-8859-1?q?HRZZYrmtxmCCbhlAfYEUH1gLCUoRAZ8WY8iYQXDzFXBWY19QrAz9M4EoHNEE?= =?iso-8859-1?q?6HI2yjnDXefDOdhFdxSxEFK13/WyMpf/53jrqxkLOgC7+KNp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ksxO0+haVrmOqDOIG4smBdkTPyaviTSeqakLAQFo036bGW46xBq5rggdxLRX?= =?iso-8859-1?q?Jq2Ew9fF2gYgAHyhHXvSh6nI017sy0XAqYlImhUIgF9Mkw2ExlkinJXtaOve?= =?iso-8859-1?q?zl9umFLo6iEVUljS2Jkq894miFtFW/kLyQfRJEcRKem7DQ/v5ozHEwUtIeq2?= =?iso-8859-1?q?Cl2CwAWlJha4/X9KDI5ekZDqDSonjZkA+dKkltmVQOt9I4EgmS9QrWT/hnY0?= =?iso-8859-1?q?yPHP9w/0LPJxSrMioREQCKju6GbfQmb8tvsKIEXu+3768SrluwCv3jXXJA5W?= =?iso-8859-1?q?jcpwMFPxzAD5dKuUQixpO5kelUSiVEvR4aq7rxbGg+oQZNtvozmcaj4QbKsj?= =?iso-8859-1?q?HzL2y3Z7Powrguoif7iBBcXA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR03MB10456.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?nOhroqYjEZr1xhJrVW8pCTk?= =?iso-8859-1?q?4jsml6Kxveykifqrv0tG2E+W69E7boVcm33YvHiRLlQhe6yqA4BWnOt1+I+2?= =?iso-8859-1?q?iH+pT0ypAJy4ALLbcFgIajqHFV8bTUfN/Qwbfe6PIGps2tV+nksYkTcUErus?= =?iso-8859-1?q?BdY63A3zleVaZh+Ytf22zsjyUlWH6ZSaBetpjo9XDQ3e57TdxTXzdWV8dlIF?= =?iso-8859-1?q?rb+mgxH9z4VDI/ts4uZjg1eFD1I7dAbgYtsEgni7gIDXOeJ2+5yBzAMOe7UX?= =?iso-8859-1?q?xa2rPwqpi9oA0MRuQcPuiLTMZT/gahSBxqtsPLP8WINEF6h/ybwyrHQHUnaU?= =?iso-8859-1?q?D6zbbLozyq1/xqON4dloRXmCXh+2TUYIoZJzTh9XduZEAi4cugW9I9FelL0L?= =?iso-8859-1?q?53OluzFKIH2do33O63Vki5VBIwqJjGwdlxE4IDdsWE+yFFaPuPL0KtiBCjLV?= =?iso-8859-1?q?g4aFztwF843p/Kv0U0Bc6DIslb1IcIsbtbzhE/ZYkAV86lKcmc0NoWhlPwWE?= =?iso-8859-1?q?JfffQoUfHmbY/uR7R1JfXCAE/F83K78tAg6rl+LienQPdSZxgfzgvhN86wQ+?= =?iso-8859-1?q?9SyBpLyz76B+ylxpGH/RrTAz+CfwHZ2yoaxlCj6gED9DR/i6zFSlxPjVkGcD?= =?iso-8859-1?q?IpaKfADoHUz1sqTnTa8xR8ZM4BM5086bF5ksIUmXRn1p5RYkLaLELOPiB81p?= =?iso-8859-1?q?4dqYHDbAWOaZ1zGGElP8jo2JVfHjIM/FPx2Y9PUG3c3pxKjNO6GhHiGRou0d?= =?iso-8859-1?q?CrXa1PCDO0sSAYycQbHp8pwSQUkD66/n12w/lBlUUkvAPdrxazjyOlfTk1Yb?= =?iso-8859-1?q?aCJan44hZ4mmW06oYhnJzLbGqGXxx188yuHU9nbx035w4UMqf8uDc8GWu0FP?= =?iso-8859-1?q?u/z/9XGMN+kECszwtbeUQ8+Lu3peaJUXNtzmKwx3eYlmy/qcTIKMXjwpZq0B?= =?iso-8859-1?q?AzlgYBUyccuWz/AdexVue6jvrlngrkF5DGr4YUCPaGq0vfy+EoCf42YoMKi9?= =?iso-8859-1?q?DLwUpMwDYs8+Jut0wJMwS0yMSgCFaek5iwvJPKSNRCOTrfuggoprQ8HG283W?= =?iso-8859-1?q?JBROQROgnJv30yPBhLOxw2iOPW5EvszYRAyDEU0hDSMakKww7WVIPorBMG4m?= =?iso-8859-1?q?qHRACyzR/8rhb8GxSeUG0gou5nQ1jw87TifDxnnWVhCN+bYcLWQQlBge04Di?= =?iso-8859-1?q?VBWUsNxFyGGWey3TDJmCrTiZ8W+zul5FpXD/PDcb8PtUFHx45nJz4tQQDxil?= =?iso-8859-1?q?lcuRl9DpTGZeh4HZOc9dPZgMeCS39RGpJEgBJwSEmgvyRwmat0JMDuZ+/wWD?= =?iso-8859-1?q?MOFyTspTo0G6tnis+wQll570I4vZawVTvw/hvmOXKHzyiaOUTeIMQFZN7LS+?= =?iso-8859-1?q?qFID8mggSIXW40vE0luQi2V7o9MEHAvNs1iK82kJwH/ognNiwsjQ9HSPwGGY?= =?iso-8859-1?q?d/6dDgXI51tcU3iKf7iH6wONi0HWixQ80SIMGb6x02PYHQiDFyL8r4wBnsUr?= =?iso-8859-1?q?gw+0JYo1j/REWSG1rZG5pH/CUoClCT9EwiiH0YSetP3A9LxIOgAaIMsAf4q/?= =?iso-8859-1?q?CLn/mb0xZgZ4GF1Z39lIZBxaEA6ss1v/7hGh5jCQHrhGvm42T0zkZ7iV8BUo?= =?iso-8859-1?q?qAHiHyZ/P5D05JC4pCzB2uaPUJyFf5THMS2RC6g=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV1PR03MB10456.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3c86f64-0920-46bf-b577-08dd10dbc065 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2024 01:10:16.2832 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dTYxlbX7Jb1Qk0SQ0QLzkPO3bKSZbxWLl0LdEcOJrrry+kyGOR39IBbqxxKggknROqf0p8ODu/uv4JQFumc3AYa5Cuhr6/yJs7vAnqIxEuw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7694 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 --- 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 #include #include +#include #include #include #include @@ -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");