mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 11:44:11 +00:00
fbdev: fix potential OOB read in fast_imageblit()
[ Upstream commit c2d22806ae
]
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>
This commit is contained in:
parent
8b292f13d8
commit
cfead8943c
1 changed files with 1 additions and 1 deletions
|
@ -189,7 +189,7 @@ static void fast_imageblit(const struct fb_image *image, struct fb_info *p,
|
|||
u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
|
||||
u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
|
||||
u32 bit_mask, eorx, shift;
|
||||
const char *s = image->data, *src;
|
||||
const u8 *s = image->data, *src;
|
||||
u32 *dst;
|
||||
const u32 *tab;
|
||||
size_t tablen;
|
||||
|
|
Loading…
Add table
Reference in a new issue