{"id":"DEBIAN-CVE-2024-41057","details":"In the Linux kernel, the following vulnerability has been resolved:  cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie()  We got the following issue in our fault injection stress test:  ================================================================== BUG: KASAN: slab-use-after-free in cachefiles_withdraw_cookie+0x4d9/0x600 Read of size 8 at addr ffff888118efc000 by task kworker/u78:0/109  CPU: 13 PID: 109 Comm: kworker/u78:0 Not tainted 6.8.0-dirty #566 Call Trace:  \u003cTASK\u003e  kasan_report+0x93/0xc0  cachefiles_withdraw_cookie+0x4d9/0x600  fscache_cookie_state_machine+0x5c8/0x1230  fscache_cookie_worker+0x91/0x1c0  process_one_work+0x7fa/0x1800  [...]  Allocated by task 117:  kmalloc_trace+0x1b3/0x3c0  cachefiles_acquire_volume+0xf3/0x9c0  fscache_create_volume_work+0x97/0x150  process_one_work+0x7fa/0x1800  [...]  Freed by task 120301:  kfree+0xf1/0x2c0  cachefiles_withdraw_cache+0x3fa/0x920  cachefiles_put_unbind_pincount+0x1f6/0x250  cachefiles_daemon_release+0x13b/0x290  __fput+0x204/0xa00  task_work_run+0x139/0x230  do_exit+0x87a/0x29b0  [...] ==================================================================  Following is the process that triggers the issue:             p1                |             p2 ------------------------------------------------------------                               fscache_begin_lookup                                fscache_begin_volume_access                                 fscache_cache_is_live(fscache_cache) cachefiles_daemon_release  cachefiles_put_unbind_pincount   cachefiles_daemon_unbind    cachefiles_withdraw_cache     fscache_withdraw_cache      fscache_set_cache_state(cache, FSCACHE_CACHE_IS_WITHDRAWN);     cachefiles_withdraw_objects(cache)     fscache_wait_for_objects(fscache)       atomic_read(&fscache_cache-\u003eobject_count) == 0                               fscache_perform_lookup                                cachefiles_lookup_cookie                                 cachefiles_alloc_object                                  refcount_set(&object-\u003eref, 1);                                  object-\u003evolume = volume                                  fscache_count_object(vcookie-\u003ecache);                                   atomic_inc(&fscache_cache-\u003eobject_count)     cachefiles_withdraw_volumes      cachefiles_withdraw_volume       fscache_withdraw_volume       __cachefiles_free_volume        kfree(cachefiles_volume)                               fscache_cookie_state_machine                                cachefiles_withdraw_cookie                                 cache = object-\u003evolume-\u003ecache;                                 // cachefiles_volume UAF !!!  After setting FSCACHE_CACHE_IS_WITHDRAWN, wait for all the cookie lookups to complete first, and then wait for fscache_cache-\u003eobject_count == 0 to avoid the cookie exiting after the volume has been freed and triggering the above issue. Therefore call fscache_withdraw_volume() before calling cachefiles_withdraw_objects().  This way, after setting FSCACHE_CACHE_IS_WITHDRAWN, only the following two cases will occur: 1) fscache_begin_lookup fails in fscache_begin_volume_access(). 2) fscache_withdraw_volume() will ensure that fscache_count_object() has    been executed before calling fscache_wait_for_objects().","modified":"2026-10-01T11:03:38.756481255Z","published":"2024-07-29T15:15:13.773Z","upstream":["CVE-2024-41057"],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2024-41057"}],"affected":[{"package":{"name":"linux","ecosystem":"Debian:12","purl":"pkg:deb/debian/linux?arch=source&distro=bookworm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.106-1"}]}],"versions":["6.1.27-1","6.1.37-1","6.1.38-1","6.1.38-2","6.1.38-2~bpo11+1","6.1.38-3","6.1.38-4","6.1.38-4~bpo11+1","6.1.52-1","6.1.55-1","6.1.55-1~bpo11+1","6.1.64-1","6.1.66-1","6.1.67-1","6.1.69-1","6.1.69-1~bpo11+1","6.1.76-1","6.1.76-1~bpo11+1","6.1.82-1","6.1.85-1","6.1.90-1","6.1.90-1~bpo11+1","6.1.94-1","6.1.94-1~bpo11+1","6.1.98-1","6.1.99-1"],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-41057.json"}},{"package":{"name":"linux","ecosystem":"Debian:13","purl":"pkg:deb/debian/linux?arch=source&distro=trixie"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.9.11-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-41057.json"}},{"package":{"name":"linux","ecosystem":"Debian:14","purl":"pkg:deb/debian/linux?arch=source&distro=forky"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.9.11-1"}]}],"ecosystem_specific":{"urgency":"not yet assigned"},"database_specific":{"source":"https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2024-41057.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}