From owner-freebsd-security Thu Mar 6 6:15:56 2003 Delivered-To: freebsd-security@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0938037B401 for ; Thu, 6 Mar 2003 06:15:54 -0800 (PST) Received: from device.dyndns.org (device.net1.nerim.net [62.212.100.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0A8B43F85 for ; Thu, 6 Mar 2003 06:15:52 -0800 (PST) (envelope-from guy@device.dyndns.org) Received: (from root@localhost) by device.dyndns.org (8.12.8/8.12.5) id h26EFoAE004330 for freebsd-security@freebsd.org; Thu, 6 Mar 2003 15:15:50 +0100 (CET) (envelope-from guy@device.dyndns.org) Received: from device.dyndns.org (guy@localhost [127.0.0.1]) by device.dyndns.org (8.12.8/8.12.8) with ESMTP id h26EFl7W004318 for ; Thu, 6 Mar 2003 15:15:48 +0100 (CET) (envelope-from guy@device.dyndns.org) Received: (from guy@localhost) by device.dyndns.org (8.12.8/8.12.8/Submit) id h26EFlhD004317 for freebsd-security@freebsd.org; Thu, 6 Mar 2003 15:15:47 +0100 (CET) Date: Thu, 6 Mar 2003 15:15:47 +0100 (CET) From: Guy Poizat Message-Id: <200303061415.h26EFlhD004317@device.dyndns.org> To: freebsd-security@freebsd.org Subject: Prov. patch for the file hole ISS disclosed X-Virus-Scanned: by AMaViS perl-11 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Here is my suggestion. Feel free to comment/correct me, as this is my first ever C line out of a windows system :] I tested it against RELENG_4. --- src/contrib/file/readelf.c Sun Nov 26 22:37:21 2000 +++ src/contrib/file/readelf.c.patched Thu Mar 6 15:02:44 2003 @@ -141,6 +141,9 @@ Elf32_Shdr sh32; Elf64_Shdr sh64; + if ( size > ( class == ELFCLASS32 ? sizeof(Elf32_Shdr) : sizeof(Elf64_Shdr) ) ) + return; + if (lseek(fd, off, SEEK_SET) == -1) error("lseek failed (%s).\n", strerror(errno)); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message