🇰🇷 한글 설명
Linux 커널의 MHI 호스트 드라이버에서 원격 장치가 예상치 못한 TRE(Transaction Resource Element) 포인터를 보낼 때 발생하는 취약점입니다. 장치가 이벤트 링의 포인터를 업데이트하는 과정에서 호스트가 오래된 데이터를 참조하게 되면, 버퍼가 중복 해제(Double-free)되어 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
장치가 데이터를 보내는 과정에서 순서가 맞지 않는 잘못된 정보를 전달할 수 있는 허점이 발견되었습니다. 이로 인해 컴퓨터가 이미 사용한 메모리를 다시 지우려고 시도하면서 시스템이 멈추거나 해킹될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bus: mhi: host: Detect events pointing to unexpected TREs
When a remote device sends a completion event to the host, it contains a
pointer to the consumed TRE. The host uses this pointer to process all of
the TREs between it and the host's local copy of the ring's read pointer.
This works when processing completion for chained transactions, but can
lead to nasty results if the device sends an event for a single-element
transaction with a read pointer that is multiple elements ahead of the
host's read pointer.
For instance, if the host accesses an event ring while the device is
updating it, the pointer inside of the event might still point to an old
TRE. If the host uses the channel's xfer_cb() to directly free the buffer
pointed to by the TRE, the buffer will be double-freed.
This behavior was observed on an ep that used upstream EP stack without
'commit 6f18d174b73d ("bus: mhi: ep: Update read pointer only after buffer
is written")'. Where the device updated the events ring pointer before
updating the event contents, so it left a window where the host was able to
access the stale data the event pointed to, before the device had the
chance to update them. The usual pattern was that the host received an
event pointing to a TRE that is not immediately after the last processed
one, so it got treated as if it was a chained transaction, processing all
of the TREs in between the two read pointers.
This commit aims to harden the host by ensuring transactions where the
event points to a TRE that isn't local_rp + 1 are chained.
[mani: added stable tag and reworded commit message]
📍 영향받는 시스템
MHI(Mobile Hardware Interface) 스택을 사용하는 Linux 커널 기반 시스템
⚔️ 공격 벡터
악의적인 원격 장치가 조작된 완료 이벤트(Completion Event)를 호스트로 전송하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트 (commit 6f18d174b73d 관련 수정 사항 포함)
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.