lkml.org 
[lkml]   [2002]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [CHECKER] 56 potential lock/unlock bugs in 2.5.8
From
Date
Dawson Engler <engler@csl.Stanford.EDU> writes:

> [BUG] recheck: seems unlikely, though it does seem that the path is valid.
> /u2/engler/mc/oses/linux/2.5.8/net/ipv6/tcp_ipv6.c:206:tcp_v6_get_port: ERROR:A_B:112:206:Did not reverse 'spin_lock' [COUNTER=spin_lock:112] [fit=3] [fit_fn=11] [fn_ex=2] [fn_counter=1] [ex=5619] [counter=272] [z = 1.34804760770983] [fn-z = -2.25170500701057]
> rover = tcp_port_rover;
> do { rover++;
> if ((rover < low) || (rover > high))
> rover = low;
> head = &tcp_bhash[tcp_bhashfn(rover)];
> Start --->
> spin_lock(&head->lock);
>

} while (--remaining > 0);
tcp_port_rover = rover;
spin_unlock(&tcp_portalloc_lock);

/* Exhausted local port range during search? */
ret = 1;
if (remaining <= 0)
goto fail;


the goto can only hit when the lock hasn't been taken, so not unlocking it
is correct. It just rechecks the loop end condition, but your tool probably
doesn't know that. The wonders of structured programming :-)


-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.042 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site