🇰🇷 한글 설명
Linux 커널의 AoE(ATA over Ethernet) 드라이버에서 aoecmd_cfg_pkts() 함수가 net_device 참조 카운트를 부적절하게 업데이트하여 use-after-free 취약점을 야기한다. 해제된 메모리에 kthread의 tx() 함수가 접근하면서 서비스 거부나 코드 실행이 가능하다.
💡 쉬운 설명
네트워크 드라이버가 메모리를 너무 일찍 반환하면서, 다른 코드가 해제된 메모리에 접근하는 경쟁 조건(race condition)이 발생한다. 이를 악용하면 시스템을 멈추거나 임의 코드를 실행할 수 있다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts
This patch is against CVE-2023-6270. The description of cve is:
A flaw was found in the ATA over Ethernet (AoE) driver in the Linux
kernel. The aoecmd_cfg_pkts() function improperly updates the refcnt on
`struct net_device`, and a use-after-free can be triggered by racing
between the free on the struct and the access through the `skbtxq`
global queue. This could lead to a denial of service condition or
potential code execution.
In aoecmd_cfg_pkts(), it always calls dev_put(ifp) when skb initial
code is finished. But the net_device ifp will still be used in
later tx()->dev_queue_xmit() in kthread. Which means that the
dev_put(ifp) should NOT be called in the success path of skb
initial code in aoecmd_cfg_pkts(). Otherwise tx() may run into
use-after-free because the net_device is freed.
This patch removed the dev_put(ifp) in the success path in
aoecmd_cfg_pkts(), and added dev_put() after skb xmit in tx().
📍 영향받는 시스템
Linux kernel with AoE driver (CVE-2023-6270 patch 이전 버전)
⚔️ 공격 벡터
skbtxq 큐를 통한 메모리 해제와 접근 사이의 경쟁 조건 트리거
🛡️ 대응 방법
Linux 커널을 패치된 버전으로 업그레이드하여 aoecmd_cfg_pkts()의 불필요한 dev_put()을 제거
🔧 검증 코드
AoE 모듈이 로드된 경우 버전을 확인하고, 로드되지 않은 경우 시스템이 취약점 영향 범위 외에 있다.
modinfo aoe 2>/dev/null | grep -E 'version|filename' || echo 'AoE driver not loaded'