🇰🇷 한글 설명
Linux 커널의 PCI 엔드포인트 unlink 함수들에서 구조체 콜백의 정의와 다르게 매개변수가 반대 순서로 전달됩니다. configfs를 통한 unlink 명령 실행 시 커널 페이징 에러로 인한 시스템 충돌이 발생합니다.
💡 쉬운 설명
Linux 커널 내부의 특정 함수가 잘못된 메모리 주소를 접근하도록 매개변수를 받으면서 시스템 오류를 일으킵니다. 로컬 사용자가 특정 파일 작업을 시도할 때 커널이 충돌할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions
struct configfs_item_operations callbacks are defined like the following:
int (*allow_link)(struct config_item *src, struct config_item *target);
void (*drop_link)(struct config_item *src, struct config_item *target);
While pci_primary_epc_epf_link() and pci_secondary_epc_epf_link() specify
the parameters in the correct order, pci_primary_epc_epf_unlink() and
pci_secondary_epc_epf_unlink() specify the parameters in the wrong order,
leading to the below kernel crash when using the unlink command in
configfs:
Unable to handle kernel paging request at virtual address 0000000300000857
Mem abort info:
...
pc : string+0x54/0x14c
lr : vsnprintf+0x280/0x6e8
...
string+0x54/0x14c
vsnprintf+0x280/0x6e8
vprintk_default+0x38/0x4c
vprintk+0xc4/0xe0
pci_epf_unbind+0xdc/0x108
configfs_unlink+0xe0/0x208+0x44/0x74
vfs_unlink+0x120/0x29c
__arm64_sys_unlinkat+0x3c/0x90
invoke_syscall+0x48/0x134
do_el0_svc+0x1c/0x30prop.0+0xd0/0xf0
[mani: cced stable, changed commit message as per https://lore.kernel.org/linux-pci/aV9joi3jF1R6ca02@ryzen]
📍 영향받는 시스템
Linux kernel (configfs를 통한 PCI 엔드포인트 사용 환경, 커널 버전 미지정)
⚔️ 공격 벡터
로컬: configfs unlink 명령 실행을 통한 Denial of Service (커널 패닉)
🛡️ 대응 방법
Linux 커널을 최신 보안 패치 버전으로 업데이트하거나 커널 패치 적용
🔧 검증 코드
함수 정의에서 매개변수 순서가 (src, target) 순서인지 확인합니다. 패치된 버전은 순서가 올바르게 정렬되어 있습니다.
grep -A 10 'pci_primary_epc_epf_unlink\|pci_secondary_epc_epf_unlink' /usr/src/linux/drivers/pci/endpoint/*.c 2>/dev/null | head -20