🇰🇷 한글 설명
Linux 커널의 s390/ap 버스에서 AP 마스크 업데이트 시 락(lock)을 해제한 후 driver_override 필드에 접근하는 레이스 컨디션 취약점이 발견되었습니다. 이로 인해 동시에 발생하는 driver_override_store() 호출과 충돌하여 Use-After-Free(UAF)가 발생할 수 있습니다.
💡 쉬운 설명
시스템의 특정 장치 설정을 변경하는 과정에서 보안 장치가 제대로 잠기지 않아 발생하는 오류입니다. 공격자가 이 틈을 타서 이미 해제된 메모리에 접근하여 시스템을 조작할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
s390/ap: use generic driver_override infrastructure
When the AP masks are updated via apmask_store() or aqmask_store(),
ap_bus_revise_bindings() is called after ap_attr_mutex has been
released.
This calls __ap_revise_reserved(), which accesses the driver_override
field without holding any lock, racing against a concurrent
driver_override_store() that may free the old string, resulting in a
potential UAF.
Fix this by using the driver-core driver_override infrastructure, which
protects all accesses with an internal spinlock.
Note that unlike most other buses, the AP bus does not check
driver_override in its match() callback; the override is checked in
ap_device_probe() and __ap_revise_reserved() instead.
Also note that we do not enable the driver_override feature of struct
bus_type, as AP - in contrast to most other buses - passes "" to
sysfs_emit() when the driver_override pointer is NULL. Thus, printing
"\n" instead of "(null)\n".
Additionally, AP has a custom counter that is modified in the
corresponding custom driver_override_store().
📍 영향받는 시스템
Linux kernel (s390/ap architecture)
⚔️ 공격 벡터
동시적인 driver_override 설정 변경을 통한 레이스 컨디션 유도 및 Use-After-Free 공격
🛡️ 대응 방법
커널을 최신 버전으로 업데이트하여 driver_core의 driver_override 인프라를 사용하도록 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인