{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-54124",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-54124"
  ],
  "published": "2025-12-24T13:11:50Z",
  "summary": "f2fs: fix to drop all dirty pages during umount() if cp_error is set",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix to drop all dirty pages during umount() if cp_error is set\n\nxfstest generic/361 reports a bug as below:\n\nf2fs_bug_on(sbi, sbi->fsync_node_num);\n\nkernel BUG at fs/f2fs/super.c:1627!\nRIP: 0010:f2fs_put_super+0x3a8/0x3b0\nCall Trace:\n generic_shutdown_super+0x8c/0x1b0\n kill_block_super+0x2b/0x60\n kill_f2fs_super+0x87/0x110\n deactivate_locked_super+0x39/0x80\n deactivate_super+0x46/0x50\n cleanup_mnt+0x109/0x170\n __cleanup_mnt+0x16/0x20\n task_work_run+0x65/0xa0\n exit_to_user_mode_prepare+0x175/0x190\n syscall_exit_to_user_mode+0x25/0x50\n do_syscall_64+0x4c/0x90\n entry_SYSCALL_64_after_hwframe+0x72/0xdc\n\nDuring umount(), if cp_error is set, f2fs_wait_on_all_pages() should\nnot stop waiting all F2FS_WB_CP_DATA pages to be writebacked, otherwise,\nfsync_node_num can be non-zero after f2fs_wait_on_all_pages() causing\nthis bug.\n\nIn this case, to avoid deadloop in f2fs_wait_on_all_pages(), it needs\nto drop all dirty pages rather than redirtying them.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.21-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v6",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7l",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v8",
            "binary_version": "1:6.1.21-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.21-1+rpt1": {
            "linux_commit": "0afb5e98488aed7017b9bf321b575d0177feb7ed",
            "upstream_version": "6.1.21",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.30"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-54124"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/92575f05a32dafb16348bfa5e62478118a9be069"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4ceedc2f8bdffb82e40b7d1bb912304f8e157cb1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ad87bd313f70b51e48019d5ce2d02d73152356b3"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d8f4ad5f3979dbd8e6251259562f12472717883a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7741ddc882a0c806a6508ba8203c55a779db7a21"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/82c3d6e9db41cbd3af1d4f90bdb441740b5fad10"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c9b3649a934d131151111354bcbb638076f03a30"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The bug is reached through local filesystem operations \u2014 write/fsync on an f2fs volume followed by umount(2) of that mount \u2014 with no network component. f2fs is a local block filesystem (Android /data, eMMC/SD/USB media), so the attacker needs local access to the system.\nAC:L - Both preconditions are attacker-controlled: `CP_ERROR_FLAG` is set deterministically by a crafted image whose metadata reads fail (or by an erroring backing device), and outstanding `F2FS_WB_CP_DATA`/fsync-node pages are trivially produced by a concurrent write+fsync loop before unmount. The condition is reliably reproducible \u2014 it is caught by xfstest generic/361.\nPR:L - The dirty-node-page side requires only an unprivileged user with write access to the f2fs mount; the mount/umount of the crafted volume is routinely available to unprivileged users via udisks2/vold auto-mount, `user`/`users` fstab entries, or removable-media handlers. No real root capability in the init namespace is needed for the realistic attack.\nUI:N - The attacker performs the mount, the I/O workload, and the umount itself in the auto-mount/removable-media and Android adoptable-storage scenarios; no separate victim action is required. On an already-mounted f2fs volume that hits a device error, the panic occurs at the next unmount without any user involvement.\nS:U - The corruption and the resulting panic are confined to the kernel of the affected system, with no crossing into a different security authority such as a hypervisor or IOMMU boundary. This is a standard in-kernel filesystem defect.\nC:H - Skipping the writeback drain lets `f2fs_put_super()` `kfree(sbi)` (and destroy the node manager and checkpoint buffer) while bios whose `bi_private` is that `f2fs_sb_info` are still in flight, so `f2fs_write_end_io()` operates on freed, reallocatable memory. Per kernel UAF guidance, an attacker who reclaims that slab can leverage the stale references for information disclosure.\nI:H - The same use-after-free provides write primitives into freed memory \u2014 `dec_page_count()` atomics, a `list_del()` on `sbi->fsync_node_list` under `sbi->fsync_node_lock`, and `wake_up(&sbi->cp_wait)` \u2014 all executed from IRQ context on a reclaimed allocation, which is exploitable for heap corruption. The bug additionally leaves the volume with `SBI_NEED_FSCK` and undropped/redirtied metadata, i.e. on-disk inconsistency.\nA:H - On `CONFIG_F2FS_CHECK_FS` builds the path terminates in `f2fs_bug_on(sbi, sbi->fsync_node_num)` \u2014 an unconditional `BUG_ON()` kernel panic in `f2fs_put_super()`, as shown in the reported trace. Without that config the resulting use-after-free crashes the kernel, and the changelog also notes a potential dead-loop in `f2fs_wait_on_all_pages()` from perpetually redirtied pages."
    }
  }
}
