Re: [PATCH] uio: uio_pci_generic_sva: reject multiple opens
From: Greg Kroah-Hartman
Date: Wed Oct 28 2026 - 04:05:08 EST
On Wed, Oct 28, 2026 at 09:27:26AM +0200, Avi Weiss wrote:
> uio_pci_sva_open() stores an SVA binding handle in device-wide state.
> A second open from another address space overwrites that handle. Closing
> the two descriptors then unbinds the second handle twice and leaves the
> first binding active.
>
> Reject another open while a binding is active and clear the handle on
> release. UIO core already serializes the callbacks under info_lock.
That's up to userspace to protect, as it can pass around file
descriptors to other processes just fine, and the kernel can't do
anything about that, so this type of change doesn't make much sense.
In other words, if you open the device multiple times, that's your
problem, you get to keep both pieces :)
thanks,
greg k-h