From owner-freebsd-stable@FreeBSD.ORG Mon Feb 18 13:42:46 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44DEA16A417; Mon, 18 Feb 2008 13:42:46 +0000 (UTC) (envelope-from filter@mail.radiokom.kr.ua) Received: from mail.radiokom.kr.ua (smtp.radiokom.kr.ua [193.17.174.11]) by mx1.freebsd.org (Postfix) with ESMTP id BE89313C4CE; Mon, 18 Feb 2008 13:42:45 +0000 (UTC) (envelope-from filter@mail.radiokom.kr.ua) Received: by mail.radiokom.kr.ua (Postfix, from userid 1003) id C38341D0F3; Mon, 18 Feb 2008 15:42:43 +0200 (EET) X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on shayba.homenet.kr.ua X-Spam-Level: X-Spam-Status: No, score=0.0 required=6.0 tests=none autolearn=disabled version=3.1.8 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by mail.radiokom.kr.ua (Postfix) with ESMTP id 251651D09E for ; Mon, 18 Feb 2008 15:42:39 +0200 (EET) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id C8D4C5F4A0; Mon, 18 Feb 2008 13:41:13 +0000 (UTC) (envelope-from owner-freebsd-security@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id B4A2816A4EF; Mon, 18 Feb 2008 13:41:13 +0000 (UTC) (envelope-from owner-freebsd-security@freebsd.org) Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9267016A418 for ; Mon, 18 Feb 2008 13:41:06 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: from ag-out-0708.google.com (ag-out-0708.google.com [72.14.246.244]) by mx1.freebsd.org (Postfix) with ESMTP id 501F913C455 for ; Mon, 18 Feb 2008 13:41:06 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: by ag-out-0708.google.com with SMTP id 5so2473871agb.7 for ; Mon, 18 Feb 2008 05:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=vq0l9z0xMsw4JpD6hWHmXb0iheAhmfajBGVA7nobMCk=; b=lgoHdV8xuG3Pk6wCyUOgAl7p80M3ORTq0MVs5nh9eJA3Naq8xE8P97UYQ5I52EwhcDykO5Q27gxOOE9A7Uhvfs+XrE1qK1UDs2c/8iWVkXpLvT20pp+fJHZEdZN618DSKUBOg4idF6fx32Zhtg9cG1TxIStgteykuruxSNCU/xc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kFxUD/W+qYjD81YNTsovhIihqaMZv14XDq+2mbEOhXyGfNOZBQ9LZb7NaUMYeJvbcI40zqqqK/MhQWnVj2FAiGs6jeEzI7MtSA0jLmTp682GLnnMlJ00rx6ql9r8e24FAqlcpnkDmp3JNZ4TMZ8QrWakjDVEm1t19eu9JARwe7I= Received: by 10.142.216.9 with SMTP id o9mr4282453wfg.173.1203341221352; Mon, 18 Feb 2008 05:27:01 -0800 (PST) Received: by 10.142.87.9 with HTTP; Mon, 18 Feb 2008 05:27:01 -0800 (PST) Message-ID: Date: Mon, 18 Feb 2008 13:27:01 +0000 From: "Kurt Buff" To: "=?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?=" In-Reply-To: <86odae5rgr.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <47B90868.7000900@electron-tube.net> <86odae5rgr.fsf@ds4.des.no> X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-freebsd-security@freebsd.org Errors-To: owner-freebsd-security@freebsd.org Cc: freebsd-fs@freebsd.org, freebsd-security@freebsd.org, Jim Bryant , freebsd-stable@freebsd.org, FreeBSD-bugs@freebsd.org Subject: Re: How to take down a system to the point of requiring a newfs with one line of C (userland) X-BeenThere: freebsd-stable@freebsd.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 13:42:46 -0000 Patient: Doctor, it hurts when I do this! Doctor: Don't do that... On Feb 18, 2008 1:23 PM, Dag-Erling Sm=F8rgrav wrote: > Jim Bryant writes: > > #include > > #include > > > > int main(int argc, char **argv) { int i; char buf[1024]; bzero(buf, 102= 4); for(i =3D 0; i < 10000; i++) { sprintf(buf, "touch %s%05d\n", argv[1], = i); system((const char *)buf);} return(0);} > > Subject should be "how to take down a system [...] with three lines of > badly written C, provided you have root privileges already and are too > lazy to just dd if=3D/dev/zero of=3D/dev/ad0s1 count=3D100", which would > accomplish the job much faster. > > Purely in the interest of showing off, here is my version. It is 81 > bytes shorter than yours, it is valid C99 with POSIX extensions (yours > is not), and it produces 11,450 files in about 0.2% of the time yours > takes to produce 10,000. > > #include > #define b(i,v) for(int v=3D48;v<127;++v){f[i]=3Dv; > #define a(i) b(i,v##i) > int main(void){char f[5]=3D{'/'};a(1)a(2)a(3)truncate(f,0);}}}} > > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > > _______________________________________________ > freebsd-security@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-security > To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.or= g" > _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"