]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
video: fbdev: sm712fb: Fix crash in smtcfb_read()
authorHelge Deller <deller@gmx.de>
Sun, 27 Feb 2022 07:43:56 +0000 (08:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:26 +0000 (13:57 +0200)
commite46779a5706941fb9cd6e0264427953eb77d7888
treee1400af3fb228032ee684e9eb0380b06b88d1a64
parent4d695d7c276f15adb1d2b64c584c3cf8f4f9e9ce
video: fbdev: sm712fb: Fix crash in smtcfb_read()

commit bd771cf5c4254511cc4abb88f3dab3bd58bdf8e8 upstream.

Zheyu Ma reported this crash in the sm712fb driver when reading
three bytes from the framebuffer:

 BUG: unable to handle page fault for address: ffffc90001ffffff
 RIP: 0010:smtcfb_read+0x230/0x3e0
 Call Trace:
  vfs_read+0x198/0xa00
  ? do_sys_openat2+0x27d/0x350
  ? __fget_light+0x54/0x340
  ksys_read+0xce/0x190
  do_syscall_64+0x43/0x90

Fix it by removing the open-coded endianess fixup-code and
by moving the pointer post decrement out the fb_readl() function.

Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: Zheyu Ma <zheyuma97@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/sm712fb.c