git: kernel - Serialize ifioctl() with a mutex

看板DFBSD_commit作者時間14年前 (2011/06/08 05:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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
文章代碼(AID): #1DxfZL0D (DFBSD_commit)