From: Patrick McHardy <kaber@trash.net>
To: stable@kernel.org
Cc: Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH -stable 01/02]: textsearch: fix Boyer-Moore text search bug
Date: Mon, 07 Jul 2008 15:56:57 +0200 [thread overview]
Message-ID: <487220A9.7000606@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
These two patches for -stable fix a bug in the BM textsearch
algorithm, leading to false negatives, and packets incorrectly
marked as INVALID by TCP conntrack.
Please apply, thanks.
[-- Attachment #2: 01.diff --]
[-- Type: text/x-diff, Size: 1317 bytes --]
textsearch: fix Boyer-Moore text search bug
Upstream commit aebb6a8:
The current logic has a bug which cannot find matching pattern, if the
pattern is matched from the first character of target string.
for example:
pattern=abc, string=abcdefg
pattern=a, string=abcdefg
Searching algorithm should return 0 for those things.
Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
commit 44e450bf173eee791911a56f7e65a30d94608cea
tree 9be6fda8b20945d835a0dc6b466341f6cd9132e9
parent 76605033bb81028b4c603a324dcec6793b7da8ae
author Joonwoo Park <joonwpark81@gmail.com> Mon, 07 Jul 2008 15:52:15 +0200
committer Patrick McHardy <kaber@trash.net> Mon, 07 Jul 2008 15:52:15 +0200
lib/ts_bm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/ts_bm.c b/lib/ts_bm.c
index d90822c..4a7fce7 100644
--- a/lib/ts_bm.c
+++ b/lib/ts_bm.c
@@ -63,7 +63,7 @@ static unsigned int bm_find(struct ts_config *conf, struct ts_state *state)
struct ts_bm *bm = ts_config_priv(conf);
unsigned int i, text_len, consumed = state->offset;
const u8 *text;
- int shift = bm->patlen, bs;
+ int shift = bm->patlen - 1, bs;
for (;;) {
text_len = conf->get_next_block(consumed, &text, conf, state);
next reply other threads:[~2008-07-07 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-07 13:56 Patrick McHardy [this message]
2008-07-17 5:42 ` patch textsearch-fix-boyer-moore-text-search-bug.patch added to 2.6.25-stable tree gregkh
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=487220A9.7000606@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=stable@kernel.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