Bug 635318 - tar crashes with SIGSEGV when --listed-incremental option specified
Summary: tar crashes with SIGSEGV when --listed-incremental option specified
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tar
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-18 23:08 UTC by Frantisek Hanzlik
Modified: 2010-09-23 12:52 UTC (History)
2 users (show)

Fixed In Version: tar-1.23-5.fc14
Clone Of:
Environment:
Last Closed: 2010-09-23 12:52:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
proposed fix (513 bytes, patch)
2010-09-19 08:51 UTC, Kamil Dudka
no flags Details | Diff

Description Frantisek Hanzlik 2010-09-18 23:08:51 UTC
Description of problem:
running command:
cvf /a.tar --listed-incremental=/tmp/tarlii /boot/grub/menu.lst /var/named

ends with SIGSEGV crash. When run under gdb, it prints:

(gdb) run cvf /a.tar --listed-incremental=/tmp/tarlii /boot/grub/menu.lst /var/named
Starting program: /bin/tar cvf /a.tar --listed-incremental=/tmp/tarlii /boot/grub/menu.lst /var/named
[Thread debugging using libthread_db enabled]
/bin/tar: /var/named: Directory is new
/bin/tar: /var/named/chroot: Directory is new
/bin/tar: /var/named/data: Directory is new
/bin/tar: /var/named/dynamic: Directory is new
/bin/tar: /var/named/slaves: Directory is new
/bin/tar: /var/named/chroot/dev: Directory is new
/bin/tar: /var/named/chroot/etc: Directory is new
/bin/tar: /var/named/chroot/usr: Directory is new
/bin/tar: /var/named/chroot/var: Directory is new
/bin/tar: /var/named/chroot/etc/named: Directory is new
/bin/tar: /var/named/chroot/etc/pki: Directory is new
/bin/tar: /var/named/chroot/etc/pki/dnssec-keys: Directory is new
/bin/tar: /var/named/chroot/usr/lib: Directory is new
/bin/tar: /var/named/chroot/usr/lib/bind: Directory is new
/bin/tar: /var/named/chroot/var/log: Directory is new
/bin/tar: /var/named/chroot/var/named: Directory has been renamed from `/var/named'
/bin/tar: /var/named/chroot/var/run: Directory is new
/bin/tar: /var/named/chroot/var/tmp: Directory is new
/bin/tar: /var/named/chroot/var/named/chroot/etc/named: Directory is new
/bin/tar: /var/named/chroot/var/named/chroot/usr/lib/bind: Directory is new
/bin/tar: /var/named/chroot/var/named/chroot/var/named: Directory is new
/bin/tar: /var/named/chroot/var/named/chroot/var/run: Directory has been renamed from `/var/named/chroot/var/run'
/bin/tar: /var/named/chroot/var/named/chroot/var/tmp: Directory has been renamed from `/var/named/chroot/var/tmp'
/bin/tar: /var/named/chroot/var/named/chroot/var/run/named: Directory is new
/bin/tar: /var/named/chroot/var/run/named: Directory has been renamed from `/var/named/chroot/var/named/chroot/var/run/named'
/bin/tar: Removing leading `/' from member names

Program received signal SIGSEGV, Segmentation fault.
append_incremental_renames (dir=0x0) at incremen.c:897
897	      dumpdir_free (dir->dump);
(gdb) 



Version-Release number of selected component (if applicable):
tar-1.23-4.fc14.i686

Reproducible allways, steps to Reproduce:
1. start named with bind-chroot package installed
2. run above tar command
3. see crash message
  
Additional info:
- verified on three HW different F14 i686 machines

- selinux is disabled

- tar-1.22-17.fc13.i686 from Fedora 13 ends OK

- in above example, commandline must contain "--listed-incremental=" option, and must have both destination ("/boot/grub/menu.lst" and "/var/named") specified. Otherwise tar isn't crashing. It seems tar as well isn't crashing when at position "/boot/grub/menu.lst" is directory specification, for crash there must be some filespec.
 
- for crash, there must be some mounts to /var/named, which bind's rc.d startup script do when bind running chrooted, but tar crashes regardless of "--one-file-system" option presence. actual mounts are:
# mount|grep '/var/named'
/etc/named on /var/named/chroot/etc/named type none (rw,bind)
/var/named on /var/named/chroot/var/named type none (rw,bind)
/etc/named.conf on /var/named/chroot/etc/named.conf type none (rw,bind)
/etc/named.rfc1912.zones on /var/named/chroot/etc/named.rfc1912.zones type none (rw,bind)
/etc/rndc.key on /var/named/chroot/etc/rndc.key type none (rw,bind)
/usr/lib/bind on /var/named/chroot/usr/lib/bind type none (rw,bind)
/etc/named.iscdlv.key on /var/named/chroot/etc/named.iscdlv.key type none (rw,bind)
/etc/named.root.key on /var/named/chroot/etc/named.root.key type none (rw,bind)

Comment 1 Kamil Dudka 2010-09-18 23:53:30 UTC
Thank you for reporting the bug!  The same flaw exists in the upstream git HEAD.  It seems to be introduced by the following commit:

http://git.savannah.gnu.org/gitweb/?p=tar.git;a=commitdiff;h=2b1bffb

Comment 2 Kamil Dudka 2010-09-19 08:51:49 UTC
Created attachment 448277 [details]
proposed fix

Comment 3 Kamil Dudka 2010-09-20 08:14:06 UTC
sent upstream:

http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html

Comment 4 Kamil Dudka 2010-09-20 08:44:51 UTC
fixed in tar-1.23-6.fc15

Comment 5 Kamil Dudka 2010-09-20 19:31:04 UTC
upstream fix:

http://git.savannah.gnu.org/gitweb/?p=tar.git;a=commit;h=efe26f9

Comment 7 Fedora Update System 2010-09-20 20:06:29 UTC
tar-1.23-5.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/tar-1.23-5.fc14

Comment 8 Fedora Update System 2010-09-21 03:50:38 UTC
tar-1.23-5.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update tar'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/tar-1.23-5.fc14

Comment 9 Fedora Update System 2010-09-23 12:52:50 UTC
tar-1.23-5.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.