>Number: 6602
>Category: library
>Synopsis: closedir() is not called when GLOB_LIMIT_READDIR is reached
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Wed May 11 16:10:02 GMT 2011
>Closed-Date:
>Last-Modified:
>Originator:
>Release:
>Organization:
>Environment:
System : OpenBSD 4.9
Details : OpenBSD 4.9-current (GENERIC.MP) #1: Thu Apr 21 09:52:35
CEST 2011
root@mincore:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
In glob(3), when the max number of items for a directory has reached
GLOB_LIMIT_READDIR, an error is returned but closedir() is not called.
>How-To-Repeat:
-
>Fix:
Index: lib/libc/gen/glob.c
===================================================================
RCS file: /var3/mirrors/cvs/openbsd/cvs/src/lib/libc/gen/glob.c,v
retrieving revision 1.35
diff -u -r1.35 glob.c
--- lib/libc/gen/glob.c 12 Jan 2011 01:53:14 -0000 1.35
+++ lib/libc/gen/glob.c 11 May 2011 15:53:02 -0000
@@ -687,7 +687,8 @@
errno = 0;
*pathend++ = SEP;
*pathend = EOS;
- return(GLOB_NOSPACE);
+ err = GLOB_NOSPACE;
+ break;
}
/* Initial DOT must be matched literally. */
dmesg:
OpenBSD 4.9-current (GENERIC.MP) #1: Thu Apr 21 09:52:35 CEST 2011
root@mincore:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8580038656 (8182MB)
avail mem = 8337596416 (7951MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0x9f000 (68 entries)
bios0: vendor American Megatrends Inc. version "1.0a" date 10/19/2009
bios0: Supermicro X8SIL
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC MCFG SLIC OEMB HPET GSCI DMAR SSDT EINJ BERT ERST
HEST
acpi0: wakeup devices P0P1(S4) P0P3(S4) P0P4(S4) P0P5(S4) P0P6(S4) BR1E(S4)
PS2K(S4) PS2M(S4) EUSB(S4) USB0(S4) USB1(S4) USB2(S4) USB3(S4) USBE(S4)
USB4(S4) USB5(S4) USB6(S4) GBE_(S4) BR20(S4) BR21(S4) BR22(S4) BR23(S4)
BR24(S4) BR25(S4) BR26(S4) BR27(S4) SLPB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz, 2667.03 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 133MHz
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz, 2666.67 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
cpu1: 256KB 64b/line 8-way L2 cache
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz, 2666.67 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
cpu2: 256KB 64b/line 8-way L2 cache
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz, 2666.67 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
cpu3: 256KB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 7 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 1, remapped to apid 7
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (P0P3)
acpiprt2 at acpi0: bus 2 (P0P5)
acpiprt3 at acpi0: bus 6 (BR1E)
acpiprt4 at acpi0: bus 3 (BR20)
acpiprt5 at acpi0: bus 4 (BR24)
acpiprt6 at acpi0: bus 5 (BR25)
acpiprt7 at acpi0: bus -1 (BR26)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpicpu2 at acpi0: PSS
acpicpu3 at acpi0: PSS
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep 2666 MHz: speeds: 2668, 2667, 2533, 2400, 2267, 2133,
2000, 1867, 1733, 1600, 1467, 1333, 1200 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core DMI" rev 0x11
ppb0 at pci0 dev 3 function 0 "Intel Core PCIE" rev 0x11: apic 7 int 16 (irq 10)
pci1 at ppb0 bus 1
ppb1 at pci0 dev 5 function 0 "Intel Core PCIE" rev 0x11: apic 7 int 16 (irq 10)
pci2 at ppb1 bus 2
"Intel Core Management" rev 0x11 at pci0 dev 8 function 0 not configured
"Intel Core Scratch" rev 0x11 at pci0 dev 8 function 1 not configured
"Intel Core Control" rev 0x11 at pci0 dev 8 function 2 not configured
"Intel Core Misc" rev 0x11 at pci0 dev 8 function 3 not configured
"Intel Core QPI Link" rev 0x11 at pci0 dev 16 function 0 not configured
"Intel Core QPI Routing" rev 0x11 at pci0 dev 16 function 1 not configured
ppb2 at pci0 dev 28 function 0 "Intel 3400 PCIE" rev 0x05: apic 7 int 17 (irq
11)
pci3 at ppb2 bus 3
ppb3 at pci0 dev 28 function 4 "Intel 3400 PCIE" rev 0x05: apic 7 int 17 (irq
11)
pci4 at ppb3 bus 4
em0 at pci4 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00: apic 7 int
16 (irq 10), address 00:25:90:08:2c:94
ppb4 at pci0 dev 28 function 5 "Intel 3400 PCIE" rev 0x05: apic 7 int 16 (irq
10)
pci5 at ppb4 bus 5
em1 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00: apic 7 int
17 (irq 11), address 00:25:90:08:2c:95
ehci0 at pci0 dev 29 function 0 "Intel 3400 USB" rev 0x05: apic 7 int 23 (irq
15)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb5 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xa5
pci6 at ppb5 bus 6
vga1 at pci6 dev 3 function 0 "Matrox MGA G200eW" rev 0x0a
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 31 function 0 "Intel 3400 LPC" rev 0x05
ahci0 at pci0 dev 31 function 2 "Intel 3400 AHCI" rev 0x05: apic 7 int 19 (irq
14), AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, ST31000528AS, CC38> SCSI3 0/direct fixed
naa.5000c5002cc5410d
sd0: 953869MB, 512 bytes/sec, 1953525168 sec total
sd1 at scsibus0 targ 1 lun 0: <ATA, ST31000528AS, CC38> SCSI3 0/direct fixed
naa.5000c5002cc5736d
sd1: 953869MB, 512 bytes/sec, 1953525168 sec total
ichiic0 at pci0 dev 31 function 3 "Intel 3400 SMBus" rev 0x05: apic 7 int 18
(irq 3)
iic0 at ichiic0
lm1 at iic0 addr 0x2d: W83627DHG
spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-8500
spdmem1 at iic0 addr 0x51: 2GB DDR3 SDRAM PC3-8500
spdmem2 at iic0 addr 0x52: 2GB DDR3 SDRAM PC3-8500
spdmem3 at iic0 addr 0x53: 2GB DDR3 SDRAM PC3-8500
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
wbsio0 at isa0 port 0x2e/2: W83627DHG rev 0x25
lm2 at wbsio0 port 0xa10/8: W83627DHG
lm1 detached
mtrr: Pentium Pro MTRR support
uhub1 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on sd0a swap on sd0b dump on sd0b
usbdevs:
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 addr 2: high speed, self powered, config 1, Rate Matching Hub(0x0020),
Intel(0x8087), rev 0.00
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
port 7 powered
port 8 powered
port 2 powered
>Release-Note:
>Audit-Trail:
>Unformatted: