qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1904486] Re: resource leak in /net/tap.c


From: Peter Maydell
Subject: [Bug 1904486] Re: resource leak in /net/tap.c
Date: Sat, 21 Nov 2020 23:37:55 -0000

Hi -- the patch looks good to me, but it looks like you didn't send it
to qemu-devel, only to qemu-trivial. Would you mind resending it to the
right list, please? (You can cc qemu-trivial if you like, but all
patches have to go to the main qemu-devel list, because systems like
patchew https://patchew.org/QEMU/ and also many developers only read the
main list.)


** Changed in: qemu
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1904486

Title:
  resource leak in /net/tap.c

Status in QEMU:
  Confirmed

Bug description:
  Hi,there might be a resource leak in function net_init_tap in
  /net/tap.c. The version is 5.1.91.

  
   811         fd = monitor_fd_param(monitor_cur(), tap->fd, errp);
   812         if (fd == -1) {
   813             return -1;
   814         }
   815
   816         ret = qemu_try_set_nonblock(fd);
   817         if (ret < 0) {
   818             error_setg_errno(errp, -ret, "%s: Can't use file descriptor 
%d",
   819                              name, fd);
   820             return -1;
   821         }
   822
   823         vnet_hdr = tap_probe_vnet_hdr(fd, errp);
   824         if (vnet_hdr < 0) {
   825             close(fd);
   826             return -1;
   827         }
   828
   829         net_init_tap_one(tap, peer, "tap", name, NULL,
   830                          script, downscript,
   831                          vhostfdname, vnet_hdr, fd, &err);
   832         if (err) {
   833             error_propagate(errp, err);
   834             return -1;
   835         }

  fd should be closed before return in line 820 and line 834, similar to
  the implementation in line 825.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1904486/+subscriptions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]