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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3BA64C433DF for ; Thu, 27 Aug 2020 14:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15D7822B4B for ; Thu, 27 Aug 2020 14:16:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uy7iSHws" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbgH0OQi (ORCPT ); Thu, 27 Aug 2020 10:16:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727909AbgH0OJB (ORCPT ); Thu, 27 Aug 2020 10:09:01 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B57C061234; Thu, 27 Aug 2020 07:07:56 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id g13so5907161ioo.9; Thu, 27 Aug 2020 07:07:56 -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=iITVmmu5F1v+iFfIuLRs81s+K0iMXUs2nHXl8cgJB50=; b=uy7iSHws8QJlH2OIPuDxtxRqUPcagcivIv2iPdlsV+MumRglXRHWq5eeU3uy3AByv/ ZwN9uspZfhyGL2FWrYeN2D1b1uBoEOpWV4Xwvyk6LVldJvZNOl0193t7Yl0MV1U+2Vim fZsT7FDPzqrFrEEOqMlpzvya45PbafSHIyH+GOQjt+B/SnT0tzN3Z10+3tNNvazK/xDU 26xlbtiFaNBBiyeEFE7qMNwG+sfYobVyQOfPXbkvDnJNZPli0eHAWhxLWf1yaEPjseB1 zXfqc1tescWT8EDTnreY9CSJMY6ZUsOdhTorGmRIG0F5OeboElvAk4/MD9fuH52TDlpW y7jg== 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=iITVmmu5F1v+iFfIuLRs81s+K0iMXUs2nHXl8cgJB50=; b=SrNyrLH0UyvuEJ9HbYQPv1lXdTSpsgkCVuMpBhdDOuxLrmVMJFLYMYhZzLomloDmH3 j67XasVLty8s+XWqkuRDxBv4GSeoNYT3744oT/7gfNXGMD//HNS4oS2AEsXITzdmarq5 GOubZcMGKwnsJ39j7OuzDloWZdHWqn8SDSWtAad40DsE0+LOQXxvIQwqCnhBoC8sB9sX vQCaCzCp3gz8keRUUJaLZIbKwjXEgtjXB10AT0YxgFikY8Xw59c/MwX0oQs+dS7HmJp2 LaVcP7fSo8aPp/aWlvmuhwpqOxqAJvPpMvkfuBC33vhdErs4HLsCAJY9wppSErCvOqCf aJTw== X-Gm-Message-State: AOAM531vyK7BnFnJUDrh/FQ87EYN79I7MHGBppXYsPSc6assTMiJw1rG 5D8UtW/aU9Yq8yoH9t18ReGELmLJy2gYhFeW3qM= X-Google-Smtp-Source: ABdhPJxHW3P48zYk8f8mc/UUwTyYIhmmTX1pyklbu8A1w2KH5Tmw78GkHcjFUMXT9WemjmzZ+54pyuGyapkq4P1L7Yk= X-Received: by 2002:a05:6638:1690:: with SMTP id f16mr19835741jat.91.1598537276190; Thu, 27 Aug 2020 07:07:56 -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: <873648w6qr.fsf@oldenburg2.str.redhat.com> From: "H.J. Lu" Date: Thu, 27 Aug 2020 07:07:20 -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-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org 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) -- H.J.