🔍 CVE-2022-50304

5.5
CVSS Score
MEDIUM
2025-09-15
2026-11-05 20:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 mtd 코어에서 init_mtd() 함수 실행 중 init_mtdchar() 실패 시 mtd_bdi가 등록 해제되지 않아 리소스 누수가 발생하는 문제입니다. 이로 인해 mtd 모듈을 다시 로드할 수 없게 되며, 해당 함수의 out_procfs 레이블 이후에 bdi_unregister(mtd_bdi)를 호출하여 수정합니다.

💡 쉬운 설명

메모리 저장장치(MTD) 드라이버를 불러오는 과정에서 오류가 나면 정리 작업이 빠져서, 같은 드라이버를 다시 불러오지 못하는 문제가 생깁니다. 주로 시스템 안정성과 가용성에 영향을 줍니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: mtd: core: fix possible resource leak in init_mtd() I got the error report while inject fault in init_mtd(): sysfs: cannot create duplicate filename '/devices/virtual/bdi/mtd-0' Call Trace: <TASK> dump_stack_lvl+0x67/0x83 sysfs_warn_dup+0x60/0x70 sysfs_create_dir_ns+0x109/0x120 kobject_add_internal+0xce/0x2f0 kobject_add+0x98/0x110 device_add+0x179/0xc00 device_create_groups_vargs+0xf4/0x100 device_create+0x7b/0xb0 bdi_register_va.part.13+0x58/0x2d0 bdi_register+0x9b/0xb0 init_mtd+0x62/0x171 [mtd] do_one_initcall+0x6c/0x3c0 do_init_module+0x58/0x222 load_module+0x268e/0x27d0 __do_sys_finit_module+0xd5/0x140 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> kobject_add_internal failed for mtd-0 with -EEXIST, don't try to register things with the same name in the same directory. Error registering mtd class or bdi: -17 If init_mtdchar() fails in init_mtd(), mtd_bdi will not be unregistered, as a result, we can't load the mtd module again, to fix this by calling bdi_unregister(mtd_bdi) after out_procfs label.

📍 영향받는 시스템

수정 이전의 Linux 커널 (mtd 코어 모듈을 사용하는 시스템)

⚔️ 공격 벡터

로컬 사용자가 모듈 로드 실패 상황을 유도해 리소스 누수 및 모듈 재로드 불가 상태를 만들 수 있음

🛡️ 대응 방법

커널을 해당 CVE 수정이 포함된 최신 안정 버전으로 업데이트

🔧 검증 코드

출력된 커널 버전을 배포판의 보안 공지나 패치 목록과 대조하여 CVE-2022-50304 수정 포함 여부를 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel