i386/107944: Forget to unlock mutex-locks
Yuxiang Luo
fedora at ercist.iscas.ac.cn
Mon Jan 15 08:40:20 UTC 2007
>Number: 107944
>Category: i386
>Synopsis: Forget to unlock mutex-locks
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-i386
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Jan 15 08:40:16 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Yuxiang Luo
>Release: 6.0 stable
>Organization:
Institute of Software, Chinese Academy of Sciences
>Environment:
FreeBSD Earth.Earth 6.0-RELEASE FreeBSD 6.0-RELEASE #2: Tue Feb 28 02:32:45 UTC 2006 root at guhao.fsd.iscas:/usr/obj/usr/src/sys/CAS-EARTH i386
>Description:
These two bugs, exiting with mutex-lock holded, are detected by a static analyzer we are developing.
One of them are caused by GOTO statement.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -cr dev/aac/aac_cam.c dev_new/aac/aac_cam.c
*** dev/aac/aac_cam.c Wed Jul 26 07:46:00 2006
--- dev_new/aac/aac_cam.c Mon Jan 15 16:15:28 2007
***************
*** 571,576 ****
--- 571,577 ----
device_printf(sc->aac_dev,"Error %d sending ResetBus command\n",
e);
aac_release_sync_fib(sc);
+ mtx_unlock(&sc->aac_io_lock);
return (CAM_REQ_ABORTED);
}
diff -cr dev/wi/if_wi.c dev_new/wi/if_wi.c
*** dev/wi/if_wi.c Tue Aug 1 07:37:22 2006
--- dev_new/wi/if_wi.c Mon Jan 15 16:29:59 2007
***************
*** 1760,1767 ****
#endif
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
! if (n >= 16)
goto allmulti;
IEEE80211_ADDR_COPY(&mlist.wi_mcast[n],
(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)));
n++;
--- 1760,1769 ----
#endif
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
! if (n >= 16) {
! IF_ADDR_UNLOCK(ifp);
goto allmulti;
+ }
IEEE80211_ADDR_COPY(&mlist.wi_mcast[n],
(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)));
n++;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-i386
mailing list