]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: fix end of range for access_ok
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 21 Aug 2017 19:33:33 +0000 (22:33 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 14 Nov 2017 21:57:39 +0000 (23:57 +0200)
commitee351356a7f02650fc3b7c2eca448d56cc3ea407
treea7b6258591856491ab4abd912c93b02958e81670
parentaf01b52987bb8a8b6eed1ae7c69bba3f56ae40b5
vhost: fix end of range for access_ok

During access_ok checks, addr increases as we iterate over the data
structure, thus addr + len - 1 will point beyond the end of region we
are translating.  Harmless since we then verify that the region covers
addr, but let's not waste cpu cycles.

Reported-by: Koichiro Den <den@klaipeden.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Koichiro Den <den@klaipeden.com>
drivers/vhost/vhost.c