Author: jhb
Date: Thu Jun 27 22:34:05 2019
New Revision: 349474
URL: https://svnweb.freebsd.org/changeset/base/349474

Log:
  Reject attempts to register a TCP stack being unloaded.
  
  Reviewed by:  gallatin
  MFC after:    2 weeks
  Sponsored by: Netflix
  Differential Revision:        https://reviews.freebsd.org/D20617

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c Thu Jun 27 22:24:56 2019        (r349473)
+++ head/sys/netinet/tcp_subr.c Thu Jun 27 22:34:05 2019        (r349474)
@@ -798,8 +798,12 @@ register_tcp_functions_as_names(struct tcp_function_bl
                }
        }
 
+       if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) {
+               *num_names = 0;
+               return (EINVAL);
+       }
+
        refcount_init(&blk->tfb_refcnt, 0);
-       blk->tfb_flags = 0;
        blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1);
        for (i = 0; i < *num_names; i++) {
                n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to