From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 24 00:40:06 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BAD1065676 for ; Tue, 24 Mar 2009 00:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 383D88FC30 for ; Tue, 24 Mar 2009 00:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O0e6oW016804 for ; Tue, 24 Mar 2009 00:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n2O0e68U016803; Tue, 24 Mar 2009 00:40:06 GMT (envelope-from gnats) Resent-Date: Tue, 24 Mar 2009 00:40:06 GMT Resent-Message-Id: <200903240040.n2O0e68U016803@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matthew Fleming Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23802106578F for ; Tue, 24 Mar 2009 00:35:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 10FF88FC31 for ; Tue, 24 Mar 2009 00:35:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2O0ZV01055992 for ; Tue, 24 Mar 2009 00:35:31 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n2O0ZVrr055991; Tue, 24 Mar 2009 00:35:31 GMT (envelope-from nobody) Message-Id: <200903240035.n2O0ZVrr055991@www.freebsd.org> Date: Tue, 24 Mar 2009 00:35:31 GMT From: Matthew Fleming To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/132987: unionfs_readdir has math problem X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 00:40:06 -0000 >Number: 132987 >Category: misc >Synopsis: unionfs_readdir has math problem >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 24 00:40:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Matthew Fleming >Release: RELENG 7.1 >Organization: Isilon Systems >Environment: n/a >Description: It looks like unionfs_readdir() has a math problem. My guess as to what was meant: if (cookies_bk != NULL) { /* merge cookies */ int size; u_long *newcookies, *pos; size = *(ap->a_ncookies) + ncookies_bk; newcookies = (u_long *) malloc(size * sizeof(u_long), M_TEMP, M_WAITOK); pos = newcookies; memcpy(pos, cookies_bk, ncookies_bk * sizeof(u_long)); - pos += ncookies_bk * sizeof(u_long); + pos += ncookies_bk; memcpy(pos, *(ap->a_cookies), *(ap->a_ncookies) * sizeof(u_long)); free(cookies_bk, M_TEMP); free(*(ap->a_cookies), M_TEMP); *(ap->a_ncookies) = size; *(ap->a_cookies) = newcookies; } >How-To-Repeat: n/a >Fix: See Full Description above. >Release-Note: >Audit-Trail: >Unformatted: