netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: andrei.popa@i-neo.ro, netfilter-devel@vger.kernel.org
Subject: Re: [oops] in text matching
Date: Wed, 28 Nov 2007 19:38:39 +0100	[thread overview]
Message-ID: <474DB5AF.7080907@trash.net> (raw)
In-Reply-To: <474DA03B.8050400@netfilter.org>

Pablo Neira Ayuso wrote:
> Patrick McHardy wrote:
>> Pablo Neira Ayuso wrote:
>>>> Pablo? I would prefer to get this fixed before 2.6.24, unless
>>>> there's a better fix I'm going to include my patch to reject
>>>> pattern lengths of 0. Thanks.
>>> Sorry for the late reply. Why should we accept zero length patterns?
>>> Would you consider this patch? It keeps consistent the return value of
>>> all textsearch approaches when a zero length pattern is passed.
>> The other ones actually seem to handle it fine, and I think
>> it should actually behave similar to memcmp or strcmp, so I'd
>> prefer a patch to handle it properly by always matching.
> 
> Indeed, KMP supports zero length patterns but I don't know how :).
> kmp_find() accesses kmp->pattern[0] -which actually points 4 bytes out
> of the ts_config structure- to compare it with text[i], then if those 4
> bytes doesn't match text[i], then returns a matching at position 1.


Indeed, it doesn't seem to handle it properly too.

> I think that a zero length pattern is a unspecified entry that we should
> reject. Also, returning some error to tell the user that is passing a
> zero length pattern -something that is probably what he didn't really
> want as it happens to Andrei.
> 
> I can cook a patch for iptables to reject zero length pattern with a
> nice error message, thus avoiding the EINVAL that will probably go nuts
> users.


Well, in that case I'll take your last patch, its textsearch which
is broken, not iptables :)

  reply	other threads:[~2007-11-28 18:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 12:40 [oops] in text matching Andrei Popa
2007-11-08 13:32 ` Patrick McHardy
2007-11-08 18:50   ` Andrei Popa
2007-11-08 18:53     ` Andrei Popa
2007-11-08 19:06       ` Andrei Popa
2007-11-10 12:57     ` Patrick McHardy
2007-11-13  6:51       ` Andrei Popa
2007-11-13  6:56         ` Patrick McHardy
2007-11-25 15:38           ` Patrick McHardy
2007-11-25 19:30             ` Pablo Neira Ayuso
2007-11-26  7:43               ` Patrick McHardy
2007-11-28 17:07                 ` Pablo Neira Ayuso
2007-11-28 18:38                   ` Patrick McHardy [this message]
2007-11-29 23:51               ` Patrick McHardy

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=474DB5AF.7080907@trash.net \
    --to=kaber@trash.net \
    --cc=andrei.popa@i-neo.ro \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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 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).