Bug 222647 - VIMAGE jail: ifa_maintain_loopback_route: deletion failed for interface lo0: 48
Summary: VIMAGE jail: ifa_maintain_loopback_route: deletion failed for interface lo0: 48
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords: vimage
Depends on:
Blocks:
 
Reported: 2017-09-27 16:14 UTC by Marie Helene Kvello-Aune
Modified: 2017-11-20 09:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marie Helene Kvello-Aune 2017-09-27 16:14:18 UTC
When stopping a VIMAGE jail, the message "ifa_maintain_loopback_route: deletion failed for interface lo0: 48" appears in the output of dmesg. The message appears only for lo0, even when several interfaces are present in the VIMAGE jail.

The following jail.conf reproduces the error message.

exec.start              = "/bin/sh /etc/rc";
exec.stop               = "/bin/sh /etc/rc.shutdown";
exec.clean;
mount.devfs;
path                    = "/usr/jails/$name";

devsamba {
  vnet;
}

There does not appear to be any adverse effects of this error, but I figure it might be a symptom of a more fundamental/severe bug.

#uname -a
FreeBSD venus 12.0-CURRENT FreeBSD 12.0-CURRENT #18 r323223M: Sun Sep 10 16:41:41 CEST 2017     root@venus:/usr/obj/usr/src/sys/Venus  amd64


# cat /usr/src/sys/amd64/conf/Venus
include GENERIC
ident Venus
options VIMAGE
device epair
Comment 1 Kristof Provost freebsd_committer freebsd_triage 2017-10-25 19:32:02 UTC
Okay, so this happens during this:

When destroying a vnet jail:
  1  57808     ifa_del_loopback_route:entry
              kernel`in6_purgeaddr+0x33
              kernel`ip6_destroy+0x142
              kernel`vnet_destroy+0x12c
              kernel`prison_deref+0x29c
              kernel`taskqueue_run_locked+0x15d
              kernel`taskqueue_thread_loop+0x88
              kernel`fork_exit+0x84
              kernel`0xffffffff80ef1b3e

Basically, ifa_del_loopback_route tries to delete the ::1 route on lo0 (in the vnet jail) and can't because this route is RTF_PINNED. I'm not sure I fully understand what that all implies, so I'm hesitant to change anything.

I'm pretty sure this is mostly harmless though.
Comment 2 Eugene Grosbein freebsd_committer freebsd_triage 2017-11-05 04:05:22 UTC
The root of this problem seems to be the same as of another problem described in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223129

Please try applying patch attached to PR 223129, then rebuild/boot new kernel. It should help.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-11-05 14:42:19 UTC
A commit references this bug:

Author: eugen
Date: Sun Nov  5 14:41:49 UTC 2017
New revision: 325436
URL: https://svnweb.freebsd.org/changeset/base/325436

Log:
  Allow a process to assign an IP address to local ppp interface
  even if kernel routing table already has a route to the address in question
  installed by some routing daemon (PR 223129).

  Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

  PR:			222647, 223129
  Reviewed by:		gnn
  Approved by:		avg (mentor), mav (mentor)
  MFC after:		2 weeks
  Differential Revision:	https://reviews.freebsd.org/D12747

Changes:
  head/sys/net/if.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-11-20 09:24:03 UTC
A commit references this bug:

Author: eugen
Date: Mon Nov 20 09:23:09 UTC 2017
New revision: 326011
URL: https://svnweb.freebsd.org/changeset/base/326011

Log:
  MFC r325436: RTF_PINNED for an interface

    Allow a process to assign an IP address to local ppp interface
    even if kernel routing table already has a route to the address in question
    installed by some routing daemon (PR 223129).

    Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

  PR:			222647, 223129
  Reviewed by:		gnn
  Approved by:		mav (mentor)
  Differential Revision:	https://reviews.freebsd.org/D12747

Changes:
_U  stable/11/
  stable/11/sys/net/if.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-11-20 09:25:08 UTC
A commit references this bug:

Author: eugen
Date: Mon Nov 20 09:24:02 UTC 2017
New revision: 326012
URL: https://svnweb.freebsd.org/changeset/base/326012

Log:
  MFC r325436: RTF_PINNED for an interface

    Allow a process to assign an IP address to local ppp interface
    even if kernel routing table already has a route to the address in question
    installed by some routing daemon (PR 223129).

    Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647).

  PR:			222647, 223129
  Reviewed by:		gnn
  Approved by:		mav (mentor)
  Differential Revision:	https://reviews.freebsd.org/D12747

Changes:
_U  stable/10/
  stable/10/sys/net/if.c
Comment 6 Eugene Grosbein freebsd_committer freebsd_triage 2017-11-20 09:27:43 UTC
Feedback timeout. Additionally, this is believed to be fixed with r325436 and following MFCs r326011 and r326012. If not, feel free to reopen this PR.