freebsd-nq/sys/geom/uzip
Maxim Sobolev 74ba4047a3 1.Improve handling around last compressed block of the file, which is
necessary because CLOOP format lacks explicit EOF or length, so that
  in the presence of padding or when the CLOOP is put onto a larger
  partition upper level provider size may be larger. Bound amount
  of extra data that we might touch to the max length of the compressed
  block and detect zero-padding in the last cluster, which when
  sector is all-zero might cause us to emit bogus I/O error after
  decompression of that fails. To not make code any more complicated
  that it needs to be deal with it in lazy-manner, i.e. when we
  first access that specific cluster.

  This change also fixes stupid mistake in the LZMA code, inherited
  from geom_lzma, which does not share length of the output buffer
  buffer with the decompression routine, so that in the presence
  of corrupted or purposedly tailored data may easily cause heap
  overflow and kernel memory corruption.

  Beef up validation of the CLOOP TOC by checking that lengths of
  all but the last compressed clusters match upper limit set by
  the decompressor and improve some error diagnostic output while
  I am here.

2.Add kern.geom.uzip.attach_to tunable to artifically limit
  attaching uzip to certain devices in the dev tree only.

    For example the following only makes us attaching to the
    GPT labels:

    kern.geom.uzip.attach_to="gpt/*"

3.Add kern.geom.uzip.noattach_to, which does opposite to the (2)
  above, i.e. prevents geom_uzip from tasting / attaching to
  providers matching some pattern. By default we don't attach
  to our own kind, i.e. kern.geom.uzip.noattach_to="*.uzip".
  It saves us quite some CPU cycles, esp on low-end embedded
  systems.

Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D7013
2016-06-29 18:19:05 +00:00
..
g_uzip_cloop.h Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip_dapi.h 1.Improve handling around last compressed block of the file, which is 2016-06-29 18:19:05 +00:00
g_uzip_lzma.c 1.Improve handling around last compressed block of the file, which is 2016-06-29 18:19:05 +00:00
g_uzip_lzma.h Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip_softc.h Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip_wrkthr.c Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip_wrkthr.h Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip_zlib.c 1.Improve handling around last compressed block of the file, which is 2016-06-29 18:19:05 +00:00
g_uzip_zlib.h Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8) 2016-02-23 23:59:08 +00:00
g_uzip.c 1.Improve handling around last compressed block of the file, which is 2016-06-29 18:19:05 +00:00
g_uzip.h Fixes to make it compile under gcc-4.2. 2016-02-24 02:52:49 +00:00