Commit 46d733d0 authored by George Kennedy's avatar George Kennedy Committed by Linus Torvalds

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: 226fae12 ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF")
Suggested-by: default avatarJiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarGeorge Kennedy <george.kennedy@oracle.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 32ff6831
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment