summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorGeorge Kennedy <george.kennedy@oracle.com>2023-02-27 21:21:41 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-02-28 01:10:38 +0100
commit46d733d0efc79bc8430d63b57ab88011806d5180 (patch)
tree0eb7ac9986ebd3c5e13067765fefedd992dfa16a /drivers/tty
parentkunit: Fix 'hooks.o' build by recursing into kunit (diff)
downloadlinux-46d733d0efc79bc8430d63b57ab88011806d5180.tar.xz
linux-46d733d0efc79bc8430d63b57ab88011806d5180.zip
vc_screen: modify vcs_size() handling in vcs_read()
Restore the vcs_size() handling in vcs_read() to what it had been in previous version. Fixes: 226fae124b2d ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF") Suggested-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: George Kennedy <george.kennedy@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/vt/vc_screen.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index f566eb1839dc..c0a2273bb998 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -414,10 +414,8 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
*/
size = vcs_size(vc, attr, uni_mode);
if (size < 0) {
- if (read)
- break;
ret = size;
- goto unlock_out;
+ break;
}
if (pos >= size)
break;