Skip to contentSkip to conversation

erofs image that can put z_erofs_scan_folio() into an infinite loop

DISCUSSION [email protected] 2 participants 2 messages Oct 16, 2025 – Oct 17, 2025

lore
Share & tools
lore
#0 lore raw

This produces an infinite loop in z_erofs_scan_folio():

# uname -r
6.17.0-12747-g859be217ee9e
# wget http://www.rtmrtm.org/rtm/erofs6a.img
# mount -t erofs -o loop erofs6a.img /mnt
# cp /mnt/x /tmp/y

I'm afraid I have not been able to track down what is going on. But one factor is that erofs_inode_extended->i_size is 0x80000000000fff; changing it to e.g. 3 makes the infinite loop go away.

On the other hand, here's another image can also loop forever in z_erofs_scan_folio(), but has a more ordinary i_size:

# wget http://www.rtmrtm.org/rtm/erofs23a.img
# mount -t erofs -o loop erofs23a.img /mnt
# cp /mnt/x /tmp/y

Robert Morris
[email protected]

#1 lore raw
Quoted 12 lines · On 2025/10/17 04:18, [email protected] wrote:

This produces an infinite loop in z_erofs_scan_folio():

# uname -r
6.17.0-12747-g859be217ee9e
# wget http://www.rtmrtm.org/rtm/erofs6a.img
# mount -t erofs -o loop erofs6a.img /mnt
# cp /mnt/x /tmp/y

I'm afraid I have not been able to track down what is going on. But one factor is that erofs_inode_extended->i_size is 0x80000000000fff; changing it to e.g. 3 makes the infinite loop go away.

Quoted 6 lines

On the other hand, here's another image can also loop forever in z_erofs_scan_folio(), but has a more ordinary i_size:

# wget http://www.rtmrtm.org/rtm/erofs23a.img
# mount -t erofs -o loop erofs23a.img /mnt
# cp /mnt/x /tmp/y

Thanks! Will look into those soon.

Thanks,
Gao Xiang

Quoted 4 lines

Robert Morris
[email protected]