🇰🇷 한글 설명
Linux 커널의 TEE(Trusted Execution Environment) 서브시스템 register_shm_helper() 함수에서 사용자 공간이 제공한 특수한 길이 값으로 인해 정수 오버플로우가 발생합니다. 이로 인해 pin_user_pages_fast() 호출 과정에서 NULL 포인터 역참조가 일어나 커널 패닉이 발생할 수 있습니다. 수정은 tee_shm_register_user_buf()에 access_ok() 검사를 추가하여 잘못된 사용자 주소를 조기에 차단하는 것입니다.
💡 쉬운 설명
사용자 프로그램이 특정 크기의 메모리 값을 보내면 커널 내부 계산이 넘쳐서 시스템이 비정상 종료될 수 있는 문제입니다. 주소 유효성 검사를 추가해 잘못된 값을 미리 걸러내도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tee: add overflow check in register_shm_helper()
With special lengths supplied by user space, register_shm_helper() has
an integer overflow when calculating the number of pages covered by a
supplied user space memory region.
This causes internal_get_user_pages_fast() a helper function of
pin_user_pages_fast() to do a NULL pointer dereference:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
Modules linked in:
CPU: 1 PID: 173 Comm: optee_example_a Not tainted 5.19.0 #11
Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
pc : internal_get_user_pages_fast+0x474/0xa80
Call trace:
internal_get_user_pages_fast+0x474/0xa80
pin_user_pages_fast+0x24/0x4c
register_shm_helper+0x194/0x330
tee_shm_register_user_buf+0x78/0x120
tee_ioctl+0xd0/0x11a0
__arm64_sys_ioctl+0xa8/0xec
invoke_syscall+0x48/0x114
Fix this by adding an an explicit call to access_ok() in
tee_shm_register_user_buf() to catch an invalid user space address
early.
📍 영향받는 시스템
패치 이전의 Linux 커널 (TEE 서브시스템을 사용하는 OP-TEE 환경 등)
⚔️ 공격 벡터
로컬 사용자가 TEE 드라이버의 ioctl 호출에 조작된 길이 값을 전달하여 커널 NULL 포인터 역참조를 유발
🛡️ 대응 방법
배포판 제공 최신 커널로 업데이트하거나 CVE-2022-50080 수정이 포함된 커널 버전으로 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지에서 CVE-2022-50080 수정이 포함된 커널 버전과 비교하여, 같거나 이후 버전이면 패치된 것입니다.