From owner-freebsd-bugs Mon Jun 29 21:00:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA21433 for freebsd-bugs-outgoing; Mon, 29 Jun 1998 21:00:59 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA21420 for ; Mon, 29 Jun 1998 21:00:56 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id VAA03746; Mon, 29 Jun 1998 21:00:01 -0700 (PDT) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA20244; Mon, 29 Jun 1998 20:52:36 -0700 (PDT) (envelope-from nobody) Message-Id: <199806300352.UAA20244@hub.freebsd.org> Date: Mon, 29 Jun 1998 20:52:36 -0700 (PDT) From: nick@taronga.com To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: misc/7124: MAKEDEV vty doesn't check if the number is valid Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7124 >Category: misc >Synopsis: MAKEDEV vty doesn't check if the number is valid >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 29 21:00:01 PDT 1998 >Last-Modified: >Originator: Nick Manka >Organization: >Release: 2.2.5-6, 3.0-current >Environment: FreeBSD engylion.in.taronga.com 3.0-CURRENT FreeBSD 3.0-CURRENT #8: Sun Jun 28 06:52:55 CDT 1998 nick@engylion.in.taronga.com:/local/src/sys/compile/angelic i386 >Description: Supplying MAKEDEV with a vty number that is not a valid hexadecimal number causes it to consume most of the processor time and all of the memory on a machine. I don't know if ever creates any devices, it never has for me before consuming the entirety of 244 megabytes of memory and page space. When run as a user not root, it waits for a few seconds and then says "Out of space." The bug appears to occur just below line 719 in MAKEDEV where units=`expr $i : 'vty\(.*\)'` eval `echo ${chr} ${units} | awk ' { c=$1; n=$2 } END { for (i = 0; i < n; i++) printf("rm -f ttyv%01x; mknod ttyv%01x c %d %d; \ chown root.wheel ttyv%01x;", \ i, i, c, i, i); }'` ln -fs ttyv0 vga # XXX X still needs this pccons relic ;; splits off the number of devices to make and passes that to awk. I'm not to keen with awk, but I'm under the impression that it can't deal with a non-hexadecimal number where a hexadecimal number is supposed to be. >How-To-Repeat: cd /dev sh MAKEDEV vtyv4 vty seems to do it. >Fix: Don't make typos as root :> Have the awk script in MAKEDEV for vty* do a sanity check? >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message