In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau: fix a use-after-free in nouveaugemprimeimportsg_table()
nouveauboinit() is backed by ttmboinit() and ferries its return code back to the caller. On failures, ttm will call nouveaubodelttm() and free the memory.Thus, when nouveauboinit() returns an error, the gem object has already been released. Then the call to nouveaubo_ref() will use the freed "nvbo->bo" and lead to a use-after-free bug.
We should delete the call to nouveauboref() to avoid the use-after-free.