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; | ^~~~~~~~
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,