Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 719aee2c authored by Alex Williamson's avatar Alex Williamson Committed by Greg Kroah-Hartman
Browse files

vfio/type1: Fix unmap overflow off-by-one

commit 58fec830fc19208354895d9832785505046d6c01 upstream.

The below referenced commit adds a test for integer overflow, but in
doing so prevents the unmap ioctl from ever including the last page of
the address space.  Subtract one to compare to the last address of the
unmap to avoid the overflow and wrap-around.

Fixes: 71a7d3d7 ("vfio/type1: silence integer overflow warning")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1662291


Cc: stable@vger.kernel.org # v4.15+
Reported-by: default avatarPei Zhang <pezhang@redhat.com>
Debugged-by: default avatarPeter Xu <peterx@redhat.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
Tested-by: default avatarPeter Xu <peterx@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1e235ec0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment