mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
vc_screen: modify vcs_size() handling in vcs_read()
[ Upstream commit46d733d0ef] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
821362a2df
commit
9c7c1cf29f
@@ -296,10 +296,8 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
*/
|
||||
size = vcs_size(inode);
|
||||
if (size < 0) {
|
||||
if (read)
|
||||
break;
|
||||
ret = size;
|
||||
goto unlock_out;
|
||||
break;
|
||||
}
|
||||
if (pos >= size)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user