aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2020-09-04 17:36:15 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2020-09-04 17:36:15 +0000
commit9675d8895abe8f56ffcff69ce5b50e8a32b7c991 (patch)
treec871829cfa56c1a296bfb381462fdfaf37238bbd /sys
parentcb5566519020ad131ea203b2a5f05eb9e77b89a1 (diff)
downloadsrc-9675d8895abe8f56ffcff69ce5b50e8a32b7c991.tar.gz
src-9675d8895abe8f56ffcff69ce5b50e8a32b7c991.zip
ktls: Check for a NULL send tag in ktls_cleanup()
When using ifnet ktls, and when ktls_reset_send_tag() fails to allocate a replacement tag, it leaves the tls session's snd_tag pointer NULL. ktls_cleanup() tries to release the send tag, and will trip over this NULL pointer and panic unless NULL is checked for. Reviewed by: jhb Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=365331
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_ktls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c
index 71bbcc7110fe..6749a881200e 100644
--- a/sys/kern/uipc_ktls.c
+++ b/sys/kern/uipc_ktls.c
@@ -680,7 +680,8 @@ ktls_cleanup(struct ktls_session *tls)
counter_u64_add(ktls_ifnet_gcm, -1);
break;
}
- m_snd_tag_rele(tls->snd_tag);
+ if (tls->snd_tag != NULL)
+ m_snd_tag_rele(tls->snd_tag);
break;
#ifdef TCP_OFFLOAD
case TCP_TLS_MODE_TOE: