]> git.baikalelectronics.ru Git - kernel.git/commit
ppp, slip: Validate VJ compression slot parameters completely
authorBen Hutchings <ben@decadent.org.uk>
Sun, 1 Nov 2015 16:22:53 +0000 (16:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Nov 2015 21:25:00 +0000 (16:25 -0500)
commit51cc37b7c18e34cc113b6666ffb93f2b64802bd0
treeeed185aafd345a302f05711c3e6d5d80fca7c3f9
parentff6e51846f91fcac9b477e53786ded8d33d221c1
ppp, slip: Validate VJ compression slot parameters completely

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.

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>
drivers/isdn/i4l/isdn_ppp.c
drivers/net/ppp/ppp_generic.c
drivers/net/slip/slhc.c
drivers/net/slip/slip.c