bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] GNU tar generates malformed Pax attributes


From: Linda A. Walsh
Subject: Re: [Bug-tar] GNU tar generates malformed Pax attributes
Date: Sun, 05 Jan 2014 03:01:25 -0800
User-agent: Thunderbird

Sorry for responding to this so far after the initial posting,
but it caught my eye...

Joerg Schilling wrote:
Tim Kientzle <address@hidden> wrote:

Quoting from ?IEEE Std 1003.1, 2013 Edition?
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
 An extended header shall consist of one or more records, each constructed as 
follows:

"%d %s=%s\n", <length>, <keyword>, <value>

The extended header records shall be encoded according to the ISO/IEC 
10646-1:2000
standard UTF-8 encoding. The <length> field, <blank>, <equals-sign>, and 
<newline>
shown shall be limited to the portable character set, as encoded in UTF-8.
----
        It is not entirely clear, but the "value" is not listed in the list of
items that need to be UTF-8 encoded.

        Even though it says the extended header records shall be encoded in 
UTF-8,
it appears that the following line is designed to clarify which fields are to be
encoded in UTF-8.   As others point out, it would be difficult to presume that
POSIX was dictating that the "value" fields (or the "keyword") fields could only
contain UTF-8 data.

I suppose I?ll have to rework libarchive?s pax parser to
tolerate this.  It would be nice if GNU tar could avoid
such brokenness in the future.

This is definitely a bug in gtar and I hope that not many archives exist with this problem.
----
        I'm not sure it is a bug, but I'm sure only a POSIX lawyer could
really say one way or another...;-)

Given the fact that star includes portable ACL support since 2001 and Linux xattr support since 2003, I would guess that a typical user of
these features uses star instead of gtar.
----
Not me.  star dumps core on my system.  Has for the past 4 releases
of SUSE Linux (13.1, 12.3, 12.2, 12.1).  Last worked ~ 11.3 or so.

Not only did it dump core, but it proceeded to finish in the main thread
and return a success.  Only the backtrace listing gave me a head's up (appended
to this message).




BTW: is this feature in use with gtar? I recently tried to compile gtar on Solaris and it does not seem to support ACLs even though the Changelog claims such support. Given the fact that star includes portable ACL support since 2001 and Linux xattr support since 2003, I would guess that a typical user of
these features uses star instead of gtar.

Regarding the problem:
It should be obvious that it is an implementation detail that Linux internally stores e.g. ACLs as "system xattrs" and that related data must not appear in an archive. Star of course excludes such data from the archive.
----

        We are talking about dumping Xattrs, not ACLs.  It would be a bug
to convert the file system Xattrs into some ACL-interpretation.  That
interpretation depends on the OS, and is not part of the POSIX standard.

        I.e. Linux should store exactly the Xattrs that are there -- not some
pseudo ACL interpretation -- as that may be wrong.  If star is not storing the
Xattrs as listed, I don't see how that would be correct.



For the same reason, it is most likely wrong to archive the extended attribute files SUNWattr_ro and SUNWattr_rw that appear e.g. in ZFS even though I expect the content to be portable across OpenSolaris, FeeeBSD and Linux. Note: the content of these files is created from libnvpair and thus could be called documented.
---
        Xattrs are NOT portable between OS's.   Sun's ACL's are not portable
to other OS's -- not Linux, and not Windows.  To try to convert them to some
portable format would be very bad, since they don't map 1:1 and anything
that isn't exactly the same would be a security flaw.



The next task for star is to implement NFSv4 ACL support for FreeBSD. From what I found in the net, there is currently no compatible NFSv4 ACL support on Linux, so it currently seems to be a feature that only can be supported on OpenSolaris and FreeBSD.
----
        Because SunOS didn't follow the only "standards" [sic] that were
in existence at the time (the withdrawn POSIX standard).  NOTE: it was
withdrawn due to a lack of "quorum".   They some number of signatures (say
100 or 50) to ratify it as a standard.  By the time the document was finished,
most of the members that had started out had dropped out (unix companies were
going under around that time).

Does anyone know whether there is another OS that implements the withdrawn POSIX draft for xattrs?
----
        IRIX from sgi.

In particular from: (emphasis, below, mine):

 http://techpubs.sgi.com/library/manuals/4000/007-4273-003/sgi_html/apa.html

    The interface with the kernel (system calls) for Access Control Lists (ACLs)
    and Extended Attributes (EAs) is different in XFS/Linux compared with IRIX.

    *** However, the user level libraries for both ACLs and EAs are exactly the
    **** same in Linux and IRIX.
    **** Thus ACL or EA application code can be exactly the same.




---- Uninteresting core dump of star-1.5final-61.1.2.x86_64 from SuSE 13.1 
follows:

*** buffer overflow detected ***: star terminated
======= Backtrace: =========
/lib64/libc.so.6[0x300207410f]
/lib64/libc.so.6(__fortify_fail+0x37)[0x30020f8657]
/lib64/libc.so.6[0x30020f6800]
star[0x427035]
star[0x419037]
star[0x419ce7]
star[0x419ce7]
star[0x419ce7]
star[0x419ce7]
star[0x419e88]
star[0x406a8b]
star[0x40af3c]
star[0x42cc19]
star[0x403c93]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3002021be5]
star[0x4040cd]
======= Memory map: ========
00400000-00452000 r-xp 00000000 08:26 34535194 /usr/bin/star 00651000-00652000 r--p 00051000 08:26 34535194 /usr/bin/star 00652000-00655000 rw-p 00052000 08:26 34535194 /usr/bin/star
00655000-00679000 rw-p 00000000 00:00 0
00854000-00856000 rw-p 00054000 08:26 34535194 /usr/bin/star
01754000-01775000 rw-p 00000000 00:00 0                                  [heap]
01775000-01854000 rw-p 00000000 00:00 0                                  [heap]
3000000000-3000020000 r-xp 00000000 08:21 51558553 /lib64/ld-2.18.so 300021f000-3000220000 r--p 0001f000 08:21 51558553 /lib64/ld-2.18.so 3000220000-3000221000 rw-p 00020000 08:21 51558553 /lib64/ld-2.18.so
3000221000-3000222000 rw-p 00000000 00:00 0
3002000000-30021a5000 r-xp 00000000 08:21 51558555 /lib64/libc-2.18.so 30021a5000-30023a5000 ---p 001a5000 08:21 51558555 /lib64/libc-2.18.so 30023a5000-30023a9000 r--p 001a5000 08:21 51558555 /lib64/libc-2.18.so 30023a9000-30023ab000 rw-p 001a9000 08:21 51558555 /lib64/libc-2.18.so
30023ab000-30023af000 rw-p 00000000 00:00 0
3002400000-3002418000 r-xp 00000000 08:21 51558558 /lib64/libpthread-2.18.so 3002418000-3002618000 ---p 00018000 08:21 51558558 /lib64/libpthread-2.18.so 3002618000-3002619000 r--p 00018000 08:21 51558558 /lib64/libpthread-2.18.so 3002619000-300261a000 rw-p 00019000 08:21 51558558 /lib64/libpthread-2.18.so
300261a000-300261e000 rw-p 00000000 00:00 0
3002800000-3002803000 r-xp 00000000 08:21 51558588 /lib64/libdl-2.18.so 3002803000-3002a02000 ---p 00003000 08:21 51558588 /lib64/libdl-2.18.so 3002a02000-3002a03000 r--p 00002000 08:21 51558588 /lib64/libdl-2.18.so 3002a03000-3002a04000 rw-p 00003000 08:21 51558588 /lib64/libdl-2.18.so 3003400000-3003416000 r-xp 00000000 08:21 51558618 /lib64/libgcc_s.so.1 3003416000-3003615000 ---p 00016000 08:21 51558618 /lib64/libgcc_s.so.1 3003615000-3003616000 r--p 00015000 08:21 51558618 /lib64/libgcc_s.so.1 3003616000-3003617000 rw-p 00016000 08:21 51558618 /lib64/libgcc_s.so.1 3003800000-3003865000 r-xp 00000000 08:21 50680370 /lib64/libpcre.so.1.2.1 3003865000-3003a64000 ---p 00065000 08:21 50680370 /lib64/libpcre.so.1.2.1 3003a64000-3003a65000 r--p 00064000 08:21 50680370 /lib64/libpcre.so.1.2.1 3003a65000-3003a66000 rw-p 00065000 08:21 50680370 /lib64/libpcre.so.1.2.1 3007800000-3007821000 r-xp 00000000 08:21 50680378 /lib64/libselinux.so.1 3007821000-3007a20000 ---p 00021000 08:21 50680378 /lib64/libselinux.so.1 3007a20000-3007a21000 r--p 00020000 08:21 50680378 /lib64/libselinux.so.1 3007a21000-3007a22000 rw-p 00021000 08:21 50680378 /lib64/libselinux.so.1
3007a22000-3007a24000 rw-p 00000000 00:00 0
3017200000-3017204000 r-xp 00000000 08:21 51600609 /lib64/libattr.so.1.1.0 3017204000-3017403000 ---p 00004000 08:21 51600609 /lib64/libattr.so.1.1.0 3017403000-3017404000 r--p 00003000 08:21 51600609 /lib64/libattr.so.1.1.0 3017404000-3017405000 rw-p 00004000 08:21 51600609 /lib64/libattr.so.1.1.0 3017e00000-3017e08000 r-xp 00000000 08:21 51600610 /lib64/libacl.so.1.1.0 3017e08000-3018007000 ---p 00008000 08:21 51600610 /lib64/libacl.so.1.1.0 3018007000-3018008000 r--p 00007000 08:21 51600610 /lib64/libacl.so.1.1.0 3018008000-3018009000 rw-p 00008000 08:21 51600610 /lib64/libacl.so.1.1.0 3022e00000-3022e15000 r-xp 00000000 08:21 51600526 /lib64/libnsl-2.18.so 3022e15000-3023014000 ---p 00015000 08:21 51600526 /lib64/libnsl-2.18.so 3023014000-3023015000 r--p 00014000 08:21 51600526 /lib64/libnsl-2.18.so 3023015000-3023016000 rw-p 00015000 08:21 51600526 /lib64/libnsl-2.18.so
3023016000-3023018000 rw-p 00000000 00:00 0
7f4f1be11000-7f4f1be17000 r-xp 00000000 08:21 50338708 /lib64/libnss_winbind.so.2 7f4f1be17000-7f4f1c016000 ---p 00006000 08:21 50338708 /lib64/libnss_winbind.so.2 7f4f1c016000-7f4f1c017000 r--p 00005000 08:21 50338708 /lib64/libnss_winbind.so.2 7f4f1c017000-7f4f1c018000 rw-p 00006000 08:21 50338708 /lib64/libnss_winbind.so.2
7f4f1c018000-7f4f1c01d000 rw-p 00000000 00:00 0
7f4f1c01d000-7f4f1c027000 r-xp 00000000 08:21 50467022 /lib64/libnss_nis-2.18.so 7f4f1c027000-7f4f1c227000 ---p 0000a000 08:21 50467022 /lib64/libnss_nis-2.18.so 7f4f1c227000-7f4f1c228000 r--p 0000a000 08:21 50467022 /lib64/libnss_nis-2.18.so 7f4f1c228000-7f4f1c229000 rw-p 0000b000 08:21 50467022 /lib64/libnss_nis-2.18.so 7f4f1c229000-7f4f1c230000 r-xp 00000000 08:21 50465487 /lib64/libnss_compat-2.18.so 7f4f1c230000-7f4f1c42f000 ---p 00007000 08:21 50465487 /lib64/libnss_compat-2.18.so 7f4f1c42f000-7f4f1c430000 r--p 00006000 08:21 50465487 /lib64/libnss_compat-2.18.so 7f4f1c430000-7f4f1c431000 rw-p 00007000 08:21 50465487 /lib64/libnss_compat-2.18.so 7f4f1c431000-7f4f1c43d000 r-xp 00000000 08:21 50467012 /lib64/libnss_files-2.18.so 7f4f1c43d000-7f4f1c63c000 ---p 0000c000 08:21 50467012 /lib64/libnss_files-2.18.so 7f4f1c63c000-7f4f1c63d000 r--p 0000b000 08:21 50467012 /lib64/libnss_files-2.18.so 7f4f1c63d000-7f4f1c63e000 rw-p 0000c000 08:21 50467012 /lib64/libnss_files-2.18.so 7f4f1c63e000-7f4f2c680000 rw-s 00000000 00:04 66644187 /dev/zero (deleted)
7f4f2c680000-7f4f2c685000 rw-p 00000000 00:00 0
7f4f2c6e6000-7f4f2c6e7000 rw-p 00000000 00:00 0
7f4f2c6e7000-7f4f2c6e8000 rw-p 00000000 00:00 0
7fff1ee00000-7fff1ee38000 rw-p 00000000 00:00 0                          [stack]
7fff1ee3b000-7fff1ee3c000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  
[vsyscall]
star: Success. Sync pipe read error on pid 60050 flags 0x0.
star: 0 blocks + 82814740992 bytes (total of 82814740992 bytes = 80873770.50k).
star: The following problems occurred during archive processing:
star: Cannot: stat 0, open 0, read/write 0. Size changed 0.
star: Missing links 0, Name too long 0, File too big 0, Not dumped 0.
star: Cannot get xattr: 0 set xattr: 90.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]