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 98DFCC433E1 for ; Thu, 27 Aug 2020 14:08:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4FA4222B4B for ; Thu, 27 Aug 2020 14:08:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uy7iSHws" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FA4222B4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB5D68E0013; Thu, 27 Aug 2020 10:08:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8D988E0006; Thu, 27 Aug 2020 10:08:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA3518E0013; Thu, 27 Aug 2020 10:08:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id B500B8E0006 for ; Thu, 27 Aug 2020 10:08:18 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 63DFE181AEF1F for ; Thu, 27 Aug 2020 14:08:18 +0000 (UTC) X-FDA: 77196528276.23.box64_590a6d22706d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 8F9A63762C for ; Thu, 27 Aug 2020 14:08:12 +0000 (UTC) X-HE-Tag: box64_590a6d22706d X-Filterd-Recvd-Size: 5349 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Aug 2020 14:07:56 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id v6so5902566iow.11 for ; 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=H6/uvTtCWGNOiUUyrN/okq4ySOciOBR/ATkpFWo/loECBw+C7hut+PkW3N3roSwXQe 9pp1zORPGVWfe/GAHCJuQQ/t3s03Y/eDiQOLC69mokkm5lc6GEKGCylET5Q0oDfXiLjx 20dz1LE2d+XKCL4EsNfs/qgvJnVpWummmE/w1wSJyDSCsocQs10HhL9x3XvCybj1kekj ufqkwec9rMDzV2VK0sykCgin3qD7UFmWfM6qjmfwoOB3DSMqrbn1m3RgNla70ee1Kv+q aV4GAPNgqemuV4cVCJPCWVRREFFouqU2m1HmGG3wsxZ4cRXYuyl5eQ/nFqdYSJY+e1YT ni3A== X-Gm-Message-State: AOAM531aHjhAC4aZMSBtN7wAbPt0OvumicwNeXjEAzk0K4t8di5M8nhs OAkR8F/0GFoW+nLotzsWEID3Zn/aVceWGzV/Scc= 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" X-Rspamd-Queue-Id: 8F9A63762C 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 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.