В ядре Linux устранена следующая уязвимость:
можно: isotp: использовать безусловную синхронизацию_rcu() в isotp_release()
isotp_notify() отменяет регистрацию CAN-фильтров (RCU) с помощью can_rx_unregister()
и очищает so->bound, не дожидаясь льготного периода. isotp_release()
использует so->bound, чтобы решить, нужно ли вызыватьsync_rcu()
перед отменой so->rxtimer, поэтому, когда NETDEV_UNREGISTER запускается первым, он
пропускает синхронизацию_rcu() и может отменить таймер, пока
in-flight isotp_rcv() все еще выполняется и собирается повторно активировать его через
isotp_send_fc(), что приводит к обратному вызову таймера использования после освобождения на
освободившаяся розетка.
sakisho-bot заметил проблему с rtnl_lock, хранящейся в isotp_notify(),
поэтому заставьте isotp_release() всегда вызыватьsync_rcu() перед
отмена таймеров, независимо от so->bound. Это все еще закрывает
исходная гонка (isotp_notify() очищает так->привязку, не дожидаясь
вызывающие isotp_rcv() в полете до того, как isotp_release() отменяет RX
таймер) без добавления ожидания RCU к пути уведомления сетевого устройства.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: can: isotp: use unconditional synchronize_rcu() in isotp_release() isotp_notify() unregisters the (RCU) CAN filters via can_rx_unregister() and clears so->bound without waiting for a grace period. isotp_release() uses so->bound to decide whether it needs to call synchronize_rcu() before cancelling so->rxtimer, so when NETDEV_UNREGISTER runs first it skips that synchronize_rcu() and can cancel the timer while an in-flight isotp_rcv() is still executing and about to re-arm it via isotp_send_fc(), leading to a use-after-free timer callback on the freed socket. sakisho-bot remarked a problem with rtnl_lock held in isotp_notify(), therefore make isotp_release() always call synchronize_rcu() before cancelling the timers, regardless of so->bound. This still closes the original race (isotp_notify() clearing so->bound without waiting for in-flight isotp_rcv() callers before isotp_release() cancels the RX timer) without adding any RCU wait to the netdevice notifier path.
Характеристики атаки
Последствия
Строка CVSS v3.1