Package: libtar / 1.2.20-7

Metadata

Package Version Patches format
libtar 1.2.20-7 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
no_static_buffers.patch | (download)

lib/decode.c | 25 18 + 7 - 0 !
lib/handle.c | 1 1 + 0 - 0 !
lib/libtar.h | 3 3 + 0 - 0 !
3 files changed, 22 insertions(+), 7 deletions(-)

 decode: avoid using a static buffer in th_get_pathname()

decode: avoid using a static buffer in th_get_pathname()

A solution suggested by Chris Frey:
https://lists.feep.net:8080/pipermail/libtar/2013-October/000377.html

Note this can break programs that expect sizeof(TAR) to be fixed.


no_maxpathlen.patch | (download)

compat/basename.c | 32 26 + 6 - 0 !
compat/dirname.c | 32 26 + 6 - 0 !
lib/append.c | 21 13 + 8 - 0 !
lib/decode.c | 7 4 + 3 - 0 !
lib/util.c | 38 29 + 9 - 0 !
lib/wrapper.c | 77 65 + 12 - 0 !
libtar/libtar.c | 19 16 + 3 - 0 !
7 files changed, 179 insertions(+), 47 deletions(-)

 fix ftbfs on hurd by dynamically allocating path names.
 Depends on no_static_buffers.patch, which introduced the th_pathname field.


CVE 2013 4420.patch | (download)

lib/decode.c | 33 31 + 2 - 0 !
lib/extract.c | 8 4 + 4 - 0 !
lib/internal.h | 1 1 + 0 - 0 !
lib/output.c | 4 2 + 2 - 0 !
4 files changed, 38 insertions(+), 8 deletions(-)

 avoid directory traversal when extracting archives 
 by skipping over leading slashes and any prefix containing ".." components.
th_get_size unsigned int.patch | (download)

lib/libtar.h | 6 5 + 1 - 0 !
1 file changed, 5 insertions(+), 1 deletion(-)

 [patch] change th_get_size() macro to return unsigned int

On systems where size_t is larger than an int (and larger than
unsigned int), then in various places in the library, where
stuff like this happens:

	size_t sz = th_get_size(t);

then the int value returned from th_get_size() is sign extended to
some unwieldy amount.

On 64bit systems, this can yield extremely large values.

By fixing this problem in the header, and only for th_get_size(),
we avoid breaking the API of the function call oct_to_int()
(which arguably should return an unsigned int, since the sscanf()
it uses expects to yield an unsigned int).  We also fix the library,
which uses th_get_size() internally to assign sizes to size_t.

The drawback is that not all client code that uses th_get_size()
will be fixed, until they recompile, but they will automatically
take advantage of the bugs fixed *inside* the library.

The remaining th_get_*() functions operate on modes and CRC values
and the like, and should be fine, remaining as ints.

Thanks very much to Magnus Holmgren for catching this behaviour.
https://lists.feep.net:8080/pipermail/libtar/2013-October/000365.html

oldgnu_prefix.patch | (download)

lib/decode.c | 9 8 + 1 - 0 !
1 file changed, 8 insertions(+), 1 deletion(-)

 detect old-style gnu headers correctly
testsuite.patch | (download)

Makefile.am | 2 1 + 1 - 0 !
configure.ac | 2 1 + 1 - 0 !
doc/Makefile.in | 1 1 + 0 - 0 !
lib/Makefile.in | 1 1 + 0 - 0 !
libtar/Makefile.in | 1 1 + 0 - 0 !
testsuite/Makefile.in | 7 7 + 0 - 0 !
6 files changed, 12 insertions(+), 2 deletions(-)

---
no_strip.patch | (download)

lib/Makefile.in | 2 1 + 1 - 0 !
libtar/Makefile.in | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 make install must not strip binaries