RE: [PATCH v3 1/7] x86/sgx: Provide indication of life-cycle of EPC pages

From: Luck, Tony
Date: Wed Jul 28 2021 - 18:57:14 EST


> Wouldn't it be safer to do something like:
>
> page->owner = owner ? owner : (void *)-1;
>
> -1 is non-NULL, but also invalid, which makes it harder for us to poke
> ourselves in the eye.

Does Linux have some #define INVALID_POINTER thing that
provides a guaranteed bad (e.g. non-canonical) value?

(void *)-1 seems hacky.

-Tony