From owner-freebsd-fs@FreeBSD.ORG Fri Mar 11 17:21:56 2005 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 605B516A4CE for ; Fri, 11 Mar 2005 17:21:56 +0000 (GMT) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id F411343D5C for ; Fri, 11 Mar 2005 17:21:55 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.91] (sam@[66.127.85.91]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j2BHLtms072702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Mar 2005 09:21:55 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <4231D417.9060705@errno.com> Date: Fri, 11 Mar 2005 09:23:35 -0800 From: Sam Leffler User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: fs@freebsd.org Content-Type: multipart/mixed; boundary="------------060406040607070405040007" Subject: dirhash potential bug X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2005 17:21:56 -0000 This is a multi-part message in MIME format. --------------060406040607070405040007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Coverity's analysis tool claims there might be a null bp dereferenced in ufsdirhash_lookup. Attached is a patch to add a KASSERT but it'd be good for someone more familiar with the code to check if a change is required. Sam --------------060406040607070405040007 Content-Type: text/plain; name="dirhash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dirhash.patch" ==== //depot/projects/wifi/sys/ufs/ufs/ufs_dirhash.c#3 - /usr/sam/wifi/sys/ufs/ufs/ufs_dirhash.c ==== @@ -420,6 +420,7 @@ if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0) return (EJUSTRETURN); } + KASSERT(bp != NULL, ("no buf?")); dp = (struct direct *)(bp->b_data + (offset & bmask)); if (dp->d_reclen == 0 || dp->d_reclen > DIRBLKSIZ - (offset & (DIRBLKSIZ - 1))) { --------------060406040607070405040007--