* [PATCH] ACPI/APEI: fix error status check condition for CPER
@ 2013-03-19 6:48 Chen Gong
2013-03-20 1:36 ` Huang Ying
0 siblings, 1 reply; 3+ messages in thread
From: Chen Gong @ 2013-03-19 6:48 UTC (permalink / raw)
To: ying.huang; +Cc: tony.luck, linux-acpi, rjw, Chen Gong
In Table 18-289, ACPI5.0 SPEC, the error data length in CPER
Generic Error Data Entry can be 0, which means this generic
error data entry can have only one header. So fix the check
conditon for it.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
drivers/acpi/apei/cper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index 1e5d8a4..fefc2ca 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
return rc;
data_len = estatus->data_length;
gdata = (struct acpi_hest_generic_data *)(estatus + 1);
- while (data_len > sizeof(*gdata)) {
+ while (data_len >= sizeof(*gdata)) {
gedata_len = gdata->error_data_length;
if (gedata_len > data_len - sizeof(*gdata))
return -EINVAL;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/APEI: fix error status check condition for CPER
2013-03-19 6:48 [PATCH] ACPI/APEI: fix error status check condition for CPER Chen Gong
@ 2013-03-20 1:36 ` Huang Ying
2013-03-26 13:35 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Huang Ying @ 2013-03-20 1:36 UTC (permalink / raw)
To: Chen Gong; +Cc: tony.luck, linux-acpi, rjw
On Tue, 2013-03-19 at 02:48 -0400, Chen Gong wrote:
> In Table 18-289, ACPI5.0 SPEC, the error data length in CPER
> Generic Error Data Entry can be 0, which means this generic
> error data entry can have only one header. So fix the check
> conditon for it.
>
> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Good catch!
Reviewed-by: Huang Ying <ying.huang@intel.com>
> ---
> drivers/acpi/apei/cper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
> index 1e5d8a4..fefc2ca 100644
> --- a/drivers/acpi/apei/cper.c
> +++ b/drivers/acpi/apei/cper.c
> @@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
> return rc;
> data_len = estatus->data_length;
> gdata = (struct acpi_hest_generic_data *)(estatus + 1);
> - while (data_len > sizeof(*gdata)) {
> + while (data_len >= sizeof(*gdata)) {
> gedata_len = gdata->error_data_length;
> if (gedata_len > data_len - sizeof(*gdata))
> return -EINVAL;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/APEI: fix error status check condition for CPER
2013-03-20 1:36 ` Huang Ying
@ 2013-03-26 13:35 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2013-03-26 13:35 UTC (permalink / raw)
To: Huang Ying; +Cc: Chen Gong, tony.luck, linux-acpi
On Wednesday, March 20, 2013 09:36:56 AM Huang Ying wrote:
> On Tue, 2013-03-19 at 02:48 -0400, Chen Gong wrote:
> > In Table 18-289, ACPI5.0 SPEC, the error data length in CPER
> > Generic Error Data Entry can be 0, which means this generic
> > error data entry can have only one header. So fix the check
> > conditon for it.
> >
> > Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
>
> Good catch!
>
> Reviewed-by: Huang Ying <ying.huang@intel.com>
Applied. I'm going to push it for 3.9.
Thanks,
Rafael
> > ---
> > drivers/acpi/apei/cper.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
> > index 1e5d8a4..fefc2ca 100644
> > --- a/drivers/acpi/apei/cper.c
> > +++ b/drivers/acpi/apei/cper.c
> > @@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
> > return rc;
> > data_len = estatus->data_length;
> > gdata = (struct acpi_hest_generic_data *)(estatus + 1);
> > - while (data_len > sizeof(*gdata)) {
> > + while (data_len >= sizeof(*gdata)) {
> > gedata_len = gdata->error_data_length;
> > if (gedata_len > data_len - sizeof(*gdata))
> > return -EINVAL;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-26 13:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 6:48 [PATCH] ACPI/APEI: fix error status check condition for CPER Chen Gong
2013-03-20 1:36 ` Huang Ying
2013-03-26 13:35 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox