Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp473835pxa; Thu, 27 Aug 2020 07:24:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6YA7jgofm5DNGWOuesmlCj8Z7UQSRGV2YHCxuvesrrn9FXzX+rCTQir9+2+inBac0sX/V X-Received: by 2002:aa7:d4cb:: with SMTP id t11mr19785359edr.223.1598538274741; Thu, 27 Aug 2020 07:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598538274; cv=none; d=google.com; s=arc-20160816; b=AKtVSmlnvavH7Dwu70mEUt3frreMgbXhCwwTPyOvFuDXVC52JSBNVyB6Um6wLKhJIX qERmGpYSPe54KdSSFwSUwGVciXUhxs4WPSMJHh80wLJ16x4l0CYYU0w3oJN0AXt8q45Y xtpJDPn5gs4rdnIF7IDL1x7kaltRuFqcfO2oqbgSrKvBID90EDMjcUct7MO7T5oROleC NYSe5aDSd0802pxs9sY8KF3+Iy/l9m2B2SO4vgH045FQj1w5kUOw3ORZTHciCrA8NBO7 jJ5AjAxseYVbWkW8gwX6CfSVbRsf8OuAjTqvsvdByngcq/OUFY9+1Ka+if1cPeH+75aS WR4Q== 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=iITVmmu5F1v+iFfIuLRs81s+K0iMXUs2nHXl8cgJB50=; b=XW3WmhYwxo3KyoWen2GKjymrxz8J07UTyGptBCevmHjlyDSYzYr6nigY1qj07vQDTS FCdvT0b2v/NsGWGG4ER/d32N3zEugUsaC82NK9HrqRwjaJaG0/bkfSP4VJtijvI0FvxO VSfFL3z9nL9vMipjh/3iy2Z7AobAhENVFjuXvtCPdYzzbSds6WUoaCI7Nydin+dBjKRg LXmtILmOSHCvN3NsHeSlBYBizBzcU7Jfefo8sFWw7mIuXLOie3JwTF+oy/van4KWGxU/ l5gAvGsQBRqEU/+uriRe7AjIeMfv0XQtk7XUncb2PlwCPf0CXIoMMQiokxRtRKCaMovZ ytYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uy7iSHws; 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 n23si1442045ejj.194.2020.08.27.07.24.11; Thu, 27 Aug 2020 07:24:34 -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=uy7iSHws; 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 S1727995AbgH0OUz (ORCPT + 99 others); Thu, 27 Aug 2020 10:20:55 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.