* [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
@ 2014-04-18 1:53 Lv Zheng
2014-04-18 1:59 ` Zheng, Lv
2014-04-18 2:44 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Lv Zheng @ 2014-04-18 1:53 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown
Cc: Lv Zheng, Lv Zheng, linux-kernel, stable, linux-acpi, Zhao Yakui
Note that this patch is only used for stable kernels, upstream kernels
will have this problem fixed in ACPICA 201303-04 release. So upstream
kernels shouldn't merge this commit.
It is reported that there are buggy BIOSes in the world: AMI uses a XSDt
compiler for early BIOSes, this compiler will generate XSDT with a NULL
entry. The affected BIOS versions are "AMI BIOS F2-F4".
Original solution on Linux is to use an alternative heathy root table
instead of the ill one. This commit is refined by the following ACPICA
commit that tries to reduce the source code differences between Linux and
ACPICA upstream.
Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
Subject: ACPICA: Back port and refine validation of the XSDT root table.
But according to the bug report, the XSDT in fact is not broken, we should
just add NULL entry sanity check before installing a table address from
XSDT.
With the NULL entry sanity check implemented, the XSDT validation is
useless because:
1. If XSDT contains NULL entries, it can be bypassed by the new sanity
check mechanism;
2. If RSDP contains a bad XSDT address, invoking XSDT validation will still
lead to kernel crash.
This patch deletes XSDT validation logics and adds code to skip NULL
entries that can be found in RSDT or XSDT. Lv Zheng.
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
Buglink: https://bugs.archlinux.org/task/39811
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
---
drivers/acpi/acpica/tbutils.c | 116 ++++-------------------------------------
1 file changed, 11 insertions(+), 105 deletions(-)
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 6412d3c..aaea4e2 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -49,8 +49,6 @@
ACPI_MODULE_NAME("tbutils")
/* Local prototypes */
-static acpi_status acpi_tb_validate_xsdt(acpi_physical_address address);
-
static acpi_physical_address
acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
@@ -357,87 +355,6 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
/*******************************************************************************
*
- * FUNCTION: acpi_tb_validate_xsdt
- *
- * PARAMETERS: address - Physical address of the XSDT (from RSDP)
- *
- * RETURN: Status. AE_OK if the table appears to be valid.
- *
- * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
- * not contain any NULL entries. A problem that is seen in the
- * field is that the XSDT exists, but is actually useless because
- * of one or more (or all) NULL entries.
- *
- ******************************************************************************/
-
-static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
-{
- struct acpi_table_header *table;
- u8 *next_entry;
- acpi_physical_address address;
- u32 length;
- u32 entry_count;
- acpi_status status;
- u32 i;
-
- /* Get the XSDT length */
-
- table =
- acpi_os_map_memory(xsdt_address, sizeof(struct acpi_table_header));
- if (!table) {
- return (AE_NO_MEMORY);
- }
-
- length = table->length;
- acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
-
- /*
- * Minimum XSDT length is the size of the standard ACPI header
- * plus one physical address entry
- */
- if (length < (sizeof(struct acpi_table_header) + ACPI_XSDT_ENTRY_SIZE)) {
- return (AE_INVALID_TABLE_LENGTH);
- }
-
- /* Map the entire XSDT */
-
- table = acpi_os_map_memory(xsdt_address, length);
- if (!table) {
- return (AE_NO_MEMORY);
- }
-
- /* Get the number of entries and pointer to first entry */
-
- status = AE_OK;
- next_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header));
- entry_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
- ACPI_XSDT_ENTRY_SIZE);
-
- /* Validate each entry (physical address) within the XSDT */
-
- for (i = 0; i < entry_count; i++) {
- address =
- acpi_tb_get_root_table_entry(next_entry,
- ACPI_XSDT_ENTRY_SIZE);
- if (!address) {
-
- /* Detected a NULL entry, XSDT is invalid */
-
- status = AE_NULL_ENTRY;
- break;
- }
-
- next_entry += ACPI_XSDT_ENTRY_SIZE;
- }
-
- /* Unmap table */
-
- acpi_os_unmap_memory(table, length);
- return (status);
-}
-
-/*******************************************************************************
- *
* FUNCTION: acpi_tb_parse_root_table
*
* PARAMETERS: rsdp - Pointer to the RSDP
@@ -502,25 +419,6 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
*/
acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
- /*
- * If it is present and used, validate the XSDT for access/size
- * and ensure that all table entries are at least non-NULL
- */
- if (table_entry_size == ACPI_XSDT_ENTRY_SIZE) {
- status = acpi_tb_validate_xsdt(address);
- if (ACPI_FAILURE(status)) {
- ACPI_BIOS_WARNING((AE_INFO,
- "XSDT is invalid (%s), using RSDT",
- acpi_format_exception(status)));
-
- /* Fall back to the RSDT */
-
- address =
- (acpi_physical_address) rsdp->rsdt_physical_address;
- table_entry_size = ACPI_RSDT_ENTRY_SIZE;
- }
- }
-
/* Map the RSDT/XSDT table header to get the full table length */
table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
@@ -592,12 +490,20 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
+ address = acpi_tb_get_root_table_entry(table_entry, table_entry_size);
+
+ /* Skip NULL entry in RSDT/XSDT */
+
+ if (!address) {
+ goto next_table;
+ }
+
acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.
- current_table_count].address =
- acpi_tb_get_root_table_entry(table_entry, table_entry_size);
+ current_table_count].address = address;
+ acpi_gbl_root_table_list.current_table_count++;
+next_table:
table_entry += table_entry_size;
- acpi_gbl_root_table_list.current_table_count++;
}
/*
--
1.7.10
^ permalink raw reply related [flat|nested] 7+ messages in thread* RE: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 1:53 [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT Lv Zheng
@ 2014-04-18 1:59 ` Zheng, Lv
2014-04-18 2:44 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Zheng, Lv @ 2014-04-18 1:59 UTC (permalink / raw)
To: Wysocki, Rafael J, Brown, Len
Cc: Lv Zheng, linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-acpi@vger.kernel.org, Zhao, Yakui
Hi, Stable reviewers
This patch is not included in any upstream kernel, so it might not follow the stable rule.
If you think you need more information, please ignore this message.
This urgent fix is sent here for people who are monitoring stable and seeking for this fix.
Thanks and best regards
-Lv
> From: Zheng, Lv
> Sent: Friday, April 18, 2014 9:53 AM
>
> Note that this patch is only used for stable kernels, upstream kernels
> will have this problem fixed in ACPICA 201303-04 release. So upstream
> kernels shouldn't merge this commit.
>
> It is reported that there are buggy BIOSes in the world: AMI uses a XSDt
> compiler for early BIOSes, this compiler will generate XSDT with a NULL
> entry. The affected BIOS versions are "AMI BIOS F2-F4".
>
> Original solution on Linux is to use an alternative heathy root table
> instead of the ill one. This commit is refined by the following ACPICA
> commit that tries to reduce the source code differences between Linux and
> ACPICA upstream.
> Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
> Subject: ACPICA: Back port and refine validation of the XSDT root table.
> But according to the bug report, the XSDT in fact is not broken, we should
> just add NULL entry sanity check before installing a table address from
> XSDT.
>
> With the NULL entry sanity check implemented, the XSDT validation is
> useless because:
> 1. If XSDT contains NULL entries, it can be bypassed by the new sanity
> check mechanism;
> 2. If RSDP contains a bad XSDT address, invoking XSDT validation will still
> lead to kernel crash.
>
> This patch deletes XSDT validation logics and adds code to skip NULL
> entries that can be found in RSDT or XSDT. Lv Zheng.
>
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
> Buglink: https://bugs.archlinux.org/task/39811
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
> Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
> Cc: Zhao Yakui <yakui.zhao@intel.com>
> Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
> ---
> drivers/acpi/acpica/tbutils.c | 116 ++++-------------------------------------
> 1 file changed, 11 insertions(+), 105 deletions(-)
>
> diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
> index 6412d3c..aaea4e2 100644
> --- a/drivers/acpi/acpica/tbutils.c
> +++ b/drivers/acpi/acpica/tbutils.c
> @@ -49,8 +49,6 @@
> ACPI_MODULE_NAME("tbutils")
>
> /* Local prototypes */
> -static acpi_status acpi_tb_validate_xsdt(acpi_physical_address address);
> -
> static acpi_physical_address
> acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
>
> @@ -357,87 +355,6 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
>
> /*******************************************************************************
> *
> - * FUNCTION: acpi_tb_validate_xsdt
> - *
> - * PARAMETERS: address - Physical address of the XSDT (from RSDP)
> - *
> - * RETURN: Status. AE_OK if the table appears to be valid.
> - *
> - * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
> - * not contain any NULL entries. A problem that is seen in the
> - * field is that the XSDT exists, but is actually useless because
> - * of one or more (or all) NULL entries.
> - *
> - ******************************************************************************/
> -
> -static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
> -{
> - struct acpi_table_header *table;
> - u8 *next_entry;
> - acpi_physical_address address;
> - u32 length;
> - u32 entry_count;
> - acpi_status status;
> - u32 i;
> -
> - /* Get the XSDT length */
> -
> - table =
> - acpi_os_map_memory(xsdt_address, sizeof(struct acpi_table_header));
> - if (!table) {
> - return (AE_NO_MEMORY);
> - }
> -
> - length = table->length;
> - acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
> -
> - /*
> - * Minimum XSDT length is the size of the standard ACPI header
> - * plus one physical address entry
> - */
> - if (length < (sizeof(struct acpi_table_header) + ACPI_XSDT_ENTRY_SIZE)) {
> - return (AE_INVALID_TABLE_LENGTH);
> - }
> -
> - /* Map the entire XSDT */
> -
> - table = acpi_os_map_memory(xsdt_address, length);
> - if (!table) {
> - return (AE_NO_MEMORY);
> - }
> -
> - /* Get the number of entries and pointer to first entry */
> -
> - status = AE_OK;
> - next_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header));
> - entry_count = (u32)((table->length - sizeof(struct acpi_table_header)) /
> - ACPI_XSDT_ENTRY_SIZE);
> -
> - /* Validate each entry (physical address) within the XSDT */
> -
> - for (i = 0; i < entry_count; i++) {
> - address =
> - acpi_tb_get_root_table_entry(next_entry,
> - ACPI_XSDT_ENTRY_SIZE);
> - if (!address) {
> -
> - /* Detected a NULL entry, XSDT is invalid */
> -
> - status = AE_NULL_ENTRY;
> - break;
> - }
> -
> - next_entry += ACPI_XSDT_ENTRY_SIZE;
> - }
> -
> - /* Unmap table */
> -
> - acpi_os_unmap_memory(table, length);
> - return (status);
> -}
> -
> -/*******************************************************************************
> - *
> * FUNCTION: acpi_tb_parse_root_table
> *
> * PARAMETERS: rsdp - Pointer to the RSDP
> @@ -502,25 +419,6 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
> */
> acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp));
>
> - /*
> - * If it is present and used, validate the XSDT for access/size
> - * and ensure that all table entries are at least non-NULL
> - */
> - if (table_entry_size == ACPI_XSDT_ENTRY_SIZE) {
> - status = acpi_tb_validate_xsdt(address);
> - if (ACPI_FAILURE(status)) {
> - ACPI_BIOS_WARNING((AE_INFO,
> - "XSDT is invalid (%s), using RSDT",
> - acpi_format_exception(status)));
> -
> - /* Fall back to the RSDT */
> -
> - address =
> - (acpi_physical_address) rsdp->rsdt_physical_address;
> - table_entry_size = ACPI_RSDT_ENTRY_SIZE;
> - }
> - }
> -
> /* Map the RSDT/XSDT table header to get the full table length */
>
> table = acpi_os_map_memory(address, sizeof(struct acpi_table_header));
> @@ -592,12 +490,20 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
>
> /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
>
> + address = acpi_tb_get_root_table_entry(table_entry, table_entry_size);
> +
> + /* Skip NULL entry in RSDT/XSDT */
> +
> + if (!address) {
> + goto next_table;
> + }
> +
> acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.
> - current_table_count].address =
> - acpi_tb_get_root_table_entry(table_entry, table_entry_size);
> + current_table_count].address = address;
> + acpi_gbl_root_table_list.current_table_count++;
>
> +next_table:
> table_entry += table_entry_size;
> - acpi_gbl_root_table_list.current_table_count++;
> }
>
> /*
> --
> 1.7.10
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 1:53 [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT Lv Zheng
2014-04-18 1:59 ` Zheng, Lv
@ 2014-04-18 2:44 ` Greg KH
2014-04-18 3:00 ` Zheng, Lv
2014-04-18 3:13 ` Zheng, Lv
1 sibling, 2 replies; 7+ messages in thread
From: Greg KH @ 2014-04-18 2:44 UTC (permalink / raw)
To: Lv Zheng
Cc: Rafael J. Wysocki, Len Brown, Lv Zheng, linux-kernel, stable,
linux-acpi, Zhao Yakui
On Fri, Apr 18, 2014 at 09:53:19AM +0800, Lv Zheng wrote:
> Note that this patch is only used for stable kernels, upstream kernels
> will have this problem fixed in ACPICA 201303-04 release. So upstream
> kernels shouldn't merge this commit.
What kernel commit fixed this issue in "upstream"?
> It is reported that there are buggy BIOSes in the world: AMI uses a XSDt
> compiler for early BIOSes, this compiler will generate XSDT with a NULL
> entry. The affected BIOS versions are "AMI BIOS F2-F4".
>
> Original solution on Linux is to use an alternative heathy root table
> instead of the ill one. This commit is refined by the following ACPICA
> commit that tries to reduce the source code differences between Linux and
> ACPICA upstream.
> Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
> Subject: ACPICA: Back port and refine validation of the XSDT root table.
> But according to the bug report, the XSDT in fact is not broken, we should
> just add NULL entry sanity check before installing a table address from
> XSDT.
>
> With the NULL entry sanity check implemented, the XSDT validation is
> useless because:
> 1. If XSDT contains NULL entries, it can be bypassed by the new sanity
> check mechanism;
> 2. If RSDP contains a bad XSDT address, invoking XSDT validation will still
> lead to kernel crash.
>
> This patch deletes XSDT validation logics and adds code to skip NULL
> entries that can be found in RSDT or XSDT. Lv Zheng.
>
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
> Buglink: https://bugs.archlinux.org/task/39811
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
> Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
> Cc: Zhao Yakui <yakui.zhao@intel.com>
> Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
So this fix is only needed for 3.14? Or older? I'm confused here...
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 2:44 ` Greg KH
@ 2014-04-18 3:00 ` Zheng, Lv
2014-04-18 3:39 ` Greg KH
2014-04-18 3:13 ` Zheng, Lv
1 sibling, 1 reply; 7+ messages in thread
From: Zheng, Lv @ 2014-04-18 3:00 UTC (permalink / raw)
To: Greg KH
Cc: Wysocki, Rafael J, Brown, Len, Lv Zheng,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-acpi@vger.kernel.org, Zhao, Yakui
Hi, Greg
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Friday, April 18, 2014 10:44 AM
>
> On Fri, Apr 18, 2014 at 09:53:19AM +0800, Lv Zheng wrote:
> > Note that this patch is only used for stable kernels, upstream kernels
> > will have this problem fixed in ACPICA 201303-04 release. So upstream
> > kernels shouldn't merge this commit.
>
> What kernel commit fixed this issue in "upstream"?
There is no kernel commit now has fixed this issue in "upstream".
The fix commit need to go into ACPICA first, so I believe it will appear in 3.15-rc2 (ACPICA 201403xx release) or 3.15-rc3 (ACPICA 201404xx release).
The back port of the fix commit will have many dependencies as we have a big change in ACPICA table manager in ACPICA 201403xx release.
However this back port is very light and has been confirmed by the reporters.
The bug seems to be urgent, it has broken many platforms shipped with AMI BIOSes versioning from F2 to F4.
Someone may monitor here to find a valid fix.
Best regards
-Lv
>
> > It is reported that there are buggy BIOSes in the world: AMI uses a XSDt
> > compiler for early BIOSes, this compiler will generate XSDT with a NULL
> > entry. The affected BIOS versions are "AMI BIOS F2-F4".
> >
> > Original solution on Linux is to use an alternative heathy root table
> > instead of the ill one. This commit is refined by the following ACPICA
> > commit that tries to reduce the source code differences between Linux and
> > ACPICA upstream.
> > Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
> > Subject: ACPICA: Back port and refine validation of the XSDT root table.
> > But according to the bug report, the XSDT in fact is not broken, we should
> > just add NULL entry sanity check before installing a table address from
> > XSDT.
> >
> > With the NULL entry sanity check implemented, the XSDT validation is
> > useless because:
> > 1. If XSDT contains NULL entries, it can be bypassed by the new sanity
> > check mechanism;
> > 2. If RSDP contains a bad XSDT address, invoking XSDT validation will still
> > lead to kernel crash.
> >
> > This patch deletes XSDT validation logics and adds code to skip NULL
> > entries that can be found in RSDT or XSDT. Lv Zheng.
> >
> > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
> > Buglink: https://bugs.archlinux.org/task/39811
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
> > Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
> > Cc: Zhao Yakui <yakui.zhao@intel.com>
> > Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
>
> So this fix is only needed for 3.14? Or older? I'm confused here...
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 3:00 ` Zheng, Lv
@ 2014-04-18 3:39 ` Greg KH
2014-04-18 6:36 ` Zheng, Lv
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2014-04-18 3:39 UTC (permalink / raw)
To: Zheng, Lv
Cc: Wysocki, Rafael J, Brown, Len, Lv Zheng,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-acpi@vger.kernel.org, Zhao, Yakui
On Fri, Apr 18, 2014 at 03:00:21AM +0000, Zheng, Lv wrote:
> Hi, Greg
>
> > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > Sent: Friday, April 18, 2014 10:44 AM
> >
> > On Fri, Apr 18, 2014 at 09:53:19AM +0800, Lv Zheng wrote:
> > > Note that this patch is only used for stable kernels, upstream kernels
> > > will have this problem fixed in ACPICA 201303-04 release. So upstream
> > > kernels shouldn't merge this commit.
> >
> > What kernel commit fixed this issue in "upstream"?
>
> There is no kernel commit now has fixed this issue in "upstream".
> The fix commit need to go into ACPICA first, so I believe it will
> appear in 3.15-rc2 (ACPICA 201403xx release) or 3.15-rc3 (ACPICA
> 201404xx release).
Then I can't take this patch at all in any stable tree. Please read
Documentation/stable_kernel_rules.txt for why and how to properly do
this.
Just mark the commit that fixes the issue in Linus's tree for stable,
and it will happen automatically.
> The back port of the fix commit will have many dependencies as we have
> a big change in ACPICA table manager in ACPICA 201403xx release.
Why not just submit this fix first to Linus, for his tree now, and then
do the larger changes later?
> However this back port is very light and has been confirmed by the reporters.
>
> The bug seems to be urgent, it has broken many platforms shipped with
> AMI BIOSes versioning from F2 to F4. Someone may monitor here to find
> a valid fix.
Not any stable maintainers, we can't take patches that aren't in Linus's
tree, sorry.
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 3:39 ` Greg KH
@ 2014-04-18 6:36 ` Zheng, Lv
0 siblings, 0 replies; 7+ messages in thread
From: Zheng, Lv @ 2014-04-18 6:36 UTC (permalink / raw)
To: Greg KH
Cc: Wysocki, Rafael J, Brown, Len, Lv Zheng,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-acpi@vger.kernel.org, Zhao, Yakui
Hi,
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Friday, April 18, 2014 11:40 AM
>
> On Fri, Apr 18, 2014 at 03:00:21AM +0000, Zheng, Lv wrote:
> > Hi, Greg
> >
> > > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > > Sent: Friday, April 18, 2014 10:44 AM
> > >
> > > On Fri, Apr 18, 2014 at 09:53:19AM +0800, Lv Zheng wrote:
> > > > Note that this patch is only used for stable kernels, upstream kernels
> > > > will have this problem fixed in ACPICA 201303-04 release. So upstream
> > > > kernels shouldn't merge this commit.
> > >
> > > What kernel commit fixed this issue in "upstream"?
> >
> > There is no kernel commit now has fixed this issue in "upstream".
> > The fix commit need to go into ACPICA first, so I believe it will
> > appear in 3.15-rc2 (ACPICA 201403xx release) or 3.15-rc3 (ACPICA
> > 201404xx release).
>
> Then I can't take this patch at all in any stable tree. Please read
> Documentation/stable_kernel_rules.txt for why and how to properly do
> this.
>
> Just mark the commit that fixes the issue in Linus's tree for stable,
> and it will happen automatically.
>
OK.
> > The back port of the fix commit will have many dependencies as we have
> > a big change in ACPICA table manager in ACPICA 201403xx release.
>
> Why not just submit this fix first to Linus, for his tree now, and then
> do the larger changes later?
>
OK. It seems possible now.
> > However this back port is very light and has been confirmed by the reporters.
> >
> > The bug seems to be urgent, it has broken many platforms shipped with
> > AMI BIOSes versioning from F2 to F4. Someone may monitor here to find
> > a valid fix.
>
> Not any stable maintainers, we can't take patches that aren't in Linus's
> tree, sorry.
>
OK.
I was just a little worried about as I'm the culprit.
Sorry for the noise.
Thanks and best regards
-Lv
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT.
2014-04-18 2:44 ` Greg KH
2014-04-18 3:00 ` Zheng, Lv
@ 2014-04-18 3:13 ` Zheng, Lv
1 sibling, 0 replies; 7+ messages in thread
From: Zheng, Lv @ 2014-04-18 3:13 UTC (permalink / raw)
To: Greg KH
Cc: Wysocki, Rafael J, Brown, Len, Lv Zheng,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-acpi@vger.kernel.org, Zhao, Yakui
Hi,
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Friday, April 18, 2014 10:44 AM
>
> On Fri, Apr 18, 2014 at 09:53:19AM +0800, Lv Zheng wrote:
> > Note that this patch is only used for stable kernels, upstream kernels
> > will have this problem fixed in ACPICA 201303-04 release. So upstream
> > kernels shouldn't merge this commit.
>
> What kernel commit fixed this issue in "upstream"?
>
> > It is reported that there are buggy BIOSes in the world: AMI uses a XSDt
> > compiler for early BIOSes, this compiler will generate XSDT with a NULL
> > entry. The affected BIOS versions are "AMI BIOS F2-F4".
> >
> > Original solution on Linux is to use an alternative heathy root table
> > instead of the ill one. This commit is refined by the following ACPICA
> > commit that tries to reduce the source code differences between Linux and
> > ACPICA upstream.
> > Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
> > Subject: ACPICA: Back port and refine validation of the XSDT root table.
> > But according to the bug report, the XSDT in fact is not broken, we should
> > just add NULL entry sanity check before installing a table address from
> > XSDT.
> >
> > With the NULL entry sanity check implemented, the XSDT validation is
> > useless because:
> > 1. If XSDT contains NULL entries, it can be bypassed by the new sanity
> > check mechanism;
> > 2. If RSDP contains a bad XSDT address, invoking XSDT validation will still
> > lead to kernel crash.
> >
> > This patch deletes XSDT validation logics and adds code to skip NULL
> > entries that can be found in RSDT or XSDT. Lv Zheng.
> >
> > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
> > Buglink: https://bugs.archlinux.org/task/39811
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
> > Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
> > Cc: Zhao Yakui <yakui.zhao@intel.com>
> > Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
>
> So this fix is only needed for 3.14? Or older? I'm confused here...
Only 3.14.1 - 3.15.1 kernels are affected. Others are fine.
Possibly this urgent commit is useful for the users currently running 3.14 on such broken platforms.
I haven't obtained Rafael's ACKs on this. We may discuss it in next week.
Thanks and best regards
-Lv
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-04-18 6:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-18 1:53 [PATCH] ACPICA: Tables: Skip NULL entries in RSDT and XSDT Lv Zheng
2014-04-18 1:59 ` Zheng, Lv
2014-04-18 2:44 ` Greg KH
2014-04-18 3:00 ` Zheng, Lv
2014-04-18 3:39 ` Greg KH
2014-04-18 6:36 ` Zheng, Lv
2014-04-18 3:13 ` Zheng, Lv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox