Skip to content

Commit 46d733d

Browse files
gkennedy12torvalds
authored andcommitted
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: 226fae1 ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF") Suggested-by: Jiri Slaby <[email protected]> Signed-off-by: George Kennedy <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 32ff683 commit 46d733d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/tty/vt/vc_screen.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,8 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
414414
*/
415415
size = vcs_size(vc, attr, uni_mode);
416416
if (size < 0) {
417-
if (read)
418-
break;
419417
ret = size;
420-
goto unlock_out;
418+
break;
421419
}
422420
if (pos >= size)
423421
break;

0 commit comments

Comments
 (0)