Skip to contentSkip to conversation

56 potential lock/unlock bugs in 2.5.8

CHECKER Andi Kleen 1 participant 1 message Jul 11, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 10 lines · Dawson Engler

[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