FAILED: patch "[PATCH] drm/sysfb: simpledrm: Improve stride validation" failed to apply to 6.12-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x df6533f11688aa30be3bb883c7637f4ffdbb7cbd
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090938-kissing-slacking-a098@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From df6533f11688aa30be3bb883c7637f4ffdbb7cbd Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <[email protected]>
Date: Thu, 25 Jun 2026 11:39:36 +0200
Subject: [PATCH] drm/sysfb: simpledrm: Improve stride validation
Validate the computed stride against the maximum value INT_MAX.
drivers/gpu/drm/sysfb/simpledrm.c +8 -2
@@ -703,9 +703,15 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,return ERR_PTR (-ENODEV ); }if (!stride) { - stride =drm_format_info_min_pitch (format,0 , width); -if (drm_WARN_ON (dev, !stride)) +u64 pitch =drm_format_info_min_pitch (format,0 , width); + +if (drm_WARN_ON (dev, !pitch)) { +return ERR_PTR (-EINVAL );/* driver bug */ + }else if (pitch >INT_MAX ) { +drm_warn (dev,"stride of %llu exceeds maximum\n" , pitch);return ERR_PTR (-EINVAL ); + } + stride = pitch; } sysfb->fb_mode =drm_sysfb_mode (width, height, width_mm, height_mm);
Sasha Levin
maintainerPATCH 1/1 drm/sysfb: simpledrm: Improve stride validation
From: Thomas Zimmermann <[email protected]>
[ Upstream commit df6533f11688aa30be3bb883c7637f4ffdbb7cbd ]
Validate the computed stride against the maximum value INT_MAX.
--- drivers/gpu/drm/tiny/simpledrm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +8 -2
@@ -853,9 +853,15 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,return ERR_PTR (-ENODEV ); }if (!stride) { - stride =drm_format_info_min_pitch (format,0 , width); -if (drm_WARN_ON (dev, !stride)) +u64 pitch =drm_format_info_min_pitch (format,0 , width); + +if (drm_WARN_ON (dev, !pitch)) { +return ERR_PTR (-EINVAL );/* driver bug */ + }else if (pitch >INT_MAX ) { +drm_warn (dev,"stride of %llu exceeds maximum\n" , pitch);return ERR_PTR (-EINVAL ); + } + stride = pitch; }/*
Signature · 1 line
2.53.0