* [PATCH 0/2] TCP conntrack fixes in TCP option handling
@ 2011-08-30 13:35 Jozsef Kadlecsik
2011-08-30 13:35 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Jozsef Kadlecsik
0 siblings, 1 reply; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-08-30 13:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: Patrick McHardy, Pablo Neira Ayuso, Jozsef Kadlecsik
Hi Patrick,
Michael M. Builov reported several problems with the TCP option handling
code in the TCP connection tracking code. The next patches, based on his
suggestions, solve all the issues. Please apply them as bugfixes.
Best regards,
Jozsef
Jozsef Kadlecsik (2):
Incorrect handling of invalid TCP option in TCP connection tracking
Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips
fastpath
net/netfilter/nf_conntrack_proto_tcp.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking
2011-08-30 13:35 [PATCH 0/2] TCP conntrack fixes in TCP option handling Jozsef Kadlecsik
@ 2011-08-30 13:35 ` Jozsef Kadlecsik
2011-08-30 13:35 ` [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath Jozsef Kadlecsik
2011-08-30 13:45 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Patrick McHardy
0 siblings, 2 replies; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-08-30 13:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: Patrick McHardy, Pablo Neira Ayuso, Jozsef Kadlecsik
Michael M. Builov reported that in the tcp_options and tcp_sack functions
of netfilter TCP conntrack the incorrect handling of invalid TCP option
with too big opsize may lead to read access beyond tcp-packet or buffer
allocated on stack (netfilter bugzilla #738). The fix is to stop parsing
the options at detecting the broken option.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
net/netfilter/nf_conntrack_proto_tcp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 37bf943..afc4ab7 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -409,7 +409,7 @@ static void tcp_options(const struct sk_buff *skb,
if (opsize < 2) /* "silly options" */
return;
if (opsize > length)
- break; /* don't parse partial options */
+ return; /* don't parse partial options */
if (opcode == TCPOPT_SACK_PERM
&& opsize == TCPOLEN_SACK_PERM)
@@ -469,7 +469,7 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
if (opsize < 2) /* "silly options" */
return;
if (opsize > length)
- break; /* don't parse partial options */
+ return; /* don't parse partial options */
if (opcode == TCPOPT_SACK
&& opsize >= (TCPOLEN_SACK_BASE
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath
2011-08-30 13:35 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Jozsef Kadlecsik
@ 2011-08-30 13:35 ` Jozsef Kadlecsik
2011-08-30 13:46 ` Patrick McHardy
2011-08-30 13:45 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Patrick McHardy
1 sibling, 1 reply; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-08-30 13:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: Patrick McHardy, Pablo Neira Ayuso, Jozsef Kadlecsik
The wrong multiplication of TCPOLEN_TSTAMP_ALIGNED by 4 skips the fast path
for the timestamp-only option. Bug reported by Michael M. Builov (netfilter
bugzilla #738).
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
net/netfilter/nf_conntrack_proto_tcp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index afc4ab7..8235b86 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -447,7 +447,7 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
BUG_ON(ptr == NULL);
/* Fast path for timestamp-only option */
- if (length == TCPOLEN_TSTAMP_ALIGNED*4
+ if (length == TCPOLEN_TSTAMP_ALIGNED
&& *(__be32 *)ptr == htonl((TCPOPT_NOP << 24)
| (TCPOPT_NOP << 16)
| (TCPOPT_TIMESTAMP << 8)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking
2011-08-30 13:35 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Jozsef Kadlecsik
2011-08-30 13:35 ` [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath Jozsef Kadlecsik
@ 2011-08-30 13:45 ` Patrick McHardy
1 sibling, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2011-08-30 13:45 UTC (permalink / raw)
To: Jozsef Kadlecsik; +Cc: netfilter-devel, Pablo Neira Ayuso
On 30.08.2011 15:35, Jozsef Kadlecsik wrote:
> Michael M. Builov reported that in the tcp_options and tcp_sack functions
> of netfilter TCP conntrack the incorrect handling of invalid TCP option
> with too big opsize may lead to read access beyond tcp-packet or buffer
> allocated on stack (netfilter bugzilla #738). The fix is to stop parsing
> the options at detecting the broken option.
Applied, thanks Jozsef.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath
2011-08-30 13:35 ` [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath Jozsef Kadlecsik
@ 2011-08-30 13:46 ` Patrick McHardy
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2011-08-30 13:46 UTC (permalink / raw)
To: Jozsef Kadlecsik; +Cc: netfilter-devel, Pablo Neira Ayuso
On 30.08.2011 15:35, Jozsef Kadlecsik wrote:
> The wrong multiplication of TCPOLEN_TSTAMP_ALIGNED by 4 skips the fast path
> for the timestamp-only option. Bug reported by Michael M. Builov (netfilter
> bugzilla #738).
>
> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Also applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-30 13:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30 13:35 [PATCH 0/2] TCP conntrack fixes in TCP option handling Jozsef Kadlecsik
2011-08-30 13:35 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Jozsef Kadlecsik
2011-08-30 13:35 ` [PATCH 2/2] Wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath Jozsef Kadlecsik
2011-08-30 13:46 ` Patrick McHardy
2011-08-30 13:45 ` [PATCH 1/2] Incorrect handling of invalid TCP option in TCP connection tracking Patrick McHardy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).