🇰🇷 한글 설명
Linux 커널의 perf sched 구성 요소에서 정수 오버플로, 힙 버퍼 오버플로 및 메모리 할당 실패 시의 부적절한 오류 처리 취약점이 발견되었습니다. 신뢰할 수 없는 perf.data 파일을 처리할 때 발생하며, 이는 시스템의 안정성을 해치거나 임의 코드 실행으로 이어질 수 있습니다.
💡 쉬운 설명
조작된 성능 데이터 파일을 읽을 때 컴퓨터의 메모리 계산 오류를 일으켜 시스템을 멈추게 하거나 해커가 침입할 수 있는 구멍이 있는 상태입니다. 이를 방지하기 위해 데이터의 크기를 제한하고 안전한 복사 방식을 사용하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf sched: Fix register_pid() overflow, strcpy, and BUG_ON
register_pid() has several issues when processing untrusted perf.data:
1. Integer overflow: (pid + 1) * sizeof(struct task_desc *) can wrap
to a small value on 32-bit systems when pid is large (e.g.
0x40000000), causing realloc to return a tiny buffer followed by
out-of-bounds writes in the initialization loop.
2. Heap buffer overflow: strcpy(task->comm, comm) copies the
untrusted comm string into a fixed 20-byte COMM_LEN buffer with
no length check.
3. BUG_ON on allocation failure: perf.data is untrusted input, so
allocation failures should be handled gracefully rather than
killing the process.
4. Realloc of sched->tasks assigned directly back, leaking the old
pointer on failure; nr_tasks incremented before the realloc,
leaving corrupted state on failure.
Cap pid at PID_MAX_LIMIT (4194304, matching the kernel's maximum
on 64-bit), replace strcpy with strlcpy, guard against NULL comm,
replace BUG_ON with NULL returns using safe realloc patterns, and
add NULL checks in callers that dereference the result.
📍 영향받는 시스템
Linux kernel (perf sched 구성 요소 포함 버전)
⚔️ 공격 벡터
조작된 perf.data 파일을 시스템에 로드하여 커널 메모리 오버플로 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인