Hi Andy, > From: linux-sgx-owner@xxxxxxxxxxxxxxx [mailto:linux-sgx- > owner@xxxxxxxxxxxxxxx] On Behalf Of Xing, Cedric > Sent: Monday, July 01, 2019 11:54 AM > > > > > > That said, every executable enclave page should have an executable > > > source page (doesn’t have to executable, as long as mprotect(X) > would > > > succeed on it, as shown in my patch) > > > > Does Sean's series require this? I think that, if we can get away > with > > it, it's a lot nicer to *not* require user code to map the source > pages > > PROT_EXEC. Some policy may check that it's VM_MAYEXEC or check some > > other attribute of the VMA, but actually requiring PROT_EXEC seems > like > > we're weakening existing hardening measures to enforce a policy, which > > is a mistake. > > My patch doesn't require X on source pages either. I said "would", > meaning X *would* be granted but doesn't have to be granted. You can see > this in selinux_enclave_load() calling selinux_file_mprotect() in my > code. The purpose is to determine if X *would* be granted to the source > pages without actually granting X. Forgot to conclude that we are on the same page for the requirement on the source pages. And given that requirement (enclave page cannot be X unless source would also be allowed X), measuring enclave code pages or not doesn't make any difference from the enclosing process's perspective in terms of security. So it only makes a difference for the enclave, which however has been covered cryptographically by its measurement already. So SGX_EXECUNMR doesn't have any practical use, thus I don't think it should be added as a new permission.