From owner-freebsd-fs Wed May 15 0:41:31 2002 Delivered-To: freebsd-fs@freebsd.org Received: from nitrogen.wanadoo.fr (ca-ol-sqy-18-7.abo.wanadoo.fr [80.8.55.7]) by hub.freebsd.org (Postfix) with ESMTP id 22A5837B404 for ; Wed, 15 May 2002 00:41:27 -0700 (PDT) Received: from nitrogen.wanadoo.fr (nitrogen [127.0.0.1]) by nitrogen.wanadoo.fr (8.12.3/8.12.3) with ESMTP id g4F7eFu5001024 for ; Wed, 15 May 2002 09:40:15 +0200 (CEST) (envelope-from dak@nitrogen.wanadoo.fr) Received: (from dak@localhost) by nitrogen.wanadoo.fr (8.12.3/8.12.3/Submit) id g4F7eFnn001023 for freebsd-fs@FreeBSD.ORG; Wed, 15 May 2002 09:40:15 +0200 (CEST) Date: Wed, 15 May 2002 09:40:15 +0200 From: dak To: freebsd-fs@FreeBSD.ORG Subject: Re: [FS BUG] How to easily corrupt an UFS file system with user access and big fake files. Message-ID: <20020515074015.GA1004@nitrogen> References: <20020515073410.GA634@nitrogen> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <20020515073410.GA634@nitrogen> User-Agent: Mutt/1.3.99i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Oops, here is the sample code :/ -- dak --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fstest.c" #include #include #include #include #include #include int main(void) { int fd, i, offset, size; char buf[512]; fd = open("tmp", O_CREAT | O_WRONLY | O_TRUNC); fchmod(fd, S_IRWXU); memset(buf, 0x61, sizeof(buf)); size = 1440 * 1024; for(i = 0, offset = 0; i < size / sizeof(buf); i++, offset += sizeof(buf)) pwrite(fd, buf, sizeof(buf), offset); lseek(fd, size * 99999, SEEK_SET); write(fd, buf, sizeof(buf)); printf("--> File 'tmp' is now created with a very big size...\n"); return(0); } --qDbXVdCdHGoSgWSk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message