{"id":"CVE-2026-63951","published":"2026-07-19T14:55:44Z","modified":"2026-08-05T12:37:36Z","title":"zram: fix use-after-free in zram_writeback_endio","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nzram: fix use-after-free in zram_writeback_endio\n\nA crash was observed in zram_writeback_endio due to a NULL pointer\ndereference in wake_up.  The root cause is a race condition between the\nbio completion handler (zram_writeback_endio) and the writeback task.\n\nIn zram_writeback_endio, wake_up() is called on &wb_ctl->done_wait after\nreleasing wb_ctl->done_lock.  This creates a race window where the\nwriteback task can see num_inflight become 0, return, and free wb_ctl\nbefore zram_writeback_endio calls wake_up().\n\nCPU 0 (zram_writeback_endio)     CPU 1 (writeback_store)\n============================     ============================\n                                 zram_writeback_slots\n                                   zram_submit_wb_request\n                                   zram_submit_wb_request\n                                   wait_event(wb_ctl->done_wait)\nspin_lock(&wb_ctl->done_lock);\nlist_add(&req->entry, &wb_ctl->done_reqs);\nspin_unlock(&wb_ctl->done_lock);\nwake_up(&wb_ctl->done_wait);\n                                   zram_complete_done_reqs\nspin_lock(&wb_ctl->done_lock);\nlist_add(&req->entry, &wb_ctl->done_reqs);\nspin_unlock(&wb_ctl->done_lock);\n                                   while (num_inflight) > 0)\n                                     spin_lock(&wb_ctl->done_lock);\n                                     list_del(&req->entry);\n                                     spin_unlock(&wb_ctl->done_lock);\n                                     // num_inflight becomes 0\n                                     atomic_dec(num_inflight);\n\n                                 // Leave zram_writeback_slots\n                                 // Free wb_ctl\n                                 release_wb_ctl(wb_ctl);\n// UAF crash!\nwake_up(&wb_ctl->done_wait);\n\nThis patch fixes this race by using RCU.  By protecting wb_ctl with\nrcu_read_lock() in zram_writeback_endio and using kfree_rcu() to free it,\nwe ensure that wb_ctl remains valid during the execution of\nzram_writeback_endio.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00177,"percentile":0.0429,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/ebe2cbefc86291fa7f386447a81995640df4e2fd","tags":[]},{"url":"https://git.kernel.org/stable/c/bf62f69574b19720ae5fbbbcdf24a0c4e3e05e43","tags":[]}],"priority":{"score":6.3,"factors":[{"name":"EPSS percentile","points":0.86},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= f405066a1f0db818270f49a5e96be329bcabde1e, < ebe2cbefc86291fa7f386447a81995640df4e2fd",">= f405066a1f0db818270f49a5e96be329bcabde1e, < bf62f69574b19720ae5fbbbcdf24a0c4e3e05e43"]},{"vendor":"Linux","product":"Linux","versions":["6.19"]}],"euvd":{"id":"EUVD-2026-45724","exploited":false,"provenance":"source"}}