提交 46d733d0 编写于 作者: G George Kennedy 提交者: 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: NJiri Slaby <jirislaby@kernel.org>
Signed-off-by: NGeorge Kennedy <george.kennedy@oracle.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册