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
..
2012-03-28 18:30:03 +01:00
2012-03-28 15:58:21 -07:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2011-10-19 03:10:46 -04:00
2012-03-08 00:30:32 -08:00
2012-03-11 23:42:51 -07:00
2012-03-11 23:42:51 -07:00
2012-03-11 23:42:51 -07:00
2012-03-28 18:30:03 +01:00
2011-12-12 19:04:10 -05:00
2012-03-28 18:30:03 +01:00
2012-03-19 16:53:08 -04:00
2012-03-11 23:42:51 -07:00
2012-03-11 15:52:12 -07:00
2012-01-20 14:17:26 -05:00
2012-01-20 14:17:26 -05:00
2011-03-31 11:26:23 -03:00
2012-01-31 12:14:00 -05:00
2011-03-31 11:26:23 -03:00
2012-03-11 23:42:51 -07:00
2012-01-17 10:31:12 -05:00
2012-03-28 18:30:03 +01:00
2010-07-12 12:57:54 -07:00