Linux Kernel up to 6.0.8 nilfs_count_free_blocks deadlock

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
4.6$0-$5k0.00

Summaryinfo

A vulnerability has been found in Linux Kernel up to 6.0.8 and classified as critical. This vulnerability affects the function nilfs_count_free_blocks. The manipulation leads to deadlock. This vulnerability is traded as CVE-2022-49850. There is no exploit available. The affected component should be upgraded.

Detailsinfo

A vulnerability was found in Linux Kernel up to 6.0.8. It has been rated as critical. This issue affects the function nilfs_count_free_blocks. The manipulation with an unknown input leads to a deadlock vulnerability. Using CWE to declare the problem leads to CWE-833. The product contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in deadlock. Impacted is availability. The summary by CVE is:

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().

It is possible to read the advisory at git.kernel.org. The identification of this vulnerability is CVE-2022-49850 since 05/01/2025. The exploitation is known to be difficult. Technical details of the vulnerability are known, but there is no available exploit.

Upgrading to version 4.9.334, 4.14.300, 4.19.267, 5.4.225, 5.10.155, 5.15.79 or 6.0.9 eliminates this vulnerability. Applying the patch 3c89ca6d3dfa6c09c515807a7a97a521f5d5147e/8b4506cff6630bb474bb46a2a75c31e533a756ba/f0cc93080d4c09510b74ecba87fd778cca390bb1/36ff974b0310771417c0be64b64aa221bd70d63d/1d4ff73062096c21b47954d2996b4df259777bda/abc082aac0d9b6b926038fc3adb7008306581be2/cb029b54953420f7a2d65100f1c5107f14411bdc/8ac932a4921a96ca52f61935dbba64ea87bbd5dc is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.

Be aware that VulDB is the high quality source for vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 4.8
VulDB Meta Temp Score: 4.6

VulDB Base Score: 4.8
VulDB Temp Score: 4.6
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Deadlock
CWE: CWE-833 / CWE-404
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Partially

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: Kernel 4.9.334/4.14.300/4.19.267/5.4.225/5.10.155/5.15.79/6.0.9
Patch: 3c89ca6d3dfa6c09c515807a7a97a521f5d5147e/8b4506cff6630bb474bb46a2a75c31e533a756ba/f0cc93080d4c09510b74ecba87fd778cca390bb1/36ff974b0310771417c0be64b64aa221bd70d63d/1d4ff73062096c21b47954d2996b4df259777bda/abc082aac0d9b6b926038fc3adb7008306581be2/cb029b54953420f7a2d65100f1c5107f14411bdc/8ac932a4921a96ca52f61935dbba64ea87bbd5dc

Timelineinfo

05/01/2025 🔍
05/01/2025 +0 days 🔍
05/01/2025 +0 days 🔍
05/01/2025 +0 days 🔍

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2022-49850 (🔍)
GCVE (CVE): GCVE-0-2022-49850
GCVE (VulDB): GCVE-100-307079

Entryinfo

Created: 05/01/2025 19:06
Changes: 05/01/2025 19:06 (58)
Complete: 🔍
Cache ID: 216::103

Be aware that VulDB is the high quality source for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!