HomeFreeBSD

gntdev: Handle errors from suword32() in gntdev_alloc_gref()

Description

gntdev: Handle errors from suword32() in gntdev_alloc_gref()

Try to copy out output values before handling errors, and check that we
did so successfully. In particular, it doesn't seem sensible to ignore
errors here, otherwise userspace won't have any way to refer to the
allocations.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43145

(cherry picked from commit 6cdff09c0d70f780a738dbd3d87deb3b13ec8446)

Details

Provenance
markjAuthored on Dec 26 2023, 1:42 AM
Reviewer
royger
Differential Revision
D43145: gntdev: Handle errors from suword32() in gntdev_alloc_gref()
Parents
rG4392ef59412d: mpr: Handle errors from copyout() in ioctl handlers
Branches
Unknown
Tags
Unknown