lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEe-dwhQXaMLH3FomhhD+iyqVOOKJA7ccSzmar9XRXS971JdeQ@mail.gmail.com>
Date:	Fri, 4 May 2012 18:21:43 +0200
From:	Marco Aurelio da Costa <costa@...ic.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Len Brown <lenb@...nel.org>
Subject: Re: [RFC][PATCH v2] ACPI: Ignore invalid _PSS entries, but use valid ones

On Fri, May 4, 2012 at 6:11 PM, Konrad Rzeszutek Wilk
<konrad.wilk@...cle.com> wrote:
> On Fri, May 04, 2012 at 05:25:13PM +0200, Marco Aurelio da Costa wrote:
>> From: Marco Aurelio da Costa <costa@...ic.com>
>> [v2: Fixes suggested by Konrad]
>> Signed-off-by: Marco Aurelio da Costa <costa@...ic.com>
>
> Heh. You didn't compile test this version did you?

>>
>> The EliteBook 8560W has non-initialized entries in its _PSS ACPI
>> table. Instead of bailing out when the first non-initialized entry is
>> found, ignore it and use only  the valid entries. Only bail out if there
>> is no valid entry at all.
>>
>> ---
>> --- linux-3.3.3/drivers/acpi/processor_perflib.c.orig 2012-04-24
>> 22:18:23.288041268 +0200
>> +++ linux-3.3.3/drivers/acpi/processor_perflib.c      2012-05-04
>> 17:22:57.400034613 +0200
>> @@ -311,6 +311,7 @@ static int acpi_processor_get_performanc
>>       struct acpi_buffer state = { 0, NULL };
>>       union acpi_object *pss = NULL;
>>       int i;
>> +     int last_invalid = -1;
>>
>>
>>       status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
>> @@ -372,14 +373,32 @@ static int acpi_processor_get_performanc
>>                   ((u32)(px->core_frequency * 1000) !=
>>                    (px->core_frequency * 1000))) {
>>                       printk(KERN_ERR FW_BUG PREFIX
>> -                            "Invalid BIOS _PSS frequency: 0x%llx MHz\n",
>> -                            px->core_frequency);
>> -                     result = -EFAULT;
>> -                     kfree(pr->performance->states);
>> -                     goto end;
>> +                            "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
>> +                            pr->id, px->core_frequency);
>> +                     if (last_invalidi == -1)
>
> Hrmm. invalidi?

Sorry, vi...

>
>> +                             last_invalid = i;
>> +             } else {
>> +                     if (last_invalid != -1) {
>> +                             /*
>> +                              * Copy this valid entry over last_invalid entry
>> +                              */
>> +                             memcpy(&(pr->performance->states[last_invalid]),
>> +                                    px, sizeof(struct acpi_processor_px));
>> +                             ++last_invalid;
>> +                     }
>>               }
>>       }
>>
>> +     if (last_invalid == 0) {
>> +             printk(KERN_ERR FW_BUG PREFIX
>> +                    "No valid BIOS _PSS frequency found for processor %d\n", pr->id);
>> +             result = -EFAULT;
>> +             kfree(pr->performance->states);
>
> Just as a precaution - also do this pls:
>
> pr->performance->states = NULL?

It wasn't on the original code, but I agree with you.

Doing and compiling, this time... :)

>
>> +     }
>> +
>> +     if (last_invalid > 0)
>> +             pr->performance->state_count = last_invalid;
>> +
>>        end:
>>       kfree(buffer.pointer);
>>
>> --
>> Marco Costa
>> Customer Support
>> --
>> GAMIC mbH
>> Roermonder Strasse, 151
>> 52072 Aachen
>> Germany
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Marco Costa
Customer Support
--
GAMIC mbH
Roermonder Strasse, 151
52072 Aachen
Germany
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ