В ядре Linux была устранена следующая уязвимость: bfs: Тип файла Reconstruct При загрузке с диска syzbot сообщает, что биты S_IFMT inode->i_mode могут стать фиктивными, когда биты S_IFMT поля 32bits «mode», загруженного с диска, повреждены или когда поле 32bits «attributes», загруженное с диска, повреждено. В документации говорится, что BFS использует только нижние 9 бит поля «mode». Но я не могу найти явного объяснения, что неиспользуемые верхние 23 бита (особенно биты S_IFMT) инициализируются с 0.
Поэтому игнорируйте биты S_IFMT поля «mode», загруженные с диска. Кроме того, убедитесь, что значение поля "attributes", загруженного с диска, является либо BFS_VREG, либо BFS_VDIR (потому что BFS поддерживает только обычные файлы и корневой каталог).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: bfs: Reconstruct file type when loading from disk syzbot is reporting that S_IFMT bits of inode->i_mode can become bogus when the S_IFMT bits of the 32bits "mode" field loaded from disk are corrupted or when the 32bits "attributes" field loaded from disk are corrupted. A documentation says that BFS uses only lower 9 bits of the "mode" field. But I can't find an explicit explanation that the unused upper 23 bits (especially, the S_IFMT bits) are initialized with 0. Therefore, ignore the S_IFMT bits of the "mode" field loaded from disk. Also, verify that the value of the "attributes" field loaded from disk is either BFS_VREG or BFS_VDIR (because BFS supports only regular files and the root directory).