No description
Find a file
Jeremy Sowden d624b93ff7 lib/ts_bm: reset initial match offset for every block of text
[ Upstream commit 6f67fbf819 ]

The `shift` variable which indicates the offset in the string at which
to start matching the pattern is initialized to `bm->patlen - 1`, but it
is not reset when a new block is retrieved.  This means the implemen-
tation may start looking at later and later positions in each successive
block and miss occurrences of the pattern at the beginning.  E.g.,
consider a HTTP packet held in a non-linear skb, where the HTTP request
line occurs in the second block:

  [... 52 bytes of packet headers ...]
  GET /bmtest HTTP/1.1\r\nHost: www.example.com\r\n\r\n

and the pattern is "GET /bmtest".

Once the first block comprising the packet headers has been examined,
`shift` will be pointing to somewhere near the end of the block, and so
when the second block is examined the request line at the beginning will
be missed.

Reinitialize the variable for each new block.

Fixes: 8082e4ed0a ("[LIB]: Boyer-Moore extension for textsearch infrastructure strike #2")
Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1390
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-11 11:45:07 +02:00
arch ARM: 9303/1: kprobes: avoid missing-declaration warnings 2023-08-11 11:45:03 +02:00
block block: bio-integrity: Copy flags when bio_integrity_payload is cloned 2023-03-11 16:31:33 +01:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-25 11:49:16 +02:00
crypto crypto: drbg - Only fail when jent is unavailable in FIPS mode 2023-05-17 11:13:13 +02:00
Documentation Documentation/x86: Fix backwards on/off logic about YMM support 2023-08-08 19:49:19 +02:00
drivers gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-08-11 11:45:07 +02:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:21:29 +01:00
fs treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
include watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config 2023-08-11 11:45:06 +02:00
init init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() 2023-08-08 19:49:18 +02:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:18:35 +01:00
kernel kexec: fix a memory leak in crash_shrink_memory() 2023-08-11 11:45:06 +02:00
lib lib/ts_bm: reset initial match offset for every block of text 2023-08-11 11:45:07 +02:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
net netlink: do not hard code device address lenth in fdb dumps 2023-08-11 11:45:06 +02:00
samples samples/bpf: Fix buffer overflow in tcp_basertt 2023-08-11 11:45:03 +02:00
scripts scripts/tags.sh: Resolve gtags empty index generation 2023-08-11 11:45:01 +02:00
security evm: Complete description of evm_inode_setattr() 2023-08-11 11:45:03 +02:00
sound treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
tools selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET 2023-06-21 15:39:59 +02:00
usr initramfs: restore default compression behavior 2020-04-13 10:44:59 +02:00
virt KVM: arm64: vgic: Fix exit condition in scan_its_table() 2022-11-03 23:52:24 +09:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS clocksource/drivers: Unify the names to timer-* format 2023-08-11 11:45:02 +02:00
Makefile Linux 4.19.290 2023-08-08 19:49:19 +02:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.