In spx_output(), use M_DONTWAIT instead of M_TRYWAIT, as we hold the
ipxpcb mutex. Contrary to the comment, even in 4.x this was unsafe, as parallel use of the socket by another process would result in pcb corruption if the mbuf allocation slept. MFC after: 1 month
This commit is contained in:
parent
ea3d97ae67
commit
c3784d3460
@ -759,11 +759,12 @@ spx_output(struct spxpcb *cb, struct mbuf *m0)
|
||||
|
||||
cb->s_cc &= ~SPX_EM;
|
||||
while (len > mtu) {
|
||||
/*
|
||||
* Here we are only being called from
|
||||
* usrreq(), so it is OK to block.
|
||||
*/
|
||||
m = m_copym(m0, 0, mtu, M_TRYWAIT);
|
||||
m = m_copym(m0, 0, mtu, M_DONTWAIT);
|
||||
if (m == NULL) {
|
||||
cb->s_cc |= oldEM;
|
||||
m_freem(m0);
|
||||
return (ENOBUFS);
|
||||
}
|
||||
if (cb->s_flags & SF_NEWCALL) {
|
||||
struct mbuf *mm = m;
|
||||
spx_newchecks[7]++;
|
||||
|
Loading…
Reference in New Issue
Block a user