В ядре Linux устранена следующая уязвимость: smb: client: hold server info until cifsd exits Последняя ссылка на сеанс может быть удалена, пока в потоке cifsd demultiplex по-прежнему работает clean_demultiplex_info(). Эта нить освобождает TCP_Server_Info там, соревнуясь с cifs_put_tcp_session (), когда он выпускает крипто-состояние сервера. syzbot сообщил о KASAN use-after-free в cifs_crypto_secmech_release (). Сохранить ссылку на объект для потока cifsd.
Отложите окончательную криптографию, ключ сеанса, пространство имен сети, строку и очистку структуры до тех пор, пока не будут удалены как последняя ссылка на сеанс, так и ссылка на поток. Оставьте ссылку на поток после того, как clean_demultiplex_info () закончил использование сервера. Build-tested с ARCHarm64 и W1 для fs/smb/client/connect.o.
Репродуктор KASAN не запускался на исправленном ядре.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: smb: client: hold server info until cifsd exits The last session reference can be dropped while the cifsd demultiplex thread is still running clean_demultiplex_info(). That thread frees TCP_Server_Info there, racing with cifs_put_tcp_session() as it releases the server crypto state. syzbot reported a KASAN use-after-free in cifs_crypto_secmech_release(). Keep an object reference for the cifsd thread. Defer final crypto, session-key, network namespace, string, and structure cleanup until both the last session reference and the thread reference are dropped. Drop the thread reference after clean_demultiplex_info() has finished using the server. Build-tested with ARCH=arm64 and W=1 for fs/smb/client/connect.o. The KASAN reproducer was not run on the patched kernel.