🇰🇷 한글 설명
Linux 커널의 macsec 모듈에서 상위 및 하위 네트워크 기능의 동기화 과정 중 데드락(Deadlock)이 발생할 수 있는 취약점입니다. ETHTOOL_SFEATURES를 통해 기능을 변경할 때, 이미 획득한 잠금(Lock) 상태에서 하위 장치의 잠금을 다시 요청하여 시스템이 멈출 수 있습니다.
💡 쉬운 설명
네트워크 보안 기능을 설정하는 과정에서 컴퓨터가 서로의 자원을 기다리며 무한히 대기하는 상태에 빠질 수 있는 문제입니다. 이로 인해 시스템이 응답하지 않거나 멈추는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
macsec: sync features on RTM_NEWLINK
Syzkaller managed to lock the lower device via ETHTOOL_SFEATURES:
netdev_lock include/linux/netdevice.h:2761 [inline]
netdev_lock_ops include/net/netdev_lock.h:42 [inline]
netdev_sync_lower_features net/core/dev.c:10649 [inline]
__netdev_update_features+0xcb1/0x1be0 net/core/dev.c:10819
netdev_update_features+0x6d/0xe0 net/core/dev.c:10876
macsec_notify+0x2f5/0x660 drivers/net/macsec.c:4533
notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
netdev_features_change+0x85/0xc0 net/core/dev.c:1570
__dev_ethtool net/ethtool/ioctl.c:3469 [inline]
dev_ethtool+0x1536/0x19b0 net/ethtool/ioctl.c:3502
dev_ioctl+0x392/0x1150 net/core/dev_ioctl.c:759
It happens because lower features are out of sync with the upper:
__dev_ethtool (real_dev)
netdev_lock_ops(real_dev)
ETHTOOL_SFEATURES
__netdev_features_change
netdev_sync_upper_features
disable LRO on the lower
if (old_features != dev->features)
netdev_features_change
fires NETDEV_FEAT_CHANGE
macsec_notify
NETDEV_FEAT_CHANGE
netdev_update_features (for each macsec dev)
netdev_sync_lower_features
if (upper_features != lower_features)
netdev_lock_ops(lower) # lower == real_dev
stuck
...
netdev_unlock_ops(real_dev)
Per commit af5f54b0ef9e ("net: Lock lower level devices when updating
features"), we elide the lock/unlock when the upper and lower features
are synced. Makes sure the lower (real_dev) has proper features after
the macsec link has been created. This makes sure we never hit the
situation where we need to sync upper flags to the lower.
📍 영향받는 시스템
Linux Kernel (macsec 모듈을 사용하는 버전)
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 ETHTOOL_SFEATURES ioctl 호출을 통해 네트워크 기능을 변경 시도
🛡️ 대응 방법
커널 패치(commit af5f54b0ef9e)가 적용된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인