🇰🇷 한글 설명
Linux 커널의 null_blk 드라이버에서 장치 전원을 껐다 켤 때 메모리 누수가 발생하는 취약점입니다. 장치 전원 종료 시 할당된 zones 배열을 해제하지 않아, 전원 사이클이 반복될수록 메모리 점유율이 계속 높아지는 문제가 있습니다.
💡 쉬운 설명
컴퓨터를 껐다 켤 때마다 사용했던 메모리를 제대로 반납하지 않아 컴퓨터의 메모리가 조금씩 낭비되는 문제입니다. 이 현상이 반복되면 결국 시스템의 메모리가 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
null_blk: free zones array on device power-off
null_init_zoned_dev() allocates dev->zones when a zoned device is powered
on, but null_del_dev() never frees it on power-off; dev->zones is only
freed later in null_free_dev(), when the configfs directory is removed. If
the device is powered off and then on again, null_init_zoned_dev()
allocates a new array and overwrites the dev->zones pointer, leaking the
previous allocation each power cycle.
Free dev->zones in null_del_dev() via null_free_zoned_dev() to solve it.
And calling null_free_zoned_dev() in null_free_dev() is no longer necessary
because every caller already invokes null_del_dev() first: via
nullb_group_drop_item() before nullb_device_release(), in the
null_add_dev() error path of null_create_dev(), and in null_destroy_dev().
Remove the redundant call.
And take &lock around zone_cond_store() in the two store wrappers to
serialize dev->zones check-and-deref against its alloc/free, which already
run under &lock. The reason there was no problem before is that only
nullb_device_release() or null_exit() frees the dev->zones, which
guarantees that subsequent users won't access the configfs interface.
📍 영향받는 시스템
Linux kernel (null_blk driver component)
⚔️ 공격 벡터
로컬 사용자가 장치의 전원 상태를 반복적으로 변경하여 메모리 고갈 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인