[Bug 292993] panic in ng_eiface_mediastatus when stopping vnet_jail with netgraph

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 08 Mar 2026 07:08:30 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993

--- Comment #2 from Martin Lesser <ml-freebsd.org@bettercom.de> ---
Hi,

following the steps to reproduce. Both host and jail are running
15.0-RELEASE-p4.

If you need further information please let me know. So here we go:

# netgraph related modules loaded - kldstat:
 3    1 0xffffffff82157000     47f0 ng_eiface.ko
 4    4 0xffffffff8215c000    16ca8 netgraph.ko
 5    1 0xffffffff82173000     5b90 ng_ether.ko
 6    1 0xffffffff8217a000     6620 ng_bridge.ko

# net related lines in /etc/rc.conf of host:
ifconfig_em0="inet 192.168.168.3 netmask 255.255.255.0 up"
ifconfig_em0_ipv6="inet6 2a00:6020:50d7:5300::3/64 accept_rtadv"

# ifconfig (on host):
em0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0
mtu 1500
options=4e524bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>
        ether 68:05:ca:0d:6a:fd
        inet 192.168.168.3 netmask 0xffffff00 broadcast 192.168.168.255
        inet6 fe80::6a05:caff:fe0d:6afd%em0 prefixlen 64 scopeid 0x2
        inet6 2a00:6020:50d7:5300::3 prefixlen 64
        inet6 2a00:6020:50d7:5300:6a05:caff:fe0d:6afd prefixlen 64 autoconf
pltime 14400 vltime 86400
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

# /usr/local/etc/jail.conf.d/web.conf:
web { 
  ### STARTUP / LOGGING
  exec.start = "/bin/sh /etc/rc"; 
  exec.stop = "/bin/sh /etc/rc.shutdown"; 
  exec.consolelog = "/var/log/jail_console_${name}.log"; 

  ### PERMISSIONS
  allow.raw_sockets;
  allow.sysvipc;
  exec.clean; 
  mount.devfs; 

  ### HOSTNAME / PATH
  host.hostname = "${name}"; 
  path = "/mnt/jails/nullfs/${name}";
  $rpath = "/mnt/jails/realjails/${name}";

  ### NETWORKS / INTERFACES
  $id      = "210";
  $ip4     = "192.168.168.${id}/24";
  $ip6     = "2a00:6020:50d7:5300::${id}:3";
  $gw6     = "2a00:6020:50d7:5300::1";
  $gw4     = "192.168.168.1";
  $jif     = "em0";
  $if_uplink="${jif}";
  $if_name="ng0_${name}";
  vnet;
  vnet.interface = "${if_name}";
  exec.prestart += "jng bridge $name $if_uplink";
  exec.start    += "ifconfig ${if_name} ${ip4} up";
  exec.start    += "ifconfig ${if_name} inet6 ${ip6}";
  exec.start    += "route add default ${gw4}";
  exec.start    += "route add -inet6 default ${gw6}";
  exec.poststart += "ngctl msg ${if_uplink}: setpromisc 1";
  exec.poststart += "ngctl msg ${if_uplink}: setautosrc 0";
  exec.poststop = "ngctl shutdown $if_name:";
  mount += "${rpath}                     ${path}       nullfs   rw     0 0";
  mount += "/mnt/jails/templates/base15  ${path}/base  nullfs   ro     0 0";

# Starting the jail, jexec into it and ifconfig:
service jail start web
jexec web
ifconfig:

ng0_web: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric
0 mtu 1500
        options=28<VLAN_MTU,JUMBO_MTU>
        ether 02:40:b2:0d:6a:fd
        hwaddr 58:9c:fc:10:a0:6e
        inet 192.168.168.210 netmask 0xffffff00 broadcast 192.168.168.255
        inet6 2a00:6020:50d7:5300::210:3 prefixlen 64
        inet6 fe80::40:b2ff:fe0d:6afd%ng0_web prefixlen 64 scopeid 0x6
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

# Leaving jail and stopping it => panic

service jail web stop

-- 
You are receiving this mail because:
You are the assignee for the bug.