git: kernel - Fix possible race in syncache

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Aug 18 12:26:54 PDT 2010


commit c1d0893d667ee18127bd3d2e371b820d65c5c0c2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Aug 18 12:22:49 2010 -0700

    kernel - Fix possible race in syncache
    
    * syncache_timer_handler() can block while dropping a syncache entry,
      potentially causing the next pointer it uses in its list iteration
      to become stale.
    
    * Use a list marker to keep tabs on the list position instead of using
      a next pointer.
    
    * Remove critical sections, callouts do not preempt and syncache
      routines can only be entered from protocol threads or callouts.
    
    * Document the callout code as not preempting other threads.
    
    Reported-by: Peter Avalos <pavalos at theshell.com>

Summary of changes:
 sys/kern/kern_timeout.c    |   19 ++++---------
 sys/netinet/tcp_syncache.c |   63 +++++++++++++++++++++++++++----------------
 sys/netinet/tcp_var.h      |    1 +
 3 files changed, 46 insertions(+), 37 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c1d0893d667ee18127bd3d2e371b820d65c5c0c2


-- 
DragonFly BSD source repository





More information about the Commits mailing list