Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2020 01:45:39 +0800
From:      Li-Wen Hsu <lwhsu@freebsd.org>
To:        Alexander Chernikov <melifaro@freebsd.org>
Cc:        freebsd-testing@freebsd.org
Subject:   ipdivert tests and net.inet.ip.fw.default_to_accept
Message-ID:  <CAKBkRUx%2B5ZKgPtb2hcYOk2-Ddz8BgX8pLoG8yHMuDakMWKKhfw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
(CC freebsd-testing@ for more people can join the discussion)

Hi Alexander,

I'm checking test failures and panics, and found that the two ipdivert
tests we added previously have never been tested correctly.  I've
loaded ipdivert.ko to unskip them in test VM, and  found that these
two tests will fail or panic the kernel when
net.inet.ip.fw.default_to_accept is not 1.

I'm thinking:

1) Also checks for net.inet.ip.fw.default_to_accept=1 at the beginning
and skip the test if 0
2) Is this lock order reversal normal?
3) Does this panic indicate a bug in the relative code?

How do you think?

Details of running the two tests are as following:

# kyua test divert:ipdivert_ip_input_local_success
divert:ipdivert_ip_input_local_success  ->  lock order reversal:
 1st 0xffffffff81c8e558 allprison (allprison) @
/usr/src/sys/kern/kern_jail.c:953
 2nd 0xffffffff81d9a750 vnet_sysinit_sxlock (vnet_sysinit_sxlock) @
/usr/src/sys/net/vnet.c:577
stack backtrace:
#0 0xffffffff80c28671 at witness_debugger+0x71
#1 0xffffffff80bc7747 at _sx_slock_int+0x67
#2 0xffffffff80cfd2ce at vnet_alloc+0x11e
#3 0xffffffff80b7fd93 at kern_jail_set+0x1a23
#4 0xffffffff80b81670 at sys_jail_set+0x40
#5 0xffffffff8105d09d at amd64_syscall+0x73d
#6 0xffffffff810328d0 at fast_syscall_common+0x101
failed: 1 != 0 (1 != 0)  [0.814s]

# kyua test divert:ipdivert_ip_output_remote_success
divert:ipdivert_ip_output_remote_success  ->  panic: Duplicate free of
0xfffff80003c3fa00 from zone 0xfffffe000a1d0000(mbuf) slab
0xfffff80003c3ffd8(10)
cpuid = 3
time = 1586710625
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0038476f70
vpanic() at vpanic+0x182/frame 0xfffffe0038476fc0
panic() at panic+0x43/frame 0xfffffe0038477020
uma_dbg_free() at uma_dbg_free+0x1f2/frame 0xfffffe0038477060
uma_zfree_arg() at uma_zfree_arg+0x130/frame 0xfffffe00384770b0
m_free() at m_free+0xb9/frame 0xfffffe00384770e0
m_freem() at m_freem+0x28/frame 0xfffffe0038477100
div_send() at div_send+0x43c/frame 0xfffffe0038477170
sosend_generic() at sosend_generic+0x44c/frame 0xfffffe0038477220
sosend() at sosend+0x66/frame 0xfffffe0038477250
kern_sendit() at kern_sendit+0x246/frame 0xfffffe00384772f0
sendit() at sendit+0x1cc/frame 0xfffffe0038477340
sys_sendto() at sys_sendto+0x4d/frame 0xfffffe0038477390
amd64_syscall() at amd64_syscall+0x73d/frame 0xfffffe00384774b0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00384774b0
--- syscall (133, FreeBSD ELF64, sys_sendto), rip = 0x8007beeba, rsp =
0x7fffffffdc68, rbp = 0x7fffffffdcb0 ---
KDB: enter: panic

Best,
Li-Wen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKBkRUx%2B5ZKgPtb2hcYOk2-Ddz8BgX8pLoG8yHMuDakMWKKhfw>