mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
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: 226fae124b
("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>
This commit is contained in:
parent
32ff6831cd
commit
46d733d0ef
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user