]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fbdev: fix potential OOB read in fast_imageblit()
authorZhang Shurong <zhang_shurong@foxmail.com>
Sat, 24 Jun 2023 16:16:49 +0000 (00:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:23:10 +0000 (16:23 +0200)
commit570f52137e9ae94e74635e389f20842f484f6416
tree45c69c98fb1e2741b69966c7233e57a23f002246
parent31131cce2455782d704279210d1e4734cb32c593
fbdev: fix potential OOB read in fast_imageblit()

[ Upstream commit c2d22806aecb24e2de55c30a06e5d6eb297d161d ]

There is a potential OOB read at fast_imageblit, for
"colortab[(*src >> 4)]" can become a negative value due to
"const char *s = image->data, *src".
This change makes sure the index for colortab always positive
or zero.

Similar commit:
https://patchwork.kernel.org/patch/11746067

Potential bug report:
https://groups.google.com/g/syzkaller-bugs/c/9ubBXKeKXf4/m/k-QXy4UgAAAJ

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/core/sysimgblt.c