* [Bug 1904486] [NEW] resource leak in /net/tap.c
@ 2020-11-17 2:15 yuanjungong
2020-11-17 6:08 ` [Bug 1904486] " yuanjungong
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: yuanjungong @ 2020-11-17 2:15 UTC (permalink / raw)
To: qemu-devel
Public bug reported:
Hi,there might be a resource leak in function net_init_tap in
/net/tap.c.
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.
** Affects: qemu
Importance: Undecided
Status: New
--
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:
New
Bug description:
Hi,there might be a resource leak in function net_init_tap in
/net/tap.c.
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
@ 2020-11-17 6:08 ` yuanjungong
2020-11-17 10:26 ` Alex Chen
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: yuanjungong @ 2020-11-17 6:08 UTC (permalink / raw)
To: qemu-devel
** Description changed:
Hi,there might be a resource leak in function net_init_tap in
- /net/tap.c.
+ /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 }
+
+ 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.
--
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:
New
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
2020-11-17 6:08 ` [Bug 1904486] " yuanjungong
@ 2020-11-17 10:26 ` Alex Chen
2020-11-20 1:57 ` Alex Chen
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Chen @ 2020-11-17 10:26 UTC (permalink / raw)
To: qemu-devel
hi yuanjungong,
You can send a patch to qemu-devel mailing list(https://wiki.qemu.org/MailingLists) to fix this memleak according to https://wiki.qemu.org/Contribute/SubmitAPatch.
Thanks.
--
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:
New
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
2020-11-17 6:08 ` [Bug 1904486] " yuanjungong
2020-11-17 10:26 ` Alex Chen
@ 2020-11-20 1:57 ` Alex Chen
2020-11-20 2:16 ` yuanjungong
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Alex Chen @ 2020-11-20 1:57 UTC (permalink / raw)
To: qemu-devel
Hi yuanjungong,
If you don't have time to submit a patch, can I submit a patch to fix
it?
--
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:
New
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
` (2 preceding siblings ...)
2020-11-20 1:57 ` Alex Chen
@ 2020-11-20 2:16 ` yuanjungong
2020-11-20 2:35 ` yuanjungong
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: yuanjungong @ 2020-11-20 2:16 UTC (permalink / raw)
To: qemu-devel
A patch has been submitted at https://lists.nongnu.org/archive/html
/qemu-trivial/2020-11/msg00355.html
--
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:
New
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
` (3 preceding siblings ...)
2020-11-20 2:16 ` yuanjungong
@ 2020-11-20 2:35 ` yuanjungong
2020-11-21 23:37 ` Peter Maydell
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: yuanjungong @ 2020-11-20 2:35 UTC (permalink / raw)
To: qemu-devel
Hi Alex,
Thanks for offering to help, but I submitted a patch to the maillist
yesterday. Thank you again.
--
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:
New
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
` (4 preceding siblings ...)
2020-11-20 2:35 ` yuanjungong
@ 2020-11-21 23:37 ` Peter Maydell
2020-12-01 13:05 ` Peter Maydell
2020-12-10 8:49 ` Thomas Huth
7 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2020-11-21 23:37 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
` (5 preceding siblings ...)
2020-11-21 23:37 ` Peter Maydell
@ 2020-12-01 13:05 ` Peter Maydell
2020-12-10 8:49 ` Thomas Huth
7 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2020-12-01 13:05 UTC (permalink / raw)
To: qemu-devel
Fix now in master for 5.2 as commit f012bec8909820390936
** Changed in: qemu
Status: Confirmed => Fix Committed
--
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:
Fix Committed
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug 1904486] Re: resource leak in /net/tap.c
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
` (6 preceding siblings ...)
2020-12-01 13:05 ` Peter Maydell
@ 2020-12-10 8:49 ` Thomas Huth
7 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-12-10 8:49 UTC (permalink / raw)
To: qemu-devel
Released with QEMU v5.2.0.
** Changed in: qemu
Status: Fix Committed => Fix Released
--
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:
Fix Released
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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-12-10 9:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 2:15 [Bug 1904486] [NEW] resource leak in /net/tap.c yuanjungong
2020-11-17 6:08 ` [Bug 1904486] " yuanjungong
2020-11-17 10:26 ` Alex Chen
2020-11-20 1:57 ` Alex Chen
2020-11-20 2:16 ` yuanjungong
2020-11-20 2:35 ` yuanjungong
2020-11-21 23:37 ` Peter Maydell
2020-12-01 13:05 ` Peter Maydell
2020-12-10 8:49 ` Thomas Huth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.