提交 d496a002 编写于 作者: Q Quentin Casasnovas 提交者: Borislav Petkov

x86/microcode/intel: Fix out of bounds memory access to the extended header

Improper pointer arithmetics when calculating the address of the
extended header could lead to an out of bounds memory read and kernel
panic.
Signed-off-by: NQuentin Casasnovas <quentin.casasnovas@oracle.com>
Link: http://lkml.kernel.org/r/20150225094125.GB30434@chrystal.uk.oracle.comSigned-off-by: NBorislav Petkov <bp@suse.de>
上级 c517d838
...@@ -180,8 +180,7 @@ matching_model_microcode(struct microcode_header_intel *mc_header, ...@@ -180,8 +180,7 @@ matching_model_microcode(struct microcode_header_intel *mc_header,
if (total_size <= data_size + MC_HEADER_SIZE) if (total_size <= data_size + MC_HEADER_SIZE)
return UCODE_NFOUND; return UCODE_NFOUND;
ext_header = (struct extended_sigtable *) ext_header = (void *) mc_header + data_size + MC_HEADER_SIZE;
mc_header + data_size + MC_HEADER_SIZE;
ext_sigcount = ext_header->count; ext_sigcount = ext_header->count;
ext_sig = (void *)ext_header + EXT_HEADER_SIZE; ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
...@@ -457,8 +456,7 @@ static void __ref show_saved_mc(void) ...@@ -457,8 +456,7 @@ static void __ref show_saved_mc(void)
if (total_size <= data_size + MC_HEADER_SIZE) if (total_size <= data_size + MC_HEADER_SIZE)
continue; continue;
ext_header = (struct extended_sigtable *) ext_header = (void *) mc_saved_header + data_size + MC_HEADER_SIZE;
mc_saved_header + data_size + MC_HEADER_SIZE;
ext_sigcount = ext_header->count; ext_sigcount = ext_header->count;
ext_sig = (void *)ext_header + EXT_HEADER_SIZE; ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册