History

dmaengine: imx-sdma: fix size check for sdma script_number

Illegal memory will be touch if SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 (41) exceed the size of structure sdma_script_start_addrs(40), thus cause memory corrupt such as slob block header so that kernel trap into while() loop forever in slob_free(). Please refer to below code piece in imx-sdma.c: for (i = 0; i < sdma->script_number; i++) if (addr_arr[i] > 0) saddr_arr[i] = addr_arr[i]; /* memory corrupt here */ That issue was brought by commit a572460be9cf ("dmaengine: imx-sdma: Add support for version 3 firmware") because SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 (38->41 3 scripts added) not align with script number added in sdma_script_start_addrs(2 scripts).

Robin Gong committed 7 years ago

Commit bd73dfa1 parent 9ec691f2 files · +11 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/platform_data/dma-imx-sdma.h+3−0
@@ -51,7 +51,10 @@ struct sdma_script_start_addrs { · 50 unmodified lines
5151 /* End of v2 array */
5252 s32 zcanfd_2_mcu_addr;
5353 s32 zqspi_2_mcu_addr;
54+ s32 mcu_2_ecspi_addr;
5455 /* End of v3 array */
56+ s32 mcu_2_zqspi_addr;
57+ /* End of v4 array */
5558 };
5659
5760 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t