linux/net/ipv4
Stefan Nuernberger 1ea453b05c net/ipv4: defensive cipso option parsing
commit 076ed3da0c upstream.

commit 40413955ee ("Cipso: cipso_v4_optptr enter infinite loop") fixed
a possible infinite loop in the IP option parsing of CIPSO. The fix
assumes that ip_options_compile filtered out all zero length options and
that no other one-byte options beside IPOPT_END and IPOPT_NOOP exist.
While this assumption currently holds true, add explicit checks for zero
length and invalid length options to be safe for the future. Even though
ip_options_compile should have validated the options, the introduction of
new one-byte options can still confuse this code without the additional
checks.

Signed-off-by: Stefan Nuernberger <snu@amazon.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Simon Veith <sveith@amazon.de>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-02-11 17:53:21 +00:00
..
netfilter netfilter: ipt_CLUSTERIP: fix a refcount bug in clusterip_config_find_get() 2018-06-16 22:22:14 +01:00
af_inet.c net: ping: do not abuse udp_poll() 2017-09-15 18:29:56 +01:00
ah4.c ah4: Use the IPsec protocol multiplexer API 2014-02-25 07:04:17 +01:00
arp.c ipv4: arp: update neighbour address when a gratuitous arp is received and arp_accept is set 2014-01-02 00:08:38 -05:00
cipso_ipv4.c net/ipv4: defensive cipso option parsing 2019-02-11 17:53:21 +00:00
datagram.c ipv6: lock socket in ip6_datagram_connect() 2015-08-27 13:56:21 +01:00
devinet.c ipv4: Don't do expensive useless work during inetdev destroy. 2016-03-29 15:53:41 +01:00
esp4.c xfrm: Return error on unknown encap_type in init_state 2018-03-03 15:52:15 +00:00
fib_frontend.c net: ipv4: update fnhe_pmtu when first hop's MTU changes 2018-12-16 22:09:40 +00:00
fib_lookup.h ipv4: make fib_detect_death static 2013-12-28 17:01:46 -05:00
fib_rules.c ipv4: Fix incorrect error code when adding an unreachable route 2014-12-01 10:02:09 +00:00
fib_semantics.c net: ipv4: update fnhe_pmtu when first hop's MTU changes 2018-12-16 22:09:40 +00:00
fib_trie.c net: Revert "fib_trie: use seq_file_net rather than seq->private" 2014-06-04 15:11:41 -07:00
gre_demux.c GRE: enable offloads for GRE 2014-07-11 13:53:39 -07:00
gre_offload.c tunnels: Don't apply GRO to multiple layers of encapsulation. 2016-05-01 00:06:03 +02:00
icmp.c ipv4: icmp: Fix pMTU handling for rare case 2014-07-07 17:22:57 -07:00
igmp.c igmp: fix incorrect unsolicit report count after link down and up 2018-12-16 22:08:59 +00:00
inet_connection_sock.c dccp/tcp: do not inherit mc_list from parent 2017-06-05 21:17:23 +01:00
inet_diag.c inet_diag: fix possible overflow in inet_diag_dump_one_icsk() 2015-03-24 10:29:06 +00:00
inet_fragment.c Revert "net: use lib/percpu_counter API for fragmentation mem accounting" 2017-11-26 13:50:30 +00:00
inet_hashtables.c net: Use a more standard macro for INET_ADDR_COOKIE 2014-05-14 16:07:23 -04:00
inet_lro.c lro: remove dead code 2013-12-29 16:34:25 -05:00
inet_timewait_sock.c soreuseport: initialise timewait reuseport field 2018-10-21 08:45:18 +01:00
inetpeer.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
ip_forward.c ip_forward: Drop frames with attached skb->sk 2015-04-29 11:26:32 +01:00
ip_fragment.c inet: frags: fix defragmented packet's IP header for af_packet 2015-08-12 09:48:31 +01:00
ip_gre.c gre: fix the inner mac header in nbma tunnel xmit path 2015-01-19 11:07:18 +00:00
ip_input.c IPv4: early demux can return an error code 2018-01-01 20:51:45 +00:00
ip_options.c ipv4: fix buffer overflow in ip_options_compile() 2014-07-21 20:16:26 -07:00
ip_output.c net: test tailroom before appending to linear skb 2018-10-21 08:46:13 +01:00
ip_sockglue.c netfilter: drop outermost socket lock in getsockopt() 2018-06-16 22:22:14 +01:00
ip_tunnel.c ip_tunnel: be careful when accessing the inner header 2018-12-16 22:09:25 +00:00
ip_tunnel_core.c ipv4: fix a potential use after free in ip_tunnel_core.c 2014-11-05 16:34:38 +00:00
ip_vti.c Revert "vti4: Don't override MTU passed on link creation via IFLA_MTU" 2018-09-25 23:47:21 +01:00
ipcomp.c ipcomp4: Use the IPsec protocol multiplexer API 2014-02-25 07:04:17 +01:00
ipconfig.c ipv4: ipconfig.c: add parentheses in an if statement 2014-02-14 00:14:23 -05:00
ipip.c ipip: fix one sparse error 2015-07-15 10:01:16 +01:00
ipmr.c ipmr/ip6mr: Initialize the last assert time of mfc entries. 2017-03-16 02:27:17 +00:00
Kconfig net: neighbour: Remove CONFIG_ARPD 2013-09-03 21:41:43 -04:00
Makefile xfrm4: Add IPsec protocol multiplexer 2014-02-25 07:04:16 +01:00
netfilter.c netfilter: remove double colon 2014-02-19 11:41:25 +01:00
ping.c ipv4: fix memory leaks in udp_sendmsg, ping_v4_sendmsg 2018-10-21 08:45:59 +01:00
proc.c net: clean up snmp stats code 2014-05-07 16:06:05 -04:00
protocol.c net: remove outdated comment for ipv4 and ipv6 protocol handler 2013-11-28 18:47:51 -05:00
raw.c net: ipv4: emulate READ_ONCE() on ->hdrincl bit-field in raw_sendmsg() 2018-03-03 15:52:19 +00:00
route.c ipv4: fix fnhe usage by non-cached routes 2018-10-21 08:45:52 +01:00
syncookies.c net: support marking accepting TCP sockets 2014-05-13 18:35:09 -04:00
sysctl_net_ipv4.c ipv4: use the right lock for ping_group_range 2017-02-23 03:54:19 +00:00
tcp.c tcp: fix TCP_REPAIR_QUEUE bound checking 2018-10-21 08:45:50 +01:00
tcp_bic.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_cong.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_cubic.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-12 13:19:14 -04:00
tcp_diag.c inet_diag: Rename inet_diag_req into inet_diag_req_v2 2012-01-11 12:56:06 -08:00
tcp_fastopen.c tcp: fix tcp_fastopen unaligned access complaints on sparc 2017-03-16 02:27:23 +00:00
tcp_highspeed.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_htcp.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_hybla.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_illinois.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_input.c tcp: don't read out-of-bounds opsize 2018-10-21 08:45:39 +01:00
tcp_ipv4.c tcp md5sig: Use skb's saddr when replying to an incoming segment 2018-03-03 15:51:53 +00:00
tcp_lp.c tcp: fix wraparound issue in tcp_lp 2017-08-26 02:14:44 +01:00
tcp_memcontrol.c cgroup: replace cftype->trigger() with cftype->write() 2014-05-13 12:16:21 -04:00
tcp_metrics.c tcp: convert cached rtt from usec to jiffies when feeding initial rto 2016-03-24 10:01:13 +00:00
tcp_minisocks.c tcp: account for ts offset only if tsecr not zero 2017-06-05 21:17:13 +01:00
tcp_offload.c net-gre-gro: Fix a bug that breaks the forwarding path 2014-07-16 14:45:26 -07:00
tcp_output.c tcp: purge write queue in tcp_connect_init() 2018-10-21 08:46:10 +01:00
tcp_probe.c tcp: switch rtt estimations to usec resolution 2014-02-26 17:08:40 -05:00
tcp_scalable.c tcp: remove in_flight parameter from cong_avoid() methods 2014-05-03 19:23:07 -04:00
tcp_timer.c tcp: snmp stats for Fast Open, SYN rtx, and data pkts 2014-03-03 15:58:03 -05:00
tcp_vegas.c tcp: Fix integer-overflow in TCP vegas 2014-08-14 10:09:43 +08:00
tcp_vegas.h net: ipv4/ipv6: Remove extern from function prototypes 2013-10-19 19:12:11 -04:00
tcp_veno.c tcp: Fix integer-overflows in TCP veno 2014-08-14 10:09:43 +08:00
tcp_westwood.c tcp: remove unused min_cwnd member of tcp_congestion_ops 2014-02-13 18:22:34 -05:00
tcp_yeah.c tcp_yeah: don't set ssthresh below 2 2016-01-28 10:49:49 +00:00
tunnel4.c net: Convert printks to pr_<level> 2012-03-11 23:42:51 -07:00
udp.c ipv4: fix memory leaks in udp_sendmsg, ping_v4_sendmsg 2018-10-21 08:45:59 +01:00
udp_diag.c udp_diag: Fix socket skipping within chain 2015-02-10 13:38:49 +00:00
udp_impl.h net: ipv4/ipv6: Remove extern from function prototypes 2013-10-19 19:12:11 -04:00
udp_offload.c net: avoid skb_warn_bad_offload false positives on UFO 2017-11-11 13:33:18 +00:00
udplite.c net: Eliminate no_check from protosw 2014-05-23 16:28:53 -04:00
xfrm4_input.c xfrm: Reinject transport-mode packets through tasklet 2018-03-03 15:52:02 +00:00
xfrm4_mode_beet.c ipv4: ERROR: code indent should use tabs where possible 2013-12-26 13:43:21 -05:00
xfrm4_mode_transport.c [IPSEC]: Use IPv6 calling convention as the convention for x->mode->output 2007-10-10 16:55:54 -07:00
xfrm4_mode_tunnel.c inetpeer: get rid of ip_id_count 2014-06-02 11:00:41 -07:00
xfrm4_output.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-24 00:32:30 -04:00
xfrm4_policy.c ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu 2018-06-16 22:22:39 +01:00
xfrm4_protocol.c xfrm4: Properly handle unsupported protocols 2014-04-29 08:41:12 +02:00
xfrm4_state.c inet: make no_pmtu_disc per namespace and kill ipv4_config 2013-12-18 16:58:20 -05:00
xfrm4_tunnel.c sit: add IPv4 over IPv4 support 2013-05-31 17:19:05 -07:00