Android: Stack-buffer-overflow in /system/bin/sdcard
There's an integer overflow issue in get_node_path_locked, which results in a buffer overflow. For all of the calling paths, this is going to overflow a stack buffer in the parent function. It can be triggered by a malicious app creating a directory structure in /sdcard with a total path length longer than PATH_MAX, which can be achieved by creating a directory heirarchy starting with several directories with short names and later renaming these parent directories to have longer names. It appears that the overflow is close enough to the bottom of the stack that with a large overflow we can corrupt thread data that is used before the stack cookie is checked, suggesting that this issue is possibly exploitable despite the presence of stack cookies.