Messages in this thread | | | Date | Wed, 12 Nov 2014 13:31:15 +0100 | From | Borislav Petkov <> | Subject | Re: [PATCH 7/8] x86, microcode, intel: guard against misaligned microcode data |
| |
On Tue, Nov 11, 2014 at 05:54:00PM -0200, Henrique de Moraes Holschuh wrote: > void *intel_ucode_kmalloc(size_t size) > { > void *p = kmalloc(size, GFP_KERNEL);
Actually I was thinking of this:
void *p = kmalloc(size + 16, GFP_KERNEL); if (!p) return -ENOMEM;
if (unlikely((unsigned long)p & 0xf)) p_a = ALIGN(p, 16);
You'd need to stash the original *p somewhere for freeing later, of course.
-- Regards/Gruss, Boris.
Sent from a fat crate under my desk. Formatting is fine. --
| |