[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240812083207.3173402-1-dmitrii.kuvaiskii@intel.com>
Date: Mon, 12 Aug 2024 01:32:07 -0700
From: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@...el.com>
To: kai.huang@...el.com
Cc: dave.hansen@...ux.intel.com,
dmitrii.kuvaiskii@...el.com,
haitao.huang@...ux.intel.com,
jarkko@...nel.org,
kailun.qin@...el.com,
linux-kernel@...r.kernel.org,
linux-sgx@...r.kernel.org,
mona.vij@...el.com,
reinette.chatre@...el.com,
stable@...r.kernel.org
Subject: Re: [PATCH v4 3/3] x86/sgx: Resolve EREMOVE page vs EAUG page data race
On Fri, Aug 09, 2024 at 11:19:22AM +0000, Huang, Kai wrote:
> > TLDR: I can add similar handling to sgx_enclave_modify_types() if
> > reviewers insist, but I don't see how this data race can ever be
> > triggered by benign real-world SGX applications.
>
> So as mentioned above, I intend to suggest to also apply the BUSY flag here.
> And we can have a consist rule in the kernel:
>
> If an enclave page is under certainly operation by the kernel with the mapping
> removed, other threads trying to access that page are temporarily blocked and
> should retry.
I agree with your assessment on the consequences of such bug in
sgx_enclave_modify_types(). To my understanding, this bug can only affect
the SGX enclave (i.e. the userspace) -- either the SGX enclave will hang
or will be terminated.
Anyway, I will apply the BUSY flag also in sgx_enclave_modify_types() in
the next iteration of this patch series.
--
Dmitrii Kuvaiskii
Powered by blists - more mailing lists