🇰🇷 한글 설명
Linux 커널의 usb gadget f_eem 드라이버에서 net_device의 생명주기 관리 오류가 발견되었습니다. 장치 언바인드 시 부모 장치는 파괴되지만 net_device가 남아 있어 sysfs에 유효하지 않은 심볼릭 링크가 생성되는 문제입니다. 이를 해결하기 위해 device_move()를 사용하여 장치 트리 간의 부모 관계를 적절히 재설정하도록 수정되었습니다.
💡 쉬운 설명
USB 장치를 연결하거나 해제할 때 시스템 내부의 연결 정보가 제대로 정리되지 않아 찌꺼기 정보가 남는 문제입니다. 이로 인해 시스템이 실제 존재하지 않는 장치 경로를 참조하려고 시도할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_eem: Fix net_device lifecycle with device_move
The net_device is allocated during function instance creation and
registered during the bind phase with the gadget device as its sysfs
parent. When the function unbinds, the parent device is destroyed, but
the net_device survives, resulting in dangling sysfs symlinks:
console:/ # ls -l /sys/class/net/usb0
lrwxrwxrwx ... /sys/class/net/usb0 ->
/sys/devices/platform/.../gadget.0/net/usb0
console:/ # ls -l /sys/devices/platform/.../gadget.0/net/usb0
ls: .../gadget.0/net/usb0: No such file or directory
Use device_move() to reparent the net_device between the gadget device
tree and /sys/devices/virtual across bind and unbind cycles. During the
final unbind, calling device_move(NULL) moves the net_device to the
virtual device tree before the gadget device is destroyed. On rebinding,
device_move() reparents the device back under the new gadget, ensuring
proper sysfs topology and power management ordering.
To maintain compatibility with legacy composite drivers (e.g., multi.c),
the bound flag is used to indicate whether the network device is shared
and pre-registered during the legacy driver's bind phase.
📍 영향받는 시스템
Linux kernel (usb gadget f_eem driver component)
⚔️ 공격 벡터
로컬 시스템에서 USB gadget 장치의 bind/unbind를 반복하여 sysfs 구조를 불안정하게 만듦
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인