linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] vc_screen: modify vcs_size() handling in vcs_read()
@ 2023-02-27 20:21 George Kennedy
  2023-02-28  0:12 ` Linus Torvalds
  2023-02-28  1:45 ` linux
  0 siblings, 2 replies; 6+ messages in thread
From: George Kennedy @ 2023-02-27 20:21 UTC (permalink / raw)
  To: jirislaby, gregkh, torvalds
  Cc: george.kennedy, sfr, akpm, linux-kernel, linux-serial, linux,
	regressions

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>
---
v2: added Fixes

 drivers/tty/vt/vc_screen.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index f566eb1839dc..c0a2273bb998 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -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;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-28  2:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 20:21 [PATCH v2] vc_screen: modify vcs_size() handling in vcs_read() George Kennedy
2023-02-28  0:12 ` Linus Torvalds
2023-02-28  1:45 ` linux
2023-02-28  1:58   ` Linus Torvalds
2023-02-28  2:18     ` Thomas Weißschuh
2023-02-28  2:40       ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).