mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Don't allow allocating a new send tag on an INP which is being torn down.
This fixes a potential send tag leak. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
This commit is contained in:
1 parent
e63539f305
commit
85d8d30f9f
1 file changed
+6
-1
@@ -3399,7 +3399,12 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp,
|
||||
|
||||
INP_WLOCK_ASSERT(inp);
|
||||
|
||||
if (*st != NULL)
|
||||
/*
|
||||
* If there is already a send tag, or the INP is being torn
|
||||
* down, allocating a new send tag is not allowed. Else send
|
||||
* tags may leak.
|
||||
*/
|
||||
if (*st != NULL || (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) != 0)
|
||||
return (EINVAL);
|
||||
|
||||
error = m_snd_tag_alloc(ifp, ¶ms, st);
|
||||
|
||||
Reference in new issue
Block a user