[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

Hiroki Sato h...@freebsd.org changed:

   What|Removed |Added

   Assignee|freebsd-net@FreeBSD.org |h...@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

--- Comment #11 from Hiroki Sato h...@freebsd.org ---
Created attachment 151999
  -- https://bugs.freebsd.org/bugzilla/attachment.cgi?id=151999action=edit
a patch to fix this panic

This patch should fix the panic.  As Bjoern pointed out, ifnet_departure event
on the lo0 interface calls bridge_ifdetach() when destroying a vnet jail.  The
problem is that vnet_bridge_uninit() can be called before it.

The patch uses the fact that a vnet whose V_bridge_cloner == NULL is tearing
down (or not initialized).  I think it is safe to ignore this detach handler in
that case.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

Hiroki Sato h...@freebsd.org changed:

   What|Removed |Added

 Status|New |In Progress

--- Comment #12 from Hiroki Sato h...@freebsd.org ---
(In reply to Bjoern A. Zeeb from comment #10)

 With all that the CURVET_SET/RESTORE question from comment #1 remains,
 as  to what happens if bridge_members in the normal case reside
 in different VNETs (child jails)?

Is it possible to have bridge members across different vnets?  As long as using
if_vmove(), member interfaces cannot be moved without detaching from the parent
if_bridge(4) interface.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

Bjoern A. Zeeb b...@freebsd.org changed:

   What|Removed |Added

   Severity|Affects Only Me |Affects Some People

--- Comment #10 from Bjoern A. Zeeb b...@freebsd.org ---
(In reply to Craig Rodrigues from comment #8)

No, it's still used in the same jail.

What seems to happen is:
(a) the bridges get destroyed (all members detached, etc.), the lock gets
destroyed.
(b) the loopback interface in the same jail gets destroyed
(c) the globally registered eventhandler in if_bridge is called for the
interface (lo) disappearing.
(d) we get to the point where we try to acquire the lock which we previously
destroyed.

Either extra checks in bridge_ifdetach() need to be implemented to catch that
case (and I think that's not possible without adding extra bandaid
information), or
proper handling of net cloned interfaces and startup/teardown ordering needs to
be implemented as a whole.

With all that the CURVET_SET/RESTORE question from comment #1 remains, as to
what happens if bridge_members in the normal case reside in different VNETs
(child jails)?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-19 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

Bjoern A. Zeeb b...@freebsd.org changed:

   What|Removed |Added

 CC||b...@freebsd.org

--- Comment #9 from Bjoern A. Zeeb b...@freebsd.org ---
(In reply to Craig Rodrigues from comment #1)

That patch would be bogus as the CURVNET_SET()/RESTORE() would have to be
before/after locking as that lack is virtualised as well.  But it's also not
the real problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

Craig Rodrigues rodr...@freebsd.org changed:

   What|Removed |Added

   Assignee|freebsd-b...@freebsd.org|freebsd-net@FreeBSD.org
 CC||h...@freebsd.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

--- Comment #6 from Craig Rodrigues rodr...@freebsd.org ---
Herbert found by creating VNET jails and then stopping them, he could reproduce
the problem.  Here are the steps he used to reproduce the problem:

/etc/rc.conf:

hostname=beastie.home.lan
ifconfig_em0=inet 192.168.1.25 netmask 0x
defaultrouter=192.168.1.255
cloned_interfaces=bridge0
ifconfig_bridge0=inet 10.0.0.1 netmask 0xff00
sshd_enable=YES
fsck_y_enable=YES
background_fsck=NO
syslogd_flags=-ss
gateway_enable=YES
pf_enable=NO
pflog_enable=NO
jail_enable=NO
jail_list=jail01 jail02 jail03 jail04
devfs_load_rulesets=YES

/etc/jail.conf:

jail01 {
 name = jail01;
 path = /usr/local/jails/jail01;
 mount.devfs;
 host.hostname = jail01.home.lan;
 vnet = new;
 vnet.interface = epair0b;
 persist;
 exec.prestart = ifconfig epair0 create;
 exec.prestart += ifconfig bridge0 addm epair0a;
 exec.prestart += ifconfig epair0a up;

 exec.start = ;
 #exec.start = /bin/sh /etc/rc;

 exec.poststart =jexec $name ifconfig epair0b 10.0.0.10 netmask
255.0.0.0 up;
 exec.poststart +=   jexec $name route add default 10.0.0.1;
 exec.poststart +=   jexec $name sh /etc/rc;

 exec.stop = /bin/sh /etc/rc.shutdown;

 exec.poststop = ifconfig bridge0 deletem epair0a;
 exec.poststop +=ifconfig epair0a destroy;
}

/etc/rc.conf in jail01:

hostname=jail01.home.lan
sshd_enable=YES
sendmail_enable=NONE

Starting jail with /etc/rc.d/jail onestart jail01 or jail -c jail01.
Stopping jail with /etc/rc.d/jail onestop jail01 or jail -r jail01.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

--- Comment #7 from Craig Rodrigues rodr...@freebsd.org ---
Created attachment 151803
  -- https://bugs.freebsd.org/bugzilla/attachment.cgi?id=151803action=edit
dump2.txt

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[Bug 195859] Reproduceble panic with VIMAGE + if_bridge

2015-01-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195859

--- Comment #8 from Craig Rodrigues rodr...@freebsd.org ---
Herbert provided a traceback from his kernel panic.  This looks like the source
of the problem:

panic: mtx_lock() of destroyed mutex @
/usr/src/sys/modules/if_bridge/../../net/if_bridge.c:1814

It looks like after destroying a jail, a mutex is destroyed, but this
destroyed mutex is used later on in another jail.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org