lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <275a5a94-1c69-4eb0-a9d0-4b397073555f@app.fastmail.com>
Date: Wed, 29 Oct 2025 20:21:20 +0200
From: "Leon Romanovsky" <leon@...nel.org>
To: "Alex Mastro" <amastro@...com>
Cc: "Alex Williamson" <alex.williamson@...hat.com>,
 "Leon Romanovsky" <leonro@...dia.com>, "Jason Gunthorpe" <jgg@...dia.com>,
 "Andrew Morton" <akpm@...ux-foundation.org>,
 "Bjorn Helgaas" <bhelgaas@...gle.com>,
 Christian König <christian.koenig@....com>,
 dri-devel@...ts.freedesktop.org, iommu@...ts.linux.dev,
 "Jens Axboe" <axboe@...nel.dk>, "Joerg Roedel" <joro@...tes.org>,
 kvm@...r.kernel.org, linaro-mm-sig@...ts.linaro.org,
 linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-media@...r.kernel.org, linux-mm@...ck.org, linux-pci@...r.kernel.org,
 "Logan Gunthorpe" <logang@...tatee.com>,
 "Marek Szyprowski" <m.szyprowski@...sung.com>,
 "Robin Murphy" <robin.murphy@....com>,
 "Sumit Semwal" <sumit.semwal@...aro.org>,
 "Vivek Kasireddy" <vivek.kasireddy@...el.com>,
 "Will Deacon" <will@...nel.org>
Subject: Re: [PATCH v5 9/9] vfio/pci: Add dma-buf export support for MMIO regions



On Wed, Oct 29, 2025, at 18:50, Alex Mastro wrote:
> On Mon, Oct 13, 2025 at 06:26:11PM +0300, Leon Romanovsky wrote:
>> +	/*
>> +	 * dma_buf_fd() consumes the reference, when the file closes the dmabuf
>> +	 * will be released.
>> +	 */
>> +	return dma_buf_fd(priv->dmabuf, get_dma_buf.open_flags);
>
> I think this still needs to unwind state on fd allocation error. Reference
> ownership is only transferred on success.

Yes, you are correct, i need to call to dma_buf_put() in case of error. I will fix.

Thanks

>
>> +
>> +err_dev_put:
>> +	vfio_device_put_registration(&vdev->vdev);
>> +err_free_phys:
>> +	kfree(priv->phys_vec);
>> +err_free_priv:
>> +	kfree(priv);
>> +err_free_ranges:
>> +	kfree(dma_ranges);
>> +	return ret;
>> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ