Re: [PATCH] arch/x86: Fix size overflows in sgx_encl_create()

2025-03-04 Thread Jarkko Sakkinen
On Tue, Mar 04, 2025 at 03:30:54PM -0800, Dave Hansen wrote: > On 3/4/25 14:56, Jarkko Sakkinen wrote: > > The total size calculated for EPC can overflow u64 given the added up page > > for SECS. Further, the total size calculated for shmem can overflow even > > when the EPC size stays within limi

Re: [PATCH] arch/x86: Fix size overflows in sgx_encl_create()

2025-03-04 Thread Dave Hansen
On 3/4/25 14:56, Jarkko Sakkinen wrote: > The total size calculated for EPC can overflow u64 given the added up page > for SECS. Further, the total size calculated for shmem can overflow even > when the EPC size stays within limits of u64, given that it adds the extra > space for 128 byte PCMD str

[PATCH] arch/x86: Fix size overflows in sgx_encl_create()

2025-03-04 Thread Jarkko Sakkinen
The total size calculated for EPC can overflow u64 given the added up page for SECS. Further, the total size calculated for shmem can overflow even when the EPC size stays within limits of u64, given that it adds the extra space for 128 byte PCMD structures (one for each page). Address this by ad