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 EDFE5C433E6 for ; Tue, 1 Sep 2020 18:24:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC80E206FA for ; Tue, 1 Sep 2020 18:24:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC80E206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 526176B00CD; Tue, 1 Sep 2020 14:24:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D76790001E; Tue, 1 Sep 2020 14:24:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C5D26B00CF; Tue, 1 Sep 2020 14:24:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 276566B00CD for ; Tue, 1 Sep 2020 14:24:26 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E1256181AEF1D for ; Tue, 1 Sep 2020 18:24:25 +0000 (UTC) X-FDA: 77215317690.07.cake24_1a0ab502709a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id B1A011803FFD1 for ; Tue, 1 Sep 2020 18:24:25 +0000 (UTC) X-HE-Tag: cake24_1a0ab502709a X-Filterd-Recvd-Size: 4939 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Sep 2020 18:24:24 +0000 (UTC) IronPort-SDR: ESINludrzKFyofBMf4YbOOgtkmUhxRsB7w2ypwbz+P/vL/VxvK9HRapg9aJkTGB/mDtpGikSaf yJV55Gke22+w== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="144983936" X-IronPort-AV: E=Sophos;i="5.76,380,1592895600"; d="scan'208";a="144983936" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 11:24:19 -0700 IronPort-SDR: JNdjWLe1AD/PYaT1EuYkk2gqd72NnZgyyspVGP737AuuGzwnEOz2eCUk+HEGdErsESAz6FZ7Ll ZH2xe5wcu1AQ== X-IronPort-AV: E=Sophos;i="5.76,380,1592895600"; d="scan'208";a="301537028" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.241.30]) ([10.212.241.30]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 11:24:17 -0700 Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: Florian Weimer Cc: "H.J. Lu" , 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> <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> <3c12b6ee-7c93-dcf4-fbf7-2698003386dd@intel.com> <87o8mpqtcn.fsf@oldenburg2.str.redhat.com> <87k0xdqs3t.fsf@oldenburg2.str.redhat.com> From: "Yu, Yu-cheng" Message-ID: Date: Tue, 1 Sep 2020 11:24:16 -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: <87k0xdqs3t.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B1A011803FFD1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/1/2020 11:17 AM, Florian Weimer wrote: > * Yu-cheng Yu: > >> On 9/1/2020 10:50 AM, Florian Weimer wrote: >>> * Yu-cheng Yu: >>> >>>> 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'. >>> What about x32? In general, long is rather problematic for x32. >> >> The problem is the size of 'long', right? >> Because this parameter is passed in a register, and only the lower >> bits are used, x32 works as well. > > The userspace calling convention leaves the upper 32-bit undefined. > Therefore, this only works by accident if the kernel does not check that > the upper 32-bit are zero, which is probably a kernel bug. > > It's unclear to me what you are trying to accomplish. Why do you want > to use unsigned long here? The correct type appears to be unsigned int. > This correctly expresses that the upper 32 bits of the register do not > matter. Yes, you are right. I will make it 'unsigned int'. Thanks, Yu-cheng