🇰🇷 한글 설명
Linux 커널 perf 서브시스템에서 SIGTRAP 누락 검사 로직이 개선되었습니다. 기존 WARN 검사는 IRQ 작업 실행 전에 발생한 인터럽트(예: hrtimer)로 인해 누락을 놓칠 수 있었으며, 이를 현재 IP의 해시값을 저장해 실제 사용자 공간 진행 여부를 확인하도록 수정했습니다.
💡 쉬운 설명
리눅스 커널의 성능 측정 기능에서 신호 전달이 누락되는 경우를 더 정확히 감지하도록 개선한 패치입니다. 이로 인해 잘못된 경고 및 커널 동작 문제를 줄일 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf: Improve missing SIGTRAP checking
To catch missing SIGTRAP we employ a WARN in __perf_event_overflow(),
which fires if pending_sigtrap was already set: returning to user space
without consuming pending_sigtrap, and then having the event fire again
would re-enter the kernel and trigger the WARN.
This, however, seemed to miss the case where some events not associated
with progress in the user space task can fire and the interrupt handler
runs before the IRQ work meant to consume pending_sigtrap (and generate
the SIGTRAP).
syzbot gifted us this stack trace:
| WARNING: CPU: 0 PID: 3607 at kernel/events/core.c:9313 __perf_event_overflow
| Modules linked in:
| CPU: 0 PID: 3607 Comm: syz-executor100 Not tainted 6.1.0-rc2-syzkaller-00073-g88619e77b33d #0
| Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
| RIP: 0010:__perf_event_overflow+0x498/0x540 kernel/events/core.c:9313
| <...>
| Call Trace:
| <TASK>
| perf_swevent_hrtimer+0x34f/0x3c0 kernel/events/core.c:10729
| __run_hrtimer kernel/time/hrtimer.c:1685 [inline]
| __hrtimer_run_queues+0x1c6/0xfb0 kernel/time/hrtimer.c:1749
| hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811
| local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1096 [inline]
| __sysvec_apic_timer_interrupt+0x17c/0x640 arch/x86/kernel/apic/apic.c:1113
| sysvec_apic_timer_interrupt+0x40/0xc0 arch/x86/kernel/apic/apic.c:1107
| asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649
| <...>
| </TASK>
In this case, syzbot produced a program with event type
PERF_TYPE_SOFTWARE and config PERF_COUNT_SW_CPU_CLOCK. The hrtimer
manages to fire again before the IRQ work got a chance to run, all while
never having returned to user space.
Improve the WARN to check for real progress in user space: approximate
this by storing a 32-bit hash of the current IP into pending_sigtrap,
and if an event fires while pending_sigtrap still matches the previous
IP, we assume no progress (false negatives are possible given we could
return to user space and trigger again on the same IP).
📍 영향받는 시스템
수정 이전 버전의 Linux 커널 (perf 서브시스템 사용 환경)
⚔️ 공격 벡터
로컬 사용자가 PERF_TYPE_SOFTWARE 이벤트를 생성해 hrtimer 인터럽트가 IRQ 작업 전에 반복 발생하도록 유도하는 방식으로 커널 경고를 트리거할 수 있음
🛡️ 대응 방법
배포판에서 제공하는 최신 커널 보안 업데이트를 적용하고 재부팅하십시오.
🔧 검증 코드
출력된 커널 버전이 배포판의 수정 버전(또는 해당 패치가 포함된 이후 버전) 이상인지 배포판 보안 공지와 대조하여 확인하십시오.