summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorGeorge Kennedy <george.kennedy@oracle.com>2023-02-27 23:21:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 15:50:34 +0300
commitf58b4378e1f37021173f0c551fa4869b3a12415c (patch)
treeb18144a05dc5ec8ae83df0a652e80b9544a00b5f /drivers/tty/vt
parentea13db527988137ef80d4366dfc8af4ffec4fca9 (diff)
downloadlinux-f58b4378e1f37021173f0c551fa4869b3a12415c.tar.xz
vc_screen: modify vcs_size() handling in vcs_read()
[ Upstream commit 46d733d0efc79bc8430d63b57ab88011806d5180 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/tty/vt')
-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 71e091f879f0..1dc07f9214d5 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -415,10 +415,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;