aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2010-07-02 09:53:26 +0000
committerRandall Stewart <rrs@FreeBSD.org>2010-07-02 09:53:26 +0000
commit606c58db25ac58ad62d53be6f48bd7635cd7d561 (patch)
tree026fe78a6f5d61c44d42424a7f188f7ba1c2cce0
parent8d7c49114c7af9ba6ef93e590c8555a2d92d912c (diff)
downloadsrc-606c58db25ac58ad62d53be6f48bd7635cd7d561.tar.gz
src-606c58db25ac58ad62d53be6f48bd7635cd7d561.zip
Fix a bug that WILL cause a panic. Basically
a read-lock is being called to check the vtag-timewait cache. Then in two cases (where a vtag is bad i.e. in the time-wait state) the write-unlock is called NOT the read-unlock. Under conditions where lots of associations are coming and going this will cause the system to panic at some point. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=209644
-rw-r--r--sys/netinet/sctp_pcb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index ef4e88bb7c66..559938adec44 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -6499,7 +6499,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp, uint32_t tag, uint16_t lport, uint16_t
continue;
}
/* Its a used tag set */
- SCTP_INP_INFO_WUNLOCK();
+ SCTP_INP_INFO_RUNLOCK();
return (0);
}
}
@@ -6528,7 +6528,7 @@ skip_vtag_check:
(twait_block->vtag_block[i].lport == lport) &&
(twait_block->vtag_block[i].rport == rport)) {
/* Bad tag, sorry :< */
- SCTP_INP_INFO_WUNLOCK();
+ SCTP_INP_INFO_RUNLOCK();
return (0);
}
}