mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: 郭永刚 <[email protected]> References: http://article.gmane.org/gmane.comp.security.oss.general/17908 Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
0baa57d8dc
commit
4ab42d78e3
4 changed files with 15 additions and 15 deletions
|
|
@ -322,9 +322,9 @@ isdn_ppp_open(int min, struct file *file)
|
|||
* VJ header compression init
|
||||
*/
|
||||
is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
|
||||
if (!is->slcomp) {
|
||||
if (IS_ERR(is->slcomp)) {
|
||||
isdn_ppp_ccp_reset_free(is);
|
||||
return -ENOMEM;
|
||||
return PTR_ERR(is->slcomp);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IPPP_FILTER
|
||||
|
|
@ -573,10 +573,8 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
|
|||
is->maxcid = val;
|
||||
#ifdef CONFIG_ISDN_PPP_VJ
|
||||
sltmp = slhc_init(16, val);
|
||||
if (!sltmp) {
|
||||
printk(KERN_ERR "ippp, can't realloc slhc struct\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (IS_ERR(sltmp))
|
||||
return PTR_ERR(sltmp);
|
||||
if (is->slcomp)
|
||||
slhc_free(is->slcomp);
|
||||
is->slcomp = sltmp;
|
||||
|
|
|
|||
Loading…
Reference in a new issue