Patch "drm/nouveau/fbcon: fix out-of-bounds memory accesses" has been added to the 4.6-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
drm/nouveau/fbcon: fix out-of-bounds memory accesses
to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-nouveau-fbcon-fix-out-of-bounds-memory-accesses.patch
and it can be found in the queue-4.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
f045f459d925138fe7d6193a8c86406bda7e49daMon Sep 17 00:00:00 2001
From: Ben Skeggs <[email protected]>
Date: Thu, 2 Jun 2016 12:23:31 +1000
Subject: drm/nouveau/fbcon: fix out-of-bounds memory accesses
From: Ben Skeggs <[email protected]>
commit f045f459d925138fe7d6193a8c86406bda7e49da upstream.
Reported by KASAN.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 1 + drivers/gpu/drm/nouveau/nv04_fbcon.c | 7 ++----- drivers/gpu/drm/nouveau/nv50_fbcon.c | 6 ++---- drivers/gpu/drm/nouveau/nvc0_fbcon.c | 6 ++---- 4 files changed, 7 insertions(+), 13 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +1 -0
@@ -557,6 +557,7 @@ nouveau_fbcon_init(struct drm_device *deif (ret) goto fini; + fbcon->helper.fbdev->pixmap.buf_align =4 ;return 0 ; fini:
drivers/gpu/drm/nouveau/nv04_fbcon.c +2 -5
@@ -82,7 +82,6 @@ nv04_fbcon_imageblit(struct fb_info *infuint32_t fg;uint32_t bg;uint32_t dsize; -uint32_t width;uint32_t *data = (uint32_t *)image->data;int ret;
@@ -93,9 +92,6 @@ nv04_fbcon_imageblit(struct fb_info *infif (ret)return ret; - width =ALIGN (image->width,8 ); - dsize =ALIGN (width * image->height,32 ) >>5 ; -if (info->fix.visual ==FB_VISUAL_TRUECOLOR || info->fix.visual ==FB_VISUAL_DIRECTCOLOR ) { fg = ((uint32_t *) info->pseudo_palette)[image->fg_color];
@@ -111,10 +107,11 @@ nv04_fbcon_imageblit(struct fb_info *inf ((image->dx + image->width) & 0xffff));OUT_RING (chan, bg);OUT_RING (chan, fg); -OUT_RING (chan, (image->height <<16 ) | width); +OUT_RING (chan, (image->height <<16 ) | image->width);OUT_RING (chan, (image->height <<16 ) | image->width);OUT_RING (chan, (image->dy <<16 ) | (image->dx &0xffff )); + dsize =ALIGN (image->width * image->height,32 ) >>5 ;while (dsize) {int iter_len = dsize >128 ?128 : dsize;
drivers/gpu/drm/nouveau/nv50_fbcon.c +2 -4
@@ -95,7 +95,7 @@ nv50_fbcon_imageblit(struct fb_info *infstruct nouveau_fbdev *nfbdev = info->par;struct nouveau_drm *drm =nouveau_drm (nfbdev->dev);struct nouveau_channel *chan = drm->channel; -uint32_t width, dwords, *data = (uint32_t *)image->data; +uint32_t dwords, *data = (uint32_t *)image->data;uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));uint32_t *palette = info->pseudo_palette;int ret;
@@ -107,9 +107,6 @@ nv50_fbcon_imageblit(struct fb_info *infif (ret)return ret; - width =ALIGN (image->width,32 ); - dwords = (width * image->height) >>5 ; -BEGIN_NV04 (chan, NvSub2D,0x0814 ,2 );if (info->fix.visual ==FB_VISUAL_TRUECOLOR || info->fix.visual ==FB_VISUAL_DIRECTCOLOR ) {
@@ -128,6 +125,7 @@ nv50_fbcon_imageblit(struct fb_info *infOUT_RING (chan,0 );OUT_RING (chan, image->dy); + dwords =ALIGN (image->width * image->height,32 ) >>5 ;while (dwords) {int push = dwords >2047 ?2047 : dwords;
drivers/gpu/drm/nouveau/nvc0_fbcon.c +2 -4
@@ -95,7 +95,7 @@ nvc0_fbcon_imageblit(struct fb_info *infstruct nouveau_fbdev *nfbdev = info->par;struct nouveau_drm *drm =nouveau_drm (nfbdev->dev);struct nouveau_channel *chan = drm->channel; -uint32_t width, dwords, *data = (uint32_t *)image->data; +uint32_t dwords, *data = (uint32_t *)image->data;uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));uint32_t *palette = info->pseudo_palette;int ret;
@@ -107,9 +107,6 @@ nvc0_fbcon_imageblit(struct fb_info *infif (ret)return ret; - width =ALIGN (image->width,32 ); - dwords = (width * image->height) >>5 ; -BEGIN_NVC0 (chan, NvSub2D,0x0814 ,2 );if (info->fix.visual ==FB_VISUAL_TRUECOLOR || info->fix.visual ==FB_VISUAL_DIRECTCOLOR ) {
@@ -128,6 +125,7 @@ nvc0_fbcon_imageblit(struct fb_info *infOUT_RING (chan,0 );OUT_RING (chan, image->dy); + dwords =ALIGN (image->width * image->height,32 ) >>5 ;while (dwords) {int push = dwords >2047 ?2047 : dwords;
Patches currently in stable-queue which might be from [email protected] are
queue-4.6/drm-nouveau-fix-for-disabled-fbdev-emulation.patch queue-4.6/drm-nouveau-disp-sor-gf119-both-links-use-the-same-training-register.patch queue-4.6/drm-nouveau-gr-gf100-update-sm-error-decoding-from-gk20a-nvgpu-headers.patch queue-4.6/drm-nouveau-revert-drm-nouveau-device-pci-set-as-non-cpu-coherent-on-arm64.patch queue-4.6/drm-nouveau-bios-disp-fix-handling-of-match-any-protocol-entries.patch queue-4.6/drm-nouveau-disp-sor-gf119-select-correct-sor-when-poking-training-pattern.patch queue-4.6/drm-nouveau-disp-sor-gm107-training-pattern-registers-are-like-gm200.patch queue-4.6/drm-nouveau-fbcon-fix-out-of-bounds-memory-accesses.patch queue-4.6/drm-nouveau-ltc-gm107-fix-typo-in-the-address-of-nv_pltcg_ltc0_lts0_intr.patch