Vulnerability in dax Package: Flushing Inodes Before Destroying Cache
Summary
GSD-2022-1001541: dax: make sure inodes are flushed before destroy cache. Affects Kernel versions >= 7b6be8444e0f0dd675b54d059793423d3c9b4c03, < f2a1e0eb70c2d954176c07d75d28742bde30e9f3. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The dax package is a component of the Linux Kernel ecosystem. It provides Direct Access (DAX) functionality, allowing applications to directly access persistent memory without the need for traditional file system I/O. This package is responsible for managing inodes, which are data structures that store metadata about files and directories. Inodes are crucial for maintaining file system integrity and ensuring proper access control. However, a vulnerability has been discovered in the dax package that can lead to data corruption and security breaches if not addressed.
Vulnerability Detail
The vulnerability in the dax package arises when inodes are not properly flushed before destroying the cache. This can occur during certain operations, such as unmounting a file system or shutting down the system. If inodes are not flushed before cache destruction, any pending changes to the inodes may be lost, leading to data corruption and potential security vulnerabilities. Attackers could exploit this vulnerability to gain unauthorized access to sensitive information or disrupt the system's functionality. The vulnerability was introduced in version v4.12 of the Linux Kernel and has been fixed in version v5.16.19.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating the Kernel is not immediately feasible, a temporary workaround is to manually flush the inodes before performing operations that involve cache destruction. This can be achieved by executing the following code snippet before unmounting a file system or shutting down the system:
#include <linux/fs.h>
void flush_inodes()
{
struct super_block *sb;
struct inode *inode;
// Iterate through all mounted file systems
sb = get_sb(NULL, NULL);
while (sb != NULL) {
// Iterate through all inodes in the file system
inode = sb->s_root->d_inode;
while (inode != NULL) {
// Flush the inode
flush_inode(inode);
inode = inode->i_sb_next;
}
sb = sb->s_next;
}
}
Conclusion
The vulnerability in the dax package, which arises when inodes are not properly flushed before destroying the cache, can have severe consequences such as data corruption and security breaches. It is crucial to update the Linux Kernel to version v5.16.19 or later to mitigate this vulnerability. If immediate updating is not possible, the provided workaround can be used as a temporary solution. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The dax package is a component of the Linux Kernel ecosystem that provides Direct Access (DAX) functionality. It allows applications to directly access persistent memory without traditional file system I/O.
Inodes are data structures in a file system that store metadata about files and directories. They contain information such as file permissions, ownership, timestamps, and file size.
The vulnerability in the dax package can lead to data corruption and potential security breaches. If inodes are not properly flushed before cache destruction, pending changes to the inodes may be lost, compromising file system integrity and potentially allowing unauthorized access to sensitive information.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.16.19 or later. This update includes a commit that ensures inodes are properly flushed before cache destruction.
If updating the Kernel is not immediately feasible, a temporary workaround is to manually flush the inodes before performing operations that involve cache destruction. Refer to the 'workaround' section for more details.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.