mbox series

[f2fs-dev,6.1,0/1] f2fs: convert to MAX_SBI_FLAG instead of 32 in stat_show()

Message ID 20240924120411.34948-1-n.zhandarovich@fintech.ru (mailing list archive)
Headers show
Series f2fs: convert to MAX_SBI_FLAG instead of 32 in stat_show() | expand

Message

Nikita Zhandarovich Sept. 24, 2024, 12:04 p.m. UTC
This patch addresses an open issue of buffer overflow in
f2fs function stat_show(). On the off chance that si->sbi->s_flag
had one of its bits (on the higher end) set to 1, for_each_set_bit()
will loop more than s_flag[] can afford, leading in turn to
erroneous array access.

The issue in question has been fixed in commit 5bb9c111cd98
("f2fs: convert to MAX_SBI_FLAG instead of 32 in stat_show()") and
cherry-picked for 6.1 stable branch.

Modified patch can now be cleanly applied to linux-6.1.y. All of
the changes made to the patch in order to adapt it are described
at the end of commit message in [PATCH 6.1 1/1] f2fs: convert to
MAX_SBI_FLAG instead of 32 in stat_show().