🇰🇷 한글 설명
Linux 커널의 pmbus 하드웨어 모니터링 드라이버에서 타입 혼동(Type Confusion) 취약점이 발견되었습니다. 특정 속성을 sensor_device_attribute로 잘못 캐스팅하여 메모리 경계를 벗어난 읽기(Slab-out-of-bounds read)가 발생하거나 잘못된 데이터가 처리될 수 있습니다.
💡 쉬운 설명
컴퓨터 부품의 상태를 체크하는 프로그램이 데이터의 종류를 착각하여 엉뚱한 메모리 영역을 읽으려 하는 문제입니다. 이로 인해 시스템 정보가 유출되거나 잘못된 경고가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (pmbus) Fix type confusion in notification logic
Sashiko reports:
At the start of the loop in pmbus_notify(), the code unconditionally casts
every attribute to a struct sensor_device_attribute:
drivers/hwmon/pmbus/pmbus_core.c:pmbus_notify() {
for (i = 0; i < data->num_attributes; i++) {
struct device_attribute *da = to_dev_attr(data->group.attrs[i]);
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
int index = attr->index;
...
}
However, data->group.attrs can contain other types like struct
pmbus_samples_reg or struct pmbus_sensor, which only embed a base
struct device_attribute.
If da is a struct pmbus_samples_reg, dev_attr is the last member. Casting
it to struct sensor_device_attribute and reading the index field appears
to access memory past the end of the allocation, which might trigger a
slab-out-of-bounds read.
Additionally, if da is a struct pmbus_sensor, casting it causes the index
field to overlap with the page, phase, and reg fields. Could this produce
a garbage mask on little-endian systems that spuriously matches the target
reg, page, and flags during an alert?
Fix the problem by using struct sensor_device_attr in struct pmbus_sensor
and struct pmbus_label. Since those attributes never trigger a
notification, set the value of attr->index to -1 for them. Use this value
to distinguish from boolean attributes which _can_ trigger a notification
and use the index field to encode mask, page, and register values.
📍 영향받는 시스템
Linux Kernel (pmbus driver 포함 버전)
⚔️ 공격 벡터
특수하게 조작된 pmbus 속성을 통해 메모리 경계 외 영역을 읽거나 잘못된 데이터 처리를 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인