[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 3/3] x86/AMD: clean up pre-canned family/revision handling for CPUID masking



>>> On 07.04.14 at 12:48, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 07/04/14 10:43, Jan Beulich wrote:
>> +static const struct cpuidmask *__init noinline get_cpuidmask(const char 
>> *opt)
>> +{
>> +    unsigned long fam;
>> +    char rev;
>> +    unsigned int i;
>> +
>> +    if (strncmp(opt, "fam_", 4))
>> +            return NULL;
>> +    fam = simple_strtoul(opt + 4, &opt, 16);
>> +    if (strncmp(opt, "_rev_", 5))
>> +            return NULL;
>> +    rev = toupper(opt[5]);
> 
> if ( opt[6] != '\0' )
>    return NULL;
> 
> Otherwise this code will start accepting malformed values it would
> previously discard.

Oh yes, of course.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.