🇰🇷 한글 설명
Linux 커널의 ATM 네트워크 스택에서 사용자 공간으로부터 받은 vcc 포인터를 검증 없이 직접 역참조하여 메모리 접근 위반 및 시스템 충돌을 야기합니다. 악의적인 사용자가 임의의 메모리 주소를 가리키는 위조된 포인터를 전달하여 커널 메모리 손상을 일으킬 수 있습니다.
💡 쉬운 설명
ATM 통신 기능에서 메모리 주소를 검증 없이 사용하기 때문에, 공격자가 잘못된 주소를 보내 시스템을 충돌시킬 수 있습니다. 이는 커널에서 존재하지 않는 메모리를 접근하려고 할 때 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: atm: fix crash due to unvalidated vcc pointer in sigd_send()
Reproducer available at [1].
The ATM send path (sendmsg -> vcc_sendmsg -> sigd_send) reads the vcc
pointer from msg->vcc and uses it directly without any validation. This
pointer comes from userspace via sendmsg() and can be arbitrarily forged:
int fd = socket(AF_ATMSVC, SOCK_DGRAM, 0);
ioctl(fd, ATMSIGD_CTRL); // become ATM signaling daemon
struct msghdr msg = { .msg_iov = &iov, ... };
*(unsigned long *)(buf + 4) = 0xdeadbeef; // fake vcc pointer
sendmsg(fd, &msg, 0); // kernel dereferences 0xdeadbeef
In normal operation, the kernel sends the vcc pointer to the signaling
daemon via sigd_enq() when processing operations like connect(), bind(),
or listen(). The daemon is expected to return the same pointer when
responding. However, a malicious daemon can send arbitrary pointer values.
Fix this by introducing find_get_vcc() which validates the pointer by
searching through vcc_hash (similar to how sigd_close() iterates over
all VCCs), and acquires a reference via sock_hold() if found.
Since struct atm_vcc embeds struct sock as its first member, they share
the same lifetime. Therefore using sock_hold/sock_put is sufficient to
keep the vcc alive while it is being used.
Note that there may be a race with sigd_close() which could mark the vcc
with various flags (e.g., ATM_VF_RELEASED) after find_get_vcc() returns.
However, sock_hold() guarantees the memory remains valid, so this race
only affects the logical state, not memory safety.
[1]: https://gist.github.com/mrpre/1ba5949c45529c511152e2f4c755b0f3
📍 영향받는 시스템
Linux kernel (CVE 공개 당시 버전까지, 특히 CONFIG_ATM 활성화된 시스템)
⚔️ 공격 벡터
AF_ATMSVC 소켓 생성 후 ATMSIGD_CTRL ioctl로 특권 획득 후 위조된 vcc 포인터를 포함한 sendmsg() 호출
🛡️ 대응 방법
Linux 커널을 패치된 버전으로 업데이트 (find_get_vcc() 함수 추가 및 포인터 유효성 검증 포함)
🔧 검증 코드
커널 버전과 ATM 설정 확인: CONFIG_ATM=y 또는 =m이면 영향받음, 버전이 패치 버전 이상이면 안전
uname -r && grep -E 'CONFIG_ATM' /boot/config-$(uname -r) 2>/dev/null || echo 'ATM not enabled'