{
  "cveId": "CVE-2025-40054",
  "url": "https://patchblox.com/security/cve/CVE-2025-40054",
  "summary": "CVE-2025-40054 is fixed in 2 products on 1 platform, first by DEBIAN-CVE-2025-40054, released October 28, 2025. It is not reported as exploited. Patch Radar priority: High.",
  "title": "linux: In the Linux kernel, the following vulnerability has been resolved:  f2fs: fix UAF issue in f2fs_merge_page_bio()  As...",
  "description": "In the Linux kernel, the following vulnerability has been resolved:  f2fs: fix UAF issue in f2fs_merge_page_bio()  As JY reported in bugzilla [1],  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : [0xffffffe51d249484] f2fs_is_cp_guaranteed\u002B0x70/0x98 lr : [0xffffffe51d24adbc] f2fs_merge_page_bio\u002B0x520/0x6d4 CPU: 3 UID: 0 PID: 6790 Comm: kworker/u16:3 Tainted: P    B   W  OE      6.12.30-android16-5-maybe-dirty-4k #1 5f7701c9cbf727d1eebe77c89bbbeb3371e895e5 Tainted: [P]=PROPRIETARY_MODULE, [B]=BAD_PAGE, [W]=WARN, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Workqueue: writeback wb_workfn (flush-254:49) Call trace:  f2fs_is_cp_guaranteed\u002B0x70/0x98  f2fs_inplace_write_data\u002B0x174/0x2f4  f2fs_do_write_data_page\u002B0x214/0x81c  f2fs_write_single_data_page\u002B0x28c/0x764  f2fs_write_data_pages\u002B0x78c/0xce4  do_writepages\u002B0xe8/0x2fc  __writeback_single_inode\u002B0x4c/0x4b4  writeback_sb_inodes\u002B0x314/0x540  __writeback_inodes_wb\u002B0xa4/0xf4  wb_writeback\u002B0x160/0x448  wb_workfn\u002B0x2f0/0x5dc  process_scheduled_works\u002B0x1c8/0x458  worker_thread\u002B0x334/0x3f0  kthread\u002B0x118/0x1ac  ret_from_fork\u002B0x10/0x20  [1] https://bugzilla.kernel.org/show_bug.cgi?id=220575  The panic was caused by UAF issue w/ below race condition:  kworker - writepages  - f2fs_write_cache_pages   - f2fs_write_single_data_page    - f2fs_do_write_data_page     - f2fs_inplace_write_data      - f2fs_merge_page_bio       - add_inu_page       : cache page #1 into bio \u0026 cache bio in         io-\u003Ebio_list   - f2fs_write_single_data_page    - f2fs_do_write_data_page     - f2fs_inplace_write_data      - f2fs_merge_page_bio       - add_inu_page       : cache page #2 into bio which is linked         in io-\u003Ebio_list \t\t\t\t\t\twrite \t\t\t\t\t\t- f2fs_write_begin \t\t\t\t\t\t: write page #1 \t\t\t\t\t\t - f2fs_folio_wait_writeback \t\t\t\t\t\t  - f2fs_submit_merged_ipu_write \t\t\t\t\t\t   - f2fs_submit_write_bio \t\t\t\t\t\t   : submit bio which inclues page #1 and #2  \t\t\t\t\t\tsoftware IRQ \t\t\t\t\t\t- f2fs_write_end_io \t\t\t\t\t\t - fscrypt_free_bounce_page \t\t\t\t\t\t : freed bounced page which belongs to page #2       - inc_page_count( , WB_DATA_TYPE(data_folio), false)       : data_folio points to fio-\u003Eencrypted_page         the bounced page can be freed before         accessing it in f2fs_is_cp_guarantee()  It can reproduce w/ below testcase: Run below script in shell #1: for ((i=1;i\u003E0;i\u002B\u002B)) do xfs_io -f /mnt/f2fs/enc/file \\ -c \u0022pwrite 0 32k\u0022 -c \u0022fdatasync\u0022  Run below script in shell #2: for ((i=1;i\u003E0;i\u002B\u002B)) do xfs_io -f /mnt/f2fs/enc/file \\ -c \u0022pwrite 0 32k\u0022 -c \u0022fdatasync\u0022  So, in f2fs_merge_page_bio(), let\u0027s avoid using fio-\u003Eencrypted_page after commit page into internal ipu cache.",
  "published": "2025-10-28T12:15:39Z",
  "severity": "high",
  "cvss": 7.8,
  "cvssVector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
  "epss": 0.00166,
  "epssPercentile": 0.05865,
  "priority": "High",
  "priorityTier": 3,
  "exploited": false,
  "vendorExploited": false,
  "disclosed": false,
  "fixes": [
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 12.15 (bookworm)",
      "fixedVersion": "6.1.187-1",
      "fix": "DEBIAN-CVE-2025-40054",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2025-40054",
      "released": "2025-10-28T12:15:39Z"
    },
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 13.5 (trixie)",
      "fixedVersion": "6.12.105-1",
      "fix": "DEBIAN-CVE-2025-40054",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2025-40054",
      "released": "2025-10-28T12:15:39Z"
    },
    {
      "platform": "linux",
      "product": "linux",
      "release": "Debian 14",
      "fixedVersion": "6.17.6-1",
      "fix": "DEBIAN-CVE-2025-40054",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2025-40054",
      "released": "2025-10-28T12:15:39Z"
    },
    {
      "platform": "linux",
      "product": "linux-6.12",
      "release": "Debian 12.15 (bookworm)",
      "fixedVersion": "6.12.107-1~deb12u1",
      "fix": "DEBIAN-CVE-2025-40054",
      "url": "https://patchblox.com/security/fix/linux/debian-cve-2025-40054",
      "released": "2025-10-28T12:15:39Z"
    }
  ],
  "noFixYet": [],
  "dataAsOf": "2026-11-09T01:18:40Z",
  "attribution": {
    "text": "Data: Patchblox Patch Radar",
    "url": "https://patchblox.com/security/patch-radar",
    "terms": "https://patchblox.com/security/patch-radar/use-the-data"
  }
}