diff options
author | Lin Ming <ming.m.lin@intel.com> | 2008-04-10 11:06:42 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 14:29:29 -0400 |
commit | 47c08729bf1c60d522d020a7f8bc15d1c70e6ecb (patch) | |
tree | 72ce86bc8ee6a9cbd9286f71b2f813c4262ff58e /drivers/acpi | |
parent | 200cce6a75061a3bf8d2e6b27c5cdcc7730893f1 (diff) |
ACPICA: Fix for LoadTable operator, input strings
Fixed a problem with the LoadTable operator where the OemId
and OemTableId input strings could cause unexpected failures if
they were shorter than the maximum lengths allowed.
http://www.acpica.org/bugzilla/show_bug.cgi?id=576
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/executer/exconfig.c | 5 | ||||
-rw-r--r-- | drivers/acpi/tables/tbfind.c | 32 |
2 files changed, 24 insertions, 13 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 52b1e95837fa..ed92fb5a1d2b 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -236,7 +236,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
236 | status = acpi_get_table_by_index(table_index, &table); | 236 | status = acpi_get_table_by_index(table_index, &table); |
237 | if (ACPI_SUCCESS(status)) { | 237 | if (ACPI_SUCCESS(status)) { |
238 | ACPI_INFO((AE_INFO, | 238 | ACPI_INFO((AE_INFO, |
239 | "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]", | 239 | "Dynamic OEM Table Load - [%.4s] OemId [%.6s] OemTableId [%.8s]", |
240 | table->signature, table->oem_id, | 240 | table->signature, table->oem_id, |
241 | table->oem_table_id)); | 241 | table->oem_table_id)); |
242 | } | 242 | } |
@@ -472,8 +472,5 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) | |||
472 | 472 | ||
473 | acpi_tb_set_table_loaded_flag(table_index, FALSE); | 473 | acpi_tb_set_table_loaded_flag(table_index, FALSE); |
474 | 474 | ||
475 | /* Delete the table descriptor (ddb_handle) */ | ||
476 | |||
477 | acpi_ut_remove_reference(table_desc); | ||
478 | return_ACPI_STATUS(AE_OK); | 475 | return_ACPI_STATUS(AE_OK); |
479 | } | 476 | } |
diff --git a/drivers/acpi/tables/tbfind.c b/drivers/acpi/tables/tbfind.c index 058c064948e1..772ca41d840b 100644 --- a/drivers/acpi/tables/tbfind.c +++ b/drivers/acpi/tables/tbfind.c | |||
@@ -70,12 +70,22 @@ acpi_tb_find_table(char *signature, | |||
70 | { | 70 | { |
71 | acpi_native_uint i; | 71 | acpi_native_uint i; |
72 | acpi_status status; | 72 | acpi_status status; |
73 | struct acpi_table_header header; | ||
73 | 74 | ||
74 | ACPI_FUNCTION_TRACE(tb_find_table); | 75 | ACPI_FUNCTION_TRACE(tb_find_table); |
75 | 76 | ||
77 | /* Normalize the input strings */ | ||
78 | |||
79 | ACPI_MEMSET(&header, 0, sizeof(struct acpi_table_header)); | ||
80 | ACPI_STRNCPY(header.signature, signature, ACPI_NAME_SIZE); | ||
81 | ACPI_STRNCPY(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); | ||
82 | ACPI_STRNCPY(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); | ||
83 | |||
84 | /* Search for the table */ | ||
85 | |||
76 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 86 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { |
77 | if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature), | 87 | if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature), |
78 | signature, ACPI_NAME_SIZE)) { | 88 | header.signature, ACPI_NAME_SIZE)) { |
79 | 89 | ||
80 | /* Not the requested table */ | 90 | /* Not the requested table */ |
81 | 91 | ||
@@ -104,20 +114,24 @@ acpi_tb_find_table(char *signature, | |||
104 | 114 | ||
105 | if (!ACPI_MEMCMP | 115 | if (!ACPI_MEMCMP |
106 | (acpi_gbl_root_table_list.tables[i].pointer->signature, | 116 | (acpi_gbl_root_table_list.tables[i].pointer->signature, |
107 | signature, ACPI_NAME_SIZE) && (!oem_id[0] | 117 | header.signature, ACPI_NAME_SIZE) && (!oem_id[0] |
108 | || | 118 | || |
109 | !ACPI_MEMCMP | 119 | !ACPI_MEMCMP |
110 | (acpi_gbl_root_table_list. | 120 | (acpi_gbl_root_table_list. |
111 | tables[i].pointer->oem_id, | 121 | tables[i].pointer-> |
112 | oem_id, ACPI_OEM_ID_SIZE)) | 122 | oem_id, |
123 | header.oem_id, | ||
124 | ACPI_OEM_ID_SIZE)) | ||
113 | && (!oem_table_id[0] | 125 | && (!oem_table_id[0] |
114 | || !ACPI_MEMCMP(acpi_gbl_root_table_list.tables[i]. | 126 | || !ACPI_MEMCMP(acpi_gbl_root_table_list.tables[i]. |
115 | pointer->oem_table_id, oem_table_id, | 127 | pointer->oem_table_id, |
128 | header.oem_table_id, | ||
116 | ACPI_OEM_TABLE_ID_SIZE))) { | 129 | ACPI_OEM_TABLE_ID_SIZE))) { |
117 | *table_index = i; | 130 | *table_index = i; |
118 | 131 | ||
119 | ACPI_DEBUG_PRINT((ACPI_DB_TABLES, | 132 | ACPI_DEBUG_PRINT((ACPI_DB_TABLES, |
120 | "Found table [%4.4s]\n", signature)); | 133 | "Found table [%4.4s]\n", |
134 | header.signature)); | ||
121 | return_ACPI_STATUS(AE_OK); | 135 | return_ACPI_STATUS(AE_OK); |
122 | } | 136 | } |
123 | } | 137 | } |