Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1278867pxj; Wed, 19 May 2021 02:21:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywZadAywVT5A3IV1bSEhnhYlwKDteZ1+Xa9mN6ZM/1NtJ+NdtbJn1HMA5qF5WBhiAJlPfm X-Received: by 2002:a05:6602:2acc:: with SMTP id m12mr9299048iov.58.1621416060551; Wed, 19 May 2021 02:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621416060; cv=none; d=google.com; s=arc-20160816; b=kYmHZdF2uuJFJnJezrZjFsZvv7Vbs5TNR6dy3ucYXmXqm9WlUaYWGxAS0ZbBJn/H7e 11jShZENpDZgXQbTqamDQ8H5stZQqiA+Yzc5Sv91XCKk1ZGKcoEyvwdYpvugGpCzpR9w OreLrdnTBXFVcLtL/1hWf0ewTuKB/VsWqkr8z3NCwaKy9beIIWAU9ObJZUACsHZX8qAV pLu8PFtfL1/c5VZrWY2CLaYMm6hmryhO4W0Yuc+c7tYlKhNjcmUduwY1Fr1YHDWt1zBN h1V+E0u8yIWMQ4SmjGNbZK6CkuGDITut2quSFFqzOfU60oO2GZcaP8u5z9dth+9d5MwP YZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=m1Brqivodx+Oej8cFA0+U8CBPFw0wpmw/nPAdL9W5IQ=; b=Q4gXpC4lLwr+ZAcFqvFrFCcoVNRpS2GfUS95LDMp1Nn1j56t6TT9cBDJS4P8L4TfMG sJk67WwEyQ1fpFxnQa6xmYk+z/eUnPErcBSDl0MtLmY1s/l1Mho+rrQiuJ6tPzSzQR1y irh9MMFhCc2NvgEieCDAC1El0Cj50xjDWQOYjyPrqnJxXgKNDnryBknBbWhaYvTBFpk2 yMtIqU6/1lE/91+3BEynGM3UJN9sWeuW5GAVX9SqgsYfMMA0ip1bUc2HjC9SN8GBL02+ LoBlPb/mP/tV0EUmR/MPTosm9L6WzAr7LVgPv2wZ2vfBkiYScaMs3NNviKD7igj++dir iV/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dn41k2B5; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si26710614ilv.110.2021.05.19.02.20.47; Wed, 19 May 2021 02:21:00 -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=@redhat.com header.s=mimecast20190719 header.b=dn41k2B5; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344894AbhERAQ3 (ORCPT + 99 others); Mon, 17 May 2021 20:16:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47311 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344871AbhERAQX (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-kernel@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.