2008-08-01 10:49:50

by Peter Oruba

[permalink] [raw]
Subject: [patch 2/2] [PATCH 2/2] x86: Fixed NULL function pointer dereference in AMD microcode patch loader.

Dereference took place in code part responsible for manual installation
of microcode patches through /dev/cpu/microcode.

Signed-off-by: Peter Oruba <[email protected]>
---
arch/x86/kernel/microcode.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 39961bb..ad136ad 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -127,7 +127,8 @@ static int do_microcode_update(void)
old = current->cpus_allowed;

while ((cursor = microcode_ops->get_next_ucode(&new_mc, cursor)) > 0) {
- error = microcode_ops->microcode_sanity_check(new_mc);
+ if (microcode_ops->microcode_sanity_check != NULL)
+ error = microcode_ops->microcode_sanity_check(new_mc);
if (error)
goto out;
/*
--
1.5.4.5




2008-08-14 02:13:41

by Andrew Morton

[permalink] [raw]
Subject: Re: [patch 2/2] [PATCH 2/2] x86: Fixed NULL function pointer dereference in AMD microcode patch loader.

On Fri, 1 Aug 2008 12:46:46 +0200 Peter Oruba <[email protected]> wrote:

> Dereference took place in code part responsible for manual installation
> of microcode patches through /dev/cpu/microcode.
>

That's a bit too terse.

> ---
> arch/x86/kernel/microcode.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
> index 39961bb..ad136ad 100644
> --- a/arch/x86/kernel/microcode.c
> +++ b/arch/x86/kernel/microcode.c
> @@ -127,7 +127,8 @@ static int do_microcode_update(void)
> old = current->cpus_allowed;
>
> while ((cursor = microcode_ops->get_next_ucode(&new_mc, cursor)) > 0) {
> - error = microcode_ops->microcode_sanity_check(new_mc);
> + if (microcode_ops->microcode_sanity_check != NULL)
> + error = microcode_ops->microcode_sanity_check(new_mc);
> if (error)
> goto out;
> /*

The patch is no longer applicable to current sources.

If the bug is sufficiently serious to warrant fixing in 2.6.25.x and in
2.6.26.x then please prepare patches against those kernels, including
sufficient description to enable the -stable maintainers to understand
why they need to merge it. Cc those patches to [email protected].

Thanks.

2008-08-14 11:56:21

by Peter Oruba

[permalink] [raw]
Subject: Re: [patch 2/2] [PATCH 2/2] x86: Fixed NULL function pointer dereference in AMD microcode patch loader.

Andrew,

that patch is only relevant in combination with the AMD microcode patch loader.

Thanks,
Peter

Andrew Morton schrieb:
> On Fri, 1 Aug 2008 12:46:46 +0200 Peter Oruba <[email protected]> wrote:
>
>> Dereference took place in code part responsible for manual installation
>> of microcode patches through /dev/cpu/microcode.
>>
>
> That's a bit too terse.
>
>> ---
>> arch/x86/kernel/microcode.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
>> index 39961bb..ad136ad 100644
>> --- a/arch/x86/kernel/microcode.c
>> +++ b/arch/x86/kernel/microcode.c
>> @@ -127,7 +127,8 @@ static int do_microcode_update(void)
>> old = current->cpus_allowed;
>>
>> while ((cursor = microcode_ops->get_next_ucode(&new_mc, cursor)) > 0) {
>> - error = microcode_ops->microcode_sanity_check(new_mc);
>> + if (microcode_ops->microcode_sanity_check != NULL)
>> + error = microcode_ops->microcode_sanity_check(new_mc);
>> if (error)
>> goto out;
>> /*
>
> The patch is no longer applicable to current sources.
>
> If the bug is sufficiently serious to warrant fixing in 2.6.25.x and in
> 2.6.26.x then please prepare patches against those kernels, including
> sufficient description to enable the -stable maintainers to understand
> why they need to merge it. Cc those patches to [email protected].
>
> Thanks.
>
>
>

--
| AMD Saxony Limited Liability Company & Co. KG
Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany
System | Register Court Dresden: HRA 4896
Research | General Partner authorized to represent:
Center | AMD Saxony LLC (Wilmington, Delaware, US)
| General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy