Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Oct 1995 12:42:52 +0200
From:      Ville Eerola <ville@vlsi.fi>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/760: mv foo/ ../.. causes panic
Message-ID:  <199510021042.AA059990572@layout.vlsi.fi>
Resent-Message-ID: <199510021120.EAA08513@freefall.freebsd.org>

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

>Number:         760
>Category:       kern
>Synopsis:       mv foo/ ../.. causes panic
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct  2 04:20:01 PDT 1995
>Last-Modified:
>Originator:     Ville Eerola
>Organization:
VLSI Solution Oy
>Release:        FreeBSD 2.1-STABLE i386
>Environment:

FreeBSD 2.1-STABLE #0: Sun Sep 17 23:18:24 EET DST 1995
    ville@descent.vlsi.fi:/usr/src/sys/compile/DESCENT
CPU: 120-MHz Pentium 735\\90 or 815\\100 (Pentium-class CPU)
  Origin = "GenuineIntel"  Id = 0x525  Stepping=5
  Features=0x1bf<FPU,VME,PSE,MCE,CX8,APIC>
real memory  = 33554432 (32768K bytes)
avail memory = 30838784 (30116K bytes)
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA color <4 virtual consoles, flags=0x0>
sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
lpt0 at 0x378-0x37f irq 7 on isa
lpt0: Interrupt-driven port
lp0: TCP/IP capable interface
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: NEC 72065B
fd0: 1.44MB 3.5in
wdc0 not found at 0x1f0
1 3C5x9 board(s) on ISA found at 0x300
ep0 at 0x300-0x30f irq 10 on isa
ep0: aui/bnc[*BNC*] address 00:20:af:56:15:5b irq 10
npx0 on motherboard
npx0: INT 16 interface
Probing for devices on the PCI bus:
chip0 <Intel 82437 (Triton)> rev 2 on pci0:0
chip1 <Intel 82371 (Triton)> rev 2 on pci0:7
vga0 <VGA-compatible display device> rev 0 int a irq 11 on pci0:13
ahc0 <Adaptec 2940 SCSI host adapter> rev 0 int a irq 9 on pci0:15
ahc0: reading board settings
ahc0: Reading SEEPROM...done.
ahc0: 2940 Single Channel, SCSI Id=7, aic7870, 16 SCBs
ahc0: Downloading Sequencer Program...Done
ahc0: Probing channel A
ahc0 waiting for scsi devices to settle
ahc0: target 0 synchronous at 10.0MB/s, offset = 0xf
ahc0: target 0 Tagged Queuing Device
(ahc0:0:0): "SEAGATE ST31230N 0300" type 0 fixed SCSI 2
sd0(ahc0:0:0): Direct-Access 1010MB (2069860 512 byte sectors)
ahc0: target 1 synchronous at 10.0MB/s, offset = 0xf
ahc0: target 1 Tagged Queuing Device
(ahc0:1:0): "SEAGATE ST31230N 0300" type 0 fixed SCSI 2
sd1(ahc0:1:0): Direct-Access 1010MB (2069860 512 byte sectors)

>Description:
[note that ../.. is owned by root, and cannot be written by normal users]

Executing the following commands cause panic:
descent% mkdir foo
descent% mv foo/ ../..

This results:
panic: relookup: lookup on dot-dot

It appears that mv tries to rename foo/ to ../../ which would cause bad
things to happen if succesful.

However, the following variants do not cause anything bad to happen:
descent% mv foo ../../
mv: rename foo to ../..//foo: Permission denied
descent% mv foo ../..
mv: rename foo to ../../foo: Permission denied
descent% mv foo/ ..
mv: rename foo/ to ../: Directory not empty

>How-To-Repeat:
See above...

>Fix:


>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510021042.AA059990572>