NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48514: nmtree segfaults on "malformed mtree files"



>Number:         48514
>Category:       bin
>Synopsis:       nmtree segfaults on "malformed mtree files"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 12 18:30:00 +0000 2014
>Originator:     Garrett Cooper
>Release:        n/a
>Organization:
n/a
>Environment:
FreeBSD fuji-current.local 11.0-CURRENT FreeBSD 11.0-CURRENT #17 
r258654+de0b0b0(master)-dirty: Tue Nov  5 23:31:59 PST 2013     
root@fuji-current.local:/usr/obj/usr/src/sys/FUJI-NOCOMPAT  i386
>Description:
Looks like the memory has already been scrubbed by jemalloc:

# mtree -deU -f /usr/src/etc/mtree/BSD.tests.dist -p /var/tmp/temproot/usr/
Segmentation fault (core dumped)
[root@ /usr/src]# gdb `which mtree` /var/tmp/temproot/usr/mtree.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `mtree'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libmd.so.6...done.
Loaded symbols for /lib/libmd.so.6
Reading symbols from /lib/libutil.so.9...done.
Loaded symbols for /lib/libutil.so.9
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x080529b5 in addchild (pathparent=0x5a5a5a5a, centry=0x2885d710) at 
/usr/src/usr.sbin/nmtree/../../contrib/mtree/spec.c:728
728 cur = pathparent->child;
(gdb) x *pathparent
Cannot access memory at address 0x5a5a5a5a
>How-To-Repeat:
fetch -o /tmp/BSD.tests.dist 
https://raw.github.com/yaneurabeya/freebsd/cfc6ad9bc622f4196577ecf38575ca78dfe5c005/etc/mtree/BSD.tests.dist
mtree -deU -f /tmp/BSD.tests.dist -p /var/tmp/temproot/usr/
>Fix:



Home | Main Index | Thread Index | Old Index