Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp632562pxb; Thu, 26 Aug 2021 10:39:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpPM6QAoOxRhf1M8kDSdOysf/hFSlAX852RqF3GHYUqLAm4SBfFU4q0LKS2CwOwA3yGTU6 X-Received: by 2002:a17:906:fc7:: with SMTP id c7mr4694432ejk.333.1629999550201; Thu, 26 Aug 2021 10:39:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629999550; cv=pass; d=google.com; s=arc-20160816; b=qJAvHn/YAg5+uSEg6gs5/jmsdz9Hlp1vu5aRMPnUy7s+EfBkrwX+6y13LOBHo59DeI 6Vk5e1qlP7sZpTGnmPUBFrNwqDgWwshzrRzIJrT6aKylLSJo5680TXYRn36lZQvka/K5 hZ2Nu+HCXGof5oIlk6IqI20RSDrwUAOdtvEfPfJG93GAgueA2C0yrO+tsEN5OMNxaO6N yQJwXi69lMOHDG1ndUbN5MfAh2C8swK7IZrTpC7A7qR6373jqwbUXlttoGbsM1TrAKIu UL5j3WQll6lSpIlebF2Fwj1xwUotryu1VPn2AcqbxebHRa7wU6a76E56EBLsWb9c+VVS V+pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=7Y7AFltwjNLdTBKi8FyhGktj6hCoxfH2H+LT5zye3rw=; b=pnDuiU14Uhuw9XoZEj6fvzxTMMfGWNWezVJz1trf2E5WnLmBxS0ES6KgxWFOkSuZb2 Oqm+dxUsHnxP7kK60ggz7SJvJaEozbEY/M81thpJD/L58Rj8x6HumaK/PCQ4CzK7ZXxY hAjMs6tXs73SYUGnVfJ4m+owhPeVEwsripFVuDrrHMdAJYT75kqPAkdDtqVz9fcc1+K+ NdJwTIyxVvVIQH8qX6tK3d1evkK9OsRGJLPfbn7BCA3AoaYlCcqKtRqTFGvwFFUy1f8v i70isCzDO7SERIvT2IWIufrDNF0maCRgKz0mtA56InkQhKzZQkJqo5/G3SGkcRQYkCDI TSMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=TpyQTii9; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si4073386eje.719.2021.08.26.10.38.39; Thu, 26 Aug 2021 10:39:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=TpyQTii9; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243197AbhHZReH (ORCPT + 99 others); Thu, 26 Aug 2021 13:34:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:13739 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243082AbhHZReG (ORCPT ); Thu, 26 Aug 2021 13:34:06 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10088"; a="240004498" X-IronPort-AV: E=Sophos;i="5.84,354,1620716400"; d="scan'208";a="240004498" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2021 10:33:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,354,1620716400"; d="scan'208";a="537534495" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 26 Aug 2021 10:33:17 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 26 Aug 2021 10:33:16 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 26 Aug 2021 10:33:16 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 26 Aug 2021 10:33:16 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 26 Aug 2021 10:33:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WAqw5dHZA3wLz0h1h+XNXpewIo35jG+yKUUlLc0zyCCWJ6zTkHq5ubi7vm5gIJtTwAzWjjCN/HUfvUXXQwy3O/UqD7yYZIQGJiViWuXGRz4V+WcGL+YilU6uvLmTXQwxOtSz1UU1xdWz6fhS6OjtjoP7hhTfKVQdmpcw+BPRFIFUG868IkPXsJ5t5QpyXqodqieHBlOM9OJn4pLJx6x7KnNLf6zied62Qx24r2u6ZLXnM5UxXIJtmYEC+SfQljFaWomlc4tmwNS5gPld35J7FN6w+t1Zk38ROxx3IWHxnxt8US87sbQbIWVE5YVE2iCPBrTW8gfqmvAg8ZluMLbJEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Y7AFltwjNLdTBKi8FyhGktj6hCoxfH2H+LT5zye3rw=; b=ibA0Fh2VVHbzKQjVNcbC0rt6eJxL/n08v0GAv9Y34NN3T0c9KoHysCFj/O97fxPAy22DQyXKvTuK+NIcs2TlAGYqLWTpH52n6S49FPdhehsgVpm5HeiCD9GPULBzdNVfi4hOUfwoPWxXQH6ChgZFaun9b3uyOt3rJmnB1Dn8tNlOvXbSK+2Et+/90LFB8K4VClnVWr2ojfnUzExDlcfsmO+LQ51bM9r7N8Kdd0ST+Xnapa5oZkU5sra9EEXGsp45+L7blqP5Hq6z7gEEyNfkxr4s4U73CDyy1zmXLDt5Cy7n6cYiOxzAziNsfSAJl/HvS5wCk9oxtFNGBajMuEaV5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Y7AFltwjNLdTBKi8FyhGktj6hCoxfH2H+LT5zye3rw=; b=TpyQTii9G397DQ8rhXUsDJv3GFJ8bsCQCrvZvBFjtoP9uy24auFOFdR8LbUeNKtLi/Sqf2djTSYZbd50IXx44406lLamS6e9hLHVSemh76Uwc4EeAizkSWBAKq/soSqQnwzu6LbpZBV35giHmoI5VlO51HOt3xxIOhB1iEVeWMQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from DM8PR11MB5736.namprd11.prod.outlook.com (2603:10b6:8:11::11) by DM6PR11MB4363.namprd11.prod.outlook.com (2603:10b6:5:14f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Thu, 26 Aug 2021 17:33:10 +0000 Received: from DM8PR11MB5736.namprd11.prod.outlook.com ([fe80::2920:8181:ca3f:8666]) by DM8PR11MB5736.namprd11.prod.outlook.com ([fe80::2920:8181:ca3f:8666%4]) with mapi id 15.20.4436.024; Thu, 26 Aug 2021 17:33:10 +0000 Subject: Re: [PATCH v29 25/32] x86/cet/shstk: Handle thread shadow stack To: Borislav Petkov , "H.J. Lu" CC: the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , "Eugene Syromiatnikov" , Florian Weimer , "Jann Horn" , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , "Dave Martin" , Weijiang Yang , Pengfei Xu , Haitao Huang , Rick P Edgecombe References: <20210820181201.31490-1-yu-cheng.yu@intel.com> <20210820181201.31490-26-yu-cheng.yu@intel.com> From: "Yu, Yu-cheng" Message-ID: <47a73ab7-20c9-f7bb-14b0-ba81e33fa1ad@intel.com> Date: Thu, 26 Aug 2021 10:33:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MWHPR10CA0070.namprd10.prod.outlook.com (2603:10b6:300:2c::32) To DM8PR11MB5736.namprd11.prod.outlook.com (2603:10b6:8:11::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.18] (98.33.34.38) by MWHPR10CA0070.namprd10.prod.outlook.com (2603:10b6:300:2c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20 via Frontend Transport; Thu, 26 Aug 2021 17:33:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64acde2b-954e-4b12-a7d1-08d968b792ca X-MS-TrafficTypeDiagnostic: DM6PR11MB4363: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9KK6gimRlT31AKCjymw+QQyuNiiXNru26zrUsz4DCH0/wbN6EnoWRVYKNnW9JE77cpkfm6Sr3bvpf4L9ooZEiWJP4BxvkSo8TO8TcIG91BVRPTwaSMtw2wHQL6paeooHlYObv47m6N+cWaq31KzoYlq+fLk/vJCz4SPpEHizMdsqN6PmNEn3U44yx1RnYwOiyE6+NbaW4aFLJe3ZyPHTNmITJPlIGVEtWgFf6N4JJEhTgXv1w9DvHq+/ytwVyS7hwO67nefIn7JMLiH5F9T4EpISpHfjH+yNez3MzAXVdC2Xzd+lp+P8Pk5eWIhDW/TJVW6wzHmPVTCSt0dGThoXVlK+acpui53AMPKYW70gp1C4D5mkGP1EJVhc/JQ9VwWycMgNNdfDNkcMbwvG9U21Tqn74rT/QUPl1XVszrzeSDqurVsTZvEqKlnCvAkDWDH7Lso3SQhLJjg8kF5dJBiAiP4mz1Ic1pIpVbTbNrpE//qHaEDdpAp+rN5MEPKgo2p+lRrwrE49dSEL9/IdIEctWrjVRXGM59RIC/xGJ6tNqXOCHR4jFNind/oZKXT3re4Vma1OOS52MlmRiCnC+hlwOjN/S4kRizsyOFh7YqOcnvWgRwOZhuOc7NwCrLXJAjctqSRLcS9YC4SNzMCAb8bDQrmNBlMDWlRBFmZyy60kctFnu5bqkn5dxn1udY5PWVxVoLtgKVBO2rxhTzHcJjTbmDWRthsf4+nsj+8ymJzS3c0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR11MB5736.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(396003)(366004)(346002)(136003)(376002)(316002)(31686004)(6486002)(6666004)(83380400001)(53546011)(66476007)(2906002)(2616005)(4326008)(8676002)(66556008)(956004)(110136005)(66946007)(54906003)(36756003)(16576012)(86362001)(478600001)(4744005)(186003)(8936002)(31696002)(26005)(5660300002)(7416002)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UmJ6SFl6TkdrTVUrNWZSdGRCclVlaDdKV1RMaklYeVNWQ2hoNkhaekhXdVMr?= =?utf-8?B?TzNORFlVaUZZK0V5ckhsYlZ0NkI5b0ZuUGR4SDhGZ2RjaVE0Z2krdEJjSm90?= =?utf-8?B?ZllCL3FyanRWYzJ2TTcxQ3VoemRTc2FNYTAzVkM5V2NWNzFQZWUzZmZGZlpq?= =?utf-8?B?UHJWNTNXRzRTN2I5RXpTWWJNM0VJdVRKZzY5V2tJSWdQWmdHK2VCUjVORlNW?= =?utf-8?B?NFpuclh1bTVQc3QyMFFJQzJnWTZIeGFrVlYzRTM2MlBLcVIxak9OTW1SdUk3?= =?utf-8?B?aG1oMmY0MjBtYjZI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crSjlFTW1rNlVLemxUd2NLSU1BVE5kcEZ2Ui9QRkh6M0Iy?= =?utf-8?B?MUtQK2dEa2UyZ1AzKzZiY0RSZWh3VWJPVmRrZXh6ekp5d2tKMWl6Lyt3MXpw?= =?utf-8?B?dVR1NUNtQ1NkalVBMnZhbkl1NkV5OW9WNWlCSnNUQ3dFRTJuV211NHk0enUw?= =?utf-8?B?Z0kzZXRRZSthMk5pWGl3UGZjZ0VWWkwwb0FNa2RoUVJ0aUFIL3BIYkQvYUJP?= =?utf-8?B?aUZrc3VteGd5MXdxZ3RTSU50VERxUFZ0R0I2UXhPc0hVT0dnNEY0RlQvbXlz?= =?utf-8?B?MGlwME1xMHBtUVZTVkpiaXo5ejFtdXZ3SWIzS0dFR2FMWlpUSzNqWE1WMC9z?= =?utf-8?B?dTVhVHpTak1iVXZWYTZzNXBLRjhNMWRsZzRGSk8yYms4ejRFWTFhUm9oL0N0?= =?utf-8?B?eVhpRWFKNElmTDgvdjI4Qmk0YUtHUVIrVjdpc2x1MkNCWWNVZjN0a1JsL1BK?= =?utf-8?B?WlNOMlJYS0I5UEwvNCsrL2QwTnYvMGE3YWZqbTh2R3ZjS0l0R05OdUk2aWZQ?= =?utf-8?Q?+zGTQKOGOLgPU3TCGBqeJjI/mhIAvYa2DdKxvsE?= X-MS-Exchange-CrossTenant-Network-Message-Id: 64acde2b-954e-4b12-a7d1-08d968b792ca X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5736.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 17:33:10.2406 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uQivYIYU7s5Wg+yMVa9EKOvznXFJNxgOubXuVU0v70H01Ul8dcRLE3/sxcC16qJJ4xzeSxpflzPs9IgE+M3UQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4363 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/26/2021 10:28 AM, Borislav Petkov wrote: > On Thu, Aug 26, 2021 at 10:22:29AM -0700, H.J. Lu wrote: >>>> + /* >>>> + * Earlier clone() does not pass stack_size. Use RLIMIT_STACK and >>> >>> What is "earlier clone()"? >> >> clone() doesn't have stack size info which was added to clone3(). > > /me goes and reads the manpage... > > clone3() > The clone3() system call provides a superset of the functionality of the older > clone() interface. It also provides a number of API improvements, including: > space for additional flags bits; cleaner separation in the use of various argu‐ > ments; and the ability to specify the size of the child's stack area. > > Aha, Yu-cheng, pls use those words to make your comment understandable. > > Thx. > Sure! Yu-cheng