]> git.itanic.dy.fi Git - linux-stable/commit
vc_screen: rewrite vcs_size to accept vc, not inode
authorJiri Slaby <jslaby@suse.cz>
Tue, 18 Aug 2020 08:56:55 +0000 (10:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:08 +0000 (12:44 +0100)
commit74e644795d37a2eff40dbb049e6c72a067a3b4e1
tree1e66542707b886f85e9038511ddc6b0a4c88221d
parente9399d4ea5ee9a7589ad5fa9889bdf8a2f9cc925
vc_screen: rewrite vcs_size to accept vc, not inode

[ Upstream commit 71d4abfab322e827a75304431fe0fad3c805cb80 ]

It is weird to fetch the information from the inode over and over. Read
and write already have the needed information, so rewrite vcs_size to
accept a vc, attr and unicode and adapt vcs_lseek to that.

Also make sure all sites check the return value of vcs_size for errors.

And document it using kernel-doc.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200818085706.12163-5-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 8fb9ea65c9d1 ("vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/vt/vc_screen.c