diff options
| author | George Kennedy <george.kennedy@oracle.com> | 2023-02-27 15:21:41 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 16:31:59 +0100 |
| commit | 61a96ad27addecaba100213c7089bf2ebd20c6e4 (patch) | |
| tree | 4023c596efe41028ba126a3b194e9eae0995418a | |
| parent | e10363d33de07ff03f60405f4ba7614752ad44c8 (diff) | |
vc_screen: modify vcs_size() handling in vcs_read()
[ Upstream commit 46d733d0efc79bc8430d63b57ab88011806d5180 ]
Restore the vcs_size() handling in vcs_read() to what
it had been in previous version.
Fixes: 226fae124b2d ("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>
| -rw-r--r-- | drivers/tty/vt/vc_screen.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 5b5e800ab154..28bc9c70de3e 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -278,10 +278,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; |
