]> git.baikalelectronics.ru Git - kernel.git/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)
commit43964d2cd4587ff0cd85f0f26118a749ccdc27f6
tree1e66542707b886f85e9038511ddc6b0a4c88221d
parent245a7862650dff7dca73b15ca3d22395b408f62e
vc_screen: rewrite vcs_size to accept vc, not inode

[ Upstream commit 165a454bc642611c0708c21f126314bb5eaaeb86 ]

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