From nobody Fri Dec 27 13:45:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1732929052; cv=pass; d=zohomail.com; s=zohoarc; b=md6bgcS+w8x+RUHWK7RpKyggD3zvCcFKxkfpZdM3aG/CrgHcdM4uZJ1V4BBwFT+RvDhAJbkVxQqO2iGPk478hRRCywLFd3x5iZVrsnHN7dleVdqctjlG2oonjsyLspmCXqhU57hvwg15e36dXcJs0VwGW5RJjhL+3LxMvjgR+Nc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732929052; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sMLsAsxP2jCKXlPGp2d48OpFc6sgoHg60qnvVOllAa0=; b=HkDXePHz8MURI1s7ELff0L7aeFa2spmdTqZ5upTSHhEJ40FiXsx+73AGpFAjoUQTcsOQjVSPTrfVdIGwm38mfyzYNjhVFpNbfyWK7uFZpPnNNBppHw6oiRi0QXpIq+09rEzMtvO82i/65u/qM8twhiESmz4eRkmqeHujGuafxCQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1732929052288153.878391089528; Fri, 29 Nov 2024 17:10:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.846086.1261358 (Exim 4.92) (envelope-from ) id 1tHC0C-0004XA-J3; Sat, 30 Nov 2024 01:10:28 +0000 Received: by outflank-mailman (output) from mailman id 846086.1261358; Sat, 30 Nov 2024 01:10:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tHC0C-0004X3-Fh; Sat, 30 Nov 2024 01:10:28 +0000 Received: by outflank-mailman (input) for mailman id 846086; Sat, 30 Nov 2024 01:10:27 +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 1tHC0B-00044C-F1 for xen-devel@lists.xenproject.org; Sat, 30 Nov 2024 01:10:27 +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 e142c225-aeb7-11ef-a0cf-8be0dac302b0; Sat, 30 Nov 2024 02:10:25 +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:17 +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:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: e142c225-aeb7-11ef-a0cf-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjYxMzo6NjJkIiwiaGVsbyI6IkVVUjA1LVZJMS1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImUxNDJjMjI1LWFlYjctMTFlZi1hMGNmLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyOTI5MDI1LjQ3MTA3Nywic2VuZGVyIjoidm9sb2R5bXlyX2JhYmNodWtAZXBhbS5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q6zrJPiOoYZzJHV1mJopSCls5JIBibHr+mbOEgXnZHiDSxUunWb9ODvMUw6nQDcuohPbUTgS9az8Yu84i1LA/6dvTJHfFDykAtTno8NXadCpsGnQj7kifdmFoHKQgXjlWpGvT4dpyPCXlAFaSiDdAiuMrj8lHiKO/4qdYKajaxGZUUVL1OHEINhNFqqvLbUGcRG3vOeEajpodhdrDEAba+oCoD3AHu0ZXpx1lLfz6LL1vbNjwGatohV5OD+e1ZIquuiOaGTAdzKrltrSAxRdNQPSrte9/jLCkwNNbILIp0HxV9is3hAa2fBaXrHWd1nNdSKiGmhXXhh4OgofwDVzyw== 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=sMLsAsxP2jCKXlPGp2d48OpFc6sgoHg60qnvVOllAa0=; b=aEY9T8VKCMjTGIjleNZuRGbY2+jKMaJfgyyUBGYSVW75fh+/IGc3HngvzYFPwf/naj0dSt1SA+ntWF9Em1xJGhI6OuNCtATl3TEburhTj5TRG6n+zyU/g42u34qxiT9iugd1otpMlG/kC7KzEloVZhVfzG/Vrr4eFfyVMa2HBkyJcQMtdL0z3+1XSqJep923te3WTxv5lL6vJorXufoiV/DFmr/TFQTkdiBvOTvmdqRO+tynUx7aEKDj9ASip3TWBPivFVv4M2o6zU5/GEWeHLDNWubddfF44WPP9B/oFngQ9//AdnvYe/Mb4CyYdS49WyjjnOUgQP/PJITug3IBFQ== 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=sMLsAsxP2jCKXlPGp2d48OpFc6sgoHg60qnvVOllAa0=; b=rvv9qRw9tXc23DMjcV9jea3tJ3lcW7hrrPAu15DPg2WMMVRlDy4Lg41kTFuxd9PUn/36dl5cgJpXkd8NLRzdxf3Dphu+V8w9slewHJju+mzkElhm2pyHNUTmNvakRozC3cR7U8DCW5fbIZqh5CUa4o4yabNAN5zojJTT41Vm/eXFdPMchEtzHZBVnr4mAgvO/wbdj18b2gc9SzrLq5BC4tdzrZGH99LsLscIjREWS3EQA/PIeA3SPb5Qm1G7t6MB9L4zPc8skzRGm3FcHVrc5swkyX9GwwoPaHzulX9LEyjLG/VXiXanxQ+rPk75SluQ3TUv1cuSeRRS7i+WEEEl3Q== From: Volodymyr Babchuk To: "xen-devel@lists.xenproject.org" CC: Volodymyr Babchuk , Alistair Francis , Bob Eshleman , Connor Davis , Oleksii Kurochko , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v2 4/4] xen: riscv: enable stack protector feature Thread-Topic: [PATCH v2 4/4] xen: riscv: enable stack protector feature Thread-Index: AQHbQsSdrqhVO8R3/0W5bnSX25z8yw== Date: Sat, 30 Nov 2024 01:10:16 +0000 Message-ID: <20241130010954.36057-5-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: cd6b4f3d-38c6-47e6-1237-08dd10dbc094 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?k3mjZrk9VHb7MObOMvN85ZqNUkvQyQJ7H2Fb/FMmMEj93r4gE49ZJ38yjU?= =?iso-8859-1?Q?Dr+w414prgQDAp5wlwOnbW5eEcemHqXTVK92aTxCqcQR9GZP3KXK4ZQLbQ?= =?iso-8859-1?Q?kLR44QVHVKertD+sS07H4CJ/BVu/DE/cUIwxSHFgker9t/p7z4x34SukGf?= =?iso-8859-1?Q?3zmi6T9BT8Bu0VhEs8+PUA+f/ci90PYNccA1IeleqwO2vICq7HSHVWIGUF?= =?iso-8859-1?Q?F4mU2djjxo++Pzif3qLaYhQYkz+8t8qE1Pz3Yo1QF590xrzqAcyNucJtOY?= =?iso-8859-1?Q?Inezyc4u2BCvYARAPyB0glYIAgp9bvNFHizppsTkrPJ3Wqjy0XQ8vMvECh?= =?iso-8859-1?Q?qAbE0FsGq+iUp3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?= =?iso-8859-1?Q?VjaIrd60cJYmBI1MvdxGJxpNlDSEKLptjadYnxT26IY3JAb8hFPM9ej68J?= =?iso-8859-1?Q?iPQCp51Oxo4BbtLGhb252p9EWEs67c/rOASYvkoN6qs4IvWnzXBRfRLTnD?= =?iso-8859-1?Q?yfOScW6Jwo69pXFXR9Kpz4Iiu8yhGbsbpHH7GJHPIWYj47BLudM2VFAZyE?= =?iso-8859-1?Q?try/OqTqaE+kWIaIRMEwJWrQy47FB1PV3D0Bkg=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?1X3XPcbFMFaVlCJOmqJr0uiSPPlahk6n9va9JCIoqHAmNpq+PlvNXExJSJ?= =?iso-8859-1?Q?8BnrEGNk8AVDsKgCtcO+FPZZxw3R2FXmJqq97RdvzCkyI6nBWn3nX5CUmq?= =?iso-8859-1?Q?PT6KkIhEpayOzI8zzIic9h51oSWSLBLwlvGEjtREJs0XIhzF8tIWrhcWKy?= =?iso-8859-1?Q?9DA+ja0jISlgfI7+cEr6znCy5eFaZDizn2vHh/Os6gPwtYwgo91ObEPqqf?= =?iso-8859-1?Q?43XLk03uPD3a5oCuvbL0Un+ERLxAltfMPSWHw3XrIfpbGoLJih8y+Z/04B?= =?iso-8859-1?Q?GCkNBDDcxg8/4OBfMGaIBWkENAUlmkwGBQhpKA5yRN6h3KoOjre/liu0SR?= =?iso-8859-1?Q?xmxqJ0hWG+I4kKdVJdLd1T4Q2GQROljjP7f9jjFeiy4qx7JKrjR7gWODik?= =?iso-8859-1?Q?8AzVMHS9gGbMfpJWcyQRfzdOJf6EpCsku90o4wRBiBKxB8ktkRm/Sp6uO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5uybmvWnM/S5uW8Gpj3/mDNKl/DxDd4oVGifW3?= =?iso-8859-1?Q?ZVA4+PNBqZQoq88KqoPe+y6cK3xxD5d8dfDVYCrThagxLe+7yMPNXbpa2h?= =?iso-8859-1?Q?4+VBJoPYmoLmhMrC9PrGQ8WsA+pxq7E8axx393adTe9HYLqDJCYAGw19rL?= =?iso-8859-1?Q?oN/Xc7WCusm/Ve0RmvqtvFkqT4c6qO2nJDg/tfB6/ITLpyvPUmrzlh2H0q?= =?iso-8859-1?Q?FtDbr/rnuc44f1xR2L3k7laXWKnm4bH+ryL+VsELSnnHDYsz10QC9gNJYq?= =?iso-8859-1?Q?ukmul5f6T2fLLRPdc74JPYd4b5JB4nXbIFIAoJ/shfjnLal03Woxyx1A?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable 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: cd6b4f3d-38c6-47e6-1237-08dd10dbc094 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2024 01:10:16.5991 (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: 8X8GmRRjURy0XqMk2Shw6ukUfXhf3iq3UNSrXAZZbQI1AhDmi0qfmbXJXvRquAlFNRoK1sCeIcrmW3IN1CPUkOooU7mGRzZ4qyloR9wGUgU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7694 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1732929054190019100 Content-Type: text/plain; charset="utf-8" Enable previously added CONFIG_STACK_PROTECTOR feature for RISC-V 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 Tested-by: Oleksii Kurochko --- In v2: - Reordered Kconfig entry - Added Oleksii's Tested-by tag --- xen/arch/riscv/Kconfig | 1 + xen/arch/riscv/setup.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig index 1858004676..79b3b68754 100644 --- a/xen/arch/riscv/Kconfig +++ b/xen/arch/riscv/Kconfig @@ -4,6 +4,7 @@ config RISCV select GENERIC_BUG_FRAME select HAS_DEVICE_TREE select HAS_PMAP + select HAS_STACK_PROTECTOR select HAS_VMAP =20 config RISCV_64 diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 9680332fee..59eddb465a 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -7,6 +7,7 @@ #include #include #include +#include #include =20 #include @@ -57,6 +58,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id, if ( !boot_fdt_info(device_tree_flattened, dtb_addr) ) BUG(); =20 + boot_stack_chk_guard_setup(); + cmdline =3D boot_fdt_cmdline(device_tree_flattened); printk("Command line: %s\n", cmdline); cmdline_parse(cmdline); --=20 2.47.1