From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED028C433E2 for ; Tue, 1 Sep 2020 17:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6772207D3 for ; Tue, 1 Sep 2020 17:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbgIARtH (ORCPT ); Tue, 1 Sep 2020 13:49:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:25772 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbgIARtF (ORCPT ); Tue, 1 Sep 2020 13:49:05 -0400 IronPort-SDR: 8xYUkwzS5RGQxRNpzA4TfvXqpHFnHkKLean5tJoO5sRxZnFGn4UFyrIEqJvjS6r++DOKZszxTU O0uiuVpY2hsA== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="175279019" X-IronPort-AV: E=Sophos;i="5.76,379,1592895600"; d="scan'208";a="175279019" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 10:49:04 -0700 IronPort-SDR: r00JZG/t68wMPpNfXe75+DLGZCVTowqwBSk2AwAfB6zDiW3JoLhHW2vWrhS7SndNyloTjPKNse 74BX/suNlhDg== X-IronPort-AV: E=Sophos;i="5.76,379,1592895600"; d="scan'208";a="477291046" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.241.30]) ([10.212.241.30]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 10:49:02 -0700 Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: "H.J. Lu" , Florian Weimer Cc: Dave Martin , Dave Hansen , Andy Lutomirski , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Weijiang Yang References: <20200825002540.3351-1-yu-cheng.yu@intel.com> <20200825002540.3351-26-yu-cheng.yu@intel.com> <2d253891-9393-44d0-35e0-4b9a2da23cec@intel.com> <086c73d8-9b06-f074-e315-9964eb666db9@intel.com> <73c2211f-8811-2d9f-1930-1c5035e6129c@intel.com> <20200826164604.GW6642@arm.com> <87ft892vvf.fsf@oldenburg2.str.redhat.com> <20200826170841.GX6642@arm.com> <87tuwow7kg.fsf@oldenburg2.str.redhat.com> <873648w6qr.fsf@oldenburg2.str.redhat.com> From: "Yu, Yu-cheng" Message-ID: <3c12b6ee-7c93-dcf4-fbf7-2698003386dd@intel.com> Date: Tue, 1 Sep 2020 10:49:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On 8/27/2020 7:08 AM, H.J. Lu wrote: > On Thu, Aug 27, 2020 at 7:07 AM H.J. Lu wrote: >> >> On Thu, Aug 27, 2020 at 6:36 AM Florian Weimer wrote: >>> >>> * H. J. Lu: >>> >>>> On Thu, Aug 27, 2020 at 6:19 AM Florian Weimer wrote: >>>>> >>>>> * Dave Martin: >>>>> >>>>>> You're right that this has implications: for i386, libc probably pulls >>>>>> more arguments off the stack than are really there in some situations. >>>>>> This isn't a new problem though. There are already generic prctls with >>>>>> fewer than 4 args that are used on x86. >>>>> >>>>> As originally posted, glibc prctl would have to know that it has to pull >>>>> an u64 argument off the argument list for ARCH_X86_CET_DISABLE. But >>>>> then the u64 argument is a problem for arch_prctl as well. >>>>> >>>> >>>> Argument of ARCH_X86_CET_DISABLE is int and passed in register. >>> >>> The commit message and the C source say otherwise, I think (not sure >>> about the C source, not a kernel hacker). >> >> It should read: >> >> arch_prctl(ARCH_X86_CET_DISABLE, unsigned long features) >> > > Or > > arch_prctl(ARCH_X86_CET_DISABLE, unsigned int features) > Like other arch_prctl()'s, this parameter was 'unsigned long' earlier. The idea was, since this arch_prctl is only implemented for the 64-bit kernel, we wanted it to look as 64-bit only. I will change it back to 'unsigned long'. Yu-cheng