From owner-p4-projects Fri Nov 8 10:49:27 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E57B937B401; Fri, 8 Nov 2002 10:49:24 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FB2137B404 for ; Fri, 8 Nov 2002 10:49:24 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A4E243E6E for ; Fri, 8 Nov 2002 10:49:24 -0800 (PST) (envelope-from green@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gA8IlLmV064597 for ; Fri, 8 Nov 2002 10:47:21 -0800 (PST) (envelope-from green@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gA8IlL3D064594 for perforce@freebsd.org; Fri, 8 Nov 2002 10:47:21 -0800 (PST) Date: Fri, 8 Nov 2002 10:47:21 -0800 (PST) Message-Id: <200211081847.gA8IlL3D064594@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to green@freebsd.org using -f From: Brian Feldman Subject: PERFORCE change 20859 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=20859 Change 20859 by green@green_laptop_2 on 2002/11/08 10:46:32 * Update the errors from the previous submission to be EIO now. * Add a few more consistency checks. Affected files ... .. //depot/projects/trustedbsd/mac/sys/ufs/ffs/ffs_vnops.c#17 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/ufs/ffs/ffs_vnops.c#17 (text+ko) ==== @@ -1328,8 +1328,8 @@ int *ealenp, u_char **eap, u_char **eac) { u_char *p, *pe, *pn, *p0; - int eapad1, eapad2, ealength, ealen, nlen; - uint32_t ul; + int eapad1, ealength, ealen, nlen; + uint32_t ul, eapad2; pe = ptr + length; nlen = strlen(name); @@ -1340,19 +1340,23 @@ pn = p + ul; /* make sure this entry is complete */ if (pn > pe) - break; + return (EIO); /* don't loop forever on a corrupt entry */ if (pn <= p) - return (EFTYPE); + return (EIO); p += sizeof(uint32_t); if (*p != nspace) continue; p++; eapad2 = *p++; + /* padding is at most 7 bytes */ + if (eapad2 >= 8) + return (EIO); if (*p != nlen) continue; p++; - if (bcmp(p, name, nlen)) + /* compare only up to the end of this attribute */ + if (p + nlen > pn || bcmp(p, name, nlen)) continue; ealength = sizeof(uint32_t) + 3 + nlen; eapad1 = 8 - (ealength % 8); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message