{"id":"CVE-2026-139615","state":"PUBLISHED","title":"vfio: Reject a second cdev open before mutating shared device state","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nvfio: Reject a second cdev open before mutating shared device state\n\nThe cdev single-open check lives in vfio_df_open(), which runs at the\nend of the bind ioctl, after vfio_df_ioctl_bind_iommufd() has already\nupdated state shared across all opens: vfio_df_check_token() can set\nthe PF vf_token and vfio_df_get_kvm_safe() records the caller's KVM\npointer in device->kvm and takes a reference.\n\nA second cdev bind of an already-open device runs both, only to be\nrejected in vfio_df_open().  The error path clears device->kvm and\ndrops the reference, tearing down the current opener's KVM association\nand potentially resulting in an unbalanced reference on close or\npremature release, while the vf_token remains clobbered.\n\nMove the single-open check into vfio_df_ioctl_bind_iommufd() ahead of\nboth mutations, so a bind that cannot complete leaves the current\nopener's state untouched.  df->group is NULL on this path, so a\nnon-zero open_count is exactly what vfio_df_open() rejected.  The test\nin vfio_df_open() becomes redundant and is removed.\n\nReturn -EBUSY rather than -EINVAL here.  The arguments are not invalid,\nthe device is in use, which could be a transient condition due to a\ndelayed fput if the prior user is terminated.  This provides\ncompatibility with the group path, where a group open returns -EBUSY,\nand users may choose bounded polling to detect such a transient\ncondition.","publishedAt":"2026-11-30T13:36:23.347Z","updatedAt":"2026-11-30T13:36:23.347Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"e5026289a555bc89647dd6476b8ab86556cf7adc","versionType":"git"},{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"52478ef75b37c264991119612ca06cb5217e4189","versionType":"git"},{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"258ba46543abdd36844f04bba8b4022a5731d873","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vfio/device_cdev.c","drivers/vfio/vfio_main.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","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":["drivers/vfio/device_cdev.c","drivers/vfio/vfio_main.c"]}],"references":["https://git.kernel.org/stable/c/e5026289a555bc89647dd6476b8ab86556cf7adc","https://git.kernel.org/stable/c/52478ef75b37c264991119612ca06cb5217e4189","https://git.kernel.org/stable/c/258ba46543abdd36844f04bba8b4022a5731d873"],"weaknesses":[],"ingestedAt":"2026-11-30T13:52:04.503Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139615.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139615","state":"PUBLISHED","datePublished":"2026-11-30T13:36:23.347Z","dateUpdated":"2026-11-30T13:36:23.347Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.943Z"},"containers":{"cna":{"title":"vfio: Reject a second cdev open before mutating shared device state","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nvfio: Reject a second cdev open before mutating shared device state\n\nThe cdev single-open check lives in vfio_df_open(), which runs at the\nend of the bind ioctl, after vfio_df_ioctl_bind_iommufd() has already\nupdated state shared across all opens: vfio_df_check_token() can set\nthe PF vf_token and vfio_df_get_kvm_safe() records the caller's KVM\npointer in device->kvm and takes a reference.\n\nA second cdev bind of an already-open device runs both, only to be\nrejected in vfio_df_open().  The error path clears device->kvm and\ndrops the reference, tearing down the current opener's KVM association\nand potentially resulting in an unbalanced reference on close or\npremature release, while the vf_token remains clobbered.\n\nMove the single-open check into vfio_df_ioctl_bind_iommufd() ahead of\nboth mutations, so a bind that cannot complete leaves the current\nopener's state untouched.  df->group is NULL on this path, so a\nnon-zero open_count is exactly what vfio_df_open() rejected.  The test\nin vfio_df_open() becomes redundant and is removed.\n\nReturn -EBUSY rather than -EINVAL here.  The arguments are not invalid,\nthe device is in use, which could be a transient condition due to a\ndelayed fput if the prior user is terminated.  This provides\ncompatibility with the group path, where a group open returns -EBUSY,\nand users may choose bounded polling to detect such a transient\ncondition."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"e5026289a555bc89647dd6476b8ab86556cf7adc","versionType":"git"},{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"52478ef75b37c264991119612ca06cb5217e4189","versionType":"git"},{"version":"839e692fa4eb7da5c541a65155f1dbc237d8afaa","status":"affected","lessThan":"258ba46543abdd36844f04bba8b4022a5731d873","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vfio/device_cdev.c","drivers/vfio/vfio_main.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.6","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","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":["drivers/vfio/device_cdev.c","drivers/vfio/vfio_main.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e5026289a555bc89647dd6476b8ab86556cf7adc"},{"url":"https://git.kernel.org/stable/c/52478ef75b37c264991119612ca06cb5217e4189"},{"url":"https://git.kernel.org/stable/c/258ba46543abdd36844f04bba8b4022a5731d873"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:23.347Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}