{"id":"CVE-2022-50221","state":"PUBLISHED","title":"drm/fb-helper: Fix out-of-bounds access","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/fb-helper: Fix out-of-bounds access\n\nClip memory range to screen-buffer size to avoid out-of-bounds access\nin fbdev deferred I/O's damage handling.\n\nFbdev's deferred I/O can only track pages. From the range of pages, the\ndamage handler computes the clipping rectangle for the display update.\nIf the fbdev screen buffer ends near the beginning of a page, that page\ncould contain more scanlines. The damage handler would then track these\nnon-existing scanlines as dirty and provoke an out-of-bounds access\nduring the screen update. Hence, clip the maximum memory range to the\nsize of the screen buffer.\n\nWhile at it, rename the variables min/max to min_off/max_off in\ndrm_fb_helper_deferred_io(). This avoids confusion with the macros of\nthe same name.","publishedAt":"2025-06-18T11:03:56.096Z","updatedAt":"2026-08-05T08:57:46.137Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"67b723f5b74254d27962b1b59bddfee1584575ff","status":"affected","lessThan":"9c49ac792c639dbec0728b513329a32461f72253","versionType":"git"},{"version":"67b723f5b74254d27962b1b59bddfee1584575ff","status":"affected","lessThan":"ae25885bdf59fde40726863c57fd20e4a0642183","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_fb_helper.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"5.19.2","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","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/drm_fb_helper.c"]}],"references":["https://git.kernel.org/stable/c/9c49ac792c639dbec0728b513329a32461f72253","https://git.kernel.org/stable/c/ae25885bdf59fde40726863c57fd20e4a0642183"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50221.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50221","state":"PUBLISHED","datePublished":"2025-06-18T11:03:56.096Z","dateUpdated":"2026-08-05T08:57:46.137Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.430Z"},"containers":{"cna":{"title":"drm/fb-helper: Fix out-of-bounds access","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/fb-helper: Fix out-of-bounds access\n\nClip memory range to screen-buffer size to avoid out-of-bounds access\nin fbdev deferred I/O's damage handling.\n\nFbdev's deferred I/O can only track pages. From the range of pages, the\ndamage handler computes the clipping rectangle for the display update.\nIf the fbdev screen buffer ends near the beginning of a page, that page\ncould contain more scanlines. The damage handler would then track these\nnon-existing scanlines as dirty and provoke an out-of-bounds access\nduring the screen update. Hence, clip the maximum memory range to the\nsize of the screen buffer.\n\nWhile at it, rename the variables min/max to min_off/max_off in\ndrm_fb_helper_deferred_io(). This avoids confusion with the macros of\nthe same name."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"67b723f5b74254d27962b1b59bddfee1584575ff","status":"affected","lessThan":"9c49ac792c639dbec0728b513329a32461f72253","versionType":"git"},{"version":"67b723f5b74254d27962b1b59bddfee1584575ff","status":"affected","lessThan":"ae25885bdf59fde40726863c57fd20e4a0642183","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/drm_fb_helper.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"5.19.2","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","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/drm_fb_helper.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/9c49ac792c639dbec0728b513329a32461f72253"},{"url":"https://git.kernel.org/stable/c/ae25885bdf59fde40726863c57fd20e4a0642183"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached by opening /dev/fbN, mmap'ing the fbdev shadow buffer, and dirtying pages so fb_deferred_io_work calls drm_fb_helper_deferred_io(); that is a local device/syscall path with no network or adjacent-protocol entry.\nAC:L - On affected shadow-fbdev configurations whose screen_size is not page-aligned (common modes such as 1366x768x32), writing the last mapped page and flushing deferred I/O (or fsync) reliably enlarges the damage clip past the buffer; no race or attacker-uncontrollable layout is required.\nPR:L - fb_open() has no capability check; access is DAC on /dev/fbN (typically 660 root:video), which ordinary desktop, Android, and embedded graphics users hold via the video group—basic local privileges, not real root.\nUI:N - The attacker opens the framebuffer, mmaps it, and dirties the last page themselves; no separate victim action is required.\nS:U - Corruption stays in host kernel vmalloc/GEM memory under the same OS authority; this is not a VM escape, IOMMU bypass, or other cross-boundary impact.\nC:H - drm_fb_helper_damage_blit_real() reads past the vzalloc'd shadow buffer into adjacent kernel memory (often kilobytes for a full extra scanline), an out-of-bounds read well beyond a few bytes that can disclose neighboring contents into the blit/display path.\nI:H - The same oversized clip drives iosys_map_memcpy_to() past the logical framebuffer into memory beyond the page-aligned GEM allocation (e.g. ~3KB past the BO for 1366x768x32), a kernel out-of-bounds write exploitable for heap corruption/control-flow impact.\nA:H - Accesses past the shadow/GEM allocations into unmapped vmalloc/guard regions can oops or panic the kernel, so availability impact is High."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:57:46.137Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"5.19.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}