| Summary: | 12.0-ALPHA6 crashes with gif (IPv4 in IPv4) over vtnet | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Lev A. Serebryakov <lev> |
| Component: | kern | Assignee: | Andrey V. Elsukov <ae> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | ae, chris, lstewart, mmacy, mmacy, net |
| Priority: | --- | Keywords: | regression |
| Version: | CURRENT | ||
| Hardware: | amd64 | ||
| OS: | Any | ||
|
Description
Lev A. Serebryakov
2018-09-17 13:06:00 UTC
Encapsulated inbound traffic is handled by ip_encap subsystem, it invokes gif_input while it is in net_epoch_preempt section. This is why INP_INFO_UNLOCK_ASSERT() triggers. I think we can solve this issue be relaxing this KASSERT to require only !mtx_owned(). But this probably can hide some problems with locking. Or we can use another epoch for ip_encap subsystem. Matt, what you think? It can probably be relaxed. I will look tomorrow. (In reply to Andrey V. Elsukov from comment #1) I think the assertion is generally useful. Andrey - is there any way to infer that we're in encap context? In which case we could just set TI_RLOCKED to true and everything would work. -M (In reply to Matthew Macy from comment #3) > I think the assertion is generally useful. Andrey - is there any way to > infer that we're in encap context? In which case we could just set > TI_RLOCKED to true and everything would work. I think currently there is no way to infer that we are in encap context. The call path is like this: ip_input() encap_input() gif_input() netisr_dispatch() ip_input() tcp_input() Starting from encap_input we are in encap context. Alright. Let's at least be specific then. Add a: #define INP_INFO_WUNLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED) Replace INP_INFO_UNLOCK_ASSERT(&V_tcbinfo) on line 803 with INP_INFO_WUNLOCK_ASSERT(...) (In reply to Matt Macy from comment #5) > Alright. Let's at least be specific then. Add a: > #define INP_INFO_WUNLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, > MA_NOTOWNED) > > > Replace INP_INFO_UNLOCK_ASSERT(&V_tcbinfo) on line 803 with > INP_INFO_WUNLOCK_ASSERT(...) tcp_input(), tcp_input_data() and siftr_findinpcb() use INP_INFO_UNLOCK_ASSERT() in several places. I think these places also should be revised. A commit references this bug: Author: ae Date: Mon Oct 1 10:46:01 UTC 2018 New revision: 339039 URL: https://svnweb.freebsd.org/changeset/base/339039 Log: Add INP_INFO_WUNLOCK_ASSERT() macro and use it instead of INP_INFO_UNLOCK_ASSERT() in TCP-related code. For encapsulated traffic it is possible, that the code is running in net_epoch_preempt section, and INP_INFO_UNLOCK_ASSERT() is very strict assertion for such case. PR: 231428 Reviewed by: mmacy, tuexen Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D17335 Changes: head/sys/netinet/in_pcb.h head/sys/netinet/siftr.c head/sys/netinet/tcp_hpts.c head/sys/netinet/tcp_input.c |