mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
DFLTCC deflate with Z_NO_FLUSH might generate a corrupted stream when the
output buffer is not large enough to fit all the deflate output at once.
The problem takes place on closing the deflate block since flush_pending()
might leave some output bits not written. Similar problem for software
deflate with Z_BLOCK flush option (not supported by kernel zlib deflate)
has been fixed a while ago in userspace zlib but the fix never got to the
kernel.
Now flush_pending() flushes the bit buffer before copying out the byte
buffer, in order to really flush as much as possible.
Currently there are no users of DFLTCC deflate with Z_NO_FLUSH option in
the kernel so the problem remained hidden for a while.
This commit is based on the old zlib commit:
|
||
|---|---|---|
| .. | ||
| deflate.c | ||
| deflate_syms.c | ||
| deftree.c | ||
| defutil.h | ||
| Makefile | ||