Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81969650
D12267.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12267.diff
View Options
Index: head/sys/netinet/tcp_timewait.c
===================================================================
--- head/sys/netinet/tcp_timewait.c
+++ head/sys/netinet/tcp_timewait.c
@@ -709,10 +709,29 @@
INP_WLOCK(inp);
tw = intotw(inp);
if (in_pcbrele_wlocked(inp)) {
- KASSERT(tw == NULL, ("%s: held last inp "
- "reference but tw not NULL", __func__));
- INP_INFO_RUNLOCK(&V_tcbinfo);
- continue;
+ if (__predict_true(tw == NULL)) {
+ INP_INFO_RUNLOCK(&V_tcbinfo);
+ continue;
+ } else {
+ /* This should not happen as in TIMEWAIT
+ * state the inp should not be destroyed
+ * before its tcptw. If INVARIANTS is
+ * defined panic.
+ */
+#ifdef INVARIANTS
+ panic("%s: Panic before an infinite "
+ "loop: INP_TIMEWAIT && (INP_FREED "
+ "|| inp last reference) && tw != "
+ "NULL", __func__);
+#else
+ log(LOG_ERR, "%s: Avoid an infinite "
+ "loop: INP_TIMEWAIT && (INP_FREED "
+ "|| inp last reference) && tw != "
+ "NULL", __func__);
+#endif
+ INP_INFO_RUNLOCK(&V_tcbinfo);
+ break;
+ }
}
if (tw == NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 7:57 AM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091567
Default Alt Text
D12267.diff (1 KB)
Attached To
Mode
D12267: Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has been destroyed before its tcptw with INVARIANTS undefined.
Attached
Detach File
Event Timeline
Log In to Comment