|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] x86, amd_ucode: Verify max allowed patch size before apply
On 4/25/2014 2:00 AM, Jan Beulich wrote: On 24.04.14 at 21:54, <aravind.gopalakrishnan@xxxxxxx> wrote:Each family has a stipulated max patch_size. Use this as additional sanity check before we apply it.And iirc there was a size limit check earlier, and it got dropped for one reason or another - did you check history?
Yes, I believe you are referring to this commit:
commit 5663cc8258cef27509a437ebd95061b8b01b9c01
Author: Christoph Egger <Christoph.Egger@xxxxxxx>
AuthorDate: Thu Dec 15 11:00:09 2011 +0100
Commit: Christoph Egger <Christoph.Egger@xxxxxxx>
CommitDate: Thu Dec 15 11:00:09 2011 +0100
x86/ucode: fix for AMD Fam15 CPUs
Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.
The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.
Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
The above patch was to make the microcode patch buffer allocation dynamic.
The hunk below simply verifies that we don't exceed the 'max_size'..
Okay. @@ -329,6 +369,11 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t bufsize)last_offset = offset; + if ( error == -EEXIST ) {Coding style, but as Andrew already indicated this block of code isn't correct anyway. Yes, will fix this. But some help in understanding the microcode_init calls would help me here.. (Pleas refer reply to Andrew's comments)
Previously, microcode_fits returned '1' for Success, '0' for error. So, the condition returns '0' when return val is '0' This mechanism is still preserved in the changes made above..
Hmm. Okay, Will just revert this. Thanks, -Aravind. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |