{"id":"CVE-2026-98176","state":"PUBLISHED","title":"drm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc\n\nThe low 6 bits of cp_hqd_eop_control store the base-2 logarithm\nof the EOP ring size. This was calculated as\n\nffs(q->eop_ring_buffer_size / sizeof(unsigned int)) - 1 - 1\n\nBut ffs can in theory return 1 or 0, so this could underflow\n(although in practice the ring buffer size cannot be less than 4096).\n\nChange this to\n\nffs(q->eop_ring_buffer_size / sizeof(unsigned int) / 4)\n\nusing properties of logarithms.\n\n(cherry picked from commit 4f18c56630383c14bfc6b2d65f88f2f895d2121a)","publishedAt":"2026-10-06T08:44:20.004Z","updatedAt":"2026-10-19T09:15:07.720Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"14328aa58ce523a59996c5a82681c43ec048cc33","status":"affected","lessThan":"82e1b8299c6da02ce02185c208d2fdf7572b5ea1","versionType":"git"},{"version":"14328aa58ce523a59996c5a82681c43ec048cc33","status":"affected","lessThan":"c883d0a132d430ef7ebb23fd94323be94d0fbdb8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.3","versionType":"semver"},{"version":"7.2.8","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c"]}],"references":["https://git.kernel.org/stable/c/82e1b8299c6da02ce02185c208d2fdf7572b5ea1","https://git.kernel.org/stable/c/c883d0a132d430ef7ebb23fd94323be94d0fbdb8"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:43.249Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/98xxx/CVE-2026-98176.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-98176","state":"PUBLISHED","datePublished":"2026-10-06T08:44:20.004Z","dateUpdated":"2026-10-19T09:15:07.720Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.322Z"},"containers":{"cna":{"title":"drm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc\n\nThe low 6 bits of cp_hqd_eop_control store the base-2 logarithm\nof the EOP ring size. This was calculated as\n\nffs(q->eop_ring_buffer_size / sizeof(unsigned int)) - 1 - 1\n\nBut ffs can in theory return 1 or 0, so this could underflow\n(although in practice the ring buffer size cannot be less than 4096).\n\nChange this to\n\nffs(q->eop_ring_buffer_size / sizeof(unsigned int) / 4)\n\nusing properties of logarithms.\n\n(cherry picked from commit 4f18c56630383c14bfc6b2d65f88f2f895d2121a)"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"14328aa58ce523a59996c5a82681c43ec048cc33","status":"affected","lessThan":"82e1b8299c6da02ce02185c208d2fdf7572b5ea1","versionType":"git"},{"version":"14328aa58ce523a59996c5a82681c43ec048cc33","status":"affected","lessThan":"c883d0a132d430ef7ebb23fd94323be94d0fbdb8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.3","versionType":"semver"},{"version":"7.2.8","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c","drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/82e1b8299c6da02ce02185c208d2fdf7572b5ea1"},{"url":"https://git.kernel.org/stable/c/c883d0a132d430ef7ebb23fd94323be94d0fbdb8"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-19T09:15:07.720Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.3","versionEndExcluding":"7.2.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.3","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}