summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-08-13 12:54:05 -0400
committerDan McDonald <danmcd@joyent.com>2020-09-02 15:51:59 -0400
commit2ad530425ac9cd3f429e64463a85f6f58703061c (patch)
treea925c2f7ba31ac07371a6ca288a6eb818a5d0750 /usr/src/uts/common/inet/tcp/tcp_output.c
parent8515d723262b57176aeeda8734edbe79fe1e7a5a (diff)
downloadillumos-gate-2ad530425ac9cd3f429e64463a85f6f58703061c.tar.gz
12976 system panics with error in IP module
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Paul Winder <p.winder@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/uts/common/inet/tcp/tcp_output.c')
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_output.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_output.c b/usr/src/uts/common/inet/tcp/tcp_output.c
index 7a0472f3dd..086668f435 100644
--- a/usr/src/uts/common/inet/tcp/tcp_output.c
+++ b/usr/src/uts/common/inet/tcp/tcp_output.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017 by Delphix. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
/* This file contains all TCP output processing functions. */
@@ -1677,11 +1677,23 @@ finish:
/* non-STREAM socket, release the upper handle */
if (IPCL_IS_NONSTR(connp)) {
- ASSERT(connp->conn_upper_handle != NULL);
- (*connp->conn_upcalls->su_closed)
- (connp->conn_upper_handle);
+ sock_upcalls_t *upcalls = connp->conn_upcalls;
+ sock_upper_handle_t handle = connp->conn_upper_handle;
+
+ ASSERT(upcalls != NULL);
+ ASSERT(upcalls->su_closed != NULL);
+ ASSERT(handle != NULL);
+ /*
+ * Set these to NULL first because closed() will free
+ * upper structures. Acquire conn_lock because an
+ * external caller like conn_get_socket_info() will
+ * upcall if these are non-NULL.
+ */
+ mutex_enter(&connp->conn_lock);
connp->conn_upper_handle = NULL;
connp->conn_upcalls = NULL;
+ mutex_exit(&connp->conn_lock);
+ upcalls->su_closed(handle);
}
}