ppp, slip: Validate VJ compression slot parameters completely 42/76542/2 accepted/tizen/mobile/20160804.080948 submit/tizen/20160803.053117
authorBen Hutchings <ben@decadent.org.uk>
Sun, 1 Nov 2015 16:22:53 +0000 (16:22 +0000)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 3 Aug 2016 02:36:01 +0000 (19:36 -0700)
commit644c6f3c5d12cc0ce07ac01c257d017475451832
treef41088ec939fd19e83f89681fa6b271ec0d3871e
parent69e4e4e9a186ec3236320a2d9cb0d140d12d70bd
ppp, slip: Validate VJ compression slot parameters completely

[ Upstream commit 4ab42d78e37a294ac7bc56901d563c642e03c4ae ]

Currently slhc_init() treats out-of-range values of rslots and tslots
as equivalent to 0, except that if tslots is too large it will
dereference a null pointer (CVE-2015-7799).

Add a range-check at the top of the function and make it return an
ERR_PTR() on error instead of NULL.  Change the callers accordingly.

Compile-tested only.

Change-Id: I4bd504aa497919117fec9d5ba97365fcca266b4c
Reported-by: 郭永刚 <guoyonggang@360.cn>
References: http://article.gmane.org/gmane.comp.security.oss.general/17908
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
drivers/isdn/i4l/isdn_ppp.c
drivers/net/ppp/ppp_generic.c
drivers/net/slip/slhc.c
drivers/net/slip/slip.c