DragonFly BSD
DragonFly commits List (threaded) for 2011-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: kernel - Serialize ifioctl() with a mutex


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 7 Jun 2011 14:00:22 -0700 (PDT)

commit 9683f229e6862b5d21b610cac390a826ba6b51de
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Tue Jun 7 13:50:40 2011 -0700

    kernel - Serialize ifioctl() with a mutex
    
    * ifioctl() calls (aka via ifconfig) make various assumptions about the
      stability of certain data structures and can panic otherwise.  Concurrent
      calls to ifioctl via ifconfig can create inconsistencies in the ifnet
      structure.
    
    * Rearrange the ifioctl() code into a fall-through modem, add a struct mtx
      to the ifnet structure, and acquire and release the mutex in ifioctl()
      to enforce stability relative to concurrent ifconfig/ioctl commands
      issued on the interface.
    
    * Fixes a panic reproduced via a while(1):
    
      while (1)
    	  echo -n x
    	  ifconfig re0 inet6 fe80::201:2eff:fe31:5469%re0 &
    	  ifconfig re0 inet6 fe80::201:2eff:fe31:5469%re0 delete &
    	  sleep 0.1
      end
    
    * May fix other related panics.
    
    NOTE: This mutex does not protect internal data structures related to
          network operation.  It is currently being used strictly to serialize
          ifconfig style operations on the interface.
    
    Reported-by: Francois Tigeot <ftigeot@wolfpond.org>

Summary of changes:
 sys/net/if.c     |  162 +++++++++++++++++++++++++++++++++---------------------
 sys/net/if_var.h |    5 +-
 2 files changed, 104 insertions(+), 63 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9683f229e6862b5d21b610cac390a826ba6b51de


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]