🇰🇷 한글 설명
Linux 커널의 PCI pnv_php 드라이버에서, 중첩된 PCIe 브리지 구성의 루트를 제거(unplug)할 때 자식 브리지의 핫플러그 이벤트 알림용 IRQ 리소스가 해제되지 않고 누수되어 커널 패닉이 발생하는 문제를 수정했습니다. 수정 내용은 하위 버스를 순회하며 IRQ를 해제하고, 워크큐의 수명을 슬롯 해제 시점으로 옮기는 것입니다.
💡 쉬운 설명
IBM Power 서버에서 PCIe 장치 연결을 해제할 때 일부 자원이 정리되지 않고 남아, 시스템이 갑자기 멈추는(패닉) 문제가 있었습니다. 이번 수정으로 연결 해제 시 남은 자원을 모두 정리하도록 바뀌었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
PCI: pnv_php: Clean up allocated IRQs on unplug
When the root of a nested PCIe bridge configuration is unplugged, the
pnv_php driver leaked the allocated IRQ resources for the child bridges'
hotplug event notifications, resulting in a panic.
Fix this by walking all child buses and deallocating all its IRQ resources
before calling pci_hp_remove_devices().
Also modify the lifetime of the workqueue at struct pnv_php_slot::wq so
that it is only destroyed in pnv_php_free_slot(), instead of
pnv_php_disable_irq(). This is required since pnv_php_disable_irq() will
now be called by workers triggered by hot unplug interrupts, so the
workqueue needs to stay allocated.
The abridged kernel panic that occurs without this patch is as follows:
WARNING: CPU: 0 PID: 687 at kernel/irq/msi.c:292 msi_device_data_release+0x6c/0x9c
CPU: 0 UID: 0 PID: 687 Comm: bash Not tainted 6.14.0-rc5+ #2
Call Trace:
msi_device_data_release+0x34/0x9c (unreliable)
release_nodes+0x64/0x13c
devres_release_all+0xc0/0x140
device_del+0x2d4/0x46c
pci_destroy_dev+0x5c/0x194
pci_hp_remove_devices+0x90/0x128
pci_hp_remove_devices+0x44/0x128
pnv_php_disable_slot+0x54/0xd4
power_write_file+0xf8/0x18c
pci_slot_attr_store+0x40/0x5c
sysfs_kf_write+0x64/0x78
kernfs_fop_write_iter+0x1b0/0x290
vfs_write+0x3bc/0x50c
ksys_write+0x84/0x140
system_call_exception+0x124/0x230
system_call_vectored_common+0x15c/0x2ec
[bhelgaas: tidy comments]
📍 영향받는 시스템
Linux 커널 PCI pnv_php 드라이버를 사용하는 PowerPC(IBM Power) 기반 시스템의 수정 전 커널 버전
⚔️ 공격 벡터
로컬 권한이 있는 사용자가 중첩된 PCIe 브리지 구성의 슬롯을 sysfs 등을 통해 반복 해제하여 커널 패닉(서비스 거부)을 유발할 수 있습니다.
🛡️ 대응 방법
배포판의 보안 업데이트를 적용하거나, 이 수정이 포함된 Linux 커널 버전으로 업그레이드하십시오.
🔧 검증 코드
출력된 커널 버전이 수정이 반영된 배포판 패치 버전인지 배포판 보안 공지와 대조하고, 'lsmod | grep pnv_php' 결과로 드라이버 로드 여부도 함께 확인하십시오.