Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2022-49850— nilfs2: fix deadlock in nilfs_count_free_blocks()

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于nilfs2文件系统中nilfs_count_free_blocks函数的信号量死锁问题。

AI Predicted 5.5 Difficulty: Moderate EPSS 0.17% · P5

Possible ATT&CK Techniques 1 AI

T1496 · Resource Hijacking

Affected Version Matrix 18

VendorProduct Version RangeStatus
Linux Linux e828949e5b42bfd234ee537cdb7c5e3a577958a3< 3c89ca6d3dfa6c09c515807a7a97a521f5d5147e affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< 8b4506cff6630bb474bb46a2a75c31e533a756ba affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< f0cc93080d4c09510b74ecba87fd778cca390bb1 affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< 36ff974b0310771417c0be64b64aa221bd70d63d affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< 1d4ff73062096c21b47954d2996b4df259777bda affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< abc082aac0d9b6b926038fc3adb7008306581be2 affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< cb029b54953420f7a2d65100f1c5107f14411bdc affected
e828949e5b42bfd234ee537cdb7c5e3a577958a3< 8ac932a4921a96ca52f61935dbba64ea87bbd5dc affected
… +10 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2022-49850

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
nilfs2: fix deadlock in nilfs_count_free_blocks()
Source: CVE Program / CVE List V5
Vulnerability Description
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().
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于nilfs2文件系统中nilfs_count_free_blocks函数的信号量死锁问题。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux e828949e5b42bfd234ee537cdb7c5e3a577958a3 ~ 3c89ca6d3dfa6c09c515807a7a97a521f5d5147e -
Linux Linux 2.6.38 -

II. Public POCs for CVE-2022-49850

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2022-49850

请登录查看更多情报信息。

Patches & Fixes for CVE-2022-49850 (8)

Same Patch Batch · Linux · 2025-05-01 · 245 CVEs total

CVE-2025-37750 9.8 CRITICAL smb: client: fix UAF in decryption with multichannel
CVE-2025-37778 9.8 CRITICAL ksmbd: Fix dangling pointer in krb_authenticate
CVE-2022-49770 9.8 CRITICAL ceph: avoid putting the realm twice when decoding snaps fails
CVE-2022-49931 8.8 HIGH IB/hfi1: Correctly move list in sc_disable()
CVE-2025-37776 8.8 HIGH ksmbd: fix use-after-free in smb_break_all_levII_oplock()
CVE-2025-37777 8.8 HIGH ksmbd: fix use-after-free in __smb2_lease_break_noti()
CVE-2025-37790 8.8 HIGH net: mctp: Set SOCK_RCU_FREE
CVE-2022-49910 8.8 HIGH Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu
CVE-2022-49886 8.4 HIGH x86/tdx: Panic on bad configs that #VE on "private" memory access
CVE-2025-23159 8.4 HIGH media: venus: hfi: add a check to handle OOB in sfr region
CVE-2025-37749 8.2 HIGH net: ppp: Add bound checking for skb data on ppp_sync_txmung
CVE-2025-37774 7.8 HIGH slab: ensure slab->obj_exts is clear in a newly allocated slab page
CVE-2025-37789 7.8 HIGH net: openvswitch: fix nested key length validation in the set() action
CVE-2025-37779 7.8 HIGH lib/iov_iter: fix to increase non slab folio refcount
CVE-2022-49920 7.8 HIGH netfilter: nf_tables: netlink notifier might race to release objects
CVE-2022-49919 7.8 HIGH netfilter: nf_tables: release flow rule object from commit path
CVE-2025-37756 7.8 HIGH net: tls: explicitly disallow disconnect
CVE-2025-37761 7.8 HIGH drm/xe: Fix an out-of-bounds shift when invalidating TLB
CVE-2025-37763 7.8 HIGH drm/imagination: take paired job reference
CVE-2025-23141 7.8 HIGH KVM: x86: Acquire SRCU in KVM_GET_MP_STATE to protect guest memory accesses

Showing top 20 of 245 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2022-49850

No comments yet


Leave a comment