All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Matthias Andree <matthias.andree@gmx.de>
Cc: linux-net@vger.kernel.org, netfilter-devel@lists.netfilter.org,
	linux-kernel@vger.kernel.org
Subject: Re: [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps
Date: Thu, 04 Nov 2004 19:55:07 +0100	[thread overview]
Message-ID: <418A7B0B.7040803@trash.net> (raw)
In-Reply-To: <20041104121522.GA16547@merlin.emma.line.org>

Matthias Andree wrote:

>You can use "bk receive" to patch with this mail.
>
>BK: Parent repository is bk://linux.bkbits.net/linux-2.5
>
>Patch description:
>ChangeSet@1.2427, 2004-11-04 13:00:54+01:00, matthias.andree@gmx.de
>    Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps.
>  
>    Fix a bug where the ip_conntrack_amanda module replaces the first LF
>    after "CONNECT " by a NUL byte. This causes the UDP checksum to become
>    corrupt and strips off the OPTIONS argument from the received packet,
>    breaking amanda's sendbackup component altogether.  Replace the LF
>    character before releasing the buffer.
>  
>
The data that is changed is only a copy, the actual packet is not touched.

Regards
Patrick

>  
>    Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
>
>Matthias Andree
>
>------------------------------------------------------------------------
>
>##### DIFFSTAT #####
> ip_conntrack_amanda.c |   12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
>##### GNUPATCH #####
>--- 1.10/net/ipv4/netfilter/ip_conntrack_amanda.c	2004-08-19 02:14:53 +02:00
>+++ 1.11/net/ipv4/netfilter/ip_conntrack_amanda.c	2004-11-04 12:59:26 +01:00
>@@ -49,7 +49,7 @@
> {
> 	struct ip_conntrack_expect *exp;
> 	struct ip_ct_amanda_expect *exp_amanda_info;
>-	char *amp, *data, *data_limit, *tmp;
>+	char *amp, *data, *data_limit, *tmp, *le = 0;
> 	unsigned int dataoff, i;
> 	u_int16_t port, len;
> 
>@@ -83,9 +83,10 @@
> 		goto out;
> 	data += strlen("CONNECT ");
> 
>-	/* Only search first line. */	
>-	if ((tmp = strchr(data, '\n')))
>-		*tmp = '\0';
>+	/* Only search first line.
>+	 * NB: The change to the data must be reverted later! */
>+	if ((le = strchr(data, '\n')))
>+		*le = '\0';
> 
> 	for (i = 0; i < ARRAY_SIZE(conns); i++) {
> 		char *match = strstr(data, conns[i]);
>@@ -120,6 +121,9 @@
> 	}
> 
> out:
>+	/* replace LF character to repair the packet */
>+	if (le)
>+	    *le = '\n';
> 	UNLOCK_BH(&amanda_buffer_lock);
> 	return NF_ACCEPT;
> }
>
>  
>

WARNING: multiple messages have this Message-ID (diff)
From: Patrick McHardy <kaber@trash.net>
To: Matthias Andree <matthias.andree@gmx.de>
Cc: netfilter-devel@lists.netfilter.org, linux-net@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps
Date: Thu, 04 Nov 2004 19:55:07 +0100	[thread overview]
Message-ID: <418A7B0B.7040803@trash.net> (raw)
In-Reply-To: <20041104121522.GA16547@merlin.emma.line.org>

Matthias Andree wrote:

>You can use "bk receive" to patch with this mail.
>
>BK: Parent repository is bk://linux.bkbits.net/linux-2.5
>
>Patch description:
>ChangeSet@1.2427, 2004-11-04 13:00:54+01:00, matthias.andree@gmx.de
>    Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps.
>  
>    Fix a bug where the ip_conntrack_amanda module replaces the first LF
>    after "CONNECT " by a NUL byte. This causes the UDP checksum to become
>    corrupt and strips off the OPTIONS argument from the received packet,
>    breaking amanda's sendbackup component altogether.  Replace the LF
>    character before releasing the buffer.
>  
>
The data that is changed is only a copy, the actual packet is not touched.

Regards
Patrick

>  
>    Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
>
>Matthias Andree
>
>------------------------------------------------------------------------
>
>##### DIFFSTAT #####
> ip_conntrack_amanda.c |   12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
>##### GNUPATCH #####
>--- 1.10/net/ipv4/netfilter/ip_conntrack_amanda.c	2004-08-19 02:14:53 +02:00
>+++ 1.11/net/ipv4/netfilter/ip_conntrack_amanda.c	2004-11-04 12:59:26 +01:00
>@@ -49,7 +49,7 @@
> {
> 	struct ip_conntrack_expect *exp;
> 	struct ip_ct_amanda_expect *exp_amanda_info;
>-	char *amp, *data, *data_limit, *tmp;
>+	char *amp, *data, *data_limit, *tmp, *le = 0;
> 	unsigned int dataoff, i;
> 	u_int16_t port, len;
> 
>@@ -83,9 +83,10 @@
> 		goto out;
> 	data += strlen("CONNECT ");
> 
>-	/* Only search first line. */	
>-	if ((tmp = strchr(data, '\n')))
>-		*tmp = '\0';
>+	/* Only search first line.
>+	 * NB: The change to the data must be reverted later! */
>+	if ((le = strchr(data, '\n')))
>+		*le = '\0';
> 
> 	for (i = 0; i < ARRAY_SIZE(conns); i++) {
> 		char *match = strstr(data, conns[i]);
>@@ -120,6 +121,9 @@
> 	}
> 
> out:
>+	/* replace LF character to repair the packet */
>+	if (le)
>+	    *le = '\n';
> 	UNLOCK_BH(&amanda_buffer_lock);
> 	return NF_ACCEPT;
> }
>
>  
>


  reply	other threads:[~2004-11-04 18:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04 12:15 [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps Matthias Andree
2004-11-04 18:55 ` Patrick McHardy [this message]
2004-11-04 18:55   ` Patrick McHardy
2004-11-04 20:45   ` Herbert Xu
2004-11-04 20:45     ` Herbert Xu
2004-11-04 21:00     ` David S. Miller
2004-11-04 21:00       ` David S. Miller
2004-11-04 21:53       ` Patrick McHardy
2004-11-04 21:53         ` Patrick McHardy
2004-11-04 23:50         ` Matthias Andree
2004-11-04 23:50           ` Matthias Andree
2004-11-04 23:59           ` Patrick McHardy
2004-11-04 23:59             ` Patrick McHardy
2004-11-04 23:17   ` Matthias Andree
2004-11-04 23:17     ` Matthias Andree
2004-11-04 23:53     ` Patrick McHardy
2004-11-04 23:53       ` Patrick McHardy
2004-11-05  0:06       ` David S. Miller
2004-11-05  0:06         ` David S. Miller
2004-11-05  0:40         ` Patrick McHardy
2004-11-05  0:40           ` Patrick McHardy
2004-11-05  1:04         ` Matthias Andree
2004-11-05  1:04           ` Matthias Andree
2004-11-05  0:58           ` David S. Miller
2004-11-05  0:58             ` David S. Miller
2004-11-05 11:30             ` Matthias Andree
2004-11-05 11:30               ` Matthias Andree
2004-11-05 20:23       ` Pablo Neira
2004-11-05 22:19         ` Patrick McHardy
2004-11-05 22:19           ` Patrick McHardy
2004-11-06  1:53           ` Pablo Neira
2004-11-06  1:53             ` Pablo Neira
2004-11-07 12:16           ` Matthias Andree
2004-11-07 16:39             ` Patrick McHardy
2004-11-05 22:24         ` Henrik Nordstrom
2004-11-05 22:24           ` Henrik Nordstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=418A7B0B.7040803@trash.net \
    --to=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --cc=matthias.andree@gmx.de \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.