ppp: deflate: never return len larger than output buffer
Subsystems (3)
PATCH 1/1 ppp: deflate: never return len larger than output buffer
When we've run out of space in the output buffer to store more data, we will call zlib_deflate with a NULL output buffer until we've consumed remaining input.
When this happens, olen contains the size the output buffer would have consumed iff we'd have had enough room.
This can later cause skb_over_panic when ppp_generic skb_put()s the returned length.
---
drivers/net/ppp/ppp_deflate.c +1 -1
@@ -246,7 +246,7 @@ static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,/* * See if we managed to reduce the size of the packet. */ -if (olen < isize) { +if (olen < isize && olen <= osize) { state->stats.comp_bytes += olen; state->stats.comp_packets++; }else {
Signature · 1 line
2.0.5
David Miller
maintainerFrom: Florian Westphal <[email protected]>
Date: Wed, 28 Jan 2015 10:56:04 +0100
Quoted 4 lines
When we've run out of space in the output buffer to store more data, we will call
zlib_deflatewith a NULL output buffer until we've consumed remaining input.
Quoted 8 lines
When this happens, olen contains the size the output buffer would have consumed iff we'd have had enough room.
This can later cause
skb_over_panicwhenppp_genericskb_put()s the returned length.Reported-by Iain Douglas <[email protected]>Signed-off-by Florian Westphal <[email protected]>
Applied and queued up for -stable, thanks Florian.