{"id":"CVE-2024-39508","published":"2024-07-12T12:20:39Z","modified":"2026-08-05T11:33:51Z","title":"io_uring/io-wq: Use set_bit() and test_bit() at worker->flags","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nio_uring/io-wq: Use set_bit() and test_bit() at worker->flags\n\nUtilize set_bit() and test_bit() on worker->flags within io_uring/io-wq\nto address potential data races.\n\nThe structure io_worker->flags may be accessed through various data\npaths, leading to concurrency issues. When KCSAN is enabled, it reveals\ndata races occurring in io_worker_handle_work and\nio_wq_activate_free_worker functions.\n\n\t BUG: KCSAN: data-race in io_worker_handle_work / io_wq_activate_free_worker\n\t write to 0xffff8885c4246404 of 4 bytes by task 49071 on cpu 28:\n\t io_worker_handle_work (io_uring/io-wq.c:434 io_uring/io-wq.c:569)\n\t io_wq_worker (io_uring/io-wq.c:?)\n<snip>\n\n\t read to 0xffff8885c4246404 of 4 bytes by task 49024 on cpu 5:\n\t io_wq_activate_free_worker (io_uring/io-wq.c:? io_uring/io-wq.c:285)\n\t io_wq_enqueue (io_uring/io-wq.c:947)\n\t io_queue_iowq (io_uring/io_uring.c:524)\n\t io_req_task_submit (io_uring/io_uring.c:1511)\n\t io_handle_tw_list (io_uring/io_uring.c:1198)\n<snip>\n\nLine numbers against commit 18daea77cca6 (\"Merge tag 'for-linus' of\ngit://git.kernel.org/pub/scm/virt/kvm/kvm\").\n\nThese races involve writes and reads to the same memory location by\ndifferent tasks running on different CPUs. To mitigate this, refactor\nthe code to use atomic operations such as set_bit(), test_bit(), and\nclear_bit() instead of basic \"and\" and \"or\" operations. This ensures\nthread-safe manipulation of worker flags.\n\nAlso, move `create_index` to avoid holes in the structure.","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.00222,"percentile":0.1307,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/ab702c3483db9046bab9f40306f1a28b22dbbdc0","tags":[]},{"url":"https://git.kernel.org/stable/c/1cbb0affb15470a9621267fe0a8568007553a4bf","tags":[]},{"url":"https://git.kernel.org/stable/c/8a565304927fbd28c9f028c492b5c1714002cbab","tags":[]}],"priority":{"score":8.1,"factors":[{"name":"EPSS percentile","points":2.61},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 2b188cc1bb857a9d4701ae59aa7768b5124e262e, < ab702c3483db9046bab9f40306f1a28b22dbbdc0",">= 2b188cc1bb857a9d4701ae59aa7768b5124e262e, < 1cbb0affb15470a9621267fe0a8568007553a4bf",">= 2b188cc1bb857a9d4701ae59aa7768b5124e262e, < 8a565304927fbd28c9f028c492b5c1714002cbab"]},{"vendor":"Linux","product":"Linux","versions":["5.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-10T17:06:48.077960Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-38034","exploited":false,"provenance":"source"}}