Re: [RESEND PATCH v2 4/4] x86/umip: Warn if UMIP-protected instructions are used

2017-11-15 Thread Ingo Molnar
* Ricardo Neri wrote: > > > + snprintf(warn, sizeof(warn), "%s %s", umip_insns[umip_inst], > > > + umip_warn_use); > > > > This is incredibly fragile against future buffer overflows, and warning > > about it > > in comments does not make it less fragile! > > I need to concatenate th

Re: [RESEND PATCH v2 4/4] x86/umip: Warn if UMIP-protected instructions are used

2017-11-14 Thread Ricardo Neri
On Tue, Nov 14, 2017 at 08:34:08AM +0100, Ingo Molnar wrote: > > * Ricardo Neri wrote: > > > +const char * const umip_insns[5] = { > > + [UMIP_INST_SGDT] = "sgdt", > > + [UMIP_INST_SIDT] = "sidt", > > + [UMIP_INST_SMSW] = "smsw", > > + [UMIP_INST_SLDT] = "sldt", > > + [UMIP_INST_STR] =

Re: [RESEND PATCH v2 4/4] x86/umip: Warn if UMIP-protected instructions are used

2017-11-13 Thread Ingo Molnar
* Ricardo Neri wrote: > +const char * const umip_insns[5] = { > + [UMIP_INST_SGDT] = "sgdt", > + [UMIP_INST_SIDT] = "sidt", > + [UMIP_INST_SMSW] = "smsw", > + [UMIP_INST_SLDT] = "sldt", > + [UMIP_INST_STR] = "str", > +}; Sigh ... > +/* > + * If you change these strings, ens