Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1920589pxk; Tue, 1 Sep 2020 10:52:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy+n7lbivk2IeLMHpepTiXc3os1EWVM1FUuqfa8sSKtfra0/XPeRLQl25oLB6LId/QlmQ8 X-Received: by 2002:a17:906:2b87:: with SMTP id m7mr2596046ejg.210.1598982751707; Tue, 01 Sep 2020 10:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598982751; cv=none; d=google.com; s=arc-20160816; b=macTEVRH21ROp160sqgkrdN/jW1kP+wfCmSEYoGMnjFOHcna4R041GR8Bon5VkwQFU 0oxK0ZLtmAsRyqJNYHJgsHoNr02LIqiDVyctPcgQD7lA4ixFyp1UYd93/KIiaPcG1WUY oobG+neF/IJPk+W1zALlMr4O0WiF5sB6pgpwLVVcK2hb+tVUXqfzLgJQVpkPbUmKglbl vZl5D1ovnkmeEMKp7VkK/BAeG/vnEMNkGLJhdQKlphcg8TQKpnXnp9Hljpwye7GNjanI c6U8Eoz0CcC52EotGHx3R1X1/Oc36g8LxftWFkcE/fiVirbsAYeM3CiaSI9FLQQEsAQF coNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=3SLT9xn8g73XwpObbZXazZ+6IY9MvjJceuc0Ye3ZKCY=; b=oEfUXc0OJjWsI9bKe7hAQixGD/krhHIyy3g3j4y3fpHBFok4Xxi00cGBw9l9RckKfJ RQy0XeRAyrGZq5sjypqLgC8C6/y0cQcc1Zx5N+2zAYtITOlCZiar15Cl32CKtDi2qEBM mGNTh6jnh24Qp81++4Ui0aWLOKvrsVFjpmubf2drQOFaJdV00O0dAX2Ir/h/UwGZIrG8 NPk7mwkPsPoiU1dQZFM1V0/PR1acQOu2UBZZ2iNzd19QuysD1g5J2KUSBSMoUKoL7EEM KGmZ094Akto1DYFWEweJooU/CRc528ch6osIc7y09MN3r6EqDVdmSLXIU7sRWNbF9icV m+Eg== ARC-Authentication-Results: i=1; mx.google.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 s17si939428edx.108.2020.09.01.10.52.08; Tue, 01 Sep 2020 10:52:31 -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; 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 S1726941AbgIARtI (ORCPT + 99 others); Tue, 1 Sep 2020 13:49:08 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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