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

From: Dave Hansen
Date: Tue Mar 04 2025 - 19:17:54 EST


On 3/4/25 16:06, Jarkko Sakkinen wrote:
> + /*
> + * This is a micro-architectural requirement. ECREATE would detect this
> + * too without mentionable overhead but this check guarantees also that
> + * the space calculations for EPC and shmem allocations never overflow.
> + */
> + if (!is_power_of_2(secs->size))
> + return -EINVAL;

Isn't it a plain old documented architectural requirement?