All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.