diff options
author | glebius <glebius@FreeBSD.org> | 2013-12-21 14:41:32 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-12-21 14:41:32 +0000 |
commit | 6873020a63f1b305d482588b953a42f0682c0ee0 (patch) | |
tree | accf878b13c3dc7d1b2d6fff1e654a87c423c2af /etc/rc.d | |
parent | 46ad59c61429268b8c4a42ec3426ffa069828108 (diff) | |
download | FreeBSD-src-6873020a63f1b305d482588b953a42f0682c0ee0.zip FreeBSD-src-6873020a63f1b305d482588b953a42f0682c0ee0.tar.gz |
In r248885 I have reduced size of fake uio resid that ng_ksocket(4) passes
to the soreceive(). This exposed a bug. When reading from a raw socket,
when our fake limit is depleted, we receive a truncated mbuf chain, with
m->m_pkthdr.len > m_length(m). The first problem is that MSG_TRUNC was not
handled. The second one is that we didn't reinit uio_resid in our endless
loop (neither flags), and if socket buffer contained several records, then
we quickly deplete our fake limit. The third bug, actually introduced in
r248885, is that MJUMPAGESIZE isn't enough to handle maximum packet that
ng_ksocket(4) can theoretically receive.
Changes:
- Reinit uio_resid and flags before every call to soreceive().
- Set maximum acceptable size of packet to IP_MAXPACKET. As for now the
module doesn't support INET6.
- Properly handle MSG_TRUNC return from soreceive().
PR: 184601
Submitted & tested by: Viktor Velichkin <avisom yandex.ru>
Sponsored by: Nginx, Inc.
Diffstat (limited to 'etc/rc.d')
0 files changed, 0 insertions, 0 deletions