In the Linux kernel, the following vulnerability has been resolved:
xen/privcmd: fix error exit of privcmdioctldm_op()
The error exit of privcmdioctldmop() is calling unlockpages() potentially with pages being NULL, leading to a NULL dereference.
Additionally lockpages() doesn't check for pinuserpagesfast() having been completely successful, resulting in potentially not locking all pages into memory. This could result in sporadic failures when using the related memory in user mode.
Fix all of that by calling unlockpages() always with the real number of pinned pages, which will be zero in case pages being NULL, and by checking the number of pages pinned by pinuserpagesfast() matching the expected number of pages.