On Wed, Apr 17, 2019, 14:20 Thomas Gleixner <tglx@linutronix.de> wrote:

It's not necessarily a W+X issue. The user space text is mapped in the
kernel as well and even if it is mapped RX then this can happen. So any
kernel mappings of user space text need to be mapped NX!

With SMEP, user space pages are always NX.

I really think SM[AE]P is something we can already take for granted. People who have old CPU's workout it are simply not serious about security anyway. There is no point in saying "we can do it badly in software".

       Linus