{
  "threat_severity" : "Moderate",
  "public_date" : "2025-09-19T00:00:00Z",
  "bugzilla" : {
    "description" : "kernel: fs: writeback: fix use-after-free in __mark_inode_dirty()",
    "id" : "2396940",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2396940"
  },
  "cvss3" : {
    "cvss3_base_score" : "6.4",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
    "status" : "verified"
  },
  "cwe" : "CWE-416",
  "details" : [ "In the Linux kernel, the following vulnerability has been resolved:\nfs: writeback: fix use-after-free in __mark_inode_dirty()\nAn use-after-free issue occurred when __mark_inode_dirty() get the\nbdi_writeback that was in the progress of switching.\nCPU: 1 PID: 562 Comm: systemd-random- Not tainted 6.6.56-gb4403bd46a8e #1\n......\npstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)\npc : __mark_inode_dirty+0x124/0x418\nlr : __mark_inode_dirty+0x118/0x418\nsp : ffffffc08c9dbbc0\n........\nCall trace:\n__mark_inode_dirty+0x124/0x418\ngeneric_update_time+0x4c/0x60\nfile_modified+0xcc/0xd0\next4_buffered_write_iter+0x58/0x124\next4_file_write_iter+0x54/0x704\nvfs_write+0x1c0/0x308\nksys_write+0x74/0x10c\n__arm64_sys_write+0x1c/0x28\ninvoke_syscall+0x48/0x114\nel0_svc_common.constprop.0+0xc0/0xe0\ndo_el0_svc+0x1c/0x28\nel0_svc+0x40/0xe4\nel0t_64_sync_handler+0x120/0x12c\nel0t_64_sync+0x194/0x198\nRoot cause is:\nsystemd-random-seed                         kworker\n----------------------------------------------------------------------\n___mark_inode_dirty                     inode_switch_wbs_work_fn\nspin_lock(&inode->i_lock);\ninode_attach_wb\nlocked_inode_to_wb_and_lock_list\nget inode->i_wb\nspin_unlock(&inode->i_lock);\nspin_lock(&wb->list_lock)\nspin_lock(&inode->i_lock)\ninode_io_list_move_locked\nspin_unlock(&wb->list_lock)\nspin_unlock(&inode->i_lock)\nspin_lock(&old_wb->list_lock)\ninode_do_switch_wbs\nspin_lock(&inode->i_lock)\ninode->i_wb = new_wb\nspin_unlock(&inode->i_lock)\nspin_unlock(&old_wb->list_lock)\nwb_put_many(old_wb, nr_switched)\ncgwb_release\nold wb released\nwb_wakeup_delayed() accesses wb,\nthen trigger the use-after-free\nissue\nFix this race condition by holding inode spinlock until\nwb_wakeup_delayed() finished." ],
  "statement" : "A race condition in __mark_inode_dirty() could lead to a use-after-free when the inode’s writeback structure (bdi_writeback) is being switched concurrently by another thread. The bug may result in a kernel crash (DoS) under heavy I/O or writeback migration workloads.\nThe vulnerability can only be triggered through actions involving inode writeback switching and cgroup writeback management, which require elevated privileges (CAP_SYS_ADMIN).\nThe CIA impact vector (H/H/H) represents a conservative worst-case scenario, assuming the use-after-free could be exploited to execute arbitrary code in kernel context. In practice, due to the limited control over memory and the need for privileged access, a more realistic assessment is CIA: N/N/H, reflecting potential system instability or denial of service rather than full compromise.",
  "affected_release" : [ {
    "product_name" : "Red Hat Enterprise Linux 10",
    "release_date" : "2026-05-19T00:00:00Z",
    "advisory" : "RHSA-2026:18134",
    "cpe" : "cpe:/o:redhat:enterprise_linux:10.2",
    "package" : "kernel-0:6.12.0-211.7.1.el10_2"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2026-05-19T00:00:00Z",
    "advisory" : "RHSA-2026:18587",
    "cpe" : "cpe:/a:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-687.5.1.el9_8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2026-05-19T00:00:00Z",
    "advisory" : "RHSA-2026:18587",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-687.5.1.el9_8"
  } ],
  "package_state" : [ {
    "product_name" : "Red Hat Enterprise Linux 6",
    "fix_state" : "Not affected",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:6"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Will not fix",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "fix_state" : "Will not fix",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "fix_state" : "Affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "fix_state" : "Affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9"
  } ],
  "references" : [ "https://www.cve.org/CVERecord?id=CVE-2025-39866\nhttps://nvd.nist.gov/vuln/detail/CVE-2025-39866\nhttps://lore.kernel.org/linux-cve-announce/2025091907-CVE-2025-39866-45d3@gregkh/T" ],
  "name" : "CVE-2025-39866",
  "csaw" : false
}