🇰🇷 한글 설명
Linux 커널의 igb 드라이버에서, 이전에 추가된 rtnl_lock 호출이 SR-IOV 가상 기능 제거 과정에서 교착 상태(deadlock)를 일으키는 문제가 있었습니다. 해당 데이터 레이스는 실제로 발생하지 않으므로 불필요한 rtnl_(un)lock을 제거하여 문제를 해결했습니다.
💡 쉬운 설명
네트워크 카드 드라이버에서 불필요한 잠금 기능이 원인이 되어 시스템이 멈추는 문제가 있었습니다. 실제로 발생하지 않는 상황을 막기 위한 코드였기 때문에 이를 제거하여 해결했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
igb: revert rtnl_lock() that causes deadlock
The commit 6faee3d4ee8b ("igb: Add lock to avoid data race") adds
rtnl_lock to eliminate a false data race shown below
(FREE from device detaching) | (USE from netdev core)
igb_remove | igb_ndo_get_vf_config
igb_disable_sriov | vf >= adapter->vfs_allocated_count?
kfree(adapter->vf_data) |
adapter->vfs_allocated_count = 0 |
| memcpy(... adapter->vf_data[vf]
The above race will never happen and the extra rtnl_lock causes deadlock
below
[ 141.420169] <TASK>
[ 141.420672] __schedule+0x2dd/0x840
[ 141.421427] schedule+0x50/0xc0
[ 141.422041] schedule_preempt_disabled+0x11/0x20
[ 141.422678] __mutex_lock.isra.13+0x431/0x6b0
[ 141.423324] unregister_netdev+0xe/0x20
[ 141.423578] igbvf_remove+0x45/0xe0 [igbvf]
[ 141.423791] pci_device_remove+0x36/0xb0
[ 141.423990] device_release_driver_internal+0xc1/0x160
[ 141.424270] pci_stop_bus_device+0x6d/0x90
[ 141.424507] pci_stop_and_remove_bus_device+0xe/0x20
[ 141.424789] pci_iov_remove_virtfn+0xba/0x120
[ 141.425452] sriov_disable+0x2f/0xf0
[ 141.425679] igb_disable_sriov+0x4e/0x100 [igb]
[ 141.426353] igb_remove+0xa0/0x130 [igb]
[ 141.426599] pci_device_remove+0x36/0xb0
[ 141.426796] device_release_driver_internal+0xc1/0x160
[ 141.427060] driver_detach+0x44/0x90
[ 141.427253] bus_remove_driver+0x55/0xe0
[ 141.427477] pci_unregister_driver+0x2a/0xa0
[ 141.428296] __x64_sys_delete_module+0x141/0x2b0
[ 141.429126] ? mntput_no_expire+0x4a/0x240
[ 141.429363] ? syscall_trace_enter.isra.19+0x126/0x1a0
[ 141.429653] do_syscall_64+0x5b/0x80
[ 141.429847] ? exit_to_user_mode_prepare+0x14d/0x1c0
[ 141.430109] ? syscall_exit_to_user_mode+0x12/0x30
[ 141.430849] ? do_syscall_64+0x67/0x80
[ 141.431083] ? syscall_exit_to_user_mode_prepare+0x183/0x1b0
[ 141.431770] ? syscall_exit_to_user_mode+0x12/0x30
[ 141.432482] ? do_syscall_64+0x67/0x80
[ 141.432714] ? exc_page_fault+0x64/0x140
[ 141.432911] entry_SYSCALL_64_after_hwframe+0x72/0xdc
Since the igb_disable_sriov() will call pci_disable_sriov() before
releasing any resources, the netdev core will synchronize the cleanup to
avoid any races. This patch removes the useless rtnl_(un)lock to guarantee
correctness.
📍 영향받는 시스템
Intel igb 네트워크 드라이버를 사용하는 Linux 커널의 SR-IOV 활성화 환경 (수정 커밋 적용 전 버전)
⚔️ 공격 벡터
로컬 관리자 권한으로 igb 드라이버를 제거(모듈 언로드)하는 과정에서 교착 상태가 발생해 서비스 중단을 유발할 수 있음
🛡️ 대응 방법
커널을 해당 수정 사항이 포함된 최신 안정 버전으로 업데이트
🔧 검증 코드
커널 버전을 확인하고 igb 드라이버 정보가 출력되면 해당 커널의 수정 적용 여부를 배포판 보안 공지나 커널 changelog에서 대조하며, 드라이버가 없으면 이 취약점의 영향을 받지 않습니다.
uname -r && (modinfo igb 2>/dev/null | grep -E '^(version|filename)')