From owner-freebsd-bugs@FreeBSD.ORG Mon May 7 14:40:10 2007 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 [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DBCF16A400 for ; Mon, 7 May 2007 14:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4E413C46A for ; Mon, 7 May 2007 14:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l47Ee4Px095682 for ; Mon, 7 May 2007 14:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l47Ee4eJ095681; Mon, 7 May 2007 14:40:04 GMT (envelope-from gnats) Resent-Date: Mon, 7 May 2007 14:40:04 GMT Resent-Message-Id: <200705071440.l47Ee4eJ095681@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mehul Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2945316A400 for ; Mon, 7 May 2007 14:34:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3B313C44B for ; Mon, 7 May 2007 14:34:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l47EY8UX018293 for ; Mon, 7 May 2007 14:34:08 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l47ET6gY003252; Mon, 7 May 2007 14:29:06 GMT (envelope-from nobody) Message-Id: <200705071429.l47ET6gY003252@www.freebsd.org> Date: Mon, 7 May 2007 14:29:06 GMT From: Mehul To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: kern/112490: Problem in "rt_check" routine. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 14:40:10 -0000 >Number: 112490 >Category: kern >Synopsis: Problem in "rt_check" routine. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 07 14:40:04 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Mehul >Release: 6.2 >Organization: >Environment: >Description: Current implementation of rt_check() routine defined in route.c is not completely MPSAFE. I found an issue when i started routing with "directisr" enabled. For the first rcvd packet this function initializes rt_gateway of the passed rt_entry. This is done by calling "rtalloc1" routine. But "rt_check" function doesnt hold any lock while calling this function. So incase if we have multiple instances of "ip_input - netisr" running than more than one thread can call this routine which may lead to some corruption, in my case it leads to a dead lock. Problem doesn't happen if first a single route packet sent and than heavy traffic. But if initially itself i send heavy traffic than this happens immediately. I have fixed this and it works well after it. Patch is attached here with. This is just a workaround for this issue. Probably we need to define few macros in route.h for the hardcoded values in the patch. >How-To-Repeat: >Fix: 1260a1261 > try_again: 1280a1282,1289 > > if(rt0->rt_flags & 0x80000000U){ > /*This rt is under process...*/ > RT_UNLOCK(rt); > RT_UNLOCK(rt0); > goto try_again; > } > 1281a1291 > rt0->rt_flags |= 0x80000000U; 1288a1299 > rt0->rt_flags &= (~0x80000000U); >Release-Note: >Audit-Trail: >Unformatted: