The problem is in the rm_ifinfo function. If the ifi structure is freed at https://svnweb.freebsd.org/base/head/usr.sbin/rtadvd/config.c?revision=289750&view=markup#l237 it is then accessed at https://svnweb.freebsd.org/base/head/usr.sbin/rtadvd/config.c?revision=289750&view=markup#l246 and further.
Created attachment 165294 [details] Proposed patch (untested)
The code here looks very strange to me. I added the patch, that fixes (probably possible) leak of rainfo when ifi is removed, and avoids reported use after free. But I have no idea how to test it.
Created attachment 165295 [details] Proposed patch (untested)
Created attachment 165296 [details] Proposed patch (untested) Another cleanup :)
Created attachment 165297 [details] Proposed patch (untested) Grrr.. Now seems ok.
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
This was fixed in a different way in commit 5c4eb897462928e39604144796e7ffa206845616.