Re: [PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data

2017-01-06 Thread Borislav Petkov
going on. I've expanded your commit message to explain the situation better, see below. Thanks again for that good catch! --- From: Junichi Nomura Date: Thu, 5 Jan 2017 04:45:18 +0000 Subject: [PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data In generic_load_microc

Re: [PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data

2017-01-05 Thread Junichi Nomura
On 01/05/17 19:17, Borislav Petkov wrote: > On Thu, Jan 05, 2017 at 04:45:18AM +, Junichi Nomura wrote: >> In generic_load_microcode(), curr_mc_size is the size of the last >> allocated buffer and could be smaller than the actual size of the >> buffer pointed to by "new_mc". >> >> Without this

Re: [PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data

2017-01-05 Thread Borislav Petkov
On Thu, Jan 05, 2017 at 04:45:18AM +, Junichi Nomura wrote: > On 01/05/17 10:02, Junichi Nomura wrote: > > In generic_load_microcode(), curr_mc_size is the size of the last > > allocated buffer and not always the size of the buffer pointed to by > > "new_mc". > ... > > @@ -864,6 +864,7 @@ stati

Re: [PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data

2017-01-04 Thread Junichi Nomura
On 01/05/17 10:02, Junichi Nomura wrote: > In generic_load_microcode(), curr_mc_size is the size of the last > allocated buffer and not always the size of the buffer pointed to by > "new_mc". ... > @@ -864,6 +864,7 @@ static enum ucode_state generic_load_microcode(int cpu, > void *data, size_t siz

[PATCH] x86/microcode/intel: Use correct buffer size for saving microcode data

2017-01-04 Thread Junichi Nomura
In generic_load_microcode(), curr_mc_size is the size of the last allocated buffer and not always the size of the buffer pointed to by "new_mc". Without this fix, we could get oops like this: BUG: unable to handle kernel paging request at c9000e30f000 IP: __memcpy+0x12/0x20 ... Call T