{"id":"CVE-2026-139014","state":"PUBLISHED","title":"f2fs: drop pending discard commands before reserving device alias","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: drop pending discard commands before reserving device alias\n\nWhen reserving a device alias via f2fs_ioc_reserve_dev_alias(),\nf2fs_reserve_device_alias() bulk-marks all blocks in the target device\nrange as valid in SIT.\n\nHowever, if the device was previously in the released state, stale\npending discard commands covering that range may still exist in dcc->root.\nWhen f2fs_issue_discard_thread later processes those commands,\n__check_sit_bitmap() detects valid blocks in the discard range and\ntriggers a kernel BUG().\n\nTo fix this:\n1. Introduce f2fs_drop_discard_cmd_range() to traverse the discard rbtree,\n   drop all pending D_PREP discard commands in the range,\n   and wait for any in-flight discard bios under dcc->cmd_lock.\n2. Call f2fs_drop_discard_cmd_range() in f2fs_ioc_reserve_dev_alias()\n   before f2fs_reserve_device_alias().","publishedAt":"2026-11-30T13:27:04.493Z","updatedAt":"2026-11-30T13:27:04.493Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"eae3faf210bdc69181be717ce90437eadc6b3c80","status":"affected","lessThan":"2702225f565ac1272e529545b12a15cd75ed2531","versionType":"git"},{"version":"eae3faf210bdc69181be717ce90437eadc6b3c80","status":"affected","lessThan":"5d37f99e4d25eaf42efe2dda8b947585478168f6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/f2fs.h","fs/f2fs/file.c","fs/f2fs/segment.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.3","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/f2fs.h","fs/f2fs/file.c","fs/f2fs/segment.c"]}],"references":["https://git.kernel.org/stable/c/2702225f565ac1272e529545b12a15cd75ed2531","https://git.kernel.org/stable/c/5d37f99e4d25eaf42efe2dda8b947585478168f6"],"weaknesses":[],"ingestedAt":"2026-11-30T13:40:04.421Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139014.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139014","state":"PUBLISHED","datePublished":"2026-11-30T13:27:04.493Z","dateUpdated":"2026-11-30T13:27:04.493Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.909Z"},"containers":{"cna":{"title":"f2fs: drop pending discard commands before reserving device alias","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: drop pending discard commands before reserving device alias\n\nWhen reserving a device alias via f2fs_ioc_reserve_dev_alias(),\nf2fs_reserve_device_alias() bulk-marks all blocks in the target device\nrange as valid in SIT.\n\nHowever, if the device was previously in the released state, stale\npending discard commands covering that range may still exist in dcc->root.\nWhen f2fs_issue_discard_thread later processes those commands,\n__check_sit_bitmap() detects valid blocks in the discard range and\ntriggers a kernel BUG().\n\nTo fix this:\n1. Introduce f2fs_drop_discard_cmd_range() to traverse the discard rbtree,\n   drop all pending D_PREP discard commands in the range,\n   and wait for any in-flight discard bios under dcc->cmd_lock.\n2. Call f2fs_drop_discard_cmd_range() in f2fs_ioc_reserve_dev_alias()\n   before f2fs_reserve_device_alias()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"eae3faf210bdc69181be717ce90437eadc6b3c80","status":"affected","lessThan":"2702225f565ac1272e529545b12a15cd75ed2531","versionType":"git"},{"version":"eae3faf210bdc69181be717ce90437eadc6b3c80","status":"affected","lessThan":"5d37f99e4d25eaf42efe2dda8b947585478168f6","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/f2fs.h","fs/f2fs/file.c","fs/f2fs/segment.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.3","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/f2fs.h","fs/f2fs/file.c","fs/f2fs/segment.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/2702225f565ac1272e529545b12a15cd75ed2531"},{"url":"https://git.kernel.org/stable/c/5d37f99e4d25eaf42efe2dda8b947585478168f6"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:04.493Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.3","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.3","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}