Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp472666pxa; Thu, 27 Aug 2020 07:22:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKa1L1gThhwoQDwzVn6AKfLC5Whz32dBPFk6YgayM7RBCrRB0ySYU1+U9Pvw4uT2flnTgm X-Received: by 2002:a17:906:64c6:: with SMTP id p6mr20804423ejn.348.1598538173751; Thu, 27 Aug 2020 07:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598538173; cv=none; d=google.com; s=arc-20160816; b=bKrP3/QtiLyoUymml/9RPk4wuv22LejXXdMbAHAWE3lxLAPrCYxD2oLjtWpU7RwkNU ZehTnr45lWKzW9Oj3vg+pyCD86PMAzm/9wghiNPnYggXAre9PUq3tlJB5XPw/OVB97hF plVN/qj8Rg0F3as/aDLicZo6Kwitv3OuzQXOc+kfu6TzDzo6PjkaDtkoSMWA1DucN6/w O+5ntYdOsxuMeJlRZjyIn3FplMaUjY1EQiaqUwr4uQ9TMTMqMqcWB0g0kudZz9lVA9JO zegrcPT0LzeJxjOewtMdIi3ZUCjOcXgDbKQ4R2m/rRcPQBncZmRk/3/KWJHitWUFKIcT zO4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DlyhGH81WZrwoF+IDUWB7EI8lPsUeUPt9vk0RLR2UPQ=; b=wbdkJjfH6YoDg6L1tqfy2VPf5MBLyyZEsjWzmslbADXchnOplkWgvVeE7F1sHVGBn6 k1p1sGnmoqY1CdbL4+l4sTMd36ozmAmpJBCv25I9uP9htOPIrxPMt7jJeTDnPFcGK1QP CRedQWIjT4LtstCt/D6bkfXWFQxnWiVhRFTf17fIHbJt8VAjJJgeOfSjVZtT/Qy+G+jK cbMoJPXM7mJmk2Gwjgl2KQbNKBVwo6+yiDESefVXj2vkv45rqsTA99Ws44LNJ1sHjgVA oaYAi2oT8zZYCrA5ATKeFpD7+Kq/Rj744+QVVuO1mfTbDNHQ8hI0uTQaFHPNWBqU1AWO eHBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DWU6+CSG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si1594829edr.321.2020.08.27.07.22.30; Thu, 27 Aug 2020 07:22:53 -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=@gmail.com header.s=20161025 header.b=DWU6+CSG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbgH0OUr (ORCPT + 99 others); Thu, 27 Aug 2020 10:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgH0OJB (ORCPT ); Thu, 27 Aug 2020 10:09:01 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E978BC061235; Thu, 27 Aug 2020 07:08:47 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id d18so5891780iop.13; Thu, 27 Aug 2020 07:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DlyhGH81WZrwoF+IDUWB7EI8lPsUeUPt9vk0RLR2UPQ=; b=DWU6+CSGDVUGZucGrq7ip9Nx/h5X2oZMldTR3UyjiMu3aw0gfy35OupTPPPxoJCU/L 9qcM8YsFWWwGfpuUbZi9vWydMWxry87NC+xZvB+bvZLPLayfByZEnssLODQLKU51qTu6 ryCRzepVYbIcYgWKpogxBE1nnBp1L48AhmkSLYlTStF5tE0ZwrjlvC/xmZUcpdXDSn7w sJaGkWm/VbyvBqmfT+OW8M+88cWnaNomjhjtyJIpxaL6/gsRBtEKY5yU4vWkIVdKP82b U9fmoIPW+Uoqww2ZeQ2Fu+8H6VeUWU2QxQQlivRdrDKb5mcBg15MP7bCQ3TBgBdz6UjH jCEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DlyhGH81WZrwoF+IDUWB7EI8lPsUeUPt9vk0RLR2UPQ=; b=hNUA/OV8MWfMjf3JDPVMZYzZYwYOEVkcAUMLKo/oSWIxyxqGt7DWlWw084cfKqoHP5 m+3ZTwvVQ7cK4L64WzpgH0QYqV2trKdX74sm0N2Jq4wo9KY5LXxgdaCNxvCy5dk8SeC1 nIocvjvH6n2ewtaXef908SCmYt53yk7YTNZgrB6pad95nLBJs1joxeWAuWA1H1t9JG+C S+I2nltNcaEuwlrjeP3UjN7TTlAQW/sSG7ydzHZlAl61IWiV0aGQIezM3AJxPaxu+e4E 4gPH2zPm1c1tK7B9E5O2XX5pJJiIkVc9NhifbhH7SkjrYdGQYl35j+RozTaIhGXKc3/D HcfA== X-Gm-Message-State: AOAM530lDlDuX0B95yzbBc9Jdx0AzB3AiPMS/ms0/8pM4bytWNe5vZeN RAW5710lWBm8pKqAemHy0E/ZRa+OaNvtIUz/wnU= X-Received: by 2002:a05:6602:15d3:: with SMTP id f19mr16944510iow.91.1598537325305; Thu, 27 Aug 2020 07:08:45 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: "H.J. Lu" Date: Thu, 27 Aug 2020 07:08:09 -0700 Message-ID: Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: Florian Weimer Cc: Dave Martin , "Yu, Yu-cheng" , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- H.J.