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>] [day] [month] [year] [list]
Message-ID: <14636369.9qhdcKOf8e@vostro.rjw.lan>
Date:	Tue, 30 Jul 2013 16:01:33 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	tianyu.lan@...el.com
Cc:	lenb@...nel.org, linux-acpi@...r.kernel.org,
	jan.christian.hoffmann@...il.com,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ACPI/Battery: Fix parsing _BIX return value

On Tuesday, July 30, 2013 09:54:58 AM tianyu.lan@...el.com wrote:
> From: Lan Tianyu <tianyu.lan@...el.com>
> 
> The _BIX method returns extended battery info as a package. According
> ACPI spec 10.2.2.2, the first member should be "Revision". However,
> current acpi battery driver treats the first member as "Power Unit"
> which should be the second member. So the parsing operation is mismatch.
> This patch is to fix it.
> 
> Reported-and-tested-by: Jan Hoffmann <jan.christian.hoffmann@...il.com>
> Reference: http://bugzilla.kernel.org/show_bug.cgi?id=60519
> CC: stable@...r.kernel.org  #v2.6.34+
> Signed-off-by: Lan Tianyu <tianyu.lan@...el.com>

Well, that's one of the most embarrassing bugs I've ever seen. :-)

Queued up as a fix for 3.11.

Thanks,
Rafael


> ---
>  drivers/acpi/battery.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index c760b61..2c9958c 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -117,6 +117,7 @@ struct acpi_battery {
>  	struct acpi_device *device;
>  	struct notifier_block pm_nb;
>  	unsigned long update_time;
> +	int revision;
>  	int rate_now;
>  	int capacity_now;
>  	int voltage_now;
> @@ -359,6 +360,7 @@ static struct acpi_offsets info_offsets[] = {
>  };
>  
>  static struct acpi_offsets extended_info_offsets[] = {
> +	{offsetof(struct acpi_battery, revision), 0},
>  	{offsetof(struct acpi_battery, power_unit), 0},
>  	{offsetof(struct acpi_battery, design_capacity), 0},
>  	{offsetof(struct acpi_battery, full_charge_capacity), 0},
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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