CVE-2022-49850
- 공개
- 2025년 5월 2일
- 수정
- 2026년 6월 17일
- 조회
- 0
- 상태
- Modified
개요
이 취약점이 무엇인지
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix deadlock in nilfs_count_free_blocks()
A semaphore deadlock can occur if nilfs_get_block() detects metadata corruption while locating data blocks and a superblock writeback occurs at the same time:
task 1 task 2 ------ ------ * A file operation * nilfs_truncate() nilfs_get_block() down_read(rwsem A) <-- nilfs_bmap_lookup_contig() ... generic_shutdown_super() nilfs_put_super() * Prepare to write superblock * down_write(rwsem B) <-- nilfs_cleanup_super() * Detect b-tree corruption * nilfs_set_log_cursor() nilfs_bmap_convert_error() nilfs_count_free_blocks() __nilfs_error() down_read(rwsem A) <-- nilfs_set_error() down_write(rwsem B) <--
*** DEADLOCK ***
Here, nilfs_get_block() readlocks rwsem A (= NILFS_MDT(dat_inode)->mi_sem) and then calls nilfs_bmap_lookup_contig(), but if it fails due to metadata corruption, __nilfs_error() is called from nilfs_bmap_convert_error() inside the lock section.
Since __nilfs_error() calls nilfs_set_error() unless the filesystem is read-only and nilfs_set_error() attempts to writelock rwsem B (= nilfs->ns_sem) to write back superblock exclusively, hierarchical lock acquisition occurs in the order rwsem A -> rwsem B.
Now, if another task starts updating the superblock, it may writelock rwsem B during the lock sequence above, and can deadlock trying to readlock rwsem A in nilfs_count_free_blocks().
However, there is actually no need to take rwsem A in nilfs_count_free_blocks() because it, within the lock section, only reads a single integer data on a shared struct with nilfs_sufile_get_ncleansegs(). This has been the case after commit aa474a220180 ("nilfs2: add local variable to cache the number of clean segments"), that is, even before this bug was introduced.
So, this resolves the deadlock problem by just not taking the semaphore in nilfs_count_free_blocks().
실제 악용 사례 · 아직 확인된 사례가 없어요
CISA의 KEV 카탈로그(실제 공격에 악용된 취약점 목록)에 아직 올라와 있지 않아요. 다만 ‘앞으로도 안전하다’는 뜻은 아니니 심각도와 EPSS를 함께 확인하세요.
패치 현황
어떤 버전이 위험하고, 몇 버전으로 올리면 되는지
| 제품 | 시작 | 끝 | 이 버전 이상으로 | |||
|---|---|---|---|---|---|---|
| linux_kernellinux | 2.6.38 | ≤ | 취약 | < | 4.9.334 | 4.9.334이상 |
| 4.10 | ≤ | 취약 | < | 4.14.300 | 4.14.300이상 | |
| 4.15 | ≤ | 취약 | < | 4.19.267 | 4.19.267이상 | |
| 4.20 | ≤ | 취약 | < | 5.4.225 | 5.4.225이상 | |
| 5.5 | ≤ | 취약 | < | 5.10.155 | 5.10.155이상 | |
| 5.11 | ≤ | 취약 | < | 5.15.79 | 5.15.79이상 | |
| 5.16 | ≤ | 취약 | < | 6.0.9 | 6.0.9이상 | |
| 이 버전만 | 취약 | = | 6.1 rc1 | 벤더 공지 확인 | ||
| 이 버전만 | 취약 | = | 6.1 rc2 | 벤더 공지 확인 | ||
| 이 버전만 | 취약 | = | 6.1 rc3 | 벤더 공지 확인 | ||
| 이 버전만 | 취약 | = | 6.1 rc4 | 벤더 공지 확인 | ||
NVD 분석 기준. 시작과 끝 사이 버전이 취약해요. ‘이 버전 이상으로’는 끝이 ‘<’로 적힌 경우에만 알 수 있어요.
할당 기관(CNA)이 적은 버전 10줄도 보기
| 제품 | 시작 | 끝 | 이 버전 이상으로 | |||
|---|---|---|---|---|---|---|
| LinuxLinux | 이 버전만 | 취약 | = | 2.6.38 | 벤더 공지 확인 | |
| 최초 버전 | ≤ | 영향 없음 | < | 2.6.38 | — | |
| 4.9.334 | ≤ | 영향 없음 | ≤ | 4.9.* | — | |
| 4.14.300 | ≤ | 영향 없음 | ≤ | 4.14.* | — | |
| 4.19.267 | ≤ | 영향 없음 | ≤ | 4.19.* | — | |
| 5.4.225 | ≤ | 영향 없음 | ≤ | 5.4.* | — | |
| 5.10.155 | ≤ | 영향 없음 | ≤ | 5.10.* | — | |
| 5.15.79 | ≤ | 영향 없음 | ≤ | 5.15.* | — | |
| 6.0.9 | ≤ | 영향 없음 | ≤ | 6.0.* | — | |
| 6.1 | ≤ | 영향 없음 | ≤ | 최신 버전 | — | |
참고 링크
NVD에 등록된 외부 자료예요. 익스플로잇·벤더 공지·패치 순으로 먼저 보여줘요.
패치8
- git.kernel.org/stable/c/1d4ff73062096c21b47954d2996b4df259777bda
- git.kernel.org/stable/c/36ff974b0310771417c0be64b64aa221bd70d63d
- git.kernel.org/stable/c/3c89ca6d3dfa6c09c515807a7a97a521f5d5147e
- git.kernel.org/stable/c/8ac932a4921a96ca52f61935dbba64ea87bbd5dc
- git.kernel.org/stable/c/8b4506cff6630bb474bb46a2a75c31e533a756ba