Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2020 17:36:15 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365331 - head/sys/kern
Message-ID:  <202009041736.084HaFtf070420@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gallatin
Date: Fri Sep  4 17:36:15 2020
New Revision: 365331
URL: https://svnweb.freebsd.org/changeset/base/365331

Log:
  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

Modified:
  head/sys/kern/uipc_ktls.c

Modified: head/sys/kern/uipc_ktls.c
==============================================================================
--- head/sys/kern/uipc_ktls.c	Fri Sep  4 13:19:18 2020	(r365330)
+++ head/sys/kern/uipc_ktls.c	Fri Sep  4 17:36:15 2020	(r365331)
@@ -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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009041736.084HaFtf070420>