🇰🇷 한글 설명
리눅스 커널의 regmap-irq 구성 요소에서 설정 버퍼를 할당할 때 범위를 벗어난 메모리 접근(Out-of-bounds access)이 발생하는 취약점입니다. IRQ 유형 레지스터를 처리하기 위한 2차원 배열 할당 과정에서 루프 조건 오류로 인해 잘못된 메모리 영역에 쓰기 작업이 수행될 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 부품인 리눅스 커널이 데이터를 저장할 공간을 만들 때, 계산 실수로 정해진 크기보다 더 많은 데이터를 넣으려고 시도하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 데이터가 깨지는 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
regmap-irq: Fix out-of-bounds access when allocating config buffers
When allocating the 2D array for handling IRQ type registers in
regmap_add_irq_chip_fwnode(), the intent is to allocate a matrix
with num_config_bases rows and num_config_regs columns.
This is currently handled by allocating a buffer to hold a pointer for
each row (i.e. num_config_bases). After that, the logic attempts to
allocate the memory required to hold the register configuration for
each row. However, instead of doing this allocation for each row
(i.e. num_config_bases allocations), the logic erroneously does this
allocation num_config_regs number of times.
This scenario can lead to out-of-bounds accesses when num_config_regs
is greater than num_config_bases. Fix this by updating the terminating
condition of the loop that allocates the memory for holding the register
configuration to allocate memory only for each row in the matrix.
Amit Pundir reported a crash that was occurring on his db845c device
due to memory corruption (see "Closes" tag for Amit's report). The KASAN
report below helped narrow it down to this issue:
[ 14.033877][ T1] ==================================================================
[ 14.042507][ T1] BUG: KASAN: invalid-access in regmap_add_irq_chip_fwnode+0x594/0x1364
[ 14.050796][ T1] Write of size 8 at addr 06ffff8081021850 by task init/1
[ 14.242004][ T1] The buggy address belongs to the object at ffffff8081021850
[ 14.242004][ T1] which belongs to the cache kmalloc-8 of size 8
[ 14.255669][ T1] The buggy address is located 0 bytes inside of
[ 14.255669][ T1] 8-byte region [ffffff8081021850, ffffff8081021858)
📍 영향받는 시스템
Linux Kernel (regmap-irq 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 조작된 하드웨어 구성(fwnode)을 통해 커널 메모리 오염 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.