В ядре Linux была устранена следующая уязвимость: fsnotify: prevent mark additions during connector teardown fsnotify_destroy_marks() сохраняет ссылку на свою текущую отметку, в то время как она падает conn->lock для уничтожения отметки. Это стабилизирует курсор, но не мешает вставлять перед ним новую метку. Например, часы inotify, повторно добавленные после IN_IGNORED, сортируются перед старой, отдельной отметкой для той же группы.
Прогулка может пропустить замену, а затем отсоединить весь разъем от объекта. Замена все еще на marks_list своей группы и, для инотифы, на часах IDR. Группа mutex больше не защищает объект соединителя от исчезновения.
Непривилегированное чтение fdinfo в гонке финального отрыва может, следовательно, вызвать igrab(NULL): BUG: KASAN: null-ptr-deref в igrab+0x24/0x100 Write размера 4 в addr 000000000148 Call Trace: igrab+0x24/0x100 inotify_show_fdinfo+0x1dc/0x5e0 seq_show+0x397/0x690 Set флаг DESTROYING под conn->lock перед началом прогулки, и отклонить новые отметки на этом разъеме с -ENOENT. Существующие пути ошибки метки добавления аннулируют временную запись списка групп и выделение часов сервером. Не ждите сноса, удерживая группу мьютекса, в котором нуждается эсминец.
После того, как старый разъем отсоединен, дополнение может установить новый разъем, как и раньше. Это закрывает гонку вставки для всех типов объектов с использованием общего разъема, без изменения ссылки на метку или правил жизни SRCU.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: fsnotify: prevent mark additions during connector teardown fsnotify_destroy_marks() keeps a reference to its current mark while it drops conn->lock to destroy the mark. This stabilizes the forward-walk cursor, but does not prevent a new mark from being inserted before it. For example, an inotify watch re-added after IN_IGNORED sorts before the old, detached mark for the same group. The walk can miss the replacement and then detach the entire connector from the object. The replacement is still on its group's marks_list and, for inotify, in the watch IDR. The group mutex no longer protects the connector's object from disappearing. An unprivileged fdinfo read racing the final detach can consequently call igrab(NULL): BUG: KASAN: null-ptr-deref in igrab+0x24/0x100 Write of size 4 at addr 0000000000000148 Call Trace: igrab+0x24/0x100 inotify_show_fdinfo+0x1dc/0x5e0 seq_show+0x397/0x690 Set a DESTROYING flag under conn->lock before starting the walk, and reject new marks on that connector with -ENOENT. The existing add-mark error paths undo the temporary group-list entry and the backend's watch allocation. Do not wait for teardown while holding the group mutex, which the destroyer needs. Once the old connector is detached, an add can install a fresh connector as before. This closes the insertion race for all object types using the common connector teardown, without changing the mark reference or SRCU lifetime rules.