🇰🇷 한글 설명
Linux 커널의 mlx5e 드라이버에서, 모듈 언로드 중 피어 tc 플로우가 아직 오프로드된 상태일 때 이미 파괴된 encap 잠금을 획득하려다 NULL 포인터 역참조가 발생하는 문제가 해결되었습니다. 수정은 tc eswitch 정리 단계(mlx5e_tc_esw_cleanup)에서 피어 플로우를 먼저 정리하도록 변경한 것입니다.
💡 쉬운 설명
Mellanox 네트워크 카드 드라이버를 제거하는 과정에서 시스템이 잘못된 메모리 주소를 참조해 충돌할 수 있는 문제입니다. 제조사 패치가 적용된 커널로 업데이트하면 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Fix cleanup null-ptr deref on encap lock
During module is unloaded while a peer tc flow is still offloaded,
first the peer uplink rep profile is changed to a nic profile, and so
neigh encap lock is destroyed. Next during unload, the VF reps netdevs
are unregistered which causes the original non-peer tc flow to be deleted,
which deletes the peer flow. The peer flow deletion detaches the encap
entry and try to take the already destroyed encap lock, causing the
below trace.
Fix this by clearing peer flows during tc eswitch cleanup
(mlx5e_tc_esw_cleanup()).
Relevant trace:
[ 4316.837128] BUG: kernel NULL pointer dereference, address: 00000000000001d8
[ 4316.842239] RIP: 0010:__mutex_lock+0xb5/0xc40
[ 4316.851897] Call Trace:
[ 4316.852481] <TASK>
[ 4316.857214] mlx5e_rep_neigh_entry_release+0x93/0x790 [mlx5_core]
[ 4316.858258] mlx5e_rep_encap_entry_detach+0xa7/0xf0 [mlx5_core]
[ 4316.859134] mlx5e_encap_dealloc+0xa3/0xf0 [mlx5_core]
[ 4316.859867] clean_encap_dests.part.0+0x5c/0xe0 [mlx5_core]
[ 4316.860605] mlx5e_tc_del_fdb_flow+0x32a/0x810 [mlx5_core]
[ 4316.862609] __mlx5e_tc_del_fdb_peer_flow+0x1a2/0x250 [mlx5_core]
[ 4316.863394] mlx5e_tc_del_flow+0x(/0x630 [mlx5_core]
[ 4316.864090] mlx5e_flow_put+0x5f/0x100 [mlx5_core]
[ 4316.864771] mlx5e_delete_flower+0x4de/0xa40 [mlx5_core]
[ 4316.865486] tc_setup_cb_reoffload+0x20/0x80
[ 4316.865905] fl_reoffload+0x47c/0x510 [cls_flower]
[ 4316.869181] tcf_block_playback_offloads+0x91/0x1d0
[ 4316.869649] tcf_block_unbind+0xe7/0x1b0
[ 4316.870049] tcf_block_offload_cmd.isra.0+0x1ee/0x270
[ 4316.879266] tcf_block_offload_unbind+0x61/0xa0
[ 4316.879711] __tcf_block_put+0xa4/0x310
📍 영향받는 시스템
Mellanox/NVIDIA ConnectX 기반 mlx5_core 드라이버를 사용하는 Linux 커널 (SR-IOV 및 eswitch/tc offload 사용 환경, 수정 커널 이전 버전)
⚔️ 공격 벡터
원격 공격 경로는 확인되지 않으며, 드라이버 언로드 시 발생하는 커널 충돌(서비스 거부) 수준의 문제로 알려져 있습니다.
🛡️ 대응 방법
커널을 CVE-2023-53105 수정이 포함된 최신 stable 버전으로 업데이트하고 재부팅합니다.
🔧 검증 코드
출력된 커널 버전이 배포판의 보안 업데이트 적용 버전 이상인지 확인하고, mlx5_core 모듈이 없으면 해당 드라이버를 사용하지 않는 시스템이므로 영향이 없습니다.
uname -r && (modinfo mlx5_core 2>/dev/null | grep -E '^(version|srcversion)')