Hi all,
On 25/06/12 09:23AM, Jiri Slaby wrote:
On 12. 06. 25, 7:31, Collin Funk wrote:
Hi Greg,
Sorry for the exta mail. Accidently put CC emails in the subject...
--- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c @@ -103,7 +103,7 @@ int ap_open_output_file(char *pathname) int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) {
- char filename[ACPI_NAMESEG_SIZE + 16];
- char filename[ACPI_NAMESEG_SIZE + 16] ACPI_NONSTRING; char instance_str[16]; ACPI_FILE file; acpi_size actual;
This one seems incorrect, as I was alerted to by the following warning:
apfiles.c: In function ‘ap_write_to_binary_file’: apfiles.c:137:9: warning: ‘__builtin_strlen’ argument 1 declared attribute ‘nonstring’ [-Wstringop-overread] 137 | strcat(filename, FILE_SUFFIX_BINARY_TABLE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ apfiles.c:106:14: note: argument ‘filename’ declared here 106 | char filename[ACPI_NAMESEG_SIZE + 16] ACPI_NONSTRING; | ^~~~~~~~
Thank you so much, Collin, for shedding light on this issue!
This is now reverted in upstream ACPICA commit a6ee09c ("acpidump: drop ACPI_NONSTRING attribute from FileName") [1], and pending merge.
The 'strcat' function is only well defined on NUL-terminated strings. Also, there is a line of code:
filename[ACPI_NAMESEG_SIZE] = 0;
That also makes me think it is a string.
Ugh, indeed.
FTR this is about 70662db73d54 ("ACPICA: Apply ACPI_NONSTRING in more places").
To me neither the above, nor struct acpi_db_execute_walk's: char name_seg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING; is correct in the commit.
This is broken in upstream/-next too.
thanks,
js suse labs
Thank you so much, Jiri, for the attention to the other issue.
The above issue is now reverted in upstream ACPICA commit 4623b33 ("Debugger: drop ACPI_NONSTRING attribute from NameSeg") [2], and pending merge.
Rafael, the upstream PR [3] is ready. My apologies to everyone, and thank you so much for the review and efforts!
Link: https://github.com/acpica/acpica/pull/1029/commits/a6ee09c [1] Link: https://github.com/acpica/acpica/pull/1029/commits/4623b33 [2] Link: https://github.com/acpica/acpica/pull/1029 [3]
-- Best regards, Ahmed Salem