Re: Kernel panics in OpenBSD 7.0 with veb rule filters

2021-11-07 Thread Stefan Sperling
On Mon, Nov 08, 2021 at 06:37:17AM +, Renato Aguiar wrote:
> OpenBSD 7.0 kernel panics when veb is used with a rule filter to tag
> packets coming from a vlan interface, for example:
> 
>   ifconfig veb0 rule pass in on vlan10 tag FOO

> panic: kernel diagnostic assertion "curcpu()->ci_schedstate.spc_smrdepth > 0" 
> f

This has just been fixed in -current:
https://marc.info/?l=openbsd-cvs=163634496007053=2



Kernel panics in OpenBSD 7.0 with veb rule filters

2021-11-07 Thread Renato Aguiar
OpenBSD 7.0 kernel panics when veb is used with a rule filter to tag
packets coming from a vlan interface, for example:

  ifconfig veb0 rule pass in on vlan10 tag FOO

I hit that issue initially while trying to replace bridge with veb on my
OpenBSD router, but it can be easily reproduced in a VM with following
steps:

1. On a OpenBSD 7.0 VM (VMM with local interface):

# ifconfig vlan10 create parent vio0 vnetid 10
# ifconfig veb0 create
# ifconfig veb0 add vlan10
# ifconfig veb0 rule pass in on vlan10 tag FOO
# ifconfig vlan10 up
# ifconfig veb0 up

2. OpenBSD Host:

# ifconfig vlan10 create parent tap0 vnetid 10 # tap0: local VM interface
# ifconfig vlan10 192.168.10.1
# ifconfig vlan10 up
# ping -I 192.168.10.1 -c 1 192.168.10.10 # or send traffic to vlan10

Console output:

panic: kernel diagnostic assertion "curcpu()->ci_schedstate.spc_smrdepth > 0" f
ailed: file "/usr/src/sys/net/if_veb.c", line 461
Stopped at  db_enter+0x10:  popq%rbp
TIDPIDUID PRFLAGS PFLAGS  CPU  COMMAND
*233209  69284  0 0x14000  0x2000  softnet
db_enter() at db_enter+0x10
panic(81e4026a) at panic+0xb8
__assert(81ead61b,81ec2cee,1cd,81e3e925) at __assert+0x
25
veb_rule_filter(8051a900,1,fd8026b49700,fee1bad7ab2d,) a
t veb_rule_filter+0x82
veb_port_input(80550800,fd8026b49700,,8051a900)
 at veb_port_input+0x1e7
ether_input(80550800,fd8026b49700) at ether_input+0xfd
vlan_input(800332a8,fd8026b49700,800014ca3ffc) at vlan_input+0x
23d
ether_input(800332a8,fd8026b49700) at ether_input+0x82
if_input_process(800332a8,800014ca4098) at if_input_process+0x6f
ifiq_process(800336b8) at ifiq_process+0x69
taskq_thread(8002f080) at taskq_thread+0x66
end trace frame: 0x0, count: 4
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports.  Insufficient info makes it difficult to find and fix bugs.
ddb>

--
Renato Aguiar