linux/net/ipv4/netfilter
Jozsef Kadlecsik 07153c6ec0 netfilter: nf_ct_ipv4: packets with wrong ihl are invalid
It was reported that the Linux kernel sometimes logs:

klogd: [2629147.402413] kernel BUG at net / netfilter /
nf_conntrack_proto_tcp.c: 447!
klogd: [1072212.887368] kernel BUG at net / netfilter /
nf_conntrack_proto_tcp.c: 392

ipv4_get_l4proto() in nf_conntrack_l3proto_ipv4.c and tcp_error() in
nf_conntrack_proto_tcp.c should catch malformed packets, so the errors
at the indicated lines - TCP options parsing - should not happen.
However, tcp_error() relies on the "dataoff" offset to the TCP header,
calculated by ipv4_get_l4proto().  But ipv4_get_l4proto() does not check
bogus ihl values in IPv4 packets, which then can slip through tcp_error()
and get caught at the TCP options parsing routines.

The patch fixes ipv4_get_l4proto() by invalidating packets with bogus
ihl value.

The patch closes netfilter bugzilla id 771.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-04-10 12:50:49 +02:00
..
arp_tables.c
arpt_mangle.c
arptable_filter.c
ip_queue.c Merge branch 'for-linus' of git://selinuxproject.org/~jmorris/linux-security 2012-01-14 18:36:33 -08:00
ip_tables.c
ipt_ah.c
ipt_CLUSTERIP.c netfilter: Remove unnecessary OOM logging messages 2011-11-01 09:19:49 +01:00
ipt_ECN.c
ipt_MASQUERADE.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
ipt_NETMAP.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
ipt_REDIRECT.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
ipt_REJECT.c
ipt_rpfilter.c netfilter: add ipv4 reverse path filter match 2011-12-04 22:43:37 +01:00
ipt_ULOG.c module_param: make bool parameters really bool (net & drivers/net) 2011-12-19 22:27:29 -05:00
iptable_filter.c netfilter: remove forward module param confusion. 2012-03-22 22:36:17 -04:00
iptable_mangle.c
iptable_raw.c
iptable_security.c
Kconfig netfilter: merge ipt_LOG and ip6_LOG into xt_LOG 2012-03-07 17:40:49 +01:00
Makefile netfilter: merge ipt_LOG and ip6_LOG into xt_LOG 2012-03-07 17:40:49 +01:00
nf_conntrack_l3proto_ipv4_compat.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
nf_conntrack_l3proto_ipv4.c netfilter: nf_ct_ipv4: packets with wrong ihl are invalid 2012-04-10 12:50:49 +02:00
nf_conntrack_proto_icmp.c netfilter: add cttimeout infrastructure for fine timeout tuning 2012-03-07 17:41:22 +01:00
nf_defrag_ipv4.c
nf_nat_amanda.c
nf_nat_core.c netfilter: ctnetlink: allow to set expectfn for expectations 2012-03-07 17:40:46 +01:00
nf_nat_ftp.c
nf_nat_h323.c netfilter: ctnetlink: allow to set expectfn for expectations 2012-03-07 17:40:46 +01:00
nf_nat_helper.c netfilter: nf_nat: remove obsolete check in nf_nat_mangle_udp_packet() 2011-12-23 14:36:46 +01:00
nf_nat_irc.c
nf_nat_pptp.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
nf_nat_proto_common.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_dccp.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_gre.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_icmp.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_sctp.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_tcp.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_udp.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_udplite.c netfilter: ctnetlink: remove dead NAT code 2011-12-23 14:36:46 +01:00
nf_nat_proto_unknown.c netfilter: nat: remove module reference counting from NAT protocols 2011-12-23 14:36:45 +01:00
nf_nat_rule.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
nf_nat_sip.c netfilter: ctnetlink: allow to set expectfn for expectations 2012-03-07 17:40:46 +01:00
nf_nat_snmp_basic.c netfilter: Remove unnecessary OOM logging messages 2011-11-01 09:19:49 +01:00
nf_nat_standalone.c netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
nf_nat_tftp.c