From owner-cvs-all@FreeBSD.ORG Thu Mar 27 06:56:37 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BA6637B401; Thu, 27 Mar 2003 06:56:37 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27D6543FB1; Thu, 27 Mar 2003 06:56:37 -0800 (PST) (envelope-from maxim@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h2REua0U063368; Thu, 27 Mar 2003 06:56:36 -0800 (PST) (envelope-from maxim@repoman.freebsd.org) Received: (from maxim@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h2REuadI063367; Thu, 27 Mar 2003 06:56:36 -0800 (PST) Message-Id: <200303271456.h2REuadI063367@repoman.freebsd.org> From: Maxim Konovalov Date: Thu, 27 Mar 2003 06:56:36 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Subject: cvs commit: src/sys/netinet ip_dummynet.c ip_dummynet.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2003 14:56:40 -0000 maxim 2003/03/27 06:56:36 PST FreeBSD src repository Modified files: sys/netinet ip_dummynet.c ip_dummynet.h Log: o Protect set_fs_param() by splimp(9). Quote from kern/37573: There is an obvious race in netinet/ip_dummynet.c:config_pipe(). Interrupts are not blocked when changing the params of an existing pipe. The specific crash observed: ... -> config_pipe -> set_fs_parms -> config_red malloc a new w_q_lookup table but take an interrupt before intializing it, interrupt handler does: ... -> dummynet_io -> red_drops red_drops dereferences the uninitialized (zeroed) w_q_lookup table. o Flush accumulated credits for idle pipes. o Flush accumulated credits when change pipe characteristics. o Change dn_flow_queue.numbytes type to unsigned long. Overlapping dn_flow_queue->numbytes in ready_event() leads to numbytes becomes negative and SET_TICKS() macro returns a very big value. heap_insert() overlaps dn_key again and inserts a queue to a ready heap with a sched_time points to the past. That leads to an "infinity" loop. PR: kern/33234, kern/37573, misc/42459, kern/43133, kern/44045, kern/48099 Submitted by: Mike Hibler (kern/37573) MFC after: 6 weeks Revision Changes Path 1.62 +17 -7 src/sys/netinet/ip_dummynet.c 1.26 +1 -1 src/sys/netinet/ip_dummynet.h