🇰🇷 한글 설명
Linux 커널의 UltraSPARC III 아키텍처에서 copy_from_user 및 copy_to_user 함수가 예외 발생 시 잘못된 값을 반환하는 취약점이 발견되었습니다. 이로 인해 ext4 코드에서 복사하려는 크기보다 더 큰 값이 반환되어 BUG_ON 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 데이터를 복사하다가 오류가 났을 때, 얼마나 복사했는지 정확히 계산하지 못해 시스템이 멈추거나 오작동할 수 있는 문제입니다. 특히 특정 하드웨어 환경에서 데이터 처리 과정의 계산 오류로 인해 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III
Anthony Yznaga tracked down that a BUG_ON in ext4 code with large folios
enabled resulted from copy_from_user() returning impossibly large values
greater than the size to be copied. This lead to __copy_from_iter()
returning impossible values instead of the actual number of bytes it was
able to copy.
The BUG_ON has been reported in
https://lore.kernel.org/r/b14f55642207e63e907965e209f6323a0df6dcee.camel@physik.fu-berlin.de
The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. The exception handlers expect that
%o2 has already been masked during the bulk copy loop, but the masking was
performed after that loop. This will fix the return value of copy_from_user
and copy_to_user in the faulting case. The behaviour of memcpy stays
unchanged.
📍 영향받는 시스템
UltraSPARC III 아키텍처를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
사용자 공간 메모리 참조 시 예외를 유도하여 잘못된 반환값을 생성하는 방식
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 이후의 버전인지 확인