CVE Details
Description
In the Linux kernel, the following vulnerability has been resolved:\ncachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie()\nWe got the following issue in our fault injection stress test:\n==================================================================\nBUG: KASAN: slab-use-after-free in cachefiles_withdraw_cookie+0x4d9/0x600\nRead of size 8 at addr ffff888118efc000 by task kworker/u78:0/109\nCPU: 13 PID: 109 Comm: kworker/u78:0 Not tainted 6.8.0-dirty #566\nCall Trace:\n\nkasan_report+0x93/0xc0\ncachefiles_withdraw_cookie+0x4d9/0x600\nfscache_cookie_state_machine+0x5c8/0x1230\nfscache_cookie_worker+0x91/0x1c0\nprocess_one_work+0x7fa/0x1800\n[...]\nAllocated by task 117:\nkmalloc_trace+0x1b3/0x3c0\ncachefiles_acquire_volume+0xf3/0x9c0\nfscache_create_volume_work+0x97/0x150\nprocess_one_work+0x7fa/0x1800\n[...]\nFreed by task 120301:\nkfree+0xf1/0x2c0\ncachefiles_withdraw_cache+0x3fa/0x920\ncachefiles_put_unbind_pincount+0x1f6/0x250\ncachefiles_daemon_release+0x13b/0x290\n__fput+0x204/0xa00\ntask_work_run+0x139/0x230\ndo_exit+0x87a/0x29b0\n[...]\n==================================================================\nFollowing is the process that triggers the issue:\np1 | p2\n------------------------------------------------------------\nfscache_begin_lookup\nfscache_begin_volume_access\nfscache_cache_is_live(fscache_cache)\ncachefiles_daemon_release\ncachefiles_put_unbind_pincount\ncachefiles_daemon_unbind\ncachefiles_withdraw_cache\nfscache_withdraw_cache\nfscache_set_cache_state(cache, FSCACHE_CACHE_IS_WITHDRAWN);\ncachefiles_withdraw_objects(cache)\nfscache_wait_for_objects(fscache)\natomic_read(&fscache_cache->object_count) == 0\nfscache_perform_lookup\ncachefiles_lookup_cookie\ncachefiles_alloc_object\nrefcount_set(&object->ref, 1);\nobject->volume = volume\nfscache_count_object(vcookie->cache);\natomic_inc(&fscache_cache->object_count)\ncachefiles_withdraw_volumes\ncachefiles_withdraw_volume\nfscache_withdraw_volume\n__cachefiles_free_volume\nkfree(cachefiles_volume)\nfscache_cookie_state_machine\ncachefiles_withdraw_cookie\ncache = object->volume->cache;\n// cachefiles_volume UAF !!!\nAfter setting FSCACHE_CACHE_IS_WITHDRAWN, wait for all the cookie lookups\nto complete first, and then wait for fscache_cache->object_count == 0 to\navoid the cookie exiting after the volume has been freed and triggering\nthe above issue. Therefore call fscache_withdraw_volume() before calling\ncachefiles_withdraw_objects().\nThis way, after setting FSCACHE_CACHE_IS_WITHDRAWN, only the following two\ncases will occur:\n1) fscache_begin_lookup fails in fscache_begin_volume_access().\n2) fscache_withdraw_volume() will ensure that fscache_count_object() has\nbeen executed before calling fscache_wait_for_objects().
See more information about CVE-2024-41057 from MITRE CVE dictionary and NIST NVD
CVSS Scoring
NOTE: The following CVSS v3.1 metrics and score provided are preliminary and subject to review.
Base Score: |
7 |
CVSS Vector: |
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
Attack Vector: |
Local network |
Attack Complexity: |
High |
Privileges Required: |
Low |
User Interaction: |
None |
Scope: |
Unchanged |
Confidentiality Impact: |
High |
Integrity Impact: |
High |
Availability Impact: |
High |
Errata information
Platform | Errata | Release Date |
Oracle Linux version 9 (kernel) | ELSA-2024-9315 | 2024-11-14 |