🇰🇷 한글 설명
Linux 커널의 mlx5 E-Switch 드라이버에서 mlx5_eswitch_termtbl_put 함수 호출 시 Use-After-Free 취약점이 발견되었습니다. termtbl_mutex가 해제된 후 ref_count를 확인하는 과정에서 경쟁 상태(Race Condition)가 발생하여, 이미 해제된 메모리에 접근할 수 있는 문제가 있습니다.
💡 쉬운 설명
두 개의 작업이 동시에 같은 메모리 정보를 수정하려고 할 때, 한쪽이 메모리를 삭제한 후 다른 쪽이 삭제된 메모리를 다시 사용하려고 시도하면서 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: E-Switch: fix use-after-free in mlx5_eswitch_termtbl_put
In mlx5_eswitch_termtbl_put(), the zero-ref cleanup check reads
tt->ref_count after termtbl_mutex has been released. Two concurrent
callers on the same mlx5_termtbl_handle race: one decrements ref_count
to zero, removes the hash entry, and calls kfree(tt) while the other
has already dropped the mutex and is about to evaluate
if (!tt->ref_count), producing a use-after-free.
Fix this by capturing the result of the decrement into a stack-local
last variable before dropping the mutex. The cleanup decision is now
made entirely under termtbl_mutex, and tt is not touched after
kfree.
📍 영향받는 시스템
Linux kernel (mlx5 driver 사용 시스템)
⚔️ 공격 벡터
동시성 제어 미흡을 이용한 경쟁 상태(Race Condition) 유발
🛡️ 대응 방법
커널 패치를 적용하여 mutex 보호 범위 내에서 참조 횟수 감소 및 정리 로직을 수행하도록 업데이트해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.