In the Linux kernel, the following vulnerability has been resolved:
nfsd: call oprelease, even when opfunc returns an error
For ops with "trivial" replies, nfsd4encodeoperation will shortcut most of the encoding work and skip to just marshalling up the status. One of the things it skips is calling op_release. This could cause a memory leak in the layoutget codepath if there is an error at an inopportune time.
Have the compound processing engine always call oprelease, even when opfunc sets an error in op->status. With this change, we also need nfsd4blockgetdeviceinfoscsi to set the gddevice pointer to NULL on error to avoid a double free.