Created attachment 5360 [details] use 4096 buffer size, and check the expend before doing it. The setup: using perl under ash. while true; do mkdir `perl -e 'print "A" x 255'`; cd A* || break; done cd (to the top root directory) issue: ls A*/A*/A*/A*/A*/A*/A*/A*/A* (deep 9, which pathname is more than 8x256) shell will die for segfault. I have the fix for us, which our PATH_MAX is 4096.
Created attachment 5366 [details] recheck the code, this seems better
Created attachment 5390 [details] another check
Created attachment 5396 [details] here is the corrent one
Fixed by commit d5f5045b43 (ash: expand: Fix buffer overflow in expandmeta). The first release containing this commit is 1.29.0.