Date: Mon, 7 May 2007 14:29:06 GMT From: Mehul<mehuljv@yahoo.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/112490: Problem in "rt_check" routine. Message-ID: <200705071429.l47ET6gY003252@www.freebsd.org> Resent-Message-ID: <200705071440.l47Ee4eJ095681@freefall.freebsd.org>
index | next in thread | raw e-mail
>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:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705071429.l47ET6gY003252>
