🇰🇷 한글 설명
Linux 커널의 mlx5e 드라이버에서 프로파일 롤백이 실패했을 때 profile 포인터가 NULL로 남아, 드라이버 언로드 시 profile->cleanup 호출로 인해 NULL 포인터 역참조가 발생하는 문제가 수정되었습니다. 해당 상황에서는 cleanup 호출을 생략하도록 변경되었습니다.
💡 쉬운 설명
Mellanox 네트워크 카드 드라이버가 설정 변경 실패 후 복구에도 실패하면, 드라이버를 제거할 때 시스템이 강제 종료(커널 패닉)될 수 있습니다. 이번 패치는 이런 상황에서 잘못된 정리 작업을 건너뛰도록 막습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Don't call cleanup on profile rollback failure
When profile rollback fails in mlx5e_netdev_change_profile, the netdev
profile var is left set to NULL. Avoid a crash when unloading the driver
by not calling profile->cleanup in such a case.
This was encountered while testing, with the original trigger that
the wq rescuer thread creation got interrupted (presumably due to
Ctrl+C-ing modprobe), which gets converted to ENOMEM (-12) by
mlx5e_priv_init, the profile rollback also fails for the same reason
(signal still active) so the profile is left as NULL, leading to a crash
later in _mlx5e_remove.
[ 732.473932] mlx5_core 0000:08:00.1: E-Switch: Unload vfs: mode(OFFLOADS), nvfs(2), necvfs(0), active vports(2)
[ 734.525513] workqueue: Failed to create a rescuer kthread for wq "mlx5e": -EINTR
[ 734.557372] mlx5_core 0000:08:00.1: mlx5e_netdev_init_profile:6235:(pid 6086): mlx5e_priv_init failed, err=-12
[ 734.559187] mlx5_core 0000:08:00.1 eth3: mlx5e_netdev_change_profile: new profile init failed, -12
[ 734.560153] workqueue: Failed to create a rescuer kthread for wq "mlx5e": -EINTR
[ 734.589378] mlx5_core 0000:08:00.1: mlx5e_netdev_init_profile:6235:(pid 6086): mlx5e_priv_init failed, err=-12
[ 734.591136] mlx5_core 0000:08:00.1 eth3: mlx5e_netdev_change_profile: failed to rollback to orig profile, -12
[ 745.537492] BUG: kernel NULL pointer dereference, address: 0000000000000008
[ 745.538222] #PF: supervisor read access in kernel mode
<snipped>
[ 745.551290] Call Trace:
[ 745.551590] <TASK>
[ 745.551866] ? __die+0x20/0x60
[ 745.552218] ? page_fault_oops+0x150/0x400
[ 745.555307] ? exc_page_fault+0x79/0x240
[ 745.555729] ? asm_exc_page_fault+0x22/0x30
[ 745.556166] ? mlx5e_remove+0x6b/0xb0 [mlx5_core]
[ 745.556698] auxiliary_bus_remove+0x18/0x30
[ 745.557134] device_release_driver_internal+0x1df/0x240
[ 745.557654] bus_remove_device+0xd7/0x140
[ 745.558075] device_del+0x15b/0x3c0
[ 745.558456] mlx5_rescan_drivers_locked.part.0+0xb1/0x2f0 [mlx5_core]
[ 745.559112] mlx5_unregister_device+0x34/0x50 [mlx5_core]
[ 745.559686] mlx5_uninit_one+0x46/0xf0 [mlx5_core]
[ 745.560203] remove_one+0x4e/0xd0 [mlx5_core]
[ 745.560694] pci_device_remove+0x39/0xa0
[ 745.561112] device_release_driver_internal+0x1df/0x240
[ 745.561631] driver_detach+0x47/0x90
[ 745.562022] bus_remove_driver+0x84/0x100
[ 745.562444] pci_unregister_driver+0x3b/0x90
[ 745.562890] mlx5_cleanup+0xc/0x1b [mlx5_core]
[ 745.563415] __x64_sys_delete_module+0x14d/0x2f0
[ 745.563886] ? kmem_cache_free+0x1b0/0x460
[ 745.564313] ? lockdep_hardirqs_on_prepare+0xe2/0x190
[ 745.564825] do_syscall_64+0x6d/0x140
[ 745.565223] entry_SYSCALL_64_after_hwframe+0x4b/0x53
[ 745.565725] RIP: 0033:0x7f1579b1288b
📍 영향받는 시스템
Linux 커널의 mlx5e(NVIDIA/Mellanox ConnectX 계열 NIC) 드라이버를 사용하는 수정 이전 커널 버전
⚔️ 공격 벡터
로컬 권한을 가진 사용자가 드라이버 로드/언로드 과정에서 시그널 등으로 프로파일 초기화를 중단시켜 실패 상태를 유도한 뒤 모듈을 제거하면 서비스 거부(커널 크래시)가 발생할 수 있음
🛡️ 대응 방법
패치가 포함된 최신 Linux 커널로 업데이트하거나 배포판 보안 업데이트를 적용하세요.
🔧 검증 코드
출력된 커널 버전이 해당 CVE 수정이 포함된 배포판 업데이트 버전 이상인지 확인하고, mlx5_core가 로드되어 있지 않다면 이 취약점의 직접적 영향은 없습니다.
uname -r && (lsmod | grep mlx5_core || echo 'mlx5_core not loaded')