Fix kernel panic while trying to read multicast stream.
When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set for all mbufs being input by the IGMP/MLD6 code. Else there will be a NULL-pointer dereference in the netisr code when trying to set the VNET based on the incoming mbuf. Add an assert to catch this when queueing mbufs on a netisr to make debugging of similar cases easier. Found by: Vladislav V. Prodan PR: 244002 Reviewed by: bz@ MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
ed581bf68f
commit
bacb11c9ed
@ -1056,6 +1056,8 @@ netisr_queue_src(u_int proto, uintptr_t source, struct mbuf *m)
|
||||
if (m != NULL) {
|
||||
KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__,
|
||||
cpuid));
|
||||
VNET_ASSERT(m->m_pkthdr.rcvif != NULL,
|
||||
("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m));
|
||||
error = netisr_queue_internal(proto, m, cpuid);
|
||||
} else
|
||||
error = ENOBUFS;
|
||||
|
@ -303,6 +303,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp)
|
||||
#ifdef VIMAGE
|
||||
m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
|
||||
#endif /* VIMAGE */
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.flowid = ifp->if_index;
|
||||
}
|
||||
|
||||
|
@ -283,6 +283,7 @@ mld_save_context(struct mbuf *m, struct ifnet *ifp)
|
||||
#ifdef VIMAGE
|
||||
m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
|
||||
#endif /* VIMAGE */
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.flowid = ifp->if_index;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user