В ядре Linux устранена следующая уязвимость: thunderbolt: Fix domain reference leak when DPRX read is cancelled tb_tunnel_one_dp() принимает доменную ссылку, которая удаляется только после запуска tb_dp_tunnel_active() в рабочей очереди. Если эта работа отменена, ссылка на нее просочилась. Так как commit f5cc545f5969 ("thunderbolt: Wait for tb_domain_release() to complete when driver is demoved") вместо просто утечки памяти это теперь также блокирует в завершении ждать вечно, когда отвязка драйвера.
Это может быть вызвано всякий раз, когда туннель DP снесен до того, как чтение DPRX завершено, например, путем отключения в течение таймаута, а затем отвязывания драйвера. Эта ссылка существует только для того, чтобы сохранить домен, в то время как работа DPRX запланирована, поэтому позвольте самой работе владеть ею: возьмите ее в tb_dp_dprx_start () и оставьте ее в обоих местах, которые заканчивают работу. Get/put затем соединяются внутри одного и того же файла, и больше не имеет значения, выполняется ли обратный звонок.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: thunderbolt: Fix domain reference leak when DPRX read is canceled tb_tunnel_one_dp() takes a domain reference which is only dropped once tb_dp_tunnel_active() has run on the work queue. If that work is cancelled that reference is leaked. Since commit f5cc545f5969 ("thunderbolt: Wait for tb_domain_release() to complete when driver is removed") instead of just leaking memory this now also blocks in the completion wait forever when unbinding the driver. This can be triggered whenever a DP tunnel is torn down before the DPRX read has completed, e.g. by unplugging within the timeout, and then unbinding the driver. That reference only exists to keep the domain around while the DPRX work is scheduled so let the work itself own it: take it in tb_dp_dprx_start() and drop it in both places that end the work. Get/put are then paired inside the same file and it doesn't matter anymore if the callback ever runs.