> On Oct 31, 2018, at 2:58 PM, Dave Hansen <dave.hansen@xxxxxxxxx> wrote: > >> On 10/31/18 2:53 PM, Jethro Beekman wrote: >>> On 2018-10-31 14:35, Dave Hansen wrote: >>>> On 10/31/18 2:30 PM, Sean Christopherson wrote: >>>> AFAIK there isn't a way to prevent userspace from manually invoking >>>> EENTER, short of doing some really nasty text poking or PTE swizzling. >>>> We could declare using EENTER as unsupported, >>> >>> Yep, userspace can call it all it wants, and we can also say that >>> calling it outside the vdso is "undefined". >> >> Is there a precedent for this? Are there any other ring 3 x86 >> instructions that Linux is claiming to be "undefined" when executed by a >> user process? > > We did it for MPX. "Don't use MPX unless you first tell the kernel, or > we'll eat your puppy." I think EENTER in plain user code should have well defined semantics, and it should get regular signals with the appropriate bits set in the error code field in the ucontext. But we should probably simultaneously offer a nicer API, and the libraries will use it because it’s nicer.