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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 BDDD9C433B4 for ; Tue, 18 May 2021 00:15:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2CA661364 for ; Tue, 18 May 2021 00:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344918AbhERAQ0 (ORCPT ); Mon, 17 May 2021 20:16:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20701 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344876AbhERAQX (ORCPT ); Mon, 17 May 2021 20:16:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621296905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m1Brqivodx+Oej8cFA0+U8CBPFw0wpmw/nPAdL9W5IQ=; b=dn41k2B5K88ZuNaGLbHq7XI1KEiKFlrEwOY07RBC+WfoS0Rf8KzUjdIaWoLw93/7cCrzo4 WMyUSLezLd9malN4bNjVr3jPh3tj6Gl69v0ST5FCjJlpamasTzYKoCJJPbFOx1w5tqHXYL oZR75TeLaMDlrGjUlz90QJR0Xb7neXI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-1urGEQsMMFWI2uB5G78gFQ-1; Mon, 17 May 2021 20:15:02 -0400 X-MC-Unique: 1urGEQsMMFWI2uB5G78gFQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37867107ACCD; Tue, 18 May 2021 00:14:58 +0000 (UTC) Received: from asgard.redhat.com (unknown [10.36.110.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20D615D6A8; Tue, 18 May 2021 00:14:23 +0000 (UTC) Date: Tue, 18 May 2021 02:14:14 +0200 From: Eugene Syromiatnikov To: "Yu, Yu-cheng" Cc: Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang Subject: Re: [PATCH v26 24/30] x86/cet/shstk: Introduce shadow stack token setup/verify routines Message-ID: <20210518001316.GR15897@asgard.redhat.com> References: <20210427204315.24153-1-yu-cheng.yu@intel.com> <20210427204315.24153-25-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Mon, May 17, 2021 at 01:55:01PM -0700, Yu, Yu-cheng wrote: > On 5/17/2021 12:45 AM, Borislav Petkov wrote: > >On Tue, Apr 27, 2021 at 01:43:09PM -0700, Yu-cheng Yu wrote: > >>+static inline int write_user_shstk_32(u32 __user *addr, u32 val) > >>+{ > >>+ WARN_ONCE(1, "%s used but not supported.\n", __func__); > >>+ return -EFAULT; > >>+} > >>+#endif > > > >What is that supposed to catch? Any concrete (mis-)use cases? > > > > If 32-bit apps are not supported, there should be no need of 32-bit shadow > stack write, otherwise there is a bug. Speaking of which, I wonder what would happen if a 64-bit process makes a 32-bit system call (using int 0x80, for example), and gets a signal.