cvelist/2024/47xxx/CVE-2024-47741.json

124 lines
7.8 KiB
JSON
Raw Normal View History

2024-09-30 17:00:36 +00:00
{
2024-10-21 13:00:49 +00:00
"data_version": "4.0",
2024-09-30 17:00:36 +00:00
"data_type": "CVE",
"data_format": "MITRE",
"CVE_data_meta": {
"ID": "CVE-2024-47741",
2024-10-21 13:00:49 +00:00
"ASSIGNER": "cve@kernel.org",
"STATE": "PUBLIC"
2024-09-30 17:00:36 +00:00
},
"description": {
"description_data": [
{
"lang": "eng",
2024-10-21 13:00:49 +00:00
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix race setting file private on concurrent lseek using same fd\n\nWhen doing concurrent lseek(2) system calls against the same file\ndescriptor, using multiple threads belonging to the same process, we have\na short time window where a race happens and can result in a memory leak.\n\nThe race happens like this:\n\n1) A program opens a file descriptor for a file and then spawns two\n threads (with the pthreads library for example), lets call them\n task A and task B;\n\n2) Task A calls lseek with SEEK_DATA or SEEK_HOLE and ends up at\n file.c:find_desired_extent() while holding a read lock on the inode;\n\n3) At the start of find_desired_extent(), it extracts the file's\n private_data pointer into a local variable named 'private', which has\n a value of NULL;\n\n4) Task B also calls lseek with SEEK_DATA or SEEK_HOLE, locks the inode\n in shared mode and enters file.c:find_desired_extent(), where it also\n extracts file->private_data into its local variable 'private', which\n has a NULL value;\n\n5) Because it saw a NULL file private, task A allocates a private\n structure and assigns to the file structure;\n\n6) Task B also saw a NULL file private so it also allocates its own file\n private and then assigns it to the same file structure, since both\n tasks are using the same file descriptor.\n\n At this point we leak the private structure allocated by task A.\n\nBesides the memory leak, there's also the detail that both tasks end up\nusing the same cached state record in the private structure (struct\nbtrfs_file_private::llseek_cached_state), which can result in a\nuse-after-free problem since one task can free it while the other is\nstill using it (only one task took a reference count on it). Also, sharing\nthe cached state is not a good idea since it could result in incorrect\nresults in the future - right now it should not be a problem because it\nend ups being used only in extent-io-tree.c:count_range_bits() where we do\nrange validation before using the cached state.\n\nFix this by protecting the private assignment and check of a file while\nholding the inode's spinlock and keep track of the task that allocated\nthe private, so that it's used only by that task in order to prevent\nuser-after-free issues with the cached state record as well as potentially\nusing it incorrectly in the future."
}
]
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "n/a"
}
]
2024-09-30 17:00:36 +00:00
}
]
2024-10-21 13:00:49 +00:00
},
"affects": {
"vendor": {
"vendor_data": [
{
"vendor_name": "Linux",
"product": {
"product_data": [
{
"product_name": "Linux",
"version": {
"version_data": [
{
"version_affected": "<",
"version_name": "3c32c7212f16",
"version_value": "f56a6d9c267e"
},
{
"version_value": "not down converted",
"x_cve_json_5_version_data": {
"versions": [
{
"version": "6.2",
"status": "affected"
},
{
"version": "0",
"lessThan": "6.2",
"status": "unaffected",
2024-11-05 11:00:32 +00:00
"versionType": "semver"
2024-10-21 13:00:49 +00:00
},
{
"version": "6.6.54",
"lessThanOrEqual": "6.6.*",
"status": "unaffected",
2024-11-05 11:00:32 +00:00
"versionType": "semver"
2024-10-21 13:00:49 +00:00
},
{
"version": "6.10.13",
"lessThanOrEqual": "6.10.*",
"status": "unaffected",
2024-11-05 11:00:32 +00:00
"versionType": "semver"
2024-10-21 13:00:49 +00:00
},
{
"version": "6.11.2",
"lessThanOrEqual": "6.11.*",
"status": "unaffected",
2024-11-05 11:00:32 +00:00
"versionType": "semver"
2024-10-21 13:00:49 +00:00
},
{
2024-11-18 16:00:33 +00:00
"version": "6.12",
2024-10-21 13:00:49 +00:00
"lessThanOrEqual": "*",
"status": "unaffected",
"versionType": "original_commit_for_fix"
}
],
"defaultStatus": "affected"
}
}
]
}
}
]
}
}
]
}
},
"references": {
"reference_data": [
{
"url": "https://git.kernel.org/stable/c/f56a6d9c267ec7fa558ede7755551c047b1034cd",
"refsource": "MISC",
"name": "https://git.kernel.org/stable/c/f56a6d9c267ec7fa558ede7755551c047b1034cd"
},
{
"url": "https://git.kernel.org/stable/c/a412ca489ac27b9d0e603499315b7139c948130d",
"refsource": "MISC",
"name": "https://git.kernel.org/stable/c/a412ca489ac27b9d0e603499315b7139c948130d"
},
{
"url": "https://git.kernel.org/stable/c/33d1310d4496e904123dab9c28b2d8d2c1800f97",
"refsource": "MISC",
"name": "https://git.kernel.org/stable/c/33d1310d4496e904123dab9c28b2d8d2c1800f97"
},
{
"url": "https://git.kernel.org/stable/c/7ee85f5515e86a4e2a2f51969795920733912bad",
"refsource": "MISC",
"name": "https://git.kernel.org/stable/c/7ee85f5515e86a4e2a2f51969795920733912bad"
}
]
},
"generator": {
2024-11-18 16:00:33 +00:00
"engine": "bippy-8e903de6a542"
2024-09-30 17:00:36 +00:00
}
}