All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@eurodev.net>
To: Patrick McHardy <kaber@trash.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Henrik Nordstrom <hno@marasystems.com>,
	netfilter-devel@lists.netfilter.org,
	linux-kernel@vger.kernel.org, linux-net@vger.kernel.org,
	"David S. Miller" <davem@redhat.com>
Subject: Re: [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps
Date: Sat, 06 Nov 2004 02:53:46 +0100	[thread overview]
Message-ID: <418C2EAA.7050507@eurodev.net> (raw)
In-Reply-To: <418BFC5C.20201@trash.net>

Patrick McHardy wrote:

> Pablo Neira wrote:
>
>> Patrick, what about this? this way we save a copy to a buffer for 
>> linear skbs.
>>
>> Signed-off-by: Pablo Neira Ayuso <pablo@eurodev.net>
>>
>> @@ -74,12 +75,17 @@
>>                  skb->len - dataoff, amanda_buffer);
>>     BUG_ON(amp == NULL);
>>     data = amp;
>> -    data_limit = amp + skb->len - dataoff;
>> -    *data_limit = '\0';
>>
>>     /* Search for the CONNECT string */
>> -    data = strstr(data, "CONNECT ");
>> -    if (!data)
>> +    while((data = memchr(data, 'C', skb->len - dataoff)) != NULL) {
>> +        if (strncmp(data, "CONNECT ", 8) == 0) {
>>  
>>
> What if the C is the last byte ? There are also more str* commands below
> that need a terminating 0-byte.


you both are right. Patrick's patch is the best way to fix this problem.

Pablo

WARNING: multiple messages have this Message-ID (diff)
From: Pablo Neira <pablo@eurodev.net>
To: Patrick McHardy <kaber@trash.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	netfilter-devel@lists.netfilter.org,
	linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@redhat.com>,
	linux-net@vger.kernel.org, Henrik Nordstrom <hno@marasystems.com>
Subject: Re: [BK PATCH] Fix ip_conntrack_amanda data corruption bug that breaks amanda dumps
Date: Sat, 06 Nov 2004 02:53:46 +0100	[thread overview]
Message-ID: <418C2EAA.7050507@eurodev.net> (raw)
In-Reply-To: <418BFC5C.20201@trash.net>

Patrick McHardy wrote:

> Pablo Neira wrote:
>
>> Patrick, what about this? this way we save a copy to a buffer for 
>> linear skbs.
>>
>> Signed-off-by: Pablo Neira Ayuso <pablo@eurodev.net>
>>
>> @@ -74,12 +75,17 @@
>>                  skb->len - dataoff, amanda_buffer);
>>     BUG_ON(amp == NULL);
>>     data = amp;
>> -    data_limit = amp + skb->len - dataoff;
>> -    *data_limit = '\0';
>>
>>     /* Search for the CONNECT string */
>> -    data = strstr(data, "CONNECT ");
>> -    if (!data)
>> +    while((data = memchr(data, 'C', skb->len - dataoff)) != NULL) {
>> +        if (strncmp(data, "CONNECT ", 8) == 0) {
>>  
>>
> What if the C is the last byte ? There are also more str* commands below
> that need a terminating 0-byte.


you both are right. Patrick's patch is the best way to fix this problem.

Pablo

  reply	other threads:[~2004-11-06  1:53 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
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 [this message]
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=418C2EAA.7050507@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=davem@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hno@marasystems.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --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.