* [PATCH -stable 01/02]: textsearch: fix Boyer-Moore text search bug
@ 2008-07-07 13:56 Patrick McHardy
2008-07-17 5:42 ` patch textsearch-fix-boyer-moore-text-search-bug.patch added to 2.6.25-stable tree gregkh
0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2008-07-07 13:56 UTC (permalink / raw)
To: stable; +Cc: Netfilter Development Mailinglist, David S. Miller
[-- 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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* patch textsearch-fix-boyer-moore-text-search-bug.patch added to 2.6.25-stable tree
2008-07-07 13:56 [PATCH -stable 01/02]: textsearch: fix Boyer-Moore text search bug Patrick McHardy
@ 2008-07-17 5:42 ` gregkh
0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2008-07-17 5:42 UTC (permalink / raw)
To: joonwpark81, davem, kaber, netfilter-devel; +Cc: stable, stable-commits
This is a note to let you know that we have just queued up the patch titled
Subject: textsearch: fix Boyer-Moore text search bug
to the 2.6.25-stable tree. Its filename is
textsearch-fix-boyer-moore-text-search-bug.patch
A git repo of this tree can be found at
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>From stable-bounces@linux.kernel.org Wed Jul 16 22:27:41 2008
From: Joonwoo Park <joonwpark81@gmail.com>
Date: Mon, 07 Jul 2008 15:56:57 +0200
Subject: textsearch: fix Boyer-Moore text search bug
To: stable@kernel.org
Cc: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>, "David S. Miller" <davem@davemloft.net>
Message-ID: <487220A9.7000606@trash.net>
From: Joonwoo Park <joonwpark81@gmail.com>
Upstream commit aebb6a849cfe7d89bcacaaecc20a480dfc1180e7
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>
---
lib/ts_bm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/ts_bm.c
+++ b/lib/ts_bm.c
@@ -63,7 +63,7 @@ static unsigned int bm_find(struct ts_co
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);
Patches currently in stable-queue which might be from joonwpark81@gmail.com are
queue-2.6.25/textsearch-fix-boyer-moore-text-search-bug.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-17 5:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 13:56 [PATCH -stable 01/02]: textsearch: fix Boyer-Moore text search bug Patrick McHardy
2008-07-17 5:42 ` patch textsearch-fix-boyer-moore-text-search-bug.patch added to 2.6.25-stable tree gregkh
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.