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: <1699654.r9C5QRPvQq@vostro.rjw.lan>
Date:	Thu, 12 Mar 2015 23:41:35 +0100
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	"Lee, Chun-Yi" <joeyli.kernel@...il.com>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Lee, Chun-Yi" <jlee@...e.com>, Len Brown <lenb@...nel.org>,
	Thomas Renninger <trenn@...e.de>, Nan Li <nli@...e.com>
Subject: Re: [PATCH] acpi: The count field of counter_show() function should be an unsigned value

On Wednesday, March 04, 2015 06:48:35 PM Lee, Chun-Yi wrote:
> From: Nan Li <nli@...e.com>
> 
> The count field is an unsigned 32bit value, and the
> counter_show() function should also treat it as a unsigned
> value.
> 
> Otherwise the counter may show negative number as we found on a
> machine:
> ...
> gpe23:        0   invalid
> gpe24: -2071733   enabled
> gpe25:        0   invalid
> ...
> gpe_all: -2070980
> sci: -2070949
> 
> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Len Brown <lenb@...nel.org>
> Cc: Thomas Renninger <trenn@...e.de>
> Signed-off-by: Nan Li <nli@...e.com>
> Signed-off-by: Lee, Chun-Yi <jlee@...e.com>

Queued up for 4.1, thanks!

> ---
>  drivers/acpi/sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
> index 13e577c..0876d77 100644
> --- a/drivers/acpi/sysfs.c
> +++ b/drivers/acpi/sysfs.c
> @@ -527,7 +527,7 @@ static ssize_t counter_show(struct kobject *kobj,
>  	    acpi_irq_not_handled;
>  	all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
>  	    acpi_gpe_count;
> -	size = sprintf(buf, "%8d", all_counters[index].count);
> +	size = sprintf(buf, "%8u", all_counters[index].count);
>  
>  	/* "gpe_all" or "sci" */
>  	if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
> 

-- 
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