Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170050310
D59332.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D59332.id.diff
View Options
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -957,6 +957,8 @@
}
space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
do {
+ KASSERT((n->m_flags & M_EXTPG) == 0,
+ ("%s: unmapped mbuf %p in chain", __func__, n));
count = min(min(max(len, max_protohdr), space), n->m_len);
bcopy(mtod(n, caddr_t), mtod(m, caddr_t) + m->m_len,
(u_int)count);
@@ -1001,6 +1003,8 @@
m->m_data += dstoff;
space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
do {
+ KASSERT((n->m_flags & M_EXTPG) == 0,
+ ("%s: unmapped mbuf %p in chain", __func__, n));
count = min(min(max(len, max_protohdr), space), n->m_len);
memcpy(mtod(m, caddr_t) + m->m_len, mtod(n, caddr_t),
(unsigned)count);
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -3938,6 +3938,7 @@
int snap, error, i;
struct ether_header *eh1, eh2;
struct llc llc1;
+ struct mbuf *m;
u_int16_t ether_type;
pfil_return_t rv;
#ifdef INET
@@ -3956,6 +3957,12 @@
if (V_pfil_bridge == 0 && V_pfil_member == 0 && V_pfil_ipfw == 0)
return (0); /* filtering is disabled */
+ if (mb_unmapped_to_ext(*mp, &m) != 0) {
+ *mp = NULL;
+ return (ENOBUFS);
+ }
+ *mp = m;
+
i = min((*mp)->m_pkthdr.len, max_protohdr);
if ((*mp)->m_len < i) {
*mp = m_pullup(*mp, i);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 9:05 AM (10 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38207439
Default Alt Text
D59332.id.diff (1 KB)
Attached To
Mode
D59332: if_bridge: map unmapped mbufs before filtering
Attached
Detach File
Event Timeline
Log In to Comment