mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
the sbappendaddr call in socket_send must be protected by Giant
because it can happen from an MPSAFE callout Supported by: FreeBSD Foundation
This commit is contained in:
parent
e3f268fc89
commit
1d78192b35
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122323
@ -1289,10 +1289,13 @@ static int
|
|||||||
socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src)
|
socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src)
|
||||||
{
|
{
|
||||||
if (s) {
|
if (s) {
|
||||||
|
mtx_lock(&Giant); /* XXX until sockets are locked */
|
||||||
if (sbappendaddr(&s->so_rcv, (struct sockaddr *)src, mm, NULL) != 0) {
|
if (sbappendaddr(&s->so_rcv, (struct sockaddr *)src, mm, NULL) != 0) {
|
||||||
sorwakeup(s);
|
sorwakeup(s);
|
||||||
|
mtx_unlock(&Giant);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
mtx_unlock(&Giant);
|
||||||
}
|
}
|
||||||
m_freem(mm);
|
m_freem(mm);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user