linux/drivers/net/wan
Dan Carpenter 66d42ed8b2 hdlc_ppp: add range checks in ppp_cp_parse_cr()
There are a couple bugs here:
1) If opt[1] is zero then this results in a forever loop.  If the value
   is less than 2 then it is invalid.
2) It assumes that "len" is more than sizeof(valid_accm) or 6 which can
   result in memory corruption.

In the case of LCP_OPTION_ACCM, then  we should check "opt[1]" instead
of "len" because, if "opt[1]" is less than sizeof(valid_accm) then
"nak_len" gets out of sync and it can lead to memory corruption in the
next iterations through the loop.  In case of LCP_OPTION_MAGIC, the
only valid value for opt[1] is 6, but the code is trying to log invalid
data so we should only discard the data when "len" is less than 6
because that leads to a read overflow.

Reported-by: ChenNan Of Chaitin Security Research Lab  <whutchennan@gmail.com>
Fixes: e022c2f07a ("WAN: new synchronous PPP implementation for generic HDLC.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-10 13:00:04 -07:00
..
lmc drivers: net: wan: Fix trivial spelling 2020-07-15 18:18:21 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
c101.c WAN: Replace HTTP links with HTTPS ones 2020-07-13 16:58:01 -07:00
cosa.c net: wan: cosa: Replace HTTP links with HTTPS ones 2020-07-13 17:45:22 -07:00
cosa.h
dlci.c net: wan: dlci: Remove set but not used variable 'err' 2020-08-14 20:42:25 -07:00
farsync.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
farsync.h WAN: Replace zero-length array with flexible-array member 2020-02-27 12:06:55 -08:00
fsl_ucc_hdlc.c ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
fsl_ucc_hdlc.h net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE() 2019-12-09 13:57:45 -06:00
hd64570.c
hd64570.h
hd64572.c
hd64572.h
hdlc_cisco.c drivers/net/wan/hdlc_cisco: Add hard_header_len 2020-08-31 12:22:43 -07:00
hdlc_fr.c drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices 2020-09-04 21:37:04 -07:00
hdlc_ppp.c hdlc_ppp: add range checks in ppp_cp_parse_cr() 2020-09-10 13:00:04 -07:00
hdlc_raw_eth.c
hdlc_raw.c
hdlc_x25.c drivers/net/wan/hdlc_x25: Added needed_headroom and a skb->len check 2020-08-14 20:41:08 -07:00
hdlc.c drivers/net/wan/hdlc: Change the default of hard_header_len to 0 2020-09-02 15:42:43 -07:00
hostess_sv11.c
ixp4xx_hss.c wan: ixp4xx_hss: prepare compile testing 2020-01-12 12:59:52 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
lapbether.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-03 18:50:48 -07:00
Makefile net: wan: wanxl: refactor the firmware rebuild rule 2020-03-29 22:37:53 +09:00
n2.c WAN: Replace HTTP links with HTTPS ones 2020-07-13 16:58:01 -07:00
pc300too.c WAN: Replace HTTP links with HTTPS ones 2020-07-13 16:58:01 -07:00
pci200syn.c WAN: Replace HTTP links with HTTPS ones 2020-07-13 16:58:01 -07:00
sbni.c
sbni.h
sdla.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sealevel.c
slic_ds26522.c
slic_ds26522.h
wanxl.c wan: wanxl: switch from 'pci_' to 'dma_' API 2020-08-04 16:17:00 -07:00
wanxl.h
wanxlfw.inc_shipped
wanxlfw.S
x25_asy.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
x25_asy.h
z85230.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
z85230.h Remove every trace of SERIAL_MAGIC 2019-11-13 19:01:14 +08:00