You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/libhtp/htp
Victor Julien 0b68da0b31 libhtp: don't use internal iterator
It violates thread safety. #601.

Suricata assures thread safety on the flow level for HTTP tracking. Part of the flow is (in case of HTTP) libhtp's htp_connp_t state. At startup the libhtp glue layer, app-layer-htp initializes as many htp_cfg_t instances as there are libhtp server configurations in the yaml. At HTTP session start, we look up the proper htp_cfg_t based on the server ip and pass it to htp_connp_create.  A ptr to the relevant htp_cfg_t is part of the htp_connp_t. The htp_cfg_t contains "hooks". The are registered based on yaml config at init time.

The hooks have lists of type list_t. The list is run with a built in iterator. The iterator is reset at the start of each "hook_run_all". Since multiple flows share the same htp_cfg_t flow A can reset the iterator while flow B is using it. The flow lock has no effect as flows share the htp_cfg_t.

This has been observed in real traffic. hook_response_body_data was run on the same data multiple times, leading to corrupt extracted files.
13 years ago
..
Makefile.am Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
bstr.c libhtp: update to sync with upstream 0.2.x 14 years ago
bstr.h libhtp: update to sync with upstream 0.2.x 14 years ago
dslib.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
dslib.h Fix file permissions. 16 years ago
hooks.c libhtp: don't use internal iterator 13 years ago
hooks.h Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp.c Update libhtp to 0.2.6 15 years ago
htp.h htp: update version numbers of bundled htp 13 years ago
htp_config.c libhtp: update to sync with upstream 0.2.x 14 years ago
htp_connection.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp_connection_parser.c libhtp: update to sync with upstream 0.2.x 14 years ago
htp_decompressors.c Support FNAME and FCOMMENT extensions in gzip'd http content. 14 years ago
htp_decompressors.h Update libhtp to 0.2.6 15 years ago
htp_parsers.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp_request.c htp: keep track of header line terminators so http_raw_header can reconstruct exact headers. 14 years ago
htp_request_apache_2_2.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp_request_generic.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp_request_parsers.c Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago
htp_response.c htp: keep track of header line terminators so http_raw_header can reconstruct exact headers. 14 years ago
htp_response_generic.c Update bundled libhtp to 0.2.7. 14 years ago
htp_transaction.c http: add unittest to test \r in header line. 14 years ago
htp_util.c spelling corrections documented in redmine bug#533 13 years ago
utf8_decoder.c
utf8_decoder.h Update bundled libhtp to libhtp svn tag 0.2.5. 15 years ago