From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 10 17:10:30 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28BAF16A41F for ; Thu, 10 Nov 2005 17:10:30 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1620443D49 for ; Thu, 10 Nov 2005 17:10:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jAAHAO0w064166 for ; Thu, 10 Nov 2005 17:10:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jAAHAOoE064165; Thu, 10 Nov 2005 17:10:24 GMT (envelope-from gnats) Date: Thu, 10 Nov 2005 17:10:24 GMT Message-Id: <200511101710.jAAHAOoE064165@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Victor Snezhko Cc: Subject: Re: kern/88725: /usr/sbin/ppp panic with 2005.10.21 netinet6 changes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Victor Snezhko List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2005 17:10:30 -0000 The following reply was made to PR kern/88725; it has been noted by GNATS. From: Victor Snezhko To: Mark Tinguely Cc: bug-followup@freebsd.org, max@love2party.net, freebsd-current@freebsd.org, Max@freebsd.org Subject: Re: kern/88725: /usr/sbin/ppp panic with 2005.10.21 netinet6 changes Date: Thu, 10 Nov 2005 23:02:47 +0600 Mark Tinguely writes: > As a postscript: > > The problem was a dynamic timer was freed without being stopped first. > Obviously, the printf() should be removed from the final fix. > > After this discovery, I went through all of the callout_init() calls > in the kernel and looked at those that may be freed before possibly > being stopped. Beside the one in netinet6/mld6.c, I have 5 more > that initially look like the memory for the callout struction could > also be freed and still not have been stopped. These paths are problably > not traveled much (detaches for less mainstream components), but stopping > the callout is cheap and not at all risky. Not risky? I'm not an expert, but I think there might be issues when callout is stopped at the moment when on-timer function is executed (I see the following bad scenario: timer function begins to execute, then we call callout_stop(), then free all the necessary data structures and then control returns to the timer proc which could depend on the structures that are already freed) I.e. in each case we should check if callout_stop don't harm. On the other hand, callout_drain could introduce lock order issues (as John Baldwin pointed). > I will look at the 5 cases again and suggest all of these callout at > risk be stopped under the same fix. -- WBR, Victor V. Snezhko EMail: snezhko@indorsoft.ru