1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

At some point during the history of m_getcl(), MAC support began to

unconditionally initialize the mbuf header even if cluster allocation
failed, which could result in a NULL pointer dereference in low-memory
conditions.

PR:		kern/65548
Submitted by:	Stephan Uphoff <ups@tree.com>
This commit is contained in:
Robert Watson 2004-04-16 14:35:11 +00:00
parent 9046571f1c
commit d54efd4d31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128317

View File

@ -1451,15 +1451,15 @@ m_getcl(int how, short type, int flags)
} else {
_mcl_setup(mb);
_mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]);
}
#ifdef MAC
if (flags & M_PKTHDR) {
if (mac_init_mbuf(mb, MBTOM(how)) != 0) {
m_free(mb);
return (NULL);
if (flags & M_PKTHDR) {
if (mac_init_mbuf(mb, MBTOM(how)) != 0) {
m_free(mb);
return (NULL);
}
}
}
#endif
}
return (mb);
}