Thread (5 messages) 5 messages, 3 authors, 2022-05-18

Re: [PATCH] vhost_net: fix double fget()

flat view

From: Jason Wang <hidden>
Date: 2022-05-18 04:10:35
Also in: kvm, linux-fsdevel, lkml, virtualization

On Wed, May 18, 2022 at 6:00 AM Al Viro [off-list ref] wrote:
On Mon, May 16, 2022 at 04:44:19AM -0400, Michael S. Tsirkin wrote:
quoted
quoted
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jason Wang <redacted>
Acked-by: Michael S. Tsirkin <mst@redhat.com>

and this is stable material I guess.
It is, except that commit message ought to be cleaned up.  Something
along the lines of

----
Fix double fget() in vhost_net_set_backend()

Descriptor table is a shared resource; two fget() on the same descriptor
may return different struct file references.  get_tap_ptr_ring() is
called after we'd found (and pinned) the socket we'll be using and it
tries to find the private tun/tap data structures associated with it.
Redoing the lookup by the same file descriptor we'd used to get the
socket is racy - we need to same struct file.

Thanks to Jason for spotting a braino in the original variant of patch -
I'd missed the use of fd == -1 for disabling backend, and in that case
we can end up with sock == NULL and sock != oldsock.
----

Does the above sound sane for commit message?
Yes.
And which tree would you
prefer it to go through?  I can take it in vfs.git#fixes, or you could
take it into your tree...
Consider Michael gave an ack, it would be fine if you want to take via
your tree.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help