]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
vm86: get rid of get_user_ex() use
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 15 Feb 2020 17:09:14 +0000 (12:09 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 19 Mar 2020 00:04:00 +0000 (20:04 -0400)
commitc63aad695dceb08290be7845052d7d3f1d457416
tree5833d226e6578bf4cc8ac702c632ce1ae3dfaf14
parent4b842e4e25b12951fa10dedb4bc16bc47e3b850c
vm86: get rid of get_user_ex() use

Just do a copyin of what we want into a local variable and
be done with that.  We are guaranteed to be on shallow stack
here...

Note that conditional expression for range passed to access_ok()
in mainline had been pointless all along - the only difference
between vm86plus_struct and vm86_struct is that the former has
one extra field in the end and when we get to copyin of that
field (conditional upon 'plus' argument), we use copy_from_user().
Moreover, all fields starting with ->int_revectored are copied
that way, so we only need that check (be it done by access_ok()
or by user_access_begin()) only on the beginning of the structure -
the fields that used to be covered by that get_user_try() block.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/x86/kernel/vm86_32.c