Page MenuHomeFreeBSD

Fix some bugs in the geom_uzip, improve handling of the last-sector padding, add some tuning knobs.
ClosedPublic

Authored by sobomax on Jun 28 2016, 7:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 11, 12:31 AM
Unknown Object (File)
Wed, Oct 2, 1:31 AM
Unknown Object (File)
Mon, Sep 30, 3:42 AM
Unknown Object (File)
Sun, Sep 29, 7:50 PM
Unknown Object (File)
Sun, Sep 29, 7:15 PM
Unknown Object (File)
Sun, Sep 29, 7:15 PM
Unknown Object (File)
Sun, Sep 29, 7:10 PM
Unknown Object (File)
Sat, Sep 28, 5:29 AM
Subscribers

Details

Summary
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, which does
  not share length of the output 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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sobomax retitled this revision from to Fix some bugs in the geom_uzip, improve handling of the last-sector padding, add some tuning knobs..
sobomax updated this object.
sobomax edited the test plan for this revision. (Show Details)
sobomax set the repository for this revision to rS FreeBSD src repository - subversion.
This revision was automatically updated to reflect the committed changes.