В ядре Linux устранена следующая уязвимость: media: micro-csi2dc: fix async notifier leak on probe error path csi2dc_of_parse() заканчивается вызовом csi2dc_prepare_notifier(), который регистрирует V4L2 async notifier with v4l2_async_nf_register(). Метка ошибки зонда csi2dc_probe_cleanup_notifier достигается после того, как csi2dc_of_parse() уже преуспел (например, когда медиа-объект init, csi2dc_power() или v4l2_async_register_subdev() терпит неудачу), но он вызывает только v4l2_async_nf_cleanup() и никогда v4l2_async_nf_unregister(). Таким образом, уведомитель остается прикованным к глобальному notifier_list, в то время как вложенная структура csi2dc_device освобождается, что приводит к повреждению списка и use-after-free, когда список будет следующий.
Unregister уведомитель, прежде чем очистить его на пути ошибки, сопоставляя разрыв уже сделано в csi2dc_remove().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: media: microchip-csi2dc: fix async notifier leak on probe error path csi2dc_of_parse() ends up calling csi2dc_prepare_notifier(), which registers the V4L2 async notifier with v4l2_async_nf_register(). The probe error label csi2dc_probe_cleanup_notifier is reached after csi2dc_of_parse() has already succeeded (e.g. when media entity init, csi2dc_power() or v4l2_async_register_subdev() fail), but it calls only v4l2_async_nf_cleanup() and never v4l2_async_nf_unregister(). The notifier therefore stays chained in the global notifier_list while the enclosing struct csi2dc_device is freed, leading to list corruption and a use-after-free when the list is next walked. Unregister the notifier before cleaning it up on the error path, matching the teardown already done in csi2dc_remove().