Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 2000 14:16:27 +0000 (GMT)
From:      Markko Merzin <markko@torn.eau.ee>
To:        freebsd-stable@FreeBSD.ORG
Subject:   DOS in newpcm audio driver
Message-ID:  <Pine.BSF.4.10.10009261326520.58778-100000@mail.torn.eau.ee>

next in thread | raw e-mail | index | archive | help
Hi!

Any user with read-write access to audio device files (/dev/audio,
/dev/dsp*) can cause system panic and reboot.

Dont forget remount your filesystems, exept /,  read-only before trying
this.

It goes like this:

# Play an au file:
[1] markko@leida:~$ cat soundfile.au >/dev/audio &
# while it plays, open /dev/dsp for reading.
[2] markko@leida:~$ cat </dev/dsp >/dev/null
# wait few seconds and hit control C
# panic, reboot ...

Or:

[1] markko@leida:~$ mpg123 -q mpegfile.mp3 &
[2] markko@leida:~$ cat </dev/audio >/dev/null

and so on..

One more complain about audio recording: many audio-conference tools open
audio device with two different processes, one for reading and one for
writing. But when reading process closes device and tries open it again,
while writing process still holding it, then audio system become unusable
untill both, writing and reading process, releases device and reopens it
again. 

Example:
[3] markko@leida:~$ cat audiofile.au >/dev/audio &
# while it plays

[4] markko@leida:~$ cat /dev/audio > kamm.au
# lets hit control C

[5] markko@leida:~$ cat /dev/audio>kamm
cat: /dev/audio: Device busy
[6] markko@leida:~$ cat /dev/audio>kamm
cat: /dev/audio: Device busy

After few seconds those messages appear in console window:
pcm0: record overrun, dumping 8192 bytes


Some background info:

[7] markko@leida:~$ cat /dev/sndstat 
FreeBSD Audio Driver (newpcm) Sep 22 2000 21:07:39
Installed devices:
pcm0: <Yamaha OPL-SAx> at io 0x530 irq 5 drq 0:1 (1p/1r channels duplex)

# this message will be end after full 'dmesg' output.

[8] markko@leida:~$ dmesg
Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 4.1-STABLE #0: Fri Sep 22 21:12:12 EET 2000
    root@leida.torn.eau.ee:/opt/obj/opt/src/sys/LEIDA.IPF
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 75171053 Hz
CPU: Pentium/P54C (75.17-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x525  Stepping = 5
  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
real memory  = 16777216 (16384K bytes)
config> quit
avail memory = 13578240 (13260K bytes)
Preloaded elf kernel "kernel" at 0xc02f8000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc02f809c.
Intel Pentium detected, installing workaround for F00F bug
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
isab0: <SiS 85c503 PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
ide_pci0: <SiS 5591 Bus-master IDE Controller> port
0x4000-0x400f,0-0x3,0-0x7,0-0x3,0-0x7 irq 0 at device 1.1 on pci0
ide_pci0: driver is using old-style compatability shims
pci0: <S3 Trio 64V2/DX/GX graphics accelerator> at 15.0 irq 9
xl0: <3Com 3c900-COMBO Etherlink XL> port 0x6000-0x603f irq 10 at device
17.0 on pci0
xl0: Ethernet address: 00:10:4b:4a:c4:43
xl0: selecting 10baseT transceiver, half duplex
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
fd1: <1200-KB 5.25" drive> on fdc0 drive 1
wdc0 at port 0x1f0-0x1f7 irq 14 on isa0
wdc0: unit 0 (wd0): <QUANTUM FIREBALLlct10 20>
wd0: 19470MB (39876480 sectors), 39560 cyls, 16 heads, 63 S/T, 512 B/S
wdc0: driver is using old-style compatability shims
wdc1 at port 0x170-0x177 irq 15 on isa0
wdc1: unit 0 (wd2): <ST3660A>
wd2: 520MB (1065456 sectors), 1057 cyls, 16 heads, 63 S/T, 512 B/S
wdc1: driver is using old-style compatability shims
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
pcm0: <Yamaha OPL-SAx> at port
0x220-0x22f,0x530-0x537,0x388-0x38b,0x330-0x331,0x370-0x371 irq 5 drq 0,1
on isa0
joy0: <Generic PnP Joystick> at port 0x201 on isa0
IP Filter: v3.4.8 initialized.  Default = pass all, Logging = enabled
Mounting root from ufs:/dev/wd0s1a
WARNING: / was not properly dismounted


--
Markko




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10009261326520.58778-100000>