🇰🇷 한글 설명
Linux 커널의 ch341 SPI 드라이버에서 ch341_transfer_one 함수 호출 시 경계 외 메모리 접근(Out-of-bounds) 취약점이 발견되었습니다. 데이터 복사 과정에서 길이를 잘못 계산하여 tx_buf의 범위를 벗어나는 읽기 및 쓰기가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 부품을 연결하는 드라이버 프로그램이 데이터를 옮길 때, 정해진 그릇보다 더 많은 양을 담으려고 시도하는 오류입니다. 이로 인해 시스템의 중요한 데이터가 읽히거나 엉뚱한 곳에 기록되어 시스템이 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
spi: ch341: fix out-of-bounds memory access in ch341_transfer_one
Discovered by Atuin - Automated Vulnerability Discovery Engine.
The 'len' variable is calculated as 'min(32, trans->len + 1)',
which includes the 1-byte command header.
When copying data from 'trans->tx_buf' to 'ch341->tx_buf + 1', using 'len'
as the length is incorrect because:
1. It causes an out-of-bounds read from 'trans->tx_buf' (which has size
'trans->len', i.e., 'len - 1' in this context).
2. It can cause an out-of-bounds write to 'ch341->tx_buf' if 'len' is
CH341_PACKET_LENGTH (32). Writing 32 bytes to ch341->tx_buf + 1
overflows the buffer.
Fix this by copying 'len - 1' bytes.
📍 영향받는 시스템
Linux kernel (ch341 SPI driver 포함 버전)
⚔️ 공격 벡터
악의적으로 조작된 SPI 통신 패킷을 통해 메모리 경계를 넘어서는 읽기 또는 쓰기 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 ch341_transfer_one 함수의 데이터 복사 로직 수정 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 최신 패치 버전인지 확인