🇰🇷 한글 설명
Linux 커널의 Bluetooth 스택에서 MSFT 응답의 evt_prefix_len 값을 검증하지 않아 발생하는 취약점입니다. 공격자가 조작된 응답을 보내면 실제 데이터 길이보다 더 많은 데이터를 메모리에서 복사하여 잘못된 데이터를 이벤트 매칭에 사용할 수 있습니다.
💡 쉬운 설명
블루투스 장치가 컴퓨터에 잘못된 정보를 보낼 때, 컴퓨터가 그 정보의 길이를 제대로 확인하지 않고 넘겨짚어 읽는 문제입니다. 이로 인해 실제로는 전달되지 않은 엉뚱한 메모리 데이터가 시스템에 사용될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MSFT: validate evt_prefix_len against the response length
read_supported_features() only checks that the response covers the fixed
part of struct msft_rp_read_supported_features, which is 11 bytes:
if (skb->len < sizeof(*rp)) {
bt_dev_err(hdev, "MSFT supported features length mismatch");
goto failed;
}
evt_prefix[] is a flexible array member and rp->evt_prefix_len is an
unvalidated u8 taken straight out of that response, so
msft->evt_prefix = kmemdup(rp->evt_prefix, rp->evt_prefix_len,
GFP_KERNEL);
copies up to 255 bytes from a reply that may have carried none of them.
What is copied is data the controller never sent, and it is then used to
match incoming vendor events in msft_vendor_evt().
This is not an out-of-bounds access. An skb data allocation always has
at least SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) bytes past the
payload, which is more than the 255 byte maximum, so the read stays
inside the allocation and KASAN does not report it. It is still a read
of bytes the host was never given, with the length fully controlled by
the controller.
Reject a response that is too short for the prefix it declares.
Verified with an emulated controller over /dev/vhci on a KASAN kernel,
with vhci made to advertise an MSFT opcode the way btintel, btqca, btmtk
and btrtl do unconditionally. A reply of exactly 11 bytes declaring
evt_prefix_len = 255 reaches kmemdup and copies 255 bytes
("skb->len=11 evt_prefix_len=255", with the copied buffer dumped); since
the reply ends at the fixed part, all 255 come from past the end of the
response. No KASAN report is produced, as expected from the allocation
slack described above. With this patch the response is rejected with
"MSFT event prefix length mismatch" and msft->evt_prefix is left unset.
📍 영향받는 시스템
Linux kernel (Bluetooth MSFT implementation)
⚔️ 공격 벡터
조작된 MSFT 응답을 보내는 악성 블루투스 컨트롤러를 통한 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 이후의 버전인지 확인