Summary: | ifconfig: Deleting (or re-setting) an IP address holds (leaks?) memory | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | ghuckriede | ||||
Component: | kern | Assignee: | Mark Johnston <markj> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Many People | CC: | markj, net | ||||
Priority: | --- | Flags: | koobs:
mfc-stable12+
koobs: mfc-stable11- |
||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D22912 | ||||||
Attachments: |
|
Description
ghuckriede
2019-12-20 21:13:27 UTC
I'll take a look at this. Created attachment 210181 [details]
patch
This patch fixes the problem in my own testing - would you be willing to try it?
Sure I'll try it. A HEAD dev environment was not available, so the patch was tested on a 12.1 based build (which was where this issue was discovered). The reported leak was gone with the provided patch. Also tested detaching em interface while receiving traffic. No crash nor memory leak was observed. A commit references this bug: Author: markj Date: Fri Dec 27 01:12:54 UTC 2019 New revision: 356107 URL: https://svnweb.freebsd.org/changeset/base/356107 Log: Plug some ifaddr refcount leaks. - Only take an ifaddr ref in in rt_exportinfo() if the caller explicitly requests it. Take care to release it in this case. - Don't unconditionally take a ref in rtrequest1_fib(). rt_getifa_fib() will acquire a reference, in which case we would previously acquire two references. - Stop taking a reference in rtinit1() before calling rtrequest1_fib(). rtrequest1_fib() will acquire a reference for the RTM_ADD case. PR: 242746 Reviewed by: melifaro (previous version) Tested by: ghuckriede@blackberry.com MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22912 Changes: head/sys/net/route.c A commit references this bug: Author: markj Date: Fri Jan 3 00:29:10 UTC 2020 New revision: 356312 URL: https://svnweb.freebsd.org/changeset/base/356312 Log: MFC r356107: Plug some ifaddr refcount leaks. PR: 242746 Changes: _U stable/12/ stable/12/sys/net/route.c |