🇰🇷 한글 설명
Linux 커널의 loop 드라이버에서 사용자 공간이 loop 장치 설정 시 lo_offset 값에 대한 오버플로우 검사가 누락되어 있었습니다. 음수 오프셋이 그대로 전달되어 iomap 계층에서 커널 경고(WARN_ON_ONCE)가 발생할 수 있었으며, 이를 막기 위해 loop_set_status_from_info()에서 음수 값을 검사하도록 수정되었습니다.
💡 쉬운 설명
리눅스 시스템에서 가상 디스크(loop 장치)를 설정할 때 잘못된 위치 값을 검사하지 않던 문제입니다. 이로 인해 시스템에 경고가 발생하거나 불안정해질 수 있어 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
loop: Check for overflow while configuring loop
The userspace can configure a loop using an ioctl call, wherein
a configuration of type loop_config is passed (see lo_ioctl()'s
case on line 1550 of drivers/block/loop.c). This proceeds to call
loop_configure() which in turn calls loop_set_status_from_info()
(see line 1050 of loop.c), passing &config->info which is of type
loop_info64*. This function then sets the appropriate values, like
the offset.
loop_device has lo_offset of type loff_t (see line 52 of loop.c),
which is typdef-chained to long long, whereas loop_info64 has
lo_offset of type __u64 (see line 56 of include/uapi/linux/loop.h).
The function directly copies offset from info to the device as
follows (See line 980 of loop.c):
lo->lo_offset = info->lo_offset;
This results in an overflow, which triggers a warning in iomap_iter()
due to a call to iomap_iter_done() which has:
WARN_ON_ONCE(iter->iomap.offset > iter->pos);
Thus, check for negative value during loop_set_status_from_info().
Bug report: https://syzkaller.appspot.com/bug?id=c620fe14aac810396d3c3edc9ad73848bf69a29e
📍 영향받는 시스템
패치 이전의 Linux 커널 (loop 드라이버를 포함한 일반 리눅스 배포판 전반)
⚔️ 공격 벡터
로컬 사용자가 loop 장치 설정 ioctl에 잘못된 음수 오프셋 값을 전달하여 커널 경고를 유발
🛡️ 대응 방법
배포판 벤더가 제공하는 최신 커널 보안 업데이트를 적용하고 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판의 보안 권고문과 대조하여 CVE-2022-49993 수정이 포함된 빌드인지 확인하며, 배포판 패키지 changelog에서 해당 CVE 번호가 있는지도 함께 확인합니다.