From nobody Fri Dec 27 12:26:08 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=1732309700; cv=pass; d=zohomail.com; s=zohoarc; b=m1CD4XFAqga/PcR4eL4i9lsh2BgLS0VIJ9r1vfe9ajg+J6lx0wEudxUqCjmM5Lio1FBqXreGzJOxldcyFBfUHwrUMKbS+70sIaAylN38wX7Fmp1Y56DUqveNVU0z0bT5CED0dRmLrzZTcsw7Y47xft3XycIOGZ/ySHGPxUXq4P0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732309700; 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=KNLjq8vKDQdOVp6utg+lFA4xZstRQk7PIXTXtcimxyI=; b=cnE7+7JnRyRlB/8j/oxfGr9oyfuQOpVglhbN4QZ+CYSH4EBCUb1zjmSTComAdKscpDbQnzf4leM2l/7GOPZ7XGqymPDp6ul/1EGdEQf+xUMGcPdjH/IYSjoYfH3G4HMiajXR4ZdwBnUH79TqrZtTullyvk870j0cDItdo561k9M= 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 1732309700024583.9550066777838; Fri, 22 Nov 2024 13:08:20 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.842004.1257483 (Exim 4.92) (envelope-from ) id 1tEasV-0007gH-BJ; Fri, 22 Nov 2024 21:07:47 +0000 Received: by outflank-mailman (output) from mailman id 842004.1257483; Fri, 22 Nov 2024 21:07:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tEasV-0007g8-8G; Fri, 22 Nov 2024 21:07:47 +0000 Received: by outflank-mailman (input) for mailman id 842004; Fri, 22 Nov 2024 21:07:46 +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 1tEasU-0006xA-Fy for xen-devel@lists.xenproject.org; Fri, 22 Nov 2024 21:07:46 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20624.outbound.protection.outlook.com [2a01:111:f403:2614::624]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d15de20e-a915-11ef-a0cc-8be0dac302b0; Fri, 22 Nov 2024 22:07:44 +0100 (CET) Received: from GV1PR03MB10456.eurprd03.prod.outlook.com (2603:10a6:150:16a::21) by PAWPR03MB9738.eurprd03.prod.outlook.com (2603:10a6:102:2ed::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20; Fri, 22 Nov 2024 21:07:34 +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.016; Fri, 22 Nov 2024 21:07:34 +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: d15de20e-a915-11ef-a0cc-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjYxNDo6NjI0IiwiaGVsbyI6IkVVUjA1LURCOC1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImQxNWRlMjBlLWE5MTUtMTFlZi1hMGNjLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyMzA5NjY0LjQ4NDcwNSwic2VuZGVyIjoidm9sb2R5bXlyX2JhYmNodWtAZXBhbS5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Cc08jIfohAxGrqPd2m7uaZ+ID4ut1zGkoJJgv1sDdyz37eaOi4mnR4zlGaldvffp4fYHiHzvnBcrInp0TykLtMsxscvszdcEsTA02mrWWjdcHVHBqUI+2P1rlA7tMgAKVYdVZrENh0TyVNtrkHHObePxYxXGUwggUf+YDmbJnw23iSxZSw5GEEjY68eTdo0CEzHq2lXLHFoTZHh5WMweSx6HMtc+FmEpkR/lPI0MzI2TfQrhmTFqqYjDdSGjYlnDbhhIvg/kPEIxaeqQpHejXju87s5PgkAE3IZ/Ic+gOzRb6u1kj0C3//4f5JROQm6CWCHHPukEEbdEl0S10RLPHQ== 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=KNLjq8vKDQdOVp6utg+lFA4xZstRQk7PIXTXtcimxyI=; b=E01hlIWj/eTOKonvNibrbU4UYzF+vMb2XwJFwoOfk/8BPJAgjYEnxdJkTwfPAdGaYYZTAAWNK7V7byG7LOYTiN4X3tCTzv1F88h9GEpObquM1koSDRM+j/Nw0m9l8jwuFI6xyxbz56QGrz+4GkGE0rUapPnNXHyqBO1WW6VuAj0SCwg8rUubt6Msx+kpYvy0MkvbNz3tbOwr1LfTeqlNP0i7HwAZJ2dExXXBxWfNwJEBxpzPfPTsl0m6YblnFUE722pE+ZP8RtoviQjDh7hINlRs1uwWH8uEpWEsSgjFrucLzlJOllxBE30LJj2hh/yKAu4tGBgvzbjn8fLBZ+X1bA== 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=KNLjq8vKDQdOVp6utg+lFA4xZstRQk7PIXTXtcimxyI=; b=h80nxDy5HnoCjpqdz+JfSKd+vZrddveWYASYi+Ke/OaBT2JcOfxz1snkQKO/WDdnPhsGepIyPe6+EyKn/hDZ8QoFvNeBy1RwNkgVBm1L6pVWkuWAVSwqAdgzzvov16/7IAeZu5aSI9FZ3cOG4meV8t0jZvuCAuZDJDIn3aAXVUIXg9r9tk4RZLiBwHc+wYsLK4404Ixzfn/UexW8rhlvsqzWSXKLyqyjoao6kmpdMLshknyouEATJTxe87cAIm1fG7xL9DG1FAudUlCEpv6sESG0/a8vLGNWIKLvzSA0iFWZBAZZpIZH77q3uogQSMEvQrT67t0Pf49w2mRM03uQ4A== 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 3/3] xen: riscv: enable stack protector feature Thread-Topic: [PATCH 3/3] xen: riscv: enable stack protector feature Thread-Index: AQHbPSKK7LmLMh+hFUu+rgI8SvJulg== Date: Fri, 22 Nov 2024 21:07:30 +0000 Message-ID: <20241122210719.2572072-4-volodymyr_babchuk@epam.com> References: <20241122210719.2572072-1-volodymyr_babchuk@epam.com> In-Reply-To: <20241122210719.2572072-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.0 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_|PAWPR03MB9738:EE_ x-ms-office365-filtering-correlation-id: 9021afc3-c04b-4a6e-27e7-08dd0b39af7d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?gfvSFmTDN0jJASxjgOGw44tKspQvz4vljlKLduxbZ023iMxbWImwdl/njf?= =?iso-8859-1?Q?BCXCV7pJyul+SVUS1mUPm0jWLENspPZUN2WwtGNzACxXhF60PFwtnB+NyQ?= =?iso-8859-1?Q?ApR0ZQ0Pdh8eHj8+R79R1HwuoXQb3G/fO241bxvz+r9o1lj/pKaC7nFB63?= =?iso-8859-1?Q?EZPFg7uDNeojHwtYDz11tLkoySEdzcShIAM4/XldOUwUwY4yadQsHj8t+g?= =?iso-8859-1?Q?m8SERasOTIEV0PwM6EYH9krnlUfTCcq+Dd9IfhaVPyqUBfaJRKLT6e1Zn6?= =?iso-8859-1?Q?oG9gPokRfNDM/NCDfAzeXfRIKaFt+VtLuSdR7h1FZYq9TshE34/yD715hp?= =?iso-8859-1?Q?s/zHVBBZN+q2B7cvd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OV/?= =?iso-8859-1?Q?BOR10jhua6GignkWJGZQ2Muqwv576RF7KHuRYF/Hrtr2ZSwlAcFIvqH4RL?= =?iso-8859-1?Q?jLoRFp3919VSHfT2yajnQ4goOxz5zUTSaYy4FXju6/HCJAam/My9cjbdXv?= =?iso-8859-1?Q?YSf1bgCgf8/D3BPbpGYveTnG/1uodpaQLTna8MQIqJ2vw8pjpnRvc=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)(376014)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?TVkB6YN8SxXyDh3744jI/T8IGN96a0VTC4bClbj5l89rpKt0n04jckaw6Y?= =?iso-8859-1?Q?sUFRQ9y+zcBoSSxc8iaFNnKY6lE+QLuPIlaZ3G6LTWAjRZB8SUT/lTJ8qm?= =?iso-8859-1?Q?VWtZGrCWDv9PyP7zyjrzcRUFFUTu0gsxD3p4PCcx3AelSO26I47bGE/4oX?= =?iso-8859-1?Q?zqHS48f/uLl1wGVRZ0UnTLDKCjZd3G4Fsp3Px/remgA/yKn2FB9MqPvTYK?= =?iso-8859-1?Q?r66yqw5CDZPkYDvD5H+lCmUzj7P9d6YxdEdOuhlOZxgWk9g3wmHG4XSaP0?= =?iso-8859-1?Q?YOWkyCtv/gryyRiQsodTwfqoacG728uczKPBiJ/vhF5VTSUCp5TIal2va3?= =?iso-8859-1?Q?v+Dd+9HvseVGTa3KvEpR6c/xe3Fsu90Mz94lOo+MKUwqKyosr413iDPn4p?= =?iso-8859-1?Q?YmZAwfd+fpUiBSaP5MWiqDFpUixZ1WnzGMPCLF1+NYNFT3WJdXNLibMAeo?= =?iso-8859-1?Q?x7De+I+S3MZO2dQ+Ar8zPL4ERpNBZSvozx2PObwa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P2id5CbXlJfyA2Ki2OavbYN1gQ0QXLmTf3dJN?= =?iso-8859-1?Q?jOAE546fOWQOpb/DbmnDI7o9s2MeLUB/N7bACRQhQYZ8M6eH/rm+lPsf37?= =?iso-8859-1?Q?m5rgDACruWGhmKMqEB6mfuGDnW3Oe3bmhePgZg76/U4OueDi63bpc7Awbj?= =?iso-8859-1?Q?oi+9N0fuMzBk3FJPFkAsfapgHgJHuSX0HOf2Ff3t5QAPiMzmJpO++zkV6E?= =?iso-8859-1?Q?LMHksXbXegWvsyxPSNeJil1acLJA/vrMBRPl+3AVAgmMoqVq4enB+rBw?= =?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: 9021afc3-c04b-4a6e-27e7-08dd0b39af7d X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2024 21:07:30.2212 (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: UpOkUQd1/b95pJhxZaWSKVqshQsDw9zPAr01nWxFrfcWuqYH8y3u2rA1sC7EQYNL2y7hlaolqaTRK2PxKfIqdA3WczEvrgXIEFenQ7cKo24= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9738 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1732309702394116600 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 --- I tested this patch for buildability, but didn't verified that Xen really boots on RISC-V when this feature is enabled. So I am asking RISC-V maintainers to provide feedback on it. --- 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..1481f23b66 100644 --- a/xen/arch/riscv/Kconfig +++ b/xen/arch/riscv/Kconfig @@ -5,6 +5,7 @@ config RISCV select HAS_DEVICE_TREE select HAS_PMAP select HAS_VMAP + select HAS_STACK_PROTECTOR =20 config RISCV_64 def_bool y diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index e29bd75d7c..cd71748d2c 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -7,6 +7,7 @@ #include #include #include +#include =20 #include =20 @@ -55,6 +56,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.0