🇰🇷 한글 설명
Linux 커널의 ieee802154 모듈에서 dgram_recvmsg() 함수 호출 시 커널 메모리 정보가 유출되는 취약점이 발견되었습니다. 주소 모드가 IEEE802154_ADDR_NONE일 때 pan_id 필드가 초기화되지 않은 상태로 사용자 공간으로 복사되어 발생합니다.
💡 쉬운 설명
컴퓨터의 중요한 정보가 담긴 메모리 영역 중 일부가 초기화되지 않은 채 외부로 흘러나갈 수 있는 보안 결함입니다. 공격자는 이를 통해 시스템 내부의 민감한 데이터를 엿볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ieee802154: fix kernel-infoleak in dgram_recvmsg()
KMSAN reported a kernel-infoleak in move_addr_to_user():
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user
include/linux/instrumented.h:131 [inline]
BUG: KMSAN: kernel-infoleak in _inline_copy_to_user
include/linux/uaccess.h:205 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xcc/0x120
lib/usercopy.c:26
instrument_copy_to_user include/linux/instrumented.h:131 [inline]
_inline_copy_to_user include/linux/uaccess.h:205 [inline]
_copy_to_user+0xcc/0x120 lib/usercopy.c:26
copy_to_user include/linux/uaccess.h:236 [inline]
move_addr_to_user+0x2e7/0x440 net/socket.c:302
____sys_recvmsg+0x232/0x610 net/socket.c:2925
...
Uninit was stored to memory at:
ieee802154_addr_to_sa include/net/ieee802154_netdev.h:369 [inline]
dgram_recvmsg+0xa09/0xbe0 net/ieee802154/socket.c:739
The issue occurs because the `pan_id` field of `struct ieee802154_addr`
is left uninitialized when the address mode is `IEEE802154_ADDR_NONE`.
The execution flow is as follows:
1. `__ieee802154_rx_handle_packet()` declares a local `struct
ieee802154_hdr hdr` on the stack.
2. `ieee802154_hdr_pull()` calls `ieee802154_hdr_get_addr()` to parse
the source and destination addresses into this structure.
3. If the address mode is `IEEE802154_ADDR_NONE`,
`ieee802154_hdr_get_addr()` previously only set the `mode` field,
leaving the `pan_id` field containing uninitialized stack memory.
4. This uninitialized `pan_id` is later copied into a `struct
sockaddr_ieee802154` in `dgram_recvmsg()` via `ieee802154_addr_to_sa()`.
5. Finally, `move_addr_to_user()` copies the socket address structure to
user space, leaking the uninitialized bytes.
Fix this by using `memset` to zero out the address structure in
`ieee802154_hdr_get_addr()` when the mode is `IEEE802154_ADDR_NONE`.
📍 영향받는 시스템
Linux kernel (ieee802154 module 사용 환경)
⚔️ 공격 벡터
IEEE 802.15.4 네트워크 패킷을 통해 주소 모드가 NONE인 데이터를 전송하여 커널 스택의 미초기화 데이터를 유도
🛡️ 대응 방법
ieee802154_hdr_get_addr() 함수 내에서 주소 모드가 NONE일 경우 memset을 사용하여 구조체를 0으로 초기화하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.