[PATCH v2 0/2] net: tap: check file descriptor can be used

Laurent Vivier posted 2 patches 1 week ago
Test FreeBSD passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200630145737.232095-1-lvivier@redhat.com
Maintainers: Stefan Weil <sw@weilnetz.de>, "Daniel P. Berrangé" <berrange@redhat.com>, Jason Wang <jasowang@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
include/qemu/sockets.h |  1 +
net/tap-bsd.c          |  2 +-
net/tap-linux.c        |  8 +++++---
net/tap-solaris.c      |  2 +-
net/tap-stub.c         |  2 +-
net/tap.c              | 38 +++++++++++++++++++++++++++++++++-----
net/tap_int.h          |  2 +-
util/oslib-posix.c     |  5 +++++
util/oslib-win32.c     |  6 ++++++
9 files changed, 54 insertions(+), 12 deletions(-)

[PATCH v2 0/2] net: tap: check file descriptor can be used

Posted by Laurent Vivier 1 week ago
v2: Add patch from Daniel to check the fd can be used

    I have updated Daniel's patch not to check for EINVAL on TUNGETIFF
    as I think we can avoid this special case because TUNGETIFF
    is available since kernel v2.6.27 (October 2008)
    Moreover I think the code was wrong as it was checking with -EINVAL and
    not EINVAL.

Daniel P. Berrang�� (1):
  net: detect errors from probing vnet hdr flag for TAP devices

Laurent Vivier (1):
  net: tap: check if the file descriptor is valid before using it

 include/qemu/sockets.h |  1 +
 net/tap-bsd.c          |  2 +-
 net/tap-linux.c        |  8 +++++---
 net/tap-solaris.c      |  2 +-
 net/tap-stub.c         |  2 +-
 net/tap.c              | 38 +++++++++++++++++++++++++++++++++-----
 net/tap_int.h          |  2 +-
 util/oslib-posix.c     |  5 +++++
 util/oslib-win32.c     |  6 ++++++
 9 files changed, 54 insertions(+), 12 deletions(-)

-- 
2.26.2



Re: [PATCH v2 0/2] net: tap: check file descriptor can be used

Posted by Daniel P. Berrangé 1 week ago
On Tue, Jun 30, 2020 at 04:57:35PM +0200, Laurent Vivier wrote:
> v2: Add patch from Daniel to check the fd can be used
> 
>     I have updated Daniel's patch not to check for EINVAL on TUNGETIFF
>     as I think we can avoid this special case because TUNGETIFF
>     is available since kernel v2.6.27 (October 2008)
>     Moreover I think the code was wrong as it was checking with -EINVAL and
>     not EINVAL.

Agreed, given our documented OS platform targets, we don't need to
care about such old kernels.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|