]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commit
Fix double-free on error condition in GnttabPermitForeignAccess()
authorRafał Wojdyła <omeg@invisiblethingslab.com>
Thu, 7 Mar 2024 10:19:01 +0000 (11:19 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Thu, 14 Mar 2024 09:36:54 +0000 (09:36 +0000)
commit1019522273c7080d73885e38e972092df4fcce0f
tree03c579745dd60a8f2c31c8cff53ba68098fc32cf
parent4fba5b8f39be60911f3cb2e3140e0bcad3092c7b
Fix double-free on error condition in GnttabPermitForeignAccess()

XENIFACE_GNTTAB_CONTEXT associated with the request was incorrectly freed
by GnttabPermitForeignAccess() when a failure occured. The context is also
freed by the parent function, IoctlGnttabPermitForeignAccess(), which led
to a double-free and kernel heap corruption.

GnttabStopSharing() as the final step in the failure path takes care
of cleaning up the contents of the (possibly partially initialized) context.

Signed-off-by: Rafał Wojdyła <omeg@invisiblethingslab.com>
Reviewed-by: Owen Smith <owen.smith@cloud.com>
src/xeniface/ioctl_gnttab.c