Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3635775rdb; Wed, 27 Dec 2023 14:24:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuIP1cUh5ylohz5xb1CR39VwkY0/cYxEzAqY4QUodRLCP8g2OVTDPnMojIz3H+4BKownSc X-Received: by 2002:a05:600c:a017:b0:40c:357e:27b with SMTP id jg23-20020a05600ca01700b0040c357e027bmr3402513wmb.162.1703715891130; Wed, 27 Dec 2023 14:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703715891; cv=none; d=google.com; s=arc-20160816; b=kIrXzO30R/q25zMXY2UMlWs2ytBkcsxlIUK56kWmsU9GfBzsYa7PvMTuiQIYXVdYrb 5E4Vt79/HPYNh9VrgyX1ftvlUA1w4b2qqC9VVEqhaZVjtrksYZjeyqeIqJjfwM8NBw6k xlRmibSzeCw+cl+hXvG/jfE3x3hxQSle9/CPNPSPHzTxbQi+SOL3EJLgNRb2SMH5Awfk 3OqqWFmeVdzxcnbzIC4TBcujOBo3KV1Ic5ueHWqdwCE+1Aam+4y+nQXyZZ4ldxo/lqEB //rchYDGx9cdtTO58qGJB5xuatAMUnwoS+bYnicXZWCezfsdNwDiDl540w/qTf8/AJMu KVgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=K+ZqtN8NNyzLf6dmeyVXjef6Pc8CyxqpuDo+6xabkl4=; fh=5cSt+EU+KK+wKunFOPjmgcPkoxzkReMhFzvKUy9L0x0=; b=GN9EVrWGNPukM4DW5ox88OrqONBB2gh8VfBU9Hk+X0WoCJ+ypj3lGLHspPHopo7MPj EZJUwG86Hv9nAWtgenXycxWzSbbG8SNNNdKq0RcRmFXAP/updoMZYTSkWFZj0tm8oYUu UvlNLW3aSFHLTnwE04r7NDSAaYaOq5tVJ2MPFr89Gqlnqz22ugm2arEXH61Gja9j9ZzX Jbm5mLDJqWgzHIC8kHPHWDSTLO09S/36zmJiq85c7U1sVxOjxa5xNAglBgWRVv2ltFV9 oHkxlWOQuGPDL0dAsSJ/FTcKfsAlTt39bftN287yOPpQ2y2FehmaCPt/u5YfmDA/2GW6 9FRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kxfkBm24; spf=pass (google.com: domain of linux-kernel+bounces-12293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12293-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h26-20020a170906719a00b00a1b31f8f717si6366430ejk.737.2023.12.27.14.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 14:24:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kxfkBm24; spf=pass (google.com: domain of linux-kernel+bounces-12293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12293-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A48AA1F21D68 for ; Wed, 27 Dec 2023 22:24:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C6C949892; Wed, 27 Dec 2023 22:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="kxfkBm24" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8DA049888 for ; Wed, 27 Dec 2023 22:24:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03086C433C7; Wed, 27 Dec 2023 22:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1703715882; bh=zEUsrdgnAUQ23oCewBpxTW3MR3vDO/bpQtbcXr3pDjc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kxfkBm24tZLUhSzuj1G9mlNxxOsSkyEYKXhboHPkPONc5qOzT++VqXm0Q2glImzWi Aavyw9UfxCSIjZcJyQqu1SCP/l+VUQTpbja9KWMnCdTAUZYmScN0jPP+PLk++7mW/x ow1H1GE5sIDv41GwED6cxHcnm6VHsq8SvQKIx9Yw= Date: Wed, 27 Dec 2023 14:24:41 -0800 From: Andrew Morton To: Deepak Gupta Cc: rick.p.edgecombe@intel.com, broonie@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] mm: abstract shadow stack vma behind arch_is_shadow_stack_vma Message-Id: <20231227142441.f9a76fa3c8b9b79eea8f93a2@linux-foundation.org> In-Reply-To: References: <20231222235248.576482-1-debug@rivosinc.com> <20231227134514.13629032c39decdf1dddcc75@linux-foundation.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Wed, 27 Dec 2023 14:20:36 -0800 Deepak Gupta wrote: > On Wed, Dec 27, 2023 at 1:45 PM Andrew Morton wrote: > > > > On Fri, 22 Dec 2023 15:51:04 -0800 Deepak Gupta wrote: > > > > > x86 has used VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) to encode shadow > > > stack VMA. VM_SHADOW_STACK is thus not possible on 32bit. Some arches may > > > need a way to encode shadow stack on 32bit and 64bit both and they may > > > encode this information differently in VMAs. > > > > Is such a patch in the pipeline? Otherwise we're making a change that > > serves no purpose. > > Yes I do have patches in the pipeline for riscv. > On riscv, presence of only `VM_WRITE` (i.e. (flags & (VM_READ | > VM_WRITE | VM_EXEC)) > == VM_WRITE) would mean a shadow stack. > And yes there would be relevant patches to ensure that existing consumers using > `PROT_WRITE` gets translated to (VM_WRITE | VM_READ) OK, please plan to carry this patch in whatever tree contains the above.