nilfs2: fix infinite loop in nilfs_clean_segments()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9ff05123e3bfbb1d2b68ba1d9bf1f7d1dffc1453 · < 1fc6df85b4954b6fda9c351843aaca3c06f66d8d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix infinite loop in nilfs_clean_segments()
syzbot reported a hung task in nilfs_transaction_begin(). This occurs because the cleaner ioctl falls into an infinite loop if nilfs_segctor_construct() repeatedly returns -EROFS (e.g. the device is remounted as read-only after an I/O error).
Currently in nilfs_clean_segments(), if err is non-zero, it logs the error and sleeps but doesn't abort when it encounters a terminal error like -EROFS. This causes the thread to loop forever.
Fix this by breaking out of the loop if nilfs_segctor_construct() returns -EROFS. This matches the behaviour in nilfs_segctor_write_out(), which also handles -EROFS.
From the CVE record · Linux
The nilfs2 cleaner ioctl can loop indefinitely if segment construction repeatedly returns -EROFS, for example after an I/O error causes the device to be remounted read-only. This can leave a task hung; the input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with nilfs2 should check their deployments; affected versions are not specified.