| Summary: | [panic] kernel panics in soreceive_dgram | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Andrey V. Elsukov <ae> | ||||||
| Component: | kern | Assignee: | Andrey V. Elsukov <ae> | ||||||
| Status: | Closed FIXED | ||||||||
| Severity: | Affects Some People | ||||||||
| Priority: | --- | ||||||||
| Version: | CURRENT | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Attachments: |
|
||||||||
|
Description
Andrey V. Elsukov
2015-02-21 17:12:33 UTC
Created attachment 153282 [details]
test program to reproduce
This program works on 10-STABLE, but on 11-CURRENT it triggers the panic.
To reproduce you need ethernet interface with enabled IPv6 and MTU less that 2000:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
ether 00:22:4d:6a:5e:b9
inet6 fe80::222:4dff:fe6a:5eb9%em0 prefixlen 64 scopeid 0x1
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
% ./test fe80::1%em0
I found that kernel without INVARIANTS and WITNESS doesn't panic. A commit references this bug: Author: ae Date: Mon Feb 23 13:41:36 UTC 2015 New revision: 279206 URL: https://svnweb.freebsd.org/changeset/base/279206 Log: In some cases soreceive_dgram() can return no data, but has control message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. PR: 197882 MFC after: 1 week Sponsored by: Yandex LLC Changes: head/sys/kern/uipc_socket.c A commit references this bug: Author: ae Date: Mon Mar 2 07:51:15 UTC 2015 New revision: 279516 URL: https://svnweb.freebsd.org/changeset/base/279516 Log: MFC r279206: In some cases soreceive_dgram() can return no data, but has control message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. MFC r279209: soreceive_generic() still has similar KASSERT(), therefore instead of remove KASSERT(), change it to check mbuf isn't NULL. PR: 197882 Sponsored by: Yandex LLC Changes: _U stable/10/ stable/10/sys/kern/uipc_socket.c A commit references this bug: Author: ae Date: Mon Mar 2 08:00:00 UTC 2015 New revision: 279517 URL: https://svnweb.freebsd.org/changeset/base/279517 Log: MFC r279206: In some cases soreceive_dgram() can return no data, but has control message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. MFC r279209: soreceive_generic() still has similar KASSERT(), therefore instead of remove KASSERT(), change it to check mbuf isn't NULL. PR: 197882 Sponsored by: Yandex LLC Changes: _U stable/9/sys/ stable/9/sys/kern/uipc_socket.c Fixed in stable/9 and stable/10. |