]> The Tcpdump Group git mirrors - tcpdump/commit
Add a sanity check on packet header length
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 25 Jan 2018 19:36:16 +0000 (20:36 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 7 Feb 2018 17:48:49 +0000 (18:48 +0100)
commitf253e110096ed673dc9de26da43ca80eaa2baec1
tree653cd4d65e298345866b9020cc1a737384fc97a3
parentfb154b00bad613756c18c56dd01bbb37e78f1b22
Add a sanity check on packet header length

The packet length must be <= MAXIMUM_SNAPLEN.

Currently, there is no D-Bus printer, thus no need for a bigger length.

Now a pachet is valid if:
capture length != 0,
packet length != 0,
capture length <= MAXIMUM_SNAPLEN,
packet length <= MAXIMUM_SNAPLEN,
packet length >= capture length.

Moreover:
Fix the packet header lengths of some fuzzed pcap files:
If the lengths are > MAXIMUM_SNAPLEN, set them to MAXIMUM_SNAPLEN.
Thus they will be always usable with this new sanity check.
168 files changed:
print.c
tests/aarp-heapoverflow-1.pcap
tests/aarp-heapoverflow-2.pcap
tests/arp-too-long-tha.out
tests/arp-too-long-tha.pcap
tests/atm-heapoverflow.pcap
tests/atm-oam-heapoverflow.pcap
tests/bad-ipv4-version-pgm-heapoverflow.pcap
tests/beep-oobr.pcap
tests/bgp_mvpn_6_and_7.pcap
tests/bgp_pmsi_tunnel-oobr.pcap
tests/bgp_vpn_rt-oobr.pcap
tests/calm-fast-mac-lookup-heapoverflow.pcap
tests/cve2015-0261-crash.pcap
tests/decnet-oobr.out
tests/decnet-oobr.pcap
tests/decnet-shorthdr-oobr.out
tests/decnet-shorthdr-oobr.pcap
tests/dhcp6_reconf_asan.pcap
tests/eap_extract_read2_asan.pcap
tests/esis_opt_prot-oobr.out
tests/esis_opt_prot-oobr.pcap
tests/esis_snpa_asan-3.out
tests/esis_snpa_asan-3.pcap
tests/esis_snpa_asan-4.out
tests/esis_snpa_asan-4.pcap
tests/frf15-heapoverflow.pcap
tests/geonet-mac-lookup-heapoverflow.pcap
tests/gre-heapoverflow-1.out
tests/gre-heapoverflow-1.pcap
tests/gre-heapoverflow-2.out
tests/gre-heapoverflow-2.pcap
tests/heap-overflow-1.pcap
tests/heap-overflow-2.pcap
tests/heapoverflow-EXTRACT_16BITS.pcap
tests/heapoverflow-atalk_print.pcap
tests/heapoverflow-in_checksum.pcap
tests/heapoverflow-ip_print_demux.out
tests/heapoverflow-ip_print_demux.pcap
tests/heapoverflow-ppp_hdlc_if_print.pcap
tests/heapoverflow-q933_printq.out
tests/heapoverflow-q933_printq.pcap
tests/heapoverflow-sl_if_print.pcap
tests/heapoverflow-tcp_print.pcap
tests/hncp_dhcpv6data-oobr.pcap
tests/hoobr_aodv_extension.pcap
tests/hoobr_chdlc_print.pcap
tests/hoobr_juniper.out
tests/hoobr_juniper.pcap
tests/hoobr_juniper2.pcap
tests/hoobr_juniper3.pcap
tests/hoobr_juniper4.out
tests/hoobr_juniper4.pcap
tests/hoobr_lookup_nsap.out
tests/hoobr_lookup_nsap.pcap
tests/hoobr_nfs_printfh.out
tests/hoobr_nfs_printfh.pcap
tests/hoobr_nfs_xid_map_enter.out
tests/hoobr_nfs_xid_map_enter.pcap
tests/hoobr_parse_field.out
tests/hoobr_parse_field.pcap
tests/hoobr_pimv1.out
tests/hoobr_pimv1.pcap
tests/hoobr_ripng_print.pcap
tests/hoobr_rt6_print.pcap
tests/hoobr_safeputs.out
tests/hoobr_safeputs.pcap
tests/ieee802.11_rates_oobr.pcap
tests/ieee802.11_tim_ie_oobr.pcap
tests/ikev1_id_ipv6_addr_subnet-oobr.pcap
tests/ip6_frag_asan.pcap
tests/ip_printroute_asan.pcap
tests/ip_ts_opts_asan.pcap
tests/ipcomp-heapoverflow.pcap
tests/ipv6-mobility-header-oobr.pcap
tests/ipv6-next-header-oobr-1.pcap
tests/ipv6-next-header-oobr-2.pcap
tests/ipv6-rthdr-oobr.pcap
tests/ipv6hdr-heapoverflow.pcap
tests/isakmp-3948-oobr-2.pcap
tests/isakmp-rfc3948-oobr.out
tests/isakmp-rfc3948-oobr.pcap
tests/isakmp-various-oobr.pcap
tests/isakmpv1-attr-oobr.pcap
tests/isis-extd-isreach-oobr.out
tests/isis-extd-isreach-oobr.pcap
tests/isis_stlv_asan-2.out
tests/isis_stlv_asan-2.pcap
tests/isis_stlv_asan-3.out
tests/isis_stlv_asan-3.pcap
tests/isis_stlv_asan-4.out
tests/isis_stlv_asan-4.pcap
tests/isis_stlv_asan.out
tests/isis_stlv_asan.pcap
tests/isis_sysid_asan.out
tests/isis_sysid_asan.pcap
tests/isoclns-heapoverflow-2.out
tests/isoclns-heapoverflow-2.pcap
tests/isoclns-heapoverflow-3.out
tests/isoclns-heapoverflow-3.pcap
tests/isoclns-heapoverflow.pcap
tests/isoclns-oobr.pcap
tests/juniper_atm1.out
tests/juniper_atm1.pcap
tests/juniper_es.out
tests/juniper_es.pcap
tests/juniper_header-heapoverflow.out
tests/juniper_header-heapoverflow.pcap
tests/kday6.out
tests/kday6.pcap
tests/l2tp-avp-overflow.out
tests/l2tp-avp-overflow.pcap
tests/llc-xid-heapoverflow.out
tests/llc-xid-heapoverflow.pcap
tests/lldp_8023_mtu-oobr.out
tests/lldp_8023_mtu-oobr.pcap
tests/lldp_mgmt_addr_tlv_asan.out
tests/lldp_mgmt_addr_tlv_asan.pcap
tests/mlppp-oobr.pcap
tests/mpls-label-heapoverflow.pcap
tests/nfs-attr-oobr.out
tests/nfs-attr-oobr.pcap
tests/olsr-oobr-2.pcap
tests/oobr_parse_elements.pcap
tests/ospf6_decode_v3_asan.pcap
tests/pgm_group_addr_asan.pcap
tests/pgm_opts_asan.pcap
tests/pgm_opts_asan_2.pcap
tests/pgm_opts_asan_3.pcap
tests/pim_header_asan-2.pcap
tests/pim_header_asan-4.out
tests/pim_header_asan-4.pcap
tests/pim_header_asan.pcap
tests/pktap-heap-overflow.out
tests/pktap-heap-overflow.pcap
tests/radiotap-heapoverflow.pcap
tests/radius_attr_asan.pcap
tests/relts-0x80000000.pcap
tests/rsvp_fast_reroute-oobr.pcap
tests/rsvp_uni-oobr-1.pcap
tests/rsvp_uni-oobr-2.pcap
tests/rsvp_uni-oobr-3.pcap
tests/slip-bad-direction.pcap
tests/snmp-heapoverflow-1.out
tests/snmp-heapoverflow-1.pcap
tests/snmp-heapoverflow-2.pcap
tests/stp-heapoverflow-1.out
tests/stp-heapoverflow-1.pcap
tests/stp-heapoverflow-2.out
tests/stp-heapoverflow-2.pcap
tests/stp-heapoverflow-3.out
tests/stp-heapoverflow-3.pcap
tests/stp-heapoverflow-4.out
tests/stp-heapoverflow-4.pcap
tests/stp-v4-length-sigsegv.out
tests/stp-v4-length-sigsegv.pcap
tests/tcp-auth-heapoverflow.pcap
tests/tcp_header_heapoverflow.pcap
tests/tftp-heapoverflow.pcap
tests/udp-length-heapoverflow.pcap
tests/vqp-oobr.pcap
tests/vtp_asan-2.out
tests/vtp_asan-2.pcap
tests/vtp_asan-3.out
tests/vtp_asan-3.pcap
tests/vtp_asan.out
tests/vtp_asan.pcap
tests/wb-oobr.pcap